repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
fxpio/composer-asset-plugin | Repository/Util.php | Util.addRepositoryInstance | public static function addRepositoryInstance(IOInterface $io, RepositoryManager $rm, array &$repos, $name, RepositoryInterface $repo, Pool $pool = null)
{
$notAddedRepo = null;
if (!isset($repos[$name])) {
static::writeAddRepository($io, $name);
$notAddedRepo = $repo;
... | php | public static function addRepositoryInstance(IOInterface $io, RepositoryManager $rm, array &$repos, $name, RepositoryInterface $repo, Pool $pool = null)
{
$notAddedRepo = null;
if (!isset($repos[$name])) {
static::writeAddRepository($io, $name);
$notAddedRepo = $repo;
... | [
"public",
"static",
"function",
"addRepositoryInstance",
"(",
"IOInterface",
"$",
"io",
",",
"RepositoryManager",
"$",
"rm",
",",
"array",
"&",
"$",
"repos",
",",
"$",
"name",
",",
"RepositoryInterface",
"$",
"repo",
",",
"Pool",
"$",
"pool",
"=",
"null",
... | Add repository instance.
The instance of repository is returned if the repository in't added in the pool.
@param IOInterface $io The IO instance
@param RepositoryManager $rm The repository mamanger
@param array $repos The list of already repository added (passed by reference)
@param strin... | [
"Add",
"repository",
"instance",
".",
"The",
"instance",
"of",
"repository",
"is",
"returned",
"if",
"the",
"repository",
"in",
"t",
"added",
"in",
"the",
"pool",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/Util.php#L60-L77 |
fxpio/composer-asset-plugin | Repository/Util.php | Util.cleanPackageName | public static function cleanPackageName($name)
{
if (preg_match('/^[a-z]+\-asset\//', $name, $matches)) {
$name = substr($name, \strlen($matches[0]));
}
return $name;
} | php | public static function cleanPackageName($name)
{
if (preg_match('/^[a-z]+\-asset\//', $name, $matches)) {
$name = substr($name, \strlen($matches[0]));
}
return $name;
} | [
"public",
"static",
"function",
"cleanPackageName",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"preg_match",
"(",
"'/^[a-z]+\\-asset\\//'",
",",
"$",
"name",
",",
"$",
"matches",
")",
")",
"{",
"$",
"name",
"=",
"substr",
"(",
"$",
"name",
",",
"\\",
"strl... | Cleans the package name, removing the Composer prefix if present.
@param string $name
@return string | [
"Cleans",
"the",
"package",
"name",
"removing",
"the",
"Composer",
"prefix",
"if",
"present",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/Util.php#L86-L93 |
fxpio/composer-asset-plugin | Repository/Vcs/GitHubDriver.php | GitHubDriver.getComposerInformation | public function getComposerInformation($identifier)
{
if ($this->gitDriver) {
return $this->gitDriver->getComposerInformation($identifier);
}
$this->infoCache[$identifier] = Util::readCache($this->infoCache, $this->cache, $this->repoConfig['asset-type'], $identifier);
i... | php | public function getComposerInformation($identifier)
{
if ($this->gitDriver) {
return $this->gitDriver->getComposerInformation($identifier);
}
$this->infoCache[$identifier] = Util::readCache($this->infoCache, $this->cache, $this->repoConfig['asset-type'], $identifier);
i... | [
"public",
"function",
"getComposerInformation",
"(",
"$",
"identifier",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"gitDriver",
")",
"{",
"return",
"$",
"this",
"->",
"gitDriver",
"->",
"getComposerInformation",
"(",
"$",
"identifier",
")",
";",
"}",
"$",
"th... | {@inheritdoc} | [
"{"
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/Vcs/GitHubDriver.php#L27-L50 |
fxpio/composer-asset-plugin | Repository/Vcs/GitHubDriver.php | GitHubDriver.getComposerContent | protected function getComposerContent($resource)
{
$notFoundRetries = 2;
$composer = null;
while ($notFoundRetries) {
try {
$composer = $this->parseComposerContent($resource);
break;
} catch (TransportException $e) {
i... | php | protected function getComposerContent($resource)
{
$notFoundRetries = 2;
$composer = null;
while ($notFoundRetries) {
try {
$composer = $this->parseComposerContent($resource);
break;
} catch (TransportException $e) {
i... | [
"protected",
"function",
"getComposerContent",
"(",
"$",
"resource",
")",
"{",
"$",
"notFoundRetries",
"=",
"2",
";",
"$",
"composer",
"=",
"null",
";",
"while",
"(",
"$",
"notFoundRetries",
")",
"{",
"try",
"{",
"$",
"composer",
"=",
"$",
"this",
"->",
... | Gets content of composer information.
@param string $resource
@throws \RuntimeException
@throws \Composer\Downloader\TransportException
@throws \Exception
@return null|array|false | [
"Gets",
"content",
"of",
"composer",
"information",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/Vcs/GitHubDriver.php#L63-L85 |
fxpio/composer-asset-plugin | Repository/Vcs/GitHubDriver.php | GitHubDriver.parseComposerContent | protected function parseComposerContent($resource)
{
$composer = (array) JsonFile::parseJson($this->getContents($resource));
if (empty($composer['content']) || 'base64' !== $composer['encoding'] || !($composer = base64_decode($composer['content'], true))) {
throw new \RuntimeException('C... | php | protected function parseComposerContent($resource)
{
$composer = (array) JsonFile::parseJson($this->getContents($resource));
if (empty($composer['content']) || 'base64' !== $composer['encoding'] || !($composer = base64_decode($composer['content'], true))) {
throw new \RuntimeException('C... | [
"protected",
"function",
"parseComposerContent",
"(",
"$",
"resource",
")",
"{",
"$",
"composer",
"=",
"(",
"array",
")",
"JsonFile",
"::",
"parseJson",
"(",
"$",
"this",
"->",
"getContents",
"(",
"$",
"resource",
")",
")",
";",
"if",
"(",
"empty",
"(",
... | Parse the composer content.
@param string $resource
@throws \RuntimeException When the resource could not be retrieved
@return array | [
"Parse",
"the",
"composer",
"content",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/Vcs/GitHubDriver.php#L96-L104 |
fxpio/composer-asset-plugin | Repository/Vcs/GitHubDriver.php | GitHubDriver.convertComposerContent | protected function convertComposerContent($composer, $resource, $identifier)
{
$composer = JsonFile::parseJson($composer, $resource);
$resource = $this->getApiUrl().'/repos/'.$this->owner.'/'.$this->repository.'/commits/'.urlencode($identifier);
$composer = Util::addComposerTime($composer, '... | php | protected function convertComposerContent($composer, $resource, $identifier)
{
$composer = JsonFile::parseJson($composer, $resource);
$resource = $this->getApiUrl().'/repos/'.$this->owner.'/'.$this->repository.'/commits/'.urlencode($identifier);
$composer = Util::addComposerTime($composer, '... | [
"protected",
"function",
"convertComposerContent",
"(",
"$",
"composer",
",",
"$",
"resource",
",",
"$",
"identifier",
")",
"{",
"$",
"composer",
"=",
"JsonFile",
"::",
"parseJson",
"(",
"$",
"composer",
",",
"$",
"resource",
")",
";",
"$",
"resource",
"="... | Converts json composer file to array.
@param string $composer
@param string $resource
@param string $identifier
@return array | [
"Converts",
"json",
"composer",
"file",
"to",
"array",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/Vcs/GitHubDriver.php#L115-L130 |
fxpio/composer-asset-plugin | Repository/Vcs/GitHubDriver.php | GitHubDriver.setupGitDriver | protected function setupGitDriver($url)
{
$this->gitDriver = new GitDriver(
array(
'url' => $url,
'asset-type' => $this->repoConfig['asset-type'],
'filename' => $this->repoConfig['filename'],
'asset-repository-manager' => $this->rep... | php | protected function setupGitDriver($url)
{
$this->gitDriver = new GitDriver(
array(
'url' => $url,
'asset-type' => $this->repoConfig['asset-type'],
'filename' => $this->repoConfig['filename'],
'asset-repository-manager' => $this->rep... | [
"protected",
"function",
"setupGitDriver",
"(",
"$",
"url",
")",
"{",
"$",
"this",
"->",
"gitDriver",
"=",
"new",
"GitDriver",
"(",
"array",
"(",
"'url'",
"=>",
"$",
"url",
",",
"'asset-type'",
"=>",
"$",
"this",
"->",
"repoConfig",
"[",
"'asset-type'",
... | Setup git driver.
@param string $url | [
"Setup",
"git",
"driver",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/Vcs/GitHubDriver.php#L137-L152 |
fxpio/composer-asset-plugin | Repository/VcsPackageFilter.php | VcsPackageFilter.skip | public function skip(AssetTypeInterface $assetType, $name, $version)
{
try {
$cVersion = $assetType->getVersionConverter()->convertVersion($version);
$normalizedVersion = $this->versionParser->normalize($cVersion);
} catch (\Exception $ex) {
return true;
}... | php | public function skip(AssetTypeInterface $assetType, $name, $version)
{
try {
$cVersion = $assetType->getVersionConverter()->convertVersion($version);
$normalizedVersion = $this->versionParser->normalize($cVersion);
} catch (\Exception $ex) {
return true;
}... | [
"public",
"function",
"skip",
"(",
"AssetTypeInterface",
"$",
"assetType",
",",
"$",
"name",
",",
"$",
"version",
")",
"{",
"try",
"{",
"$",
"cVersion",
"=",
"$",
"assetType",
"->",
"getVersionConverter",
"(",
")",
"->",
"convertVersion",
"(",
"$",
"versio... | Check if the version must be skipped.
@param AssetTypeInterface $assetType The asset type
@param string $name The composer package name
@param string $version The version
@return bool | [
"Check",
"if",
"the",
"version",
"must",
"be",
"skipped",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/VcsPackageFilter.php#L126-L140 |
fxpio/composer-asset-plugin | Repository/VcsPackageFilter.php | VcsPackageFilter.doSkip | protected function doSkip($name, $normalizedVersion)
{
if (!isset($this->requires[$name]) || false !== strpos($normalizedVersion, '-p')) {
return false;
}
/** @var Link $require */
$require = $this->requires[$name];
return !$this->satisfy($require, $normalizedVe... | php | protected function doSkip($name, $normalizedVersion)
{
if (!isset($this->requires[$name]) || false !== strpos($normalizedVersion, '-p')) {
return false;
}
/** @var Link $require */
$require = $this->requires[$name];
return !$this->satisfy($require, $normalizedVe... | [
"protected",
"function",
"doSkip",
"(",
"$",
"name",
",",
"$",
"normalizedVersion",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"requires",
"[",
"$",
"name",
"]",
")",
"||",
"false",
"!==",
"strpos",
"(",
"$",
"normalizedVersion",
",",
... | Do check if the version must be skipped.
@param string $name The composer package name
@param string $normalizedVersion The normalized version
@return bool | [
"Do",
"check",
"if",
"the",
"version",
"must",
"be",
"skipped",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/VcsPackageFilter.php#L150-L160 |
fxpio/composer-asset-plugin | Repository/VcsPackageFilter.php | VcsPackageFilter.skipByPattern | protected function skipByPattern()
{
$skip = $this->config->get('pattern-skip-version', false);
return \is_string($skip)
? trim($skip, '/')
: false;
} | php | protected function skipByPattern()
{
$skip = $this->config->get('pattern-skip-version', false);
return \is_string($skip)
? trim($skip, '/')
: false;
} | [
"protected",
"function",
"skipByPattern",
"(",
")",
"{",
"$",
"skip",
"=",
"$",
"this",
"->",
"config",
"->",
"get",
"(",
"'pattern-skip-version'",
",",
"false",
")",
";",
"return",
"\\",
"is_string",
"(",
"$",
"skip",
")",
"?",
"trim",
"(",
"$",
"skip... | Check if the filter must be skipped the version by pattern or not.
@return false|string Return the pattern or FALSE for disable the feature | [
"Check",
"if",
"the",
"filter",
"must",
"be",
"skipped",
"the",
"version",
"by",
"pattern",
"or",
"not",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/VcsPackageFilter.php#L181-L188 |
fxpio/composer-asset-plugin | Repository/VcsPackageFilter.php | VcsPackageFilter.satisfyVersion | protected function satisfyVersion(Link $require, $normalizedVersion)
{
$constraintSame = $this->versionParser->parseConstraints($normalizedVersion);
$sameVersion = (bool) $require->getConstraint()->matches($constraintSame);
$consNormalizedVersion = FilterUtil::getVersionConstraint($normaliz... | php | protected function satisfyVersion(Link $require, $normalizedVersion)
{
$constraintSame = $this->versionParser->parseConstraints($normalizedVersion);
$sameVersion = (bool) $require->getConstraint()->matches($constraintSame);
$consNormalizedVersion = FilterUtil::getVersionConstraint($normaliz... | [
"protected",
"function",
"satisfyVersion",
"(",
"Link",
"$",
"require",
",",
"$",
"normalizedVersion",
")",
"{",
"$",
"constraintSame",
"=",
"$",
"this",
"->",
"versionParser",
"->",
"parseConstraints",
"(",
"$",
"normalizedVersion",
")",
";",
"$",
"sameVersion"... | Check if the require dependency has a satisfactory version.
@param Link $require The require link defined in root package
@param string $normalizedVersion The normalized version
@return bool | [
"Check",
"if",
"the",
"require",
"dependency",
"has",
"a",
"satisfactory",
"version",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/VcsPackageFilter.php#L210-L219 |
fxpio/composer-asset-plugin | Repository/VcsPackageFilter.php | VcsPackageFilter.satisfyStability | protected function satisfyStability(Link $require, $normalizedVersion)
{
$requireStability = $this->getRequireStability($require);
$stability = $this->versionParser->parseStability($normalizedVersion);
return Package::$stabilities[$stability] <= Package::$stabilities[$requireStability];
... | php | protected function satisfyStability(Link $require, $normalizedVersion)
{
$requireStability = $this->getRequireStability($require);
$stability = $this->versionParser->parseStability($normalizedVersion);
return Package::$stabilities[$stability] <= Package::$stabilities[$requireStability];
... | [
"protected",
"function",
"satisfyStability",
"(",
"Link",
"$",
"require",
",",
"$",
"normalizedVersion",
")",
"{",
"$",
"requireStability",
"=",
"$",
"this",
"->",
"getRequireStability",
"(",
"$",
"require",
")",
";",
"$",
"stability",
"=",
"$",
"this",
"->"... | Check if the require dependency has a satisfactory stability.
@param Link $require The require link defined in root package
@param string $normalizedVersion The normalized version
@return bool | [
"Check",
"if",
"the",
"require",
"dependency",
"has",
"a",
"satisfactory",
"stability",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/VcsPackageFilter.php#L229-L235 |
fxpio/composer-asset-plugin | Repository/VcsPackageFilter.php | VcsPackageFilter.getRequireStability | protected function getRequireStability(Link $require)
{
$prettyConstraint = $require->getPrettyConstraint();
$stabilities = Package::$stabilities;
if (preg_match_all('/@('.implode('|', array_keys($stabilities)).')/', $prettyConstraint, $matches)) {
return FilterUtil::findInlineS... | php | protected function getRequireStability(Link $require)
{
$prettyConstraint = $require->getPrettyConstraint();
$stabilities = Package::$stabilities;
if (preg_match_all('/@('.implode('|', array_keys($stabilities)).')/', $prettyConstraint, $matches)) {
return FilterUtil::findInlineS... | [
"protected",
"function",
"getRequireStability",
"(",
"Link",
"$",
"require",
")",
"{",
"$",
"prettyConstraint",
"=",
"$",
"require",
"->",
"getPrettyConstraint",
"(",
")",
";",
"$",
"stabilities",
"=",
"Package",
"::",
"$",
"stabilities",
";",
"if",
"(",
"pr... | Get the minimum stability for the require dependency defined in root package.
@param Link $require The require link defined in root package
@return string The minimum stability | [
"Get",
"the",
"minimum",
"stability",
"for",
"the",
"require",
"dependency",
"defined",
"in",
"root",
"package",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/VcsPackageFilter.php#L244-L254 |
fxpio/composer-asset-plugin | Repository/VcsPackageFilter.php | VcsPackageFilter.initialize | protected function initialize()
{
$this->requires = array_merge(
$this->package->getRequires(),
$this->package->getDevRequires()
);
if (null !== $this->installedRepository
&& FilterUtil::checkConfigOption($this->config, 'optimize-with-installed-packag... | php | protected function initialize()
{
$this->requires = array_merge(
$this->package->getRequires(),
$this->package->getDevRequires()
);
if (null !== $this->installedRepository
&& FilterUtil::checkConfigOption($this->config, 'optimize-with-installed-packag... | [
"protected",
"function",
"initialize",
"(",
")",
"{",
"$",
"this",
"->",
"requires",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"package",
"->",
"getRequires",
"(",
")",
",",
"$",
"this",
"->",
"package",
"->",
"getDevRequires",
"(",
")",
")",
";",
"i... | Initialize. | [
"Initialize",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/VcsPackageFilter.php#L259-L270 |
fxpio/composer-asset-plugin | Repository/VcsPackageFilter.php | VcsPackageFilter.initInstalledPackages | private function initInstalledPackages()
{
/** @var PackageInterface $package */
foreach ($this->installedRepository->getPackages() as $package) {
$operator = $this->getFilterOperator($package);
/** @var Link $link */
$link = current($this->arrayLoader->parseLinks... | php | private function initInstalledPackages()
{
/** @var PackageInterface $package */
foreach ($this->installedRepository->getPackages() as $package) {
$operator = $this->getFilterOperator($package);
/** @var Link $link */
$link = current($this->arrayLoader->parseLinks... | [
"private",
"function",
"initInstalledPackages",
"(",
")",
"{",
"/** @var PackageInterface $package */",
"foreach",
"(",
"$",
"this",
"->",
"installedRepository",
"->",
"getPackages",
"(",
")",
"as",
"$",
"package",
")",
"{",
"$",
"operator",
"=",
"$",
"this",
"-... | Initialize the installed package. | [
"Initialize",
"the",
"installed",
"package",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/VcsPackageFilter.php#L275-L286 |
fxpio/composer-asset-plugin | Repository/VcsPackageFilter.php | VcsPackageFilter.includeRootConstraint | private function includeRootConstraint(PackageInterface $package, Link $link)
{
if (isset($this->requires[$package->getName()])) {
/** @var Link $rLink */
$rLink = $this->requires[$package->getName()];
$useConjunctive = FilterUtil::checkConfigOption($this->config, 'optimi... | php | private function includeRootConstraint(PackageInterface $package, Link $link)
{
if (isset($this->requires[$package->getName()])) {
/** @var Link $rLink */
$rLink = $this->requires[$package->getName()];
$useConjunctive = FilterUtil::checkConfigOption($this->config, 'optimi... | [
"private",
"function",
"includeRootConstraint",
"(",
"PackageInterface",
"$",
"package",
",",
"Link",
"$",
"link",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"requires",
"[",
"$",
"package",
"->",
"getName",
"(",
")",
"]",
")",
")",
"{",
"/*... | Include the constraint of root dependency version in the constraint
of installed package.
@param PackageInterface $package The installed package
@param Link $link The link contained installed constraint
@return Link The link with root and installed version constraint | [
"Include",
"the",
"constraint",
"of",
"root",
"dependency",
"version",
"in",
"the",
"constraint",
"of",
"installed",
"package",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/VcsPackageFilter.php#L297-L308 |
fxpio/composer-asset-plugin | Repository/AbstractAssetVcsRepository.php | AbstractAssetVcsRepository.getComposerPackageName | public function getComposerPackageName()
{
if (null === $this->packages) {
$this->initialize();
}
return $this->assetType->formatComposerName($this->packageName);
} | php | public function getComposerPackageName()
{
if (null === $this->packages) {
$this->initialize();
}
return $this->assetType->formatComposerName($this->packageName);
} | [
"public",
"function",
"getComposerPackageName",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"packages",
")",
"{",
"$",
"this",
"->",
"initialize",
"(",
")",
";",
"}",
"return",
"$",
"this",
"->",
"assetType",
"->",
"formatComposerName",
"... | Gets the package name of this repository.
@return string | [
"Gets",
"the",
"package",
"name",
"of",
"this",
"repository",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/AbstractAssetVcsRepository.php#L116-L123 |
fxpio/composer-asset-plugin | Repository/AbstractAssetVcsRepository.php | AbstractAssetVcsRepository.initLoader | protected function initLoader()
{
$this->versionParser = new VersionParser();
if (!$this->loader) {
$this->loader = new ArrayLoader($this->versionParser);
}
} | php | protected function initLoader()
{
$this->versionParser = new VersionParser();
if (!$this->loader) {
$this->loader = new ArrayLoader($this->versionParser);
}
} | [
"protected",
"function",
"initLoader",
"(",
")",
"{",
"$",
"this",
"->",
"versionParser",
"=",
"new",
"VersionParser",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"loader",
")",
"{",
"$",
"this",
"->",
"loader",
"=",
"new",
"ArrayLoader",
"(",
... | Initializes the version parser and loader. | [
"Initializes",
"the",
"version",
"parser",
"and",
"loader",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/AbstractAssetVcsRepository.php#L145-L152 |
fxpio/composer-asset-plugin | Repository/AbstractAssetVcsRepository.php | AbstractAssetVcsRepository.initRootIdentifier | protected function initRootIdentifier(VcsDriverInterface $driver)
{
try {
if ($driver->hasComposerFile($driver->getRootIdentifier())) {
$data = $driver->getComposerInformation($driver->getRootIdentifier());
$sc = new SemverConverter();
$this->rootP... | php | protected function initRootIdentifier(VcsDriverInterface $driver)
{
try {
if ($driver->hasComposerFile($driver->getRootIdentifier())) {
$data = $driver->getComposerInformation($driver->getRootIdentifier());
$sc = new SemverConverter();
$this->rootP... | [
"protected",
"function",
"initRootIdentifier",
"(",
"VcsDriverInterface",
"$",
"driver",
")",
"{",
"try",
"{",
"if",
"(",
"$",
"driver",
"->",
"hasComposerFile",
"(",
"$",
"driver",
"->",
"getRootIdentifier",
"(",
")",
")",
")",
"{",
"$",
"data",
"=",
"$",... | Initializes the root identifier.
@param VcsDriverInterface $driver | [
"Initializes",
"the",
"root",
"identifier",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/AbstractAssetVcsRepository.php#L159-L178 |
fxpio/composer-asset-plugin | Repository/AbstractAssetVcsRepository.php | AbstractAssetVcsRepository.createPackageName | protected function createPackageName()
{
if (null === $this->packageName) {
return $this->url;
}
return sprintf('%s/%s', $this->assetType->getComposerVendorName(), $this->packageName);
} | php | protected function createPackageName()
{
if (null === $this->packageName) {
return $this->url;
}
return sprintf('%s/%s', $this->assetType->getComposerVendorName(), $this->packageName);
} | [
"protected",
"function",
"createPackageName",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"packageName",
")",
"{",
"return",
"$",
"this",
"->",
"url",
";",
"}",
"return",
"sprintf",
"(",
"'%s/%s'",
",",
"$",
"this",
"->",
"assetType",
"... | Creates the package name with the composer prefix and the asset package name,
or only with the URL.
@return string The package name | [
"Creates",
"the",
"package",
"name",
"with",
"the",
"composer",
"prefix",
"and",
"the",
"asset",
"package",
"name",
"or",
"only",
"with",
"the",
"URL",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/AbstractAssetVcsRepository.php#L186-L193 |
fxpio/composer-asset-plugin | Repository/AbstractAssetVcsRepository.php | AbstractAssetVcsRepository.createLazyLoader | protected function createLazyLoader($type, $identifier, array $packageData, VcsDriverInterface $driver)
{
$lazyLoader = new LazyAssetPackageLoader($type, $identifier, $packageData);
$lazyLoader->setAssetType($this->assetType);
$lazyLoader->setLoader($this->loader);
$lazyLoader->setDr... | php | protected function createLazyLoader($type, $identifier, array $packageData, VcsDriverInterface $driver)
{
$lazyLoader = new LazyAssetPackageLoader($type, $identifier, $packageData);
$lazyLoader->setAssetType($this->assetType);
$lazyLoader->setLoader($this->loader);
$lazyLoader->setDr... | [
"protected",
"function",
"createLazyLoader",
"(",
"$",
"type",
",",
"$",
"identifier",
",",
"array",
"$",
"packageData",
",",
"VcsDriverInterface",
"$",
"driver",
")",
"{",
"$",
"lazyLoader",
"=",
"new",
"LazyAssetPackageLoader",
"(",
"$",
"type",
",",
"$",
... | Creates the lazy loader of package.
@param string $type
@param string $identifier
@param array $packageData
@param VcsDriverInterface $driver
@return LazyAssetPackageLoader | [
"Creates",
"the",
"lazy",
"loader",
"of",
"package",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/AbstractAssetVcsRepository.php#L222-L232 |
fxpio/composer-asset-plugin | Repository/AbstractAssetVcsRepository.php | AbstractAssetVcsRepository.preProcessAsset | protected function preProcessAsset(array $data)
{
$vcsRepos = array();
// keep the name of the main identifier for all packages
$data['name'] = $this->packageName ?: $data['name'];
$data = (array) $this->assetType->getPackageConverter()->convert($data, $vcsRepos);
$this->ass... | php | protected function preProcessAsset(array $data)
{
$vcsRepos = array();
// keep the name of the main identifier for all packages
$data['name'] = $this->packageName ?: $data['name'];
$data = (array) $this->assetType->getPackageConverter()->convert($data, $vcsRepos);
$this->ass... | [
"protected",
"function",
"preProcessAsset",
"(",
"array",
"$",
"data",
")",
"{",
"$",
"vcsRepos",
"=",
"array",
"(",
")",
";",
"// keep the name of the main identifier for all packages",
"$",
"data",
"[",
"'name'",
"]",
"=",
"$",
"this",
"->",
"packageName",
"?"... | Pre process the data of package before the conversion to Package instance.
@param array $data
@return array | [
"Pre",
"process",
"the",
"data",
"of",
"package",
"before",
"the",
"conversion",
"to",
"Package",
"instance",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/AbstractAssetVcsRepository.php#L241-L251 |
fxpio/composer-asset-plugin | Repository/AbstractAssetVcsRepository.php | AbstractAssetVcsRepository.overrideBranchAliasConfig | protected function overrideBranchAliasConfig(PackageInterface $package, $aliasNormalized, $branch)
{
if ($package instanceof Package && false === strpos('dev-', $aliasNormalized)) {
$extra = $package->getExtra();
$extra['branch-alias'] = array(
'dev-'.$branch => $this... | php | protected function overrideBranchAliasConfig(PackageInterface $package, $aliasNormalized, $branch)
{
if ($package instanceof Package && false === strpos('dev-', $aliasNormalized)) {
$extra = $package->getExtra();
$extra['branch-alias'] = array(
'dev-'.$branch => $this... | [
"protected",
"function",
"overrideBranchAliasConfig",
"(",
"PackageInterface",
"$",
"package",
",",
"$",
"aliasNormalized",
",",
"$",
"branch",
")",
"{",
"if",
"(",
"$",
"package",
"instanceof",
"Package",
"&&",
"false",
"===",
"strpos",
"(",
"'dev-'",
",",
"$... | Override the branch alias extra config of the current package.
@param PackageInterface $package The current package
@param string $aliasNormalized The alias version normalizes
@param string $branch The branch name
@return PackageInterface | [
"Override",
"the",
"branch",
"alias",
"extra",
"config",
"of",
"the",
"current",
"package",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/AbstractAssetVcsRepository.php#L262-L273 |
fxpio/composer-asset-plugin | Repository/AbstractAssetVcsRepository.php | AbstractAssetVcsRepository.addPackageAliases | protected function addPackageAliases(PackageInterface $package, $aliasNormalized)
{
$alias = new AliasPackage($package, $aliasNormalized, $this->rootPackageVersion);
$this->addPackage($alias);
if (false === strpos('dev-', $aliasNormalized)) {
$alias = new AliasPackage($package, ... | php | protected function addPackageAliases(PackageInterface $package, $aliasNormalized)
{
$alias = new AliasPackage($package, $aliasNormalized, $this->rootPackageVersion);
$this->addPackage($alias);
if (false === strpos('dev-', $aliasNormalized)) {
$alias = new AliasPackage($package, ... | [
"protected",
"function",
"addPackageAliases",
"(",
"PackageInterface",
"$",
"package",
",",
"$",
"aliasNormalized",
")",
"{",
"$",
"alias",
"=",
"new",
"AliasPackage",
"(",
"$",
"package",
",",
"$",
"aliasNormalized",
",",
"$",
"this",
"->",
"rootPackageVersion"... | Add the alias packages.
@param PackageInterface $package The current package
@param string $aliasNormalized The alias version normalizes
@return PackageInterface | [
"Add",
"the",
"alias",
"packages",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/AbstractAssetVcsRepository.php#L283-L294 |
fxpio/composer-asset-plugin | Repository/AbstractAssetVcsRepository.php | AbstractAssetVcsRepository.injectExtraConfig | private function injectExtraConfig(PackageInterface $package, array $extra)
{
$ref = new \ReflectionClass($package);
$met = $ref->getProperty('extra');
$met->setAccessible(true);
$met->setValue($package, $extra);
} | php | private function injectExtraConfig(PackageInterface $package, array $extra)
{
$ref = new \ReflectionClass($package);
$met = $ref->getProperty('extra');
$met->setAccessible(true);
$met->setValue($package, $extra);
} | [
"private",
"function",
"injectExtraConfig",
"(",
"PackageInterface",
"$",
"package",
",",
"array",
"$",
"extra",
")",
"{",
"$",
"ref",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"package",
")",
";",
"$",
"met",
"=",
"$",
"ref",
"->",
"getProperty",
"... | Inject the overriding extra config in the current package.
@param PackageInterface $package The package
@param array $extra The new extra config | [
"Inject",
"the",
"overriding",
"extra",
"config",
"in",
"the",
"current",
"package",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/AbstractAssetVcsRepository.php#L302-L308 |
fxpio/composer-asset-plugin | Repository/Vcs/BitbucketUtil.php | BitbucketUtil.getComposerInformation | public static function getComposerInformation(
Cache $cache,
array &$infoCache,
$scheme,
array $repoConfig,
$identifier,
$owner,
$repository,
VcsDriverInterface $driver,
$method = 'getContents'
) {
$infoCache[$identifier] = Util::readCa... | php | public static function getComposerInformation(
Cache $cache,
array &$infoCache,
$scheme,
array $repoConfig,
$identifier,
$owner,
$repository,
VcsDriverInterface $driver,
$method = 'getContents'
) {
$infoCache[$identifier] = Util::readCa... | [
"public",
"static",
"function",
"getComposerInformation",
"(",
"Cache",
"$",
"cache",
",",
"array",
"&",
"$",
"infoCache",
",",
"$",
"scheme",
",",
"array",
"$",
"repoConfig",
",",
"$",
"identifier",
",",
"$",
"owner",
",",
"$",
"repository",
",",
"VcsDriv... | Get composer information.
@param Cache $cache The cache
@param array $infoCache The code cache
@param string $scheme The scheme
@param array $repoConfig The repository config
@param string $identifier The identifier
@param string $own... | [
"Get",
"composer",
"information",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/Vcs/BitbucketUtil.php#L40-L62 |
fxpio/composer-asset-plugin | Repository/Vcs/BitbucketUtil.php | BitbucketUtil.getUrlResource | protected static function getUrlResource(
$scheme,
array $repoConfig,
$identifier,
$owner,
$repository,
VcsDriverInterface $driver
) {
if (false === strpos(\get_class($driver), 'Git')) {
return $scheme.'://bitbucket.org/'.$owner.'/'.$repository.'/r... | php | protected static function getUrlResource(
$scheme,
array $repoConfig,
$identifier,
$owner,
$repository,
VcsDriverInterface $driver
) {
if (false === strpos(\get_class($driver), 'Git')) {
return $scheme.'://bitbucket.org/'.$owner.'/'.$repository.'/r... | [
"protected",
"static",
"function",
"getUrlResource",
"(",
"$",
"scheme",
",",
"array",
"$",
"repoConfig",
",",
"$",
"identifier",
",",
"$",
"owner",
",",
"$",
"repository",
",",
"VcsDriverInterface",
"$",
"driver",
")",
"{",
"if",
"(",
"false",
"===",
"str... | Get the url of resource.
@param string $scheme The scheme
@param array $repoConfig The repository config
@param string $identifier The identifier
@param string $owner The owner of repository
@param string $repository The repository name
@param VcsDr... | [
"Get",
"the",
"url",
"of",
"resource",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/Vcs/BitbucketUtil.php#L76-L89 |
fxpio/composer-asset-plugin | Repository/Vcs/BitbucketUtil.php | BitbucketUtil.getComposerContent | protected static function getComposerContent(
$resource,
$identifier,
$scheme,
$owner,
$repository,
VcsDriverInterface $driver,
$method
) {
$composer = static::getComposerContentOfFile($resource, $driver, $method);
if (false !== $composer) {
... | php | protected static function getComposerContent(
$resource,
$identifier,
$scheme,
$owner,
$repository,
VcsDriverInterface $driver,
$method
) {
$composer = static::getComposerContentOfFile($resource, $driver, $method);
if (false !== $composer) {
... | [
"protected",
"static",
"function",
"getComposerContent",
"(",
"$",
"resource",
",",
"$",
"identifier",
",",
"$",
"scheme",
",",
"$",
"owner",
",",
"$",
"repository",
",",
"VcsDriverInterface",
"$",
"driver",
",",
"$",
"method",
")",
"{",
"$",
"composer",
"... | Gets content of composer information.
@param string $resource The resource
@param string $identifier The identifier
@param string $scheme The scheme
@param string $owner The owner
@param string $repository The repository
@param VcsDriverInterface $... | [
"Gets",
"content",
"of",
"composer",
"information",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/Vcs/BitbucketUtil.php#L104-L123 |
fxpio/composer-asset-plugin | Repository/Vcs/BitbucketUtil.php | BitbucketUtil.getComposerContentOfFile | protected static function getComposerContentOfFile($resource, VcsDriverInterface $driver, $method)
{
try {
$ref = new \ReflectionClass($driver);
$meth = $ref->getMethod($method);
$meth->setAccessible(true);
$composer = $meth->invoke($driver, $resource);
... | php | protected static function getComposerContentOfFile($resource, VcsDriverInterface $driver, $method)
{
try {
$ref = new \ReflectionClass($driver);
$meth = $ref->getMethod($method);
$meth->setAccessible(true);
$composer = $meth->invoke($driver, $resource);
... | [
"protected",
"static",
"function",
"getComposerContentOfFile",
"(",
"$",
"resource",
",",
"VcsDriverInterface",
"$",
"driver",
",",
"$",
"method",
")",
"{",
"try",
"{",
"$",
"ref",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"driver",
")",
";",
"$",
"me... | Get the parsed content of composer.
@param string $resource The resource
@param VcsDriverInterface $driver The vcs driver
@param string $method The method for get content
@return false|string | [
"Get",
"the",
"parsed",
"content",
"of",
"composer",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/Vcs/BitbucketUtil.php#L134-L152 |
fxpio/composer-asset-plugin | Repository/Vcs/BitbucketUtil.php | BitbucketUtil.formatComposerContent | protected static function formatComposerContent(array $composer, $identifier, $scheme, $owner, $repository, $driver, $method)
{
$resource = $scheme.'://api.bitbucket.org/1.0/repositories/'.$owner.'/'.$repository.'/changesets/'.$identifier;
return Util::addComposerTime($composer, 'timestamp', $resou... | php | protected static function formatComposerContent(array $composer, $identifier, $scheme, $owner, $repository, $driver, $method)
{
$resource = $scheme.'://api.bitbucket.org/1.0/repositories/'.$owner.'/'.$repository.'/changesets/'.$identifier;
return Util::addComposerTime($composer, 'timestamp', $resou... | [
"protected",
"static",
"function",
"formatComposerContent",
"(",
"array",
"$",
"composer",
",",
"$",
"identifier",
",",
"$",
"scheme",
",",
"$",
"owner",
",",
"$",
"repository",
",",
"$",
"driver",
",",
"$",
"method",
")",
"{",
"$",
"resource",
"=",
"$",... | Format composer content.
@param array $composer The composer
@param string $identifier The identifier
@param string $scheme The scheme
@param string $owner The owner
@param string $repository The repository
@param VcsDriverInterface $driver Th... | [
"Format",
"composer",
"content",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/Vcs/BitbucketUtil.php#L167-L172 |
fxpio/composer-asset-plugin | Converter/SemverRangeUtil.php | SemverRangeUtil.replaceSpecialRange | public static function replaceSpecialRange(SemverConverter $converter, $match)
{
$newMatch = $converter->convertVersion($match);
$newMatch = '>='.static::standardizeVersion(SemverUtil::replaceAlias($newMatch, '>')).',<';
$exp = static::getSplittedVersion($match);
$increase = false;
... | php | public static function replaceSpecialRange(SemverConverter $converter, $match)
{
$newMatch = $converter->convertVersion($match);
$newMatch = '>='.static::standardizeVersion(SemverUtil::replaceAlias($newMatch, '>')).',<';
$exp = static::getSplittedVersion($match);
$increase = false;
... | [
"public",
"static",
"function",
"replaceSpecialRange",
"(",
"SemverConverter",
"$",
"converter",
",",
"$",
"match",
")",
"{",
"$",
"newMatch",
"=",
"$",
"converter",
"->",
"convertVersion",
"(",
"$",
"match",
")",
";",
"$",
"newMatch",
"=",
"'>='",
".",
"s... | Replaces the special range "^".
@param SemverConverter $converter The semver converter
@param string $match The match version
@return string the new match version | [
"Replaces",
"the",
"special",
"range",
"^",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Converter/SemverRangeUtil.php#L29-L47 |
fxpio/composer-asset-plugin | Converter/SemverRangeUtil.php | SemverRangeUtil.analyzeSubVersion | protected static function analyzeSubVersion($i, array &$exp, &$increase)
{
$analyzed = false;
if ($increase) {
$exp[$i] = 0;
$analyzed = true;
}
if (0 === $i && (int) $exp[$i] > 0) {
$increase = true;
$exp[$i] = (int) $exp[$i] + 1;
... | php | protected static function analyzeSubVersion($i, array &$exp, &$increase)
{
$analyzed = false;
if ($increase) {
$exp[$i] = 0;
$analyzed = true;
}
if (0 === $i && (int) $exp[$i] > 0) {
$increase = true;
$exp[$i] = (int) $exp[$i] + 1;
... | [
"protected",
"static",
"function",
"analyzeSubVersion",
"(",
"$",
"i",
",",
"array",
"&",
"$",
"exp",
",",
"&",
"$",
"increase",
")",
"{",
"$",
"analyzed",
"=",
"false",
";",
"if",
"(",
"$",
"increase",
")",
"{",
"$",
"exp",
"[",
"$",
"i",
"]",
"... | Analyze the sub version of splitted version.
@param int $i The position in splitted version
@param array $exp The splitted version
@param bool $increase Check if the next sub version must be increased
@return bool | [
"Analyze",
"the",
"sub",
"version",
"of",
"splitted",
"version",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Converter/SemverRangeUtil.php#L58-L74 |
fxpio/composer-asset-plugin | Converter/SemverRangeUtil.php | SemverRangeUtil.increaseSubVersion | protected static function increaseSubVersion($i, array &$exp, &$increase)
{
$iNext = min(min($i + 1, 3), \count($exp) - 1);
if (($iNext !== $i && ($exp[$i] > 0 || (int) $exp[$iNext] > 9999998)) || $iNext === $i) {
$exp[$i] = (int) $exp[$i] + 1;
$increase = true;
}
... | php | protected static function increaseSubVersion($i, array &$exp, &$increase)
{
$iNext = min(min($i + 1, 3), \count($exp) - 1);
if (($iNext !== $i && ($exp[$i] > 0 || (int) $exp[$iNext] > 9999998)) || $iNext === $i) {
$exp[$i] = (int) $exp[$i] + 1;
$increase = true;
}
... | [
"protected",
"static",
"function",
"increaseSubVersion",
"(",
"$",
"i",
",",
"array",
"&",
"$",
"exp",
",",
"&",
"$",
"increase",
")",
"{",
"$",
"iNext",
"=",
"min",
"(",
"min",
"(",
"$",
"i",
"+",
"1",
",",
"3",
")",
",",
"\\",
"count",
"(",
"... | Increase the sub version of splitted version.
@param int $i The position in splitted version
@param array $exp The splitted version
@param bool $increase Check if the next sub version must be increased | [
"Increase",
"the",
"sub",
"version",
"of",
"splitted",
"version",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Converter/SemverRangeUtil.php#L83-L91 |
fxpio/composer-asset-plugin | Converter/SemverRangeUtil.php | SemverRangeUtil.standardizeVersion | protected static function standardizeVersion($version)
{
if (\is_string($version)) {
$version = explode('.', $version);
}
while (\count($version) < 3) {
$version[] = '0';
}
return implode('.', $version);
} | php | protected static function standardizeVersion($version)
{
if (\is_string($version)) {
$version = explode('.', $version);
}
while (\count($version) < 3) {
$version[] = '0';
}
return implode('.', $version);
} | [
"protected",
"static",
"function",
"standardizeVersion",
"(",
"$",
"version",
")",
"{",
"if",
"(",
"\\",
"is_string",
"(",
"$",
"version",
")",
")",
"{",
"$",
"version",
"=",
"explode",
"(",
"'.'",
",",
"$",
"version",
")",
";",
"}",
"while",
"(",
"\... | Standardize the version.
@param array|string $version The version or the splitted version
@return string | [
"Standardize",
"the",
"version",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Converter/SemverRangeUtil.php#L100-L111 |
fxpio/composer-asset-plugin | Converter/SemverRangeUtil.php | SemverRangeUtil.getSplittedVersion | protected static function getSplittedVersion($version)
{
$version = static::cleanExtraVersion($version);
$version = str_replace(array('*', 'x', 'X'), '9999999', $version);
$exp = explode('.', $version);
return $exp;
} | php | protected static function getSplittedVersion($version)
{
$version = static::cleanExtraVersion($version);
$version = str_replace(array('*', 'x', 'X'), '9999999', $version);
$exp = explode('.', $version);
return $exp;
} | [
"protected",
"static",
"function",
"getSplittedVersion",
"(",
"$",
"version",
")",
"{",
"$",
"version",
"=",
"static",
"::",
"cleanExtraVersion",
"(",
"$",
"version",
")",
";",
"$",
"version",
"=",
"str_replace",
"(",
"array",
"(",
"'*'",
",",
"'x'",
",",
... | Split the version.
@param string $version
@return array | [
"Split",
"the",
"version",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Converter/SemverRangeUtil.php#L120-L127 |
fxpio/composer-asset-plugin | Converter/SemverRangeUtil.php | SemverRangeUtil.cleanExtraVersion | protected static function cleanExtraVersion($version)
{
$pos = strpos($version, '-');
if (false !== $pos) {
$version = substr($version, 0, $pos);
}
return $version;
} | php | protected static function cleanExtraVersion($version)
{
$pos = strpos($version, '-');
if (false !== $pos) {
$version = substr($version, 0, $pos);
}
return $version;
} | [
"protected",
"static",
"function",
"cleanExtraVersion",
"(",
"$",
"version",
")",
"{",
"$",
"pos",
"=",
"strpos",
"(",
"$",
"version",
",",
"'-'",
")",
";",
"if",
"(",
"false",
"!==",
"$",
"pos",
")",
"{",
"$",
"version",
"=",
"substr",
"(",
"$",
"... | Remove the extra informations of the version (info after "-").
@param string $version
@return string | [
"Remove",
"the",
"extra",
"informations",
"of",
"the",
"version",
"(",
"info",
"after",
"-",
")",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Converter/SemverRangeUtil.php#L136-L145 |
fxpio/composer-asset-plugin | Assets.php | Assets.createType | public static function createType($type)
{
if (!isset(static::$typeClasses[$type])) {
throw new InvalidArgumentException('The asset type "'.$type.'" does not exist, only "'.implode('", "', static::getTypes()).'" are accepted');
}
$class = static::$typeClasses[$type];
re... | php | public static function createType($type)
{
if (!isset(static::$typeClasses[$type])) {
throw new InvalidArgumentException('The asset type "'.$type.'" does not exist, only "'.implode('", "', static::getTypes()).'" are accepted');
}
$class = static::$typeClasses[$type];
re... | [
"public",
"static",
"function",
"createType",
"(",
"$",
"type",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"static",
"::",
"$",
"typeClasses",
"[",
"$",
"type",
"]",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'The asset type \"'",
".",
... | Creates asset type.
@param string $type
@throws InvalidArgumentException When the asset type does not exist
@return AssetTypeInterface | [
"Creates",
"asset",
"type",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Assets.php#L85-L94 |
fxpio/composer-asset-plugin | Installer/BowerInstaller.php | BowerInstaller.addIgnorePatterns | protected function addIgnorePatterns(IgnoreManager $manager, PackageInterface $package)
{
$extra = $package->getExtra();
if (!empty($extra['bower-asset-ignore'])) {
$manager->doAddPattern('!bower.json');
foreach ($extra['bower-asset-ignore'] as $pattern) {
$... | php | protected function addIgnorePatterns(IgnoreManager $manager, PackageInterface $package)
{
$extra = $package->getExtra();
if (!empty($extra['bower-asset-ignore'])) {
$manager->doAddPattern('!bower.json');
foreach ($extra['bower-asset-ignore'] as $pattern) {
$... | [
"protected",
"function",
"addIgnorePatterns",
"(",
"IgnoreManager",
"$",
"manager",
",",
"PackageInterface",
"$",
"package",
")",
"{",
"$",
"extra",
"=",
"$",
"package",
"->",
"getExtra",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"extra",
"[",
"'... | {@inheritdoc} | [
"{"
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Installer/BowerInstaller.php#L27-L38 |
fxpio/composer-asset-plugin | Package/Loader/LazyAssetPackageLoader.php | LazyAssetPackageLoader.setIO | public function setIO(IOInterface $io)
{
$this->io = $io;
$this->verbose = $io->isVerbose();
} | php | public function setIO(IOInterface $io)
{
$this->io = $io;
$this->verbose = $io->isVerbose();
} | [
"public",
"function",
"setIO",
"(",
"IOInterface",
"$",
"io",
")",
"{",
"$",
"this",
"->",
"io",
"=",
"$",
"io",
";",
"$",
"this",
"->",
"verbose",
"=",
"$",
"io",
"->",
"isVerbose",
"(",
")",
";",
"}"
] | Sets the IO.
@param IOInterface $io | [
"Sets",
"the",
"IO",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Package/Loader/LazyAssetPackageLoader.php#L132-L136 |
fxpio/composer-asset-plugin | Package/Loader/LazyAssetPackageLoader.php | LazyAssetPackageLoader.load | public function load(LazyPackageInterface $package)
{
if (isset($this->cache[$package->getUniqueName()])) {
return $this->cache[$package->getUniqueName()];
}
$this->validateConfig();
$filename = $this->assetType->getFilename();
$msg = 'Reading '.$filename.' of <i... | php | public function load(LazyPackageInterface $package)
{
if (isset($this->cache[$package->getUniqueName()])) {
return $this->cache[$package->getUniqueName()];
}
$this->validateConfig();
$filename = $this->assetType->getFilename();
$msg = 'Reading '.$filename.' of <i... | [
"public",
"function",
"load",
"(",
"LazyPackageInterface",
"$",
"package",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"cache",
"[",
"$",
"package",
"->",
"getUniqueName",
"(",
")",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"cache",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Package/Loader/LazyAssetPackageLoader.php#L151-L174 |
fxpio/composer-asset-plugin | Package/Loader/LazyAssetPackageLoader.php | LazyAssetPackageLoader.loadRealPackage | protected function loadRealPackage(LazyPackageInterface $package)
{
$realPackage = false;
try {
$data = $this->driver->getComposerInformation($this->identifier);
$valid = \is_array($data);
$data = $this->preProcess($this->driver, $this->validateData($data), $this... | php | protected function loadRealPackage(LazyPackageInterface $package)
{
$realPackage = false;
try {
$data = $this->driver->getComposerInformation($this->identifier);
$valid = \is_array($data);
$data = $this->preProcess($this->driver, $this->validateData($data), $this... | [
"protected",
"function",
"loadRealPackage",
"(",
"LazyPackageInterface",
"$",
"package",
")",
"{",
"$",
"realPackage",
"=",
"false",
";",
"try",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"driver",
"->",
"getComposerInformation",
"(",
"$",
"this",
"->",
"iden... | Loads the real package.
@param LazyPackageInterface $package
@return CompletePackageInterface|false | [
"Loads",
"the",
"real",
"package",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Package/Loader/LazyAssetPackageLoader.php#L197-L221 |
fxpio/composer-asset-plugin | Package/Loader/LazyAssetPackageLoader.php | LazyAssetPackageLoader.preProcess | protected function preProcess(VcsDriverInterface $driver, array $data, $identifier)
{
$vcsRepos = array();
$data = array_merge($data, $this->packageData);
$data = $this->assetType->getPackageConverter()->convert($data, $vcsRepos);
$this->addRepositories($vcsRepos);
if (!iss... | php | protected function preProcess(VcsDriverInterface $driver, array $data, $identifier)
{
$vcsRepos = array();
$data = array_merge($data, $this->packageData);
$data = $this->assetType->getPackageConverter()->convert($data, $vcsRepos);
$this->addRepositories($vcsRepos);
if (!iss... | [
"protected",
"function",
"preProcess",
"(",
"VcsDriverInterface",
"$",
"driver",
",",
"array",
"$",
"data",
",",
"$",
"identifier",
")",
"{",
"$",
"vcsRepos",
"=",
"array",
"(",
")",
";",
"$",
"data",
"=",
"array_merge",
"(",
"$",
"data",
",",
"$",
"th... | Pre process the data of package before the conversion to Package instance.
@param VcsDriverInterface $driver
@param array $data
@param string $identifier
@return array | [
"Pre",
"process",
"the",
"data",
"of",
"package",
"before",
"the",
"conversion",
"to",
"Package",
"instance",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Package/Loader/LazyAssetPackageLoader.php#L252-L268 |
fxpio/composer-asset-plugin | Converter/SemverUtil.php | SemverUtil.convertDateVersion | public static function convertDateVersion($version)
{
if (preg_match('/^\d{7,}\./', $version)) {
$pos = strpos($version, '.');
$version = substr($version, 0, $pos).self::convertDateMinorVersion(substr($version, $pos + 1));
}
return $version;
} | php | public static function convertDateVersion($version)
{
if (preg_match('/^\d{7,}\./', $version)) {
$pos = strpos($version, '.');
$version = substr($version, 0, $pos).self::convertDateMinorVersion(substr($version, $pos + 1));
}
return $version;
} | [
"public",
"static",
"function",
"convertDateVersion",
"(",
"$",
"version",
")",
"{",
"if",
"(",
"preg_match",
"(",
"'/^\\d{7,}\\./'",
",",
"$",
"version",
")",
")",
"{",
"$",
"pos",
"=",
"strpos",
"(",
"$",
"version",
",",
"'.'",
")",
";",
"$",
"versio... | Converts the date or datetime version.
@param string $version The version
@return string | [
"Converts",
"the",
"date",
"or",
"datetime",
"version",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Converter/SemverUtil.php#L53-L61 |
fxpio/composer-asset-plugin | Converter/SemverUtil.php | SemverUtil.convertVersionMetadata | public static function convertVersionMetadata($version)
{
$version = str_replace(self::$cleanPatterns, '', $version);
if (preg_match_all(
self::createPattern('([a-zA-Z]+|(\-|\+)[a-zA-Z]+|(\-|\+)[0-9]+)'),
$version,
$matches,
PREG_OFFSET_CAPTURE
... | php | public static function convertVersionMetadata($version)
{
$version = str_replace(self::$cleanPatterns, '', $version);
if (preg_match_all(
self::createPattern('([a-zA-Z]+|(\-|\+)[a-zA-Z]+|(\-|\+)[0-9]+)'),
$version,
$matches,
PREG_OFFSET_CAPTURE
... | [
"public",
"static",
"function",
"convertVersionMetadata",
"(",
"$",
"version",
")",
"{",
"$",
"version",
"=",
"str_replace",
"(",
"self",
"::",
"$",
"cleanPatterns",
",",
"''",
",",
"$",
"version",
")",
";",
"if",
"(",
"preg_match_all",
"(",
"self",
"::",
... | Converts the version metadata.
@param string $version
@return string | [
"Converts",
"the",
"version",
"metadata",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Converter/SemverUtil.php#L70-L93 |
fxpio/composer-asset-plugin | Converter/SemverUtil.php | SemverUtil.createPattern | public static function createPattern($pattern)
{
$numVer = '([0-9]+|x|\*)';
$numVer2 = '('.$numVer.'\.'.$numVer.')';
$numVer3 = '('.$numVer.'\.'.$numVer.'\.'.$numVer.')';
return '/^'.'('.$numVer.'|'.$numVer2.'|'.$numVer3.')'.$pattern.'/';
} | php | public static function createPattern($pattern)
{
$numVer = '([0-9]+|x|\*)';
$numVer2 = '('.$numVer.'\.'.$numVer.')';
$numVer3 = '('.$numVer.'\.'.$numVer.'\.'.$numVer.')';
return '/^'.'('.$numVer.'|'.$numVer2.'|'.$numVer3.')'.$pattern.'/';
} | [
"public",
"static",
"function",
"createPattern",
"(",
"$",
"pattern",
")",
"{",
"$",
"numVer",
"=",
"'([0-9]+|x|\\*)'",
";",
"$",
"numVer2",
"=",
"'('",
".",
"$",
"numVer",
".",
"'\\.'",
".",
"$",
"numVer",
".",
"')'",
";",
"$",
"numVer3",
"=",
"'('",
... | Creates a pattern with the version prefix pattern.
@param string $pattern The pattern without '/'
@return string The full pattern with '/' | [
"Creates",
"a",
"pattern",
"with",
"the",
"version",
"prefix",
"pattern",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Converter/SemverUtil.php#L102-L109 |
fxpio/composer-asset-plugin | Converter/SemverUtil.php | SemverUtil.cleanVersion | protected static function cleanVersion($version, array $matches)
{
$end = substr($version, \strlen($matches[1][0][0]));
$version = $matches[1][0][0].'-';
$matches = array();
if (preg_match('/^(\-|\+)/', $end, $matches)) {
$end = substr($end, 1);
}
$match... | php | protected static function cleanVersion($version, array $matches)
{
$end = substr($version, \strlen($matches[1][0][0]));
$version = $matches[1][0][0].'-';
$matches = array();
if (preg_match('/^(\-|\+)/', $end, $matches)) {
$end = substr($end, 1);
}
$match... | [
"protected",
"static",
"function",
"cleanVersion",
"(",
"$",
"version",
",",
"array",
"$",
"matches",
")",
"{",
"$",
"end",
"=",
"substr",
"(",
"$",
"version",
",",
"\\",
"strlen",
"(",
"$",
"matches",
"[",
"1",
"]",
"[",
"0",
"]",
"[",
"0",
"]",
... | Clean the raw version.
@param string $version The version
@param array $matches The match of pattern asset version
@return array The list of $type, $version and $end | [
"Clean",
"the",
"raw",
"version",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Converter/SemverUtil.php#L135-L151 |
fxpio/composer-asset-plugin | Converter/SemverUtil.php | SemverUtil.matchVersion | protected static function matchVersion($version, $type)
{
$patchVersion = true;
if (\in_array($type, array('dev', 'snapshot'), true)) {
$type = 'dev';
$patchVersion = false;
} elseif ('a' === $type) {
$type = 'alpha';
} elseif (\in_array($type, ar... | php | protected static function matchVersion($version, $type)
{
$patchVersion = true;
if (\in_array($type, array('dev', 'snapshot'), true)) {
$type = 'dev';
$patchVersion = false;
} elseif ('a' === $type) {
$type = 'alpha';
} elseif (\in_array($type, ar... | [
"protected",
"static",
"function",
"matchVersion",
"(",
"$",
"version",
",",
"$",
"type",
")",
"{",
"$",
"patchVersion",
"=",
"true",
";",
"if",
"(",
"\\",
"in_array",
"(",
"$",
"type",
",",
"array",
"(",
"'dev'",
",",
"'snapshot'",
")",
",",
"true",
... | Match the version.
@param string $version
@param string $type
@return array The list of $version and $patchVersion | [
"Match",
"the",
"version",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Converter/SemverUtil.php#L161-L179 |
fxpio/composer-asset-plugin | Converter/SemverUtil.php | SemverUtil.convertDateMinorVersion | protected static function convertDateMinorVersion($minor)
{
$split = explode('.', $minor);
$minor = (int) $split[0];
$revision = isset($split[1]) ? (int) $split[1] : 0;
return '.'.sprintf('%03d', $minor).sprintf('%03d', $revision);
} | php | protected static function convertDateMinorVersion($minor)
{
$split = explode('.', $minor);
$minor = (int) $split[0];
$revision = isset($split[1]) ? (int) $split[1] : 0;
return '.'.sprintf('%03d', $minor).sprintf('%03d', $revision);
} | [
"protected",
"static",
"function",
"convertDateMinorVersion",
"(",
"$",
"minor",
")",
"{",
"$",
"split",
"=",
"explode",
"(",
"'.'",
",",
"$",
"minor",
")",
";",
"$",
"minor",
"=",
"(",
"int",
")",
"$",
"split",
"[",
"0",
"]",
";",
"$",
"revision",
... | Convert the minor version of date.
@param string $minor The minor version
@return string | [
"Convert",
"the",
"minor",
"version",
"of",
"date",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Converter/SemverUtil.php#L188-L195 |
fxpio/composer-asset-plugin | Repository/AssetRepositoryManager.php | AssetRepositoryManager.setPool | public function setPool(Pool $pool)
{
$this->pool = $pool;
foreach ($this->poolRepositories as $repo) {
$pool->addRepository($repo);
}
$this->poolRepositories = array();
return $this;
} | php | public function setPool(Pool $pool)
{
$this->pool = $pool;
foreach ($this->poolRepositories as $repo) {
$pool->addRepository($repo);
}
$this->poolRepositories = array();
return $this;
} | [
"public",
"function",
"setPool",
"(",
"Pool",
"$",
"pool",
")",
"{",
"$",
"this",
"->",
"pool",
"=",
"$",
"pool",
";",
"foreach",
"(",
"$",
"this",
"->",
"poolRepositories",
"as",
"$",
"repo",
")",
"{",
"$",
"pool",
"->",
"addRepository",
"(",
"$",
... | Set the pool.
@param Pool $pool The pool
@return self | [
"Set",
"the",
"pool",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/AssetRepositoryManager.php#L110-L121 |
fxpio/composer-asset-plugin | Repository/AssetRepositoryManager.php | AssetRepositoryManager.solveResolutions | public function solveResolutions(array $data)
{
return null !== $this->resolutionManager
? $this->resolutionManager->solveResolutions($data)
: $data;
} | php | public function solveResolutions(array $data)
{
return null !== $this->resolutionManager
? $this->resolutionManager->solveResolutions($data)
: $data;
} | [
"public",
"function",
"solveResolutions",
"(",
"array",
"$",
"data",
")",
"{",
"return",
"null",
"!==",
"$",
"this",
"->",
"resolutionManager",
"?",
"$",
"this",
"->",
"resolutionManager",
"->",
"solveResolutions",
"(",
"$",
"data",
")",
":",
"$",
"data",
... | Solve the dependency resolutions.
@param array $data
@return array | [
"Solve",
"the",
"dependency",
"resolutions",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/AssetRepositoryManager.php#L140-L145 |
fxpio/composer-asset-plugin | Repository/AssetRepositoryManager.php | AssetRepositoryManager.addRepositories | public function addRepositories(array $repositories)
{
foreach ($repositories as $index => $repo) {
$this->validateRepositories($index, $repo);
if ('package' === $repo['type']) {
$name = $repo['package']['name'];
} else {
$name = \is_int($... | php | public function addRepositories(array $repositories)
{
foreach ($repositories as $index => $repo) {
$this->validateRepositories($index, $repo);
if ('package' === $repo['type']) {
$name = $repo['package']['name'];
} else {
$name = \is_int($... | [
"public",
"function",
"addRepositories",
"(",
"array",
"$",
"repositories",
")",
"{",
"foreach",
"(",
"$",
"repositories",
"as",
"$",
"index",
"=>",
"$",
"repo",
")",
"{",
"$",
"this",
"->",
"validateRepositories",
"(",
"$",
"index",
",",
"$",
"repo",
")... | Adds asset vcs repositories.
@param array $repositories The repositories
@throws \UnexpectedValueException When config of repository is not an array
@throws \UnexpectedValueException When the config of repository has not a type defined
@throws \UnexpectedValueException When the config of repository has an invalid typ... | [
"Adds",
"asset",
"vcs",
"repositories",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/AssetRepositoryManager.php#L156-L176 |
fxpio/composer-asset-plugin | Repository/AssetRepositoryManager.php | AssetRepositoryManager.validateRepositories | protected function validateRepositories($index, $repo)
{
if (!\is_array($repo)) {
throw new \UnexpectedValueException('Repository '.$index.' ('.json_encode($repo).') should be an array, '.\gettype($repo).' given');
}
if (!isset($repo['type'])) {
throw new \UnexpectedV... | php | protected function validateRepositories($index, $repo)
{
if (!\is_array($repo)) {
throw new \UnexpectedValueException('Repository '.$index.' ('.json_encode($repo).') should be an array, '.\gettype($repo).' given');
}
if (!isset($repo['type'])) {
throw new \UnexpectedV... | [
"protected",
"function",
"validateRepositories",
"(",
"$",
"index",
",",
"$",
"repo",
")",
"{",
"if",
"(",
"!",
"\\",
"is_array",
"(",
"$",
"repo",
")",
")",
"{",
"throw",
"new",
"\\",
"UnexpectedValueException",
"(",
"'Repository '",
".",
"$",
"index",
... | Validates the config of repositories.
@param int|string $index The index
@param array|mixed $repo The config repo
@throws \UnexpectedValueException | [
"Validates",
"the",
"config",
"of",
"repositories",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/AssetRepositoryManager.php#L186-L197 |
fxpio/composer-asset-plugin | Repository/AssetRepositoryManager.php | AssetRepositoryManager.validatePackageRepositories | protected function validatePackageRepositories($index, $repo)
{
if ('package' !== $repo['type']) {
return;
}
if (!isset($repo['package'])) {
throw new \UnexpectedValueException('Repository '.$index.' ('.json_encode($repo).') must have a package definition"');
... | php | protected function validatePackageRepositories($index, $repo)
{
if ('package' !== $repo['type']) {
return;
}
if (!isset($repo['package'])) {
throw new \UnexpectedValueException('Repository '.$index.' ('.json_encode($repo).') must have a package definition"');
... | [
"protected",
"function",
"validatePackageRepositories",
"(",
"$",
"index",
",",
"$",
"repo",
")",
"{",
"if",
"(",
"'package'",
"!==",
"$",
"repo",
"[",
"'type'",
"]",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"isset",
"(",
"$",
"repo",
"[",
"'pac... | Validates the config of package repositories.
@param int|string $index The index
@param array|mixed $repo The config repo
@throws \UnexpectedValueException | [
"Validates",
"the",
"config",
"of",
"package",
"repositories",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/AssetRepositoryManager.php#L207-L222 |
fxpio/composer-asset-plugin | Repository/AssetRepositoryManager.php | AssetRepositoryManager.validateVcsRepositories | protected function validateVcsRepositories($index, $repo)
{
if ('package' === $repo['type']) {
return;
}
if (false === strpos($repo['type'], '-')) {
throw new \UnexpectedValueException('Repository '.$index.' ('.json_encode($repo).') must have a type defined in this w... | php | protected function validateVcsRepositories($index, $repo)
{
if ('package' === $repo['type']) {
return;
}
if (false === strpos($repo['type'], '-')) {
throw new \UnexpectedValueException('Repository '.$index.' ('.json_encode($repo).') must have a type defined in this w... | [
"protected",
"function",
"validateVcsRepositories",
"(",
"$",
"index",
",",
"$",
"repo",
")",
"{",
"if",
"(",
"'package'",
"===",
"$",
"repo",
"[",
"'type'",
"]",
")",
"{",
"return",
";",
"}",
"if",
"(",
"false",
"===",
"strpos",
"(",
"$",
"repo",
"[... | Validates the config of vcs repositories.
@param int|string $index The index
@param array|mixed $repo The config repo
@throws \UnexpectedValueException | [
"Validates",
"the",
"config",
"of",
"vcs",
"repositories",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/AssetRepositoryManager.php#L232-L244 |
fxpio/composer-asset-plugin | Converter/NpmPackageConverter.php | NpmPackageConverter.getMapKeys | protected function getMapKeys()
{
$assetType = $this->assetType;
return array(
'name' => array('name', function ($value) use ($assetType) {
return $assetType->formatComposerName(NpmPackageUtil::convertName($value));
}),
'type' => array('type', fun... | php | protected function getMapKeys()
{
$assetType = $this->assetType;
return array(
'name' => array('name', function ($value) use ($assetType) {
return $assetType->formatComposerName(NpmPackageUtil::convertName($value));
}),
'type' => array('type', fun... | [
"protected",
"function",
"getMapKeys",
"(",
")",
"{",
"$",
"assetType",
"=",
"$",
"this",
"->",
"assetType",
";",
"return",
"array",
"(",
"'name'",
"=>",
"array",
"(",
"'name'",
",",
"function",
"(",
"$",
"value",
")",
"use",
"(",
"$",
"assetType",
")"... | {@inheritdoc} | [
"{"
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Converter/NpmPackageConverter.php#L24-L59 |
fxpio/composer-asset-plugin | Converter/NpmPackageConverter.php | NpmPackageConverter.convertDependency | protected function convertDependency($dependency, $version, array &$vcsRepos, array $composer)
{
$dependency = NpmPackageUtil::convertName($dependency);
return parent::convertDependency($dependency, $version, $vcsRepos, $composer);
} | php | protected function convertDependency($dependency, $version, array &$vcsRepos, array $composer)
{
$dependency = NpmPackageUtil::convertName($dependency);
return parent::convertDependency($dependency, $version, $vcsRepos, $composer);
} | [
"protected",
"function",
"convertDependency",
"(",
"$",
"dependency",
",",
"$",
"version",
",",
"array",
"&",
"$",
"vcsRepos",
",",
"array",
"$",
"composer",
")",
"{",
"$",
"dependency",
"=",
"NpmPackageUtil",
"::",
"convertName",
"(",
"$",
"dependency",
")"... | {@inheritdoc} | [
"{"
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Converter/NpmPackageConverter.php#L90-L95 |
fxpio/composer-asset-plugin | Repository/Vcs/Util.php | Util.readCache | public static function readCache(array $cacheCode, Cache $cache, $type, $identifier, $force = false)
{
if (\array_key_exists($identifier, $cacheCode)) {
return $cacheCode[$identifier];
}
$data = null;
if (self::isSha($identifier) || $force) {
$res = $cache->r... | php | public static function readCache(array $cacheCode, Cache $cache, $type, $identifier, $force = false)
{
if (\array_key_exists($identifier, $cacheCode)) {
return $cacheCode[$identifier];
}
$data = null;
if (self::isSha($identifier) || $force) {
$res = $cache->r... | [
"public",
"static",
"function",
"readCache",
"(",
"array",
"$",
"cacheCode",
",",
"Cache",
"$",
"cache",
",",
"$",
"type",
",",
"$",
"identifier",
",",
"$",
"force",
"=",
"false",
")",
"{",
"if",
"(",
"\\",
"array_key_exists",
"(",
"$",
"identifier",
"... | @param array $cacheCode The cache code
@param Cache $cache The cache filesystem
@param string $type The asset type
@param string $identifier The identifier
@param bool $force Force the read
@return null|array | [
"@param",
"array",
"$cacheCode",
"The",
"cache",
"code",
"@param",
"Cache",
"$cache",
"The",
"cache",
"filesystem",
"@param",
"string",
"$type",
"The",
"asset",
"type",
"@param",
"string",
"$identifier",
"The",
"identifier",
"@param",
"bool",
"$force",
"Force",
... | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/Vcs/Util.php#L46-L62 |
fxpio/composer-asset-plugin | Repository/Vcs/Util.php | Util.addComposerTime | public static function addComposerTime(array $composer, $resourceKey, $resource, VcsDriverInterface $driver, $method = 'getContents')
{
if (!isset($composer['time'])) {
$ref = new \ReflectionClass($driver);
$meth = $ref->getMethod($method);
$meth->setAccessible(true);
... | php | public static function addComposerTime(array $composer, $resourceKey, $resource, VcsDriverInterface $driver, $method = 'getContents')
{
if (!isset($composer['time'])) {
$ref = new \ReflectionClass($driver);
$meth = $ref->getMethod($method);
$meth->setAccessible(true);
... | [
"public",
"static",
"function",
"addComposerTime",
"(",
"array",
"$",
"composer",
",",
"$",
"resourceKey",
",",
"$",
"resource",
",",
"VcsDriverInterface",
"$",
"driver",
",",
"$",
"method",
"=",
"'getContents'",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$"... | Add time in composer.
@param array $composer The composer
@param string $resourceKey The composer key
@param string $resource The resource url
@param VcsDriverInterface $driver The vcs driver
@param string $method The method for get content
@return arra... | [
"Add",
"time",
"in",
"composer",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/Vcs/Util.php#L89-L108 |
fxpio/composer-asset-plugin | Repository/Vcs/AbstractGitHubDriver.php | AbstractGitHubDriver.getBranches | public function getBranches()
{
if ($this->gitDriver) {
return $this->gitDriver->getBranches();
}
if (null === $this->branches) {
$this->branches = array();
$resource = $this->getApiUrl().'/repos/'.$this->owner.'/'.$this->repository.'/git/refs/heads?per_p... | php | public function getBranches()
{
if ($this->gitDriver) {
return $this->gitDriver->getBranches();
}
if (null === $this->branches) {
$this->branches = array();
$resource = $this->getApiUrl().'/repos/'.$this->owner.'/'.$this->repository.'/git/refs/heads?per_p... | [
"public",
"function",
"getBranches",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"gitDriver",
")",
"{",
"return",
"$",
"this",
"->",
"gitDriver",
"->",
"getBranches",
"(",
")",
";",
"}",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"branches",
")",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/Vcs/AbstractGitHubDriver.php#L49-L64 |
fxpio/composer-asset-plugin | Repository/Vcs/AbstractGitHubDriver.php | AbstractGitHubDriver.getNoApiOption | protected function getNoApiOption()
{
$packageName = $this->repoConfig['package-name'];
$opts = RepoUtil::getArrayValue($this->repoConfig, 'vcs-driver-options', array());
$noApiOpt = RepoUtil::getArrayValue($opts, 'github-no-api', array());
$defaultValue = false;
if (\is_boo... | php | protected function getNoApiOption()
{
$packageName = $this->repoConfig['package-name'];
$opts = RepoUtil::getArrayValue($this->repoConfig, 'vcs-driver-options', array());
$noApiOpt = RepoUtil::getArrayValue($opts, 'github-no-api', array());
$defaultValue = false;
if (\is_boo... | [
"protected",
"function",
"getNoApiOption",
"(",
")",
"{",
"$",
"packageName",
"=",
"$",
"this",
"->",
"repoConfig",
"[",
"'package-name'",
"]",
";",
"$",
"opts",
"=",
"RepoUtil",
"::",
"getArrayValue",
"(",
"$",
"this",
"->",
"repoConfig",
",",
"'vcs-driver-... | Get the no-api repository option.
@return bool | [
"Get",
"the",
"no",
"-",
"api",
"repository",
"option",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/Vcs/AbstractGitHubDriver.php#L71-L87 |
fxpio/composer-asset-plugin | Repository/Vcs/AbstractGitHubDriver.php | AbstractGitHubDriver.getContents | protected function getContents($url, $fetchingRepoData = false)
{
$url = $this->getValidContentUrl($url);
if (null !== $this->redirectApi) {
return parent::getContents($url, $fetchingRepoData);
}
try {
$contents = $this->getRemoteContents($url);
... | php | protected function getContents($url, $fetchingRepoData = false)
{
$url = $this->getValidContentUrl($url);
if (null !== $this->redirectApi) {
return parent::getContents($url, $fetchingRepoData);
}
try {
$contents = $this->getRemoteContents($url);
... | [
"protected",
"function",
"getContents",
"(",
"$",
"url",
",",
"$",
"fetchingRepoData",
"=",
"false",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"getValidContentUrl",
"(",
"$",
"url",
")",
";",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"redirectAp... | Get the remote content.
@param string $url The URL of content
@param bool $fetchingRepoData Fetching the repo data or not
@return mixed The result | [
"Get",
"the",
"remote",
"content",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/Vcs/AbstractGitHubDriver.php#L97-L117 |
fxpio/composer-asset-plugin | Repository/Vcs/AbstractGitHubDriver.php | AbstractGitHubDriver.getValidContentUrl | protected function getValidContentUrl($url)
{
if (null === $this->redirectApi && false !== $redirectApi = $this->cache->read('redirect-api')) {
$this->redirectApi = $redirectApi;
}
if (\is_string($this->redirectApi) && 0 === strpos($url, $this->getRepositoryApiUrl())) {
... | php | protected function getValidContentUrl($url)
{
if (null === $this->redirectApi && false !== $redirectApi = $this->cache->read('redirect-api')) {
$this->redirectApi = $redirectApi;
}
if (\is_string($this->redirectApi) && 0 === strpos($url, $this->getRepositoryApiUrl())) {
... | [
"protected",
"function",
"getValidContentUrl",
"(",
"$",
"url",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"redirectApi",
"&&",
"false",
"!==",
"$",
"redirectApi",
"=",
"$",
"this",
"->",
"cache",
"->",
"read",
"(",
"'redirect-api'",
")",
")"... | @param string $url The url
@return string The url redirected | [
"@param",
"string",
"$url",
"The",
"url"
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/Vcs/AbstractGitHubDriver.php#L124-L135 |
fxpio/composer-asset-plugin | Repository/Vcs/AbstractGitHubDriver.php | AbstractGitHubDriver.hasRedirectUrl | protected function hasRedirectUrl($url)
{
if (null === $this->redirectApi && 0 === strpos($url, $this->getRepositoryApiUrl())) {
$this->redirectApi = $this->getNewRepositoryUrl();
if (\is_string($this->redirectApi)) {
$this->cache->write('redirect-api', $this->redire... | php | protected function hasRedirectUrl($url)
{
if (null === $this->redirectApi && 0 === strpos($url, $this->getRepositoryApiUrl())) {
$this->redirectApi = $this->getNewRepositoryUrl();
if (\is_string($this->redirectApi)) {
$this->cache->write('redirect-api', $this->redire... | [
"protected",
"function",
"hasRedirectUrl",
"(",
"$",
"url",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"redirectApi",
"&&",
"0",
"===",
"strpos",
"(",
"$",
"url",
",",
"$",
"this",
"->",
"getRepositoryApiUrl",
"(",
")",
")",
")",
"{",
"$"... | Check if the driver must find the new url.
@param string $url The url
@return bool | [
"Check",
"if",
"the",
"driver",
"must",
"find",
"the",
"new",
"url",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/Vcs/AbstractGitHubDriver.php#L144-L155 |
fxpio/composer-asset-plugin | Repository/Vcs/AbstractGitHubDriver.php | AbstractGitHubDriver.getNewRepositoryUrl | protected function getNewRepositoryUrl()
{
try {
$this->getRemoteContents($this->getRepositoryUrl());
$headers = $this->remoteFilesystem->getLastHeaders();
if (!empty($headers[0]) && preg_match('{^HTTP/\S+ (30[1278])}i', $headers[0], $match)) {
array_shif... | php | protected function getNewRepositoryUrl()
{
try {
$this->getRemoteContents($this->getRepositoryUrl());
$headers = $this->remoteFilesystem->getLastHeaders();
if (!empty($headers[0]) && preg_match('{^HTTP/\S+ (30[1278])}i', $headers[0], $match)) {
array_shif... | [
"protected",
"function",
"getNewRepositoryUrl",
"(",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"getRemoteContents",
"(",
"$",
"this",
"->",
"getRepositoryUrl",
"(",
")",
")",
";",
"$",
"headers",
"=",
"$",
"this",
"->",
"remoteFilesystem",
"->",
"getLastHeade... | Get the new url of repository.
@return false|string The new url or false if there is not a new url | [
"Get",
"the",
"new",
"url",
"of",
"repository",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/Vcs/AbstractGitHubDriver.php#L162-L178 |
fxpio/composer-asset-plugin | Repository/Vcs/AbstractGitHubDriver.php | AbstractGitHubDriver.findNewLocationInHeader | protected function findNewLocationInHeader(array $headers)
{
$url = false;
foreach ($headers as $header) {
if (0 === strpos($header, 'Location:')) {
$newUrl = trim(substr($header, 9));
preg_match('#^(?:(?:https?|git)://([^/]+)/|git@([^:]+):)([^/]+)/(.+?)(... | php | protected function findNewLocationInHeader(array $headers)
{
$url = false;
foreach ($headers as $header) {
if (0 === strpos($header, 'Location:')) {
$newUrl = trim(substr($header, 9));
preg_match('#^(?:(?:https?|git)://([^/]+)/|git@([^:]+):)([^/]+)/(.+?)(... | [
"protected",
"function",
"findNewLocationInHeader",
"(",
"array",
"$",
"headers",
")",
"{",
"$",
"url",
"=",
"false",
";",
"foreach",
"(",
"$",
"headers",
"as",
"$",
"header",
")",
"{",
"if",
"(",
"0",
"===",
"strpos",
"(",
"$",
"header",
",",
"'Locati... | Find the new url api in the header.
@param array $headers The http header
@return false|string | [
"Find",
"the",
"new",
"url",
"api",
"in",
"the",
"header",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/Vcs/AbstractGitHubDriver.php#L187-L206 |
fxpio/composer-asset-plugin | Repository/Vcs/AbstractGitHubDriver.php | AbstractGitHubDriver.getRepositoryApiUrl | protected function getRepositoryApiUrl($owner = null, $repository = null)
{
$owner = null !== $owner ? $owner : $this->owner;
$repository = null !== $repository ? $repository : $this->repository;
return $this->getApiUrl().'/repos/'.$owner.'/'.$repository;
} | php | protected function getRepositoryApiUrl($owner = null, $repository = null)
{
$owner = null !== $owner ? $owner : $this->owner;
$repository = null !== $repository ? $repository : $this->repository;
return $this->getApiUrl().'/repos/'.$owner.'/'.$repository;
} | [
"protected",
"function",
"getRepositoryApiUrl",
"(",
"$",
"owner",
"=",
"null",
",",
"$",
"repository",
"=",
"null",
")",
"{",
"$",
"owner",
"=",
"null",
"!==",
"$",
"owner",
"?",
"$",
"owner",
":",
"$",
"this",
"->",
"owner",
";",
"$",
"repository",
... | Get the url API of the repository.
@param string $owner
@param string $repository
@return string | [
"Get",
"the",
"url",
"API",
"of",
"the",
"repository",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/Vcs/AbstractGitHubDriver.php#L216-L222 |
fxpio/composer-asset-plugin | Repository/Vcs/AbstractGitHubDriver.php | AbstractGitHubDriver.doAddBranches | protected function doAddBranches($resource, array $branchBlacklist)
{
do {
$branchData = JsonFile::parseJson((string) $this->getContents($resource), $resource);
foreach ($branchData as $branch) {
$name = substr($branch['ref'], 11);
if (!\in_array($na... | php | protected function doAddBranches($resource, array $branchBlacklist)
{
do {
$branchData = JsonFile::parseJson((string) $this->getContents($resource), $resource);
foreach ($branchData as $branch) {
$name = substr($branch['ref'], 11);
if (!\in_array($na... | [
"protected",
"function",
"doAddBranches",
"(",
"$",
"resource",
",",
"array",
"$",
"branchBlacklist",
")",
"{",
"do",
"{",
"$",
"branchData",
"=",
"JsonFile",
"::",
"parseJson",
"(",
"(",
"string",
")",
"$",
"this",
"->",
"getContents",
"(",
"$",
"resource... | Push the list of all branch.
@param string $resource
@param array $branchBlacklist | [
"Push",
"the",
"list",
"of",
"all",
"branch",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/Vcs/AbstractGitHubDriver.php#L242-L257 |
fxpio/composer-asset-plugin | Converter/SemverConverter.php | SemverConverter.convertVersion | public function convertVersion($version)
{
if (\in_array($version, array(null, '', 'latest'), true)) {
return ('latest' === $version ? 'default || ' : '').'*';
}
$version = str_replace('–', '-', $version);
$prefix = preg_match('/^[a-z]/', $version) && 0 !== strpos($versi... | php | public function convertVersion($version)
{
if (\in_array($version, array(null, '', 'latest'), true)) {
return ('latest' === $version ? 'default || ' : '').'*';
}
$version = str_replace('–', '-', $version);
$prefix = preg_match('/^[a-z]/', $version) && 0 !== strpos($versi... | [
"public",
"function",
"convertVersion",
"(",
"$",
"version",
")",
"{",
"if",
"(",
"\\",
"in_array",
"(",
"$",
"version",
",",
"array",
"(",
"null",
",",
"''",
",",
"'latest'",
")",
",",
"true",
")",
")",
"{",
"return",
"(",
"'latest'",
"===",
"$",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Converter/SemverConverter.php#L24-L37 |
fxpio/composer-asset-plugin | Converter/SemverConverter.php | SemverConverter.convertRange | public function convertRange($range)
{
$range = $this->cleanRange(strtolower($range));
return $this->matchRange($range);
} | php | public function convertRange($range)
{
$range = $this->cleanRange(strtolower($range));
return $this->matchRange($range);
} | [
"public",
"function",
"convertRange",
"(",
"$",
"range",
")",
"{",
"$",
"range",
"=",
"$",
"this",
"->",
"cleanRange",
"(",
"strtolower",
"(",
"$",
"range",
")",
")",
";",
"return",
"$",
"this",
"->",
"matchRange",
"(",
"$",
"range",
")",
";",
"}"
] | {@inheritdoc} | [
"{"
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Converter/SemverConverter.php#L42-L47 |
fxpio/composer-asset-plugin | Converter/SemverConverter.php | SemverConverter.cleanRange | protected function cleanRange($range)
{
foreach (array('<', '>', '=', '~', '^', '||', '&&') as $character) {
$range = str_replace($character.' ', $character, $range);
}
$range = preg_replace('/(?:[vV])(\d+)/', '${1}', $range);
$range = str_replace(' ||', '||', $range);
... | php | protected function cleanRange($range)
{
foreach (array('<', '>', '=', '~', '^', '||', '&&') as $character) {
$range = str_replace($character.' ', $character, $range);
}
$range = preg_replace('/(?:[vV])(\d+)/', '${1}', $range);
$range = str_replace(' ||', '||', $range);
... | [
"protected",
"function",
"cleanRange",
"(",
"$",
"range",
")",
"{",
"foreach",
"(",
"array",
"(",
"'<'",
",",
"'>'",
",",
"'='",
",",
"'~'",
",",
"'^'",
",",
"'||'",
",",
"'&&'",
")",
"as",
"$",
"character",
")",
"{",
"$",
"range",
"=",
"str_replac... | Clean the raw range.
@param string $range
@return string | [
"Clean",
"the",
"raw",
"range",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Converter/SemverConverter.php#L56-L66 |
fxpio/composer-asset-plugin | Converter/SemverConverter.php | SemverConverter.matchRange | protected function matchRange($range)
{
$pattern = '/(\ -\ )|(<)|(>)|(=)|(\|\|)|(\ )|(,)|(\~)|(\^)/';
$matches = preg_split($pattern, $range, -1, PREG_SPLIT_DELIM_CAPTURE);
$special = null;
$replace = null;
$first = true;
foreach ($matches as $i => $match) {
... | php | protected function matchRange($range)
{
$pattern = '/(\ -\ )|(<)|(>)|(=)|(\|\|)|(\ )|(,)|(\~)|(\^)/';
$matches = preg_split($pattern, $range, -1, PREG_SPLIT_DELIM_CAPTURE);
$special = null;
$replace = null;
$first = true;
foreach ($matches as $i => $match) {
... | [
"protected",
"function",
"matchRange",
"(",
"$",
"range",
")",
"{",
"$",
"pattern",
"=",
"'/(\\ -\\ )|(<)|(>)|(=)|(\\|\\|)|(\\ )|(,)|(\\~)|(\\^)/'",
";",
"$",
"matches",
"=",
"preg_split",
"(",
"$",
"pattern",
",",
"$",
"range",
",",
"-",
"1",
",",
"PREG_SPLIT_D... | Match the range.
@param string $range The range cleaned
@return string The range | [
"Match",
"the",
"range",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Converter/SemverConverter.php#L75-L93 |
fxpio/composer-asset-plugin | Converter/SemverConverter.php | SemverConverter.matchRangeToken | protected function matchRangeToken($i, $match, array &$matches, &$special, &$replace)
{
if (' - ' === $match) {
$matches[$i - 1] = '>='.str_replace(array('*', 'x', 'X'), '0', $matches[$i - 1]);
if (false !== strpos($matches[$i + 1], '.') && false === strpos($matches[$i + 1], '*')
... | php | protected function matchRangeToken($i, $match, array &$matches, &$special, &$replace)
{
if (' - ' === $match) {
$matches[$i - 1] = '>='.str_replace(array('*', 'x', 'X'), '0', $matches[$i - 1]);
if (false !== strpos($matches[$i + 1], '.') && false === strpos($matches[$i + 1], '*')
... | [
"protected",
"function",
"matchRangeToken",
"(",
"$",
"i",
",",
"$",
"match",
",",
"array",
"&",
"$",
"matches",
",",
"&",
"$",
"special",
",",
"&",
"$",
"replace",
")",
"{",
"if",
"(",
"' - '",
"===",
"$",
"match",
")",
"{",
"$",
"matches",
"[",
... | Converts the token of the matched range.
@param int $i
@param string $match
@param array $matches
@param null|string $special
@param null|string $replace | [
"Converts",
"the",
"token",
"of",
"the",
"matched",
"range",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Converter/SemverConverter.php#L104-L119 |
fxpio/composer-asset-plugin | Converter/SemverConverter.php | SemverConverter.matchRangeTokenStep2 | protected function matchRangeTokenStep2($i, $match, array &$matches, &$special, &$replace)
{
if (\in_array($match, array('', '<', '>', '=', ','), true)) {
$replace = \in_array($match, array('<', '>'), true) ? $match : $replace;
$matches[$i] = '~' === $special && \in_array($replace, a... | php | protected function matchRangeTokenStep2($i, $match, array &$matches, &$special, &$replace)
{
if (\in_array($match, array('', '<', '>', '=', ','), true)) {
$replace = \in_array($match, array('<', '>'), true) ? $match : $replace;
$matches[$i] = '~' === $special && \in_array($replace, a... | [
"protected",
"function",
"matchRangeTokenStep2",
"(",
"$",
"i",
",",
"$",
"match",
",",
"array",
"&",
"$",
"matches",
",",
"&",
"$",
"special",
",",
"&",
"$",
"replace",
")",
"{",
"if",
"(",
"\\",
"in_array",
"(",
"$",
"match",
",",
"array",
"(",
"... | Step2: Converts the token of the matched range.
@param int $i
@param string $match
@param array $matches
@param null|string $special
@param null|string $replace | [
"Step2",
":",
"Converts",
"the",
"token",
"of",
"the",
"matched",
"range",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Converter/SemverConverter.php#L130-L143 |
fxpio/composer-asset-plugin | Converter/SemverConverter.php | SemverConverter.matchRangeTokenStep3 | protected function matchRangeTokenStep3($i, $match, array &$matches, &$special, &$replace)
{
if (' ' === $match) {
$matches[$i] = ',';
} elseif ('||' === $match) {
$matches[$i] = '|';
} elseif (\in_array($special, array('^'), true)) {
$matches[$i] = Semver... | php | protected function matchRangeTokenStep3($i, $match, array &$matches, &$special, &$replace)
{
if (' ' === $match) {
$matches[$i] = ',';
} elseif ('||' === $match) {
$matches[$i] = '|';
} elseif (\in_array($special, array('^'), true)) {
$matches[$i] = Semver... | [
"protected",
"function",
"matchRangeTokenStep3",
"(",
"$",
"i",
",",
"$",
"match",
",",
"array",
"&",
"$",
"matches",
",",
"&",
"$",
"special",
",",
"&",
"$",
"replace",
")",
"{",
"if",
"(",
"' '",
"===",
"$",
"match",
")",
"{",
"$",
"matches",
"["... | Step3: Converts the token of the matched range.
@param int $i
@param string $match
@param array $matches
@param null|string $special
@param null|string $replace | [
"Step3",
":",
"Converts",
"the",
"token",
"of",
"the",
"matched",
"range",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Converter/SemverConverter.php#L154-L166 |
fxpio/composer-asset-plugin | Converter/SemverConverter.php | SemverConverter.matchRangeTokenStep4 | protected function matchRangeTokenStep4($i, $match, array &$matches, &$special, &$replace)
{
if (',<~' === $special) {
// Version range contains x in last place.
$match .= (false === strpos($match, '.') ? '.x' : '');
$version = explode('.', $match);
$change = ... | php | protected function matchRangeTokenStep4($i, $match, array &$matches, &$special, &$replace)
{
if (',<~' === $special) {
// Version range contains x in last place.
$match .= (false === strpos($match, '.') ? '.x' : '');
$version = explode('.', $match);
$change = ... | [
"protected",
"function",
"matchRangeTokenStep4",
"(",
"$",
"i",
",",
"$",
"match",
",",
"array",
"&",
"$",
"matches",
",",
"&",
"$",
"special",
",",
"&",
"$",
"replace",
")",
"{",
"if",
"(",
"',<~'",
"===",
"$",
"special",
")",
"{",
"// Version range c... | Step4: Converts the token of the matched range.
@param int $i
@param string $match
@param array $matches
@param null|string $special
@param null|string $replace | [
"Step4",
":",
"Converts",
"the",
"token",
"of",
"the",
"matched",
"range",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Converter/SemverConverter.php#L177-L195 |
fxpio/composer-asset-plugin | Converter/SemverConverter.php | SemverConverter.matchRangeTokenStep5 | protected function matchRangeTokenStep5($i, $match, array &$matches, &$special, &$replace)
{
$matches[$i] = $this->convertVersion($match);
$matches[$i] = $replace
? SemverUtil::replaceAlias($matches[$i], $replace)
: $matches[$i];
$matches[$i] .= '~' === $special && \i... | php | protected function matchRangeTokenStep5($i, $match, array &$matches, &$special, &$replace)
{
$matches[$i] = $this->convertVersion($match);
$matches[$i] = $replace
? SemverUtil::replaceAlias($matches[$i], $replace)
: $matches[$i];
$matches[$i] .= '~' === $special && \i... | [
"protected",
"function",
"matchRangeTokenStep5",
"(",
"$",
"i",
",",
"$",
"match",
",",
"array",
"&",
"$",
"matches",
",",
"&",
"$",
"special",
",",
"&",
"$",
"replace",
")",
"{",
"$",
"matches",
"[",
"$",
"i",
"]",
"=",
"$",
"this",
"->",
"convert... | Step5: Converts the token of the matched range.
@param int $i
@param string $match
@param array $matches
@param null|string $special
@param null|string $replace | [
"Step5",
":",
"Converts",
"the",
"token",
"of",
"the",
"matched",
"range",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Converter/SemverConverter.php#L206-L217 |
fxpio/composer-asset-plugin | Converter/NpmPackageUtil.php | NpmPackageUtil.convertName | public static function convertName($name)
{
if (0 === strpos($name, '@') && false !== strpos($name, '/')) {
$name = ltrim(str_replace('/', '--', $name), '@');
}
return $name;
} | php | public static function convertName($name)
{
if (0 === strpos($name, '@') && false !== strpos($name, '/')) {
$name = ltrim(str_replace('/', '--', $name), '@');
}
return $name;
} | [
"public",
"static",
"function",
"convertName",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"0",
"===",
"strpos",
"(",
"$",
"name",
",",
"'@'",
")",
"&&",
"false",
"!==",
"strpos",
"(",
"$",
"name",
",",
"'/'",
")",
")",
"{",
"$",
"name",
"=",
"ltrim",... | Convert the npm package name.
@param string $name The npm package name
@return string | [
"Convert",
"the",
"npm",
"package",
"name",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Converter/NpmPackageUtil.php#L28-L35 |
fxpio/composer-asset-plugin | Converter/NpmPackageUtil.php | NpmPackageUtil.convertLicenses | public static function convertLicenses($licenses)
{
if (!\is_array($licenses)) {
return $licenses;
}
$result = array();
foreach ($licenses as $license) {
if (\is_array($license)) {
if (!empty($license['type'])) {
$result[] ... | php | public static function convertLicenses($licenses)
{
if (!\is_array($licenses)) {
return $licenses;
}
$result = array();
foreach ($licenses as $license) {
if (\is_array($license)) {
if (!empty($license['type'])) {
$result[] ... | [
"public",
"static",
"function",
"convertLicenses",
"(",
"$",
"licenses",
")",
"{",
"if",
"(",
"!",
"\\",
"is_array",
"(",
"$",
"licenses",
")",
")",
"{",
"return",
"$",
"licenses",
";",
"}",
"$",
"result",
"=",
"array",
"(",
")",
";",
"foreach",
"(",... | Convert the npm licenses list.
@param array|string $licenses The npm package licenses list
@return array|string | [
"Convert",
"the",
"npm",
"licenses",
"list",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Converter/NpmPackageUtil.php#L60-L80 |
fxpio/composer-asset-plugin | Converter/NpmPackageUtil.php | NpmPackageUtil.convertContributors | public static function convertContributors($value, $prevValue)
{
$mergeValue = \is_array($prevValue) ? $prevValue : array();
$mergeValue = array_merge($mergeValue, \is_array($value) ? $value : array());
if (\count($mergeValue) > 0) {
$value = $mergeValue;
}
retu... | php | public static function convertContributors($value, $prevValue)
{
$mergeValue = \is_array($prevValue) ? $prevValue : array();
$mergeValue = array_merge($mergeValue, \is_array($value) ? $value : array());
if (\count($mergeValue) > 0) {
$value = $mergeValue;
}
retu... | [
"public",
"static",
"function",
"convertContributors",
"(",
"$",
"value",
",",
"$",
"prevValue",
")",
"{",
"$",
"mergeValue",
"=",
"\\",
"is_array",
"(",
"$",
"prevValue",
")",
"?",
"$",
"prevValue",
":",
"array",
"(",
")",
";",
"$",
"mergeValue",
"=",
... | Convert the contributors section.
@param null|string $value The current value
@param null|string $prevValue The previous value
@return array | [
"Convert",
"the",
"contributors",
"section",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Converter/NpmPackageUtil.php#L106-L116 |
fxpio/composer-asset-plugin | Converter/NpmPackageUtil.php | NpmPackageUtil.convertDist | public static function convertDist($value)
{
if (\is_array($value)) {
$data = (array) $value;
$value = array();
foreach ($data as $type => $url) {
if (\is_string($url)) {
self::convertDistEntry($value, $type, $url);
}
... | php | public static function convertDist($value)
{
if (\is_array($value)) {
$data = (array) $value;
$value = array();
foreach ($data as $type => $url) {
if (\is_string($url)) {
self::convertDistEntry($value, $type, $url);
}
... | [
"public",
"static",
"function",
"convertDist",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"\\",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"$",
"data",
"=",
"(",
"array",
")",
"$",
"value",
";",
"$",
"value",
"=",
"array",
"(",
")",
";",
"foreach... | Convert the dist section.
@param null|string $value The current value
@return array | [
"Convert",
"the",
"dist",
"section",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Converter/NpmPackageUtil.php#L125-L139 |
fxpio/composer-asset-plugin | Converter/NpmPackageUtil.php | NpmPackageUtil.convertDistEntry | private static function convertDistEntry(array &$value, $type, $url)
{
$httpPrefix = 'http://';
if (0 === strpos($url, $httpPrefix)) {
$url = 'https://'.substr($url, \strlen($httpPrefix));
}
if ('shasum' === $type) {
$value[$type] = $url;
} elseif ('... | php | private static function convertDistEntry(array &$value, $type, $url)
{
$httpPrefix = 'http://';
if (0 === strpos($url, $httpPrefix)) {
$url = 'https://'.substr($url, \strlen($httpPrefix));
}
if ('shasum' === $type) {
$value[$type] = $url;
} elseif ('... | [
"private",
"static",
"function",
"convertDistEntry",
"(",
"array",
"&",
"$",
"value",
",",
"$",
"type",
",",
"$",
"url",
")",
"{",
"$",
"httpPrefix",
"=",
"'http://'",
";",
"if",
"(",
"0",
"===",
"strpos",
"(",
"$",
"url",
",",
"$",
"httpPrefix",
")"... | Convert the each entry of dist section.
@param array $value The result
@param string $type The dist type
@param string $url The dist url | [
"Convert",
"the",
"each",
"entry",
"of",
"dist",
"section",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Converter/NpmPackageUtil.php#L148-L165 |
fxpio/composer-asset-plugin | Repository/Vcs/ProcessUtil.php | ProcessUtil.getComposerInformation | public static function getComposerInformation(
Cache $cache,
array &$infoCache,
$assetType,
ProcessExecutor $process,
$identifier,
$resource,
$cmdGet,
$cmdLog,
$repoDir,
$datetimePrefix = ''
) {
$infoCache[$identifier] = Util::r... | php | public static function getComposerInformation(
Cache $cache,
array &$infoCache,
$assetType,
ProcessExecutor $process,
$identifier,
$resource,
$cmdGet,
$cmdLog,
$repoDir,
$datetimePrefix = ''
) {
$infoCache[$identifier] = Util::r... | [
"public",
"static",
"function",
"getComposerInformation",
"(",
"Cache",
"$",
"cache",
",",
"array",
"&",
"$",
"infoCache",
",",
"$",
"assetType",
",",
"ProcessExecutor",
"$",
"process",
",",
"$",
"identifier",
",",
"$",
"resource",
",",
"$",
"cmdGet",
",",
... | Get composer information.
@param Cache $cache
@param array $infoCache
@param string $assetType
@param ProcessExecutor $process
@param string $identifier
@param string $resource
@param string $cmdGet
@param string $cmdLog
@param string $repoDir
@... | [
"Get",
"composer",
"information",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/Vcs/ProcessUtil.php#L41-L63 |
fxpio/composer-asset-plugin | Repository/Vcs/ProcessUtil.php | ProcessUtil.doGetComposerInformation | protected static function doGetComposerInformation($resource, ProcessExecutor $process, $cmdGet, $cmdLog, $repoDir, $datetimePrefix = '')
{
$process->execute($cmdGet, $composer, $repoDir);
if (!trim($composer)) {
return array('_nonexistent_package' => true);
}
$composer... | php | protected static function doGetComposerInformation($resource, ProcessExecutor $process, $cmdGet, $cmdLog, $repoDir, $datetimePrefix = '')
{
$process->execute($cmdGet, $composer, $repoDir);
if (!trim($composer)) {
return array('_nonexistent_package' => true);
}
$composer... | [
"protected",
"static",
"function",
"doGetComposerInformation",
"(",
"$",
"resource",
",",
"ProcessExecutor",
"$",
"process",
",",
"$",
"cmdGet",
",",
"$",
"cmdLog",
",",
"$",
"repoDir",
",",
"$",
"datetimePrefix",
"=",
"''",
")",
"{",
"$",
"process",
"->",
... | Get composer information.
@param string $resource
@param ProcessExecutor $process
@param string $cmdGet
@param string $cmdLog
@param string $repoDir
@param string $datetimePrefix
@return array The composer | [
"Get",
"composer",
"information",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/Vcs/ProcessUtil.php#L77-L88 |
fxpio/composer-asset-plugin | Repository/Vcs/ProcessUtil.php | ProcessUtil.addComposerTime | protected static function addComposerTime(array $composer, ProcessExecutor $process, $cmd, $repoDir, $datetimePrefix = '')
{
if (!isset($composer['time'])) {
$process->execute($cmd, $output, $repoDir);
$date = new \DateTime($datetimePrefix.trim($output), new \DateTimeZone('UTC'));
... | php | protected static function addComposerTime(array $composer, ProcessExecutor $process, $cmd, $repoDir, $datetimePrefix = '')
{
if (!isset($composer['time'])) {
$process->execute($cmd, $output, $repoDir);
$date = new \DateTime($datetimePrefix.trim($output), new \DateTimeZone('UTC'));
... | [
"protected",
"static",
"function",
"addComposerTime",
"(",
"array",
"$",
"composer",
",",
"ProcessExecutor",
"$",
"process",
",",
"$",
"cmd",
",",
"$",
"repoDir",
",",
"$",
"datetimePrefix",
"=",
"''",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"compos... | Add time in composer.
@param array $composer
@param ProcessExecutor $process
@param string $cmd
@param string $repoDir
@param string $datetimePrefix
@return array The composer | [
"Add",
"time",
"in",
"composer",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/Vcs/ProcessUtil.php#L101-L110 |
fxpio/composer-asset-plugin | Installer/IgnoreFactory.php | IgnoreFactory.create | public static function create(Config $config, Composer $composer, PackageInterface $package, $installDir = null, $section = 'ignore-files')
{
$installDir = static::getInstallDir($composer, $package, $installDir);
$manager = new IgnoreManager($installDir);
$config = $config->getArray($section... | php | public static function create(Config $config, Composer $composer, PackageInterface $package, $installDir = null, $section = 'ignore-files')
{
$installDir = static::getInstallDir($composer, $package, $installDir);
$manager = new IgnoreManager($installDir);
$config = $config->getArray($section... | [
"public",
"static",
"function",
"create",
"(",
"Config",
"$",
"config",
",",
"Composer",
"$",
"composer",
",",
"PackageInterface",
"$",
"package",
",",
"$",
"installDir",
"=",
"null",
",",
"$",
"section",
"=",
"'ignore-files'",
")",
"{",
"$",
"installDir",
... | Create a ignore manager.
@param Config $config The plugin config
@param Composer $composer The composer instance
@param PackageInterface $package The package instance
@param null|string $installDir The custom installation directory
@param null|string $section The config section ... | [
"Create",
"a",
"ignore",
"manager",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Installer/IgnoreFactory.php#L36-L51 |
fxpio/composer-asset-plugin | Installer/IgnoreFactory.php | IgnoreFactory.getInstallDir | protected static function getInstallDir(Composer $composer, PackageInterface $package, $installDir = null)
{
if (null === $installDir) {
$installDir = rtrim($composer->getConfig()->get('vendor-dir'), '/').'/'.$package->getName();
}
return rtrim($installDir, '/');
} | php | protected static function getInstallDir(Composer $composer, PackageInterface $package, $installDir = null)
{
if (null === $installDir) {
$installDir = rtrim($composer->getConfig()->get('vendor-dir'), '/').'/'.$package->getName();
}
return rtrim($installDir, '/');
} | [
"protected",
"static",
"function",
"getInstallDir",
"(",
"Composer",
"$",
"composer",
",",
"PackageInterface",
"$",
"package",
",",
"$",
"installDir",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"installDir",
")",
"{",
"$",
"installDir",
"=",
"rt... | Get the installation directory of the package.
@param Composer $composer The composer instance
@param PackageInterface $package The package instance
@param null|string $installDir The custom installation directory
@return string The installation directory | [
"Get",
"the",
"installation",
"directory",
"of",
"the",
"package",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Installer/IgnoreFactory.php#L62-L69 |
fxpio/composer-asset-plugin | Installer/IgnoreFactory.php | IgnoreFactory.addPatterns | protected static function addPatterns(IgnoreManager $manager, $patterns)
{
$enabled = false === $patterns ? false : true;
$manager->setEnabled($enabled);
if (\is_array($patterns)) {
foreach ($patterns as $pattern) {
$manager->addPattern($pattern);
}
... | php | protected static function addPatterns(IgnoreManager $manager, $patterns)
{
$enabled = false === $patterns ? false : true;
$manager->setEnabled($enabled);
if (\is_array($patterns)) {
foreach ($patterns as $pattern) {
$manager->addPattern($pattern);
}
... | [
"protected",
"static",
"function",
"addPatterns",
"(",
"IgnoreManager",
"$",
"manager",
",",
"$",
"patterns",
")",
"{",
"$",
"enabled",
"=",
"false",
"===",
"$",
"patterns",
"?",
"false",
":",
"true",
";",
"$",
"manager",
"->",
"setEnabled",
"(",
"$",
"e... | Add ignore file patterns in the ignore manager.
@param IgnoreManager $manager The ignore files manager
@param array|bool $patterns The patterns for ignore files | [
"Add",
"ignore",
"file",
"patterns",
"in",
"the",
"ignore",
"manager",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Installer/IgnoreFactory.php#L77-L87 |
fxpio/composer-asset-plugin | Package/AbstractLazyCompletePackage.php | AbstractLazyCompletePackage.initialize | protected function initialize()
{
if (!$this->lazyLoader) {
return;
}
$real = $this->lazyLoader->load($this);
$this->lazyLoader = null;
if (false === $real) {
$this->version = '-9999999.9999999.9999999.9999999';
return;
}
... | php | protected function initialize()
{
if (!$this->lazyLoader) {
return;
}
$real = $this->lazyLoader->load($this);
$this->lazyLoader = null;
if (false === $real) {
$this->version = '-9999999.9999999.9999999.9999999';
return;
}
... | [
"protected",
"function",
"initialize",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"lazyLoader",
")",
"{",
"return",
";",
"}",
"$",
"real",
"=",
"$",
"this",
"->",
"lazyLoader",
"->",
"load",
"(",
"$",
"this",
")",
";",
"$",
"this",
"->",
"... | Initialize the package. | [
"Initialize",
"the",
"package",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Package/AbstractLazyCompletePackage.php#L170-L220 |
fxpio/composer-asset-plugin | Repository/BowerPrivateRegistryFactory.php | BowerPrivateRegistryFactory.create | public static function create(AssetRepositoryManager $arm, VcsPackageFilter $filter, Config $config)
{
$rm = $arm->getRepositoryManager();
$registries = $config->getArray('private-bower-registries');
foreach ($registries as $registryName => $registryUrl) {
$repoConfig = AssetPlu... | php | public static function create(AssetRepositoryManager $arm, VcsPackageFilter $filter, Config $config)
{
$rm = $arm->getRepositoryManager();
$registries = $config->getArray('private-bower-registries');
foreach ($registries as $registryName => $registryUrl) {
$repoConfig = AssetPlu... | [
"public",
"static",
"function",
"create",
"(",
"AssetRepositoryManager",
"$",
"arm",
",",
"VcsPackageFilter",
"$",
"filter",
",",
"Config",
"$",
"config",
")",
"{",
"$",
"rm",
"=",
"$",
"arm",
"->",
"getRepositoryManager",
"(",
")",
";",
"$",
"registries",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/BowerPrivateRegistryFactory.php#L27-L39 |
fxpio/composer-asset-plugin | Installer/AssetInstaller.php | AssetInstaller.getInstallPath | public function getInstallPath(PackageInterface $package)
{
$this->initializeVendorDir();
$targetDir = $package->getTargetDir();
list(, $name) = explode('/', $package->getPrettyName(), 2);
return ($this->vendorDir ? $this->vendorDir.'/' : '').$name.($targetDir ? '/'.$targetDir : '... | php | public function getInstallPath(PackageInterface $package)
{
$this->initializeVendorDir();
$targetDir = $package->getTargetDir();
list(, $name) = explode('/', $package->getPrettyName(), 2);
return ($this->vendorDir ? $this->vendorDir.'/' : '').$name.($targetDir ? '/'.$targetDir : '... | [
"public",
"function",
"getInstallPath",
"(",
"PackageInterface",
"$",
"package",
")",
"{",
"$",
"this",
"->",
"initializeVendorDir",
"(",
")",
";",
"$",
"targetDir",
"=",
"$",
"package",
"->",
"getTargetDir",
"(",
")",
";",
"list",
"(",
",",
"$",
"name",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Installer/AssetInstaller.php#L70-L79 |
fxpio/composer-asset-plugin | Installer/AssetInstaller.php | AssetInstaller.installCode | protected function installCode(PackageInterface $package)
{
$package = AssetPlugin::addMainFiles($this->config, $package);
parent::installCode($package);
$this->deleteIgnoredFiles($package);
} | php | protected function installCode(PackageInterface $package)
{
$package = AssetPlugin::addMainFiles($this->config, $package);
parent::installCode($package);
$this->deleteIgnoredFiles($package);
} | [
"protected",
"function",
"installCode",
"(",
"PackageInterface",
"$",
"package",
")",
"{",
"$",
"package",
"=",
"AssetPlugin",
"::",
"addMainFiles",
"(",
"$",
"this",
"->",
"config",
",",
"$",
"package",
")",
";",
"parent",
"::",
"installCode",
"(",
"$",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Installer/AssetInstaller.php#L92-L99 |
fxpio/composer-asset-plugin | Installer/AssetInstaller.php | AssetInstaller.updateCode | protected function updateCode(PackageInterface $initial, PackageInterface $target)
{
$target = AssetPlugin::addMainFiles($this->config, $target);
parent::updateCode($initial, $target);
$this->deleteIgnoredFiles($target);
} | php | protected function updateCode(PackageInterface $initial, PackageInterface $target)
{
$target = AssetPlugin::addMainFiles($this->config, $target);
parent::updateCode($initial, $target);
$this->deleteIgnoredFiles($target);
} | [
"protected",
"function",
"updateCode",
"(",
"PackageInterface",
"$",
"initial",
",",
"PackageInterface",
"$",
"target",
")",
"{",
"$",
"target",
"=",
"AssetPlugin",
"::",
"addMainFiles",
"(",
"$",
"this",
"->",
"config",
",",
"$",
"target",
")",
";",
"parent... | {@inheritdoc} | [
"{"
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Installer/AssetInstaller.php#L104-L111 |
fxpio/composer-asset-plugin | Installer/AssetInstaller.php | AssetInstaller.deleteIgnoredFiles | protected function deleteIgnoredFiles(PackageInterface $package)
{
$manager = IgnoreFactory::create($this->config, $this->composer, $package, $this->getInstallPath($package));
if ($manager->isEnabled() && !$manager->hasPattern()) {
$this->addIgnorePatterns($manager, $package);
}... | php | protected function deleteIgnoredFiles(PackageInterface $package)
{
$manager = IgnoreFactory::create($this->config, $this->composer, $package, $this->getInstallPath($package));
if ($manager->isEnabled() && !$manager->hasPattern()) {
$this->addIgnorePatterns($manager, $package);
}... | [
"protected",
"function",
"deleteIgnoredFiles",
"(",
"PackageInterface",
"$",
"package",
")",
"{",
"$",
"manager",
"=",
"IgnoreFactory",
"::",
"create",
"(",
"$",
"this",
"->",
"config",
",",
"$",
"this",
"->",
"composer",
",",
"$",
"package",
",",
"$",
"th... | Deletes files defined in bower.json in section "ignore".
@param PackageInterface $package | [
"Deletes",
"files",
"defined",
"in",
"bower",
".",
"json",
"in",
"section",
"ignore",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Installer/AssetInstaller.php#L118-L127 |
fxpio/composer-asset-plugin | Type/AbstractAssetType.php | AbstractAssetType.formatComposerName | public function formatComposerName($name)
{
$prefix = $this->getComposerVendorName().'/';
if (preg_match('/(\:\/\/)|\@/', $name) || 0 === strpos($name, $prefix)) {
return $name;
}
return $prefix.$name;
} | php | public function formatComposerName($name)
{
$prefix = $this->getComposerVendorName().'/';
if (preg_match('/(\:\/\/)|\@/', $name) || 0 === strpos($name, $prefix)) {
return $name;
}
return $prefix.$name;
} | [
"public",
"function",
"formatComposerName",
"(",
"$",
"name",
")",
"{",
"$",
"prefix",
"=",
"$",
"this",
"->",
"getComposerVendorName",
"(",
")",
".",
"'/'",
";",
"if",
"(",
"preg_match",
"(",
"'/(\\:\\/\\/)|\\@/'",
",",
"$",
"name",
")",
"||",
"0",
"===... | {@inheritdoc} | [
"{"
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Type/AbstractAssetType.php#L90-L99 |
fxpio/composer-asset-plugin | Repository/NpmRepository.php | NpmRepository.buildPackageUrl | protected function buildPackageUrl($packageName)
{
$packageName = urlencode(NpmPackageUtil::revertName($packageName));
$packageName = str_replace('%40', '@', $packageName);
return parent::buildPackageUrl($packageName);
} | php | protected function buildPackageUrl($packageName)
{
$packageName = urlencode(NpmPackageUtil::revertName($packageName));
$packageName = str_replace('%40', '@', $packageName);
return parent::buildPackageUrl($packageName);
} | [
"protected",
"function",
"buildPackageUrl",
"(",
"$",
"packageName",
")",
"{",
"$",
"packageName",
"=",
"urlencode",
"(",
"NpmPackageUtil",
"::",
"revertName",
"(",
"$",
"packageName",
")",
")",
";",
"$",
"packageName",
"=",
"str_replace",
"(",
"'%40'",
",",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/NpmRepository.php#L73-L79 |
fxpio/composer-asset-plugin | Repository/NpmRepository.php | NpmRepository.createVcsRepositoryConfig | protected function createVcsRepositoryConfig(array $data, $registryName = null)
{
$type = isset($data['repository']['type']) ? $data['repository']['type'] : 'vcs';
// Add release date in $packageConfigs
if (isset($data['versions'], $data['time'])) {
$time = $data['time'];
... | php | protected function createVcsRepositoryConfig(array $data, $registryName = null)
{
$type = isset($data['repository']['type']) ? $data['repository']['type'] : 'vcs';
// Add release date in $packageConfigs
if (isset($data['versions'], $data['time'])) {
$time = $data['time'];
... | [
"protected",
"function",
"createVcsRepositoryConfig",
"(",
"array",
"$",
"data",
",",
"$",
"registryName",
"=",
"null",
")",
"{",
"$",
"type",
"=",
"isset",
"(",
"$",
"data",
"[",
"'repository'",
"]",
"[",
"'type'",
"]",
")",
"?",
"$",
"data",
"[",
"'r... | {@inheritdoc} | [
"{"
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/NpmRepository.php#L84-L102 |
fxpio/composer-asset-plugin | Repository/NpmRepository.php | NpmRepository.whatProvidesManageException | protected function whatProvidesManageException(Pool $pool, $name, \Exception $exception)
{
if ($exception instanceof InvalidCreateRepositoryException) {
$data = $exception->getData();
if (isset($data['versions']) && !empty($data['versions'])) {
$this->putArrayReposit... | php | protected function whatProvidesManageException(Pool $pool, $name, \Exception $exception)
{
if ($exception instanceof InvalidCreateRepositoryException) {
$data = $exception->getData();
if (isset($data['versions']) && !empty($data['versions'])) {
$this->putArrayReposit... | [
"protected",
"function",
"whatProvidesManageException",
"(",
"Pool",
"$",
"pool",
",",
"$",
"name",
",",
"\\",
"Exception",
"$",
"exception",
")",
"{",
"if",
"(",
"$",
"exception",
"instanceof",
"InvalidCreateRepositoryException",
")",
"{",
"$",
"data",
"=",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/NpmRepository.php#L107-L120 |
fxpio/composer-asset-plugin | Repository/NpmRepository.php | NpmRepository.putArrayRepositoryConfig | protected function putArrayRepositoryConfig(array $packageConfigs, $name, Pool $pool)
{
$packages = $this->createArrayRepositoryConfig($packageConfigs);
$repo = new ArrayRepository($packages);
Util::addRepositoryInstance($this->io, $this->repositoryManager, $this->repos, $name, $repo, $pool)... | php | protected function putArrayRepositoryConfig(array $packageConfigs, $name, Pool $pool)
{
$packages = $this->createArrayRepositoryConfig($packageConfigs);
$repo = new ArrayRepository($packages);
Util::addRepositoryInstance($this->io, $this->repositoryManager, $this->repos, $name, $repo, $pool)... | [
"protected",
"function",
"putArrayRepositoryConfig",
"(",
"array",
"$",
"packageConfigs",
",",
"$",
"name",
",",
"Pool",
"$",
"pool",
")",
"{",
"$",
"packages",
"=",
"$",
"this",
"->",
"createArrayRepositoryConfig",
"(",
"$",
"packageConfigs",
")",
";",
"$",
... | Create and put the array repository with the asset configs.
@param array $packageConfigs The configs of assets package versions
@param string $name The asset package name
@param Pool $pool The pool | [
"Create",
"and",
"put",
"the",
"array",
"repository",
"with",
"the",
"asset",
"configs",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/NpmRepository.php#L129-L136 |
fxpio/composer-asset-plugin | Repository/NpmRepository.php | NpmRepository.createArrayRepositoryConfig | protected function createArrayRepositoryConfig(array $packageConfigs)
{
$packages = array();
$loader = new ArrayLoader();
foreach ($packageConfigs as $version => $config) {
try {
$config['version'] = $version;
$config = $this->assetType->getPackag... | php | protected function createArrayRepositoryConfig(array $packageConfigs)
{
$packages = array();
$loader = new ArrayLoader();
foreach ($packageConfigs as $version => $config) {
try {
$config['version'] = $version;
$config = $this->assetType->getPackag... | [
"protected",
"function",
"createArrayRepositoryConfig",
"(",
"array",
"$",
"packageConfigs",
")",
"{",
"$",
"packages",
"=",
"array",
"(",
")",
";",
"$",
"loader",
"=",
"new",
"ArrayLoader",
"(",
")",
";",
"foreach",
"(",
"$",
"packageConfigs",
"as",
"$",
... | Create the array repository with the asset configs.
A warning message is displayed if the constraint versions of packages
are broken. These versions are skipped and the plugin hope that other
versions will be OK.
@param array $packageConfigs The configs of assets package versions
@return CompletePackageInterface[] | [
"Create",
"the",
"array",
"repository",
"with",
"the",
"asset",
"configs",
"."
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Repository/NpmRepository.php#L149-L166 |
fxpio/composer-asset-plugin | Util/Perforce.php | Perforce.getComposerInformation | public function getComposerInformation($identifier)
{
$composerFileContent = $this->getFileContent($this->filename, $identifier);
return !$composerFileContent
? null
: json_decode($composerFileContent, true);
} | php | public function getComposerInformation($identifier)
{
$composerFileContent = $this->getFileContent($this->filename, $identifier);
return !$composerFileContent
? null
: json_decode($composerFileContent, true);
} | [
"public",
"function",
"getComposerInformation",
"(",
"$",
"identifier",
")",
"{",
"$",
"composerFileContent",
"=",
"$",
"this",
"->",
"getFileContent",
"(",
"$",
"this",
"->",
"filename",
",",
"$",
"identifier",
")",
";",
"return",
"!",
"$",
"composerFileConte... | @param string $identifier
@return array|string | [
"@param",
"string",
"$identifier"
] | train | https://github.com/fxpio/composer-asset-plugin/blob/6d5cfd0a4f4c3e167d2048eb8f5347309a6bbe10/Util/Perforce.php#L45-L52 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.