Skip to content

Commit

Permalink
Merge pull request #535 from greg0ire/modern-directory-structure
Browse files Browse the repository at this point in the history
Switch to a modern directory structure
  • Loading branch information
greg0ire committed Mar 27, 2024
2 parents 62db2f2 + 47020af commit dcb2981
Show file tree
Hide file tree
Showing 27 changed files with 30 additions and 40 deletions.
7 changes: 2 additions & 5 deletions composer.json
Expand Up @@ -44,13 +44,10 @@
"vimeo/psalm": "^4.30 || ^5.15"
},
"autoload": {
"psr-4": { "Doctrine\\Bundle\\MigrationsBundle\\": "" },
"exclude-from-classmap": [
"/Tests/"
]
"psr-4": { "Doctrine\\Bundle\\MigrationsBundle\\": "src" }
},
"autoload-dev": {
"psr-4": { "Doctrine\\Bundle\\MigrationsBundle\\Tests\\": "Tests" }
"psr-4": { "Doctrine\\Bundle\\MigrationsBundle\\Tests\\": "tests" }
},
"config": {
"allow-plugins": {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 3 additions & 6 deletions phpcs.xml.dist
Expand Up @@ -11,13 +11,10 @@

<config name="php_version" value="70200"/>

<file>Collector</file>
<file>MigrationsFactory</file>
<file>DoctrineMigrationsBundle.php</file>
<file>DependencyInjection</file>
<file>Tests</file>
<file>src</file>
<file>tests</file>

<exclude-pattern>Tests/Fixtures/CustomEntityManager.php</exclude-pattern>
<exclude-pattern>tests/Fixtures/CustomEntityManager.php</exclude-pattern>

<rule ref="Doctrine">
<exclude name="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint" />
Expand Down
10 changes: 5 additions & 5 deletions phpstan-baseline.neon
Expand Up @@ -3,24 +3,24 @@ parameters:
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: Collector/MigrationsCollector.php
path: src/Collector/MigrationsCollector.php

-
message: "#^Only booleans are allowed in a negated boolean, Doctrine\\\\Migrations\\\\AbstractMigration\\|null given\\.$#"
count: 1
path: Collector/MigrationsFlattener.php
path: src/Collector/MigrationsFlattener.php

-
message: "#^Only booleans are allowed in a ternary operator condition, Doctrine\\\\Migrations\\\\AbstractMigration\\|null given\\.$#"
count: 2
path: Collector/MigrationsFlattener.php
path: src/Collector/MigrationsFlattener.php

-
message: "#^Call to method setContainer\\(\\) on an unknown class Symfony\\\\Component\\\\DependencyInjection\\\\ContainerAwareInterface\\.$#"
count: 1
path: MigrationsFactory/ContainerAwareMigrationFactory.php
path: src/MigrationsFactory/ContainerAwareMigrationFactory.php

-
message: "#^Class Symfony\\\\Component\\\\DependencyInjection\\\\ContainerAwareInterface not found\\.$#"
count: 2
path: MigrationsFactory/ContainerAwareMigrationFactory.php
path: src/MigrationsFactory/ContainerAwareMigrationFactory.php
9 changes: 3 additions & 6 deletions phpstan.neon.dist
Expand Up @@ -2,15 +2,12 @@ parameters:
level: 7
phpVersion: 80200
paths:
- Collector
- DependencyInjection
- DoctrineMigrationsBundle.php
- MigrationsFactory
- Tests
- src
- tests

excludePaths:
# That file contains an error that cannot be ignored
- Tests/Fixtures/Migrations/ContainerAwareMigration.php
- tests/Fixtures/Migrations/ContainerAwareMigration.php

ignoreErrors:
- '~Parameter \#1 \$configs.*DoctrineMigrationsExtension::load.*~'
Expand Down
9 changes: 2 additions & 7 deletions phpunit.xml.dist
Expand Up @@ -3,18 +3,13 @@
<phpunit colors="true" bootstrap="vendor/autoload.php">
<testsuites>
<testsuite name="DoctrineMigrationsBundle for the Symfony Framework">
<directory>./Tests</directory>
<directory>./tests</directory>
</testsuite>
</testsuites>

<filter>
<whitelist>
<directory>.</directory>
<exclude>
<directory>./Resources</directory>
<directory>./Tests</directory>
<directory>./vendor</directory>
</exclude>
<directory>src</directory>
</whitelist>
</filter>

Expand Down
8 changes: 4 additions & 4 deletions psalm-baseline.xml
@@ -1,24 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.23.1@8471a896ccea3526b26d082f4461eeea467f10a4">
<file src="DependencyInjection/Configuration.php">
<file src="src/DependencyInjection/Configuration.php">
<UndefinedInterfaceMethod>
<code><![CDATA[end]]></code>
</UndefinedInterfaceMethod>
</file>
<file src="DependencyInjection/DoctrineMigrationsExtension.php">
<file src="src/DependencyInjection/DoctrineMigrationsExtension.php">
<MoreSpecificImplementedParamType>
<code><![CDATA[$configs]]></code>
</MoreSpecificImplementedParamType>
</file>
<file src="MigrationsFactory/ContainerAwareMigrationFactory.php">
<file src="src/MigrationsFactory/ContainerAwareMigrationFactory.php">
<ContainerDependency>
<code><![CDATA[ContainerInterface $container]]></code>
</ContainerDependency>
<UndefinedClass>
<code><![CDATA[ContainerAwareInterface]]></code>
</UndefinedClass>
</file>
<file src="Tests/Fixtures/Migrations/ContainerAwareMigration.php">
<file src="tests/Fixtures/Migrations/ContainerAwareMigration.php">
<UndefinedClass>
<code><![CDATA[ContainerAwareInterface]]></code>
</UndefinedClass>
Expand Down
7 changes: 2 additions & 5 deletions psalm.xml
Expand Up @@ -10,11 +10,8 @@
errorBaseline="psalm-baseline.xml"
>
<projectFiles>
<directory name="Collector" />
<directory name="DependencyInjection" />
<directory name="MigrationsFactory" />
<directory name="Tests" />
<file name="DoctrineMigrationsBundle.php" />
<directory name="src" />
<directory name="tests" />
<ignoreFiles>
<directory name="vendor" />
</ignoreFiles>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -47,7 +47,7 @@ public function load(array $configs, ContainerBuilder $container): void

$config = $this->processConfiguration($configuration, $configs);

$locator = new FileLocator(__DIR__ . '/../Resources/config/');
$locator = new FileLocator(__DIR__ . '/../../config/');
$loader = new XmlFileLoader($container, $locator);

$loader->load('services.xml');
Expand Down Expand Up @@ -195,7 +195,7 @@ private function registerCollector(ContainerBuilder $container): void
*/
public function getXsdValidationBasePath(): string
{
return __DIR__ . '/../Resources/config/schema';
return __DIR__ . '/../../config/schema';
}

public function getNamespace(): string
Expand Down
Expand Up @@ -8,6 +8,8 @@
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;

use function dirname;

/**
* Bundle.
*/
Expand All @@ -18,4 +20,9 @@ public function build(ContainerBuilder $container)
{
$container->addCompilerPass(new ConfigureDependencyFactoryPass());
}

public function getPath(): string
{
return dirname(__DIR__);
}
}
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit dcb2981

Please sign in to comment.