*/
protected $defaultOutput;
+ /**
+ * @var array
+ */
+ protected $requirements = [
+ 'pcre',
+ 'DOM',
+ ];
+
protected function configure()
{
$this
$fulfilled = true;
- $label = '<comment>PCRE</comment>';
- if (extension_loaded('pcre')) {
- $status = '<info>OK!</info>';
- $help = '';
- } else {
- $fulfilled = false;
- $status = '<error>ERROR!</error>';
- $help = 'You should enabled PCRE extension';
- }
- $rows[] = array($label, $status, $help);
-
- $label = '<comment>DOM</comment>';
- if (extension_loaded('DOM')) {
- $status = '<info>OK!</info>';
- $help = '';
- } else {
- $fulfilled = false;
- $status = '<error>ERROR!</error>';
- $help = 'You should enabled DOM extension';
+ foreach ($this->requirements as $requirement) {
+ $label = '<comment>'.strtoupper($requirement).'</comment>';
+ if (extension_loaded($requirement)) {
+ $status = '<info>OK!</info>';
+ $help = '';
+ } else {
+ $fulfilled = false;
+ $status = '<error>ERROR!</error>';
+ $help = 'You should enabled '.$requirement.' extension';
+ }
+ $rows[] = array($label, $status, $help);
}
- $rows[] = array($label, $status, $help);
$table = new Table($this->defaultOutput);
$table