Skip to content

Commit

Permalink
Printer: added $returnTypeColon [Closes #63]
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Jun 19, 2020
1 parent dced442 commit 0aa8ca8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/PhpGenerator/Printer.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ class Printer
/** @var int */
protected $linesBetweenMethods = 2;

/** @var string */
protected $returnTypeColon = ': ';

/** @var bool */
private $resolveTypes = true;

Expand Down Expand Up @@ -278,7 +281,7 @@ public function printType(?string $type, bool $nullable = false, PhpNamespace $n
private function printReturnType($function, ?PhpNamespace $namespace): string
{
return ($tmp = $this->printType($function->getReturnType(), $function->isReturnNullable(), $namespace))
? ': ' . $tmp
? $this->returnTypeColon . $tmp
: '';
}

Expand Down

0 comments on commit 0aa8ca8

Please sign in to comment.