diff --git a/.phive/phars.xml b/.phive/phars.xml index b3c9592e..642921de 100644 --- a/.phive/phars.xml +++ b/.phive/phars.xml @@ -1,5 +1,5 @@ - - + + diff --git a/psalm.xml b/psalm.xml index 9a07f854..8f778137 100644 --- a/psalm.xml +++ b/psalm.xml @@ -5,6 +5,9 @@ xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" errorBaseline="psalm-baseline.xml" autoloader="tests/bootstrap.php" + findUnusedPsalmSuppress="true" + findUnusedBaselineEntry="true" + findUnusedCode="false" > diff --git a/src/Policy/OrmResolver.php b/src/Policy/OrmResolver.php index db04b33b..44b93293 100644 --- a/src/Policy/OrmResolver.php +++ b/src/Policy/OrmResolver.php @@ -62,7 +62,6 @@ public function __construct(string $appNamespace = 'App', array $overrides = []) * @return mixed * @throws \Authorization\Policy\Exception\MissingPolicyException When a policy for the * resource has not been defined or cannot be resolved. - * @psalm-suppress MoreSpecificImplementedParamType */ public function getPolicy(mixed $resource): mixed { diff --git a/tests/TestCase/AuthorizationServiceTest.php b/tests/TestCase/AuthorizationServiceTest.php index a7a05d81..a0683c42 100644 --- a/tests/TestCase/AuthorizationServiceTest.php +++ b/tests/TestCase/AuthorizationServiceTest.php @@ -173,7 +173,7 @@ public function testApplyScopeMethodMissing() ]); $article = new Article(); - $result = $service->applyScope($user, 'nope', $article); + $service->applyScope($user, 'nope', $article); } public function testApplyScopeAdditionalArguments() diff --git a/tests/TestCase/Policy/OrmResolverTest.php b/tests/TestCase/Policy/OrmResolverTest.php index 2c215435..f22db452 100644 --- a/tests/TestCase/Policy/OrmResolverTest.php +++ b/tests/TestCase/Policy/OrmResolverTest.php @@ -117,6 +117,6 @@ public function testGetPolicyUnknownTable() $articles = $this->createMock('Cake\Datasource\RepositoryInterface'); $resolver = new OrmResolver('TestApp'); - $policy = $resolver->getPolicy($articles); + $resolver->getPolicy($articles); } } diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 5ed5cab1..7b5758cf 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -13,11 +13,13 @@ * @link http://cakephp.org CakePHP(tm) Project * @license http://www.opensource.org/licenses/mit-license.php MIT License */ + use Authorization\AuthorizationPlugin; use Cake\Core\Configure; use Cake\Core\Plugin; use Cake\Datasource\ConnectionManager; use Cake\TestSuite\Fixture\SchemaLoader; +use function Cake\Core\env; $findRoot = function ($root) { do { @@ -33,7 +35,6 @@ unset($findRoot); chdir($root); -require_once 'vendor/cakephp/cakephp/src/basics.php'; require_once 'vendor/autoload.php'; define('ROOT', $root . DS . 'tests' . DS . 'test_app' . DS);