Merge branch '3.3' into 3.4
* 3.3: Fix the conditional definition of the SymfonyTestsListener [DI] Fix keys resolution in ResolveParameterPlaceHoldersPass [EventDispatcher] Remove dead code in WrappedListener Fix non-dumped voters in security panel [Yaml] Remove line number in deprecation notices [SecurityBundle] Made 2 service aliases private
This commit is contained in:
commit
8bbfc96802
@ -18,53 +18,53 @@ use PHPUnit\Framework\Warning;
|
||||
|
||||
if (class_exists('PHPUnit_Runner_Version') && version_compare(\PHPUnit_Runner_Version::id(), '6.0.0', '<')) {
|
||||
class_alias('Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListener', 'Symfony\Bridge\PhpUnit\SymfonyTestsListener');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Collects and replays skipped tests.
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class SymfonyTestsListener extends BaseTestListener
|
||||
{
|
||||
private $trait;
|
||||
|
||||
public function __construct(array $mockedNamespaces = array())
|
||||
// Using an early return instead of a else does not work when using the PHPUnit phar due to some weird PHP behavior (the class
|
||||
// gets defined without executing the code before it and so the definition is not properly conditional)
|
||||
} else {
|
||||
/**
|
||||
* Collects and replays skipped tests.
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class SymfonyTestsListener extends BaseTestListener
|
||||
{
|
||||
$this->trait = new Legacy\SymfonyTestsListenerTrait($mockedNamespaces);
|
||||
}
|
||||
private $trait;
|
||||
|
||||
public function globalListenerDisabled()
|
||||
{
|
||||
$this->trait->globalListenerDisabled();
|
||||
}
|
||||
public function __construct(array $mockedNamespaces = array())
|
||||
{
|
||||
$this->trait = new Legacy\SymfonyTestsListenerTrait($mockedNamespaces);
|
||||
}
|
||||
|
||||
public function startTestSuite(TestSuite $suite)
|
||||
{
|
||||
return $this->trait->startTestSuite($suite);
|
||||
}
|
||||
public function globalListenerDisabled()
|
||||
{
|
||||
$this->trait->globalListenerDisabled();
|
||||
}
|
||||
|
||||
public function addSkippedTest(Test $test, \Exception $e, $time)
|
||||
{
|
||||
return $this->trait->addSkippedTest($test, $e, $time);
|
||||
}
|
||||
public function startTestSuite(TestSuite $suite)
|
||||
{
|
||||
return $this->trait->startTestSuite($suite);
|
||||
}
|
||||
|
||||
public function startTest(Test $test)
|
||||
{
|
||||
return $this->trait->startTest($test);
|
||||
}
|
||||
public function addSkippedTest(Test $test, \Exception $e, $time)
|
||||
{
|
||||
return $this->trait->addSkippedTest($test, $e, $time);
|
||||
}
|
||||
|
||||
public function addWarning(Test $test, Warning $e, $time)
|
||||
{
|
||||
return $this->trait->addWarning($test, $e, $time);
|
||||
}
|
||||
public function startTest(Test $test)
|
||||
{
|
||||
return $this->trait->startTest($test);
|
||||
}
|
||||
|
||||
public function endTest(Test $test, $time)
|
||||
{
|
||||
return $this->trait->endTest($test, $time);
|
||||
public function addWarning(Test $test, Warning $e, $time)
|
||||
{
|
||||
return $this->trait->addWarning($test, $e, $time);
|
||||
}
|
||||
|
||||
public function endTest(Test $test, $time)
|
||||
{
|
||||
return $this->trait->endTest($test, $time);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,7 @@
|
||||
<argument type="service" id="security.access.decision_manager" />
|
||||
<argument>%security.access.always_authenticate_before_granting%</argument>
|
||||
</service>
|
||||
<service id="Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface" alias="security.authorization_checker" public="true" />
|
||||
<service id="Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface" alias="security.authorization_checker" />
|
||||
|
||||
<service id="security.token_storage" class="Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage" public="true" />
|
||||
<service id="Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface" alias="security.token_storage" />
|
||||
@ -59,7 +59,7 @@
|
||||
</service>
|
||||
|
||||
<service id="security.password_encoder" alias="security.user_password_encoder.generic" public="true" />
|
||||
<service id="Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface" alias="security.password_encoder" public="true" />
|
||||
<service id="Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface" alias="security.password_encoder" />
|
||||
|
||||
<service id="security.user_checker" class="Symfony\Component\Security\Core\User\UserChecker" />
|
||||
|
||||
|
@ -222,7 +222,7 @@
|
||||
{% for voter in collector.voters %}
|
||||
<tr>
|
||||
<td class="font-normal text-small text-muted nowrap">{{ loop.index }}</td>
|
||||
<td class="font-normal">{{ voter }}</td>
|
||||
<td class="font-normal">{{ profiler_dump(voter) }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
|
@ -65,10 +65,14 @@ class ResolveParameterPlaceHoldersPass extends AbstractRecursivePass
|
||||
if (isset($changes['file'])) {
|
||||
$value->setFile($this->bag->resolveValue($value->getFile()));
|
||||
}
|
||||
$value->setProperties($this->bag->resolveValue($value->getProperties()));
|
||||
$value->setMethodCalls($this->bag->resolveValue($value->getMethodCalls()));
|
||||
}
|
||||
|
||||
return parent::processValue($value, $isRoot);
|
||||
$value = parent::processValue($value, $isRoot);
|
||||
|
||||
if ($value && is_array($value)) {
|
||||
$value = array_combine($this->bag->resolveValue(array_keys($value)), $value);
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
|
@ -41,12 +41,12 @@ class ResolveParameterPlaceHoldersPassTest extends TestCase
|
||||
|
||||
public function testArgumentParametersShouldBeResolved()
|
||||
{
|
||||
$this->assertSame(array('bar', 'baz'), $this->fooDefinition->getArguments());
|
||||
$this->assertSame(array('bar', array('bar' => 'baz')), $this->fooDefinition->getArguments());
|
||||
}
|
||||
|
||||
public function testMethodCallParametersShouldBeResolved()
|
||||
{
|
||||
$this->assertSame(array(array('foobar', array('bar', 'baz'))), $this->fooDefinition->getMethodCalls());
|
||||
$this->assertSame(array(array('foobar', array('bar', array('bar' => 'baz')))), $this->fooDefinition->getMethodCalls());
|
||||
}
|
||||
|
||||
public function testPropertyParametersShouldBeResolved()
|
||||
@ -71,7 +71,7 @@ class ResolveParameterPlaceHoldersPassTest extends TestCase
|
||||
$containerBuilder->setParameter('foo.class', 'Foo');
|
||||
$containerBuilder->setParameter('foo.factory.class', 'FooFactory');
|
||||
$containerBuilder->setParameter('foo.arg1', 'bar');
|
||||
$containerBuilder->setParameter('foo.arg2', 'baz');
|
||||
$containerBuilder->setParameter('foo.arg2', array('%foo.arg1%' => 'baz'));
|
||||
$containerBuilder->setParameter('foo.method', 'foobar');
|
||||
$containerBuilder->setParameter('foo.property.name', 'bar');
|
||||
$containerBuilder->setParameter('foo.property.value', 'baz');
|
||||
@ -80,7 +80,7 @@ class ResolveParameterPlaceHoldersPassTest extends TestCase
|
||||
|
||||
$fooDefinition = $containerBuilder->register('foo', '%foo.class%');
|
||||
$fooDefinition->setFactory(array('%foo.factory.class%', 'getFoo'));
|
||||
$fooDefinition->setArguments(array('%foo.arg1%', '%foo.arg2%'));
|
||||
$fooDefinition->setArguments(array('%foo.arg1%', array('%foo.arg1%' => 'baz')));
|
||||
$fooDefinition->addMethodCall('%foo.method%', array('%foo.arg1%', '%foo.arg2%'));
|
||||
$fooDefinition->setProperty('%foo.property.name%', '%foo.property.value%');
|
||||
$fooDefinition->setFile('%foo.file%');
|
||||
|
@ -15,7 +15,6 @@ use Symfony\Component\Stopwatch\Stopwatch;
|
||||
use Symfony\Component\EventDispatcher\Event;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use Symfony\Component\VarDumper\Caster\ClassStub;
|
||||
use Symfony\Component\VarDumper\Cloner\VarCloner;
|
||||
|
||||
/**
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
@ -30,8 +29,7 @@ class WrappedListener
|
||||
private $dispatcher;
|
||||
private $pretty;
|
||||
private $stub;
|
||||
|
||||
private static $cloner;
|
||||
private static $hasClassStub;
|
||||
|
||||
public function __construct($listener, $name, Stopwatch $stopwatch, EventDispatcherInterface $dispatcher = null)
|
||||
{
|
||||
@ -58,8 +56,8 @@ class WrappedListener
|
||||
$this->name = $name;
|
||||
}
|
||||
|
||||
if (null === self::$cloner) {
|
||||
self::$cloner = class_exists(ClassStub::class) ? new VarCloner() : false;
|
||||
if (null === self::$hasClassStub) {
|
||||
self::$hasClassStub = class_exists(ClassStub::class);
|
||||
}
|
||||
}
|
||||
|
||||
@ -86,7 +84,7 @@ class WrappedListener
|
||||
public function getInfo($eventName)
|
||||
{
|
||||
if (null === $this->stub) {
|
||||
$this->stub = false === self::$cloner ? $this->pretty.'()' : new ClassStub($this->pretty.'()', $this->listener);
|
||||
$this->stub = self::$hasClassStub ? new ClassStub($this->pretty.'()', $this->listener) : $this->pretty.'()';
|
||||
}
|
||||
|
||||
return array(
|
||||
|
@ -493,7 +493,7 @@ class Inline
|
||||
if (!(Yaml::PARSE_KEYS_AS_STRINGS & $flags)) {
|
||||
$evaluatedKey = self::evaluateScalar($key, $flags, $references);
|
||||
|
||||
if ('' !== $key && $evaluatedKey !== $key && !is_string($evaluatedKey)) {
|
||||
if ('' !== $key && $evaluatedKey !== $key && !is_string($evaluatedKey) && !is_int($evaluatedKey)) {
|
||||
@trigger_error('Implicit casting of incompatible mapping keys to strings is deprecated since version 3.3 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0. Pass the PARSE_KEYS_AS_STRING flag to explicitly enable the type casts.', E_USER_DEPRECATED);
|
||||
}
|
||||
}
|
||||
@ -519,7 +519,7 @@ class Inline
|
||||
// Parser cannot abort this mapping earlier, since lines
|
||||
// are processed sequentially.
|
||||
if (isset($output[$key])) {
|
||||
@trigger_error(sprintf('Duplicate key "%s" detected on line %d whilst parsing YAML. Silent handling of duplicate mapping keys in YAML is deprecated since version 3.2 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0.', $key, self::$parsedLineNumber + 1), E_USER_DEPRECATED);
|
||||
@trigger_error(sprintf('Duplicate key "%s" detected whilst parsing YAML. Silent handling of duplicate mapping keys in YAML is deprecated since version 3.2 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0.', $key), E_USER_DEPRECATED);
|
||||
$duplicate = true;
|
||||
}
|
||||
break;
|
||||
@ -530,7 +530,7 @@ class Inline
|
||||
// Parser cannot abort this mapping earlier, since lines
|
||||
// are processed sequentially.
|
||||
if (isset($output[$key])) {
|
||||
@trigger_error(sprintf('Duplicate key "%s" detected on line %d whilst parsing YAML. Silent handling of duplicate mapping keys in YAML is deprecated since version 3.2 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0.', $key, self::$parsedLineNumber + 1), E_USER_DEPRECATED);
|
||||
@trigger_error(sprintf('Duplicate key "%s" detected whilst parsing YAML. Silent handling of duplicate mapping keys in YAML is deprecated since version 3.2 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0.', $key), E_USER_DEPRECATED);
|
||||
$duplicate = true;
|
||||
}
|
||||
break;
|
||||
@ -540,7 +540,7 @@ class Inline
|
||||
// Parser cannot abort this mapping earlier, since lines
|
||||
// are processed sequentially.
|
||||
if (isset($output[$key])) {
|
||||
@trigger_error(sprintf('Duplicate key "%s" detected on line %d whilst parsing YAML. Silent handling of duplicate mapping keys in YAML is deprecated since version 3.2 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0.', $key, self::$parsedLineNumber + 1), E_USER_DEPRECATED);
|
||||
@trigger_error(sprintf('Duplicate key "%s" detected whilst parsing YAML. Silent handling of duplicate mapping keys in YAML is deprecated since version 3.2 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0.', $key), E_USER_DEPRECATED);
|
||||
$duplicate = true;
|
||||
}
|
||||
--$i;
|
||||
|
@ -236,9 +236,9 @@ class Parser
|
||||
throw $e;
|
||||
}
|
||||
|
||||
if (!(Yaml::PARSE_KEYS_AS_STRINGS & $flags) && !is_string($key)) {
|
||||
$keyType = is_numeric($key) ? 'numeric key' : 'incompatible key type';
|
||||
@trigger_error(sprintf('Implicit casting of %s to string on line %d is deprecated since version 3.3 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0. Pass the PARSE_KEYS_AS_STRING flag to explicitly enable the type casts.', $keyType, $this->getRealCurrentLineNb()), E_USER_DEPRECATED);
|
||||
if (!(Yaml::PARSE_KEYS_AS_STRINGS & $flags) && !is_string($key) && !is_int($key)) {
|
||||
$keyType = is_numeric($key) ? 'numeric key' : 'non-string key';
|
||||
@trigger_error(sprintf('Implicit casting of %s to string is deprecated since version 3.3 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0. Pass the PARSE_KEYS_AS_STRING flag to explicitly enable the type casts.', $keyType), E_USER_DEPRECATED);
|
||||
}
|
||||
|
||||
// Convert float keys to strings, to avoid being converted to integers by PHP
|
||||
@ -312,7 +312,7 @@ class Parser
|
||||
$data[$key] = null;
|
||||
}
|
||||
} else {
|
||||
@trigger_error(sprintf('Duplicate key "%s" detected on line %d whilst parsing YAML. Silent handling of duplicate mapping keys in YAML is deprecated since version 3.2 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0.', $key, $this->getRealCurrentLineNb() + 1), E_USER_DEPRECATED);
|
||||
@trigger_error(sprintf('Duplicate key "%s" detected whilst parsing YAML. Silent handling of duplicate mapping keys in YAML is deprecated since version 3.2 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0.', $key), E_USER_DEPRECATED);
|
||||
}
|
||||
} else {
|
||||
// remember the parsed line number here in case we need it to provide some contexts in error messages below
|
||||
@ -327,7 +327,7 @@ class Parser
|
||||
$data[$key] = $value;
|
||||
}
|
||||
} else {
|
||||
@trigger_error(sprintf('Duplicate key "%s" detected on line %d whilst parsing YAML. Silent handling of duplicate mapping keys in YAML is deprecated since version 3.2 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0.', $key, $realCurrentLineNbKey + 1), E_USER_DEPRECATED);
|
||||
@trigger_error(sprintf('Duplicate key "%s" detected whilst parsing YAML. Silent handling of duplicate mapping keys in YAML is deprecated since version 3.2 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0.', $key), E_USER_DEPRECATED);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -337,7 +337,7 @@ class Parser
|
||||
if ($allowOverwrite || !isset($data[$key])) {
|
||||
$data[$key] = $value;
|
||||
} else {
|
||||
@trigger_error(sprintf('Duplicate key "%s" detected on line %d whilst parsing YAML. Silent handling of duplicate mapping keys in YAML is deprecated since version 3.2 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0.', $key, $this->getRealCurrentLineNb() + 1), E_USER_DEPRECATED);
|
||||
@trigger_error(sprintf('Duplicate key "%s" detected whilst parsing YAML. Silent handling of duplicate mapping keys in YAML is deprecated since version 3.2 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0.', $key), E_USER_DEPRECATED);
|
||||
}
|
||||
}
|
||||
if ($isRef) {
|
||||
|
@ -853,7 +853,7 @@ EOD;
|
||||
/**
|
||||
* @group legacy
|
||||
* @dataProvider getParseExceptionOnDuplicateData
|
||||
* @expectedDeprecation Duplicate key "%s" detected on line %d whilst parsing YAML. Silent handling of duplicate mapping keys in YAML is deprecated %s.
|
||||
* @expectedDeprecation Duplicate key "%s" detected whilst parsing YAML. Silent handling of duplicate mapping keys in YAML is deprecated %s.
|
||||
* throws \Symfony\Component\Yaml\Exception\ParseException in 4.0
|
||||
*/
|
||||
public function testParseExceptionOnDuplicate($input, $duplicateKey, $lineNumber)
|
||||
@ -1081,7 +1081,7 @@ EOF;
|
||||
|
||||
/**
|
||||
* @group legacy
|
||||
* @expectedDeprecation Implicit casting of numeric key to string on line 1 is deprecated since version 3.3 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0. Pass the PARSE_KEYS_AS_STRING flag to explicitly enable the type casts.
|
||||
* @expectedDeprecation Implicit casting of numeric key to string is deprecated since version 3.3 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0. Pass the PARSE_KEYS_AS_STRING flag to explicitly enable the type casts.
|
||||
*/
|
||||
public function testFloatKeys()
|
||||
{
|
||||
@ -1103,7 +1103,7 @@ EOF;
|
||||
|
||||
/**
|
||||
* @group legacy
|
||||
* @expectedDeprecation Implicit casting of incompatible key type to string on line 1 is deprecated since version 3.3 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0. Pass the PARSE_KEYS_AS_STRING flag to explicitly enable the type casts.
|
||||
* @expectedDeprecation Implicit casting of non-string key to string is deprecated since version 3.3 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0. Pass the PARSE_KEYS_AS_STRING flag to explicitly enable the type casts.
|
||||
*/
|
||||
public function testBooleanKeys()
|
||||
{
|
||||
|
Reference in New Issue
Block a user