mirror of
https://github.com/standardebooks/web.git
synced 2025-07-05 22:30:30 -04:00
Bump PHPStan check level to max and add final round of type hints
This commit is contained in:
parent
110c091a7b
commit
70ae877dd8
15 changed files with 86 additions and 52 deletions
|
@ -84,18 +84,22 @@ class HttpInput{
|
|||
return null;
|
||||
}
|
||||
|
||||
/** @var ?string $var */
|
||||
return $var;
|
||||
}
|
||||
|
||||
public static function Int(HttpVariableSource $set, string $variable): ?int{
|
||||
/** @var ?int */
|
||||
return self::GetHttpVar($variable, HttpVariableType::Integer, $set);
|
||||
}
|
||||
|
||||
public static function Bool(HttpVariableSource $set, string $variable): ?bool{
|
||||
/** @var ?bool */
|
||||
return self::GetHttpVar($variable, HttpVariableType::Boolean, $set);
|
||||
}
|
||||
|
||||
public static function Dec(HttpVariableSource $set, string $variable): ?float{
|
||||
/** @var ?float */
|
||||
return self::GetHttpVar($variable, HttpVariableType::Decimal, $set);
|
||||
}
|
||||
|
||||
|
@ -104,9 +108,13 @@ class HttpInput{
|
|||
* @return array<string>
|
||||
*/
|
||||
public static function Array(HttpVariableSource $set, string $variable): ?array{
|
||||
/** @var array<string> */
|
||||
return self::GetHttpVar($variable, HttpVariableType::Array, $set);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string>|array<int>|array<float>|array<bool>|string|int|float|bool|null
|
||||
*/
|
||||
private static function GetHttpVar(string $variable, HttpVariableType $type, HttpVariableSource $set): mixed{
|
||||
$vars = [];
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue