getMethods() public method

public getMethods ( ) : Method[]
return Method[]
 public function afterCompile(Nette\PhpGenerator\ClassType $class)
 {
     $methods = $class->getMethods();
     $init = $methods['initialize'];
     $init->addBody('vojtabiberle\\MediaStorage\\Bridges\\Nette\\Forms\\Controls\\SingleSelectFileChoicer::register();');
     $init->addBody('vojtabiberle\\MediaStorage\\Bridges\\Nette\\Forms\\Controls\\MultiSelectFileChoicer::register();');
 }
 public function afterCompile(Nette\PhpGenerator\ClassType $class)
 {
     $init = $class->getMethods()['initialize'];
     $config = $this->validateConfig($this->defaults);
     if ($config['paginatorTemplate']) {
         $init->addBody('?::$defaultPaginationTemplate = ?;', [Settings::class, $config['paginatorTemplate']]);
     }
 }
 /**
  * @param Nette\PhpGenerator\ClassType $class
  */
 public function afterCompile(Nette\PhpGenerator\ClassType $class)
 {
     $methods = $class->getMethods();
     $init = $methods['initialize'];
     if ($this->getContainerBuilder()->hasDefinition($this->prefix('bar'))) {
         $init->addBody('if ($this->parameters["debugMode"]) Tracy\\Debugger::getBar()->addPanel($this->getService(?));', [$this->prefix('bar')]);
     }
 }
Beispiel #4
0
 public function afterCompile(ClassType $class)
 {
     $config = $this->validateConfig($this->defaults);
     $methods = $class->getMethods();
     $initialize = $methods['initialize'];
     $initialize->addBody(TextOutput::class . '::register();');
     $initialize->addBody(DatePicker::class . '::register();');
     $initialize->addBody(DateTimePicker::class . '::register();');
     $initialize->addBody(TagControl::class . '::register();');
     $this->registerSelectBox($initialize, $config['country'], "addSelectCountry", $this->countryCodes);
     $this->registerSelectBox($initialize, $config['locale'], "addSelectLocale", $this->localeCodes);
 }
 /**
  * @param Nette\PhpGenerator\ClassType $class
  */
 public function afterCompile(Nette\PhpGenerator\ClassType $class)
 {
     $methods = $class->getMethods();
     $init = $methods['initialize'];
     $config = $this->getSettings();
     if ($config['registration']['upload'] && class_exists('Nette\\Forms\\Form')) {
         $init->addBody(Upload::class . '::register();');
     }
     if ($config['registration']['multiUpload'] && class_exists('Nette\\Forms\\Form')) {
         $init->addBody(MultiUpload::class . '::register();');
     }
     if ($config['checkbox']['caption']) {
         $init->addBody(Checkbox::class . '::$globalCaption = ?;', [$config['checkbox']['caption']]);
     }
 }
 public function afterCompile(Nette\PhpGenerator\ClassType $class)
 {
     $config = $this->validateConfig($this->defaults);
     $init = $class->getMethods()['initialize'];
     if ($config['recaptcha']['api']) {
         $init->addBody('WebChemistry\\Forms\\Controls\\Recaptcha::$defaultApiKey = ?;', [$config['recaptcha']['api']]);
     }
     if ($config['recaptcha']['secret']) {
         $init->addBody('WebChemistry\\Forms\\Controls\\Recaptcha::$defaultSecretKey = ?;', [$config['recaptcha']['secret']]);
     }
     if ($config['date']['format']) {
         $init->addBody('WebChemistry\\Forms\\Controls\\Date::$dateFormat = ?;', [$config['date']['format']]);
     }
     if ($config['translations']['enable']) {
         $tr = $config['translations'];
         $init->addBody('Nette\\Forms\\Validator::$messages[WebChemistry\\Forms\\Controls\\Date::VALID] = ?;', [$tr['date']]);
         $init->addBody('Nette\\Forms\\Validator::$messages[WebChemistry\\Forms\\Controls\\Mask::VALID] = ?;', [$tr['mask']]);
         $init->addBody('Nette\\Forms\\Validator::$messages[WebChemistry\\Forms\\Controls\\Recaptcha::VALID] = ?;', [$tr['recaptcha']['valid']]);
         $init->addBody('Nette\\Forms\\Validator::$messages[WebChemistry\\Forms\\Controls\\Recaptcha::FILLED] = ?;', [$tr['recaptcha']['filled']]);
         $init->addBody('Nette\\Forms\\Validator::$messages[WebChemistry\\Forms\\Controls\\Tags::PLACEHOLDER] = ?;', [$tr['tags']]);
     }
 }
 public function afterCompile(Nette\PhpGenerator\ClassType $class)
 {
     $init = $class->getMethods()['initialize'];
     $config = $this->validateConfig($this->defaults);
     $init->addBody('WebChemistry\\Forms\\Controls\\Multiplier::register(?);', [$config['name']]);
 }
Beispiel #8
0
 public function afterCompile(ClassType $class)
 {
     $init = $class->getMethods()['initialize'];
     $init->addBody(__CLASS__ . '::registerControls();');
 }
Beispiel #9
0
 public function afterCompile(Nette\PhpGenerator\ClassType $class)
 {
     $methods = $class->getMethods();
     $methods['initialize']->addBody('$this->getByType(?)->register(?);', [Manager::class, $this->config['prepend']]);
 }