Exemple #1
0
 /**
  * @covers Phpy\Func\Func::addParameter
  */
 public function testAddParameter()
 {
     $param1 = new Parameter('p1');
     $param2 = new Parameter('p2');
     $this->func->addParameter($param1)->addParameter($param2);
     $this->assertEquals(array($param1, $param2), $this->func->getParameters());
 }
Exemple #2
0
 /**
  * @param Func $function
  * @param bool $includeBody
  *
  * @return array
  */
 private function getTmplVars(Func $function, $includeBody)
 {
     $realizedParams = array();
     foreach ($function->getParameters() as $param) {
         $realizedParams[] = $this->parameterRealizer->realize($param);
     }
     return array('parametersList' => implode(', ', $realizedParams), 'realizedBody' => $includeBody ? $this->getRealizedBody($function) : '', 'name' => $function->getName(), 'fullName' => $function->getFullQualifiedName());
 }