Skip to content

Commit

Permalink
Merge pull request #25 from mezzio/renovate/lock-file-maintenance
Browse files Browse the repository at this point in the history
Lock file maintenance
  • Loading branch information
Ocramius committed Dec 5, 2022
2 parents c50567a + 6b9e18c commit 703ea50
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 61 deletions.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@
},
"require-dev": {
"laminas/laminas-coding-standard": "~2.4.0",
"laminas/laminas-servicemanager": "^3.19.0",
"laminas/laminas-servicemanager": "^3.20",
"phpunit/phpunit": "^9.5.26",
"psalm/plugin-phpunit": "^0.18.0",
"vimeo/psalm": "^5.0"
"psalm/plugin-phpunit": "^0.18.4",
"vimeo/psalm": "^5.1"
},
"conflict": {
"container-interop/container-interop": "<1.2.0",
Expand Down
82 changes: 41 additions & 41 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 2 additions & 11 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.0.0@4e177bf0c9f03c17d2fbfd83b7cc9c47605274d8">
<files psalm-version="5.1.0@4defa177c89397c5e14737a80fe4896584130674">
<file src="src/LaminasAcl.php">
<PossiblyFalseArgument occurrences="1">
<code>$routeName</code>
</PossiblyFalseArgument>
</file>
<file src="src/LaminasAclFactory.php">
<InvalidCatch occurrences="4"/>
<MixedArgument occurrences="4">
<code>$config['allow'] ?? []</code>
<code>$config['deny'] ?? []</code>
Expand All @@ -27,23 +26,15 @@
<InvalidFunctionCall occurrences="1">
<code>$configProvider()</code>
</InvalidFunctionCall>
<MixedArgument occurrences="2">
<MixedArgument occurrences="1">
<code>$configProvider()</code>
<code>$config['dependencies']</code>
</MixedArgument>
<MixedArgumentTypeCoercion occurrences="1">
<code>$dependencies</code>
</MixedArgumentTypeCoercion>
<MixedArrayAccess occurrences="4">
<code>$json['packages']</code>
<code>$package['extra']</code>
<code>$package['extra']['laminas']</code>
<code>$package['extra']['laminas']['config-provider']</code>
</MixedArrayAccess>
<MixedArrayAssignment occurrences="2">
<code>$config['dependencies']['services']</code>
<code>$config['dependencies']['services']['config']</code>
</MixedArrayAssignment>
<MixedAssignment occurrences="2">
<code>$json</code>
<code>$package</code>
Expand Down
8 changes: 4 additions & 4 deletions src/LaminasAclFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ private function injectRoles(Acl $acl, array $roles): void
try {
$acl->addRole($parent);
} catch (AclExceptionInterface $e) {
throw new Exception\InvalidConfigException($e->getMessage(), (int) $e->getCode(), $e);
throw new Exception\InvalidConfigException($e->getMessage(), $e->getCode(), $e);
}
}
}
try {
$acl->addRole($role, $parents);
} catch (AclExceptionInterface $e) {
throw new Exception\InvalidConfigException($e->getMessage(), (int) $e->getCode(), $e);
throw new Exception\InvalidConfigException($e->getMessage(), $e->getCode(), $e);
}
}
}
Expand All @@ -83,7 +83,7 @@ private function injectResources(Acl $acl, array $resources): void
try {
$acl->addResource($resource);
} catch (AclExceptionInterface $e) {
throw new Exception\InvalidConfigException($e->getMessage(), (int) $e->getCode(), $e);
throw new Exception\InvalidConfigException($e->getMessage(), $e->getCode(), $e);
}
}
}
Expand All @@ -107,7 +107,7 @@ private function injectPermissions(Acl $acl, array $permissions, string $type):
? $acl->allow($role, $resources)
: $acl->deny($role, $resources);
} catch (AclExceptionInterface $e) {
throw new Exception\InvalidConfigException($e->getMessage(), (int) $e->getCode(), $e);
throw new Exception\InvalidConfigException($e->getMessage(), $e->getCode(), $e);
}
}
}
Expand Down
12 changes: 10 additions & 2 deletions test/ConfigProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace MezzioTest\Authorization\Acl;

use Laminas\ServiceManager\ConfigInterface;
use Laminas\ServiceManager\ServiceManager;
use Mezzio\Authorization\Acl\ConfigProvider;
use Mezzio\Authorization\Acl\LaminasAcl;
Expand All @@ -15,6 +16,7 @@
use function json_decode;
use function sprintf;

/** @psalm-import-type ServiceManagerConfigurationType from ConfigInterface */
class ConfigProviderTest extends TestCase
{
private ConfigProvider $provider;
Expand Down Expand Up @@ -64,10 +66,15 @@ public function testServicesDefinedInConfigProvider(): void
}
}

$config['dependencies']['services']['config'] = [
self::assertIsArray($config['dependencies']);
/** @psalm-var ServiceManagerConfigurationType $dependencies */
$dependencies = $config['dependencies'];
unset($dependencies['services']['config']);
$dependencies['services']['config'] = [
'mezzio-authorization-acl' => ['roles' => [], 'resources' => []],
];
$container = $this->getContainer($config['dependencies']);

$container = $this->getContainer($dependencies);

$dependencies = $this->provider->getDependencies();
foreach ($dependencies['factories'] as $name => $factory) {
Expand All @@ -81,6 +88,7 @@ public function testServicesDefinedInConfigProvider(): void
}
}

/** @param ServiceManagerConfigurationType $dependencies */
private function getContainer(array $dependencies): ServiceManager
{
return new ServiceManager($dependencies);
Expand Down

0 comments on commit 703ea50

Please sign in to comment.