Skip to content

Commit ed44b0d

Browse files
committed
Code style fixes
1 parent ce40455 commit ed44b0d

File tree

9 files changed

+22
-15
lines changed

9 files changed

+22
-15
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

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

tests/FunctionalTests/DashboardPackagesControllerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function testAddVcsRepository(): void
4545
$packageRepository = $client->getContainer()->get(PackageRepository::class);
4646

4747
$package = $packageRepository->findOneByName('psr/container');
48-
self::assertNotNull($package, 'A package was created');
48+
self::assertNotNull($package, 'A package was created.');
4949

5050
$packageRepository->remove($package, true);
5151
}

0 commit comments

Comments
 (0)