Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[do not merge] Symfony 5 compatibility #18

Open
wants to merge 5 commits into
base: feature/CKLS-13333
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ test/fixtures/treetest/build/
vendor/
composer.lock
composer.phar
.idea
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ class ConcreteInheritanceBehavior extends Behavior
'schema' => ''
);

protected $builder;

public function modifyTable()
{
$table = $this->getTable();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
*/
class ConcreteInheritanceParentBehavior extends Behavior
{
protected $builder;

// default parameters value
protected $parameters = array(
'descendant_column' => 'descendant_class'
Expand Down
2 changes: 1 addition & 1 deletion generator/lib/builder/om/PHP5PeerBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 .= "

Expand Down
4 changes: 2 additions & 2 deletions generator/lib/builder/om/QueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -395,10 +395,10 @@ protected function addFindPk(&$script)
}
$pkType = 'array';
$pkDescription = "
A Primary key composition: ".'['. join($colNames, ', ') . ']';
A Primary key composition: ".'['. join(', ', $colNames) . ']';
$script .= "
* <code>
* \$obj = \$c->findPk(array(" . join($examplePk, ', ') . "), \$con);";
* \$obj = \$c->findPk(array(" . join(', ', $examplePk) . "), \$con);";
} else {
$pkType = 'mixed';
$script .= "
Expand Down
1 change: 1 addition & 0 deletions generator/lib/builder/util/XmlToAppData.php
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion generator/lib/config/GeneratorConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
2 changes: 1 addition & 1 deletion generator/lib/config/QuickGeneratorConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
2 changes: 2 additions & 0 deletions generator/lib/model/ForeignKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
2 changes: 0 additions & 2 deletions generator/lib/model/XMLElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -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).
*
Expand Down
14 changes: 8 additions & 6 deletions runtime/lib/connection/PropelPDO.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ public function isCommitable()
*
* @return boolean
*/
public function beginTransaction()
public function beginTransaction(): bool
{
$return = true;
if (!$this->nestedTransactionCount) {
Expand All @@ -250,7 +250,7 @@ public function beginTransaction()
*
* @throws PropelException
*/
public function commit()
public function commit(): bool
{
$return = true;
$opcount = $this->nestedTransactionCount;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions runtime/lib/util/BasePeer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 . ', ';
Expand Down