Commit 93c75faa authored by alexpott's avatar alexpott
Browse files

Issue #2377281 by hussainweb: Upgrade to Symfony 2.6 stable

parent 596978a7
......@@ -4,7 +4,7 @@
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "34a4f5a56891e51217c305b97e8cc675",
"hash": "fce47406c708047e654d8274620405e8",
"packages": [
{
"name": "doctrine/annotations",
......@@ -1643,17 +1643,17 @@
},
{
"name": "symfony/class-loader",
"version": "v2.6.0-BETA1",
"version": "v2.6.0",
"target-dir": "Symfony/Component/ClassLoader",
"source": {
"type": "git",
"url": "https://github.com/symfony/ClassLoader.git",
"reference": "d1a16139ea522ec3cc20801b7e19cd3cafd12d8c"
"reference": "b403af3d4fa3a2c3c926121c05042107e3a5b916"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/ClassLoader/zipball/d1a16139ea522ec3cc20801b7e19cd3cafd12d8c",
"reference": "d1a16139ea522ec3cc20801b7e19cd3cafd12d8c",
"url": "https://api.github.com/repos/symfony/ClassLoader/zipball/b403af3d4fa3a2c3c926121c05042107e3a5b916",
"reference": "b403af3d4fa3a2c3c926121c05042107e3a5b916",
"shasum": ""
},
"require": {
......@@ -1689,11 +1689,11 @@
],
"description": "Symfony ClassLoader Component",
"homepage": "http://symfony.com",
"time": "2014-11-03 03:55:50"
"time": "2014-11-20 13:24:23"
},
{
"name": "symfony/css-selector",
"version": "v2.6.0-BETA1",
"version": "v2.6.0",
"target-dir": "Symfony/Component/CssSelector",
"source": {
"type": "git",
......@@ -1744,17 +1744,17 @@
},
{
"name": "symfony/debug",
"version": "v2.6.0-BETA1",
"version": "v2.6.0",
"target-dir": "Symfony/Component/Debug",
"source": {
"type": "git",
"url": "https://github.com/symfony/Debug.git",
"reference": "3548595c26175fdaca19cbec204668c22cda41f0"
"reference": "e1e27710efabc3f67a2d1f6710641b3bdca289d3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/Debug/zipball/3548595c26175fdaca19cbec204668c22cda41f0",
"reference": "3548595c26175fdaca19cbec204668c22cda41f0",
"url": "https://api.github.com/repos/symfony/Debug/zipball/e1e27710efabc3f67a2d1f6710641b3bdca289d3",
"reference": "e1e27710efabc3f67a2d1f6710641b3bdca289d3",
"shasum": ""
},
"require": {
......@@ -1796,21 +1796,21 @@
],
"description": "Symfony Debug Component",
"homepage": "http://symfony.com",
"time": "2014-10-28 10:06:58"
"time": "2014-11-28 10:00:40"
},
{
"name": "symfony/dependency-injection",
"version": "v2.6.0-BETA1",
"version": "v2.6.0",
"target-dir": "Symfony/Component/DependencyInjection",
"source": {
"type": "git",
"url": "https://github.com/symfony/DependencyInjection.git",
"reference": "926500fe0b8a6562c4e8b8166a1cb664733804aa"
"reference": "20bc8737876e4a2222101749b5547fd5acc24e30"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/DependencyInjection/zipball/926500fe0b8a6562c4e8b8166a1cb664733804aa",
"reference": "926500fe0b8a6562c4e8b8166a1cb664733804aa",
"url": "https://api.github.com/repos/symfony/DependencyInjection/zipball/20bc8737876e4a2222101749b5547fd5acc24e30",
"reference": "20bc8737876e4a2222101749b5547fd5acc24e30",
"shasum": ""
},
"require": {
......@@ -1853,21 +1853,21 @@
],
"description": "Symfony DependencyInjection Component",
"homepage": "http://symfony.com",
"time": "2014-11-03 03:55:50"
"time": "2014-11-28 10:00:40"
},
{
"name": "symfony/event-dispatcher",
"version": "v2.6.0-BETA1",
"version": "v2.6.0",
"target-dir": "Symfony/Component/EventDispatcher",
"source": {
"type": "git",
"url": "https://github.com/symfony/EventDispatcher.git",
"reference": "dcf345d5ed96bc6c3b4521c1989670d2c9e5014e"
"reference": "697331d4ac78668cf6d21a2bb009b3faae92814f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/dcf345d5ed96bc6c3b4521c1989670d2c9e5014e",
"reference": "dcf345d5ed96bc6c3b4521c1989670d2c9e5014e",
"url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/697331d4ac78668cf6d21a2bb009b3faae92814f",
"reference": "697331d4ac78668cf6d21a2bb009b3faae92814f",
"shasum": ""
},
"require": {
......@@ -1911,21 +1911,21 @@
],
"description": "Symfony EventDispatcher Component",
"homepage": "http://symfony.com",
"time": "2014-11-03 03:55:50"
"time": "2014-11-28 10:00:40"
},
{
"name": "symfony/http-foundation",
"version": "v2.6.0-BETA1",
"version": "v2.6.0",
"target-dir": "Symfony/Component/HttpFoundation",
"source": {
"type": "git",
"url": "https://github.com/symfony/HttpFoundation.git",
"reference": "4cd6c807598e560db7b3da50c4330fdb4808cfa1"
"reference": "bb46e43145184ce8c3069a8ea2c299fb53d432f9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/4cd6c807598e560db7b3da50c4330fdb4808cfa1",
"reference": "4cd6c807598e560db7b3da50c4330fdb4808cfa1",
"url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/bb46e43145184ce8c3069a8ea2c299fb53d432f9",
"reference": "bb46e43145184ce8c3069a8ea2c299fb53d432f9",
"shasum": ""
},
"require": {
......@@ -1964,21 +1964,21 @@
],
"description": "Symfony HttpFoundation Component",
"homepage": "http://symfony.com",
"time": "2014-11-03 03:55:50"
"time": "2014-11-28 10:00:40"
},
{
"name": "symfony/http-kernel",
"version": "v2.6.0-BETA1",
"version": "v2.6.0",
"target-dir": "Symfony/Component/HttpKernel",
"source": {
"type": "git",
"url": "https://github.com/symfony/HttpKernel.git",
"reference": "7fa0bd9220cd529ee78d8565bbf8d5a854bd72d2"
"reference": "0e3cad4d574e84b01d2a0df706bb31f024a93bdc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/HttpKernel/zipball/7fa0bd9220cd529ee78d8565bbf8d5a854bd72d2",
"reference": "7fa0bd9220cd529ee78d8565bbf8d5a854bd72d2",
"url": "https://api.github.com/repos/symfony/HttpKernel/zipball/0e3cad4d574e84b01d2a0df706bb31f024a93bdc",
"reference": "0e3cad4d574e84b01d2a0df706bb31f024a93bdc",
"shasum": ""
},
"require": {
......@@ -2039,21 +2039,21 @@
],
"description": "Symfony HttpKernel Component",
"homepage": "http://symfony.com",
"time": "2014-11-03 20:15:26"
"time": "2014-11-28 15:59:01"
},
{
"name": "symfony/routing",
"version": "v2.6.0-BETA1",
"version": "v2.6.0",
"target-dir": "Symfony/Component/Routing",
"source": {
"type": "git",
"url": "https://github.com/symfony/Routing.git",
"reference": "f0bb6f818f9a7ece41c7dfe14e08b13c2de55b0c"
"reference": "5e2c6aba6cbb00a6b7e3760db99f72c85c52b6e5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/Routing/zipball/f0bb6f818f9a7ece41c7dfe14e08b13c2de55b0c",
"reference": "f0bb6f818f9a7ece41c7dfe14e08b13c2de55b0c",
"url": "https://api.github.com/repos/symfony/Routing/zipball/5e2c6aba6cbb00a6b7e3760db99f72c85c52b6e5",
"reference": "5e2c6aba6cbb00a6b7e3760db99f72c85c52b6e5",
"shasum": ""
},
"require": {
......@@ -2106,21 +2106,21 @@
"uri",
"url"
],
"time": "2014-11-03 19:16:49"
"time": "2014-11-16 17:28:09"
},
{
"name": "symfony/serializer",
"version": "v2.6.0-BETA1",
"version": "v2.6.0",
"target-dir": "Symfony/Component/Serializer",
"source": {
"type": "git",
"url": "https://github.com/symfony/Serializer.git",
"reference": "e96b7ac54b3d75a458f76eab11b7cd2d757f09f1"
"reference": "16e548902fab42d26ceb1de5ca06ab676d1a81a7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/Serializer/zipball/e96b7ac54b3d75a458f76eab11b7cd2d757f09f1",
"reference": "e96b7ac54b3d75a458f76eab11b7cd2d757f09f1",
"url": "https://api.github.com/repos/symfony/Serializer/zipball/16e548902fab42d26ceb1de5ca06ab676d1a81a7",
"reference": "16e548902fab42d26ceb1de5ca06ab676d1a81a7",
"shasum": ""
},
"require": {
......@@ -2153,39 +2153,41 @@
],
"description": "Symfony Serializer Component",
"homepage": "http://symfony.com",
"time": "2014-11-03 03:55:50"
"time": "2014-11-20 13:24:23"
},
{
"name": "symfony/translation",
"version": "v2.5.6",
"version": "v2.6.0",
"target-dir": "Symfony/Component/Translation",
"source": {
"type": "git",
"url": "https://github.com/symfony/Translation.git",
"reference": "362fe4da2cfe587f72d57aaa2f89e6b61c05dedf"
"reference": "0a3711860976f15ee46642b4dd354e9ef9fc9a15"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/Translation/zipball/362fe4da2cfe587f72d57aaa2f89e6b61c05dedf",
"reference": "362fe4da2cfe587f72d57aaa2f89e6b61c05dedf",
"url": "https://api.github.com/repos/symfony/Translation/zipball/0a3711860976f15ee46642b4dd354e9ef9fc9a15",
"reference": "0a3711860976f15ee46642b4dd354e9ef9fc9a15",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"psr/log": "~1.0",
"symfony/config": "~2.0",
"symfony/intl": "~2.3",
"symfony/yaml": "~2.2"
},
"suggest": {
"psr/log": "To use logging capability in translator",
"symfony/config": "",
"symfony/yaml": ""
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.5-dev"
"dev-master": "2.6-dev"
}
},
"autoload": {
......@@ -2209,21 +2211,21 @@
],
"description": "Symfony Translation Component",
"homepage": "http://symfony.com",
"time": "2014-10-01 05:50:18"
"time": "2014-11-28 10:00:40"
},
{
"name": "symfony/validator",
"version": "v2.6.0-BETA1",
"version": "v2.6.0",
"target-dir": "Symfony/Component/Validator",
"source": {
"type": "git",
"url": "https://github.com/symfony/Validator.git",
"reference": "6e521cdbc963cef7daf9931a7bde48b56d67d10a"
"reference": "cbf6575c4c9c83621df01483e215599f5377fc0b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/Validator/zipball/6e521cdbc963cef7daf9931a7bde48b56d67d10a",
"reference": "6e521cdbc963cef7daf9931a7bde48b56d67d10a",
"url": "https://api.github.com/repos/symfony/Validator/zipball/cbf6575c4c9c83621df01483e215599f5377fc0b",
"reference": "cbf6575c4c9c83621df01483e215599f5377fc0b",
"shasum": ""
},
"require": {
......@@ -2279,21 +2281,21 @@
],
"description": "Symfony Validator Component",
"homepage": "http://symfony.com",
"time": "2014-11-03 03:55:50"
"time": "2014-11-28 10:00:40"
},
{
"name": "symfony/yaml",
"version": "v2.6.0-BETA1",
"version": "v2.6.0",
"target-dir": "Symfony/Component/Yaml",
"source": {
"type": "git",
"url": "https://github.com/symfony/Yaml.git",
"reference": "9da3813f36985a4089f7e83c601a1034d125ff69"
"reference": "51c845cf3e4bfc182d1d5c05ed1c7338361d86f8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/Yaml/zipball/9da3813f36985a4089f7e83c601a1034d125ff69",
"reference": "9da3813f36985a4089f7e83c601a1034d125ff69",
"url": "https://api.github.com/repos/symfony/Yaml/zipball/51c845cf3e4bfc182d1d5c05ed1c7338361d86f8",
"reference": "51c845cf3e4bfc182d1d5c05ed1c7338361d86f8",
"shasum": ""
},
"require": {
......@@ -2326,7 +2328,7 @@
],
"description": "Symfony Yaml Component",
"homepage": "http://symfony.com",
"time": "2014-11-03 03:55:50"
"time": "2014-11-20 13:24:23"
},
{
"name": "twig/twig",
......@@ -2522,17 +2524,6 @@
"aliases": [],
"minimum-stability": "stable",
"stability-flags": {
"symfony/class-loader": 10,
"symfony/css-selector": 10,
"symfony/debug": 10,
"symfony/dependency-injection": 10,
"symfony/event-dispatcher": 10,
"symfony/http-foundation": 10,
"symfony/http-kernel": 10,
"symfony/routing": 10,
"symfony/serializer": 10,
"symfony/validator": 10,
"symfony/yaml": 10,
"doctrine/common": 20,
"phpunit/phpunit-mock-objects": 20
},
......
......@@ -56,7 +56,10 @@ class ClassLoader
public function getPrefixes()
{
return call_user_func_array('array_merge', $this->prefixesPsr0);
if (!empty($this->prefixesPsr0)) {
return call_user_func_array('array_merge', $this->prefixesPsr0);
}
return array();
}
public function getPrefixesPsr4()
......
This diff is collapsed.
......@@ -11,8 +11,10 @@
namespace Symfony\Component\ClassLoader;
if (!defined('T_TRAIT')) {
define('T_TRAIT', 0);
if (PHP_VERSION_ID >= 50400) {
define('SYMFONY_TRAIT', T_TRAIT);
} else {
define('SYMFONY_TRAIT', 0);
}
/**
......@@ -113,7 +115,7 @@ private static function findClasses($path)
break;
case T_CLASS:
case T_INTERFACE:
case T_TRAIT:
case SYMFONY_TRAIT:
// Find the classname
while (($t = $tokens[++$i]) && is_array($t)) {
if (T_STRING === $t[0]) {
......
......@@ -22,7 +22,7 @@ class ClassCollectionLoaderTest extends \PHPUnit_Framework_TestCase
{
public function testTraitDependencies()
{
if (version_compare(phpversion(), '5.4', '<')) {
if (PHP_VERSION_ID < 50400) {
$this->markTestSkipped('Requires PHP > 5.4');
return;
......@@ -100,7 +100,7 @@ public function getDifferentOrders()
*/
public function testClassWithTraitsReordering(array $classes)
{
if (version_compare(phpversion(), '5.4', '<')) {
if (PHP_VERSION_ID < 50400) {
$this->markTestSkipped('Requires PHP > 5.4');
return;
......
......@@ -104,7 +104,7 @@ public function getTestCreateMapTests()
)),
);
if (version_compare(PHP_VERSION, '5.4', '>=')) {
if (PHP_VERSION_ID >= 50400) {
$data[] = array(__DIR__.'/Fixtures/php5.4', array(
'TFoo' => __DIR__.'/Fixtures/php5.4/traits.php',
'CFoo' => __DIR__.'/Fixtures/php5.4/traits.php',
......
......@@ -487,7 +487,6 @@ public function handleException(\Exception $exception, array $error = null)
public static function handleFatalError(array $error = null)
{
self::$reservedMemory = '';
gc_collect_cycles();
$handler = set_error_handler('var_dump', 0);
$handler = is_array($handler) ? $handler[0] : null;
restore_error_handler();
......
......@@ -15,10 +15,6 @@
use Symfony\Component\Debug\Exception\FlattenException;
use Symfony\Component\Debug\Exception\OutOfMemoryException;
if (!defined('ENT_SUBSTITUTE')) {
define('ENT_SUBSTITUTE', 8);
}
/**
* ExceptionHandler converts an exception to a Response object.
*
......@@ -253,7 +249,7 @@ public function getContent(FlattenException $exception)
} catch (\Exception $e) {
// something nasty happened and we cannot throw an exception anymore
if ($this->debug) {
$title = sprintf('Exception thrown when handling an exception (%s: %s)', get_class($exception), $exception->getMessage());
$title = sprintf('Exception thrown when handling an exception (%s: %s)', get_class($e), $e->getMessage());
} else {
$title = 'Whoops, looks like something went wrong.';
}
......@@ -428,7 +424,7 @@ protected static function utf8Htmlize($str)
$str = iconv($charset, 'UTF-8', $str);
}
return htmlspecialchars($str, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
return htmlspecialchars($str, ENT_QUOTES | (PHP_VERSION_ID >= 50400 ? ENT_SUBSTITUTE : 0), 'UTF-8');
}
/**
......
......@@ -162,21 +162,21 @@ public function testDefaultLogger()
$handler->setDefaultLogger($logger, array(E_USER_NOTICE => LogLevel::CRITICAL));
$loggers = array(
E_DEPRECATED => array(null, LogLevel::INFO),
E_USER_DEPRECATED => array(null, LogLevel::INFO),
E_NOTICE => array($logger, LogLevel::NOTICE),
E_USER_NOTICE => array($logger, LogLevel::CRITICAL),
E_STRICT => array(null, LogLevel::NOTICE),
E_WARNING => array(null, LogLevel::WARNING),
E_USER_WARNING => array(null, LogLevel::WARNING),
E_COMPILE_WARNING => array(null, LogLevel::WARNING),
E_CORE_WARNING => array(null, LogLevel::WARNING),
E_USER_ERROR => array(null, LogLevel::ERROR),
E_DEPRECATED => array(null, LogLevel::INFO),
E_USER_DEPRECATED => array(null, LogLevel::INFO),
E_NOTICE => array($logger, LogLevel::NOTICE),
E_USER_NOTICE => array($logger, LogLevel::CRITICAL),
E_STRICT => array(null, LogLevel::NOTICE),
E_WARNING => array(null, LogLevel::WARNING),
E_USER_WARNING => array(null, LogLevel::WARNING),
E_COMPILE_WARNING => array(null, LogLevel::WARNING),
E_CORE_WARNING => array(null, LogLevel::WARNING),
E_USER_ERROR => array(null, LogLevel::ERROR),
E_RECOVERABLE_ERROR => array(null, LogLevel::ERROR),
E_COMPILE_ERROR => array(null, LogLevel::EMERGENCY),
E_PARSE => array(null, LogLevel::EMERGENCY),
E_ERROR => array(null, LogLevel::EMERGENCY),
E_CORE_ERROR => array(null, LogLevel::EMERGENCY),
E_COMPILE_ERROR => array(null, LogLevel::EMERGENCY),
E_PARSE => array(null, LogLevel::EMERGENCY),
E_ERROR => array(null, LogLevel::EMERGENCY),
E_CORE_ERROR => array(null, LogLevel::EMERGENCY),
);
$this->assertSame($loggers, $handler->setLoggers(array()));
......
......@@ -114,6 +114,10 @@ private function processArguments(array $arguments)
$this->processArguments($argument->getArguments());
$this->processArguments($argument->getMethodCalls());
$this->processArguments($argument->getProperties());
if ($argument->getFactoryService()) {
$this->processArguments(array(new Reference($argument->getFactoryService())));
}
}
}
}
......
......@@ -144,6 +144,10 @@ private function isInlineableDefinition(ContainerBuilder $container, $id, Defini
return false;
}
if (count($ids) > 1 && $definition->getFactoryService()) {
return false;
}
return $container->getDefinition(reset($ids))->getScope() === $definition->getScope();
}
}
......@@ -360,6 +360,10 @@ public function initialized($id)
return true;
}
if (isset($this->aliases[$id])) {
$id = $this->aliases[$id];
}
return isset($this->services[$id]) || array_key_exists($id, $this->services);
}
......
......@@ -79,6 +79,28 @@ public function testProcessDetectsReferencesFromInlinedDefinitions()
$this->assertSame($ref, $refs[0]->getValue());
}
public function testProcessDetectsReferencesFromInlinedFactoryDefinitions()
{
$container = new ContainerBuilder();
$container
->register('a')
;
$factory = new Definition();
$factory->setFactoryService('a');
$container
->register('b')
->addArgument($factory)
;
$graph = $this->process($container);
$this->assertTrue($graph->hasNode('a'));
$this->assertCount(1, $refs = $graph->getNode('a')->getInEdges());
}
public function testProcessDoesNotSaveDuplicateReferences()
{
$container = new ContainerBuilder();
......
......@@ -110,6 +110,84 @@ public function testProcessInlinesIfMultipleReferencesButAllFromTheSameDefinitio
$this->assertSame($a, $inlinedArguments[0]);
}
public function testProcessInlinesPrivateFactoryReference()
{
$container = new ContainerBuilder();
$container->register('a')->setPublic(false);
$b = $container
->register('b')
->setPublic(false)
->setFactoryService('a')
;
$container
->register('foo')
->setArguments(array(
$ref = new Reference('b'),