From 3959eb801daea591dfc9c83d3c26137076561423 Mon Sep 17 00:00:00 2001 From: William DURAND Date: Mon, 21 Oct 2013 14:46:05 +0200 Subject: [PATCH] Fix CS --- generator/lib/builder/om/PHP5ObjectBuilder.php | 5 ++--- .../lib/collection/PropelObjectCollection.php | 2 +- runtime/lib/map/DatabaseMap.php | 1 + ...onableBehaviorObjectBuilderModifierTest.php | 2 +- .../builder/om/QueryBuilderInheritanceTest.php | 2 +- test/testsuite/generator/model/TableTest.php | 2 +- test/testsuite/misc/FieldnameRelatedTest.php | 10 +++++----- test/testsuite/runtime/adapter/DBMSSQLTest.php | 2 +- .../runtime/connection/PropelPDOTest.php | 11 ++++------- test/testsuite/runtime/query/CriteriaTest.php | 18 +++++++++--------- .../bookstore/validator/ISBNValidator.php | 2 +- 11 files changed, 27 insertions(+), 30 deletions(-) diff --git a/generator/lib/builder/om/PHP5ObjectBuilder.php b/generator/lib/builder/om/PHP5ObjectBuilder.php index 4a4a7ff41..74dbce8f9 100644 --- a/generator/lib/builder/om/PHP5ObjectBuilder.php +++ b/generator/lib/builder/om/PHP5ObjectBuilder.php @@ -1778,7 +1778,7 @@ protected function addArrayMutator(&$script, Column $col) $script .= " if (\$this->$cloUnserialized !== \$v) { \$this->$cloUnserialized = \$v; - \$this->$clo = '| ' . implode(' | ', (array)\$v) . ' |'; + \$this->$clo = '| ' . implode(' | ', (array) \$v) . ' |'; \$this->modifiedColumns[] = " . $this->getColumnConstant($col) . "; } "; @@ -2456,8 +2456,7 @@ public function toArray(\$keyType = BasePeer::$defaultKeyType, \$includeLazyLoad );"; $script .= " \$virtualColumns = \$this->virtualColumns; - foreach(\$virtualColumns as \$key => \$virtualColumn) - { + foreach (\$virtualColumns as \$key => \$virtualColumn) { \$result[\$key] = \$virtualColumn; } "; diff --git a/runtime/lib/collection/PropelObjectCollection.php b/runtime/lib/collection/PropelObjectCollection.php index 5ca6c46b3..265da242f 100644 --- a/runtime/lib/collection/PropelObjectCollection.php +++ b/runtime/lib/collection/PropelObjectCollection.php @@ -306,7 +306,7 @@ private function getIdenticalObject(BaseObject $object) $objectHashCode = $object->hashCode(); } - if($obj->hashCode() === $objectHashCode) { + if ($obj->hashCode() === $objectHashCode) { return $obj; } } diff --git a/runtime/lib/map/DatabaseMap.php b/runtime/lib/map/DatabaseMap.php index 2e5f842ef..6c2880b8f 100644 --- a/runtime/lib/map/DatabaseMap.php +++ b/runtime/lib/map/DatabaseMap.php @@ -180,6 +180,7 @@ public function getTableByPhpName($phpName) $tmClass = constant($peerClass . '::TM_CLASS'); $this->addTableFromMapClass($tmClass); + return $this->tablesByPhpName[$phpName]; } else { throw new PropelException("Cannot fetch TableMap for undefined table phpName: " . $phpName); diff --git a/test/testsuite/generator/behavior/versionable/VersionableBehaviorObjectBuilderModifierTest.php b/test/testsuite/generator/behavior/versionable/VersionableBehaviorObjectBuilderModifierTest.php index 659fd963b..6cfb3d43f 100644 --- a/test/testsuite/generator/behavior/versionable/VersionableBehaviorObjectBuilderModifierTest.php +++ b/test/testsuite/generator/behavior/versionable/VersionableBehaviorObjectBuilderModifierTest.php @@ -1014,7 +1014,7 @@ public function testVersionColumnNameCaseInsensitivity() // class and one for the version class $this->assertEquals(2, sizeof($getterMatches[0])); - // there should be two versions of the filter. one for the main query class + // there should be two versions of the filter. one for the main query class // and one for the version query class $this->assertEquals(2, sizeof($filterMatches[0])); } diff --git a/test/testsuite/generator/builder/om/QueryBuilderInheritanceTest.php b/test/testsuite/generator/builder/om/QueryBuilderInheritanceTest.php index bfb5dbf4c..5f68551f5 100644 --- a/test/testsuite/generator/builder/om/QueryBuilderInheritanceTest.php +++ b/test/testsuite/generator/builder/om/QueryBuilderInheritanceTest.php @@ -134,7 +134,7 @@ public function testDeleteCascadeWithAbstractSingleTableInheritance() $manager->delete(); } - public function testFindPkSimpleWithAbstractSingleTableInheritanceReturnCorrectClass() + public function testFindPkSimpleWithAbstractSingleTableInheritanceReturnCorrectClass() { Propel::disableInstancePooling(); diff --git a/test/testsuite/generator/model/TableTest.php b/test/testsuite/generator/model/TableTest.php index 1cfe1936b..ab90b21ad 100644 --- a/test/testsuite/generator/model/TableTest.php +++ b/test/testsuite/generator/model/TableTest.php @@ -532,7 +532,7 @@ public function testIsCrossRefAttribute() $this->assertFalse($table3->getIsCrossRef()); } - public function testPrefixDoesntAffectPhpName () + public function testPrefixDoesntAffectPhpName() { $xmlToAppData = new XmlToAppData(); $schema = <<assertTrue($result); @@ -52,7 +52,7 @@ public function testFieldNameTypeConstants () /** * Tests the Base[Object]Peer::getFieldNames() method */ - public function testGetFieldNames () + public function testGetFieldNames() { $types = array( BasePeer::TYPE_PHPNAME, @@ -117,7 +117,7 @@ public function testGetFieldNames () /** * Tests the Base[Object]Peer::translateFieldName() method */ - public function testTranslateFieldName () + public function testTranslateFieldName() { $types = array( BasePeer::TYPE_PHPNAME, @@ -146,7 +146,7 @@ public function testTranslateFieldName () /** * Tests the BasePeer::getFieldNames() method */ - public function testGetFieldNamesStatic () + public function testGetFieldNamesStatic() { $types = array( BasePeer::TYPE_PHPNAME, @@ -212,7 +212,7 @@ public function testGetFieldNamesStatic () /** * Tests the BasePeer::translateFieldName() method */ - public function testTranslateFieldNameStatic () + public function testTranslateFieldNameStatic() { $types = array( BasePeer::TYPE_PHPNAME, diff --git a/test/testsuite/runtime/adapter/DBMSSQLTest.php b/test/testsuite/runtime/adapter/DBMSSQLTest.php index e591b4804..b35e3be88 100644 --- a/test/testsuite/runtime/adapter/DBMSSQLTest.php +++ b/test/testsuite/runtime/adapter/DBMSSQLTest.php @@ -19,7 +19,7 @@ */ class DBMSSQLTest extends DBAdapterTestAbstract { - public function testSelectJoinOrderAlias () + public function testSelectJoinOrderAlias() { $adapter = new DBMSSQL(); $sql = 'SELECT Field, Related.Field AS [RelatedField] FROM Record LEFT JOIN Related ON Record.RelatedID = Related.ID ORDER BY [RelatedField] ASC'; diff --git a/test/testsuite/runtime/connection/PropelPDOTest.php b/test/testsuite/runtime/connection/PropelPDOTest.php index bf86cd933..ad340560c 100644 --- a/test/testsuite/runtime/connection/PropelPDOTest.php +++ b/test/testsuite/runtime/connection/PropelPDOTest.php @@ -492,7 +492,6 @@ public function testDebugExecutedQueryStringValue() $prepStmt->execute(array(':p1' => '%Harry%')); $this->assertEquals($expectedQuery, $con->getLastExecutedQuery(), 'DebugPDO failed to quote prepared statement on execute properly'); - // statement with named placeholder, this one won't get substituted $expectedNotSubstitutedQuery = "SELECT book.id FROM `book` WHERE book.title LIKE :name"; $prepStmt = $con->prepare($expectedNotSubstitutedQuery); @@ -528,8 +527,8 @@ public function testDebugExecutedQueryStringValue() /** * Testing if integer values will be quoted correctly by DebugPDOStatement::getExecutedQueryString */ - public function testDebugExecutedQueryIntegerValue() { - + public function testDebugExecutedQueryIntegerValue() + { /** * @var DebugPDO $con */ @@ -558,7 +557,6 @@ public function testDebugExecutedQueryIntegerValue() { $prepStmt->execute(array(':p1' => 123)); $this->assertEquals($expectedQuery, $con->getLastExecutedQuery(), 'DebugPDO failed to quote prepared statement on execute properly'); - // statement with named placeholder, this one won't get substituted $expectedNotSubstitutedQuery = "SELECT book.title FROM `book` WHERE book.id = :name"; $prepStmt = $con->prepare($expectedNotSubstitutedQuery); @@ -595,8 +593,8 @@ public function testDebugExecutedQueryIntegerValue() { * Testing if numeric values will be quoted correctly by DebugPDOStatement::getExecutedQueryString * Numeric values sometimes will get handled differently, since there are numeric values which are non-integer */ - public function testDebugExecutedQueryNumericValue() { - + public function testDebugExecutedQueryNumericValue() + { /** * @var DebugPDO $con */ @@ -625,7 +623,6 @@ public function testDebugExecutedQueryNumericValue() { $prepStmt->execute(array(':p1' => 0002000)); $this->assertEquals($expectedQuery, $con->getLastExecutedQuery(), 'DebugPDO failed to quote prepared statement on execute properly'); - // statement with named placeholder, this one won't get substituted $expectedNotSubstitutedQuery = "SELECT book.title FROM `book` WHERE book.id = :name"; $prepStmt = $con->prepare($expectedNotSubstitutedQuery); diff --git a/test/testsuite/runtime/query/CriteriaTest.php b/test/testsuite/runtime/query/CriteriaTest.php index 06ba22639..972cbb7a1 100644 --- a/test/testsuite/runtime/query/CriteriaTest.php +++ b/test/testsuite/runtime/query/CriteriaTest.php @@ -526,7 +526,7 @@ public function testAddRaw() $this->assertEquals($expected, $params); } - public function testJoinObject () + public function testJoinObject() { $j = new Join('TABLE_A.COL_1', 'TABLE_B.COL_2'); $this->assertEquals('INNER JOIN', $j->getJoinType()); @@ -559,7 +559,7 @@ public function testJoinObject () $this->assertEquals('TABLE_B.COL_2', $j->getRightColumn(1)); } - public function testAddStraightJoin () + public function testAddStraightJoin() { $c = new Criteria(); $c->addSelectColumn("*"); @@ -576,7 +576,7 @@ public function testAddStraightJoin () $this->assertEquals($expect, $result); } - public function testAddSeveralJoins () + public function testAddSeveralJoins() { $c = new Criteria(); $c->addSelectColumn("*"); @@ -595,7 +595,7 @@ public function testAddSeveralJoins () $this->assertEquals($expect, $result); } - public function testAddLeftJoin () + public function testAddLeftJoin() { $c = new Criteria(); $c->addSelectColumn("TABLE_A.*"); @@ -613,7 +613,7 @@ public function testAddLeftJoin () $this->assertEquals($expect, $result); } - public function testAddSeveralLeftJoins () + public function testAddSeveralLeftJoins() { // Fails.. Suspect answer in the chunk starting at BasePeer:605 $c = new Criteria(); @@ -634,7 +634,7 @@ public function testAddSeveralLeftJoins () $this->assertEquals($expect, $result); } - public function testAddRightJoin () + public function testAddRightJoin() { $c = new Criteria(); $c->addSelectColumn("*"); @@ -651,7 +651,7 @@ public function testAddRightJoin () $this->assertEquals($expect, $result); } - public function testAddSeveralRightJoins () + public function testAddSeveralRightJoins() { // Fails.. Suspect answer in the chunk starting at BasePeer:605 $c = new Criteria(); @@ -672,7 +672,7 @@ public function testAddSeveralRightJoins () $this->assertEquals($expect, $result); } - public function testAddInnerJoin () + public function testAddInnerJoin() { $c = new Criteria(); $c->addSelectColumn("*"); @@ -689,7 +689,7 @@ public function testAddInnerJoin () $this->assertEquals($expect, $result); } - public function testAddSeveralInnerJoin () + public function testAddSeveralInnerJoin() { $c = new Criteria(); $c->addSelectColumn("*"); diff --git a/test/tools/helpers/bookstore/validator/ISBNValidator.php b/test/tools/helpers/bookstore/validator/ISBNValidator.php index a91c6144b..c92413ca6 100644 --- a/test/tools/helpers/bookstore/validator/ISBNValidator.php +++ b/test/tools/helpers/bookstore/validator/ISBNValidator.php @@ -22,7 +22,7 @@ class ISBNValidator implements BasicValidator /** * Whether the passed string matches regular expression. */ - public function isValid (ValidatorMap $map, $str) + public function isValid(ValidatorMap $map, $str) { return !(preg_match(self::NOT_ISBN_REGEXP, $str)); }