Skip to content

Commit

Permalink
Update phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
xificurk committed Nov 7, 2021
1 parent f53d2b3 commit 4fdc1a8
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 12 deletions.
13 changes: 6 additions & 7 deletions composer.json
Expand Up @@ -22,14 +22,13 @@
},
"require-dev": {
"nette/tester": "2.4.1",
"phpstan/phpstan": "0.12.99",
"phpstan/phpstan-strict-rules": "0.12.11",
"pepakriz/phpstan-exception-rules": "0.11.7",
"phpstan/phpstan-nette": "0.12.21",
"nepada/phpstan-nette-tester": "0.3.2",
"spaze/phpstan-disallowed-calls": "1.11.0",
"phpstan/phpstan": "1.1.1",
"phpstan/phpstan-strict-rules": "1.0.",
"phpstan/phpstan-nette": "1.0.0",
"nepada/phpstan-nette-tester": "0.4.0",
"spaze/phpstan-disallowed-calls": "2.0.0",
"php-parallel-lint/php-parallel-lint": "1.3.1",
"nepada/coding-standard": "7.4.0",
"nepada/coding-standard": "7.4.1",
"nette/di": "^3.0.6@dev",
"nette/schema": "^1.0.3@dev",
"nette/bootstrap": ">=3.0@dev",
Expand Down
19 changes: 15 additions & 4 deletions phpstan.neon.dist
@@ -1,6 +1,5 @@
includes:
- vendor/phpstan/phpstan-strict-rules/rules.neon
- vendor/pepakriz/phpstan-exception-rules/extension.neon
- vendor/phpstan/phpstan-nette/extension.neon
- vendor/phpstan/phpstan-nette/rules.neon
- vendor/spaze/phpstan-disallowed-calls/extension.neon
Expand All @@ -12,13 +11,25 @@ parameters:
paths:
- src

exceptionRules:
uncheckedExceptions:
exceptions:
implicitThrows: false
check:
missingCheckedExceptionInThrows: true
tooWideThrowType: true
uncheckedExceptionClasses:
- LogicException
- Nette\InvalidStateException


ignoreErrors:
- # intended
message: '#Parameter \#1 \$value \(Nepada\\EmailAddress\\EmailAddress\|string\|null\) of method Nepada\\EmailAddressInput\\EmailAddressInput::setDefaultValue\(\) should be contravariant with parameter#'
path: src/EmailAddressInput/EmailAddressInput.php
-
message: "#^Dead catch \\- Nepada\\\\EmailAddress\\\\InvalidEmailAddressException is never thrown in the try block\\.$#"
count: 1
path: src/EmailAddressInput/EmailAddressInput.php
-
message: "#^Parameter \\#1 \\$s of static method Nette\\\\Utils\\\\Strings\\:\\:trim\\(\\) expects string, mixed given\\.$#"
count: 2
path: src/EmailAddressInput/EmailAddressInput.php

2 changes: 1 addition & 1 deletion phpstan.tests.neon.dist
Expand Up @@ -16,7 +16,7 @@ parameters:
- php
- phpt

excludes_analyse:
excludePaths:
- tests/temp/*

ignoreErrors:
Expand Down
2 changes: 2 additions & 0 deletions src/EmailAddressInput/EmailAddressInput.php
Expand Up @@ -37,6 +37,7 @@ public function setCaseSensitive(bool $caseSensitive): void

public function getValue(): ?EmailAddress
{
/** @var EmailAddress|null $value */
$value = parent::getValue();
return $value;
}
Expand Down Expand Up @@ -76,6 +77,7 @@ public function setDefaultValue($value): self

public function loadHttpData(): void
{
/** @var string $value */
$value = $this->getHttpData(Form::DATA_LINE);

if ($value === '' || $value === Strings::trim($this->translate($this->emptyValue))) {
Expand Down

0 comments on commit 4fdc1a8

Please sign in to comment.