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


PHP VersionParser::parseLinks方法代碼示例

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


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

示例1: getPlatformRequirements

 public function getPlatformRequirements($withDevReqs = false)
 {
     $lockData = $this->getLockData();
     $versionParser = new VersionParser();
     $requirements = array();
     if (!empty($lockData['platform'])) {
         $requirements = $versionParser->parseLinks('__ROOT__', '1.0.0', 'requires', isset($lockData['platform']) ? $lockData['platform'] : array());
     }
     if ($withDevReqs && !empty($lockData['platform-dev'])) {
         $devRequirements = $versionParser->parseLinks('__ROOT__', '1.0.0', 'requires', isset($lockData['platform-dev']) ? $lockData['platform-dev'] : array());
         $requirements = array_merge($requirements, $devRequirements);
     }
     return $requirements;
 }
開發者ID:VicDeo,項目名稱:poc,代碼行數:14,代碼來源:Locker.php

示例2: testPluginApiVersionDoesSupportSelfVersion

 public function testPluginApiVersionDoesSupportSelfVersion()
 {
     $parser = new VersionParser();
     /** @var Link[] $links */
     $links = $parser->parseLinks('Plugin', '6.6.6', '', array('composer-plugin-api' => 'self.version'));
     $this->assertArrayHasKey('composer-plugin-api', $links);
     $this->assertSame('6.6.6', $links['composer-plugin-api']->getConstraint()->getPrettyString());
 }
開發者ID:arunkumar741,項目名稱:composer,代碼行數:8,代碼來源:VersionParserTest.php

示例3: init

    protected function init(array $requires = array(), $minimumStability = 'stable')
    {
        $parser = new VersionParser();
        $linkRequires = $parser->parseLinks('__ROOT__', '1.0.0', 'requires', $requires);

        $this->package->expects($this->any())
            ->method('getRequires')
            ->will($this->returnValue($linkRequires));
        $this->package->expects($this->any())
            ->method('getDevRequires')
            ->will($this->returnValue(array()));
        $this->package->expects($this->any())
            ->method('getMinimumStability')
            ->will($this->returnValue($minimumStability));

        /* @var RootPackageInterface $package */
        $package = $this->package;
        $this->filter = new VcsPackageFilter($package);
    }
開發者ID:pombredanne,項目名稱:ArcherSys,代碼行數:19,代碼來源:VcsPackageFilterTest.php


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