8000 Merge branch '2.3' into 2.4 · symfony/symfony@e0402ba · GitHub
[go: up one dir, main page]

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

Commit e0402ba

Browse files
committed
Merge branch '2.3' into 2.4
* 2.3: removed unneeded use statements Prepend Child Bundle paths before the parent [Routing] add unit tests for Symfony\Component\Routing\RequestContext class Conflicts: src/Symfony/Component/Form/Extension/Csrf/CsrfExtension.php src/Symfony/Component/HttpKernel/DataCollector/TimeDataCollector.php src/Symfony/Component/Validator/ConstraintValidatorFactory.php
2 parents 7c727e4 + f36f666 commit e0402ba

File tree

56 files changed

+141
-77
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+141
-77
lines changed

src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Bundle\FrameworkBundle\Command;
1313

14-
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
1514
use Symfony\Component\Translation\Catalogue\DiffOperation;
1615
use Symfony\Component\Translation\Catalogue\MergeOperation;
1716
use Symfony\Component\Console\Input\InputInterface;

src/Symfony/Bundle/FrameworkBundle/Controller/ControllerResolver.php

Lines changed: 0 additions & 1 deletion
< 57AE td data-grid-cell-id="diff-1f7f244e60c1683d62a1bb1ec8695ed27fced3ea0efff8f2be210e7f50513ed1-15-15-1" data-selected="false" role="gridcell" style="background-color:var(--bgColor-default);text-align:center" tabindex="-1" valign="top" class="focusable-grid-cell diff-line-number position-relative diff-line-number-neutral left-side">15
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use Psr\Log\LoggerInterface;
15
use Symfony\Component\HttpKernel\Controller\ControllerResolver as BaseControllerResolver;
1616
use Symfony\Component\DependencyInjection\ContainerInterface;
17-
use Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser;
1817
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
1918

2019
/**

src/Symfony/Bundle/FrameworkBundle/Templating/DelegatingEngine.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
use Symfony\Component\Templating\DelegatingEngine as BaseDelegatingEngine;
1515
use Symfony\Component\DependencyInjection\ContainerInterface;
16-
use Symfony\Bundle\FrameworkBundle\Templating\EngineInterface;
1716
use Symfony\Component\HttpFoundation\Response;
1817

1918
/**

src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,26 @@ public function load(array $configs, ContainerBuilder $container)
6969
}
7070

7171
// register bundles as Twig namespaces
72-
foreach ($container->getParameter('kernel.bundles') as $bundle => $class) {
72+
$bundles = $this->getBundlesByChildPriority($container);
73+
foreach ($bundles as $bundle => $bundleReflection) {
74+
/** @var \Symfony\Component\HttpKernel\Bundle\BundleInterface $bundleInstance */
75+
$bundleInstance = $bundleReflection->newInstance();
76+
77+
if (null !== $parentBundle = $bundleInstance->getParent()) {
78+
if (is_dir($dir = $container->getParameter('kernel.root_dir').'/Resources/'.$bundle.'/views')) {
79+
$this->addTwigPath($twigFilesystemLoaderDefinition, $dir, $parentBundle);
80+
}
81+
82+
if (is_dir($dir = $bundleInstance->getPath().'/Resources/views')) {
83+
$this->addTwigPath($twigFilesystemLoaderDefinition, $dir, $parentBundle);
84+
}
85+
}
86+
7387
if (is_dir($dir = $container->getParameter('kernel.root_dir').'/Resources/'.$bundle.'/views')) {
7488
$this->addTwigPath($twigFilesystemLoaderDefinition, $dir, $bundle);
7589
}
7690

77-
$reflection = new \ReflectionClass($class);
78-
if (is_dir($dir = dirname($reflection->getFilename()).'/Resources/views')) {
91+
if (is_dir($dir = $bundleInstance->getPath().'/Resources/views')) {
7992
$this->addTwigPath($twigFilesystemLoaderDefinition, $dir, $bundle);
8093
}
8194
}
@@ -130,12 +143,36 @@ public function load(array $configs, ContainerBuilder $container)
130143
));
131144
}
132145

146+
/**
147+
* @param ContainerBuilder $container
148+
* @return array | \ReflectionClass[]
149+
*/
150+
private function getBundlesByChildPriority(ContainerBuilder $container)
151+
{
152+
$childBundles = array();
153+
$parentBundles = array();
154+
155+
foreach ($container->getParameter('kernel.bundles') as $bundle => $class) {
156+
$reflection = new \ReflectionClass($class);
157+
158+
$bundleInstance = $reflection->newInstance();
159+
if (null === $bundleInstance->getParent()) {
160+
$parentBundles[$bundle] = $reflection;
161+
} else {
162+
$childBundles[$bundle] = $reflection;
163+
}
164+
}
165+
166+
return array_merge($childBundles, $parentBundles);
167+
}
168+
133169
private function addTwigPath($twigFilesystemLoaderDefinition, $dir, $bundle)
134170
{
135171
$name = $bundle;
136172
if ('Bundle' === substr($name, -6)) {
137173
$name = substr($name, 0, -6);
138174
}
175+
139176
$twigFilesystemLoaderDefinition->addMethodCall('addPath', array($dir, $name));
140177
}
141178

src/Symfony/Component/Config/Definition/Builder/EnumNodeDefinition.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Component\Config\Definition\Builder;
1313

1414
use Symfony\Component\Config\Definition\EnumNode;
15-
use Symfony\Component\Config\Definition\Builder\ScalarNodeDefinition;
1615

1716
/**
1817
* Enum Node Definition.

src/Symfony/Component/Config/Definition/EnumNode.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Component\Config\Definition;
1313

1414
use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
15-
use Symfony\Component\Config\Definition\ScalarNode;
1615

1716
/**
1817
* Node which only allows a finite set of values.

src/Symfony/Component/Config/Definition/ScalarNode.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Component\Config\Definition;
1313

14-
use Symfony\Component\Config\Definition\VariableNode;
1514
use Symfony\Component\Config\Definition\Exception\InvalidTypeException;
1615

1716
/**

src/Symfony/Component/Console/Output/ConsoleOutput.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Component\Console\Output;
1313

1414
use Symfony\Component\Console\Formatter\OutputFormatterInterface;
15-
use Symfony\Component\Console\Output\ConsoleOutputInterface;
1615

1716
/**
1817
* ConsoleOutput is the default class for all CLI output. It uses STDOUT.

src/Symfony/Component/Console/Output/ConsoleOutputInterface.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111

1212
namespace Symfony\Component\Console\Output;
1313

14-
use Symfony\Component\Console\Output\OutputInterface;
15-
1614
/**
1715
* ConsoleOutputInterface is the interface implemented by ConsoleOutput class.
1816
* This adds information about stderr output stream.

src/Symfony/Component/Console/Shell.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Component\Console;
1313

14-
use Symfony\Component\Console\Application;
1514
use Symfony\Component\Console\Input\StringInput;
1615
use Symfony\Component\Console\Output\ConsoleOutput;
1716
use Symfony\Component\Process\ProcessBuilder;

src/Symfony/Component/CssSelector/XPath/Translator.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
use Symfony\Component\CssSelector\Node\SelectorNode;
1818
use Symfony\Component\CssSelector\Parser\Parser;
1919
use Symfony\Component\CssSelector\Parser\ParserInterface;
20-
use Symfony\Component\CssSelector\XPath\Extension;
2120

2221
/**
2322
* XPath expression translator interface.

src/Symfony/Component/DependencyInjection/Compiler/Compiler.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Component\DependencyInjection\Compiler;
1313

1414
use Symfony\Component\DependencyInjection\ContainerBuilder;
15-
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
1615

1716
/**
1817
* This class is used to remove circular dependencies between individual passes.

src/Symfony/Component/Finder/Tests/FinderTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
use Symfony\Component\Finder\Finder;
1515
use Symfony\Component\Finder\Adapter;
16-
use Symfony\Component\Finder\Tests\FakeAdapter;
1716

1817
class FinderTest extends Iterator\RealIteratorTestCase
1918
{

src/Symfony/Component/Finder/Tests/Iterator/FilecontentFilterIteratorTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
namespace Symfony\Component\Finder\Tests\Iterator;
1313

1414
use Symfony\Component\Finder\Iterator\FilecontentFilterIterator;
15-
use Symfony\Component\Finder\Tests\Iterator\MockSplFileInfo;
16-
use Symfony\Component\Finder\Tests\Iterator\MockFileListIterator;
1715

1816
class FilecontentFilterIteratorTest extends IteratorTestCase
1917
{

src/Symfony/Component/Form/Extension/Csrf/CsrfExtension.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@
1313

1414
use Symfony\Component\Form\Exception\UnexpectedTypeException;
1515
use Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfProviderAdapter;
16-
use Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfProviderInterface;
17-
use Symfony\Component\Form\Extension\Csrf\Type;
18-
use Symfony\Component\Form\AbstractExtension;
19-
use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface;
20-
use Symfony\Component\Translation\TranslatorInterface;
2116

2217
/**
2318
* This extension protects forms by using a CSRF token.

src/Symfony/Component/Form/Extension/Validator/ValidatorExtension.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Component\Form\Extension\Validator;
1313

14-
use Symfony\Component\Form\Extension\Validator\Type;
1514
use Symfony\Component\Form\Extension\Validator\Constraints\Form;
1615
use Symfony\Component\Form\AbstractExtension;
1716
use Symfony\Component\Validator\ValidatorInterface;

src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationMapper.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
use Symfony\Component\PropertyAccess\PropertyPathIterator;
1717
use Symfony\Component\PropertyAccess\PropertyPathBuilder;
1818
use Symfony\Component\PropertyAccess\PropertyPathIteratorInterface;
19-
use Symfony\Component\Form\Extension\Validator\ViolationMapper\ViolationPathIterator;
2019
use Symfony\Component\Form\FormError;
2120
use Symfony\Component\Validator\ConstraintViolation;
2221

src/Symfony/Component/Form/NativeRequestHandler.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
namespace Symfony\Component\Form;
1313

1414
use Symfony\Component\Form\Exception\UnexpectedTypeException;
15-
use Symfony\Component\Form\FormInterface;
16-
use Symfony\Component\Form\RequestHandlerInterface;
1715

1816
/**
1917
* A request handler using PHP's super globals $_GET, $_POST and $_SERVER.

src/Symfony/Component/HttpFoundation/Session/Session.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBagInterface;
1717
use Symfony\Component\HttpFoundation\Session\Flash\FlashBag;
1818
use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface;
19-
use Symfony\Component\HttpFoundation\Session\SessionBagInterface;
2019
use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage;
2120

2221
/**

src/Symfony/Component/HttpFoundation/Session/Storage/MockArraySessionStorage.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Component\HttpFoundation\Session\Storage;
1313

1414
use Symfony\Component\HttpFoundation\Session\SessionBagInterface;
15-
use Symfony\Component\HttpFoundation\Session\Storage\MetadataBag;
1615

1716
/**
1817
* MockArraySessionStorage mocks the session for unit tests.

src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
use Symfony\Component\HttpFoundation\Session\SessionBagInterface;
1515
use Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeSessionHandler;
16-
use Symfony\Component\HttpFoundation\Session\Storage\MetadataBag;
1716
use Symfony\Component\HttpFoundation\Session\Storage\Proxy\NativeProxy;
1817
use Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy;
1918
use Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy;

src/Symfony/Component/HttpFoundation/Session/Storage/PhpBridgeSessionStorage.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Component\HttpFoundation\Session\Storage;
1313

14-
use Symfony\Component\HttpFoundation\Session\Storage\MetadataBag;
1514
use Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy;
1615
use Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeSessionHandler;
1716

src/Symfony/Component/HttpFoundation/Session/Storage/SessionStorageInterface.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Component\HttpFoundation\Session\Storage;
1313

1414
use Symfony\Component\HttpFoundation\Session\SessionBagInterface;
15-
use Symfony\Component\HttpFoundation\Session\Storage\MetadataBag;
1615

1716
/**
1817
* StorageInterface.

src/Symfony/Component/HttpKernel/Client.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
use Symfony\Component\BrowserKit\Cookie as DomCookie;
1818
use Symfony\Component\BrowserKit\History;
1919
use Symfony\Component\BrowserKit\CookieJar;
20-
use Symfony\Component\HttpKernel\TerminableInterface;
2120
use Symfony\Component\HttpFoundation\File\UploadedFile;
2221
use Symfony\Component\HttpFoundation\Request;
2322
use Symfony\Component\HttpFoundation\Response;

src/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
use Symfony\Component\HttpKernel\KernelInterface;
1515
use Symfony\Component\HttpKernel\Kernel;
16-
use Symfony\Component\HttpKernel\DataCollector\DataCollector;
1716
use Symfony\Component\HttpFoundation\Request;
1817
use Symfony\Component\HttpFoundation\Response;
1918

src/Symfony/Component/HttpKernel/DataCollector/RouterDataCollector.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use Symfony\Component\HttpFoundation\Request;
1515
use Symfony\Component\HttpFoundation\Response;
1616
use Symfony\Component\HttpFoundation\RedirectResponse;
17-
use Symfony\Component\HttpKernel\DataCollector\DataCollector;
1817
use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
1918

2019
/**

src/Symfony/Component/HttpKernel/DataCollector/TimeDataCollector.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@
1313

1414
use Symfony\Component\HttpKernel\DataCollector\DataCollector;
1515
use Symfony\Component\HttpKernel\DataCollector\LateDataCollectorInterface;
16-
use Symfony\Component\HttpKernel\KernelInterface;
17-
use Symfony\Component\HttpFoundation\Request;
18-
use Symfony\Component\HttpFoundation\Response;
19-
use Symfony\Component\Stopwatch\Stopwatch;
2016

2117
/**
2218
* TimeDataCollector.

src/Symfony/Component/HttpKernel/DependencyInjection/AddClassesToCachePass.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
use Symfony\Component\DependencyInjection\ContainerBuilder;
1515
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
16-
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
1716
use Symfony\Component\HttpKernel\Kernel;
1817

1918
/**

src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
use Symfony\Component\HttpKernel\TerminableInterface;
2020
use Symfony\Component\HttpFoundation\Request;
2121
use Symfony\Component\HttpFoundation\Response;
22-
use Symfony\Component\HttpKernel\HttpCache\Esi;
2322

2423
/**
2524
* Cache provides HTTP caching.

src/Symfony/Component/HttpKernel/Kernel.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
use Symfony\Component\DependencyInjection\Loader\ClosureLoader;
2525
use Symfony\Component\HttpFoundation\Request;
2626
use Symfony\Component\HttpFoundation\Response;
27-
use Symfony\Component\HttpKernel\HttpKernelInterface;
2827
use Symfony\Component\HttpKernel\Bundle\BundleInterface;
2928
use Symfony\Component\HttpKernel\Config\FileLocator;
3029
use Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass;

src/Symfony/Component/HttpKernel/KernelInterface.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Component\HttpKernel;
1313

1414
use Symfony\Component\DependencyInjection\ContainerInterface;
15-
use Symfony\Component\HttpKernel\HttpKernelInterface;
1615
use Symfony\Component\HttpKernel\Bundle\BundleInterface;
1716
use Symfony\Component\Config\Loader\LoaderInterface;
1817

src/Symfony/Component/HttpKernel/Profiler/Profiler.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
use Symfony\Component\HttpFoundation\Request;
1515
use Symfony\Component\HttpFoundation\Response;
16-
use Symfony\Component\HttpKernel\Profiler\ProfilerStorageInterface;
1716
use Symfony\Component\HttpKernel\DataCollector\DataCollectorInterface;
1817
use Symfony\Component\HttpKernel\DataCollector\LateDataCollectorInterface;
1918
use Psr\Log\LoggerInterface;

src/Symfony/Component/Intl/DateFormatter/DateFormat/FullTransformer.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
use Symfony\Component\Intl\Exception\NotImplementedException;
1515
use Symfony\Component\Intl\Globals\IntlGlobals;
16-
use Symfony\Component\Intl\DateFormatter\DateFormat\MonthTransformer;
1716

1817
/**
1918
* Parser and formatter for date formats

src/Symfony/Component/Intl/Exception/MethodArgumentNotImplementedException.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111

1212
namespace Symfony\Component\Intl\Exception;
1313

14-
use Symfony\Component\Intl\Exception\NotImplementedException;
15-
1614
/**
1715
* @author Eriksen Costa <eriksen.costa@infranology.com.br>
1816
*/

src/Symfony/Component/Intl/Exception/MethodArgumentValueNotImplementedException.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111

1212
namespace Symfony\Component\Intl\Exception;
1313

14-
use Symfony\Component\Intl\Exception\NotImplementedException;
15-
1614
/**
1715
* @author Eriksen Costa <eriksen.costa@infranology.com.br>
1816
*/

src/Symfony/Component/Routing/Matcher/TraceableUrlMatcher.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use Symfony\Component\Routing\Exception\ExceptionInterface;
1515
use Symfony\Component\Routing\Route;
1616
use Symfony\Component\Routing\RouteCollection;
17-
use Symfony\Component\Routing\Matcher\UrlMatcher;
1817

1918
/**
2019
* TraceableUrlMatcher helps debug path info matching by tracing the match.

0 commit comments

Comments
 (0)
0