public static function createFromStateSummary(stdClass $states, $title, array $colors) { $handledUnhandledStates = array(); foreach ($states as $key => $value) { if (StringHelper::endsWith($key, '_handled') || StringHelper::endsWith($key, '_unhandled')) { $handledUnhandledStates[$key] = $value; } } $chart = new self(array_values($handledUnhandledStates), $title, $colors); return $chart->setSize(50)->setTitle('')->setSparklineClass('sparkline-multi'); }
/** * {@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 && !StringHelper::endsWith($file, $this->extension)) { $skip = true; break; } $key = $file; $file = $path; } while (0); } } while ($skip); $this->current = $file; /** @noinspection PhpUndefinedVariableInspection */ $this->key = $key; }
/** * {@inheritdoc} */ public function next() { do { $this->files->next(); $skip = false; if (!$this->files->valid()) { $file = false; $path = false; break; } else { $file = $this->files->current(); do { if ($this->skipHidden && $file[0] === '.') { $skip = true; break; } $path = $this->path . '/' . $file; if (is_dir($path)) { if ($this->flags & static::FILES_FIRST === static::FILES_FIRST) { $this->queue[] = array($path, $file); $skip = true; } break; } if ($this->skipEmpty && !filesize($path)) { $skip = true; break; } if ($this->extension && !StringHelper::endsWith($file, $this->extension)) { $skip = true; break; } } while (0); } } while ($skip); /** @noinspection PhpUndefinedVariableInspection */ if ($path === false && !empty($this->queue)) { list($path, $file) = array_shift($this->queue); } $this->current = $path; $this->key = $file; }