Permalink
Browse files

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
  • Loading branch information...
2 parents 7c727e4 + f36f666 commit e0402bae65c239da87774eabb9e3b8f8ecbf2982 @fabpot fabpot committed Jan 1, 2014
Showing with 141 additions and 77 deletions.
  1. +0 −1 src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php
  2. +0 −1 src/Symfony/Bundle/FrameworkBundle/Controller/ControllerResolver.php
  3. +0 −1 src/Symfony/Bundle/FrameworkBundle/Templating/DelegatingEngine.php
  4. +40 −3 src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php
  5. +0 −1 src/Symfony/Component/Config/Definition/Builder/EnumNodeDefinition.php
  6. +0 −1 src/Symfony/Component/Config/Definition/EnumNode.php
  7. +0 −1 src/Symfony/Component/Config/Definition/ScalarNode.php
  8. +0 −1 src/Symfony/Component/Console/Output/ConsoleOutput.php
  9. +0 −2 src/Symfony/Component/Console/Output/ConsoleOutputInterface.php
  10. +0 −1 src/Symfony/Component/Console/Shell.php
  11. +0 −1 src/Symfony/Component/CssSelector/XPath/Translator.php
  12. +0 −1 src/Symfony/Component/DependencyInjection/Compiler/Compiler.php
  13. +0 −1 src/Symfony/Component/Finder/Tests/FinderTest.php
  14. +0 −2 src/Symfony/Component/Finder/Tests/Iterator/FilecontentFilterIteratorTest.php
  15. +0 −5 src/Symfony/Component/Form/Extension/Csrf/CsrfExtension.php
  16. +0 −1 src/Symfony/Component/Form/Extension/Validator/ValidatorExtension.php
  17. +0 −1 src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationMapper.php
  18. +0 −2 src/Symfony/Component/Form/NativeRequestHandler.php
  19. +0 −1 src/Symfony/Component/HttpFoundation/Session/Session.php
  20. +0 −1 src/Symfony/Component/HttpFoundation/Session/Storage/MockArraySessionStorage.php
  21. +0 −1 src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php
  22. +0 −1 src/Symfony/Component/HttpFoundation/Session/Storage/PhpBridgeSessionStorage.php
  23. +0 −1 src/Symfony/Component/HttpFoundation/Session/Storage/SessionStorageInterface.php
  24. +0 −1 src/Symfony/Component/HttpKernel/Client.php
  25. +0 −1 src/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php
  26. +0 −1 src/Symfony/Component/HttpKernel/DataCollector/RouterDataCollector.php
  27. +0 −4 src/Symfony/Component/HttpKernel/DataCollector/TimeDataCollector.php
  28. +0 −1 src/Symfony/Component/HttpKernel/DependencyInjection/AddClassesToCachePass.php
  29. +0 −1 src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php
  30. +0 −1 src/Symfony/Component/HttpKernel/Kernel.php
  31. +0 −1 src/Symfony/Component/HttpKernel/KernelInterface.php
  32. +0 −1 src/Symfony/Component/HttpKernel/Profiler/Profiler.php
  33. +0 −1 src/Symfony/Component/Intl/DateFormatter/DateFormat/FullTransformer.php
  34. +0 −2 src/Symfony/Component/Intl/Exception/MethodArgumentNotImplementedException.php
  35. +0 −2 src/Symfony/Component/Intl/Exception/MethodArgumentValueNotImplementedException.php
  36. +0 −1 src/Symfony/Component/Routing/Matcher/TraceableUrlMatcher.php
  37. +101 −0 src/Symfony/Component/Routing/Tests/RequestContextTest.php
  38. +0 −1 src/Symfony/Component/Security/Core/Encoder/BCryptPasswordEncoder.php
  39. +0 −2 src/Symfony/Component/Security/Core/Exception/NonceExpiredException.php
  40. +0 −1 src/Symfony/Component/Security/Http/EntryPoint/BasicAuthenticationEntryPoint.php
  41. +0 −1 src/Symfony/Component/Security/Http/EntryPoint/DigestAuthenticationEntryPoint.php
  42. +0 −1 src/Symfony/Component/Security/Http/EntryPoint/FormAuthenticationEntryPoint.php
  43. +0 −1 src/Symfony/Component/Security/Http/EntryPoint/RetryAuthenticationEntryPoint.php
  44. +0 −1 src/Symfony/Component/Security/Http/Logout/DefaultLogoutSuccessHandler.php
  45. +0 −1 src/Symfony/Component/Serializer/Encoder/ChainDecoder.php
  46. +0 −2 src/Symfony/Component/Serializer/Encoder/ChainEncoder.php
  47. +0 −2 src/Symfony/Component/Serializer/SerializerAwareInterface.php
  48. +0 −3 src/Symfony/Component/Templating/TemplateNameParser.php
  49. +0 −2 src/Symfony/Component/Validator/ConstraintValidatorFactoryInterface.php
  50. +0 −2 src/Symfony/Component/Validator/Constraints/Collection.php
  51. +0 −1 src/Symfony/Component/Validator/Constraints/CollectionValidator.php
  52. +0 −1 src/Symfony/Component/Validator/Tests/Constraints/EqualToValidatorTest.php
  53. +0 −1 src/Symfony/Component/Validator/Tests/Constraints/IdenticalToValidatorTest.php
  54. +0 −1 src/Symfony/Component/Validator/Tests/Constraints/NotEqualToValidatorTest.php
  55. +0 −1 src/Symfony/Component/Validator/Tests/Constraints/NotIdenticalToValidatorTest.php
  56. +0 −2 src/Symfony/Component/Validator/ValidatorInterface.php
@@ -11,7 +11,6 @@
namespace Symfony\Bundle\FrameworkBundle\Command;
-use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Translation\Catalogue\DiffOperation;
use Symfony\Component\Translation\Catalogue\MergeOperation;
use Symfony\Component\Console\Input\InputInterface;
@@ -14,7 +14,6 @@
use Psr\Log\LoggerInterface;
use Symfony\Component\HttpKernel\Controller\ControllerResolver as BaseControllerResolver;
use Symfony\Component\DependencyInjection\ContainerInterface;
-use Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
/**
@@ -13,7 +13,6 @@
use Symfony\Component\Templating\DelegatingEngine as BaseDelegatingEngine;
use Symfony\Component\DependencyInjection\ContainerInterface;
-use Symfony\Bundle\FrameworkBundle\Templating\EngineInterface;
use Symfony\Component\HttpFoundation\Response;
/**
@@ -69,13 +69,26 @@ public function load(array $configs, ContainerBuilder $container)
}
// register bundles as Twig namespaces
- foreach ($container->getParameter('kernel.bundles') as $bundle => $class) {
+ $bundles = $this->getBundlesByChildPriority($container);
+ foreach ($bundles as $bundle => $bundleReflection) {
+ /** @var \Symfony\Component\HttpKernel\Bundle\BundleInterface $bundleInstance */
+ $bundleInstance = $bundleReflection->newInstance();
+
+ if (null !== $parentBundle = $bundleInstance->getParent()) {
+ if (is_dir($dir = $container->getParameter('kernel.root_dir').'/Resources/'.$bundle.'/views')) {
+ $this->addTwigPath($twigFilesystemLoaderDefinition, $dir, $parentBundle);
+ }
+
+ if (is_dir($dir = $bundleInstance->getPath().'/Resources/views')) {
+ $this->addTwigPath($twigFilesystemLoaderDefinition, $dir, $parentBundle);
+ }
+ }
+
if (is_dir($dir = $container->getParameter('kernel.root_dir').'/Resources/'.$bundle.'/views')) {
$this->addTwigPath($twigFilesystemLoaderDefinition, $dir, $bundle);
}
- $reflection = new \ReflectionClass($class);
- if (is_dir($dir = dirname($reflection->getFilename()).'/Resources/views')) {
+ if (is_dir($dir = $bundleInstance->getPath().'/Resources/views')) {
$this->addTwigPath($twigFilesystemLoaderDefinition, $dir, $bundle);
}
}
@@ -130,12 +143,36 @@ public function load(array $configs, ContainerBuilder $container)
));
}
+ /**
+ * @param ContainerBuilder $container
+ * @return array | \ReflectionClass[]
+ */
+ private function getBundlesByChildPriority(ContainerBuilder $container)
+ {
+ $childBundles = array();
+ $parentBundles = array();
+
+ foreach ($container->getParameter('kernel.bundles') as $bundle => $class) {
+ $reflection = new \ReflectionClass($class);
+
+ $bundleInstance = $reflection->newInstance();
+ if (null === $bundleInstance->getParent()) {
+ $parentBundles[$bundle] = $reflection;
+ } else {
+ $childBundles[$bundle] = $reflection;
+ }
+ }
+
+ return array_merge($childBundles, $parentBundles);
+ }
+
private function addTwigPath($twigFilesystemLoaderDefinition, $dir, $bundle)
{
$name = $bundle;
if ('Bundle' === substr($name, -6)) {
$name = substr($name, 0, -6);
}
+
$twigFilesystemLoaderDefinition->addMethodCall('addPath', array($dir, $name));
}
@@ -12,7 +12,6 @@
namespace Symfony\Component\Config\Definition\Builder;
use Symfony\Component\Config\Definition\EnumNode;
-use Symfony\Component\Config\Definition\Builder\ScalarNodeDefinition;
/**
* Enum Node Definition.
@@ -12,7 +12,6 @@
namespace Symfony\Component\Config\Definition;
use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
-use Symfony\Component\Config\Definition\ScalarNode;
/**
* Node which only allows a finite set of values.
@@ -11,7 +11,6 @@
namespace Symfony\Component\Config\Definition;
-use Symfony\Component\Config\Definition\VariableNode;
use Symfony\Component\Config\Definition\Exception\InvalidTypeException;
/**
@@ -12,7 +12,6 @@
namespace Symfony\Component\Console\Output;
use Symfony\Component\Console\Formatter\OutputFormatterInterface;
-use Symfony\Component\Console\Output\ConsoleOutputInterface;
/**
* ConsoleOutput is the default class for all CLI output. It uses STDOUT.
@@ -11,8 +11,6 @@
namespace Symfony\Component\Console\Output;
-use Symfony\Component\Console\Output\OutputInterface;
-
/**
* ConsoleOutputInterface is the interface implemented by ConsoleOutput class.
* This adds information about stderr output stream.
@@ -11,7 +11,6 @@
namespace Symfony\Component\Console;
-use Symfony\Component\Console\Application;
use Symfony\Component\Console\Input\StringInput;
use Symfony\Component\Console\Output\ConsoleOutput;
use Symfony\Component\Process\ProcessBuilder;
@@ -17,7 +17,6 @@
use Symfony\Component\CssSelector\Node\SelectorNode;
use Symfony\Component\CssSelector\Parser\Parser;
use Symfony\Component\CssSelector\Parser\ParserInterface;
-use Symfony\Component\CssSelector\XPath\Extension;
/**
* XPath expression translator interface.
@@ -12,7 +12,6 @@
namespace Symfony\Component\DependencyInjection\Compiler;
use Symfony\Component\DependencyInjection\ContainerBuilder;
-use Symfony\Component\DependencyInjection\Compiler\PassConfig;
/**
* This class is used to remove circular dependencies between individual passes.
@@ -13,7 +13,6 @@
use Symfony\Component\Finder\Finder;
use Symfony\Component\Finder\Adapter;
-use Symfony\Component\Finder\Tests\FakeAdapter;
class FinderTest extends Iterator\RealIteratorTestCase
{
@@ -12,8 +12,6 @@
namespace Symfony\Component\Finder\Tests\Iterator;
use Symfony\Component\Finder\Iterator\FilecontentFilterIterator;
-use Symfony\Component\Finder\Tests\Iterator\MockSplFileInfo;
-use Symfony\Component\Finder\Tests\Iterator\MockFileListIterator;
class FilecontentFilterIteratorTest extends IteratorTestCase
{
@@ -13,11 +13,6 @@
use Symfony\Component\Form\Exception\UnexpectedTypeException;
use Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfProviderAdapter;
-use Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfProviderInterface;
-use Symfony\Component\Form\Extension\Csrf\Type;
-use Symfony\Component\Form\AbstractExtension;
-use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface;
-use Symfony\Component\Translation\TranslatorInterface;
/**
* This extension protects forms by using a CSRF token.
@@ -11,7 +11,6 @@
namespace Symfony\Component\Form\Extension\Validator;
-use Symfony\Component\Form\Extension\Validator\Type;
use Symfony\Component\Form\Extension\Validator\Constraints\Form;
use Symfony\Component\Form\AbstractExtension;
use Symfony\Component\Validator\ValidatorInterface;
@@ -16,7 +16,6 @@
use Symfony\Component\PropertyAccess\PropertyPathIterator;
use Symfony\Component\PropertyAccess\PropertyPathBuilder;
use Symfony\Component\PropertyAccess\PropertyPathIteratorInterface;
-use Symfony\Component\Form\Extension\Validator\ViolationMapper\ViolationPathIterator;
use Symfony\Component\Form\FormError;
use Symfony\Component\Validator\ConstraintViolation;
@@ -12,8 +12,6 @@
namespace Symfony\Component\Form;
use Symfony\Component\Form\Exception\UnexpectedTypeException;
-use Symfony\Component\Form\FormInterface;
-use Symfony\Component\Form\RequestHandlerInterface;
/**
* A request handler using PHP's super globals $_GET, $_POST and $_SERVER.
@@ -16,7 +16,6 @@
use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBagInterface;
use Symfony\Component\HttpFoundation\Session\Flash\FlashBag;
use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface;
-use Symfony\Component\HttpFoundation\Session\SessionBagInterface;
use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage;
/**
@@ -12,7 +12,6 @@
namespace Symfony\Component\HttpFoundation\Session\Storage;
use Symfony\Component\HttpFoundation\Session\SessionBagInterface;
-use Symfony\Component\HttpFoundation\Session\Storage\MetadataBag;
/**
* MockArraySessionStorage mocks the session for unit tests.
@@ -13,7 +13,6 @@
use Symfony\Component\HttpFoundation\Session\SessionBagInterface;
use Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeSessionHandler;
-use Symfony\Component\HttpFoundation\Session\Storage\MetadataBag;
use Symfony\Component\HttpFoundation\Session\Storage\Proxy\NativeProxy;
use Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy;
use Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy;
@@ -11,7 +11,6 @@
namespace Symfony\Component\HttpFoundation\Session\Storage;
-use Symfony\Component\HttpFoundation\Session\Storage\MetadataBag;
use Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy;
use Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeSessionHandler;
@@ -12,7 +12,6 @@
namespace Symfony\Component\HttpFoundation\Session\Storage;
use Symfony\Component\HttpFoundation\Session\SessionBagInterface;
-use Symfony\Component\HttpFoundation\Session\Storage\MetadataBag;
/**
* StorageInterface.
@@ -17,7 +17,6 @@
use Symfony\Component\BrowserKit\Cookie as DomCookie;
use Symfony\Component\BrowserKit\History;
use Symfony\Component\BrowserKit\CookieJar;
-use Symfony\Component\HttpKernel\TerminableInterface;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
@@ -13,7 +13,6 @@
use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\HttpKernel\Kernel;
-use Symfony\Component\HttpKernel\DataCollector\DataCollector;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
@@ -14,7 +14,6 @@
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\RedirectResponse;
-use Symfony\Component\HttpKernel\DataCollector\DataCollector;
use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
/**
@@ -13,10 +13,6 @@
use Symfony\Component\HttpKernel\DataCollector\DataCollector;
use Symfony\Component\HttpKernel\DataCollector\LateDataCollectorInterface;
-use Symfony\Component\HttpKernel\KernelInterface;
-use Symfony\Component\HttpFoundation\Request;
-use Symfony\Component\HttpFoundation\Response;
-use Symfony\Component\Stopwatch\Stopwatch;
/**
* TimeDataCollector.
@@ -13,7 +13,6 @@
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
-use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\HttpKernel\Kernel;
/**
@@ -19,7 +19,6 @@
use Symfony\Component\HttpKernel\TerminableInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
-use Symfony\Component\HttpKernel\HttpCache\Esi;
/**
* Cache provides HTTP caching.
@@ -24,7 +24,6 @@
use Symfony\Component\DependencyInjection\Loader\ClosureLoader;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
-use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\Bundle\BundleInterface;
use Symfony\Component\HttpKernel\Config\FileLocator;
use Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass;
@@ -12,7 +12,6 @@
namespace Symfony\Component\HttpKernel;
use Symfony\Component\DependencyInjection\ContainerInterface;
-use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\Bundle\BundleInterface;
use Symfony\Component\Config\Loader\LoaderInterface;
@@ -13,7 +13,6 @@
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
-use Symfony\Component\HttpKernel\Profiler\ProfilerStorageInterface;
use Symfony\Component\HttpKernel\DataCollector\DataCollectorInterface;
use Symfony\Component\HttpKernel\DataCollector\LateDataCollectorInterface;
use Psr\Log\LoggerInterface;
@@ -13,7 +13,6 @@
use Symfony\Component\Intl\Exception\NotImplementedException;
use Symfony\Component\Intl\Globals\IntlGlobals;
-use Symfony\Component\Intl\DateFormatter\DateFormat\MonthTransformer;
/**
* Parser and formatter for date formats
@@ -11,8 +11,6 @@
namespace Symfony\Component\Intl\Exception;
-use Symfony\Component\Intl\Exception\NotImplementedException;
-
/**
* @author Eriksen Costa <eriksen.costa@infranology.com.br>
*/
@@ -11,8 +11,6 @@
namespace Symfony\Component\Intl\Exception;
-use Symfony\Component\Intl\Exception\NotImplementedException;
-
/**
* @author Eriksen Costa <eriksen.costa@infranology.com.br>
*/
@@ -14,7 +14,6 @@
use Symfony\Component\Routing\Exception\ExceptionInterface;
use Symfony\Component\Routing\Route;
use Symfony\Component\Routing\RouteCollection;
-use Symfony\Component\Routing\Matcher\UrlMatcher;
/**
* TraceableUrlMatcher helps debug path info matching by tracing the match.
Oops, something went wrong.

0 comments on commit e0402ba

Please sign in to comment.