Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge 3.6.x up into 4.0.x #435

Merged
merged 21 commits into from
May 3, 2024
Merged

Merge 3.6.x up into 4.0.x #435

merged 21 commits into from
May 3, 2024

Conversation

greg0ire
Copy link
Member

@greg0ire greg0ire commented May 2, 2024

No description provided.

Dumkaaa and others added 21 commits December 15, 2023 15:56
Update composer dump-autoload command syntax
Running the latest PHPStan produces this output:

```
------ --------------------------------------------------------------------------------------------------------------
 Line   Loader/SymfonyFixturesLoader.php
------ --------------------------------------------------------------------------------------------------------------
 62     Call to an undefined static method Doctrine\Bundle\FixturesBundle\Loader\SymfonyBridgeLoader::addFixture().
 96     Call to an undefined static method Doctrine\Bundle\FixturesBundle\Loader\SymfonyBridgeLoader::getFixtures().
------ --------------------------------------------------------------------------------------------------------------

------ ------------------------------------------------------------------------------------------------------------------------------------------------
 Line   Tests/Command/LoadDataFixturesDoctrineCommandTest.php
------ ------------------------------------------------------------------------------------------------------------------------------------------------
 27     Class Doctrine\Bundle\FixturesBundle\Loader\SymfonyFixturesLoader does not have a constructor and must be instantiated without any parameters.
 50     Class Doctrine\Bundle\FixturesBundle\Loader\SymfonyFixturesLoader does not have a constructor and must be instantiated without any parameters.
------ ------------------------------------------------------------------------------------------------------------------------------------------------

------ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Line   Tests/IntegrationTest.php
------ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 467    Return type mixed of method Doctrine\Bundle\FixturesBundle\Tests\ForwardCompatibleEntityManager::wrapInTransaction() is not covariant with return type mixed of method Doctrine\ORM\EntityManagerInterface::wrapInTransaction().
------ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
```

All of them happen in the context of compatibility layers. The last one
cannot be ignored for some reason.
Here are the steps I followed:

- `mkdir src`
- `git mv *.php src`
- `git mv Command/ DependencyInjection Loader Purger src`
- adjust autoloading path
- overrode `Bunde::getPath()`
- `git mv Resources/doc/ docs`
- `git mv Resources/config/ config`
- `git mv Tests/ tests`
The directory structure differs between both branches.
Configure docs path depending on the branch
It is now no longer required to declare groups on all dependent
fixtures, the fixture loader will now automatically find the required
dependencies and load them without them being explicitly added
to the groups being loaded.

Before you were forced to declare groups all the way down the
dependency chain, for example:

```
TopLevelFixture (groups: default)
├─ SecondLevelFixture1 (groups: default, alternative)
│  ├─ ThirdLevelFixture1 (groups: default, alternative)
├─ SecondLevelFixture2 (groups: default)
│  ├─ ThridLevelFixture2 (groups: default)
│  ├─ ThirdLevelFixture3 (groups: default, alternative)
```

Now you only need to specify the groups at the highest level:

```
TopLevelFixture (groups: default)
├─ SecondLevelFixture1 (groups: alternative)
│  ├─ ThirdLevelFixture1 (groups: none)
├─ SecondLevelFixture2 (groups: none)
│  ├─ ThridLevelFixture2 (groups: none)
│  ├─ ThirdLevelFixture3 (groups: alternative)
```

In both examples the groups `default` and `alternative` will load the
same fixtures.

Adds an additional PHPStan error to the baseline which appears to be
caused by the backwards compatibility layer.
Automatically extract fixture dependencies
The right class to use now is in the DI component, which does make a lot
more sense.
Address deprecation of HttpKernel Extension class
@greg0ire greg0ire merged commit eef884e into doctrine:4.0.x May 3, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants