本文整理汇总了PHP中Composer\Package\Package::setProvides方法的典型用法代码示例。如果您正苦于以下问题:PHP Package::setProvides方法的具体用法?PHP Package::setProvides怎么用?PHP Package::setProvides使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Composer\Package\Package
的用法示例。
在下文中一共展示了Package::setProvides方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dataPackages
public function dataPackages()
{
$metapackage = new Package('vendor/name', '1.0.0.0', '1.0');
$metapackage->setType('metapackage');
$package1 = new Package('vendor/name', '1.0.0.0', '1.0');
$package2 = new Package('vendor/name', 'dev-master', 'dev-master');
$package3 = new Package('othervendor/othername', '1.0.0.0', '1.0');
$package3->setProvides([new Link('', 'vendor/name')]);
$data = [];
$data['metapackage'] = [true, $metapackage, []];
$data['skipDev is true, but package is not'] = [false, $package1, ['skip-dev' => 1]];
$data['skipDev is true, package isDev'] = [true, $package2, ['skip-dev' => 1]];
$data['package in whitelist'] = [false, $package1, ['whitelist' => ['vendor/name']]];
$data['package not in whitelist'] = [true, $package1, ['whitelist' => ['othervendor/othername']]];
$data['package in blacklist'] = [true, $package1, ['blacklist' => ['vendor/name']]];
$data['package not in blacklist'] = [false, $package1, ['blacklist' => ['othervendor/othername']]];
$data['package provides a virtual package in blacklist'] = [true, $package3, ['blacklist' => ['vendor/name']]];
return $data;
}
示例2: dataPackages
public function dataPackages()
{
$metapackage = new Package('vendor/name', '1.0.0.0', '1.0');
$metapackage->setType('metapackage');
$package1 = new Package('vendor/name', '1.0.0.0', '1.0');
$package2 = new Package('vendor/name', 'dev-master', 'dev-master');
$package3 = new Package('othervendor/othername', '1.0.0.0', '1.0');
$package3->setProvides(array(new Link('', 'vendor/name')));
$data = array();
$data['metapackage'] = array(true, $metapackage, array());
$data['skipDev is true, but package is not'] = array(false, $package1, array('skip-dev' => 1));
$data['skipDev is true, package isDev'] = array(true, $package2, array('skip-dev' => 1));
$data['package in whitelist'] = array(false, $package1, array('whitelist' => array('vendor/name')));
$data['package not in whitelist'] = array(true, $package1, array('whitelist' => array('othervendor/othername')));
$data['package in blacklist'] = array(true, $package1, array('blacklist' => array('vendor/name')));
$data['package not in blacklist'] = array(false, $package1, array('blacklist' => array('othervendor/othername')));
$data['package provides a virtual package in blacklist'] = array(true, $package3, array('blacklist' => array('vendor/name')));
return $data;
}