diff --git a/.gitignore b/.gitignore index cdb0ed746..a7bdbdf54 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ test/fixtures/treetest/build/ vendor/ composer.lock composer.phar +.idea diff --git a/generator/lib/behavior/concrete_inheritance/ConcreteInheritanceBehavior.php b/generator/lib/behavior/concrete_inheritance/ConcreteInheritanceBehavior.php index f220f243b..535c95c73 100644 --- a/generator/lib/behavior/concrete_inheritance/ConcreteInheritanceBehavior.php +++ b/generator/lib/behavior/concrete_inheritance/ConcreteInheritanceBehavior.php @@ -31,6 +31,8 @@ class ConcreteInheritanceBehavior extends Behavior 'schema' => '' ); + protected $builder; + public function modifyTable() { $table = $this->getTable(); diff --git a/generator/lib/behavior/concrete_inheritance/ConcreteInheritanceParentBehavior.php b/generator/lib/behavior/concrete_inheritance/ConcreteInheritanceParentBehavior.php index ca23fb712..899791191 100644 --- a/generator/lib/behavior/concrete_inheritance/ConcreteInheritanceParentBehavior.php +++ b/generator/lib/behavior/concrete_inheritance/ConcreteInheritanceParentBehavior.php @@ -19,6 +19,8 @@ */ class ConcreteInheritanceParentBehavior extends Behavior { + protected $builder; + // default parameters value protected $parameters = array( 'descendant_column' => 'descendant_class' diff --git a/generator/lib/builder/om/PHP5PeerBuilder.php b/generator/lib/builder/om/PHP5PeerBuilder.php index bd0fe2b16..30f9abe57 100644 --- a/generator/lib/builder/om/PHP5PeerBuilder.php +++ b/generator/lib/builder/om/PHP5PeerBuilder.php @@ -1164,7 +1164,7 @@ public static function getPrimaryKeyFromRow(\$row, \$startcol = 0) if ($table->hasCompositePrimaryKey()) { $script .= " - return array(" . implode($pks, ', '). ");"; + return array(" . implode(', ', $pks). ");"; } else { $script .= " diff --git a/generator/lib/builder/om/QueryBuilder.php b/generator/lib/builder/om/QueryBuilder.php index 30c0c44cc..46cae0f98 100644 --- a/generator/lib/builder/om/QueryBuilder.php +++ b/generator/lib/builder/om/QueryBuilder.php @@ -395,10 +395,10 @@ protected function addFindPk(&$script) } $pkType = 'array'; $pkDescription = " - A Primary key composition: ".'['. join($colNames, ', ') . ']'; + A Primary key composition: ".'['. join(', ', $colNames) . ']'; $script .= " * - * \$obj = \$c->findPk(array(" . join($examplePk, ', ') . "), \$con);"; + * \$obj = \$c->findPk(array(" . join(', ', $examplePk) . "), \$con);"; } else { $pkType = 'mixed'; $script .= " diff --git a/generator/lib/builder/util/XmlToAppData.php b/generator/lib/builder/util/XmlToAppData.php index 1d71e3d22..ad64d073a 100644 --- a/generator/lib/builder/util/XmlToAppData.php +++ b/generator/lib/builder/util/XmlToAppData.php @@ -45,6 +45,7 @@ class XmlToAppData private $defaultPackage; private $encoding; + private $firstPass; /** two-dimensional array, first dimension is for schemas(key is the path to the schema file), diff --git a/generator/lib/config/GeneratorConfig.php b/generator/lib/config/GeneratorConfig.php index b3517dcb6..500c7cb47 100644 --- a/generator/lib/config/GeneratorConfig.php +++ b/generator/lib/config/GeneratorConfig.php @@ -115,7 +115,7 @@ public function getClassname($propname) // Basically, we want to turn ?.?.?.sqliteDataSQLBuilder into ?.?.?.SqliteDataSQLBuilder $lastdotpos = strrpos($classpath, '.'); if ($lastdotpos !== false) { - $classpath{$lastdotpos+1} = strtoupper($classpath{$lastdotpos+1}); + $classpath[$lastdotpos + 1] = strtoupper($classpath[$lastdotpos + 1]); } else { // Allows to configure full classname instead of a dot-path notation if (class_exists($classpath)) { diff --git a/generator/lib/config/QuickGeneratorConfig.php b/generator/lib/config/QuickGeneratorConfig.php index e1708114e..a8192280c 100644 --- a/generator/lib/config/QuickGeneratorConfig.php +++ b/generator/lib/config/QuickGeneratorConfig.php @@ -62,7 +62,7 @@ protected function parsePseudoIniFile($filepath) } foreach ($lines as $line) { $line = trim($line); - if ($line == "" || $line{0} == '#' || $line{0} == ';') continue; + if ($line == "" || $line[0] == '#' || $line[0] == ';') continue; $pos = strpos($line, '='); $property = trim(substr($line, 0, $pos)); $value = trim(substr($line, $pos + 1)); diff --git a/generator/lib/model/ForeignKey.php b/generator/lib/model/ForeignKey.php index b36be0d3c..f60b47b44 100644 --- a/generator/lib/model/ForeignKey.php +++ b/generator/lib/model/ForeignKey.php @@ -35,6 +35,8 @@ class ForeignKey extends XMLElement protected $localColumns = array(); protected $foreignColumns = array(); + public $isParentChild; + /** * Whether to skip generation of SQL for this foreign key. * diff --git a/generator/lib/model/XMLElement.php b/generator/lib/model/XMLElement.php index bc2e0f452..4e12cdf96 100644 --- a/generator/lib/model/XMLElement.php +++ b/generator/lib/model/XMLElement.php @@ -8,8 +8,6 @@ * @license MIT License */ -require_once dirname(__FILE__) . '/VendorInfo.php'; - /** * An abstract class for elements represented by XML tags (e.g. Column, Table). * diff --git a/runtime/lib/connection/PropelPDO.php b/runtime/lib/connection/PropelPDO.php index 1a30d3b4c..c79fa8b68 100644 --- a/runtime/lib/connection/PropelPDO.php +++ b/runtime/lib/connection/PropelPDO.php @@ -227,7 +227,7 @@ public function isCommitable() * * @return boolean */ - public function beginTransaction() + public function beginTransaction(): bool { $return = true; if (!$this->nestedTransactionCount) { @@ -250,7 +250,7 @@ public function beginTransaction() * * @throws PropelException */ - public function commit() + public function commit(): bool { $return = true; $opcount = $this->nestedTransactionCount; @@ -279,7 +279,7 @@ public function commit() * * @return boolean Whether operation was successful. */ - public function rollBack() + public function rollBack(): bool { $return = true; $opcount = $this->nestedTransactionCount; @@ -337,17 +337,19 @@ public function forceRollBack() * * @return void */ - public function setAttribute($attribute, $value) + public function setAttribute($attribute, $value): bool { switch ($attribute) { case self::PROPEL_ATTR_CACHE_PREPARES: $this->cachePreparedStatements = $value; + return true; break; case self::PROPEL_ATTR_CONNECTION_NAME: $this->connectionName = $value; + return true; break; default: - parent::setAttribute($attribute, $value); + return parent::setAttribute($attribute, $value); } } @@ -444,7 +446,7 @@ public function exec($sql) * * @return PDOStatement */ - public function query() + public function query($query, $fetchMode = PDO::ATTR_DEFAULT_FETCH_MODE, $arg3 = null, $ctorargs = []) { if ($this->useDebug) { $debug = $this->getDebugSnapshot(); diff --git a/runtime/lib/util/BasePeer.php b/runtime/lib/util/BasePeer.php index 77dc6d66a..d1374da59 100644 --- a/runtime/lib/util/BasePeer.php +++ b/runtime/lib/util/BasePeer.php @@ -394,10 +394,10 @@ public static function doUpdate(Criteria $selectCriteria, Criteria $updateValues $rawcvt = ''; // parse the $params['raw'] for ? chars for ($r=0,$len=strlen($raw); $r < $len; $r++) { - if ($raw{$r} == '?') { + if ($raw[$r] == '?') { $rawcvt .= ':p'.$p++; } else { - $rawcvt .= $raw{$r}; + $rawcvt .= $raw[$r]; } } $sql .= $rawcvt . ', ';