Skip to content

Commit 04a2f21

Browse files
committed
Code style fixes
1 parent ce40455 commit 04a2f21

13 files changed

+40
-35
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/.github/
22
/.idea/
3+
/.phpunit.cache/
34
/config/dirigent.json
45
/config/dirigent.php
56
/config/dirigent.yaml

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Documentation files
22
docs/** linguist-documentation
3-
changelogd.md linguist-documentation
3+
changelog.md linguist-documentation
44
license.md linguist-documentation
55
readme.md linguist-documentation
66

phpstan.dist.neon

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,16 @@ parameters:
33
paths:
44
- bin/
55
- config/
6+
- migrations/
67
- public/
78
- src/
89
- tests/
910
excludePaths:
1011
- tests/bootstrap.php
1112
ignoreErrors:
12-
- '#Call to an undefined method Symfony\\Component\\Config\\Definition\\Builder\\NodeDefinition::children\(\).#'
13-
- '#Property CodedMonkey\\Dirigent\\Doctrine\\Entity\\[a-zA-Z]+::\$id \(int\|null\) is never assigned int so it can be removed from the property type.#'
13+
- '#^Property CodedMonkey\\Dirigent\\Doctrine\\Entity\\[a-zA-Z]+\:\:\$id \(int\|null\) is never assigned int so it can be removed from the property type\.$#'
14+
-
15+
message: '#^Call to an undefined method Symfony\\Component\\Config\\Definition\\Builder\\NodeDefinition\:\:children\(\)\.$#'
16+
identifier: method.notFound
17+
count: 1
18+
path: src/DependencyInjection/DirigentConfiguration.php

phpunit.dist.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

33
<!-- https://phpunit.readthedocs.io/en/latest/configuration.html -->
4-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5-
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
6-
backupGlobals="false"
7-
colors="true"
8-
bootstrap="tests/bootstrap.php"
9-
cacheDirectory=".phpunit.cache"
4+
<phpunit
5+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
7+
bootstrap="tests/bootstrap.php"
8+
cacheDirectory=".phpunit.cache"
9+
colors="true"
1010
>
1111
<php>
1212
<ini name="display_errors" value="1" />
@@ -26,7 +26,7 @@
2626
</testsuite>
2727
</testsuites>
2828

29-
<source restrictDeprecations="true" restrictNotices="true" restrictWarnings="true">
29+
<source restrictNotices="true" restrictWarnings="true">
3030
<include>
3131
<directory>src</directory>
3232
</include>

phpunit.docker.xml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

3-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
5-
colors="true"
6-
bootstrap="tests/bootstrap.php"
3+
<phpunit
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
6+
cacheDirectory=".phpunit.cache"
7+
colors="true"
78
>
89
<php>
910
<ini name="display_errors" value="1" />

src/EventListener/DashboardRoutingListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function __construct(
1919
}
2020

2121
#[AsEventListener]
22-
public function onKernelRequest(RequestEvent $event): void
22+
public function redirectPrettyDashboardUrls(RequestEvent $event): void
2323
{
2424
$request = $event->getRequest();
2525

src/EventListener/SecurityEventListener.php renamed to src/EventListener/SecurityListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use Symfony\Component\Security\Http\Authenticator\Passport\Credentials\PasswordCredentials;
1414
use Symfony\Component\Security\Http\Event\CheckPassportEvent;
1515

16-
readonly class SecurityEventListener
16+
readonly class SecurityListener
1717
{
1818
public function __construct(
1919
private AccessTokenRepository $accessTokenRepository,

src/Kernel.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,17 @@ protected function configureContainer(ContainerConfigurator $container): void
2727
}
2828
}
2929

30+
protected function build(ContainerBuilder $container): void
31+
{
32+
$container->registerExtension(new DirigentExtension());
33+
}
34+
3035
public function boot(): void
3136
{
3237
parent::boot();
3338

39+
// Set Composer env vars
3440
$_SERVER['COMPOSER_CACHE_DIR'] = $this->container->getParameter('dirigent.storage.path') . '/composer-cache';
3541
$_SERVER['COMPOSER_HOME'] = $this->container->getParameter('dirigent.storage.path') . '/composer';
3642
}
37-
38-
protected function build(ContainerBuilder $container): void
39-
{
40-
$container->registerExtension(new DirigentExtension());
41-
}
4243
}

src/Package/PackageMetadataResolver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,8 @@ private function updateReadme(Version $version, VcsDriverInterface $driver): voi
403403

404404
break;
405405
}
406-
} catch (\Exception $e) {
407-
throw $e; // todo handle politely
406+
} catch (\Exception $exception) {
407+
throw $exception; // todo handle politely
408408
}
409409
}
410410

src/Package/PackageVcsRepositoryValidator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ public function validate(Package $package): array
6767
}
6868

6969
return $result;
70-
} catch (\Exception $e) {
71-
return ['error' => '[' . $e::class . '] ' . $e->getMessage()];
70+
} catch (\Exception $exception) {
71+
return ['error' => '[' . $exception::class . '] ' . $exception->getMessage()];
7272
}
7373
}
7474

0 commit comments

Comments
 (0)