Skip to content

Commit 23b541e

Browse files
author
DKravtsov
committed
Updated dependencies, refactoring.
1 parent 46ce1b8 commit 23b541e

File tree

107 files changed

+1062
-1578
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+1062
-1578
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ ifeq ($(INSIDE_DOCKER_CONTAINER), 1)
356356
@echo "\033[32mRunning PHPStan - PHP Static Analysis Tool\033[39m"
357357
@bin/console cache:clear --env=test
358358
@./vendor/bin/phpstan --version
359-
@./vendor/bin/phpstan analyze src tests --xdebug
359+
@./vendor/bin/phpstan analyze src tests
360360
else
361361
@make exec cmd="make phpstan"
362362
endif

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"Elasticsearch"
1515
],
1616
"homepage": "https://github.com/systemsdk/docker-symfony-api",
17-
"version": "v1.4.5",
17+
"version": "v1.4.6",
1818
"license": "MIT",
1919
"authors": [
2020
{
@@ -41,7 +41,6 @@
4141
"ext-pdo": "*",
4242
"ext-pdo_mysql": "*",
4343
"beberlei/doctrineextensions": "^1.3",
44-
"doctrine/annotations": "^1.14",
4544
"doctrine/doctrine-bundle": "^2.9",
4645
"doctrine/doctrine-migrations-bundle": "^3.2",
4746
"doctrine/orm": "^2.14",

composer.lock

Lines changed: 283 additions & 280 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/services.yaml

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ services:
4949
- '../src/DependencyInjection/'
5050
- '../src/*/Domain/Entity/'
5151
- '../src/*/Transport/EventListener/'
52-
- '../src/General/Application/Utils/Tests/'
5352
- '../src/Kernel.php'
5453

5554
# controllers are imported separately to make sure services can be injected
@@ -84,19 +83,19 @@ when@dev:
8483
autoconfigure: true
8584

8685
App\ApiKey\Infrastructure\DataFixtures\:
87-
resource: '../src/ApiKey/Infrastructure/DataFixtures/'
86+
resource: '../src/ApiKey/Infrastructure/DataFixtures/*'
8887

8988
App\Role\Infrastructure\DataFixtures\:
90-
resource: '../src/Role/Infrastructure/DataFixtures/'
89+
resource: '../src/Role/Infrastructure/DataFixtures/*'
9190

9291
App\User\Infrastructure\DataFixtures\:
93-
resource: '../src/User/Infrastructure/DataFixtures/'
92+
resource: '../src/User/Infrastructure/DataFixtures/*'
9493

95-
App\General\Transport\Utils\Tests\:
96-
resource: '../src/General/Transport/Utils/Tests'
94+
App\Tests\TestCase\:
95+
resource: '../tests/TestCase/*'
9796

98-
App\General\Application\Utils\Tests\:
99-
resource: '../src/General/Application/Utils/Tests'
97+
App\Tests\Utils\:
98+
resource: '../tests/Utils/*'
10099

101100
ProxyManager\Factory\AccessInterceptorValueHolderFactory:
102101
class: ProxyManager\Factory\AccessInterceptorValueHolderFactory
@@ -121,16 +120,16 @@ when@test:
121120
public: true
122121

123122
App\ApiKey\Infrastructure\DataFixtures\:
124-
resource: '../src/ApiKey/Infrastructure/DataFixtures/'
123+
resource: '../src/ApiKey/Infrastructure/DataFixtures/*'
125124

126125
App\Role\Infrastructure\DataFixtures\:
127-
resource: '../src/Role/Infrastructure/DataFixtures/'
126+
resource: '../src/Role/Infrastructure/DataFixtures/*'
128127

129128
App\User\Infrastructure\DataFixtures\:
130-
resource: '../src/User/Infrastructure/DataFixtures/'
129+
resource: '../src/User/Infrastructure/DataFixtures/*'
131130

132-
App\General\Transport\Utils\Tests\:
133-
resource: '../src/General/Transport/Utils/Tests'
131+
App\Tests\TestCase\:
132+
resource: '../tests/TestCase/*'
134133

135-
App\General\Application\Utils\Tests\:
136-
resource: '../src/General/Application/Utils/Tests'
134+
App\Tests\Utils\:
135+
resource: '../tests/Utils/*'

phpunit.xml.dist

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html -->
33
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd"
4+
xsi:noNamespaceSchemaLocation="tools/01_phpunit/vendor/phpunit/phpunit/phpunit.xsd"
55
backupGlobals="false"
66
bootstrap="tests/bootstrap.php"
77
colors="true"
88
testdox="true"
99
beStrictAboutTestsThatDoNotTestAnything="true"
1010
beStrictAboutOutputDuringTests="true"
1111
processIsolation="false"
12+
stopOnError="true"
1213
stopOnFailure="false"
14+
stopOnDefect="false"
1315
displayDetailsOnTestsThatTriggerDeprecations="true"
1416
displayDetailsOnTestsThatTriggerNotices="true"
1517
displayDetailsOnTestsThatTriggerWarnings="true"
1618
displayDetailsOnTestsThatTriggerErrors="true"
1719
cacheDirectory=".phpunit.cache"
1820
>
19-
<coverage>
21+
<coverage/>
22+
<source>
2023
<include>
2124
<directory suffix=".php">./src</directory>
2225
</include>
@@ -33,7 +36,7 @@
3336
<directory>./src/User/Infrastructure/DataFixtures</directory>
3437
<file>./src/Kernel.php</file>
3538
</exclude>
36-
</coverage>
39+
</source>
3740
<php>
3841
<ini name="error_reporting" value="-1" />
3942
<ini name="display_errors" value="On" />

src/ApiKey/Application/Security/ApiKeyUser.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
use App\Role\Domain\Enum\Role;
1010
use Symfony\Component\Security\Core\User\UserInterface;
1111

12-
use function array_merge;
1312
use function array_unique;
1413

1514
/**
@@ -19,13 +18,13 @@
1918
*/
2019
class ApiKeyUser implements ApiKeyUserInterface, UserInterface
2120
{
22-
private string $identifier;
23-
private string $apiKeyIdentifier;
21+
private readonly string $identifier;
22+
private readonly string $apiKeyIdentifier;
2423

2524
/**
2625
* @var array<int, string>
2726
*/
28-
private array $roles;
27+
private readonly array $roles;
2928

3029
/**
3130
* {@inheritdoc}
@@ -34,7 +33,7 @@ public function __construct(ApiKey $apiKey, array $roles)
3433
{
3534
$this->identifier = $apiKey->getToken();
3635
$this->apiKeyIdentifier = $apiKey->getId();
37-
$this->roles = array_unique(array_merge($roles, [Role::API->value]));
36+
$this->roles = array_unique([...$roles, Role::API->value]);
3837
}
3938

4039
public function getUserIdentifier(): string

src/ApiKey/Domain/Entity/ApiKey.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
use Throwable;
2727

2828
use function array_map;
29-
use function array_merge;
3029
use function array_unique;
3130
use function array_values;
3231

@@ -204,12 +203,12 @@ public function getRoles(): array
204203
array_map(
205204
'\strval',
206205
array_unique(
207-
array_merge(
208-
[RoleEnum::API->value],
209-
$this->userGroups
206+
[
207+
RoleEnum::API->value,
208+
...$this->userGroups
210209
->map(static fn (UserGroup $userGroup): string => $userGroup->getRole()->getId())
211210
->toArray(),
212-
),
211+
],
213212
),
214213
),
215214
);

src/ApiKey/Infrastructure/DataFixtures/ORM/LoadApiKeyData.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
namespace App\ApiKey\Infrastructure\DataFixtures\ORM;
66

77
use App\ApiKey\Domain\Entity\ApiKey;
8-
use App\General\Application\Utils\Tests\PhpUnitUtil;
98
use App\General\Domain\Rest\UuidHelper;
109
use App\Role\Application\Security\Interfaces\RolesServiceInterface;
10+
use App\Tests\Utils\PhpUnitUtil;
1111
use App\User\Domain\Entity\UserGroup;
1212
use Doctrine\Bundle\FixturesBundle\Fixture;
1313
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;

src/ApiKey/Transport/Command/ApiKey/ChangeTokenCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class ChangeTokenCommand extends Command
2727
{
2828
use SymfonyStyleTrait;
2929

30-
public const NAME = 'api-key:change-token';
30+
final public const NAME = 'api-key:change-token';
3131

3232
/**
3333
* Constructor

src/ApiKey/Transport/Command/ApiKey/CreateApiKeyCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class CreateApiKeyCommand extends Command
3838
use ApiKeyUserManagementHelperTrait;
3939
use SymfonyStyleTrait;
4040

41-
public const NAME = 'api-key:create';
41+
final public const NAME = 'api-key:create';
4242

4343
/**
4444
* @var array<int, array<string, string>>

0 commit comments

Comments
 (0)