Merge branch '2.6' into 2.7
* 2.6: [Translator] Cache does not take fallback locales into consideration [VarDumper] Fix call site detection [Process] Fix volatile test Remove some useless @group annotations Removed useless strtolower call [Validator] Use strict comparisons in loaders CS: Use "self" keyword instead of class name if possible Conflicts: .travis.yml src/Symfony/Component/Translation/Translator.php
This commit is contained in:
commit
30b31611a5
@ -46,5 +46,5 @@ install:
|
|||||||
script:
|
script:
|
||||||
- if [ "$deps" = "no" ]; then echo "$components" | parallel --gnu --keep-order 'echo -e "\\nRunning {} tests"; phpunit --exclude-group tty,benchmark,intl-data {} || (echo -e "\\e[41mKO\\e[0m {}" && $(exit 1));'; fi;
|
- if [ "$deps" = "no" ]; then echo "$components" | parallel --gnu --keep-order 'echo -e "\\nRunning {} tests"; phpunit --exclude-group tty,benchmark,intl-data {} || (echo -e "\\e[41mKO\\e[0m {}" && $(exit 1));'; fi;
|
||||||
- if [ "$deps" = "no" ]; then echo -e "\\nRunning tests requiring tty"; phpunit --group tty || (echo -e "\\e[41mKO\\e[0m tty group" && $(exit 1)); fi;
|
- if [ "$deps" = "no" ]; then echo -e "\\nRunning tests requiring tty"; phpunit --group tty || (echo -e "\\e[41mKO\\e[0m tty group" && $(exit 1)); fi;
|
||||||
- if [ "$deps" = "high" ]; then echo "$components" | parallel --gnu --keep-order -j25% 'echo -e "\\nRunning {} tests"; cd {}; composer --prefer-source update; phpunit --exclude-group tty,benchmark,intl-data,legacy || (echo -e "\\e[41mKO\\e[0m {}" && $(exit 1));'; fi;
|
- if [ "$deps" = "high" ]; then echo "$components" | parallel --gnu --keep-order -j10% 'echo -e "\\nRunning {} tests"; cd {}; composer --prefer-source update; phpunit --exclude-group tty,benchmark,intl-data,legacy || (echo -e "\\e[41mKO\\e[0m {}" && $(exit 1));'; fi;
|
||||||
- if [ "$deps" = "low" ]; then echo "$components" | parallel --gnu --keep-order -j25% 'echo -e "\\nRunning {} tests"; cd {}; composer --prefer-source --prefer-lowest --prefer-stable update; phpunit --exclude-group tty,benchmark,intl-data || (echo -e "\\e[41mKO\\e[0m {}" && $(exit 1));'; fi;
|
- if [ "$deps" = "low" ]; then echo "$components" | parallel --gnu --keep-order -j10% 'echo -e "\\nRunning {} tests"; cd {}; composer --prefer-source --prefer-lowest --prefer-stable update; phpunit --exclude-group tty,benchmark,intl-data || (echo -e "\\e[41mKO\\e[0m {}" && $(exit 1));'; fi;
|
||||||
|
@ -336,9 +336,6 @@ class UniqueEntityValidatorTest extends AbstractConstraintValidatorTest
|
|||||||
$this->assertNoViolation();
|
$this->assertNoViolation();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @group GH-1635
|
|
||||||
*/
|
|
||||||
public function testAssociatedEntity()
|
public function testAssociatedEntity()
|
||||||
{
|
{
|
||||||
$constraint = new UniqueEntity(array(
|
$constraint = new UniqueEntity(array(
|
||||||
@ -395,7 +392,6 @@ class UniqueEntityValidatorTest extends AbstractConstraintValidatorTest
|
|||||||
/**
|
/**
|
||||||
* @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException
|
* @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException
|
||||||
* @expectedExceptionMessage Associated entities are not allowed to have more than one identifier field
|
* @expectedExceptionMessage Associated entities are not allowed to have more than one identifier field
|
||||||
* @group GH-1635
|
|
||||||
*/
|
*/
|
||||||
public function testAssociatedCompositeEntity()
|
public function testAssociatedCompositeEntity()
|
||||||
{
|
{
|
||||||
|
@ -11,9 +11,6 @@
|
|||||||
|
|
||||||
namespace Symfony\Bundle\FrameworkBundle\Tests\Functional;
|
namespace Symfony\Bundle\FrameworkBundle\Tests\Functional;
|
||||||
|
|
||||||
/**
|
|
||||||
* @group functional
|
|
||||||
*/
|
|
||||||
class FragmentTest extends WebTestCase
|
class FragmentTest extends WebTestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
@ -11,9 +11,6 @@
|
|||||||
|
|
||||||
namespace Symfony\Bundle\FrameworkBundle\Tests\Functional;
|
namespace Symfony\Bundle\FrameworkBundle\Tests\Functional;
|
||||||
|
|
||||||
/**
|
|
||||||
* @group functional
|
|
||||||
*/
|
|
||||||
class ProfilerTest extends WebTestCase
|
class ProfilerTest extends WebTestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
@ -11,9 +11,6 @@
|
|||||||
|
|
||||||
namespace Symfony\Bundle\FrameworkBundle\Tests\Functional;
|
namespace Symfony\Bundle\FrameworkBundle\Tests\Functional;
|
||||||
|
|
||||||
/**
|
|
||||||
* @group functional
|
|
||||||
*/
|
|
||||||
class SessionTest extends WebTestCase
|
class SessionTest extends WebTestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
@ -11,9 +11,6 @@
|
|||||||
|
|
||||||
namespace Symfony\Bundle\FrameworkBundle\Tests\Functional;
|
namespace Symfony\Bundle\FrameworkBundle\Tests\Functional;
|
||||||
|
|
||||||
/**
|
|
||||||
* @group functional
|
|
||||||
*/
|
|
||||||
class SubRequestsTest extends WebTestCase
|
class SubRequestsTest extends WebTestCase
|
||||||
{
|
{
|
||||||
public function testStateAfterSubRequest()
|
public function testStateAfterSubRequest()
|
||||||
|
@ -11,9 +11,6 @@
|
|||||||
|
|
||||||
namespace Symfony\Bundle\SecurityBundle\Tests\Functional;
|
namespace Symfony\Bundle\SecurityBundle\Tests\Functional;
|
||||||
|
|
||||||
/**
|
|
||||||
* @group functional
|
|
||||||
*/
|
|
||||||
class CsrfFormLoginTest extends WebTestCase
|
class CsrfFormLoginTest extends WebTestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
@ -13,9 +13,6 @@ namespace Symfony\Bundle\SecurityBundle\Tests\Functional;
|
|||||||
|
|
||||||
use Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\FirewallEntryPointBundle\Security\EntryPointStub;
|
use Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\FirewallEntryPointBundle\Security\EntryPointStub;
|
||||||
|
|
||||||
/**
|
|
||||||
* @group functional
|
|
||||||
*/
|
|
||||||
class FirewallEntryPointTest extends WebTestCase
|
class FirewallEntryPointTest extends WebTestCase
|
||||||
{
|
{
|
||||||
public function testItUsesTheConfiguredEntryPointWhenUsingUnknownCredentials()
|
public function testItUsesTheConfiguredEntryPointWhenUsingUnknownCredentials()
|
||||||
|
@ -11,9 +11,6 @@
|
|||||||
|
|
||||||
namespace Symfony\Bundle\SecurityBundle\Tests\Functional;
|
namespace Symfony\Bundle\SecurityBundle\Tests\Functional;
|
||||||
|
|
||||||
/**
|
|
||||||
* @group functional
|
|
||||||
*/
|
|
||||||
class FormLoginTest extends WebTestCase
|
class FormLoginTest extends WebTestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
@ -57,7 +57,6 @@ class SecurityRoutingIntegrationTest extends WebTestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider getConfigs
|
* @dataProvider getConfigs
|
||||||
* @group ip_whitelist
|
|
||||||
*/
|
*/
|
||||||
public function testSecurityConfigurationForSingleIPAddress($config)
|
public function testSecurityConfigurationForSingleIPAddress($config)
|
||||||
{
|
{
|
||||||
@ -70,7 +69,6 @@ class SecurityRoutingIntegrationTest extends WebTestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider getConfigs
|
* @dataProvider getConfigs
|
||||||
* @group ip_whitelist
|
|
||||||
*/
|
*/
|
||||||
public function testSecurityConfigurationForMultipleIPAddresses($config)
|
public function testSecurityConfigurationForMultipleIPAddresses($config)
|
||||||
{
|
{
|
||||||
|
@ -11,9 +11,6 @@
|
|||||||
|
|
||||||
namespace Symfony\Bundle\SecurityBundle\Tests\Functional;
|
namespace Symfony\Bundle\SecurityBundle\Tests\Functional;
|
||||||
|
|
||||||
/**
|
|
||||||
* @group functional
|
|
||||||
*/
|
|
||||||
class SwitchUserTest extends WebTestCase
|
class SwitchUserTest extends WebTestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
@ -224,7 +224,7 @@ class ExprBuilder
|
|||||||
public static function buildExpressions(array $expressions)
|
public static function buildExpressions(array $expressions)
|
||||||
{
|
{
|
||||||
foreach ($expressions as $k => $expr) {
|
foreach ($expressions as $k => $expr) {
|
||||||
if ($expr instanceof ExprBuilder) {
|
if ($expr instanceof self) {
|
||||||
$if = $expr->ifPart;
|
$if = $expr->ifPart;
|
||||||
$then = $expr->thenPart;
|
$then = $expr->thenPart;
|
||||||
$expressions[$k] = function ($v) use ($if, $then) {
|
$expressions[$k] = function ($v) use ($if, $then) {
|
||||||
|
@ -82,7 +82,7 @@ abstract class FileLoader extends Loader
|
|||||||
try {
|
try {
|
||||||
$loader = $this->resolve($resource, $type);
|
$loader = $this->resolve($resource, $type);
|
||||||
|
|
||||||
if ($loader instanceof FileLoader && null !== $this->currentDir) {
|
if ($loader instanceof self && null !== $this->currentDir) {
|
||||||
// we fallback to the current locator to keep BC
|
// we fallback to the current locator to keep BC
|
||||||
// as some some loaders do not call the parent __construct()
|
// as some some loaders do not call the parent __construct()
|
||||||
// @deprecated should be removed in 3.0
|
// @deprecated should be removed in 3.0
|
||||||
|
@ -768,7 +768,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
|||||||
*/
|
*/
|
||||||
public function register($id, $class = null)
|
public function register($id, $class = null)
|
||||||
{
|
{
|
||||||
return $this->setDefinition(strtolower($id), new Definition($class));
|
return $this->setDefinition($id, new Definition($class));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -132,8 +132,6 @@ class FinderTest extends Iterator\RealIteratorTestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider getRegexNameTestData
|
* @dataProvider getRegexNameTestData
|
||||||
*
|
|
||||||
* @group regexName
|
|
||||||
*/
|
*/
|
||||||
public function testRegexName($adapter, $regex)
|
public function testRegexName($adapter, $regex)
|
||||||
{
|
{
|
||||||
@ -506,7 +504,6 @@ class FinderTest extends Iterator\RealIteratorTestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider getContainsTestData
|
* @dataProvider getContainsTestData
|
||||||
* @group grep
|
|
||||||
*/
|
*/
|
||||||
public function testContains($adapter, $matchPatterns, $noMatchPatterns, $expected)
|
public function testContains($adapter, $matchPatterns, $noMatchPatterns, $expected)
|
||||||
{
|
{
|
||||||
|
@ -139,7 +139,7 @@ class File extends \SplFileInfo
|
|||||||
|
|
||||||
$target = rtrim($directory, '/\\').DIRECTORY_SEPARATOR.(null === $name ? $this->getBasename() : $this->getName($name));
|
$target = rtrim($directory, '/\\').DIRECTORY_SEPARATOR.(null === $name ? $this->getBasename() : $this->getName($name));
|
||||||
|
|
||||||
return new File($target, false);
|
return new self($target, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -84,7 +84,7 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface
|
|||||||
$line = $trace[$i]['line'];
|
$line = $trace[$i]['line'];
|
||||||
|
|
||||||
while (++$i < 7) {
|
while (++$i < 7) {
|
||||||
if (isset($trace[$i]['function']) && empty($trace[$i]['class']) && 'call_user_func' !== $trace[$i]['function']) {
|
if (isset($trace[$i]['function'], $trace[$i]['file']) && empty($trace[$i]['class']) && 0 !== strpos($trace[$i]['function'], 'call_user_func')) {
|
||||||
$file = $trace[$i]['file'];
|
$file = $trace[$i]['file'];
|
||||||
$line = $trace[$i]['line'];
|
$line = $trace[$i]['line'];
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ final class Intl
|
|||||||
{
|
{
|
||||||
if (null === self::$currencyBundle) {
|
if (null === self::$currencyBundle) {
|
||||||
self::$currencyBundle = new CurrencyBundle(
|
self::$currencyBundle = new CurrencyBundle(
|
||||||
self::getDataDirectory().'/'.Intl::CURRENCY_DIR,
|
self::getDataDirectory().'/'.self::CURRENCY_DIR,
|
||||||
self::getEntryReader(),
|
self::getEntryReader(),
|
||||||
self::getLocaleBundle()
|
self::getLocaleBundle()
|
||||||
);
|
);
|
||||||
@ -135,11 +135,11 @@ final class Intl
|
|||||||
{
|
{
|
||||||
if (null === self::$languageBundle) {
|
if (null === self::$languageBundle) {
|
||||||
self::$languageBundle = new LanguageBundle(
|
self::$languageBundle = new LanguageBundle(
|
||||||
self::getDataDirectory().'/'.Intl::LANGUAGE_DIR,
|
self::getDataDirectory().'/'.self::LANGUAGE_DIR,
|
||||||
self::getEntryReader(),
|
self::getEntryReader(),
|
||||||
self::getLocaleBundle(),
|
self::getLocaleBundle(),
|
||||||
new ScriptDataProvider(
|
new ScriptDataProvider(
|
||||||
self::getDataDirectory().'/'.Intl::SCRIPT_DIR,
|
self::getDataDirectory().'/'.self::SCRIPT_DIR,
|
||||||
self::getEntryReader()
|
self::getEntryReader()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@ -157,7 +157,7 @@ final class Intl
|
|||||||
{
|
{
|
||||||
if (null === self::$localeBundle) {
|
if (null === self::$localeBundle) {
|
||||||
self::$localeBundle = new LocaleBundle(
|
self::$localeBundle = new LocaleBundle(
|
||||||
self::getDataDirectory().'/'.Intl::LOCALE_DIR,
|
self::getDataDirectory().'/'.self::LOCALE_DIR,
|
||||||
self::getEntryReader()
|
self::getEntryReader()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -174,7 +174,7 @@ final class Intl
|
|||||||
{
|
{
|
||||||
if (null === self::$regionBundle) {
|
if (null === self::$regionBundle) {
|
||||||
self::$regionBundle = new RegionBundle(
|
self::$regionBundle = new RegionBundle(
|
||||||
self::getDataDirectory().'/'.Intl::REGION_DIR,
|
self::getDataDirectory().'/'.self::REGION_DIR,
|
||||||
self::getEntryReader(),
|
self::getEntryReader(),
|
||||||
self::getLocaleBundle()
|
self::getLocaleBundle()
|
||||||
);
|
);
|
||||||
|
@ -818,9 +818,6 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertFalse($process->isSuccessful());
|
$this->assertFalse($process->isSuccessful());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @group idle-timeout
|
|
||||||
*/
|
|
||||||
public function testIdleTimeout()
|
public function testIdleTimeout()
|
||||||
{
|
{
|
||||||
$process = $this->getProcess('php -r "sleep(3);"');
|
$process = $this->getProcess('php -r "sleep(3);"');
|
||||||
@ -838,21 +835,18 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @group idle-timeout
|
|
||||||
*/
|
|
||||||
public function testIdleTimeoutNotExceededWhenOutputIsSent()
|
public function testIdleTimeoutNotExceededWhenOutputIsSent()
|
||||||
{
|
{
|
||||||
$process = $this->getProcess('php -r "echo \'foo\'; sleep(1); echo \'foo\'; sleep(1); echo \'foo\'; sleep(1); "');
|
$process = $this->getProcess(sprintf('php -r %s', escapeshellarg('$n = 30; while ($n--) {echo "foo\n"; usleep(100000); }')));
|
||||||
$process->setTimeout(2);
|
$process->setTimeout(2);
|
||||||
$process->setIdleTimeout(1.5);
|
$process->setIdleTimeout(1);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$process->run();
|
$process->run();
|
||||||
$this->fail('A timeout exception was expected.');
|
$this->fail('A timeout exception was expected.');
|
||||||
} catch (ProcessTimedOutException $ex) {
|
} catch (ProcessTimedOutException $ex) {
|
||||||
$this->assertTrue($ex->isGeneralTimeout());
|
$this->assertTrue($ex->isGeneralTimeout(), 'A general timeout is expected.');
|
||||||
$this->assertFalse($ex->isIdleTimeout());
|
$this->assertFalse($ex->isIdleTimeout(), 'No idle timeout is expected.');
|
||||||
$this->assertEquals(2, $ex->getExceededTimeout());
|
$this->assertEquals(2, $ex->getExceededTimeout());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,7 @@ class PropertyPath implements \IteratorAggregate, PropertyPathInterface
|
|||||||
public function __construct($propertyPath)
|
public function __construct($propertyPath)
|
||||||
{
|
{
|
||||||
// Can be used as copy constructor
|
// Can be used as copy constructor
|
||||||
if ($propertyPath instanceof PropertyPath) {
|
if ($propertyPath instanceof self) {
|
||||||
/* @var PropertyPath $propertyPath */
|
/* @var PropertyPath $propertyPath */
|
||||||
$this->elements = $propertyPath->elements;
|
$this->elements = $propertyPath->elements;
|
||||||
$this->singulars = $propertyPath->singulars;
|
$this->singulars = $propertyPath->singulars;
|
||||||
|
@ -50,7 +50,7 @@ class DumperCollection implements \IteratorAggregate
|
|||||||
*/
|
*/
|
||||||
public function add($child)
|
public function add($child)
|
||||||
{
|
{
|
||||||
if ($child instanceof DumperCollection) {
|
if ($child instanceof self) {
|
||||||
$child->setParent($this);
|
$child->setParent($this);
|
||||||
}
|
}
|
||||||
$this->children[] = $child;
|
$this->children[] = $child;
|
||||||
@ -64,7 +64,7 @@ class DumperCollection implements \IteratorAggregate
|
|||||||
public function setAll(array $children)
|
public function setAll(array $children)
|
||||||
{
|
{
|
||||||
foreach ($children as $child) {
|
foreach ($children as $child) {
|
||||||
if ($child instanceof DumperCollection) {
|
if ($child instanceof self) {
|
||||||
$child->setParent($this);
|
$child->setParent($this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ class DumperPrefixCollection extends DumperCollection
|
|||||||
|
|
||||||
// Prefix starts with route's prefix
|
// Prefix starts with route's prefix
|
||||||
if ('' === $collection->prefix || 0 === strpos($prefix, $collection->prefix)) {
|
if ('' === $collection->prefix || 0 === strpos($prefix, $collection->prefix)) {
|
||||||
$child = new DumperPrefixCollection();
|
$child = new self();
|
||||||
$child->setPrefix(substr($prefix, 0, strlen($collection->prefix) + 1));
|
$child->setPrefix(substr($prefix, 0, strlen($collection->prefix) + 1));
|
||||||
$collection->add($child);
|
$collection->add($child);
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ final class RoleSecurityIdentity implements SecurityIdentityInterface
|
|||||||
*/
|
*/
|
||||||
public function equals(SecurityIdentityInterface $sid)
|
public function equals(SecurityIdentityInterface $sid)
|
||||||
{
|
{
|
||||||
if (!$sid instanceof RoleSecurityIdentity) {
|
if (!$sid instanceof self) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ final class UserSecurityIdentity implements SecurityIdentityInterface
|
|||||||
*/
|
*/
|
||||||
public function equals(SecurityIdentityInterface $sid)
|
public function equals(SecurityIdentityInterface $sid)
|
||||||
{
|
{
|
||||||
if (!$sid instanceof UserSecurityIdentity) {
|
if (!$sid instanceof self) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,6 +76,7 @@ class StopwatchEventTest extends \PHPUnit_Framework_TestCase
|
|||||||
$event->start();
|
$event->start();
|
||||||
usleep(100000);
|
usleep(100000);
|
||||||
$event->stop();
|
$event->stop();
|
||||||
|
usleep(50000);
|
||||||
$event->start();
|
$event->start();
|
||||||
usleep(100000);
|
usleep(100000);
|
||||||
$event->stop();
|
$event->stop();
|
||||||
@ -93,6 +94,7 @@ class StopwatchEventTest extends \PHPUnit_Framework_TestCase
|
|||||||
$event->start();
|
$event->start();
|
||||||
usleep(100000);
|
usleep(100000);
|
||||||
$event->stop();
|
$event->stop();
|
||||||
|
usleep(50000);
|
||||||
$event->start();
|
$event->start();
|
||||||
usleep(100000);
|
usleep(100000);
|
||||||
$this->assertEquals(100, $event->getDuration(), null, self::DELTA);
|
$this->assertEquals(100, $event->getDuration(), null, self::DELTA);
|
||||||
|
@ -232,7 +232,7 @@ abstract class Constraint
|
|||||||
*/
|
*/
|
||||||
public function addImplicitGroupName($group)
|
public function addImplicitGroupName($group)
|
||||||
{
|
{
|
||||||
if (in_array(Constraint::DEFAULT_GROUP, $this->groups) && !in_array($group, $this->groups)) {
|
if (in_array(self::DEFAULT_GROUP, $this->groups) && !in_array($group, $this->groups)) {
|
||||||
$this->groups[] = $group;
|
$this->groups[] = $group;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ class AnnotationLoader implements LoaderInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach ($reflClass->getProperties() as $property) {
|
foreach ($reflClass->getProperties() as $property) {
|
||||||
if ($property->getDeclaringClass()->name == $className) {
|
if ($property->getDeclaringClass()->name === $className) {
|
||||||
foreach ($this->reader->getPropertyAnnotations($property) as $constraint) {
|
foreach ($this->reader->getPropertyAnnotations($property) as $constraint) {
|
||||||
if ($constraint instanceof Constraint) {
|
if ($constraint instanceof Constraint) {
|
||||||
$metadata->addPropertyConstraint($property->name, $constraint);
|
$metadata->addPropertyConstraint($property->name, $constraint);
|
||||||
@ -70,7 +70,7 @@ class AnnotationLoader implements LoaderInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach ($reflClass->getMethods() as $method) {
|
foreach ($reflClass->getMethods() as $method) {
|
||||||
if ($method->getDeclaringClass()->name == $className) {
|
if ($method->getDeclaringClass()->name === $className) {
|
||||||
foreach ($this->reader->getMethodAnnotations($method) as $constraint) {
|
foreach ($this->reader->getMethodAnnotations($method) as $constraint) {
|
||||||
if ($constraint instanceof Callback) {
|
if ($constraint instanceof Callback) {
|
||||||
$constraint->callback = $method->getName();
|
$constraint->callback = $method->getName();
|
||||||
|
@ -85,7 +85,7 @@ class YamlFileLoader extends FileLoader
|
|||||||
$values = array();
|
$values = array();
|
||||||
|
|
||||||
foreach ($nodes as $name => $childNodes) {
|
foreach ($nodes as $name => $childNodes) {
|
||||||
if (is_numeric($name) && is_array($childNodes) && count($childNodes) == 1) {
|
if (is_numeric($name) && is_array($childNodes) && 1 === count($childNodes)) {
|
||||||
$options = current($childNodes);
|
$options = current($childNodes);
|
||||||
|
|
||||||
if (is_array($options)) {
|
if (is_array($options)) {
|
||||||
|
@ -93,7 +93,7 @@ class Parser
|
|||||||
// array
|
// array
|
||||||
if (!isset($values['value']) || '' == trim($values['value'], ' ') || 0 === strpos(ltrim($values['value'], ' '), '#')) {
|
if (!isset($values['value']) || '' == trim($values['value'], ' ') || 0 === strpos(ltrim($values['value'], ' '), '#')) {
|
||||||
$c = $this->getRealCurrentLineNb() + 1;
|
$c = $this->getRealCurrentLineNb() + 1;
|
||||||
$parser = new Parser($c);
|
$parser = new self($c);
|
||||||
$parser->refs = &$this->refs;
|
$parser->refs = &$this->refs;
|
||||||
$data[] = $parser->parse($this->getNextEmbedBlock(null, true), $exceptionOnInvalidType, $objectSupport, $objectForMap);
|
$data[] = $parser->parse($this->getNextEmbedBlock(null, true), $exceptionOnInvalidType, $objectSupport, $objectForMap);
|
||||||
} else {
|
} else {
|
||||||
@ -102,7 +102,7 @@ class Parser
|
|||||||
) {
|
) {
|
||||||
// this is a compact notation element, add to next block and parse
|
// this is a compact notation element, add to next block and parse
|
||||||
$c = $this->getRealCurrentLineNb();
|
$c = $this->getRealCurrentLineNb();
|
||||||
$parser = new Parser($c);
|
$parser = new self($c);
|
||||||
$parser->refs = &$this->refs;
|
$parser->refs = &$this->refs;
|
||||||
|
|
||||||
$block = $values['value'];
|
$block = $values['value'];
|
||||||
@ -159,7 +159,7 @@ class Parser
|
|||||||
$value = $this->getNextEmbedBlock();
|
$value = $this->getNextEmbedBlock();
|
||||||
}
|
}
|
||||||
$c = $this->getRealCurrentLineNb() + 1;
|
$c = $this->getRealCurrentLineNb() + 1;
|
||||||
$parser = new Parser($c);
|
$parser = new self($c);
|
||||||
$parser->refs = &$this->refs;
|
$parser->refs = &$this->refs;
|
||||||
$parsed = $parser->parse($value, $exceptionOnInvalidType, $objectSupport, $objectForMap);
|
$parsed = $parser->parse($value, $exceptionOnInvalidType, $objectSupport, $objectForMap);
|
||||||
|
|
||||||
@ -210,7 +210,7 @@ class Parser
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$c = $this->getRealCurrentLineNb() + 1;
|
$c = $this->getRealCurrentLineNb() + 1;
|
||||||
$parser = new Parser($c);
|
$parser = new self($c);
|
||||||
$parser->refs = &$this->refs;
|
$parser->refs = &$this->refs;
|
||||||
$value = $parser->parse($this->getNextEmbedBlock(), $exceptionOnInvalidType, $objectSupport, $objectForMap);
|
$value = $parser->parse($this->getNextEmbedBlock(), $exceptionOnInvalidType, $objectSupport, $objectForMap);
|
||||||
// Spec: Keys MUST be unique; first one wins.
|
// Spec: Keys MUST be unique; first one wins.
|
||||||
|
Reference in New Issue
Block a user