示例#1
0
 public static function createFromStateSummary(stdClass $states, $title, array $colors)
 {
     $handledUnhandledStates = array();
     foreach ($states as $key => $value) {
         if (String::endsWith($key, '_handled') || String::endsWith($key, '_unhandled')) {
             $handledUnhandledStates[$key] = $value;
         }
     }
     $chart = new self(array_values($handledUnhandledStates), $title, $colors);
     return $chart->setSize(50)->setTitle('')->setSparklineClass('sparkline-multi');
 }
示例#2
0
 /**
  * {@inheritdoc}
  */
 public function next()
 {
     do {
         $file = readdir($this->handle);
         if ($file === false) {
             $key = false;
             break;
         } else {
             $skip = false;
             do {
                 if ($this->skipHidden && $file[0] === '.') {
                     $skip = true;
                     break;
                 }
                 $path = $this->path . '/' . $file;
                 if (is_dir($path)) {
                     $skip = true;
                     break;
                 }
                 if ($this->skipEmpty && !filesize($path)) {
                     $skip = true;
                     break;
                 }
                 if ($this->extension && !String::endsWith($file, $this->extension)) {
                     $skip = true;
                     break;
                 }
                 $key = $file;
                 $file = $path;
             } while (0);
         }
     } while ($skip);
     $this->current = $file;
     /** @noinspection PhpUndefinedVariableInspection */
     $this->key = $key;
 }