當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PackageInterface::getPrettyString方法代碼示例

本文整理匯總了PHP中Composer\Package\PackageInterface::getPrettyString方法的典型用法代碼示例。如果您正苦於以下問題:PHP PackageInterface::getPrettyString方法的具體用法?PHP PackageInterface::getPrettyString怎麽用?PHP PackageInterface::getPrettyString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Composer\Package\PackageInterface的用法示例。


在下文中一共展示了PackageInterface::getPrettyString方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: isSkippable

 /**
  * 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;
 }
開發者ID:zyfran,項目名稱:satis,代碼行數:28,代碼來源:ArchiveBuilderHelper.php

示例2: getPrettyString

 public function getPrettyString(PackageInterface $sourcePackage)
 {
     return $sourcePackage->getPrettyString() . ' ' . $this->description . ' ' . $this->target . ' ' . $this->constraint->getPrettyString() . '';
 }
開發者ID:itillawarra,項目名稱:cmfive,代碼行數:4,代碼來源:Link.php

示例3: getPrettyString

 /**
  * {@inheritdoc}
  */
 public function getPrettyString()
 {
     return $this->package->getPrettyString();
 }
開發者ID:tenside,項目名稱:core,代碼行數:7,代碼來源:VersionedPackage.php

示例4: searchInRequires

 /**
  * 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();
     }
 }
開發者ID:bit3,項目名稱:composer-global-depends,代碼行數:23,代碼來源:DependencyAnalyser.php


注:本文中的Composer\Package\PackageInterface::getPrettyString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。