diff --git a/.travis.yml b/.travis.yml index 6c03aaf46a..4405045107 100644 --- a/.travis.yml +++ b/.travis.yml @@ -46,5 +46,5 @@ install: 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 -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" = "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" = "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 -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; diff --git a/src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php b/src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php index 685ef7d6bd..6efeebc451 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php @@ -336,9 +336,6 @@ class UniqueEntityValidatorTest extends AbstractConstraintValidatorTest $this->assertNoViolation(); } - /** - * @group GH-1635 - */ public function testAssociatedEntity() { $constraint = new UniqueEntity(array( @@ -395,7 +392,6 @@ class UniqueEntityValidatorTest extends AbstractConstraintValidatorTest /** * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException * @expectedExceptionMessage Associated entities are not allowed to have more than one identifier field - * @group GH-1635 */ public function testAssociatedCompositeEntity() { diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/FragmentTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/FragmentTest.php index eafe6bd43e..dff65d636c 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/FragmentTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/FragmentTest.php @@ -11,9 +11,6 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Functional; -/** - * @group functional - */ class FragmentTest extends WebTestCase { /** diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ProfilerTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ProfilerTest.php index d4eb927ff8..a8741124fd 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ProfilerTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ProfilerTest.php @@ -11,9 +11,6 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Functional; -/** - * @group functional - */ class ProfilerTest extends WebTestCase { /** diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SessionTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SessionTest.php index 3e90e9d7a0..415e031189 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SessionTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SessionTest.php @@ -11,9 +11,6 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Functional; -/** - * @group functional - */ class SessionTest extends WebTestCase { /** diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SubRequestsTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SubRequestsTest.php index 2676653b1e..2aaeb220f7 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SubRequestsTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SubRequestsTest.php @@ -11,9 +11,6 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Functional; -/** - * @group functional - */ class SubRequestsTest extends WebTestCase { public function testStateAfterSubRequest() diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/CsrfFormLoginTest.php b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/CsrfFormLoginTest.php index 4c4c1ac295..c2299c9a51 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/CsrfFormLoginTest.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/CsrfFormLoginTest.php @@ -11,9 +11,6 @@ namespace Symfony\Bundle\SecurityBundle\Tests\Functional; -/** - * @group functional - */ class CsrfFormLoginTest extends WebTestCase { /** diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/FirewallEntryPointTest.php b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/FirewallEntryPointTest.php index 656d493009..269cea3b72 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/FirewallEntryPointTest.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/FirewallEntryPointTest.php @@ -13,9 +13,6 @@ namespace Symfony\Bundle\SecurityBundle\Tests\Functional; use Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\FirewallEntryPointBundle\Security\EntryPointStub; -/** - * @group functional - */ class FirewallEntryPointTest extends WebTestCase { public function testItUsesTheConfiguredEntryPointWhenUsingUnknownCredentials() diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/FormLoginTest.php b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/FormLoginTest.php index 6119b45803..3bb2235d51 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/FormLoginTest.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/FormLoginTest.php @@ -11,9 +11,6 @@ namespace Symfony\Bundle\SecurityBundle\Tests\Functional; -/** - * @group functional - */ class FormLoginTest extends WebTestCase { /** diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SecurityRoutingIntegrationTest.php b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SecurityRoutingIntegrationTest.php index f628326482..4c1f0853bb 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SecurityRoutingIntegrationTest.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SecurityRoutingIntegrationTest.php @@ -57,7 +57,6 @@ class SecurityRoutingIntegrationTest extends WebTestCase /** * @dataProvider getConfigs - * @group ip_whitelist */ public function testSecurityConfigurationForSingleIPAddress($config) { @@ -70,7 +69,6 @@ class SecurityRoutingIntegrationTest extends WebTestCase /** * @dataProvider getConfigs - * @group ip_whitelist */ public function testSecurityConfigurationForMultipleIPAddresses($config) { diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SwitchUserTest.php b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SwitchUserTest.php index d9472f2f7d..f4b3d27f21 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SwitchUserTest.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SwitchUserTest.php @@ -11,9 +11,6 @@ namespace Symfony\Bundle\SecurityBundle\Tests\Functional; -/** - * @group functional - */ class SwitchUserTest extends WebTestCase { /** diff --git a/src/Symfony/Component/Config/Definition/Builder/ExprBuilder.php b/src/Symfony/Component/Config/Definition/Builder/ExprBuilder.php index 7887f2d288..3d79b29858 100644 --- a/src/Symfony/Component/Config/Definition/Builder/ExprBuilder.php +++ b/src/Symfony/Component/Config/Definition/Builder/ExprBuilder.php @@ -224,7 +224,7 @@ class ExprBuilder public static function buildExpressions(array $expressions) { foreach ($expressions as $k => $expr) { - if ($expr instanceof ExprBuilder) { + if ($expr instanceof self) { $if = $expr->ifPart; $then = $expr->thenPart; $expressions[$k] = function ($v) use ($if, $then) { diff --git a/src/Symfony/Component/Config/Loader/FileLoader.php b/src/Symfony/Component/Config/Loader/FileLoader.php index 21e4c47331..c1add20cea 100644 --- a/src/Symfony/Component/Config/Loader/FileLoader.php +++ b/src/Symfony/Component/Config/Loader/FileLoader.php @@ -82,7 +82,7 @@ abstract class FileLoader extends Loader try { $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 // as some some loaders do not call the parent __construct() // @deprecated should be removed in 3.0 diff --git a/src/Symfony/Component/DependencyInjection/ContainerBuilder.php b/src/Symfony/Component/DependencyInjection/ContainerBuilder.php index 9cf37cb7f3..b76e07d1be 100644 --- a/src/Symfony/Component/DependencyInjection/ContainerBuilder.php +++ b/src/Symfony/Component/DependencyInjection/ContainerBuilder.php @@ -768,7 +768,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface */ public function register($id, $class = null) { - return $this->setDefinition(strtolower($id), new Definition($class)); + return $this->setDefinition($id, new Definition($class)); } /** diff --git a/src/Symfony/Component/Finder/Tests/FinderTest.php b/src/Symfony/Component/Finder/Tests/FinderTest.php index fe0984dc59..4d196840a5 100644 --- a/src/Symfony/Component/Finder/Tests/FinderTest.php +++ b/src/Symfony/Component/Finder/Tests/FinderTest.php @@ -132,8 +132,6 @@ class FinderTest extends Iterator\RealIteratorTestCase /** * @dataProvider getRegexNameTestData - * - * @group regexName */ public function testRegexName($adapter, $regex) { @@ -506,7 +504,6 @@ class FinderTest extends Iterator\RealIteratorTestCase /** * @dataProvider getContainsTestData - * @group grep */ public function testContains($adapter, $matchPatterns, $noMatchPatterns, $expected) { diff --git a/src/Symfony/Component/HttpFoundation/File/File.php b/src/Symfony/Component/HttpFoundation/File/File.php index dc0e2f7656..87c1606d4a 100644 --- a/src/Symfony/Component/HttpFoundation/File/File.php +++ b/src/Symfony/Component/HttpFoundation/File/File.php @@ -139,7 +139,7 @@ class File extends \SplFileInfo $target = rtrim($directory, '/\\').DIRECTORY_SEPARATOR.(null === $name ? $this->getBasename() : $this->getName($name)); - return new File($target, false); + return new self($target, false); } /** diff --git a/src/Symfony/Component/HttpKernel/DataCollector/DumpDataCollector.php b/src/Symfony/Component/HttpKernel/DataCollector/DumpDataCollector.php index d46194cfbc..e0755ac9ee 100644 --- a/src/Symfony/Component/HttpKernel/DataCollector/DumpDataCollector.php +++ b/src/Symfony/Component/HttpKernel/DataCollector/DumpDataCollector.php @@ -84,7 +84,7 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface $line = $trace[$i]['line']; 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']; $line = $trace[$i]['line']; diff --git a/src/Symfony/Component/Intl/Intl.php b/src/Symfony/Component/Intl/Intl.php index 58a3e84809..cb14e334d0 100644 --- a/src/Symfony/Component/Intl/Intl.php +++ b/src/Symfony/Component/Intl/Intl.php @@ -117,7 +117,7 @@ final class Intl { if (null === self::$currencyBundle) { self::$currencyBundle = new CurrencyBundle( - self::getDataDirectory().'/'.Intl::CURRENCY_DIR, + self::getDataDirectory().'/'.self::CURRENCY_DIR, self::getEntryReader(), self::getLocaleBundle() ); @@ -135,11 +135,11 @@ final class Intl { if (null === self::$languageBundle) { self::$languageBundle = new LanguageBundle( - self::getDataDirectory().'/'.Intl::LANGUAGE_DIR, + self::getDataDirectory().'/'.self::LANGUAGE_DIR, self::getEntryReader(), self::getLocaleBundle(), new ScriptDataProvider( - self::getDataDirectory().'/'.Intl::SCRIPT_DIR, + self::getDataDirectory().'/'.self::SCRIPT_DIR, self::getEntryReader() ) ); @@ -157,7 +157,7 @@ final class Intl { if (null === self::$localeBundle) { self::$localeBundle = new LocaleBundle( - self::getDataDirectory().'/'.Intl::LOCALE_DIR, + self::getDataDirectory().'/'.self::LOCALE_DIR, self::getEntryReader() ); } @@ -174,7 +174,7 @@ final class Intl { if (null === self::$regionBundle) { self::$regionBundle = new RegionBundle( - self::getDataDirectory().'/'.Intl::REGION_DIR, + self::getDataDirectory().'/'.self::REGION_DIR, self::getEntryReader(), self::getLocaleBundle() ); diff --git a/src/Symfony/Component/Process/Tests/AbstractProcessTest.php b/src/Symfony/Component/Process/Tests/AbstractProcessTest.php index 8aa3765245..2a4d583cb2 100644 --- a/src/Symfony/Component/Process/Tests/AbstractProcessTest.php +++ b/src/Symfony/Component/Process/Tests/AbstractProcessTest.php @@ -818,9 +818,6 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase $this->assertFalse($process->isSuccessful()); } - /** - * @group idle-timeout - */ public function testIdleTimeout() { $process = $this->getProcess('php -r "sleep(3);"'); @@ -838,21 +835,18 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase } } - /** - * @group idle-timeout - */ 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->setIdleTimeout(1.5); + $process->setIdleTimeout(1); try { $process->run(); $this->fail('A timeout exception was expected.'); } catch (ProcessTimedOutException $ex) { - $this->assertTrue($ex->isGeneralTimeout()); - $this->assertFalse($ex->isIdleTimeout()); + $this->assertTrue($ex->isGeneralTimeout(), 'A general timeout is expected.'); + $this->assertFalse($ex->isIdleTimeout(), 'No idle timeout is expected.'); $this->assertEquals(2, $ex->getExceededTimeout()); } } diff --git a/src/Symfony/Component/PropertyAccess/PropertyPath.php b/src/Symfony/Component/PropertyAccess/PropertyPath.php index ac3851dbbd..fd7e22e214 100644 --- a/src/Symfony/Component/PropertyAccess/PropertyPath.php +++ b/src/Symfony/Component/PropertyAccess/PropertyPath.php @@ -76,7 +76,7 @@ class PropertyPath implements \IteratorAggregate, PropertyPathInterface public function __construct($propertyPath) { // Can be used as copy constructor - if ($propertyPath instanceof PropertyPath) { + if ($propertyPath instanceof self) { /* @var PropertyPath $propertyPath */ $this->elements = $propertyPath->elements; $this->singulars = $propertyPath->singulars; diff --git a/src/Symfony/Component/Routing/Matcher/Dumper/DumperCollection.php b/src/Symfony/Component/Routing/Matcher/Dumper/DumperCollection.php index ce3a6aa86e..f91df98476 100644 --- a/src/Symfony/Component/Routing/Matcher/Dumper/DumperCollection.php +++ b/src/Symfony/Component/Routing/Matcher/Dumper/DumperCollection.php @@ -50,7 +50,7 @@ class DumperCollection implements \IteratorAggregate */ public function add($child) { - if ($child instanceof DumperCollection) { + if ($child instanceof self) { $child->setParent($this); } $this->children[] = $child; @@ -64,7 +64,7 @@ class DumperCollection implements \IteratorAggregate public function setAll(array $children) { foreach ($children as $child) { - if ($child instanceof DumperCollection) { + if ($child instanceof self) { $child->setParent($this); } } diff --git a/src/Symfony/Component/Routing/Matcher/Dumper/DumperPrefixCollection.php b/src/Symfony/Component/Routing/Matcher/Dumper/DumperPrefixCollection.php index c94377359f..6a615f21ad 100644 --- a/src/Symfony/Component/Routing/Matcher/Dumper/DumperPrefixCollection.php +++ b/src/Symfony/Component/Routing/Matcher/Dumper/DumperPrefixCollection.php @@ -66,7 +66,7 @@ class DumperPrefixCollection extends DumperCollection // Prefix starts with route's prefix if ('' === $collection->prefix || 0 === strpos($prefix, $collection->prefix)) { - $child = new DumperPrefixCollection(); + $child = new self(); $child->setPrefix(substr($prefix, 0, strlen($collection->prefix) + 1)); $collection->add($child); diff --git a/src/Symfony/Component/Security/Acl/Domain/RoleSecurityIdentity.php b/src/Symfony/Component/Security/Acl/Domain/RoleSecurityIdentity.php index 5410a46b37..c28a1c522d 100644 --- a/src/Symfony/Component/Security/Acl/Domain/RoleSecurityIdentity.php +++ b/src/Symfony/Component/Security/Acl/Domain/RoleSecurityIdentity.php @@ -52,7 +52,7 @@ final class RoleSecurityIdentity implements SecurityIdentityInterface */ public function equals(SecurityIdentityInterface $sid) { - if (!$sid instanceof RoleSecurityIdentity) { + if (!$sid instanceof self) { return false; } diff --git a/src/Symfony/Component/Security/Acl/Domain/UserSecurityIdentity.php b/src/Symfony/Component/Security/Acl/Domain/UserSecurityIdentity.php index e3d9a34bae..3bf277f364 100644 --- a/src/Symfony/Component/Security/Acl/Domain/UserSecurityIdentity.php +++ b/src/Symfony/Component/Security/Acl/Domain/UserSecurityIdentity.php @@ -102,7 +102,7 @@ final class UserSecurityIdentity implements SecurityIdentityInterface */ public function equals(SecurityIdentityInterface $sid) { - if (!$sid instanceof UserSecurityIdentity) { + if (!$sid instanceof self) { return false; } diff --git a/src/Symfony/Component/Stopwatch/Tests/StopwatchEventTest.php b/src/Symfony/Component/Stopwatch/Tests/StopwatchEventTest.php index 6399d71b6f..309fc3e2a3 100644 --- a/src/Symfony/Component/Stopwatch/Tests/StopwatchEventTest.php +++ b/src/Symfony/Component/Stopwatch/Tests/StopwatchEventTest.php @@ -76,6 +76,7 @@ class StopwatchEventTest extends \PHPUnit_Framework_TestCase $event->start(); usleep(100000); $event->stop(); + usleep(50000); $event->start(); usleep(100000); $event->stop(); @@ -93,6 +94,7 @@ class StopwatchEventTest extends \PHPUnit_Framework_TestCase $event->start(); usleep(100000); $event->stop(); + usleep(50000); $event->start(); usleep(100000); $this->assertEquals(100, $event->getDuration(), null, self::DELTA); diff --git a/src/Symfony/Component/Validator/Constraint.php b/src/Symfony/Component/Validator/Constraint.php index a8ae634e97..ad86f4418d 100644 --- a/src/Symfony/Component/Validator/Constraint.php +++ b/src/Symfony/Component/Validator/Constraint.php @@ -232,7 +232,7 @@ abstract class Constraint */ 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; } } diff --git a/src/Symfony/Component/Validator/Mapping/Loader/AnnotationLoader.php b/src/Symfony/Component/Validator/Mapping/Loader/AnnotationLoader.php index af0bf5239a..d1b8c35b36 100644 --- a/src/Symfony/Component/Validator/Mapping/Loader/AnnotationLoader.php +++ b/src/Symfony/Component/Validator/Mapping/Loader/AnnotationLoader.php @@ -58,7 +58,7 @@ class AnnotationLoader implements LoaderInterface } foreach ($reflClass->getProperties() as $property) { - if ($property->getDeclaringClass()->name == $className) { + if ($property->getDeclaringClass()->name === $className) { foreach ($this->reader->getPropertyAnnotations($property) as $constraint) { if ($constraint instanceof Constraint) { $metadata->addPropertyConstraint($property->name, $constraint); @@ -70,7 +70,7 @@ class AnnotationLoader implements LoaderInterface } foreach ($reflClass->getMethods() as $method) { - if ($method->getDeclaringClass()->name == $className) { + if ($method->getDeclaringClass()->name === $className) { foreach ($this->reader->getMethodAnnotations($method) as $constraint) { if ($constraint instanceof Callback) { $constraint->callback = $method->getName(); diff --git a/src/Symfony/Component/Validator/Mapping/Loader/YamlFileLoader.php b/src/Symfony/Component/Validator/Mapping/Loader/YamlFileLoader.php index e293a6eb38..6075b270ba 100644 --- a/src/Symfony/Component/Validator/Mapping/Loader/YamlFileLoader.php +++ b/src/Symfony/Component/Validator/Mapping/Loader/YamlFileLoader.php @@ -85,7 +85,7 @@ class YamlFileLoader extends FileLoader $values = array(); 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); if (is_array($options)) { diff --git a/src/Symfony/Component/Yaml/Parser.php b/src/Symfony/Component/Yaml/Parser.php index 065e650b4c..d72c7639c8 100644 --- a/src/Symfony/Component/Yaml/Parser.php +++ b/src/Symfony/Component/Yaml/Parser.php @@ -93,7 +93,7 @@ class Parser // array if (!isset($values['value']) || '' == trim($values['value'], ' ') || 0 === strpos(ltrim($values['value'], ' '), '#')) { $c = $this->getRealCurrentLineNb() + 1; - $parser = new Parser($c); + $parser = new self($c); $parser->refs = &$this->refs; $data[] = $parser->parse($this->getNextEmbedBlock(null, true), $exceptionOnInvalidType, $objectSupport, $objectForMap); } else { @@ -102,7 +102,7 @@ class Parser ) { // this is a compact notation element, add to next block and parse $c = $this->getRealCurrentLineNb(); - $parser = new Parser($c); + $parser = new self($c); $parser->refs = &$this->refs; $block = $values['value']; @@ -159,7 +159,7 @@ class Parser $value = $this->getNextEmbedBlock(); } $c = $this->getRealCurrentLineNb() + 1; - $parser = new Parser($c); + $parser = new self($c); $parser->refs = &$this->refs; $parsed = $parser->parse($value, $exceptionOnInvalidType, $objectSupport, $objectForMap); @@ -210,7 +210,7 @@ class Parser } } else { $c = $this->getRealCurrentLineNb() + 1; - $parser = new Parser($c); + $parser = new self($c); $parser->refs = &$this->refs; $value = $parser->parse($this->getNextEmbedBlock(), $exceptionOnInvalidType, $objectSupport, $objectForMap); // Spec: Keys MUST be unique; first one wins.