Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix CS

  • Loading branch information...
commit b20978480f097e303df24fe59ef9c205779b490f 1 parent 808bc84
@willdurand willdurand authored
Showing with 196 additions and 219 deletions.
  1. +0 −1  generator/bin/phing.php
  2. +10 −10 generator/lib/behavior/AlternativeCodingStandardsBehavior.php
  3. +4 −8 generator/lib/behavior/SoftDeleteBehavior.php
  4. +1 −1  generator/lib/behavior/aggregate_column/AggregateColumnBehavior.php
  5. +1 −1  generator/lib/behavior/aggregate_column/templates/objectPostSave.php
  6. +2 −4 generator/lib/behavior/archivable/ArchivableBehaviorObjectBuilderModifier.php
  7. +3 −5 generator/lib/behavior/nestedset/NestedSetBehaviorObjectBuilderModifier.php
  8. +1 −0  generator/lib/behavior/sluggable/SluggableBehavior.php
  9. +1 −2  generator/lib/behavior/sortable/SortableBehaviorObjectBuilderModifier.php
  10. +2 −1  generator/lib/behavior/sortable/SortableRelationBehavior.php
  11. +3 −3 generator/lib/builder/om/OMBuilder.php
  12. +1 −9 generator/lib/builder/om/PHP5NodeBuilder.php
  13. +14 −13 generator/lib/builder/om/PHP5ObjectBuilder.php
  14. +2 −4 generator/lib/builder/om/PHP5ObjectNoCollectionBuilder.php
  15. +9 −10 generator/lib/builder/om/PHP5PeerBuilder.php
  16. +2 −2 generator/lib/builder/util/XmlToDataSQL.php
  17. +1 −1  generator/lib/model/AppData.php
  18. +2 −2 generator/lib/model/Column.php
  19. +3 −3 generator/lib/model/Database.php
  20. +2 −2 generator/lib/model/ForeignKey.php
  21. +5 −5 generator/lib/model/Inheritance.php
  22. +1 −1  generator/lib/model/NameFactory.php
  23. +1 −1  generator/lib/model/PhpNameGenerator.php
  24. +3 −3 generator/lib/model/ScopedElement.php
  25. +4 −2 generator/lib/model/Table.php
  26. +5 −5 generator/lib/platform/MysqlPlatform.php
  27. +2 −2 generator/lib/task/AbstractPropelDataModelTask.php
  28. +1 −1  generator/lib/task/PropelDataDumpTask.php
  29. +1 −1  generator/lib/task/PropelSQLExec.php
  30. +3 −3 runtime/lib/adapter/DBMSSQL.php
  31. +2 −2 runtime/lib/config/PropelConfiguration.php
  32. +2 −2 runtime/lib/om/NodeObject.php
  33. +13 −13 runtime/lib/query/Criteria.php
  34. +3 −3 runtime/lib/query/Criterion.php
  35. +1 −1  runtime/lib/query/Join.php
  36. +18 −18 runtime/lib/query/ModelCriteria.php
  37. +2 −2 runtime/lib/query/ModelJoin.php
  38. +1 −1  runtime/lib/query/PropelQuery.php
  39. +1 −1  test/fixtures/namespaced/schema.xml
  40. +3 −7 test/testsuite/generator/behavior/AlternativeCodingStandardsBehaviorTest.php
  41. +1 −12 test/testsuite/generator/behavior/nestedset/NestedSetBehaviorObjectBuilderModifierWithScopeTest.php
  42. +9 −9 test/testsuite/generator/builder/om/GeneratedObjectMoreRelationTest.php
  43. +4 −6 test/testsuite/generator/builder/om/GeneratedObjectTest.php
  44. +1 −0  test/testsuite/generator/platform/MysqlPlatformMigrationMyISAMTest.php
  45. +1 −0  test/testsuite/generator/platform/MysqlPlatformMigrationTest.php
  46. +1 −0  test/testsuite/generator/platform/MysqlPlatformMyISAMTest.php
  47. +1 −0  test/testsuite/generator/platform/MysqlPlatformTest.php
  48. +0 −1  test/testsuite/generator/reverse/mysql/MysqlSchemaParserTest.php
  49. +6 −7 test/testsuite/misc/Issue617Test.php
  50. +3 −3 test/testsuite/runtime/adapter/DBAdapterTestAbstract.php
  51. +3 −2 test/testsuite/runtime/adapter/DBMSSQLTest.php
  52. +2 −1  test/testsuite/runtime/adapter/DBMySQLTest.php
  53. +2 −1  test/testsuite/runtime/adapter/DBOracleTest.php
  54. +2 −1  test/testsuite/runtime/adapter/DBPostgresTest.php
  55. +10 −10 test/testsuite/runtime/collection/PropelCollectionTest.php
  56. +1 −1  test/testsuite/runtime/collection/PropelOnDemandCollectionTest.php
  57. +2 −1  test/testsuite/runtime/query/CriteriaTest.php
  58. +2 −1  test/testsuite/runtime/query/JoinTest.php
  59. +2 −1  test/testsuite/runtime/query/ModelCriteriaSelectTest.php
  60. +6 −5 test/testsuite/runtime/query/ModelCriteriaTest.php
  61. +1 −1  test/tools/helpers/PlatformDatabaseBuildTimeBase.php
View
1  generator/bin/phing.php
@@ -62,4 +62,3 @@
// exit with non-0 error code.
exit(1);
}
-
View
20 generator/lib/behavior/AlternativeCodingStandardsBehavior.php
@@ -39,13 +39,13 @@
class AlternativeCodingStandardsBehavior extends Behavior
{
// default parameters value
- protected $parameters = array(
- 'brackets_newline' => 'true',
- 'remove_closing_comments' => 'true',
- 'use_whitespace' => 'true',
- 'tab_size' => 2,
- 'strip_comments' => 'false'
- );
+ protected $parameters = array(
+ 'brackets_newline' => 'true',
+ 'remove_closing_comments' => 'true',
+ 'use_whitespace' => 'true',
+ 'tab_size' => 2,
+ 'strip_comments' => 'false'
+ );
public function objectFilter(&$script)
{
@@ -90,7 +90,7 @@ public function tableMapFilter(&$script)
protected function filter(&$script)
{
$filter = array();
- if($this->getParameter('brackets_newline') == 'true') {
+ if ($this->getParameter('brackets_newline') == 'true') {
$filter['#^(\t*)\}\h(else|elseif|catch)(.*)\h\{$#m'] = "$1}
$1$2$3
$1{";
@@ -113,8 +113,8 @@ protected function filter(&$script)
/**
* Remove inline and codeblock comments from a PHP code string
- * @param string $code The input code
- * @return string The input code, without comments
+ * @param string $code The input code
+ * @return string The input code, without comments
*/
public static function stripComments($code)
{
View
12 generator/lib/behavior/SoftDeleteBehavior.php
@@ -61,12 +61,10 @@ public function addObjectForceDelete(&$script)
*/
public function forceDelete(PropelPDO \$con = null)
{
- if (\$isSoftDeleteEnabled = {$peerClassName}::isSoftDeleteEnabled()) {
- {$peerClassName}::disableSoftDelete();
+ if (\$isSoftDeleteEnabled = {$peerClassName}::isSoftDeleteEnabled()) { {$peerClassName}::disableSoftDelete();
}
\$this->delete(\$con);
- if (\$isSoftDeleteEnabled) {
- {$peerClassName}::enableSoftDelete();
+ if (\$isSoftDeleteEnabled) { {$peerClassName}::enableSoftDelete();
}
}
";
@@ -275,8 +273,7 @@ public function preSelectQuery($builder)
return <<<EOT
if ({$builder->getStubQueryBuilder()->getClassname()}::isSoftDeleteEnabled() && \$this->localSoftDelete) {
\$this->addUsingAlias({$builder->getColumnConstant($this->getColumnForParameter('deleted_column'))}, null, Criteria::ISNULL);
-} else {
- {$builder->getPeerClassname()}::enableSoftDelete();
+} else { {$builder->getPeerClassname()}::enableSoftDelete();
}
EOT;
}
@@ -479,8 +476,7 @@ public function preSelect($builder)
return <<<EOT
if ({$builder->getStubQueryBuilder()->getClassname()}::isSoftDeleteEnabled()) {
\$criteria->add({$builder->getColumnConstant($this->getColumnForParameter('deleted_column'))}, null, Criteria::ISNULL);
-} else {
- {$builder->getPeerClassname()}::enableSoftDelete();
+} else { {$builder->getPeerClassname()}::enableSoftDelete();
}
EOT;
}
View
2  generator/lib/behavior/aggregate_column/AggregateColumnBehavior.php
@@ -74,7 +74,7 @@ public function objectMethods($builder)
protected function addObjectCompute()
{
$conditions = array();
- if($this->getParameter('condition')) {
+ if ($this->getParameter('condition')) {
$conditions[] = $this->getParameter('condition');
}
View
2  generator/lib/behavior/aggregate_column/templates/objectPostSave.php
@@ -3,4 +3,4 @@
if ($this->isModified()) {
$this->save($con);
}
-}
+}
View
6 generator/lib/behavior/archivable/ArchivableBehaviorObjectBuilderModifier.php
@@ -196,8 +196,7 @@ public function addPopulateFromArchive($builder)
*/
public function fakeAutoIncrementPrimaryKeyForConcreteInheritance()
{
- if ($this->table->hasBehavior('concrete_inheritance'))
- {
+ if ($this->table->hasBehavior('concrete_inheritance')) {
$concrete_inheritance_behavior = $this->table->getBehavior('concrete_inheritance');
$database = $this->table->getDatabase();
@@ -207,8 +206,7 @@ public function fakeAutoIncrementPrimaryKeyForConcreteInheritance()
$tableName = $concrete_inheritance_behavior->getParameter('schema').'.'.$tableName;
}
- if (( $parent_table = $database->getTable($tableName) ))
- {
+ if (( $parent_table = $database->getTable($tableName) )) {
return $parent_table->hasBehavior('archivable')
&& $parent_table->hasAutoIncrementPrimaryKey();
}
View
8 generator/lib/behavior/nestedset/NestedSetBehaviorObjectBuilderModifier.php
@@ -1341,17 +1341,15 @@ protected function moveSubtreeTo(\$destLeft, \$levelDelta" . ($this->behavior->u
\$left = \$this->getLeftValue();
\$right = \$this->getRightValue();";
-
if ($useScope) {
$script .= "
\$scope = \$this->getScopeValue();
- if (\$targetScope === null){
+ if (\$targetScope === null) {
\$targetScope = \$scope;
}";
}
-
$script .= "
@@ -1373,7 +1371,7 @@ protected function moveSubtreeTo(\$destLeft, \$levelDelta" . ($this->behavior->u
$script .= "
- if (\$targetScope != \$scope){
+ if (\$targetScope != \$scope) {
//move subtree to < 0, so the items are out of scope.
$peerClassname::shiftRLValues(-\$right, \$left, \$right" . ($useScope ? ", \$scope" : "") . ", \$con);
@@ -1396,7 +1394,7 @@ protected function moveSubtreeTo(\$destLeft, \$levelDelta" . ($this->behavior->u
$script .= "
- if (!\$preventDefault){
+ if (!\$preventDefault) {
if (\$left >= \$destLeft) { // src was shifted too?
View
1  generator/lib/behavior/sluggable/SluggableBehavior.php
@@ -115,6 +115,7 @@ public function preSave($builder)
\$this->{$this->getColumnSetter()}(\$this->createSlug());
}";
}
+
return $script;
}
View
3  generator/lib/behavior/sortable/SortableBehaviorObjectBuilderModifier.php
@@ -92,8 +92,7 @@ public function preUpdate($builder)
return "// if scope has changed and rank was not modified (if yes, assuming superior action)
// insert object to the end of new scope and cleanup old one
-if (\$this->isColumnModified({$this->peerClassname}::SCOPE_COL) && !\$this->isColumnModified({$this->peerClassname}::RANK_COL)) {
- {$this->peerClassname}::shiftRank(-1, \$this->{$this->getColumnGetter()}() + 1, null, \$this->oldScope, \$con);
+if (\$this->isColumnModified({$this->peerClassname}::SCOPE_COL) && !\$this->isColumnModified({$this->peerClassname}::RANK_COL)) { {$this->peerClassname}::shiftRank(-1, \$this->{$this->getColumnGetter()}() + 1, null, \$this->oldScope, \$con);
\$this->insertAtBottom(\$con);
}
";
View
3  generator/lib/behavior/sortable/SortableRelationBehavior.php
@@ -40,6 +40,7 @@ public function preDelete($builder)
$script = "\$this->{$this->getObjectMoveRelatedToNullScopeMethodName()}(\$con);
";
+
return $script;
}
@@ -56,12 +57,12 @@ protected function getForeignColumnForParameter($param)
protected function getRelatedClassPluralForm()
{
$relatedClass = $this->getForeignTable()->getPhpName();
+
return $this->builder->getPluralizer()->getPluralForm($relatedClass);
}
protected function getObjectMoveRelatedToNullScopeMethodName()
{
-
return "moveRelated{$this->getRelatedClassPluralForm()}ToNullScope";
}
View
6 generator/lib/builder/om/OMBuilder.php
@@ -503,8 +503,8 @@ protected function isAddIncludes()
/**
* Checks whether any registered behavior on that table has a modifier for a hook
- * @param string $hookName The name of the hook as called from one of this class methods, e.g. "preSave"
- * @param string $modifier The name of the modifier object providing the method in the behavior
+ * @param string $hookName The name of the hook as called from one of this class methods, e.g. "preSave"
+ * @param string $modifier The name of the modifier object providing the method in the behavior
* @return boolean
*/
public function hasBehaviorModifier($hookName, $modifier)
@@ -554,7 +554,7 @@ public function applyBehaviorModifierBase($hookName, $modifier, &$script, $tab =
/**
* Checks whether any registered behavior content creator on that table exists a contentName
* @param string $contentName The name of the content as called from one of this class methods, e.g. "parentClassname"
- * @param string $modifier The name of the modifier object providing the method in the behavior
+ * @param string $modifier The name of the modifier object providing the method in the behavior
*/
public function getBehaviorContentBase($contentName, $modifier)
{
View
10 generator/lib/builder/om/PHP5NodeBuilder.php
@@ -209,7 +209,6 @@ protected function addCallOverload(&$script)
public function __call(\$name, \$parms)
{
if (method_exists(\$this->obj, \$name))
-
return call_user_func_array(array(\$this->obj, \$name), \$parms);
else
throw new PropelException('get method not defined: \$name');
@@ -347,11 +346,9 @@ public function hasChildNode(\$node, \$strict = false, \$recurse = false)
{
foreach (\$this->childNodes as \$childNode) {
if (\$childNode->equals(\$node, \$strict))
-
return true;
if (\$recurse && \$childNode->hasChildNode(\$node, \$recurse))
-
return true;
}
@@ -483,17 +480,13 @@ public function getSiblingNode(\$prev = false, \$querydb = false, PropelPDO \$co
return null;
} elseif (\$prev) {
if (\$nidx > 1 && (\$parentNode = \$this->getParentNode(\$querydb, \$con)))
-
return \$parentNode->getChildNodeAt(\$nidx-1, \$querydb, \$con);
else
-
return null;
} else {
if (\$parentNode = \$this->getParentNode(\$querydb, \$con))
-
return \$parentNode->getChildNodeAt(\$nidx+1, \$querydb, \$con);
else
-
return null;
}
}
@@ -939,7 +932,6 @@ protected function shiftChildNodes(\$direction, \$offsetIdx, PropelPDO \$con)
\$lastIdx = (\$lastNode !== null ? \$lastNode->getNodeIndex() : 0);
if (\$lastNode === null || \$offsetIdx > \$lastIdx)
-
return;
if (\$con === null)
@@ -1008,7 +1000,7 @@ protected function addInsertNewChildNode(&$script)
* @param $nodeClassname \$node Node to insert.
* @param int \$childIdx One-based child index to insert at.
* @param PropelPDO \$con Connection to use.
- * @return void
+ * @return void
*/
protected function insertNewChildNode(\$node, \$childIdx, PropelPDO \$con)
{
View
27 generator/lib/builder/om/PHP5ObjectBuilder.php
@@ -129,7 +129,7 @@ protected function getTemporalFormatter(Column $col)
/**
* Returns the type-casted and stringified default value for the specified Column.
* This only works for scalar default values currently.
- * @return string The default value or 'null' if there is none.
+ * @return string The default value or 'null' if there is none.
* @throws EngineException
*/
protected function getDefaultValueString(Column $col)
@@ -1221,6 +1221,7 @@ protected function addDefaultAccessorBody(&$script, Column $col)
}
$script .= "
+
return \$this->$clo;";
}
@@ -2074,6 +2075,7 @@ protected function addHydrateBody(&$script)
$this->applyBehaviorModifier('postHydrate', $script, " ");
$script .= "
+
return \$startcol + $n; // $n = ".$this->getPeerClassname()."::NUM_HYDRATE_COLUMNS.
} catch (Exception \$e) {
@@ -3156,7 +3158,7 @@ protected function addFKMutator(&$script, ForeignKey $fk)
/**
* Declares an association between this object and a $className object.
*
- * @param $className \$v
+ * @param $className \$v
* @return ".$this->getObjectClassname()." The current object (for fluent API support)
* @throws PropelException
*/
@@ -3584,7 +3586,6 @@ public function resetPartial{$relCol}(\$v = true)
";
} // addRefFKPartial()
-
/**
* Adds the method that initializes the referrer fkey collection.
* @param string &$script The script will be modified in this method.
@@ -3642,7 +3643,7 @@ protected function addRefFKAdd(&$script, ForeignKey $refFK)
* Method called to associate a $className object to this object
* through the $className foreign key attribute.
*
- * @param $className \$l $className
+ * @param $className \$l $className
* @return ".$this->getObjectClassname()." The current object (for fluent API support)
*/
public function add".$this->getRefFKPhpNameAffix($refFK, $plural = false)."($className \$l)
@@ -3696,7 +3697,7 @@ public function count$relCol(Criteria \$criteria = null, \$distinct = false, Pro
return 0;
}
- if(\$partial && !\$criteria) {
+ if (\$partial && !\$criteria) {
return count(\$this->get$relCol());
}
\$query = $fkQueryClassname::create(null, \$criteria);
@@ -3762,7 +3763,7 @@ public function get$relCol(\$criteria = null, PropelPDO \$con = null)
if (false !== \$this->{$collName}Partial && count(\$$collName)) {
\$this->init".$this->getRefFKPhpNameAffix($refFK, $plural = true)."(false);
- foreach(\$$collName as \$obj) {
+ foreach (\$$collName as \$obj) {
if (false == \$this->{$collName}->contains(\$obj)) {
\$this->{$collName}->append(\$obj);
}
@@ -3772,12 +3773,13 @@ public function get$relCol(\$criteria = null, PropelPDO \$con = null)
}
\$$collName"."->getInternalIterator()->rewind();
+
return \$$collName;
}
- if(\$partial && \$this->$collName) {
- foreach(\$this->$collName as \$obj) {
- if(\$obj->isNew()) {
+ if (\$partial && \$this->$collName) {
+ foreach (\$this->$collName as \$obj) {
+ if (\$obj->isNew()) {
\${$collName}[] = \$obj;
}
}
@@ -3826,7 +3828,7 @@ public function set{$relatedName}(PropelCollection \${$inputCollection}, PropelP
";
- if ($refFK->isAtLeastOneLocalPrimaryKey()){
+ if ($refFK->isAtLeastOneLocalPrimaryKey()) {
$script .= "
//since at least one column in the foreign key is at the same time a PK
//we can not just set a PK to NULL in the lines below. We have to store
@@ -3995,7 +3997,7 @@ protected function addPKRefFKSet(&$script, ForeignKey $refFK)
/**
* Sets a single $className object as related to this object by a one-to-one relationship.
*
- * @param $className \$v $className
+ * @param $className \$v $className
* @return ".$this->getObjectClassname()." The current object (for fluent API support)
* @throws PropelException
*/
@@ -4107,7 +4109,6 @@ protected function addRefFkScheduledForDeletion(&$script, ForeignKey $refFK)
if (\$this->{$lowerRelatedName}ScheduledForDeletion !== null) {
if (!\$this->{$lowerRelatedName}ScheduledForDeletion->isEmpty()) {";
-
if ($refFK->getOnDelete() == ForeignKey::CASCADE) {
$script .= "
//the foreign key is flagged as `CASCADE`, so we delete the items
@@ -4366,7 +4367,7 @@ protected function addCrossFKAdd(&$script, ForeignKey $refFK, ForeignKey $crossF
* Associate a " . $crossObjectClassName . " object to this object
* through the " . $tblFK->getName() . " cross reference table.
*
- * @param " . $crossObjectClassName . " " . $crossObjectName . " The $className object to relate
+ * @param " . $crossObjectClassName . " " . $crossObjectName . " The $className object to relate
* @return ".$this->getObjectClassname()." The current object (for fluent API support)
*/
public function add{$relatedObjectClassName}($crossObjectClassName $crossObjectName)
View
6 generator/lib/builder/om/PHP5ObjectNoCollectionBuilder.php
@@ -608,8 +608,7 @@ public function get".$relCol."Join".$relCol2."(\$criteria = null, \$con = null,
$script .= "
if (\$criteria === null) {
\$criteria = new Criteria($peerClassname::DATABASE_NAME);
- } elseif (\$criteria instanceof Criteria)
- {
+ } elseif (\$criteria instanceof Criteria) {
\$criteria = clone \$criteria;
}
@@ -864,8 +863,7 @@ public function get$relCol(\$criteria = null, PropelPDO \$con = null)
$script .= "
if (\$criteria === null) {
\$criteria = new Criteria($peerClassname::DATABASE_NAME);
- } elseif (\$criteria instanceof Criteria)
- {
+ } elseif (\$criteria instanceof Criteria) {
\$criteria = clone \$criteria;
}
View
19 generator/lib/builder/om/PHP5PeerBuilder.php
@@ -520,7 +520,7 @@ protected function addGetSqlValueForEnum(&$script)
* @param string \$colname ENUM column name.
* @param string \$enumVal ENUM value.
*
- * @return int SQL value
+ * @return int SQL value
*/
public static function getSqlValueForEnum(\$colname, \$enumVal)
{
@@ -528,6 +528,7 @@ public static function getSqlValueForEnum(\$colname, \$enumVal)
if (!in_array(\$enumVal, \$values)) {
throw new PropelException(sprintf('Value \"%s\" is not accepted in this enumerated column', \$colname));
}
+
return array_search(\$enumVal, \$values);
}
";
@@ -547,7 +548,7 @@ protected function addEnumMethods(&$script)
* Gets the SQL value for ".$col->getPhpName()." ENUM value
*
* @param string \$enumVal ENUM value to get SQL value for
- * @return int SQL value
+ * @return int SQL value
*/
public static function get{$col->getPhpName()}SqlValue(\$enumVal)
{
@@ -992,10 +993,8 @@ protected function addClearInstancePool(&$script)
*/
public static function clearInstancePool(\$and_clear_all_references = false)
{
- if (\$and_clear_all_references)
- {
- foreach (".$this->getPeerClassname()."::\$instances as \$instance)
- {
+ if (\$and_clear_all_references) {
+ foreach (".$this->getPeerClassname()."::\$instances as \$instance) {
\$instance->clearAllReferences(true);
}
}
@@ -2002,7 +2001,7 @@ protected function addRetrieveByPKs_SinglePK(&$script)
*
* @param array \$pks List of primary keys
* @param PropelPDO \$con the connection to use
- * @return " .$this->getObjectClassname(). "[]
+ * @return " .$this->getObjectClassname(). "[]
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
@@ -2181,7 +2180,7 @@ public function addCriteriaJoin($fk, $table, $joinTable, $joinedTablePeerBuilder
$script .= "
\$criteria->addMultipleJoin(array(
";
- foreach ($lftCols as $columnName ) {
+ foreach ($lftCols as $columnName) {
$script .= sprintf(" array(%s, %s),
",
$this->getColumnConstant($table->getColumn($columnName) ),
@@ -2684,7 +2683,7 @@ protected function addDoSelectJoinAllExcept(&$script)
$fkeys = $table->getForeignKeys(); // this sep assignment is necessary otherwise sub-loops over
// getForeignKeys() will cause this to only execute one time.
- foreach ($fkeys as $fk ) {
+ foreach ($fkeys as $fk) {
$tblFK = $table->getDatabase()->getTable($fk->getForeignTableName());
@@ -2873,7 +2872,7 @@ protected function addDoCountJoinAllExcept(&$script)
$fkeys = $table->getForeignKeys(); // this sep assignment is necessary otherwise sub-loops over
// getForeignKeys() will cause this to only execute one time.
- foreach ($fkeys as $fk ) {
+ foreach ($fkeys as $fk) {
$tblFK = $table->getDatabase()->getTable($fk->getForeignTableName());
View
4 generator/lib/builder/util/XmlToDataSQL.php
@@ -106,8 +106,8 @@ public function __construct(Database $database, GeneratorConfig $config, $encodi
/**
* Transform the data dump input file into SQL and writes it to the output stream.
*
- * @param PhingFile $xmlFile
- * @param Writer $out
+ * @param PhingFile $xmlFile
+ * @param Writer $out
* @throws BuildException
*/
public function transform(PhingFile $xmlFile, Writer $out)
View
2  generator/lib/model/AppData.php
@@ -109,7 +109,7 @@ public function getGeneratorConfig()
/**
* Set the name of the database.
*
- * @param $name of the database.
+ * @param $name of the database.
*/
public function setName($name)
{
View
4 generator/lib/model/Column.php
@@ -100,7 +100,7 @@ class Column extends XMLElement
/**
* Creates a new column and set the name
*
- * @param $name column name
+ * @param $name column name
*/
public function __construct($name = null)
{
@@ -110,7 +110,7 @@ public function __construct($name = null)
/**
* Return a comma delimited string listing the specified columns.
*
- * @param $columns Either a list of <code>Column</code> objects, or
+ * @param $columns Either a list of <code>Column</code> objects, or
* a list of <code>String</code> objects with column names.
* @deprecated Use the Platform::getColumnListDDL() method instead
*
View
6 generator/lib/model/Database.php
@@ -138,7 +138,7 @@ public function getBaseClass()
/**
* Set the value of baseClass.
- * @param $v Value to assign to baseClass.
+ * @param $v Value to assign to baseClass.
*/
public function setBaseClass($v)
{
@@ -156,7 +156,7 @@ public function getBasePeer()
/**
* Set the value of basePeer.
- * @param $v Value to assign to basePeer.
+ * @param $v Value to assign to basePeer.
*/
public function setBasePeer($v)
{
@@ -174,7 +174,7 @@ public function getDefaultIdMethod()
/**
* Set the value of defaultIdMethod.
- * @param $v Value to assign to defaultIdMethod.
+ * @param $v Value to assign to defaultIdMethod.
*/
public function setDefaultIdMethod($v)
{
View
4 generator/lib/model/ForeignKey.php
@@ -627,8 +627,8 @@ public function isAtLeastOneLocalPrimaryKey()
{
$localCols = $this->getLocalColumnObjects();
- foreach ($localCols as $localCol){
- if ($this->getTable()->getColumn($localCol->getName())->isPrimaryKey()){
+ foreach ($localCols as $localCol) {
+ if ($this->getTable()->getColumn($localCol->getName())->isPrimaryKey()) {
return true;
}
}
View
10 generator/lib/model/Inheritance.php
@@ -50,7 +50,7 @@ public function getKey()
/**
* Set the value of key.
- * @param $v Value to assign to key.
+ * @param $v Value to assign to key.
*/
public function setKey($v)
{
@@ -68,7 +68,7 @@ public function getColumn()
/**
* Set the value of parent.
- * @param $v Value to assign to parent.
+ * @param $v Value to assign to parent.
*/
public function setColumn(Column $v)
{
@@ -86,7 +86,7 @@ public function getClassName()
/**
* Set the value of className.
- * @param $v Value to assign to className.
+ * @param $v Value to assign to className.
*/
public function setClassName($v)
{
@@ -104,7 +104,7 @@ public function getPackage()
/**
* Set the value of package.
- * @param $v Value to assign to package.
+ * @param $v Value to assign to package.
*/
public function setPackage($v)
{
@@ -122,7 +122,7 @@ public function getAncestor()
/**
* Set the value of ancestor.
- * @param $v Value to assign to ancestor.
+ * @param $v Value to assign to ancestor.
*/
public function setAncestor($v)
{
View
2  generator/lib/model/NameFactory.php
@@ -48,7 +48,7 @@ class NameFactory
/**
* Factory method which retrieves an instance of the named generator.
*
- * @param $name The fully qualified class name of the name
+ * @param $name The fully qualified class name of the name
* generation algorithm to retrieve.
*/
protected static function getAlgorithm($name)
View
2  generator/lib/model/PhpNameGenerator.php
@@ -38,7 +38,7 @@ class PhpNameGenerator implements NameGenerator
* works the same as the <code>CONV_METHOD_PHPNAME</code> method
* but will not lowercase any characters.
*
- * @param $inputs list expected to contain two (optional: three) parameters,
+ * @param $inputs list expected to contain two (optional: three) parameters,
* element 0 contains name to convert, element 1 contains method for conversion,
* optional element 2 contains prefix to be striped from name
* @return The generated name.
View
6 generator/lib/model/ScopedElement.php
@@ -75,7 +75,7 @@ public function getNamespace()
/**
* Set the value of the namespace.
- * @param $v Value to assign to namespace.
+ * @param $v Value to assign to namespace.
*/
public function setNamespace($v)
{
@@ -100,7 +100,7 @@ public function getPackage()
/**
* Set the value of package.
- * @param $v Value to assign to package.
+ * @param $v Value to assign to package.
*/
public function setPackage($v)
{
@@ -122,7 +122,7 @@ public function getSchema()
/**
* Set the value of schema.
- * @param $v Value to assign to schema.
+ * @param $v Value to assign to schema.
*/
public function setSchema($v)
{
View
6 generator/lib/model/Table.php
@@ -1051,6 +1051,7 @@ public function removeIndex($name)
foreach ($this->indices as $n => $idx) {
if ($idx->getName() == $name) {
unset($this->indices[$n]);
+
return;
}
}
@@ -1060,16 +1061,17 @@ public function removeIndex($name)
/**
* check if the table has a index by name
*
- * @param string $name
+ * @param string $name
* @return bool
*/
public function hasIndex($name)
{
foreach ($this->indices as $idx) {
- if ($idx->getName() == $name){
+ if ($idx->getName() == $name) {
return true;
}
}
+
return false;
}
View
10 generator/lib/platform/MysqlPlatform.php
@@ -125,6 +125,7 @@ public function supportsForeignKeys(Table $table)
} else {
$mysqlTableType = $this->getDefaultTableEngine();
}
+
return strtolower($mysqlTableType) == 'innodb';
}
@@ -172,9 +173,9 @@ public function getPrimaryKeyDDL(Table $table)
//if the primary key consists of multiple columns and if the first is not the autoIncrement one. So
//this push the autoIncrement column to the first position if its not already.
$autoIncrement = $table->getAutoIncrementPrimaryKey();
- if ($autoIncrement && $keys[0] != $autoIncrement){
+ if ($autoIncrement && $keys[0] != $autoIncrement) {
$idx = array_search($autoIncrement, $keys);
- if ($idx !== false){
+ if ($idx !== false) {
unset($keys[$idx]);
array_unshift($keys, $autoIncrement);
}
@@ -480,16 +481,15 @@ public function getUniqueDDL(Unique $unique)
);
}
-
public function getAddForeignKeyDDL(ForeignKey $fk)
{
if ($this->supportsForeignKeys($fk->getTable())) {
return parent::getAddForeignKeyDDL($fk);
}
+
return '';
}
-
/**
* Builds the DDL SQL for a ForeignKey object.
* @return string
@@ -499,10 +499,10 @@ public function getForeignKeyDDL(ForeignKey $fk)
if ($this->supportsForeignKeys($fk->getTable())) {
return parent::getForeignKeyDDL($fk);
}
+
return '';
}
-
public function getDropForeignKeyDDL(ForeignKey $fk)
{
if (!$this->supportsForeignKeys($fk->getTable()) || $fk->isSkipSql()) {
View
4 generator/lib/task/AbstractPropelDataModelTask.php
@@ -190,7 +190,7 @@ public function getTargetDatabase()
/**
* Set the current target database. (e.g. mysql, oracle, ..)
*
- * @param $v target database(s)
+ * @param $v target database(s)
*/
public function setTargetDatabase($v)
{
@@ -280,7 +280,7 @@ public function setOutputDirectory(PhingFile $outputDirectory)
/**
* Set the current target database encoding.
*
- * @param $v target database encoding
+ * @param $v target database encoding
*/
public function setDbEncoding($v)
{
View
2  generator/lib/task/PropelDataDumpTask.php
@@ -110,7 +110,7 @@ public function getDatabaseName()
/**
* Set the database name
*
- * @param $v The new DatabaseName value
+ * @param $v The new DatabaseName value
*/
public function setDatabaseName($v)
{
View
2  generator/lib/task/PropelSQLExec.php
@@ -69,7 +69,7 @@ class PropelSQLExec extends Task
/**
* Set the sqldbmap properties file.
*
- * @param $sqldbmap filename for the sqldbmap
+ * @param $sqldbmap filename for the sqldbmap
*/
public function setSqlDbMap($sqldbmap)
{
View
6 runtime/lib/adapter/DBMSSQL.php
@@ -202,14 +202,14 @@ public function applyLimit(&$sql, $offset, $limit)
//make sure the current column isn't * or an aggregate
if ($selColArr[0] != '*' && ! strstr($selColArr[0], '(')) {
-
+
// Aliases can be used in ORDER BY clauses on a SELECT,
// but aliases are not valid in the ORDER BY clause of ROW_NUMBER() OVER (...),
// so if we notice that part of $order is actually an alias,
// we replace it with the original Table.Column designation.
if ($selColCount) {
// column with alias
- foreach(array(' ASC',' DESC') as $sort) {
+ foreach (array(' ASC',' DESC') as $sort) {
$index = array_search($selColArr[2].$sort,$orders);
if ($index !== FALSE) {
// replace alias with "Table.Column ASC/DESC"
@@ -218,7 +218,7 @@ public function applyLimit(&$sql, $offset, $limit)
}
}
}
-
+
if (isset($orderArr[$selColArr[0]])) {
$orders[$orderArr[$selColArr[0]]['key']] = $selColArr[0] . ' ' . $orderArr[$selColArr[0]]['sort'];
}
View
4 runtime/lib/config/PropelConfiguration.php
@@ -122,8 +122,8 @@ public function getParameter($name, $default = null)
* print_r($c['foo1']); => array('foo2' => 'bar')
* </code>
*
- * @param string $name Configuration item name (name.space.name)
- * @param mixed $value Value to be stored
+ * @param string $name Configuration item name (name.space.name)
+ * @param mixed $value Value to be stored
* @param Boolean $autoFlattenArrays
*/
public function setParameter($name, $value, $autoFlattenArrays = true)
View
4 runtime/lib/om/NodeObject.php
@@ -103,8 +103,8 @@ public function setLevel($level);
/**
* Sets the children array of the node in the tree
*
- * @param Node[] $children array of Propel node object
- * @return object The current object (for fluent API support)
+ * @param Node[] $children array of Propel node object
+ * @return object The current object (for fluent API support)
*/
public function setChildren(array $children);
View
26 runtime/lib/query/Criteria.php
@@ -484,7 +484,7 @@ public function hasWhereClause()
* postgresql. Though it can be used to require any single sql statement
* to use a transaction.
*
- * @param bool $v
+ * @param bool $v
* @return void
*/
public function setUseTransaction($v)
@@ -1181,7 +1181,7 @@ public function isSingleRecord()
/**
* Set limit.
*
- * @param int $limit An int with the value for limit.
+ * @param int $limit An int with the value for limit.
* @return Criteria Modified Criteria object (for fluent API)
*/
public function setLimit($limit)
@@ -1311,7 +1311,7 @@ public function getSelectModifiers()
/**
* Add group by column name.
*
- * @param string $groupBy The name of the column to group by.
+ * @param string $groupBy The name of the column to group by.
* @return Criteria Modified Criteria object (for fluent API)
*/
public function addGroupByColumn($groupBy)
@@ -1324,7 +1324,7 @@ public function addGroupByColumn($groupBy)
/**
* Add order by column name, explicitly specifying ascending.
*
- * @param string $name The name of the column to order by.
+ * @param string $name The name of the column to order by.
* @return Criteria Modified Criteria object (for fluent API)
*/
public function addAscendingOrderByColumn($name)
@@ -1464,7 +1464,7 @@ public function size()
* This method checks another Criteria to see if they contain
* the same attributes and hashtable entries.
*
- * @param Criteria|null $crit
+ * @param Criteria|null $crit
* @return boolean
*/
public function equals($crit)
@@ -1685,10 +1685,10 @@ protected function getCriterionForCondition($p1, $value = null, $comparison = nu
* - addAnd(column, value)
* - addAnd(Criterion)
*
- * @param mixed $p1 A Criterion, or a SQL clause with a question mark placeholder, or a column name
- * @param mixed $value The value to bind in the condition
- * @param mixed $comparison A Criteria class constant, or a PDO::PARAM_ class constant
- * @param bool $preferColumnCondition
+ * @param mixed $p1 A Criterion, or a SQL clause with a question mark placeholder, or a column name
+ * @param mixed $value The value to bind in the condition
+ * @param mixed $comparison A Criteria class constant, or a PDO::PARAM_ class constant
+ * @param bool $preferColumnCondition
*
* @return Criteria A modified Criteria object.
*/
@@ -1721,10 +1721,10 @@ public function addAnd($p1, $value = null, $comparison = null, $preferColumnCond
* - addOr(column, value)
* - addOr(Criterion)
*
- * @param mixed $p1 A Criterion, or a SQL clause with a question mark placeholder, or a column name
- * @param mixed $value The value to bind in the condition
- * @param mixed $comparison A Criteria class constant, or a PDO::PARAM_ class constant
- * @param bool $preferColumnCondition
+ * @param mixed $p1 A Criterion, or a SQL clause with a question mark placeholder, or a column name
+ * @param mixed $value The value to bind in the condition
+ * @param mixed $comparison A Criteria class constant, or a PDO::PARAM_ class constant
+ * @param bool $preferColumnCondition
*
* @return Criteria A modified Criteria object.
*/
View
6 runtime/lib/query/Criterion.php
@@ -125,7 +125,7 @@ public function getColumn()
/**
* Set the table name.
*
- * @param string $name A String with the table name.
+ * @param string $name A String with the table name.
* @return void
*/
public function setTable($name)
@@ -243,7 +243,7 @@ public function addAnd(Criterion $criterion)
/**
* Append an OR Criterion onto this Criterion's list.
*
- * @param Criterion $criterion
+ * @param Criterion $criterion
* @return Criterion
*/
public function addOr(Criterion $criterion)
@@ -462,7 +462,7 @@ protected function appendBasicToPs(&$sb, array &$params)
* This method checks another Criteria to see if they contain
* the same attributes and hashtable entries.
*
- * @param Criterion|null $obj
+ * @param Criterion|null $obj
* @return boolean
*/
public function equals($obj)
View
2  runtime/lib/query/Join.php
@@ -540,7 +540,7 @@ public function getClause(&$params)
}
/**
- * @param Join $join
+ * @param Join $join
* @return bool
*/
public function equals($join)
View
36 runtime/lib/query/ModelCriteria.php
@@ -269,7 +269,7 @@ public function filterByArray($conditions)
*
* @param mixed $clause A string representing the pseudo SQL clause, e.g. 'Book.AuthorId = ?'
* Or an array of condition names
- * @param mixed $value A value for the condition
+ * @param mixed $value A value for the condition
* @param string $bindingType
*
* @return ModelCriteria The current object, for fluid interface
@@ -303,8 +303,8 @@ public function where($clause, $value = null, $bindingType = null)
* @see Criteria::addOr()
* @deprecated Use _or()->where() instead
*
- * @param string $clause The pseudo SQL clause, e.g. 'AuthorId = ?'
- * @param mixed $value A value for the condition
+ * @param string $clause The pseudo SQL clause, e.g. 'AuthorId = ?'
+ * @param mixed $value A value for the condition
* @param string $bindingType
*
* @return ModelCriteria The current object, for fluid interface
@@ -332,7 +332,7 @@ public function orWhere($clause, $value = null, $bindingType = null)
*
* @param mixed $clause A string representing the pseudo SQL clause, e.g. 'Book.AuthorId = ?'
* Or an array of condition names
- * @param mixed $value A value for the condition
+ * @param mixed $value A value for the condition
* @param string $bindingType
*
* @return ModelCriteria The current object, for fluid interface
@@ -563,7 +563,7 @@ protected function configureSelectColumns()
// Add requested columns which are not withColumns
$columnNames = (array) $this->select;
-
+
// temporary store columns Alias or withColumn
$asColumns = $this->getAsColumns();
$this->asColumns = array();
@@ -578,9 +578,9 @@ protected function configureSelectColumns()
unset($asColumns[$columnName]);
}
}
-
+
// re-add all remaining columns which were not contained in select-columnNames
- foreach($asColumns as $columnName => $columnAlias) {
+ foreach ($asColumns as $columnName => $columnAlias) {
$this->addAsColumn($columnName, $columnAlias);
}
}
@@ -700,10 +700,10 @@ public function join($relation, $joinType = Criteria::INNER_JOIN)
* $query->addJoinCondition('Author', 'Book.Title LIKE ?', 'foo%');
* </code>
*
- * @param string $name The relation name or alias on which the join was created
- * @param string $clause SQL clause, may contain column and table phpNames
- * @param mixed $value An optional value to bind to the clause
- * @param string $operator The operator to use to add the condition. Defaults to 'AND'
+ * @param string $name The relation name or alias on which the join was created
+ * @param string $clause SQL clause, may contain column and table phpNames
+ * @param mixed $value An optional value to bind to the clause
+ * @param string $operator The operator to use to add the condition. Defaults to 'AND'
* @param string $bindingType
*
* @return ModelCriteria The current object, for fluid interface
@@ -763,7 +763,7 @@ public function setJoinCondition($name, $condition)
/**
* Add a join object to the Criteria
* @see Criteria::addJoinObject()
- * @param Join $join A join object
+ * @param Join $join A join object
* @param string $name
*
* @return ModelCriteria The current object, for fluid interface
@@ -924,7 +924,7 @@ public function withColumn($clause, $name = null)
* Initializes a secondary ModelCriteria object, to be later merged with the current object
*
* @see ModelCriteria::endUse()
- * @param string $relationName Relation name or alias
+ * @param string $relationName Relation name or alias
* @param string $secondaryCriteriaClass Classname for the ModelCriteria to be used
*
* @return ModelCriteria The secondary criteria object
@@ -1807,8 +1807,8 @@ protected function getCriterionForConditions($conditions, $operator = null)
* Creates a Criterion object based on a SQL clause and a value
* Uses introspection to translate the column phpName into a fully qualified name
*
- * @param string $clause The pseudo SQL clause, e.g. 'AuthorId = ?'
- * @param mixed $value A value for the condition
+ * @param string $clause The pseudo SQL clause, e.g. 'AuthorId = ?'
+ * @param mixed $value A value for the condition
* @param string $bindingType
*
* @return Criterion a Criterion or ModelCriterion object
@@ -1980,7 +1980,7 @@ protected function doReplaceNameInExpression($matches)
* => array($authorFirstNameColumnMap, 'a.FIRST_NAME')
* </code>
*
- * @param string $phpName String representing the column name in a pseudo SQL clause, e.g. 'Book.Title'
+ * @param string $phpName String representing the column name in a pseudo SQL clause, e.g. 'Book.Title'
* @param boolean $failSilently
*
* @return array List($columnMap, $realColumnName)
@@ -2043,8 +2043,8 @@ protected function getColumnFromName($phpName, $failSilently = true)
/**
* Special case for subquery columns
*
- * @param string $class
- * @param string $phpName
+ * @param string $class
+ * @param string $phpName
* @param boolean $failSilently
*
* @return array List($columnMap, $realColumnName)
View
4 runtime/lib/query/ModelJoin.php
@@ -70,7 +70,7 @@ public function getTableMap()
}
/**
- * @param ModelJoin $join
+ * @param ModelJoin $join
* @return ModelJoin
*/
public function setPreviousJoin(ModelJoin $join)
@@ -135,7 +135,7 @@ public function getObjectToRelate($startObject)
}
/**
- * @param ModelJoin $join
+ * @param ModelJoin $join
* @return bool
*/
public function equals($join)
View
2  runtime/lib/query/PropelQuery.php
@@ -18,7 +18,7 @@
class PropelQuery
{
/**
- * @param string $queryClassAndAlias
+ * @param string $queryClassAndAlias
* @return ModelCriteria
* @throws PropelException
*/
View
2  test/fixtures/namespaced/schema.xml
@@ -84,7 +84,7 @@
<reference local="supervisor_id" foreign="id" />
</foreign-key>
</table>
-
+
<table name="ns_concrete_content" phpName="NamespacedConcreteContent" namespace="Foo\Bar">
<column name="id" required="true" primaryKey="true" type="INTEGER" />
<column name="title" type="VARCHAR" size="100" primaryString="true" />
View
10 test/testsuite/generator/behavior/AlternativeCodingStandardsBehaviorTest.php
@@ -29,17 +29,13 @@ public function convertBracketsNewlineDataProvider()
{
}"),
array("if (true) {
-}", "if (true)
-{
+}", "if (true) {
}"),
array("} else {
-}", "}
-else
-{
+}", "} else {
}"),
array("foreach (\$i as \$j) {
-}", "foreach (\$i as \$j)
-{
+}", "foreach (\$i as \$j) {
}"),
);
}
View
13 ...uite/generator/behavior/nestedset/NestedSetBehaviorObjectBuilderModifierWithScopeTest.php
@@ -565,7 +565,6 @@ public function testMoveToFirstChildOf()
$this->assertEquals($expected, $this->dumpTreeWithScope(2), 't10 removed from scope 2, therefore t8 `right` has been changed');
$this->assertEquals(15, $t3->getRightValue(), 't3 has shifted by one item, so from 13 to 15');
-
//move t7 into t9, from scope 1 to scope 2
$t7->moveToFirstChildOf($t9);
@@ -574,7 +573,6 @@ public function testMoveToFirstChildOf()
$this->assertEquals(6, $t8->getRightValue(), 't8 extended by 1 item, 4+2 => 6');
$this->assertEquals(2, $t7->getLevel(), 'New level is 2');
-
//dispose scope 2
$oldt4Left = $t4->getLeftValue();
@@ -628,7 +626,6 @@ public function testMoveToLastChildOf()
$this->assertEquals($expected, $this->dumpTreeWithScope(2), 't10 removed from scope 2, therefore t8 `right` has been changed');
$this->assertEquals(15, $t3->getRightValue(), 't3 has shifted by one item, so from 13 to 15');
-
//move t7 into t9, from scope 1 to scope 2
$t7->moveToLastChildOf($t9);
@@ -637,7 +634,6 @@ public function testMoveToLastChildOf()
$this->assertEquals(6, $t8->getRightValue(), 't8 extended by 1 item, 4+2 => 6');
$this->assertEquals(2, $t7->getLevel(), 'New level is 2');
-
//dispose scope 2
$t8->moveToLastChildOf($t3);
@@ -678,13 +674,11 @@ public function testMoveToPrevSiblingOf()
$this->assertEquals(5, $t2->getRightValue(), 'Move by one item, +2');
$this->assertEquals(1, $t10->getLevel(), 'Level is 1 as old');
-
$this->assertEquals(2, $t10->getLeftValue(), 'Moved before t2');
$this->assertEquals(3, $t10->getRightValue(), 'Moved before t2');
$this->assertEquals($t2->getScopeValue(), $t10->getScopeValue(), 'Should have now the same scope');
-
$expected = array(
't8' => array(1, 4, 0),
't9' => array(2, 3, 1)
@@ -692,7 +686,6 @@ public function testMoveToPrevSiblingOf()
$this->assertEquals($expected, $this->dumpTreeWithScope(2), 't10 removed from scope 2, therefore t8 `right` has been changed');
$this->assertEquals(15, $t3->getRightValue(), 't3 has shifted by one item, so from 13 to 15');
-
//move t7 before t9, from scope 1 to scope 2
$t7->moveToPrevSiblingOf($t9);
@@ -732,7 +725,6 @@ public function testMoveToNextSiblingOf()
t9 t10
*/
-
$this->assertEquals(13, $t3->getRightValue(), 't3 left has 13 per init');
$this->assertEquals(2, $t2->getLeftValue(), 'Init');
$this->assertEquals(3, $t2->getRightValue(), 'Init');
@@ -751,7 +743,6 @@ public function testMoveToNextSiblingOf()
$this->assertEquals($t2->getScopeValue(), $t10->getScopeValue(), 'Should have now the same scope');
-
$expected = array(
't8' => array(1, 4, 0),
't9' => array(2, 3, 1)
@@ -759,7 +750,6 @@ public function testMoveToNextSiblingOf()
$this->assertEquals($expected, $this->dumpTreeWithScope(2), 't10 removed from scope 2, therefore t8 `right` has been changed');
$this->assertEquals(15, $t3->getRightValue(), 't3 has shifted by one item, so from 13 to 15');
-
//move t7 after t9, from scope 1 to scope 2
$t7->moveToNextSiblingOf($t9);
@@ -770,7 +760,6 @@ public function testMoveToNextSiblingOf()
$this->assertEquals($t9->getRightValue()+1, $t7->getLeftValue(), 'Moved after t9, so we have t9.right+1 as left');
-
//dispose scope 2
$oldT1Right = $t1->getRightValue();
$t8->moveToNextSiblingOf($t3);
@@ -816,4 +805,4 @@ public function testDeleteDescendants()
);
$this->assertEquals($expected, $this->dumpTreeWithScope(2), 'deleteDescendants() does not delete anything out of the scope');
}
-}
+}
View
18 test/testsuite/generator/builder/om/GeneratedObjectMoreRelationTest.php
@@ -76,12 +76,12 @@ public function setUp()
\MoreRelationTest\CommentPeer::doDeleteAll();
\MoreRelationTest\PagePeer::doDeleteAll();
- for($i=1;$i<=2;$i++){
+ for ($i=1;$i<=2;$i++) {
$page = new \MoreRelationTest\Page();
$page->setTitle('Page '.$i);
- for($j=1;$j<=3;$j++){
+ for ($j=1;$j<=3;$j++) {
$content = new \MoreRelationTest\Content();
$content->setTitle('Content '.$j);
@@ -109,8 +109,8 @@ public function setUp()
* Composite PK deletion of a 1-to-n relation through set<RelationName>() and remove<RelationName>()
* where the PK is at the same time a FK.
*/
- public function testCommentsDeletion(){
-
+ public function testCommentsDeletion()
+ {
$commentCollection = new PropelObjectCollection();
$commentCollection->setModel('MoreRelationTest\\Comment');
@@ -150,8 +150,8 @@ public function testCommentsDeletion(){
* Deletion of a 1-to-n relation through set<RelationName>()
* with onDelete=setnull
*/
- public function testContentCommentDeletion(){
-
+ public function testContentCommentDeletion()
+ {
$commentCollection = new PropelObjectCollection();
$commentCollection->setModel('MoreRelationTest\\ContentComment');
@@ -186,8 +186,8 @@ public function testContentCommentDeletion(){
* Basic deletion of a 1-to-n relation through set<RelationName>().
*
*/
- public function testContentsDeletion(){
-
+ public function testContentsDeletion()
+ {
$contentCollection = new PropelObjectCollection();
$contentCollection->setModel('MoreRelationTest\\Content');
@@ -212,4 +212,4 @@ public function testContentsDeletion(){
}
-}
+}
View
10 test/testsuite/generator/builder/om/GeneratedObjectTest.php
@@ -740,15 +740,13 @@ public function testReplace_RelationWithCompositePK()
$this->assertEquals(1, count($op2->getBook()), 'BookOpinion2 has a relation to the Book');
$this->assertEquals(1, count($br1->getBookOpinions()), 'BookReader1 has 1 BookOpinion (BookOpinion1)');
$this->assertEquals(1, count($br2->getBookOpinions()), 'BookReader2 has 1 BookOpinion (BookOpinion2)');
-
+
$this->assertFalse($op1->isDeleted(), 'BookOpinion1 think it has not been deleted');
$caughtException = false;
- try
- {
+ try {
$op1->reload(false); // will fail because won't find the entry in the db
- } catch (PropelException $pe)
- {
+ } catch (PropelException $pe) {
$caughtException = true;
}
@@ -818,7 +816,7 @@ public function testRemove_CompositePK()
$this->assertEquals(1, BookQuery::create()->count(), '1 Book');
$this->assertEquals(0, BookOpinionQuery::create()->count(), '0 BookOpinion');
}
-
+
/**
*
*/
View
1  test/testsuite/generator/platform/MysqlPlatformMigrationMyISAMTest.php
@@ -37,6 +37,7 @@ protected function getPlatform()
));
$platform->setGeneratorConfig($config);
}
+
return $platform;
}
View
1  test/testsuite/generator/platform/MysqlPlatformMigrationTest.php
@@ -37,6 +37,7 @@ protected function getPlatform()
));
$platform->setGeneratorConfig($config);
}
+
return $platform;
}
View
1  test/testsuite/generator/platform/MysqlPlatformMyISAMTest.php
@@ -37,6 +37,7 @@ protected function getPlatform()
));
$platform->setGeneratorConfig($config);
}
+
return $platform;
}
View
1  test/testsuite/generator/platform/MysqlPlatformTest.php
@@ -37,6 +37,7 @@ protected function getPlatform()
));
$platform->setGeneratorConfig($config);
}
+
return $platform;
}
View
1  test/testsuite/generator/reverse/mysql/MysqlSchemaParserTest.php
@@ -76,7 +76,6 @@ public function testDecimal()
$table = $database->getTable('foo');
$c1 = $table->getColumn('longitude');
-
$parser = new MysqlSchemaParser(Propel::getConnection('reverse-bookstore'));
$parser->setGeneratorConfig(new QuickGeneratorConfig());
View
13 test/testsuite/misc/Issue617Test.php
@@ -42,8 +42,8 @@ public function removeTables()
/**
* Setups the initial schema.
*/
- private function setupInitSchema(){
-
+ private function setupInitSchema()
+ {
/*
* Create issue617 tables with foreign keys
*/
@@ -124,8 +124,8 @@ private function setupInitSchema(){
* Drop the foreign key in the `_user` table and check whether it generates
* the correct `DROP` SQL.
*/
- private function dropForeignKey(){
-
+ private function dropForeignKey()
+ {
/*
* Create issue617 tables without foreign keys
*/
@@ -186,9 +186,8 @@ private function dropForeignKey(){
/*
* Checks if FKs are really deleted.
*/
- private function checkDeletedFk(){
-
-
+ private function checkDeletedFk()
+ {
$this->readDatabase();
$diff = PropelDatabaseComparator::computeDiff($this->database, $this->updatedBuilder->getDatabase());
$sql = $this->database->getPlatform()->getModifyDatabaseDDL($diff);
View
6 test/testsuite/runtime/adapter/DBAdapterTestAbstract.php
@@ -16,8 +16,8 @@
* @package runtime.adapter
*/
-abstract class DBAdapterTestAbstract extends BookstoreTestBase {
-
+abstract class DBAdapterTestAbstract extends BookstoreTestBase
+{
abstract public function testQuotingIdentifiers();
-}
+}
View
5 test/testsuite/runtime/adapter/DBMSSQLTest.php
@@ -19,7 +19,7 @@
*/
class DBMSSQLTest extends DBAdapterTestAbstract
{
- 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';
@@ -27,7 +27,8 @@ function testSelectJoinOrderAlias ()
$this->assertEquals('SELECT [Field], [RelatedField] FROM (SELECT ROW_NUMBER() OVER(ORDER BY Related.Field ASC) AS [RowNumber], Field AS [Field], Related.Field AS [RelatedField] FROM Record LEFT JOIN Related ON Record.RelatedID = Related.ID) AS derivedb WHERE RowNumber BETWEEN 11 AND 15', $sql);
}
- public function testQuotingIdentifiers() {
+ public function testQuotingIdentifiers()
+ {
$db = new DBMSSQL();
$this->assertEquals('[Book ISBN]', $db->quoteIdentifier('Book ISBN'));
}
View
3  test/testsuite/runtime/adapter/DBMySQLTest.php
@@ -99,7 +99,8 @@ protected function getPdoMock()
return $con;
}
- public function testQuotingIdentifiers() {
+ public function testQuotingIdentifiers()
+ {
$db = new DBMySQL();
$this->assertEquals('`Book ISBN`', $db->quoteIdentifier('Book ISBN'));
}
View
3  test/testsuite/runtime/adapter/DBOracleTest.php
@@ -82,7 +82,8 @@ public function testGetExplainPlanQuery()
$this->assertEquals('EXPLAIN PLAN SET STATEMENT_ID = \'iuyiuyiu\' FOR SELECT B.* FROM (SELECT A.*, rownum AS '.$db->quoteIdentifier('PROPEL_ROWNUM').' FROM (SELECT book.id AS '.$db->quoteIdentifier('ORA_COL_ALIAS_0').', book.title AS '.$db->quoteIdentifier('ORA_COL_ALIAS_1').', book.isbn AS '.$db->quoteIdentifier('ORA_COL_ALIAS_2').', book.price AS '.$db->quoteIdentifier('ORA_COL_ALIAS_3').', book.publisher_id AS '.$db->quoteIdentifier('ORA_COL_ALIAS_4').', book.author_id AS '.$db->quoteIdentifier('ORA_COL_ALIAS_5').', author.id AS '.$db->quoteIdentifier('ORA_COL_ALIAS_6').', author.first_name AS '.$db->quoteIdentifier('ORA_COL_ALIAS_7').', author.last_name AS '.$db->quoteIdentifier('ORA_COL_ALIAS_8').', author.email AS '.$db->quoteIdentifier('ORA_COL_ALIAS_9').', author.age AS '.$db->quoteIdentifier('ORA_COL_ALIAS_10').', book.price AS '.$db->quoteIdentifier('BOOK_PRICE').' FROM book, author) A ) B WHERE B.PROPEL_ROWNUM <= 1', $explainQuery, 'getExplainPlanQuery() returns a SQL Explain query');
}
- public function testQuotingIdentifiers() {
+ public function testQuotingIdentifiers()
+ {
$db = new DBOracle();
$this->assertEquals('"Book ISBN"', $db->quoteIdentifier('Book ISBN'));
}
View
3  test/testsuite/runtime/adapter/DBPostgresTest.php
@@ -29,7 +29,8 @@ public function testGetExplainPlanQuery()
$this->assertEquals('EXPLAIN SELECT B.* FROM (SELECT A.*, rownum AS PROPEL_ROWNUM FROM (SELECT book.ID AS ORA_COL_ALIAS_0, book.TITLE AS ORA_COL_ALIAS_1, book.ISBN AS ORA_COL_ALIAS_2, book.PRICE AS ORA_COL_ALIAS_3, book.PUBLISHER_ID AS ORA_COL_ALIAS_4, book.AUTHOR_ID AS ORA_COL_ALIAS_5, author.ID AS ORA_COL_ALIAS_6, author.FIRST_NAME AS ORA_COL_ALIAS_7, author.LAST_NAME AS ORA_COL_ALIAS_8, author.EMAIL AS ORA_COL_ALIAS_9, author.AGE AS ORA_COL_ALIAS_10, book.PRICE AS BOOK_PRICE FROM book, author) A ) B WHERE B.PROPEL_ROWNUM <= 1', $db->getExplainPlanQuery($query), 'getExplainPlanQuery() returns a SQL Explain query');
}
- public function testQuotingIdentifiers() {
+ public function testQuotingIdentifiers()
+ {
$db = new DBPostgres();
$this->assertEquals('"Book ISBN"', $db->quoteIdentifier('Book ISBN'));
}
View
20 test/testsuite/runtime/collection/PropelCollectionTest.php
@@ -43,39 +43,39 @@ public function testCloneContainingScalar()
{
$data = array('bar1', 'bar2', 'bar3');
$col = new PropelCollection($data);
-
+
$clone = clone $col;
-
+
$orgCount = $col->getIterator()->count();
$cloneCount = $clone->getIterator()->count();
-
+
$this->assertEquals($orgCount, $cloneCount, 'all entries will be cloned');
}
-
+
public function testCloneContainingObjects()
{
$a = new Author();
$b= new Book();
$b->setAuthor($a);
$b->setISBN('ISBN1');
-
+
$b1 = new Book();
$b1->setPrice(5.55);
-
+
$col = new PropelCollection(array($b, $b1));
$clone = clone $col;
-
+
$orgCount = $col->getIterator()->count();
$cloneCount = $clone->getIterator()->count();
$this->assertEquals($orgCount, $cloneCount, 'cloned collections have the same size');
-
+
$this->assertEquals($b, $clone[0], 'cloned objects are equal');
$this->assertEquals($b1, $clone[1], 'cloned objects are equal');
-
+
$this->assertNotSame($b, $clone[0], 'cloned objects are copies, not identical');
$this->assertNotSame($b1, $clone[1], 'cloned objects are copies, not identical');
}
-
+
public function testSetData()
{
$col = new PropelCollection();
View
2  test/testsuite/runtime/collection/PropelOnDemandCollectionTest.php
@@ -46,7 +46,7 @@ public function testClone()
{
$clone = clone $this->books;
}
-
+
public function testKeys()
{
$i = 0;
View
3  test/testsuite/runtime/query/CriteriaTest.php
@@ -932,7 +932,8 @@ public function testAliasInCriterion()
$this->assertEquals("column_alias", $crit->getColumn());
}
- public function testQuotingAlias() {
+ public function testQuotingAlias()
+ {
$db = Propel::getDB();
$c = new Criteria();
$c->addSelectColumn(BookPeer::TITLE);
View
3  test/testsuite/runtime/query/JoinTest.php
@@ -165,7 +165,8 @@ public function testCompositeeConstructor()
$this->assertEquals('LEFT JOIN', $j->getJoinType());
}
- public function testEquality() {
+ public function testEquality()
+ {
$j1 = new Join('foo', 'bar', 'INNER JOIN');
$j2 = new Join('foo', 'bar', 'INNER JOIN');
View
3  test/testsuite/runtime/query/ModelCriteriaSelectTest.php
@@ -455,7 +455,8 @@ public function testGetSelectReturnsArrayWhenSelectingAllColumns()
$this->assertEquals(array('Book.Id', 'Book.Title', 'Book.ISBN', 'Book.Price', 'Book.PublisherId', 'Book.AuthorId'), $c->getSelect());
}
- public function testQuotingAliases() {
+ public function testQuotingAliases()
+ {
$c = new ModelCriteria('bookstore', 'Book');
$c->withColumn('book.title', 'Book Title (*.)');
$c->select('Book Title (*.)');
View
11 test/testsuite/runtime/query/ModelCriteriaTest.php
@@ -905,7 +905,8 @@ public function testJoinAliasQuery()
$this->assertEquals($expectedSQL, $con->getLastExecutedQuery(), 'join() allows the use of relation alias in further joins()');
}
- public function testJoinDuplicate() {
+ public function testJoinDuplicate()
+ {
$c = new ModelCriteria('bookstore', 'Author');
$c->addJoinObject(new Join('tbl.COL1', 'tbl.COL2', 'LEFT JOIN'));
$c->addJoinObject(new Join('tbl.COL1', 'tbl.COL2', 'LEFT JOIN'));
@@ -1348,16 +1349,16 @@ public function testWithColumnAndSelect()
$c->withColumn('COUNT(Book.Id)', 'NbBooks');
$c->select(array('FirstName', 'LastName'));
$collection = $c->find();
-
+
$this->assertThat($collection, $this->isInstanceOf('PropelCollection'));
-
- foreach($collection as $array) {
+
+ foreach ($collection as $array) {
$this->assertArrayHasKey('FirstName', $array);
$this->assertArrayHasKey('LastName', $array);
$this->assertArrayHasKey('NbBooks', $array);
}
}
-
+
public function testWithColumnAndSelectColumns()
{
$c = new ModelCriteria('bookstore', 'Book');
View
2  test/tools/helpers/PlatformDatabaseBuildTimeBase.php
@@ -64,7 +64,7 @@ protected function tearDown()
* Detects the differences between current connected database and $pDatabase
* and updates the schema. This does not DROP tables.
*
- * @param Database $pDatabase
+ * @param Database $pDatabase
*/
public function updateSchema($pDatabase)
{
Please sign in to comment.
Something went wrong with that request. Please try again.