当前位置: 首页>>代码示例>>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;未经允许,请勿转载。