当前位置: 首页>>代码示例>>PHP>>正文


PHP ArrayLoader::parseLinks方法代码示例

本文整理汇总了PHP中Composer\Package\Loader\ArrayLoader::parseLinks方法的典型用法代码示例。如果您正苦于以下问题:PHP ArrayLoader::parseLinks方法的具体用法?PHP ArrayLoader::parseLinks怎么用?PHP ArrayLoader::parseLinks使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Composer\Package\Loader\ArrayLoader的用法示例。


在下文中一共展示了ArrayLoader::parseLinks方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testPluginApiVersionDoesSupportSelfVersion

    public function testPluginApiVersionDoesSupportSelfVersion()
    {
        $links = $this->loader->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:ncusoho,项目名称:composer,代码行数:7,代码来源:ArrayLoaderTest.php

示例2: initInstalledPackages

 /**
  * Initialize the installed package.
  */
 private function initInstalledPackages()
 {
     /* @var PackageInterface $package */
     foreach ($this->installedRepository->getPackages() as $package) {
         $operator = $this->getFilterOperator($package);
         /* @var Link $link */
         $link = current($this->arrayLoader->parseLinks($this->package->getName(), $this->package->getVersion(), 'installed', array($package->getName() => $operator . $package->getPrettyVersion())));
         $link = $this->includeRootConstraint($package, $link);
         $this->requires[$package->getName()] = $link;
     }
 }
开发者ID:DYFeng,项目名称:composer-asset-plugin,代码行数:14,代码来源:VcsPackageFilter.php

示例3: init

 /**
  * Init test.
  *
  * @param array  $requires
  * @param string $minimumStability
  * @param array  $extra
  */
 protected function init(array $requires = array(), $minimumStability = 'stable', array $extra = array())
 {
     $parser = new ArrayLoader();
     $linkRequires = $parser->parseLinks('__ROOT__', '1.0.0', 'requires', $requires);
     $stabilityFlags = $this->findStabilityFlags($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));
     $this->package->expects($this->any())->method('getStabilityFlags')->will($this->returnValue($stabilityFlags));
     $this->package->expects($this->any())->method('getExtra')->will($this->returnValue($extra));
     /* @var RootPackageInterface $package */
     $package = $this->package;
     $this->filter = new VcsPackageFilter($package, $this->installationManager, $this->installedRepository);
 }
开发者ID:stefangr,项目名称:composer-asset-plugin,代码行数:21,代码来源:VcsPackageFilterTest.php

示例4: parseLinks

 /**
  * @deprecated use ArrayLoader::parseLinks() instead
  * @param  string $source        source package name
  * @param  string $sourceVersion source package version (pretty version ideally)
  * @param  string $description   link description (e.g. requires, replaces, ..)
  * @param  array  $links         array of package name => constraint mappings
  * @return Link[]
  */
 public function parseLinks($source, $sourceVersion, $description, $links)
 {
     trigger_error(__METHOD__ . ' is deprecated. Use ' . '\\Composer\\Package\\Loader\\ArrayLoader::parseLinks() instead', E_USER_DEPRECATED);
     $loader = new ArrayLoader($this, false);
     return $loader->parseLinks($source, $sourceVersion, $description, $links);
 }
开发者ID:rogeriopradoj,项目名称:platform-show,代码行数:14,代码来源:VersionParser.php


注:本文中的Composer\Package\Loader\ArrayLoader::parseLinks方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。