Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,18 @@
"roave/psr-container-doctrine": "^5.2.2"
},
"require-dev": {
"boundwize/structarmed": "^0.19.4",
"filp/whoops": "^2.15.4",
"laminas/laminas-coding-standard": "^3.0",
"laminas/laminas-development-mode": "^3.12.0",
"mezzio/mezzio-tooling": "^2.9.0",
"phpunit/phpunit": "^10.5",
"roave/security-advisories": "dev-master",
"vincentlanglet/twig-cs-fixer": "^2.12",
"phpstan/phpstan": "^2.0",
"phpstan/phpstan-doctrine": "^2.0",
"phpstan/phpstan-phpunit": "^2.0",
"symfony/var-dumper": "^7.1"
"phpunit/phpunit": "^10.5",
"roave/security-advisories": "dev-master",
"symfony/var-dumper": "^7.1",
"vincentlanglet/twig-cs-fixer": "^2.12"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion src/App/src/DBAL/Types/AbstractEnumType.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function getSQLDeclaration(array $column, AbstractPlatform $platform): st
return 'TEXT';
}

$values = array_map(fn($case) => "'{$case->value}'", $this->getEnumValues());
$values = array_map(static fn($case) => "'{$case->value}'", $this->getEnumValues());

return sprintf('ENUM(%s)', implode(', ', $values));
}
Expand Down
4 changes: 2 additions & 2 deletions src/Plugin/src/Factory/PluginManagerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ public function __invoke(ContainerInterface $container): PluginManager

//register the built-in plugins, if the required component is present
if ($container->has(UrlHelper::class)) {
$pluginManager->setFactory('url', function (ContainerInterface $container) {
$pluginManager->setFactory('url', static function (ContainerInterface $container) {
return new UrlHelperPlugin($container->get(UrlHelper::class));
});
}

if ($container->has(TemplateRendererInterface::class)) {
$pluginManager->setFactory('template', function (ContainerInterface $container) {
$pluginManager->setFactory('template', static function (ContainerInterface $container) {
return new TemplatePlugin($container->get(TemplateRendererInterface::class));
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/User/src/Entity/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ public function getArrayCopy(): array
'avatar' => $this->getAvatar()?->getArrayCopy(),
'identity' => $this->getIdentity(),
'status' => $this->getStatus(),
'roles' => $this->getRoles()->map(function (UserRole $userRole) {
'roles' => $this->getRoles()->map(static function (UserRole $userRole) {
return $userRole->getArrayCopy();
})->toArray(),
'created' => $this->getCreated(),
Expand Down
2 changes: 1 addition & 1 deletion src/User/src/Entity/UserIdentity.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public static function fromEntity(UserIdentityInterface $user): self
return new self(
$user->getUuid()->toString(),
$user->getIdentity(),
$user->getRoles()->map(function (UserRole $userRole) {
$user->getRoles()->map(static function (UserRole $userRole) {
return $userRole->getName();
})->toArray(),
$user->getDetail()->getArrayCopy(),
Expand Down
21 changes: 21 additions & 0 deletions structarmed.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

declare(strict_types=1);

use Boundwize\StructArmed\Architecture;
use Boundwize\StructArmed\Preset\Preset;

return Architecture::define()
->withPresets(Preset::PSR4(), Preset::CODEQUALITY())
->layer('Plugin', 'src/Plugin/src')
->layer('App', 'src/App/src')
->layer('User', 'src/User/src')
->layer('Contact', 'src/Contact/src')
->layer('Page', 'src/Page/src')
->ruleset([
'Plugin' => [],
'App' => ['User'],
'User' => ['+App', 'Plugin'],
'Contact' => ['+User'],
'Page' => [],
]);
2 changes: 1 addition & 1 deletion test/Unit/Plugin/FormsPluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function testWillRestoreState(): void
->expects($this->exactly(2))
->method('getData')
->willReturnCallback(
function (string $key) use ($newData, $newMessages) {
static function (string $key) use ($newData, $newMessages) {
return match ($key) {
'loginForm_data' => $newData,
'loginForm_messages' => $newMessages,
Expand Down
Loading