phpstan checks for level 9
This commit is contained in:
@@ -9,7 +9,7 @@ parameters:
|
||||
#friendly:
|
||||
# lineBefore: 3
|
||||
# lineAfter: 3
|
||||
level: 8 # max is now 9
|
||||
level: 8 # max is now 10
|
||||
# strictRules:
|
||||
# allRules: false
|
||||
checkMissingCallableSignature: true
|
||||
|
||||
@@ -46,19 +46,19 @@ class qqUploadedFileXhr implements qqUploadedFile // phpcs:ignore Squiz.Classes.
|
||||
*/
|
||||
public function getName(): string
|
||||
{
|
||||
return $_GET['qqfile'] ?? '';
|
||||
return !empty($_GET['qqfile']) && is_string($_GET['qqfile']) ? $_GET['qqfile'] : '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get file size from _SERVERa array, throws an error if not possible
|
||||
*
|
||||
* @return int
|
||||
* @return int size of the file
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function getSize(): int
|
||||
{
|
||||
if (isset($_SERVER['CONTENT_LENGTH'])) {
|
||||
if (isset($_SERVER['CONTENT_LENGTH']) && is_numeric($_SERVER['CONTENT_LENGTH'])) {
|
||||
return (int)$_SERVER['CONTENT_LENGTH'];
|
||||
} else {
|
||||
throw new \Exception('Getting content length is not supported.');
|
||||
|
||||
Reference in New Issue
Block a user