/** * Tells if a package has to be dumped or not. * * @param PackageInterface $package The package to be dumped * * @return bool false if the package has to be dumped. */ public function isSkippable(PackageInterface $package) { if ('metapackage' === $package->getType()) { return true; } $name = $package->getPrettyString(); if (true === $this->archiveConfig['skip-dev'] && true === $package->isDev()) { $this->output->writeln(sprintf("<info>Skipping '%s' (is dev)</info>", $name)); return true; } $names = $package->getNames(); if ($this->archiveConfig['whitelist'] && !array_intersect($this->archiveConfig['whitelist'], $names)) { $this->output->writeln(sprintf("<info>Skipping '%s' (is not in whitelist)</info>", $name)); return true; } if ($this->archiveConfig['blacklist'] && array_intersect($this->archiveConfig['blacklist'], $names)) { $this->output->writeln(sprintf("<info>Skipping '%s' (is in blacklist)</info>", $name)); return true; } return false; }
public function getPrettyString(PackageInterface $sourcePackage) { return $sourcePackage->getPrettyString() . ' ' . $this->description . ' ' . $this->target . ' ' . $this->constraint->getPrettyString() . ''; }
/** * {@inheritdoc} */ public function getPrettyString() { return $this->package->getPrettyString(); }
/** * Search for dependencies in this package. * * @param PackageInterface $package The package to search in. * @param string $type One of "prod" or "dev". * @param array|Link[] $requires The require links. * * @return void */ private function searchInRequires(PackageInterface $package, $type, array $requires) { if (isset($requires[$this->packageName])) { $link = $requires[$this->packageName]; $constraint = $link->getPrettyConstraint(); $section = $package->getPrettyString(); $message = sprintf('<comment>%s</comment> %s %s', 'dev' == $type ? 'require-dev' : 'require', $this->packageName, $constraint); $this->progress->clear(); // Hack to get the cursor on the line beginning $this->output->write("\n[1A"); $this->output->writeln($this->formatter->formatSection($section, $message)); $this->progress->display(); } }