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


PHP VersionParser::isDev方法代碼示例

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


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

示例1: __construct

 /**
  * Creates a new in memory package.
  *
  * @param string $name        The package's name
  * @param string $version     The package's version
  * @param string $prettyVersion The package's non-normalized version
  */
 public function __construct($name, $version, $prettyVersion)
 {
     parent::__construct($name);
     $this->version = $version;
     $this->prettyVersion = $prettyVersion;
     $this->dev = VersionParser::isDev($version);
 }
開發者ID:roadrunner,項目名稱:composer,代碼行數:14,代碼來源:MemoryPackage.php

示例2: __construct

 /**
  * All descendants' constructors should call this parent constructor
  *
  * @param PackageInterface $aliasOf The package this package is an alias of
  * @param string $version The version the alias must report
  * @param string $prettyVersion The alias's non-normalized version
  */
 public function __construct(PackageInterface $aliasOf, $version, $prettyVersion)
 {
     parent::__construct($aliasOf->getName());
     $this->version = $version;
     $this->prettyVersion = $prettyVersion;
     $this->aliasOf = $aliasOf;
     $this->dev = VersionParser::isDev($version);
     // replace self.version dependencies
     foreach (array('requires', 'recommends', 'suggests') as $type) {
         $links = $aliasOf->{'get' . ucfirst($type)}();
         foreach ($links as $index => $link) {
             // link is self.version, but must be replacing also the replaced version
             if ('self.version' === $link->getPrettyConstraint()) {
                 $links[$index] = new Link($link->getSource(), $link->getTarget(), new VersionConstraint('=', $this->version), $type, $this->version);
             }
         }
         $this->{$type} = $links;
     }
     // duplicate self.version provides
     foreach (array('conflicts', 'provides', 'replaces') as $type) {
         $links = $aliasOf->{'get' . ucfirst($type)}();
         $newLinks = array();
         foreach ($links as $link) {
             // link is self.version, but must be replacing also the replaced version
             if ('self.version' === $link->getPrettyConstraint()) {
                 $newLinks[] = new Link($link->getSource(), $link->getTarget(), new VersionConstraint('=', $this->version), $type, $this->version);
             }
         }
         $this->{$type} = array_merge($links, $newLinks);
     }
 }
開發者ID:roadrunner,項目名稱:composer,代碼行數:38,代碼來源:AliasPackage.php

示例3: testIsDev

 /**
  * @dataProvider dataIsDev
  */
 public function testIsDev($expected, $version)
 {
     $this->assertSame($expected, VersionParser::isDev($version));
 }
開發者ID:roadrunner,項目名稱:composer,代碼行數:7,代碼來源:VersionParserTest.php


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