Skip to content

Commit

Permalink
Fix phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Oct 1, 2020
1 parent 6c1c124 commit 40eec67
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"test": "php phpunit.phar",
"test-setup": "[ ! -f phpunit.phar ] && wget https://phar.phpunit.de/phpunit-8.5.1.phar && mv phpunit-8.5.1.phar phpunit.phar || true",
"test-coverage" : "php phpunit.phar --log-junit tmp/coverage/unitreport.xml --coverage-html tmp/coverage --coverage-clover tmp/coverage/coverage.xml",
"stan": "phpstan analyse -c tests/phpstan.neon -l 7 src/",
"stan": "phpstan analyse -c tests/phpstan.neon -l 8 src/",
"stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan:^0.12 && mv composer.backup composer.json",
"cs-check": "phpcs -p --standard=vendor/fig-r/psr2r-sniffer/PSR2R/ruleset.xml --ignore=/tests/test_files/,/config/Migrations/ --extensions=php src/ tests/",
"cs-fix": "phpcbf -p --standard=vendor/fig-r/psr2r-sniffer/PSR2R/ruleset.xml --ignore=/tests/test_files/,/config/Migrations/ --extensions=php src/ tests/",
Expand Down
2 changes: 1 addition & 1 deletion src/Policy/RequestPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function canAccess(?IdentityInterface $identity, ServerRequest $request):
$user = [];
if ($identity) {
$data = $identity->getOriginalData();
$user = ($data instanceof ArrayAccess) ? $data->toArray() : (array)$data;
$user = ($data instanceof ArrayAccess && method_exists($data, 'toArray')) ? $data->toArray() : (array)$data;
}

return $this->_checkUser($user, $params);
Expand Down
8 changes: 4 additions & 4 deletions src/Sync/Syncer.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ public function syncAcl(Arguments $args, ConsoleIo $io) {
}

/**
* @param string $plugin
* @param string|null $plugin
* @return array
*/
protected function _getControllers($plugin) {
if ($plugin === 'all') {
$plugins = (array)Plugin::loaded();
$plugins = Plugin::loaded();

$controllers = [];
foreach ($plugins as $plugin) {
Expand Down Expand Up @@ -131,8 +131,8 @@ protected function _parseControllers($folder, $plugin, $prefix = null) {

/**
* @param string $name
* @param string $plugin
* @param string $prefix
* @param string|null $plugin
* @param string|null $prefix
* @return bool
*/
protected function _noAuthenticationNeeded($name, $plugin, $prefix) {
Expand Down

0 comments on commit 40eec67

Please sign in to comment.