-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHPStan level 9 progress #155
Commits on Jun 24, 2023
-
Get original request in a special service
Resolves these errors: ``` ------ ------------------------------------------------- Line app/Www/Presenters/ErrorPresenter.php ------ ------------------------------------------------- 76 Cannot call method getParameter() on mixed. 76 Cannot call method getPresenterName() on mixed. 91 Cannot call method getParameters() on mixed. ------ ------------------------------------------------- ```
Configuration menu - View commit details
-
Copy full SHA for 6ad269e - Browse repository at this point
Copy the full SHA 6ad269eView commit details -
Get exception in the same service
Resolves these errors: ``` ------ ------------------------------------------- Line app/Www/Presenters/BaseErrorPresenter.php ------ ------------------------------------------- 58 Cannot call method getCode() on mixed. 58 Cannot call method getFile() on mixed. 58 Cannot call method getLine() on mixed. 58 Cannot call method getMessage() on mixed. ------ ------------------------------------------- ```
Configuration menu - View commit details
-
Copy full SHA for 65eb8cf - Browse repository at this point
Copy the full SHA 65eb8cfView commit details -
Document and check x509parse return array, though not extensively, ju…
…st what's needed at the moment Resolves these errors: ``` ------ ------------------------------------------------------------------------------------------------------------------ Line app/Tls/CertificateFactory.php ------ ------------------------------------------------------------------------------------------------------------------ 50 Cannot access offset 'commonName' on mixed. 50 Parameter #1 $commonName of class MichalSpacekCz\Tls\Certificate constructor expects string, mixed given. 52 Cannot cast mixed to string. 53 Cannot cast mixed to string. 55 Parameter #6 $serialNumber of class MichalSpacekCz\Tls\Certificate constructor expects string|null, mixed given. ------ ------------------------------------------------------------------------------------------------------------------ ```
Configuration menu - View commit details
-
Copy full SHA for a2f51dd - Browse repository at this point
Copy the full SHA a2f51ddView commit details -
Pass individual values to CertificateFactory and validate them with N…
…ette\Schema Resolves ``` ------ --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Line app/Tls/CertificatesApiClient.php ------ --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 69 Parameter #1 $details of method MichalSpacekCz\Tls\CertificateFactory::fromArray() expects array{commonName: string, commonNameExt: string|null, notBefore: string, notBeforeTz: string, notAfter: string, notAfterTz: string, expiringThreshold: int, serialNumber: string|null, ...}, mixed given. ------ --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ```
Configuration menu - View commit details
-
Copy full SHA for fb4cc4f - Browse repository at this point
Copy the full SHA fb4cc4fView commit details -
This was easy, removes this: ``` ------ ------------------------------------------------------------------------------------------------ Line app/Test/NoOpTranslator.php ------ ------------------------------------------------------------------------------------------------ 36 Method MichalSpacekCz\Test\NoOpTranslator::translate() should return string but returns mixed. ------ ------------------------------------------------------------------------------------------------ ```
Configuration menu - View commit details
-
Copy full SHA for 09531a7 - Browse repository at this point
Copy the full SHA 09531a7View commit details -
Add type to Nette\Schema validation output
This is sort of a duplication of what's already defined in the schema but here we are. Solves these: ``` ------ ---------------------------------------------------- Line app/Pulse/Passwords/AlgorithmAttributesFactory.php ------ ---------------------------------------------------- 37 Cannot access property $inner on mixed. 37 Cannot access property $outer on mixed. 37 Cannot access property $params on mixed. ------ ---------------------------------------------------- ```
Configuration menu - View commit details
-
Copy full SHA for e2ddce8 - Browse repository at this point
Copy the full SHA e2ddce8View commit details -
Add HttpInput service to get cookies as strings and possibly more in …
…the future Right now, `Nette\Http\Request::getCookie()` returns mixed and would require we check for strings all the time
Configuration menu - View commit details
-
Copy full SHA for 6e9af53 - Browse repository at this point
Copy the full SHA 6e9af53View commit details -
Configuration menu - View commit details
-
Copy full SHA for ca4edc6 - Browse repository at this point
Copy the full SHA ca4edc6View commit details -
Get form values from the form, not via params
Currently, `$form->onValidate` and `$form->onSuccess` types for `$values` are specified as `mixed` and the type in the callbacks cannot be narrower as seen in errors like: ``` ------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Line app/Form/TrainingApplicationAdminFormFactory.php ------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 96 Property Nette\Forms\Form::$onSuccess (array<callable(Nette\Application\UI\Form, mixed): void>) does not accept non-empty-array<(callable(Nette\Application\UI\Form, mixed): void)|(Closure(Nette\Application\UI\Form, stdClass): void)>. 💡 Type stdClass of parameter #2 $values of passed callable needs to be same or wider than parameter type mixed of accepting callable. ------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ```
Configuration menu - View commit details
-
Copy full SHA for a548983 - Browse repository at this point
Copy the full SHA a548983View commit details
Commits on Jun 25, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 79c2cc1 - Browse repository at this point
Copy the full SHA 79c2cc1View commit details -
Resolves: ``` ------ ----------------------------------------------------------------------- Line app/UpcKeys/Technicolor.php ------ ----------------------------------------------------------------------- 88 Parameter #2 $string of function explode expects string, mixed given. ------ ----------------------------------------------------------------------- ```
Configuration menu - View commit details
-
Copy full SHA for 697dd58 - Browse repository at this point
Copy the full SHA 697dd58View commit details
Commits on Jun 26, 2023
-
Configuration menu - View commit details
-
Copy full SHA for f4a796e - Browse repository at this point
Copy the full SHA f4a796eView commit details -
Configuration menu - View commit details
-
Copy full SHA for a3dfcc1 - Browse repository at this point
Copy the full SHA a3dfcc1View commit details -
Configuration menu - View commit details
-
Copy full SHA for f1a8b3b - Browse repository at this point
Copy the full SHA f1a8b3bView commit details -
Throw specific exception instead of RuntimeException
This is kinda unrelated but I still like it.
Configuration menu - View commit details
-
Copy full SHA for 4ce4239 - Browse repository at this point
Copy the full SHA 4ce4239View commit details -
Configuration menu - View commit details
-
Copy full SHA for da519cb - Browse repository at this point
Copy the full SHA da519cbView commit details -
Align types in link() in tests
Fix ``` ------ --------------------------------------------------------------- Line app/Test/Application/ApplicationPresenter.php ------ --------------------------------------------------------------- 38 Parameter #2 $ of closure expects array<string>, array given. ------ --------------------------------------------------------------- ```
Configuration menu - View commit details
-
Copy full SHA for d7d6499 - Browse repository at this point
Copy the full SHA d7d6499View commit details -
Only a string goes to DateTimeImmutable constructor
Fixes these errors: ``` ------ -------------------------------------------------------------------------------------------- Line app/Training/Dates/TrainingDatesFormValidator.php ------ -------------------------------------------------------------------------------------------- 18 Parameter #1 $datetime of class DateTimeImmutable constructor expects string, mixed given. 19 Parameter #1 $datetime of class DateTimeImmutable constructor expects string, mixed given. ------ -------------------------------------------------------------------------------------------- ```
Configuration menu - View commit details
-
Copy full SHA for f8292af - Browse repository at this point
Copy the full SHA f8292afView commit details -
Configuration menu - View commit details
-
Copy full SHA for 51ba665 - Browse repository at this point
Copy the full SHA 51ba665View commit details -
Let PHPStan know that updating the row may throw an exception
It was either PhpStorm complaining that the right part of `$slideNumber ?? ...` is useless, or PHPStan complaining that "Cannot access property $number on mixed." Or both.
Configuration menu - View commit details
-
Copy full SHA for c3d3f15 - Browse repository at this point
Copy the full SHA c3d3f15View commit details
Commits on Jun 27, 2023
-
Ensure the input value is a string
Don't care if not because it's gonna be a string, trust me.
Configuration menu - View commit details
-
Copy full SHA for f30c4ef - Browse repository at this point
Copy the full SHA f30c4efView commit details