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