Skip to content

Commit cddac99

Browse files
committed
PHPStan 2.0
1 parent 2e19f3d commit cddac99

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"lowest": "validate-prefer-lowest",
6060
"lowest-setup": "composer update --prefer-lowest --prefer-stable --prefer-dist --no-interaction && cp composer.json composer.backup && composer require --dev dereuromark/composer-prefer-lowest && mv composer.backup composer.json",
6161
"stan": "phpstan analyse",
62-
"stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan:^1.0.0 && mv composer.backup composer.json",
62+
"stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan:^2.0.0 && mv composer.backup composer.json",
6363
"test": "phpunit",
6464
"test-coverage": "phpunit --log-junit tmp/coverage/unitreport.xml --coverage-html tmp/coverage --coverage-clover tmp/coverage/coverage.xml"
6565
}

src/Auth/AllowTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ protected function _getAllowRule(array $params) {
3030
$allowDefaults = $this->_getAllowDefaultsForCurrentParams($params);
3131

3232
foreach ($rules as $rule) {
33-
if (isset($params['plugin']) && ($params['plugin'] !== null)) {
33+
if (isset($params['plugin'])) {
3434
if ($params['plugin'] !== $rule['plugin']) {
3535
continue;
3636
}
@@ -39,7 +39,7 @@ protected function _getAllowRule(array $params) {
3939
continue;
4040
}
4141
}
42-
if (isset($params['prefix']) && ($params['prefix'] !== null)) {
42+
if (isset($params['prefix'])) {
4343
if ($params['prefix'] !== $rule['prefix']) {
4444
continue;
4545
}

src/Controller/Component/LegacyAuthComponent.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,8 +691,9 @@ protected function _getUser(): bool {
691691
}
692692
foreach ($this->_authenticateObjects as $auth) {
693693
$result = $auth->getUser($this->getController()->getRequest());
694-
if (!empty($result) && is_array($result)) {
694+
if ($result) {
695695
$this->_authenticationProvider = $auth;
696+
/** @var \Cake\Event\Event $event */
696697
$event = $this->dispatchEvent('Auth.afterIdentify', [$result, $auth]);
697698
if ($event->getResult() !== null) {
698699
$result = $event->getResult();

0 commit comments

Comments
 (0)