/** * @return null|string */ public function getCustomTemplate($domain) { $config = $this->application->getConfig(); if ('pull-request-create' === $domain && null !== $config && $config->has('table-pr')) { return 'custom'; } return; }
/** * {@inheritdoc} * * @throws \RuntimeException when fields structure is invalid */ public function getRequirements() { $fields = $this->application->getConfig()->get('table-pr') ?: []; $fields['description'] = ['Description', '']; if (count($fields) < 2) { throw new \RuntimeException('table-pr structure requires at least one row, please check your local .gush.yml'); } foreach ($fields as $name => $rowData) { if (!is_string($name)) { throw new \RuntimeException('table-pr table row-name must be a string, please check your local .gush.yml'); } if (!is_array($rowData) || count($rowData) != 2) { throw new \RuntimeException(sprintf('table-pr table row-data "%s" must be an array with at least two values like: ' . '[Label, default value].' . PHP_EOL . 'please check your local .gush.yml', $name)); } } return $fields; }