Skip to content

Commit 3568624

Browse files
committed
Method: formatArgs() is used only with arrays
1 parent 2e64165 commit 3568624

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/PhpGenerator/Method.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,9 @@ public function addUse($name)
231231
/**
232232
* @return static
233233
*/
234-
public function setBody($statement, array $args = NULL)
234+
public function setBody($code, array $args = NULL)
235235
{
236-
$this->body = func_num_args() > 1 ? Helpers::formatArgs($statement, $args) : $statement;
236+
$this->body = $args === NULL ? $code : Helpers::formatArgs($code, $args);
237237
return $this;
238238
}
239239

@@ -250,9 +250,9 @@ public function getBody()
250250
/**
251251
* @return static
252252
*/
253-
public function addBody($statement, array $args = NULL)
253+
public function addBody($code, array $args = NULL)
254254
{
255-
$this->body .= (func_num_args() > 1 ? Helpers::formatArgs($statement, $args) : $statement) . "\n";
255+
$this->body .= ($args === NULL ? $code : Helpers::formatArgs($code, $args)) . "\n";
256256
return $this;
257257
}
258258

0 commit comments

Comments
 (0)