Ejemplo n.º 1
0
 /**
  * Set type
  *
  * @param array $options
  * @throws \PreCommit\Exception
  */
 public function __construct(array $options = [])
 {
     parent::__construct($options);
     $this->type = $this->getConfig()->getNode('hooks/commit-msg/message/type');
     if (!$this->type) {
         throw new Exception('Type is not set.');
     }
 }
Ejemplo n.º 2
0
 /**
  * Constructor. Set path to PHP interpreter
  *
  * @param array $options
  * @throws Exception
  */
 public function __construct(array $options)
 {
     $interpreter = (string) Config::getInstance()->getNode('code/interpreter/php');
     if (empty($interpreter)) {
         throw new Exception('Path to PHP interpreter is not set.');
     }
     $this->interpreterPath = $interpreter;
     parent::__construct($options);
 }