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

fix: Change order of mapping paths being loaded #4465

Merged
merged 3 commits into from
Sep 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## 2.7.0

* **BC**: `mapping.paths` in configuration should override bundles configuration (#4465)
* GraphQL: Add ability to use different pagination types for the queries of a resource (#4453)
* Security: **BC** Fix `ApiProperty` `security` attribute expression being passed a class string for the `object` variable on updates/creates - null is now passed instead if the object is not available (#4184)
* Security: `ApiProperty` now supports a `security_post_denormalize` attribute, which provides access to the `object` variable for the object being updated/created and `previous_object` for the object before it was updated (#4184)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ private function getBundlesResourcesPaths(ContainerBuilder $container, array $co

private function getResourcesToWatch(ContainerBuilder $container, array $config): array
{
$paths = array_unique(array_merge($config['mapping']['paths'], $this->getBundlesResourcesPaths($container, $config)));
$paths = array_unique(array_merge($this->getBundlesResourcesPaths($container, $config), $config['mapping']['paths']));

// Flex structure (only if nothing specified)
$projectDir = $container->getParameter('kernel.project_dir');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@
use Nelmio\ApiDocBundle\NelmioApiDocBundle;
use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\Exception\Doubler\MethodNotFoundException;
use Symfony\Bundle\SecurityBundle\SecurityBundle;
use Symfony\Component\Cache\Adapter\ArrayAdapter;
use Symfony\Component\Config\Resource\DirectoryResource;
Expand Down Expand Up @@ -898,16 +897,16 @@ static function (string $path): string {

self::assertSame(
$normalizePaths([
"{$fixturesDirectory}/Fixtures/TestBundle/Resources/config/api_resources.yml",
"{$fixturesDirectory}/Fixtures/TestBundle/Resources/config/api_resources/dummy_address.yml",
"{$fixturesDirectory}/Fixtures/TestBundle/Resources/config/api_resources/my_resource.yml",
"{$testsDirectory}/Bridge/Symfony/Bundle/DependencyInjection/Fixtures/resources/B.yaml",
"{$testsDirectory}/Bridge/Symfony/Bundle/DependencyInjection/Fixtures/resources/Bb.yaml",
"{$testsDirectory}/Bridge/Symfony/Bundle/DependencyInjection/Fixtures/resources/a.yaml",
"{$testsDirectory}/Bridge/Symfony/Bundle/DependencyInjection/Fixtures/resources/a/a.yaml",
"{$testsDirectory}/Bridge/Symfony/Bundle/DependencyInjection/Fixtures/resources/b/a.yaml",
"{$testsDirectory}/Bridge/Symfony/Bundle/DependencyInjection/Fixtures/resources/c.yaml",
"{$testsDirectory}/Bridge/Symfony/Bundle/DependencyInjection/Fixtures/resources/c/a.yaml",
"{$fixturesDirectory}/Fixtures/TestBundle/Resources/config/api_resources.yml",
"{$fixturesDirectory}/Fixtures/TestBundle/Resources/config/api_resources/dummy_address.yml",
"{$fixturesDirectory}/Fixtures/TestBundle/Resources/config/api_resources/my_resource.yml",
]),
$normalizePaths($paths)
);
Expand Down Expand Up @@ -1036,12 +1035,7 @@ private function getPartialContainerBuilderProphecy($configuration = null)
}

$containerBuilderProphecy->fileExists(Argument::type('string'))->shouldBeCalled();

try {
$containerBuilderProphecy->fileExists(Argument::type('string'))->shouldBeCalled();
} catch (MethodNotFoundException $e) {
$containerBuilderProphecy->addResource(Argument::type(ResourceInterface::class))->shouldBeCalled();
}
$containerBuilderProphecy->addResource(Argument::type(ResourceInterface::class))->shouldBeCalled();

$containerBuilderProphecy->hasExtension('http://symfony.com/schema/dic/services')->shouldBeCalled();

Expand Down