Author: José Nahuel Cuesta Luengo (nahuelcuestaluengo@gmail.com)
示例#1
0
 /**
  * Get the source files as an associative array.
  *
  * @return array
  */
 public function getSourceFiles()
 {
     $sourceFiles = array();
     $ignore = $this->configuration->get('ignore');
     if (is_dir($this->get('source'))) {
         $recursiveIterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->get('source')));
         foreach ($recursiveIterator as $file) {
             if (!$ignore || !preg_match($ignore, $file->getPathname())) {
                 $sourceFiles[$file->getFilename()] = $file->getPathname();
             }
         }
     }
     return $sourceFiles;
 }
示例#2
0
 /**
  * Set a single option for this command.
  *
  * @param  string $name  Name of the option to set.
  * @param  mixed  $value Value for that option.
  *
  * @return \Clinner\Command\Command This instance, for a fluent API.
  */
 public function setOption($name, $value)
 {
     $this->_options->set($name, $value);
     return $this;
 }
示例#3
0
 /**
  * @dataProvider getInitialValues
  */
 public function testIsEmpty($initialValues)
 {
     $valueHolder = new ValueHolder($initialValues);
     $this->assertEquals(empty($initialValues), $valueHolder->isEmpty());
 }