Skip to content

Commit d2e7b48

Browse files
committed
Fix nullable docblock for mutator methods.
1 parent 538771a commit d2e7b48

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/Propel/Generator/Builder/Om/ObjectBuilder.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1601,16 +1601,22 @@ public function addJsonMutatorComment(&$script, Column $column)
16011601
*
16021602
* @param string $script
16031603
* @param Column $column
1604+
* @return void
16041605
*/
16051606
public function addMutatorComment(&$script, Column $column)
16061607
{
16071608
$clo = $column->getLowercasedName();
1609+
$type = $column->getPhpType();
1610+
if ($type && !$column->isNotNull()) {
1611+
$type .= '|null';
1612+
}
1613+
16081614
$script .= "
16091615
/**
16101616
* Set the value of [$clo] column.
1611-
* ".$column->getDescription()."
1612-
* @param ".($column->getPhpType() ?: 'mixed')." \$v new value
1613-
* @return \$this|".$this->getObjectClassName(true)." The current object (for fluent API support)
1617+
* " . $column->getDescription() . "
1618+
* @param " . $type . " \$v New value
1619+
* @return \$this|" . $this->getObjectClassName(true) . " The current object (for fluent API support)
16141620
*/";
16151621
}
16161622

0 commit comments

Comments
 (0)