diff --git a/src/Symfony/Bridge/Doctrine/DataCollector/DoctrineDataCollector.php b/src/Symfony/Bridge/Doctrine/DataCollector/DoctrineDataCollector.php index 62c6a2381a..7f5a5105a7 100644 --- a/src/Symfony/Bridge/Doctrine/DataCollector/DoctrineDataCollector.php +++ b/src/Symfony/Bridge/Doctrine/DataCollector/DoctrineDataCollector.php @@ -162,8 +162,8 @@ class DoctrineDataCollector extends DataCollector $className = get_class($var); return method_exists($var, '__toString') ? - array(sprintf('Object(%s): "%s"', $className, $var->__toString()), false) : - array(sprintf('Object(%s)', $className), false); + array(sprintf('/* Object(%s): */"%s"', $className, $var->__toString()), false) : + array(sprintf('/* Object(%s) */', $className), false); } if (is_array($var)) { @@ -179,7 +179,7 @@ class DoctrineDataCollector extends DataCollector } if (is_resource($var)) { - return array(sprintf('Resource(%s)', get_resource_type($var)), false); + return array(sprintf('/* Resource(%s) */', get_resource_type($var)), false); } return array($var, true); diff --git a/src/Symfony/Bridge/Doctrine/Form/EventListener/MergeDoctrineCollectionListener.php b/src/Symfony/Bridge/Doctrine/Form/EventListener/MergeDoctrineCollectionListener.php index 81ee5cf405..487523dd5d 100644 --- a/src/Symfony/Bridge/Doctrine/Form/EventListener/MergeDoctrineCollectionListener.php +++ b/src/Symfony/Bridge/Doctrine/Form/EventListener/MergeDoctrineCollectionListener.php @@ -45,7 +45,7 @@ class MergeDoctrineCollectionListener implements EventSubscriberInterface // If all items were removed, call clear which has a higher // performance on persistent collections - if ($collection instanceof Collection && count($data) === 0) { + if ($collection instanceof Collection && 0 === count($data)) { $collection->clear(); } } diff --git a/src/Symfony/Bridge/Doctrine/Tests/DataCollector/DoctrineDataCollectorTest.php b/src/Symfony/Bridge/Doctrine/Tests/DataCollector/DoctrineDataCollectorTest.php index 8cbd2c3eac..add62ca58f 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/DataCollector/DoctrineDataCollectorTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/DataCollector/DoctrineDataCollectorTest.php @@ -126,12 +126,12 @@ class DoctrineDataCollectorTest extends TestCase array(true, array(), true, true), array(null, array(), null, true), array(new \DateTime('2011-09-11'), array('date'), '2011-09-11', true), - array(fopen(__FILE__, 'r'), array(), 'Resource(stream)', false), - array(new \stdClass(), array(), 'Object(stdClass)', false), + array(fopen(__FILE__, 'r'), array(), '/* Resource(stream) */', false), + array(new \stdClass(), array(), '/* Object(stdClass) */', false), array( new StringRepresentableClass(), array(), - 'Object(Symfony\Bridge\Doctrine\Tests\DataCollector\StringRepresentableClass): "string representation"', + '/* Object(Symfony\Bridge\Doctrine\Tests\DataCollector\StringRepresentableClass): */"string representation"', false, ), );