Skip to content

Commit

Permalink
chore: update bundle structure to latest version (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukadschaak committed Aug 31, 2023
1 parent 6212c44 commit 7cbe998
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 30 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
@@ -1,6 +1,8 @@
/.gitattributes export-ignore
/.github/ export-ignore
/.gitignore export-ignore
/.gitlab-ci.yml export-ignore
/.gitlab-ci/ export-ignore
/.php-cs-fixer.php export-ignore
/bin/ export-ignore
/compose.yaml export-ignore
Expand Down
6 changes: 3 additions & 3 deletions .php-cs-fixer.php
Expand Up @@ -28,12 +28,12 @@
'single_line_throw' => false, // overwrite @Symfony

// we want spaces
'concat_space' => ['spacing' => 'one'],
'concat_space' => ['spacing' => 'one'], // overwrite @Symfony

// we want to leave the choice to the developer,
// because some people have their own style of naming test methods
'php_unit_method_casing' => false,
'php_unit_method_casing' => false, // overwrite @Symfony

// we want to leave the choice to the developer
'php_unit_test_annotation' => false,
'php_unit_test_annotation' => false, // overwrite @Symfony:risky
]);
21 changes: 0 additions & 21 deletions phpstan-baseline.neon

This file was deleted.

3 changes: 0 additions & 3 deletions phpstan.neon
@@ -1,6 +1,3 @@
includes:
- phpstan-baseline.neon

parameters:

level: 8
Expand Down
2 changes: 2 additions & 0 deletions phpunit.xml.dist
Expand Up @@ -3,6 +3,8 @@
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
bootstrap="tests/bootstrap.php"
cacheResultFile=".phpunit.cache/test-results"
colors="true"
Expand Down
Expand Up @@ -23,21 +23,28 @@ public function load(array $configs, ContainerBuilder $container): void
->replaceArgument(2, $this->getTranslationFileDirectories($container));
}

/**
* @return list<string>
*/
private function getTranslationFileDirectories(ContainerBuilder $container): array
{
$directories = [];

// Add translation directories of bundles
foreach ($container->getParameter('kernel.bundles_metadata') as ['path' => $bundleDir]) {
/** @var array<string, array{path: string, namespace: string}> $kernelBundlesMetadata */
$kernelBundlesMetadata = $container->getParameter('kernel.bundles_metadata');
foreach ($kernelBundlesMetadata as ['path' => $bundleDir]) {
if (is_dir($dir = $bundleDir . '/Resources/translations') || is_dir($dir = $bundleDir . '/translations')) {
$directories[] = $dir;
}
}

// Add translation directory of project
$projectDir = $container->getParameter('kernel.project_dir');
if (is_dir($dir = $projectDir . '/Resources/translations') || is_dir($dir = $projectDir . '/translations')) {
$directories[] = $dir;
if (\is_string($projectDir)) {
if (is_dir($dir = $projectDir . '/Resources/translations') || is_dir($dir = $projectDir . '/translations')) {
$directories[] = $dir;
}
}

return $directories;
Expand Down
Empty file added tests/app/config/.gitkeep
Empty file.

0 comments on commit 7cbe998

Please sign in to comment.