addBody() public method

public addBody ( $statement, array $args = NULL ) : self
$args array
return self
コード例 #1
0
ファイル: FormExtensions.php プロジェクト: pipaslot/forms
 /**
  * @param Method $initialize
  * @param $config
  * @param $method
  * @param $defaults
  */
 private function registerSelectBox(Method $initialize, $config, $method, $defaults)
 {
     $codes = count($config['codes']) == 0 ? $defaults : (array) $config['codes'];
     $list = array();
     foreach ($codes as $code) {
         $lowercase = strtolower($code);
         $list[$lowercase] = $config['prefix'] . $lowercase;
     }
     $initialize->addBody(GenericSelectBox::class . '::register(?,?);', array($method, $list));
 }
コード例 #2
0
ファイル: OrmExtension.php プロジェクト: psyrny/Doctrine
 private function addCollapsePathsToTracy(Method $init)
 {
     $blueScreen = 'Tracy\\Debugger::getBlueScreen()';
     $commonDirname = dirname(Nette\Reflection\ClassType::from('Doctrine\\Common\\Version')->getFileName());
     $init->addBody($blueScreen . '->collapsePaths[] = ?;', array(dirname(Nette\Reflection\ClassType::from('Kdyby\\Doctrine\\Exception')->getFileName())));
     $init->addBody($blueScreen . '->collapsePaths[] = ?;', array(dirname(dirname(dirname(dirname($commonDirname))))));
     // this should be vendor/doctrine
     foreach ($this->proxyAutoloaders as $dir) {
         $init->addBody($blueScreen . '->collapsePaths[] = ?;', array($dir));
     }
 }
コード例 #3
0
ファイル: TestsGenerator.php プロジェクト: mrtnzlml/testbench
 private function generateExceptionBody(PhpGenerator\Method $method, $destination, \Exception $exception)
 {
     $method->addBody("Assert::exception(function () {\n" . "\t\$this->checkAction(?);\n" . '}, ?);', [$destination, get_class($exception)]);
     if ($exception instanceof \Nette\Application\BadRequestException) {
         $method->addBody("Assert::same(?, \$this->getReturnCode());", [$exception->getCode()]);
     }
     return $method;
 }
コード例 #4
0
ファイル: Extension.php プロジェクト: vrtak-cz/newrelic-nette
 private function setupCustom(Method $initialize)
 {
     $config = $this->getConfig();
     if (isset($config['custom']['parameters'])) {
         if (!is_array($config['custom']['parameters'])) {
             throw new \RuntimeException('Invalid custom parameters structure');
         }
         foreach ($config['custom']['parameters'] as $name => $value) {
             $initialize->addBody('\\VrtakCZ\\NewRelic\\Tracy\\Custom\\Parameters::addParameter(?, ?);', [$name, $value]);
         }
     }
     if (isset($config['custom']['tracers'])) {
         if (!is_array($config['custom']['tracers'])) {
             throw new \RuntimeException('Invalid custom tracers structure');
         }
         foreach ($config['custom']['tracers'] as $function) {
             $initialize->addBody('\\VrtakCZ\\NewRelic\\Tracy\\Custom\\Tracers::addTracer(?);', [$function]);
         }
     }
 }