Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[DependencyInjection] fix tracking of changes to vendor/ dirs #40098

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

Merged
merged 1 commit into from
Feb 5, 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
Original file line number Diff line number Diff line change
Expand Up @@ -1655,14 +1655,14 @@ private function getExpressionLanguage(): ExpressionLanguage
private function inVendors(string $path): bool
{
if (null === $this->vendors) {
$resource = new ComposerResource();
$this->vendors = $resource->getVendors();
$this->addResource($resource);
$this->vendors = (new ComposerResource())->getVendors();
}
$path = realpath($path) ?: $path;

foreach ($this->vendors as $vendor) {
if (0 === strpos($path, $vendor) && false !== strpbrk(substr($path, \strlen($vendor), 1), '/'.\DIRECTORY_SEPARATOR)) {
$this->addResource(new FileResource($vendor.'/composer/installed.json'));

return true;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

use PHPUnit\Framework\TestCase;
use Psr\Container\ContainerInterface as PsrContainerInterface;
use Symfony\Component\Config\Resource\ComposerResource;
use Symfony\Component\Config\Resource\DirectoryResource;
use Symfony\Component\Config\Resource\FileResource;
use Symfony\Component\Config\Resource\ResourceInterface;
Expand Down Expand Up @@ -929,7 +928,7 @@ public function testAddObjectResource()

$resources = $container->getResources();

$this->assertCount(2, $resources, '2 resources were registered');
$this->assertCount(1, $resources);

/* @var $resource \Symfony\Component\Config\Resource\FileResource */
$resource = end($resources);
Expand Down Expand Up @@ -958,9 +957,9 @@ public function testGetReflectionClass()

$resources = $container->getResources();

$this->assertCount(3, $resources, '3 resources were registered');
$this->assertCount(2, $resources);

$this->assertSame('reflection.BarClass', (string) $resources[1]);
$this->assertSame('reflection.BarClass', (string) $resources[0]);
$this->assertSame('BarMissingClass', (string) end($resources));
}

Expand Down Expand Up @@ -1021,7 +1020,6 @@ public function testResources()
public function testFileExists()
{
$container = new ContainerBuilder();
$A = new ComposerResource();
$a = new FileResource(__DIR__.'/Fixtures/xml/services1.xml');
$b = new FileResource(__DIR__.'/Fixtures/xml/services2.xml');
$c = new DirectoryResource($dir = \dirname($b));
Expand All @@ -1035,7 +1033,7 @@ public function testFileExists()
}
}

$this->assertEquals([$A, $a, $b, $c], $resources, '->getResources() returns an array of resources read for the current configuration');
$this->assertEquals([$a, $b, $c], $resources, '->getResources() returns an array of resources read for the current configuration');
}

public function testExtension()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function testLoadAddsTheGlobResourceToTheContainer()
$loader = new GlobFileLoaderWithoutImport($container = new ContainerBuilder(), new FileLocator());
$loader->load(__DIR__.'/../Fixtures/config/*');

$this->assertEquals(new GlobResource(__DIR__.'/../Fixtures/config', '/*', false), $container->getResources()[1]);
$this->assertEquals(new GlobResource(__DIR__.'/../Fixtures/config', '/*', false), $container->getResources()[0]);
}
}

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.