private function displayValues(Configuration $reader, $filter = self::NO_FILTERING) { $values = new \ArrayIterator($reader->getAllValuesForEnvironment()); if ($filter !== self::NO_FILTERING) { $values = new ValueFilterIterator($filter, $values); } $this->output->writeln(''); $values->ksort(); foreach ($values as $variable => $value) { $this->output->writeln(sprintf('<fg=cyan>%s</fg=cyan> = %s', $variable, $this->formatValue($value))); } }
public function __construct(Filesystem $sources, Configuration $reader, Finder $finder, FormatterProvider $formatterProvider = null) { $this->logger = new NullLogger(); $this->sources = $sources; $this->reader = $reader; $this->finder = $finder; $this->suffix = Application::DEFAULT_DISTFILE_SUFFIX; $this->dryRun = false; $this->enableBackup = false; $this->formatterProvider = $formatterProvider; if ($this->formatterProvider === null) { $this->formatterProvider = new NullProvider(); } $this->currentFormatterName = null; $this->currentTargetFile = null; $this->systemEnvironment = null; $this->unusedVariables = array_flip($reader->getAllVariables()); $this->unvaluedVariables = array(); }