diff --git a/src/Symfony/Bridge/Propel1/DataCollector/PropelDataCollector.php b/src/Symfony/Bridge/Propel1/DataCollector/PropelDataCollector.php index 6efb8f561a..bc91564a57 100644 --- a/src/Symfony/Bridge/Propel1/DataCollector/PropelDataCollector.php +++ b/src/Symfony/Bridge/Propel1/DataCollector/PropelDataCollector.php @@ -26,7 +26,7 @@ class PropelDataCollector extends DataCollector /** * Propel logger. * - * @var \Symfony\Bridge\Propel1\Logger\PropelLogger + * @var PropelLogger */ private $logger; @@ -63,7 +63,7 @@ class PropelDataCollector extends DataCollector /** * Returns the collector name. * - * @return string The collector name. + * @return string */ public function getName() { @@ -71,9 +71,9 @@ class PropelDataCollector extends DataCollector } /** - * Returns queries. + * Returns the collected stats for all executed SQL queries. * - * @return array Queries + * @return array */ public function getQueries() { @@ -83,7 +83,7 @@ class PropelDataCollector extends DataCollector /** * Returns the query count. * - * @return int The query count + * @return int */ public function getQueryCount() { @@ -91,9 +91,9 @@ class PropelDataCollector extends DataCollector } /** - * Returns the total time of queries. + * Returns the total time spent on running all queries. * - * @return float The total time of queries + * @return float */ public function getTime() { @@ -106,9 +106,9 @@ class PropelDataCollector extends DataCollector } /** - * Creates an array of Build objects. + * Computes the stats of all executed SQL queries. * - * @return array An array of Build objects + * @return array */ private function buildQueries() { @@ -136,9 +136,9 @@ class PropelDataCollector extends DataCollector } /** - * Count queries. + * Returns the total count of SQL queries. * - * @return int The number of queries. + * @return int */ private function countQueries() { diff --git a/src/Symfony/Bridge/Propel1/DependencyInjection/Security/UserProvider/PropelFactory.php b/src/Symfony/Bridge/Propel1/DependencyInjection/Security/UserProvider/PropelFactory.php index 2706d341a9..eb8e2e4a72 100644 --- a/src/Symfony/Bridge/Propel1/DependencyInjection/Security/UserProvider/PropelFactory.php +++ b/src/Symfony/Bridge/Propel1/DependencyInjection/Security/UserProvider/PropelFactory.php @@ -26,6 +26,12 @@ class PropelFactory implements UserProviderFactoryInterface private $key; private $providerId; + /** + * Constructor. + * + * @param string $key + * @param string $providerId + */ public function __construct($key, $providerId) { $this->key = $key; @@ -38,7 +44,7 @@ class PropelFactory implements UserProviderFactoryInterface ->setDefinition($id, new DefinitionDecorator($this->providerId)) ->addArgument($config['class']) ->addArgument($config['property']) - ; + ; } public function getKey() @@ -50,9 +56,14 @@ class PropelFactory implements UserProviderFactoryInterface { $node ->children() - ->scalarNode('class')->isRequired()->cannotBeEmpty()->end() - ->scalarNode('property')->defaultNull()->end() + ->scalarNode('class') + ->isRequired() + ->cannotBeEmpty() + ->end() + ->scalarNode('property') + ->defaultNull() + ->end() ->end() - ; + ; } } diff --git a/src/Symfony/Bridge/Propel1/Form/Type/ModelType.php b/src/Symfony/Bridge/Propel1/Form/Type/ModelType.php index ca049b5bf2..aa500928a1 100644 --- a/src/Symfony/Bridge/Propel1/Form/Type/ModelType.php +++ b/src/Symfony/Bridge/Propel1/Form/Type/ModelType.php @@ -55,11 +55,19 @@ class ModelType extends AbstractType */ private $propertyAccessor; + /** + * Constructor. + * + * @param PropertyAccessorInterface|null $propertyAccessor + */ public function __construct(PropertyAccessorInterface $propertyAccessor = null) { $this->propertyAccessor = $propertyAccessor ?: PropertyAccess::createPropertyAccessor(); } + /** + * {@inheritdoc} + */ public function buildForm(FormBuilderInterface $builder, array $options) { if ($options['multiple']) { @@ -67,6 +75,9 @@ class ModelType extends AbstractType } } + /** + * {@inheritdoc} + */ public function setDefaultOptions(OptionsResolverInterface $resolver) { $propertyAccessor = $this->propertyAccessor; @@ -97,11 +108,17 @@ class ModelType extends AbstractType )); } + /** + * {@inheritdoc} + */ public function getParent() { return 'choice'; } + /** + * {@inheritdoc} + */ public function getName() { return 'model'; diff --git a/src/Symfony/Bridge/Propel1/Form/Type/TranslationCollectionType.php b/src/Symfony/Bridge/Propel1/Form/Type/TranslationCollectionType.php index e9b6978a0f..8aaa120b55 100644 --- a/src/Symfony/Bridge/Propel1/Form/Type/TranslationCollectionType.php +++ b/src/Symfony/Bridge/Propel1/Form/Type/TranslationCollectionType.php @@ -40,6 +40,9 @@ class TranslationCollectionType extends AbstractType $builder->addEventSubscriber($listener); } + /** + * {@inheritdoc} + */ public function getParent() { return 'collection'; diff --git a/src/Symfony/Bridge/Propel1/Tests/DataCollector/PropelDataCollectorTest.php b/src/Symfony/Bridge/Propel1/Tests/DataCollector/PropelDataCollectorTest.php index 756cbfa9f4..0f454e55ff 100644 --- a/src/Symfony/Bridge/Propel1/Tests/DataCollector/PropelDataCollectorTest.php +++ b/src/Symfony/Bridge/Propel1/Tests/DataCollector/PropelDataCollectorTest.php @@ -92,18 +92,19 @@ class PropelDataCollectorTest extends Propel1TestCase private function createCollector($queries) { $config = $this->getMock('\PropelConfiguration'); + $config ->expects($this->any()) ->method('getParameter') ->will($this->returnArgument(1)) - ; + ; $logger = $this->getMock('\Symfony\Bridge\Propel1\Logger\PropelLogger'); $logger ->expects($this->any()) ->method('getQueries') ->will($this->returnValue($queries)) - ; + ; return new PropelDataCollector($logger, $config); } diff --git a/src/Symfony/Bridge/Propel1/Tests/Fixtures/Column.php b/src/Symfony/Bridge/Propel1/Tests/Fixtures/Column.php index 6b03977e20..431f8e1373 100644 --- a/src/Symfony/Bridge/Propel1/Tests/Fixtures/Column.php +++ b/src/Symfony/Bridge/Propel1/Tests/Fixtures/Column.php @@ -14,7 +14,6 @@ namespace Symfony\Bridge\Propel1\Tests\Fixtures; class Column { private $name; - private $type; public function __construct($name, $type) @@ -35,13 +34,13 @@ class Column } switch ($this->type) { - case \PropelColumnTypes::CHAR: - case \PropelColumnTypes::VARCHAR: - case \PropelColumnTypes::LONGVARCHAR: - case \PropelColumnTypes::BLOB: - case \PropelColumnTypes::CLOB: - case \PropelColumnTypes::CLOB_EMU: - return true; + case \PropelColumnTypes::CHAR: + case \PropelColumnTypes::VARCHAR: + case \PropelColumnTypes::LONGVARCHAR: + case \PropelColumnTypes::BLOB: + case \PropelColumnTypes::CLOB: + case \PropelColumnTypes::CLOB_EMU: + return true; } return false; @@ -54,6 +53,6 @@ class Column public function isNotNull() { - return ('id' === $this->name); + return 'id' === $this->name; } } diff --git a/src/Symfony/Bridge/Propel1/Tests/Fixtures/Item.php b/src/Symfony/Bridge/Propel1/Tests/Fixtures/Item.php index fbe0b82ed1..faca7df59e 100644 --- a/src/Symfony/Bridge/Propel1/Tests/Fixtures/Item.php +++ b/src/Symfony/Bridge/Propel1/Tests/Fixtures/Item.php @@ -11,16 +11,11 @@ namespace Symfony\Bridge\Propel1\Tests\Fixtures; -use PropelPDO; - class Item implements \Persistent { private $id; - private $value; - private $groupName; - private $price; public function __construct($id = null, $value = null, $groupName = null, $price = null) @@ -98,11 +93,11 @@ class Item implements \Persistent { } - public function delete(PropelPDO $con = null) + public function delete(\PropelPDO $con = null) { } - public function save(PropelPDO $con = null) + public function save(\PropelPDO $con = null) { } } diff --git a/src/Symfony/Bridge/Propel1/Tests/Fixtures/TranslatableItem.php b/src/Symfony/Bridge/Propel1/Tests/Fixtures/TranslatableItem.php index c69fe45299..8c1c2e2dc7 100644 --- a/src/Symfony/Bridge/Propel1/Tests/Fixtures/TranslatableItem.php +++ b/src/Symfony/Bridge/Propel1/Tests/Fixtures/TranslatableItem.php @@ -11,16 +11,11 @@ namespace Symfony\Bridge\Propel1\Tests\Fixtures; -use PropelPDO; - class TranslatableItem implements \Persistent { private $id; - private $currentTranslations; - private $groupName; - private $price; public function __construct($id = null, $translations = array()) @@ -91,15 +86,15 @@ class TranslatableItem implements \Persistent { } - public function delete(PropelPDO $con = null) + public function delete(\PropelPDO $con = null) { } - public function save(PropelPDO $con = null) + public function save(\PropelPDO $con = null) { } - public function getTranslation($locale = 'de', PropelPDO $con = null) + public function getTranslation($locale = 'de', \PropelPDO $con = null) { if (!isset($this->currentTranslations[$locale])) { $translation = new TranslatableItemI18n(); diff --git a/src/Symfony/Bridge/Propel1/Tests/Fixtures/TranslatableItemI18n.php b/src/Symfony/Bridge/Propel1/Tests/Fixtures/TranslatableItemI18n.php index 1fa1741ab5..76c546c0b3 100644 --- a/src/Symfony/Bridge/Propel1/Tests/Fixtures/TranslatableItemI18n.php +++ b/src/Symfony/Bridge/Propel1/Tests/Fixtures/TranslatableItemI18n.php @@ -11,18 +11,12 @@ namespace Symfony\Bridge\Propel1\Tests\Fixtures; -use PropelPDO; - class TranslatableItemI18n implements \Persistent { private $id; - private $locale; - private $value; - private $value2; - private $item; public function __construct($id = null, $locale = null, $value = null) @@ -84,11 +78,11 @@ class TranslatableItemI18n implements \Persistent { } - public function delete(PropelPDO $con = null) + public function delete(\PropelPDO $con = null) { } - public function save(PropelPDO $con = null) + public function save(\PropelPDO $con = null) { } diff --git a/src/Symfony/Bridge/Propel1/Tests/Form/ChoiceList/ModelChoiceListTest.php b/src/Symfony/Bridge/Propel1/Tests/Form/ChoiceList/ModelChoiceListTest.php index 9f9a69e331..d0194f8c54 100644 --- a/src/Symfony/Bridge/Propel1/Tests/Form/ChoiceList/ModelChoiceListTest.php +++ b/src/Symfony/Bridge/Propel1/Tests/Form/ChoiceList/ModelChoiceListTest.php @@ -249,7 +249,7 @@ class ModelChoiceListTest extends Propel1TestCase */ public function testEmptyClass() { - $choiceList = new ModelChoiceList(''); + new ModelChoiceList(''); } /** @@ -257,6 +257,6 @@ class ModelChoiceListTest extends Propel1TestCase */ public function testInvalidClass() { - $choiceList = new ModelChoiceList('Foo\Bar\DoesNotExistClass'); + new ModelChoiceList('Foo\Bar\DoesNotExistClass'); } } diff --git a/src/Symfony/Bridge/Propel1/Tests/Form/DataTransformer/CollectionToArrayTransformerTest.php b/src/Symfony/Bridge/Propel1/Tests/Form/DataTransformer/CollectionToArrayTransformerTest.php index 0830747608..544e56902e 100644 --- a/src/Symfony/Bridge/Propel1/Tests/Form/DataTransformer/CollectionToArrayTransformerTest.php +++ b/src/Symfony/Bridge/Propel1/Tests/Form/DataTransformer/CollectionToArrayTransformerTest.php @@ -11,7 +11,6 @@ namespace Symfony\Bridge\Propel1\Tests\Form\DataTransformer; -use PropelObjectCollection; use Symfony\Bridge\Propel1\Form\DataTransformer\CollectionToArrayTransformer; use Symfony\Bridge\Propel1\Tests\Propel1TestCase; @@ -32,7 +31,7 @@ class CollectionToArrayTransformerTest extends Propel1TestCase public function testTransform() { - $result = $this->transformer->transform(new PropelObjectCollection()); + $result = $this->transformer->transform(new \PropelObjectCollection()); $this->assertTrue(is_array($result)); $this->assertCount(0, $result); @@ -56,7 +55,7 @@ class CollectionToArrayTransformerTest extends Propel1TestCase public function testTransformWithData() { - $coll = new PropelObjectCollection(); + $coll = new \PropelObjectCollection(); $coll->setData(array('foo', 'bar')); $result = $this->transformer->transform($coll); diff --git a/src/Symfony/Bridge/Propel1/Tests/Form/PropelTypeGuesserTest.php b/src/Symfony/Bridge/Propel1/Tests/Form/PropelTypeGuesserTest.php index 3762a57633..1d9e6bdb39 100644 --- a/src/Symfony/Bridge/Propel1/Tests/Form/PropelTypeGuesserTest.php +++ b/src/Symfony/Bridge/Propel1/Tests/Form/PropelTypeGuesserTest.php @@ -18,16 +18,20 @@ use Symfony\Component\Form\Guess\Guess; class PropelTypeGuesserTest extends Propel1TestCase { const CLASS_NAME = 'Symfony\Bridge\Propel1\Tests\Fixtures\Item'; - const UNKNOWN_CLASS_NAME = 'Symfony\Bridge\Propel1\Tests\Fixtures\UnknownItem'; private $guesser; - public function setUp() + protected function setUp() { $this->guesser = new PropelTypeGuesser(); } + protected function tearDown() + { + $this->guesser = null; + } + public function testGuessMaxLengthWithText() { $value = $this->guesser->guessMaxLength(self::CLASS_NAME, 'value'); diff --git a/src/Symfony/Bridge/Propel1/Tests/Form/Type/TranslationCollectionTypeTest.php b/src/Symfony/Bridge/Propel1/Tests/Form/Type/TranslationCollectionTypeTest.php index 0663020cc6..f5b64c3c75 100644 --- a/src/Symfony/Bridge/Propel1/Tests/Form/Type/TranslationCollectionTypeTest.php +++ b/src/Symfony/Bridge/Propel1/Tests/Form/Type/TranslationCollectionTypeTest.php @@ -23,16 +23,9 @@ class TranslationCollectionTypeTest extends TypeTestCase const TRANSLATABLE_I18N_CLASS = 'Symfony\Bridge\Propel1\Tests\Fixtures\TranslatableItemI18n'; const NON_TRANSLATION_CLASS = 'Symfony\Bridge\Propel1\Tests\Fixtures\Item'; - protected function setUp() - { - parent::setUp(); - } - protected function getExtensions() { - return array_merge(parent::getExtensions(), array( - new PropelExtension(), - )); + return array(new PropelExtension()); } public function testTranslationsAdded()