Skip to content

Commit 98f76a6

Browse files
committed
PHPStan Fixes
1 parent adc1d20 commit 98f76a6

5 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/Google/GoogleClassroom.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class GoogleClassroom {
99

1010
/**
1111
* Returns an authorized Clasroom API client.
12-
* @return Google_Client the authorized client object
12+
* @return \Google_Client the authorized client object
1313
*/
1414
public static function getClient($accessTokenStr, $user_id=false) {
1515
global $CFG, $PDOX;

src/UI/CrudForm.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public static function insertForm($fields, $from_location, $titles=false, $field
9393
*
9494
* @param $fields An array of fields to be inserted. These items must be
9595
* in the $_POST data as well.
96-
* @return int Returns the constant for SUCCESS, FAIL, or NONE
96+
* @return array|int Returns the fetched row array or the constant for SUCCESS, FAIL, or NONE
9797
*/
9898
public static function handleInsert($tablename, $fields) {
9999
global $PDOX;

src/Util/LTI13.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1266,7 +1266,7 @@ public static function build_jwt_html($launch_url, $jws, $dodebug=true, $extra=f
12661266
* @param string $publicKey Returned public key
12671267
* @param string $privateKey Returned private key
12681268
*
1269-
* @return string or true If there was an error, we return it, on success return true
1269+
* @return string|true If there was an error, we return it, on success return true
12701270
*/
12711271
// https://stackoverflow.com/questions/6648337/generate-ssh-keypair-form-php
12721272
public static function generatePKCS8Pair(&$publicKey, &$privateKey) {

src/Util/U.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ public static function createGUID() {
700700
}
701701

702702
public static function isGUIDValid($guid) {
703-
return (preg_match("/^(\{)?[a-f\d]{8}(-[a-f\d]{4}){4}[a-f\d]{8}(?(1)\})$/i", $guid)
703+
return (preg_match("/^(\{)?[a-f\d]{8}(-[a-f\d]{4}){3}-[a-f\d]{12}(?(1)\})$/i", $guid)
704704
? true : false);
705705
}
706706

@@ -737,7 +737,7 @@ public static function strlen($string) : int {
737737
if ( $string === false ) return 0;
738738
if ( $string === NULL ) return 0;
739739
if ( is_numeric($string) ) $string = $string . '';
740-
if ( $string instanceof Stringable ) $string = $string . '';
740+
if ( $string instanceof \Stringable ) $string = $string . '';
741741
if ( !is_string($string) ) return 0;
742742
return strlen($string);
743743
}

util/unsubscribe.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
</p>
6565
<form method="post" action="unsubscribe.php">
6666
<input type="hidden" name="id" value="<?php echo($id); ?>">
67-
<input type="hidden" name="token" value="<?php echo(htmlencode($token)); ?>">
67+
<input type="hidden" name="token" value="<?php echo(htmlent_utf8($token)); ?>">
6868
<input type="submit" value="Unsubscribe">
6969
</form>
7070
<p>

0 commit comments

Comments
 (0)