Skip to content

Commit

Permalink
Add more types were possible, fix docblocks. (#1858)
Browse files Browse the repository at this point in the history
* Add more types were possible, fix docblocks.

* Adjust templates method signatures. Fix up constants.
  • Loading branch information
dereuromark authored Apr 6, 2022
1 parent 2c7a2f7 commit 0cfea4e
Show file tree
Hide file tree
Showing 52 changed files with 633 additions and 611 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ protected function addObjectGetParentOrCreate(string &$script): void
/**
* Get or Create the parent " . $parentClass . " object of the current object
*
* @return " . $parentClass . " The parent object
* @return " . $parentClass . " The parent object
*/
public function getParentOrCreate(?ConnectionInterface \$con = null)
{
Expand Down Expand Up @@ -372,7 +372,7 @@ protected function addObjectGetSyncParent(string &$script): void
* Create or Update the parent " . $parentTable->getPhpName() . " object
* And return its primary key
*
* @return " . $cptype . " The primary key of the parent object
* @return " . $cptype . " The primary key of the parent object
*/
public function getSyncParent(?ConnectionInterface \$con = null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ protected function addHasChildObject(string &$script): void
/**
* Whether this object is the parent of a child object
*
* @return bool
* @return bool
*/
public function hasChildObject(): bool
{
Expand Down
12 changes: 7 additions & 5 deletions src/Propel/Generator/Behavior/Delegate/DelegateBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -338,21 +338,23 @@ public function queryMethods(QueryBuilder $builder): string
*
* @see Criteria::add()
*
* @param string \$column A string representing thecolumn phpName, e.g. 'AuthorId'
* @param mixed \$value A value for the condition
* @param string \$column A string representing the column phpName, e.g. 'AuthorId'
* @param mixed \$value A value for the condition
* @param string \$comparison What to use for the column comparison, defaults to Criteria::EQUAL
*
* @return \$this|ModelCriteria The current object, for fluid interface
* @return \$this The current object, for fluid interface
*/
public function filterBy(\$column, \$value, \$comparison = Criteria::EQUAL)
{
if (isset(\$this->delegatedFields[\$column])) {
\$methodUse = \"use{\$this->delegatedFields[\$column]}Query\";
return \$this->{\$methodUse}()->filterBy(\$column, \$value, \$comparison)->endUse();
\$this->{\$methodUse}()->filterBy(\$column, \$value, \$comparison)->endUse();
} else {
return \$this->add(\$this->getRealColumnName(\$column), \$value, \$comparison);
\$this->add(\$this->getRealColumnName(\$column), \$value, \$comparison);
}
return \$this;
}
";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ protected function addTranslatedColumnSetter(Column $column): string
$objectBuilder->addMutatorOpenOpen($functionStatement, $column);
}
$comment = preg_replace('/^\t/m', '', $comment);
$comment = str_replace('@return $this|' . $i18nTablePhpName, '@return $this|' . $tablePhpName, $comment);
$comment = str_replace('@return $this|' . $i18nTablePhpName, '@return $this|' . $tablePhpName, $comment);
$functionStatement = preg_replace('/^\t/m', '', $functionStatement);
preg_match_all('/\$[a-z]+/i', $functionStatement, $params);

Expand Down
Loading

0 comments on commit 0cfea4e

Please sign in to comment.