id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
223,800 | enygma/gauth | src/GAuth/Auth.php | Auth.buildLookup | public function buildLookup()
{
$lookup = array_combine(
array_merge(range('A', 'Z'), range(2, 7)),
range(0, 31)
);
$this->setLookup($lookup);
} | php | public function buildLookup()
{
$lookup = array_combine(
array_merge(range('A', 'Z'), range(2, 7)),
range(0, 31)
);
$this->setLookup($lookup);
} | [
"public",
"function",
"buildLookup",
"(",
")",
"{",
"$",
"lookup",
"=",
"array_combine",
"(",
"array_merge",
"(",
"range",
"(",
"'A'",
",",
"'Z'",
")",
",",
"range",
"(",
"2",
",",
"7",
")",
")",
",",
"range",
"(",
"0",
",",
"31",
")",
")",
";",
... | Build the base32 lookup table
@return null | [
"Build",
"the",
"base32",
"lookup",
"table"
] | a559a35209c80ff3a3f787eb46d1358e1cc4bcdf | https://github.com/enygma/gauth/blob/a559a35209c80ff3a3f787eb46d1358e1cc4bcdf/src/GAuth/Auth.php#L69-L76 |
223,801 | enygma/gauth | src/GAuth/Auth.php | Auth.setInitKey | public function setInitKey($key)
{
if (preg_match('/^['.implode('', array_keys($this->getLookup())).']+$/', $key) == false) {
throw new \InvalidArgumentException('Invalid base32 hash!');
}
$this->initKey = $key;
return $this;
} | php | public function setInitKey($key)
{
if (preg_match('/^['.implode('', array_keys($this->getLookup())).']+$/', $key) == false) {
throw new \InvalidArgumentException('Invalid base32 hash!');
}
$this->initKey = $key;
return $this;
} | [
"public",
"function",
"setInitKey",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"preg_match",
"(",
"'/^['",
".",
"implode",
"(",
"''",
",",
"array_keys",
"(",
"$",
"this",
"->",
"getLookup",
"(",
")",
")",
")",
".",
"']+$/'",
",",
"$",
"key",
")",
"==",
... | Set the initialization key for the object
@param string $key Initialization key
@throws \InvalidArgumentException If hash is not valid base32
@return \GAuth\Auth instance | [
"Set",
"the",
"initialization",
"key",
"for",
"the",
"object"
] | a559a35209c80ff3a3f787eb46d1358e1cc4bcdf | https://github.com/enygma/gauth/blob/a559a35209c80ff3a3f787eb46d1358e1cc4bcdf/src/GAuth/Auth.php#L109-L116 |
223,802 | enygma/gauth | src/GAuth/Auth.php | Auth.validateCode | public function validateCode($code, $initKey = null, $timestamp = null, $range = null)
{
if (strlen($code) !== $this->getCodeLength()) {
throw new \InvalidArgumentException('Incorrect code length');
}
$range = ($range == null) ? $this->getRange() : $range;
$timestamp = (... | php | public function validateCode($code, $initKey = null, $timestamp = null, $range = null)
{
if (strlen($code) !== $this->getCodeLength()) {
throw new \InvalidArgumentException('Incorrect code length');
}
$range = ($range == null) ? $this->getRange() : $range;
$timestamp = (... | [
"public",
"function",
"validateCode",
"(",
"$",
"code",
",",
"$",
"initKey",
"=",
"null",
",",
"$",
"timestamp",
"=",
"null",
",",
"$",
"range",
"=",
"null",
")",
"{",
"if",
"(",
"strlen",
"(",
"$",
"code",
")",
"!==",
"$",
"this",
"->",
"getCodeLe... | Validate the given code
@param string $code Code entered by user
@param string $initKey Initialization key
@param string $timestamp Timestamp for calculation
@param integer $range Seconds before/after to validate hash against
@throws \InvalidArgumentException If incorrect code length
@return boolean Pass/fail of valid... | [
"Validate",
"the",
"given",
"code"
] | a559a35209c80ff3a3f787eb46d1358e1cc4bcdf | https://github.com/enygma/gauth/blob/a559a35209c80ff3a3f787eb46d1358e1cc4bcdf/src/GAuth/Auth.php#L212-L230 |
223,803 | enygma/gauth | src/GAuth/Auth.php | Auth.generateOneTime | public function generateOneTime($initKey = null, $timestamp = null)
{
$initKey = ($initKey == null) ? $this->getInitKey() : $initKey;
$timestamp = ($timestamp == null) ? $this->generateTimestamp() : $timestamp;
$hash = hash_hmac (
'sha1',
pack('N*', 0) . pack('N*', $... | php | public function generateOneTime($initKey = null, $timestamp = null)
{
$initKey = ($initKey == null) ? $this->getInitKey() : $initKey;
$timestamp = ($timestamp == null) ? $this->generateTimestamp() : $timestamp;
$hash = hash_hmac (
'sha1',
pack('N*', 0) . pack('N*', $... | [
"public",
"function",
"generateOneTime",
"(",
"$",
"initKey",
"=",
"null",
",",
"$",
"timestamp",
"=",
"null",
")",
"{",
"$",
"initKey",
"=",
"(",
"$",
"initKey",
"==",
"null",
")",
"?",
"$",
"this",
"->",
"getInitKey",
"(",
")",
":",
"$",
"initKey",... | Generate a one-time code
@param string $initKey Initialization key [optional]
@param string $timestamp Timestamp for calculation [optional]
@return string Geneerated code/hash | [
"Generate",
"a",
"one",
"-",
"time",
"code"
] | a559a35209c80ff3a3f787eb46d1358e1cc4bcdf | https://github.com/enygma/gauth/blob/a559a35209c80ff3a3f787eb46d1358e1cc4bcdf/src/GAuth/Auth.php#L239-L252 |
223,804 | enygma/gauth | src/GAuth/Auth.php | Auth.truncateHash | public function truncateHash($hash)
{
$offset = ord($hash[19]) & 0xf;
return (
((ord($hash[$offset+0]) & 0x7f) << 24 ) |
((ord($hash[$offset+1]) & 0xff) << 16 ) |
((ord($hash[$offset+2]) & 0xff) << 8 ) |
(ord($hash[$offset+3]) & 0xff)
) % pow(... | php | public function truncateHash($hash)
{
$offset = ord($hash[19]) & 0xf;
return (
((ord($hash[$offset+0]) & 0x7f) << 24 ) |
((ord($hash[$offset+1]) & 0xff) << 16 ) |
((ord($hash[$offset+2]) & 0xff) << 8 ) |
(ord($hash[$offset+3]) & 0xff)
) % pow(... | [
"public",
"function",
"truncateHash",
"(",
"$",
"hash",
")",
"{",
"$",
"offset",
"=",
"ord",
"(",
"$",
"hash",
"[",
"19",
"]",
")",
"&",
"0xf",
";",
"return",
"(",
"(",
"(",
"ord",
"(",
"$",
"hash",
"[",
"$",
"offset",
"+",
"0",
"]",
")",
"&"... | Truncate the given hash down to just what we need
@param string $hash Hash to truncate
@return string Truncated hash value | [
"Truncate",
"the",
"given",
"hash",
"down",
"to",
"just",
"what",
"we",
"need"
] | a559a35209c80ff3a3f787eb46d1358e1cc4bcdf | https://github.com/enygma/gauth/blob/a559a35209c80ff3a3f787eb46d1358e1cc4bcdf/src/GAuth/Auth.php#L318-L328 |
223,805 | enygma/gauth | src/GAuth/Auth.php | Auth.base32_decode | public function base32_decode($hash)
{
$lookup = $this->getLookup();
if (preg_match('/^['.implode('', array_keys($lookup)).']+$/', $hash) == false) {
throw new \InvalidArgumentException('Invalid base32 hash!');
}
$hash = strtoupper($hash);
$buffer = 0;
$... | php | public function base32_decode($hash)
{
$lookup = $this->getLookup();
if (preg_match('/^['.implode('', array_keys($lookup)).']+$/', $hash) == false) {
throw new \InvalidArgumentException('Invalid base32 hash!');
}
$hash = strtoupper($hash);
$buffer = 0;
$... | [
"public",
"function",
"base32_decode",
"(",
"$",
"hash",
")",
"{",
"$",
"lookup",
"=",
"$",
"this",
"->",
"getLookup",
"(",
")",
";",
"if",
"(",
"preg_match",
"(",
"'/^['",
".",
"implode",
"(",
"''",
",",
"array_keys",
"(",
"$",
"lookup",
")",
")",
... | Base32 decoding function
@param string base32 encoded hash
@throws \InvalidArgumentException When hash is not valid
@return string Binary value of hash | [
"Base32",
"decoding",
"function"
] | a559a35209c80ff3a3f787eb46d1358e1cc4bcdf | https://github.com/enygma/gauth/blob/a559a35209c80ff3a3f787eb46d1358e1cc4bcdf/src/GAuth/Auth.php#L337-L362 |
223,806 | nilportugues/php-sitemap | src/Item/Video/Validator/RatingValidator.php | RatingValidator.validate | public static function validate($rating)
{
if (\is_numeric($rating) && $rating > -0.01 && $rating < 5.01) {
\preg_match('/([0-9].[0-9])/', $rating, $matches);
$matches[0] = \floatval($matches[0]);
return (!empty($matches[0]) && $matches[0] <= 5.0 && $matches[0] >= 0.0) ?... | php | public static function validate($rating)
{
if (\is_numeric($rating) && $rating > -0.01 && $rating < 5.01) {
\preg_match('/([0-9].[0-9])/', $rating, $matches);
$matches[0] = \floatval($matches[0]);
return (!empty($matches[0]) && $matches[0] <= 5.0 && $matches[0] >= 0.0) ?... | [
"public",
"static",
"function",
"validate",
"(",
"$",
"rating",
")",
"{",
"if",
"(",
"\\",
"is_numeric",
"(",
"$",
"rating",
")",
"&&",
"$",
"rating",
">",
"-",
"0.01",
"&&",
"$",
"rating",
"<",
"5.01",
")",
"{",
"\\",
"preg_match",
"(",
"'/([0-9].[0... | The rating of the video. Allowed values are float numbers in the range 0.0 to 5.0.
@param $rating
@return string|false | [
"The",
"rating",
"of",
"the",
"video",
".",
"Allowed",
"values",
"are",
"float",
"numbers",
"in",
"the",
"range",
"0",
".",
"0",
"to",
"5",
".",
"0",
"."
] | b1c7109d6e0c30ee9a0f9ef3b73bac406add9bfd | https://github.com/nilportugues/php-sitemap/blob/b1c7109d6e0c30ee9a0f9ef3b73bac406add9bfd/src/Item/Video/Validator/RatingValidator.php#L25-L35 |
223,807 | puli/manager | src/Api/Discovery/NoSuchBindingException.php | NoSuchBindingException.forUuidAndModule | public static function forUuidAndModule(Uuid $uuid, $moduleName, Exception $cause = null)
{
return new static(sprintf(
'The binding with UUID "%s" does not exist in module "%s".',
$uuid->toString(),
$moduleName
), 0, $cause);
} | php | public static function forUuidAndModule(Uuid $uuid, $moduleName, Exception $cause = null)
{
return new static(sprintf(
'The binding with UUID "%s" does not exist in module "%s".',
$uuid->toString(),
$moduleName
), 0, $cause);
} | [
"public",
"static",
"function",
"forUuidAndModule",
"(",
"Uuid",
"$",
"uuid",
",",
"$",
"moduleName",
",",
"Exception",
"$",
"cause",
"=",
"null",
")",
"{",
"return",
"new",
"static",
"(",
"sprintf",
"(",
"'The binding with UUID \"%s\" does not exist in module \"%s\... | Creates an exception for a UUID that was not found in a given module.
@param Uuid $uuid The UUID.
@param string $moduleName The name of the containing module.
@param Exception|null $cause The exception that caused this
exception.
@return static The created exception. | [
"Creates",
"an",
"exception",
"for",
"a",
"UUID",
"that",
"was",
"not",
"found",
"in",
"a",
"given",
"module",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Discovery/NoSuchBindingException.php#L53-L60 |
223,808 | puli/manager | src/Api/Installer/NoSuchInstallerException.php | NoSuchInstallerException.forInstallerNameAndModuleName | public static function forInstallerNameAndModuleName($installerName, $moduleName, Exception $cause = null)
{
return new static(sprintf(
'The installer "%s" does not exist in module "%s".',
$installerName,
$moduleName
), 0, $cause);
} | php | public static function forInstallerNameAndModuleName($installerName, $moduleName, Exception $cause = null)
{
return new static(sprintf(
'The installer "%s" does not exist in module "%s".',
$installerName,
$moduleName
), 0, $cause);
} | [
"public",
"static",
"function",
"forInstallerNameAndModuleName",
"(",
"$",
"installerName",
",",
"$",
"moduleName",
",",
"Exception",
"$",
"cause",
"=",
"null",
")",
"{",
"return",
"new",
"static",
"(",
"sprintf",
"(",
"'The installer \"%s\" does not exist in module \... | Creates an exception for an installer name that was not found in a given
module.
@param string $installerName The installer name.
@param string $moduleName The module name.
@param Exception|null $cause The exception that caused this
exception.
@return static The created exception. | [
"Creates",
"an",
"exception",
"for",
"an",
"installer",
"name",
"that",
"was",
"not",
"found",
"in",
"a",
"given",
"module",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Installer/NoSuchInstallerException.php#L53-L60 |
223,809 | ongr-io/FilterManagerBundle | Search/FilterContainer.php | FilterContainer.buildSearchRequest | public function buildSearchRequest(Request $request)
{
$search = new SearchRequest();
/** @var FilterInterface[] $filters */
$filters = $this->all();
foreach ($filters as $name => $filter) {
$state = $filter->getState($request);
$state->setName($name);
... | php | public function buildSearchRequest(Request $request)
{
$search = new SearchRequest();
/** @var FilterInterface[] $filters */
$filters = $this->all();
foreach ($filters as $name => $filter) {
$state = $filter->getState($request);
$state->setName($name);
... | [
"public",
"function",
"buildSearchRequest",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"search",
"=",
"new",
"SearchRequest",
"(",
")",
";",
"/** @var FilterInterface[] $filters */",
"$",
"filters",
"=",
"$",
"this",
"->",
"all",
"(",
")",
";",
"foreach",
... | Builds search request according to given filters.
@param Request $request
@return SearchRequest | [
"Builds",
"search",
"request",
"according",
"to",
"given",
"filters",
"."
] | 26c1125457f0440019b9bf20090bf23ba4bb1905 | https://github.com/ongr-io/FilterManagerBundle/blob/26c1125457f0440019b9bf20090bf23ba4bb1905/Search/FilterContainer.php#L91-L104 |
223,810 | ongr-io/FilterManagerBundle | Search/FilterContainer.php | FilterContainer.buildSearch | public function buildSearch(SearchRequest $request, $filters = null)
{
$search = new Search();
/** @var FilterInterface[] $filters */
$filters = $filters ? $filters : $this->all();
foreach ($filters as $name => $filter) {
$filter->modifySearch($search, $request->get($nam... | php | public function buildSearch(SearchRequest $request, $filters = null)
{
$search = new Search();
/** @var FilterInterface[] $filters */
$filters = $filters ? $filters : $this->all();
foreach ($filters as $name => $filter) {
$filter->modifySearch($search, $request->get($nam... | [
"public",
"function",
"buildSearch",
"(",
"SearchRequest",
"$",
"request",
",",
"$",
"filters",
"=",
"null",
")",
"{",
"$",
"search",
"=",
"new",
"Search",
"(",
")",
";",
"/** @var FilterInterface[] $filters */",
"$",
"filters",
"=",
"$",
"filters",
"?",
"$"... | Builds elastic search query by given SearchRequest and filters.
@param SearchRequest $request
@param \ArrayIterator|null $filters
@return Search | [
"Builds",
"elastic",
"search",
"query",
"by",
"given",
"SearchRequest",
"and",
"filters",
"."
] | 26c1125457f0440019b9bf20090bf23ba4bb1905 | https://github.com/ongr-io/FilterManagerBundle/blob/26c1125457f0440019b9bf20090bf23ba4bb1905/Search/FilterContainer.php#L114-L125 |
223,811 | puli/manager | src/Api/Container.php | Container.parseHomeDirectory | private static function parseHomeDirectory()
{
try {
$homeDir = System::parseHomeDirectory();
System::denyWebAccess($homeDir);
return $homeDir;
} catch (InvalidConfigException $e) {
// Context variable was not found -> no home directory
/... | php | private static function parseHomeDirectory()
{
try {
$homeDir = System::parseHomeDirectory();
System::denyWebAccess($homeDir);
return $homeDir;
} catch (InvalidConfigException $e) {
// Context variable was not found -> no home directory
/... | [
"private",
"static",
"function",
"parseHomeDirectory",
"(",
")",
"{",
"try",
"{",
"$",
"homeDir",
"=",
"System",
"::",
"parseHomeDirectory",
"(",
")",
";",
"System",
"::",
"denyWebAccess",
"(",
"$",
"homeDir",
")",
";",
"return",
"$",
"homeDir",
";",
"}",
... | Parses the system context for a home directory.
@return null|string Returns the path to the home directory or `null`
if none was found. | [
"Parses",
"the",
"system",
"context",
"for",
"a",
"home",
"directory",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Container.php#L303-L317 |
223,812 | puli/manager | src/Api/Container.php | Container.start | public function start()
{
if ($this->started) {
throw new LogicException('Puli is already started');
}
if (null !== $this->rootDir) {
$this->context = $this->createProjectContext($this->rootDir, $this->env);
$bootstrapFile = $this->context->getConfig()->g... | php | public function start()
{
if ($this->started) {
throw new LogicException('Puli is already started');
}
if (null !== $this->rootDir) {
$this->context = $this->createProjectContext($this->rootDir, $this->env);
$bootstrapFile = $this->context->getConfig()->g... | [
"public",
"function",
"start",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"started",
")",
"{",
"throw",
"new",
"LogicException",
"(",
"'Puli is already started'",
")",
";",
"}",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"rootDir",
")",
"{",
"$",
... | Starts the service container. | [
"Starts",
"the",
"service",
"container",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Container.php#L340-L382 |
223,813 | puli/manager | src/Api/Container.php | Container.setRootDirectory | public function setRootDirectory($rootDir)
{
if ($this->started) {
throw new LogicException('Puli is already started');
}
Assert::nullOrDirectory($rootDir);
$this->rootDir = $rootDir ? Path::canonicalize($rootDir) : null;
} | php | public function setRootDirectory($rootDir)
{
if ($this->started) {
throw new LogicException('Puli is already started');
}
Assert::nullOrDirectory($rootDir);
$this->rootDir = $rootDir ? Path::canonicalize($rootDir) : null;
} | [
"public",
"function",
"setRootDirectory",
"(",
"$",
"rootDir",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"started",
")",
"{",
"throw",
"new",
"LogicException",
"(",
"'Puli is already started'",
")",
";",
"}",
"Assert",
"::",
"nullOrDirectory",
"(",
"$",
"rootD... | Sets the root directory of the managed Puli project.
@param string|null $rootDir The root directory of the managed Puli
project or `null` to start Puli outside of a
specific project. | [
"Sets",
"the",
"root",
"directory",
"of",
"the",
"managed",
"Puli",
"project",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Container.php#L402-L411 |
223,814 | puli/manager | src/Api/Container.php | Container.setEnvironment | public function setEnvironment($env)
{
if ($this->started) {
throw new LogicException('Puli is already started');
}
Assert::oneOf($env, Environment::all(), 'The environment must be one of: %2$s. Got: %s');
$this->env = $env;
} | php | public function setEnvironment($env)
{
if ($this->started) {
throw new LogicException('Puli is already started');
}
Assert::oneOf($env, Environment::all(), 'The environment must be one of: %2$s. Got: %s');
$this->env = $env;
} | [
"public",
"function",
"setEnvironment",
"(",
"$",
"env",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"started",
")",
"{",
"throw",
"new",
"LogicException",
"(",
"'Puli is already started'",
")",
";",
"}",
"Assert",
"::",
"oneOf",
"(",
"$",
"env",
",",
"Envir... | Sets the environment of the managed Puli project.
@param string $env One of the {@link Environment} constants. | [
"Sets",
"the",
"environment",
"of",
"the",
"managed",
"Puli",
"project",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Container.php#L418-L427 |
223,815 | puli/manager | src/Api/Container.php | Container.getRepository | public function getRepository()
{
if (!$this->started) {
throw new LogicException('Puli was not started');
}
if (!$this->context instanceof ProjectContext) {
return null;
}
if (!$this->repo) {
$this->repo = $this->getFactory()->createRepo... | php | public function getRepository()
{
if (!$this->started) {
throw new LogicException('Puli was not started');
}
if (!$this->context instanceof ProjectContext) {
return null;
}
if (!$this->repo) {
$this->repo = $this->getFactory()->createRepo... | [
"public",
"function",
"getRepository",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"started",
")",
"{",
"throw",
"new",
"LogicException",
"(",
"'Puli was not started'",
")",
";",
"}",
"if",
"(",
"!",
"$",
"this",
"->",
"context",
"instanceof",
"Pro... | Returns the resource repository of the project.
@return EditableRepository The resource repository. | [
"Returns",
"the",
"resource",
"repository",
"of",
"the",
"project",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Container.php#L546-L561 |
223,816 | puli/manager | src/Api/Container.php | Container.getDiscovery | public function getDiscovery()
{
if (!$this->started) {
throw new LogicException('Puli was not started');
}
if (!$this->context instanceof ProjectContext) {
return null;
}
if (!$this->discovery) {
$this->discovery = $this->getFactory()->c... | php | public function getDiscovery()
{
if (!$this->started) {
throw new LogicException('Puli was not started');
}
if (!$this->context instanceof ProjectContext) {
return null;
}
if (!$this->discovery) {
$this->discovery = $this->getFactory()->c... | [
"public",
"function",
"getDiscovery",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"started",
")",
"{",
"throw",
"new",
"LogicException",
"(",
"'Puli was not started'",
")",
";",
"}",
"if",
"(",
"!",
"$",
"this",
"->",
"context",
"instanceof",
"Proj... | Returns the resource discovery of the project.
@return EditableDiscovery The resource discovery. | [
"Returns",
"the",
"resource",
"discovery",
"of",
"the",
"project",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Container.php#L568-L583 |
223,817 | puli/manager | src/Api/Container.php | Container.getConfigFileManager | public function getConfigFileManager()
{
if (!$this->started) {
throw new LogicException('Puli was not started');
}
if (!$this->configFileManager && $this->context->getHomeDirectory()) {
$this->configFileManager = new ConfigFileManagerImpl(
$this->con... | php | public function getConfigFileManager()
{
if (!$this->started) {
throw new LogicException('Puli was not started');
}
if (!$this->configFileManager && $this->context->getHomeDirectory()) {
$this->configFileManager = new ConfigFileManagerImpl(
$this->con... | [
"public",
"function",
"getConfigFileManager",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"started",
")",
"{",
"throw",
"new",
"LogicException",
"(",
"'Puli was not started'",
")",
";",
"}",
"if",
"(",
"!",
"$",
"this",
"->",
"configFileManager",
"&&... | Returns the configuration file manager.
@return ConfigFileManager The configuration file manager. | [
"Returns",
"the",
"configuration",
"file",
"manager",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Container.php#L630-L644 |
223,818 | puli/manager | src/Api/Container.php | Container.getRootModuleFileManager | public function getRootModuleFileManager()
{
if (!$this->started) {
throw new LogicException('Puli was not started');
}
if (!$this->rootModuleFileManager && $this->context instanceof ProjectContext) {
$this->rootModuleFileManager = new RootModuleFileManagerImpl(
... | php | public function getRootModuleFileManager()
{
if (!$this->started) {
throw new LogicException('Puli was not started');
}
if (!$this->rootModuleFileManager && $this->context instanceof ProjectContext) {
$this->rootModuleFileManager = new RootModuleFileManagerImpl(
... | [
"public",
"function",
"getRootModuleFileManager",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"started",
")",
"{",
"throw",
"new",
"LogicException",
"(",
"'Puli was not started'",
")",
";",
"}",
"if",
"(",
"!",
"$",
"this",
"->",
"rootModuleFileManager... | Returns the root module file manager.
@return RootModuleFileManager The module file manager. | [
"Returns",
"the",
"root",
"module",
"file",
"manager",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Container.php#L651-L665 |
223,819 | puli/manager | src/Api/Container.php | Container.getModuleManager | public function getModuleManager()
{
if (!$this->started) {
throw new LogicException('Puli was not started');
}
if (!$this->moduleManager && $this->context instanceof ProjectContext) {
$this->moduleManager = new ModuleManagerImpl(
$this->context,
... | php | public function getModuleManager()
{
if (!$this->started) {
throw new LogicException('Puli was not started');
}
if (!$this->moduleManager && $this->context instanceof ProjectContext) {
$this->moduleManager = new ModuleManagerImpl(
$this->context,
... | [
"public",
"function",
"getModuleManager",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"started",
")",
"{",
"throw",
"new",
"LogicException",
"(",
"'Puli was not started'",
")",
";",
"}",
"if",
"(",
"!",
"$",
"this",
"->",
"moduleManager",
"&&",
"$"... | Returns the module manager.
@return ModuleManager The module manager. | [
"Returns",
"the",
"module",
"manager",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Container.php#L672-L686 |
223,820 | puli/manager | src/Api/Container.php | Container.getRepositoryManager | public function getRepositoryManager()
{
if (!$this->started) {
throw new LogicException('Puli was not started');
}
if (!$this->repositoryManager && $this->context instanceof ProjectContext) {
$this->repositoryManager = new RepositoryManagerImpl(
$thi... | php | public function getRepositoryManager()
{
if (!$this->started) {
throw new LogicException('Puli was not started');
}
if (!$this->repositoryManager && $this->context instanceof ProjectContext) {
$this->repositoryManager = new RepositoryManagerImpl(
$thi... | [
"public",
"function",
"getRepositoryManager",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"started",
")",
"{",
"throw",
"new",
"LogicException",
"(",
"'Puli was not started'",
")",
";",
"}",
"if",
"(",
"!",
"$",
"this",
"->",
"repositoryManager",
"&&... | Returns the resource repository manager.
@return RepositoryManager The repository manager. | [
"Returns",
"the",
"resource",
"repository",
"manager",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Container.php#L693-L709 |
223,821 | puli/manager | src/Api/Container.php | Container.getDiscoveryManager | public function getDiscoveryManager()
{
if (!$this->started) {
throw new LogicException('Puli was not started');
}
if (!$this->discoveryManager && $this->context instanceof ProjectContext) {
$this->discoveryManager = new DiscoveryManagerImpl(
$this->c... | php | public function getDiscoveryManager()
{
if (!$this->started) {
throw new LogicException('Puli was not started');
}
if (!$this->discoveryManager && $this->context instanceof ProjectContext) {
$this->discoveryManager = new DiscoveryManagerImpl(
$this->c... | [
"public",
"function",
"getDiscoveryManager",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"started",
")",
"{",
"throw",
"new",
"LogicException",
"(",
"'Puli was not started'",
")",
";",
"}",
"if",
"(",
"!",
"$",
"this",
"->",
"discoveryManager",
"&&",... | Returns the resource discovery manager.
@return DiscoveryManager The discovery manager. | [
"Returns",
"the",
"resource",
"discovery",
"manager",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Container.php#L716-L733 |
223,822 | puli/manager | src/Api/Container.php | Container.getServerManager | public function getServerManager()
{
if (!$this->started) {
throw new LogicException('Puli was not started');
}
if (!$this->serverManager && $this->context instanceof ProjectContext) {
$this->serverManager = new ModuleFileServerManager(
$this->getRoot... | php | public function getServerManager()
{
if (!$this->started) {
throw new LogicException('Puli was not started');
}
if (!$this->serverManager && $this->context instanceof ProjectContext) {
$this->serverManager = new ModuleFileServerManager(
$this->getRoot... | [
"public",
"function",
"getServerManager",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"started",
")",
"{",
"throw",
"new",
"LogicException",
"(",
"'Puli was not started'",
")",
";",
"}",
"if",
"(",
"!",
"$",
"this",
"->",
"serverManager",
"&&",
"$"... | Returns the server manager.
@return ServerManager The server manager. | [
"Returns",
"the",
"server",
"manager",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Container.php#L805-L819 |
223,823 | puli/manager | src/Api/Container.php | Container.getJsonEncoder | public function getJsonEncoder()
{
if (!$this->jsonEncoder) {
$this->jsonEncoder = new JsonEncoder();
$this->jsonEncoder->setPrettyPrinting(true);
$this->jsonEncoder->setEscapeSlash(false);
$this->jsonEncoder->setTerminateWithLineFeed(true);
}
... | php | public function getJsonEncoder()
{
if (!$this->jsonEncoder) {
$this->jsonEncoder = new JsonEncoder();
$this->jsonEncoder->setPrettyPrinting(true);
$this->jsonEncoder->setEscapeSlash(false);
$this->jsonEncoder->setTerminateWithLineFeed(true);
}
... | [
"public",
"function",
"getJsonEncoder",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"jsonEncoder",
")",
"{",
"$",
"this",
"->",
"jsonEncoder",
"=",
"new",
"JsonEncoder",
"(",
")",
";",
"$",
"this",
"->",
"jsonEncoder",
"->",
"setPrettyPrinting",
"(... | Returns the JSON encoder.
@return JsonEncoder The JSON encoder. | [
"Returns",
"the",
"JSON",
"encoder",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Container.php#L965-L975 |
223,824 | puli/manager | src/Api/Container.php | Container.getJsonValidator | public function getJsonValidator()
{
if (!$this->jsonValidator) {
$uriRetriever = new UriRetriever();
// Load puli.io schemas from the schema/ directory
$uriRetriever->setUriRetriever(new LocalUriRetriever());
$this->jsonValidator = new JsonValidator(null, $... | php | public function getJsonValidator()
{
if (!$this->jsonValidator) {
$uriRetriever = new UriRetriever();
// Load puli.io schemas from the schema/ directory
$uriRetriever->setUriRetriever(new LocalUriRetriever());
$this->jsonValidator = new JsonValidator(null, $... | [
"public",
"function",
"getJsonValidator",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"jsonValidator",
")",
"{",
"$",
"uriRetriever",
"=",
"new",
"UriRetriever",
"(",
")",
";",
"// Load puli.io schemas from the schema/ directory",
"$",
"uriRetriever",
"->",
... | Returns the JSON validator.
@return JsonValidator The JSON validator. | [
"Returns",
"the",
"JSON",
"validator",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Container.php#L996-L1008 |
223,825 | puli/manager | src/Api/Container.php | Container.createProjectContext | private function createProjectContext($rootDir, $env)
{
Assert::fileExists($rootDir, 'Could not load Puli context: The root %s does not exist.');
Assert::directory($rootDir, 'Could not load Puli context: The root %s is a file. Expected a directory.');
$baseConfig = new DefaultConfig();
... | php | private function createProjectContext($rootDir, $env)
{
Assert::fileExists($rootDir, 'Could not load Puli context: The root %s does not exist.');
Assert::directory($rootDir, 'Could not load Puli context: The root %s is a file. Expected a directory.');
$baseConfig = new DefaultConfig();
... | [
"private",
"function",
"createProjectContext",
"(",
"$",
"rootDir",
",",
"$",
"env",
")",
"{",
"Assert",
"::",
"fileExists",
"(",
"$",
"rootDir",
",",
"'Could not load Puli context: The root %s does not exist.'",
")",
";",
"Assert",
"::",
"directory",
"(",
"$",
"r... | Creates the context of a Puli project.
The home directory is read from the context variable "PULI_HOME".
If this variable is not set, the home directory defaults to:
* `$HOME/.puli` on Linux, where `$HOME` is the context variable
"HOME".
* `$APPDATA/Puli` on Windows, where `$APPDATA` is the context
variable "APPDATA"... | [
"Creates",
"the",
"context",
"of",
"a",
"Puli",
"project",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Container.php#L1055-L1087 |
223,826 | puli/manager | src/Api/Container.php | Container.getJsonStorage | private function getJsonStorage()
{
if (!$this->jsonStorage) {
$this->jsonStorage = new JsonStorage(
$this->getStorage(),
new JsonConverterProvider($this),
$this->getJsonEncoder(),
$this->getJsonDecoder(),
$this->get... | php | private function getJsonStorage()
{
if (!$this->jsonStorage) {
$this->jsonStorage = new JsonStorage(
$this->getStorage(),
new JsonConverterProvider($this),
$this->getJsonEncoder(),
$this->getJsonDecoder(),
$this->get... | [
"private",
"function",
"getJsonStorage",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"jsonStorage",
")",
"{",
"$",
"this",
"->",
"jsonStorage",
"=",
"new",
"JsonStorage",
"(",
"$",
"this",
"->",
"getStorage",
"(",
")",
",",
"new",
"JsonConverterPro... | Returns the JSON file storage.
@return JsonStorage The JSON file storage. | [
"Returns",
"the",
"JSON",
"file",
"storage",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Container.php#L1107-L1120 |
223,827 | puli/manager | src/Api/Container.php | Container.getJsonVersioner | private function getJsonVersioner()
{
if (!$this->jsonVersioner) {
$this->jsonVersioner = new ChainVersioner(array(
// check the schema of the "$schema" field by default
new SchemaUriVersioner(),
// fall back to the "version" field for 1.0
... | php | private function getJsonVersioner()
{
if (!$this->jsonVersioner) {
$this->jsonVersioner = new ChainVersioner(array(
// check the schema of the "$schema" field by default
new SchemaUriVersioner(),
// fall back to the "version" field for 1.0
... | [
"private",
"function",
"getJsonVersioner",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"jsonVersioner",
")",
"{",
"$",
"this",
"->",
"jsonVersioner",
"=",
"new",
"ChainVersioner",
"(",
"array",
"(",
"// check the schema of the \"$schema\" field by default",
... | Returns the JSON versioner.
@return JsonVersioner The JSON versioner. | [
"Returns",
"the",
"JSON",
"versioner",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Container.php#L1127-L1139 |
223,828 | puli/manager | src/Api/Container.php | Container.getModuleFileMigrationManager | private function getModuleFileMigrationManager()
{
if (!$this->moduleFileMigrationManager) {
$this->moduleFileMigrationManager = new MigrationManager(array(
new ModuleFile10To20Migration(),
), $this->getJsonVersioner());
}
return $this->moduleFileMigr... | php | private function getModuleFileMigrationManager()
{
if (!$this->moduleFileMigrationManager) {
$this->moduleFileMigrationManager = new MigrationManager(array(
new ModuleFile10To20Migration(),
), $this->getJsonVersioner());
}
return $this->moduleFileMigr... | [
"private",
"function",
"getModuleFileMigrationManager",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"moduleFileMigrationManager",
")",
"{",
"$",
"this",
"->",
"moduleFileMigrationManager",
"=",
"new",
"MigrationManager",
"(",
"array",
"(",
"new",
"ModuleFile... | Returns the migration manager for module files.
@return MigrationManager The migration manager. | [
"Returns",
"the",
"migration",
"manager",
"for",
"module",
"files",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Container.php#L1146-L1155 |
223,829 | puli/manager | src/Api/Container.php | Container.validatePluginClass | private function validatePluginClass($pluginClass)
{
if (!class_exists($pluginClass)) {
throw new InvalidConfigException(sprintf(
'The plugin class %s does not exist.',
$pluginClass
));
}
if (!in_array('Puli\Manager\Api\PuliPlugin', cl... | php | private function validatePluginClass($pluginClass)
{
if (!class_exists($pluginClass)) {
throw new InvalidConfigException(sprintf(
'The plugin class %s does not exist.',
$pluginClass
));
}
if (!in_array('Puli\Manager\Api\PuliPlugin', cl... | [
"private",
"function",
"validatePluginClass",
"(",
"$",
"pluginClass",
")",
"{",
"if",
"(",
"!",
"class_exists",
"(",
"$",
"pluginClass",
")",
")",
"{",
"throw",
"new",
"InvalidConfigException",
"(",
"sprintf",
"(",
"'The plugin class %s does not exist.'",
",",
"$... | Validates the given plugin class name.
@param string $pluginClass The fully qualified name of a plugin class. | [
"Validates",
"the",
"given",
"plugin",
"class",
"name",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Container.php#L1162-L1177 |
223,830 | bitverseio/identicon | src/Bitverse/Identicon/Generator/PixelsGenerator.php | PixelsGenerator.getPixel | private function getPixel($x, $y, Color $color)
{
return (new Rectangle($x * 80 + 40, $y * 80 + 40, 80, 80))
->setFillColor($color)
->setStrokeWidth(0);
} | php | private function getPixel($x, $y, Color $color)
{
return (new Rectangle($x * 80 + 40, $y * 80 + 40, 80, 80))
->setFillColor($color)
->setStrokeWidth(0);
} | [
"private",
"function",
"getPixel",
"(",
"$",
"x",
",",
"$",
"y",
",",
"Color",
"$",
"color",
")",
"{",
"return",
"(",
"new",
"Rectangle",
"(",
"$",
"x",
"*",
"80",
"+",
"40",
",",
"$",
"y",
"*",
"80",
"+",
"40",
",",
"80",
",",
"80",
")",
"... | Returns a pixel drawn accordingly to the passed parameters.
@param integer $x
@param integer $y
@param Color $color
@return SvgNode | [
"Returns",
"a",
"pixel",
"drawn",
"accordingly",
"to",
"the",
"passed",
"parameters",
"."
] | 5a015546e7f29d537807e0877446e2cd704ca438 | https://github.com/bitverseio/identicon/blob/5a015546e7f29d537807e0877446e2cd704ca438/src/Bitverse/Identicon/Generator/PixelsGenerator.php#L56-L61 |
223,831 | bitverseio/identicon | src/Bitverse/Identicon/Generator/PixelsGenerator.php | PixelsGenerator.showPixel | private function showPixel($x, $y, $hash)
{
return hexdec(substr($hash, 6 + abs(2-$x) * 5 + $y, 1)) % 2 === 0;
} | php | private function showPixel($x, $y, $hash)
{
return hexdec(substr($hash, 6 + abs(2-$x) * 5 + $y, 1)) % 2 === 0;
} | [
"private",
"function",
"showPixel",
"(",
"$",
"x",
",",
"$",
"y",
",",
"$",
"hash",
")",
"{",
"return",
"hexdec",
"(",
"substr",
"(",
"$",
"hash",
",",
"6",
"+",
"abs",
"(",
"2",
"-",
"$",
"x",
")",
"*",
"5",
"+",
"$",
"y",
",",
"1",
")",
... | Determines whether a pixel from the 5x5 grid should be visible.
@param integer $x
@param integer $y
@param string $hash
@return boolean | [
"Determines",
"whether",
"a",
"pixel",
"from",
"the",
"5x5",
"grid",
"should",
"be",
"visible",
"."
] | 5a015546e7f29d537807e0877446e2cd704ca438 | https://github.com/bitverseio/identicon/blob/5a015546e7f29d537807e0877446e2cd704ca438/src/Bitverse/Identicon/Generator/PixelsGenerator.php#L72-L75 |
223,832 | puli/manager | src/Conflict/DependencyGraph.php | DependencyGraph.forModules | public static function forModules(ModuleList $modules)
{
$graph = new static($modules->getModuleNames());
foreach ($modules as $module) {
if (null === $module->getModuleFile()) {
continue;
}
foreach ($module->getModuleFile()->getDependencies() as... | php | public static function forModules(ModuleList $modules)
{
$graph = new static($modules->getModuleNames());
foreach ($modules as $module) {
if (null === $module->getModuleFile()) {
continue;
}
foreach ($module->getModuleFile()->getDependencies() as... | [
"public",
"static",
"function",
"forModules",
"(",
"ModuleList",
"$",
"modules",
")",
"{",
"$",
"graph",
"=",
"new",
"static",
"(",
"$",
"modules",
"->",
"getModuleNames",
"(",
")",
")",
";",
"foreach",
"(",
"$",
"modules",
"as",
"$",
"module",
")",
"{... | Creates an override graph for the given modules.
@param ModuleList $modules The modules to load.
@return static The created override graph. | [
"Creates",
"an",
"override",
"graph",
"for",
"the",
"given",
"modules",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Conflict/DependencyGraph.php#L92-L127 |
223,833 | puli/manager | src/Conflict/DependencyGraph.php | DependencyGraph.addModuleName | public function addModuleName($moduleName)
{
if (isset($this->moduleNames[$moduleName])) {
throw new RuntimeException(sprintf(
'The module "%s" was added to the graph twice.',
$moduleName
));
}
$this->moduleNames[$moduleName] = true;
... | php | public function addModuleName($moduleName)
{
if (isset($this->moduleNames[$moduleName])) {
throw new RuntimeException(sprintf(
'The module "%s" was added to the graph twice.',
$moduleName
));
}
$this->moduleNames[$moduleName] = true;
... | [
"public",
"function",
"addModuleName",
"(",
"$",
"moduleName",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"moduleNames",
"[",
"$",
"moduleName",
"]",
")",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"sprintf",
"(",
"'The module \"%s\" was a... | Adds a module name to the graph.
@param string $moduleName The module name.
@throws RuntimeException If the module name already exists. | [
"Adds",
"a",
"module",
"name",
"to",
"the",
"graph",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Conflict/DependencyGraph.php#L147-L158 |
223,834 | puli/manager | src/Conflict/DependencyGraph.php | DependencyGraph.getSortedModuleNames | public function getSortedModuleNames(array $namesToSort = array())
{
if (count($namesToSort) > 0) {
$namesToSort = array_flip($namesToSort);
foreach ($namesToSort as $module => $_) {
if (!isset($this->moduleNames[$module])) {
throw new RuntimeExce... | php | public function getSortedModuleNames(array $namesToSort = array())
{
if (count($namesToSort) > 0) {
$namesToSort = array_flip($namesToSort);
foreach ($namesToSort as $module => $_) {
if (!isset($this->moduleNames[$module])) {
throw new RuntimeExce... | [
"public",
"function",
"getSortedModuleNames",
"(",
"array",
"$",
"namesToSort",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"namesToSort",
")",
">",
"0",
")",
"{",
"$",
"namesToSort",
"=",
"array_flip",
"(",
"$",
"namesToSort",
")",
... | Returns the sorted module names.
The names are sorted such that if a module m1 depends on a module m2,
then m2 comes before m1 in the sorted set.
If module names are passed, only those module names are sorted. Otherwise
all module names are sorted.
@param string[] $namesToSort The module names which should be sorted... | [
"Returns",
"the",
"sorted",
"module",
"names",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Conflict/DependencyGraph.php#L212-L238 |
223,835 | puli/manager | src/Conflict/DependencyGraph.php | DependencyGraph.addDependency | public function addDependency($moduleName, $dependency)
{
if (!isset($this->moduleNames[$dependency])) {
throw new RuntimeException(sprintf(
'The module "%s" does not exist in the graph.',
$dependency
));
}
if (!isset($this->moduleName... | php | public function addDependency($moduleName, $dependency)
{
if (!isset($this->moduleNames[$dependency])) {
throw new RuntimeException(sprintf(
'The module "%s" does not exist in the graph.',
$dependency
));
}
if (!isset($this->moduleName... | [
"public",
"function",
"addDependency",
"(",
"$",
"moduleName",
",",
"$",
"dependency",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"moduleNames",
"[",
"$",
"dependency",
"]",
")",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"sprintf... | Adds a dependency from one to another module.
@param string $moduleName The module name.
@param string $dependency The name of the dependency. | [
"Adds",
"a",
"dependency",
"from",
"one",
"to",
"another",
"module",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Conflict/DependencyGraph.php#L246-L275 |
223,836 | puli/manager | src/Conflict/DependencyGraph.php | DependencyGraph.hasDependency | public function hasDependency($moduleName, $dependency, $recursive = true)
{
if ($recursive) {
return $this->hasPath($moduleName, $dependency);
}
return isset($this->dependencies[$moduleName][$dependency]);
} | php | public function hasDependency($moduleName, $dependency, $recursive = true)
{
if ($recursive) {
return $this->hasPath($moduleName, $dependency);
}
return isset($this->dependencies[$moduleName][$dependency]);
} | [
"public",
"function",
"hasDependency",
"(",
"$",
"moduleName",
",",
"$",
"dependency",
",",
"$",
"recursive",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"recursive",
")",
"{",
"return",
"$",
"this",
"->",
"hasPath",
"(",
"$",
"moduleName",
",",
"$",
"depen... | Returns whether a module directly depends on another module.
@param string $moduleName The module name.
@param string $dependency The name of the dependency.
@param bool $recursive Whether to take recursive dependencies into
account.
@return bool Whether an edge exists from the origin to the target module. | [
"Returns",
"whether",
"a",
"module",
"directly",
"depends",
"on",
"another",
"module",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Conflict/DependencyGraph.php#L298-L305 |
223,837 | puli/manager | src/Conflict/DependencyGraph.php | DependencyGraph.hasPath | public function hasPath($moduleName, $dependency)
{
// does not exist in the graph
if (!isset($this->dependencies[$moduleName])) {
return false;
}
// adjacent node
if (isset($this->dependencies[$moduleName][$dependency])) {
return true;
}
... | php | public function hasPath($moduleName, $dependency)
{
// does not exist in the graph
if (!isset($this->dependencies[$moduleName])) {
return false;
}
// adjacent node
if (isset($this->dependencies[$moduleName][$dependency])) {
return true;
}
... | [
"public",
"function",
"hasPath",
"(",
"$",
"moduleName",
",",
"$",
"dependency",
")",
"{",
"// does not exist in the graph",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"dependencies",
"[",
"$",
"moduleName",
"]",
")",
")",
"{",
"return",
"false",
";"... | Returns whether a path exists from a module to a dependency.
@param string $moduleName The module name.
@param string $dependency The name of the dependency.
@return bool Whether a path exists from the origin to the target module. | [
"Returns",
"whether",
"a",
"path",
"exists",
"from",
"a",
"module",
"to",
"a",
"dependency",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Conflict/DependencyGraph.php#L315-L335 |
223,838 | puli/manager | src/Conflict/DependencyGraph.php | DependencyGraph.getPath | public function getPath($moduleName, $dependency)
{
if ($this->getPathDFS($moduleName, $dependency, $reversePath)) {
return array_reverse($reversePath);
}
return null;
} | php | public function getPath($moduleName, $dependency)
{
if ($this->getPathDFS($moduleName, $dependency, $reversePath)) {
return array_reverse($reversePath);
}
return null;
} | [
"public",
"function",
"getPath",
"(",
"$",
"moduleName",
",",
"$",
"dependency",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getPathDFS",
"(",
"$",
"moduleName",
",",
"$",
"dependency",
",",
"$",
"reversePath",
")",
")",
"{",
"return",
"array_reverse",
"(",... | Returns the path from a module name to a dependency.
@param string $moduleName The module name.
@param string $dependency The name of the dependency.
@return null|string[] The sorted module names on the path or `null` if no
path was found. | [
"Returns",
"the",
"path",
"from",
"a",
"module",
"name",
"to",
"a",
"dependency",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Conflict/DependencyGraph.php#L346-L353 |
223,839 | puli/manager | src/Conflict/DependencyGraph.php | DependencyGraph.getPathDFS | private function getPathDFS($moduleName, $dependency, &$reversePath = array())
{
// does not exist in the graph
if (!isset($this->dependencies[$moduleName])) {
return false;
}
$reversePath[] = $moduleName;
// adjacent node
if (isset($this->dependencies[$... | php | private function getPathDFS($moduleName, $dependency, &$reversePath = array())
{
// does not exist in the graph
if (!isset($this->dependencies[$moduleName])) {
return false;
}
$reversePath[] = $moduleName;
// adjacent node
if (isset($this->dependencies[$... | [
"private",
"function",
"getPathDFS",
"(",
"$",
"moduleName",
",",
"$",
"dependency",
",",
"&",
"$",
"reversePath",
"=",
"array",
"(",
")",
")",
"{",
"// does not exist in the graph",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"dependencies",
"[",
"$"... | Finds a path between modules using Depth-First Search.
@param string $moduleName The end module name.
@param string $dependency The start module name.
@param array $reversePath The path in reverse order.
@return bool Whether a path was found. | [
"Finds",
"a",
"path",
"between",
"modules",
"using",
"Depth",
"-",
"First",
"Search",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Conflict/DependencyGraph.php#L364-L388 |
223,840 | puli/manager | src/Conflict/DependencyGraph.php | DependencyGraph.sortModulesDFS | private function sortModulesDFS($currentName, array &$namesToSort, array &$output)
{
unset($namesToSort[$currentName]);
// Before adding the module itself to the path, add all predecessors.
// Do so recursively, then we make sure that each module is visited
// in the path before any... | php | private function sortModulesDFS($currentName, array &$namesToSort, array &$output)
{
unset($namesToSort[$currentName]);
// Before adding the module itself to the path, add all predecessors.
// Do so recursively, then we make sure that each module is visited
// in the path before any... | [
"private",
"function",
"sortModulesDFS",
"(",
"$",
"currentName",
",",
"array",
"&",
"$",
"namesToSort",
",",
"array",
"&",
"$",
"output",
")",
"{",
"unset",
"(",
"$",
"namesToSort",
"[",
"$",
"currentName",
"]",
")",
";",
"// Before adding the module itself t... | Topologically sorts the given module name into the output array.
The resulting array is sorted such that all predecessors of the module
come before the module (and their predecessors before them, and so on).
@param string $currentName The current module name to sort.
@param array $namesToSort The module names yet to... | [
"Topologically",
"sorts",
"the",
"given",
"module",
"name",
"into",
"the",
"output",
"array",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Conflict/DependencyGraph.php#L400-L417 |
223,841 | apoutchika/MediaBundle | Filesystem/Local.php | Local.getAdapter | public function getAdapter(array $configs)
{
if ($configs['force_absolute_url'] === true) {
$this->urlRelative = $this->urlAbsolute;
}
return new LocalAdapter($this->path);
} | php | public function getAdapter(array $configs)
{
if ($configs['force_absolute_url'] === true) {
$this->urlRelative = $this->urlAbsolute;
}
return new LocalAdapter($this->path);
} | [
"public",
"function",
"getAdapter",
"(",
"array",
"$",
"configs",
")",
"{",
"if",
"(",
"$",
"configs",
"[",
"'force_absolute_url'",
"]",
"===",
"true",
")",
"{",
"$",
"this",
"->",
"urlRelative",
"=",
"$",
"this",
"->",
"urlAbsolute",
";",
"}",
"return",... | Get Adapter.
@param array $configs Parameters in filesystems name, injected in gaufrette adapter
return \Gaufrette\Adapter\Adapter | [
"Get",
"Adapter",
"."
] | dd52efed4a4463041da73af2cb25bdbe00365fcc | https://github.com/apoutchika/MediaBundle/blob/dd52efed4a4463041da73af2cb25bdbe00365fcc/Filesystem/Local.php#L41-L48 |
223,842 | madeyourday/contao-rocksolid-columns | src/Columns.php | Columns.onsubmitCallback | public function onsubmitCallback($dc)
{
$activeRecord = $dc->activeRecord;
if (!$activeRecord) {
return;
}
if ($activeRecord->type === 'rs_columns_start' || $activeRecord->type === 'rs_column_start') {
// Find the next columns or column element
$nextElement = \Database::getInstance()
->prepare('... | php | public function onsubmitCallback($dc)
{
$activeRecord = $dc->activeRecord;
if (!$activeRecord) {
return;
}
if ($activeRecord->type === 'rs_columns_start' || $activeRecord->type === 'rs_column_start') {
// Find the next columns or column element
$nextElement = \Database::getInstance()
->prepare('... | [
"public",
"function",
"onsubmitCallback",
"(",
"$",
"dc",
")",
"{",
"$",
"activeRecord",
"=",
"$",
"dc",
"->",
"activeRecord",
";",
"if",
"(",
"!",
"$",
"activeRecord",
")",
"{",
"return",
";",
"}",
"if",
"(",
"$",
"activeRecord",
"->",
"type",
"===",
... | tl_content DCA onsubmit callback
Creates a stop element after a start element was created
@param DataContainer $dc Data container
@return void | [
"tl_content",
"DCA",
"onsubmit",
"callback"
] | 35ca1f9b17c19fd0b774ed3307a85b58fa4b2705 | https://github.com/madeyourday/contao-rocksolid-columns/blob/35ca1f9b17c19fd0b774ed3307a85b58fa4b2705/src/Columns.php#L90-L154 |
223,843 | puli/manager | src/Json/JsonStorage.php | JsonStorage.saveConfigFile | public function saveConfigFile(ConfigFile $configFile)
{
$this->saveFile($configFile, $configFile->getPath());
if ($this->factoryManager) {
$this->factoryManager->autoGenerateFactoryClass();
}
} | php | public function saveConfigFile(ConfigFile $configFile)
{
$this->saveFile($configFile, $configFile->getPath());
if ($this->factoryManager) {
$this->factoryManager->autoGenerateFactoryClass();
}
} | [
"public",
"function",
"saveConfigFile",
"(",
"ConfigFile",
"$",
"configFile",
")",
"{",
"$",
"this",
"->",
"saveFile",
"(",
"$",
"configFile",
",",
"$",
"configFile",
"->",
"getPath",
"(",
")",
")",
";",
"if",
"(",
"$",
"this",
"->",
"factoryManager",
")... | Saves a configuration file.
The configuration file is saved to the same path that it was read from.
@param ConfigFile $configFile The configuration file to save.
@throws WriteException If the file cannot be written.
@throws InvalidConfigException If the file contains invalid configuration. | [
"Saves",
"a",
"configuration",
"file",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Json/JsonStorage.php#L122-L129 |
223,844 | puli/manager | src/Json/JsonStorage.php | JsonStorage.saveModuleFile | public function saveModuleFile(ModuleFile $moduleFile)
{
$this->saveFile($moduleFile, $moduleFile->getPath(), array(
'targetVersion' => $moduleFile->getVersion(),
));
} | php | public function saveModuleFile(ModuleFile $moduleFile)
{
$this->saveFile($moduleFile, $moduleFile->getPath(), array(
'targetVersion' => $moduleFile->getVersion(),
));
} | [
"public",
"function",
"saveModuleFile",
"(",
"ModuleFile",
"$",
"moduleFile",
")",
"{",
"$",
"this",
"->",
"saveFile",
"(",
"$",
"moduleFile",
",",
"$",
"moduleFile",
"->",
"getPath",
"(",
")",
",",
"array",
"(",
"'targetVersion'",
"=>",
"$",
"moduleFile",
... | Saves a module file.
The module file is saved to the same path that it was read from.
@param ModuleFile $moduleFile The module file to save.
@throws WriteException If the file cannot be written.
@throws InvalidConfigException If the file contains invalid configuration. | [
"Saves",
"a",
"module",
"file",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Json/JsonStorage.php#L157-L162 |
223,845 | puli/manager | src/Json/JsonStorage.php | JsonStorage.saveRootModuleFile | public function saveRootModuleFile(RootModuleFile $moduleFile)
{
$this->saveFile($moduleFile, $moduleFile->getPath(), array(
'targetVersion' => $moduleFile->getVersion(),
));
if ($this->factoryManager) {
$this->factoryManager->autoGenerateFactoryClass();
}
... | php | public function saveRootModuleFile(RootModuleFile $moduleFile)
{
$this->saveFile($moduleFile, $moduleFile->getPath(), array(
'targetVersion' => $moduleFile->getVersion(),
));
if ($this->factoryManager) {
$this->factoryManager->autoGenerateFactoryClass();
}
... | [
"public",
"function",
"saveRootModuleFile",
"(",
"RootModuleFile",
"$",
"moduleFile",
")",
"{",
"$",
"this",
"->",
"saveFile",
"(",
"$",
"moduleFile",
",",
"$",
"moduleFile",
"->",
"getPath",
"(",
")",
",",
"array",
"(",
"'targetVersion'",
"=>",
"$",
"module... | Saves a root module file.
The module file is saved to the same path that it was read from.
@param RootModuleFile $moduleFile The module file to save.
@throws WriteException If the file cannot be written.
@throws InvalidConfigException If the file contains invalid configuration. | [
"Saves",
"a",
"root",
"module",
"file",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Json/JsonStorage.php#L194-L203 |
223,846 | puli/manager | src/Api/Repository/PathConflict.php | PathConflict.addMapping | public function addMapping(PathMapping $mapping)
{
if (!$mapping->isLoaded()) {
throw new NotLoadedException('The passed mapping must be loaded.');
}
$moduleName = $mapping->getContainingModule()->getName();
$previousMapping = isset($this->mappings[$moduleName]) ? $this-... | php | public function addMapping(PathMapping $mapping)
{
if (!$mapping->isLoaded()) {
throw new NotLoadedException('The passed mapping must be loaded.');
}
$moduleName = $mapping->getContainingModule()->getName();
$previousMapping = isset($this->mappings[$moduleName]) ? $this-... | [
"public",
"function",
"addMapping",
"(",
"PathMapping",
"$",
"mapping",
")",
"{",
"if",
"(",
"!",
"$",
"mapping",
"->",
"isLoaded",
"(",
")",
")",
"{",
"throw",
"new",
"NotLoadedException",
"(",
"'The passed mapping must be loaded.'",
")",
";",
"}",
"$",
"mo... | Adds a path mapping involved in the conflict.
@param PathMapping $mapping The path mapping to add.
@throws NotLoadedException If the passed mapping is not loaded. | [
"Adds",
"a",
"path",
"mapping",
"involved",
"in",
"the",
"conflict",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Repository/PathConflict.php#L65-L84 |
223,847 | puli/manager | src/Api/Repository/PathConflict.php | PathConflict.removeMapping | public function removeMapping(PathMapping $mapping)
{
if (!$mapping->isLoaded()) {
throw new NotLoadedException('The passed mapping must be loaded.');
}
$moduleName = $mapping->getContainingModule()->getName();
if (!isset($this->mappings[$moduleName]) || $mapping !== $t... | php | public function removeMapping(PathMapping $mapping)
{
if (!$mapping->isLoaded()) {
throw new NotLoadedException('The passed mapping must be loaded.');
}
$moduleName = $mapping->getContainingModule()->getName();
if (!isset($this->mappings[$moduleName]) || $mapping !== $t... | [
"public",
"function",
"removeMapping",
"(",
"PathMapping",
"$",
"mapping",
")",
"{",
"if",
"(",
"!",
"$",
"mapping",
"->",
"isLoaded",
"(",
")",
")",
"{",
"throw",
"new",
"NotLoadedException",
"(",
"'The passed mapping must be loaded.'",
")",
";",
"}",
"$",
... | Removes a path mapping from the conflict.
If only one path mapping is left after removing this mapping, that
mapping is removed as well. The conflict is then resolved.
@param PathMapping $mapping The path mapping to remove.
@throws NotLoadedException If the passed mapping is not loaded. | [
"Removes",
"a",
"path",
"mapping",
"from",
"the",
"conflict",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Repository/PathConflict.php#L110-L134 |
223,848 | puli/manager | src/Api/Repository/PathConflict.php | PathConflict.resolve | public function resolve()
{
foreach ($this->mappings as $mapping) {
$mapping->removeConflict($this);
}
$this->mappings = array();
} | php | public function resolve()
{
foreach ($this->mappings as $mapping) {
$mapping->removeConflict($this);
}
$this->mappings = array();
} | [
"public",
"function",
"resolve",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"mappings",
"as",
"$",
"mapping",
")",
"{",
"$",
"mapping",
"->",
"removeConflict",
"(",
"$",
"this",
")",
";",
"}",
"$",
"this",
"->",
"mappings",
"=",
"array",
"(",
... | Resolves the conflict.
This method removes all mappings from the conflict. After calling this
method, {@link isResolved()} returns `true`. | [
"Resolves",
"the",
"conflict",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Repository/PathConflict.php#L152-L159 |
223,849 | ongr-io/FilterManagerBundle | Filter/Widget/Search/MatchSearch.php | MatchSearch.buildMatchPart | private function buildMatchPart($field, FilterState $state)
{
if (strpos($field, '>') !== false) {
list ($path, $field) = explode('>', $field);
}
if (strpos($field, '^') !== false) {
list ($field, $boost) = explode('^', $field);
}
$query = new Match... | php | private function buildMatchPart($field, FilterState $state)
{
if (strpos($field, '>') !== false) {
list ($path, $field) = explode('>', $field);
}
if (strpos($field, '^') !== false) {
list ($field, $boost) = explode('^', $field);
}
$query = new Match... | [
"private",
"function",
"buildMatchPart",
"(",
"$",
"field",
",",
"FilterState",
"$",
"state",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"field",
",",
"'>'",
")",
"!==",
"false",
")",
"{",
"list",
"(",
"$",
"path",
",",
"$",
"field",
")",
"=",
"explo... | Build possibly nested match part.
@param string $field
@param FilterState $state
@return BuilderInterface | [
"Build",
"possibly",
"nested",
"match",
"part",
"."
] | 26c1125457f0440019b9bf20090bf23ba4bb1905 | https://github.com/ongr-io/FilterManagerBundle/blob/26c1125457f0440019b9bf20090bf23ba4bb1905/Filter/Widget/Search/MatchSearch.php#L51-L69 |
223,850 | puli/manager | src/Api/Module/ModuleList.php | ModuleList.add | public function add(Module $module)
{
$this->modules[$module->getName()] = $module;
if ($module instanceof RootModule) {
$this->rootModule = $module;
}
} | php | public function add(Module $module)
{
$this->modules[$module->getName()] = $module;
if ($module instanceof RootModule) {
$this->rootModule = $module;
}
} | [
"public",
"function",
"add",
"(",
"Module",
"$",
"module",
")",
"{",
"$",
"this",
"->",
"modules",
"[",
"$",
"module",
"->",
"getName",
"(",
")",
"]",
"=",
"$",
"module",
";",
"if",
"(",
"$",
"module",
"instanceof",
"RootModule",
")",
"{",
"$",
"th... | Adds a module to the collection.
@param Module $module The added module. | [
"Adds",
"a",
"module",
"to",
"the",
"collection",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Module/ModuleList.php#L48-L55 |
223,851 | puli/manager | src/Api/Module/ModuleList.php | ModuleList.remove | public function remove($name)
{
if ($this->rootModule && $name === $this->rootModule->getName()) {
$this->rootModule = null;
}
unset($this->modules[$name]);
} | php | public function remove($name)
{
if ($this->rootModule && $name === $this->rootModule->getName()) {
$this->rootModule = null;
}
unset($this->modules[$name]);
} | [
"public",
"function",
"remove",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"rootModule",
"&&",
"$",
"name",
"===",
"$",
"this",
"->",
"rootModule",
"->",
"getName",
"(",
")",
")",
"{",
"$",
"this",
"->",
"rootModule",
"=",
"null",
";... | Removes a module from the collection.
@param string $name The module name. | [
"Removes",
"a",
"module",
"from",
"the",
"collection",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Module/ModuleList.php#L85-L92 |
223,852 | puli/manager | src/Api/Module/ModuleList.php | ModuleList.get | public function get($name)
{
if (!isset($this->modules[$name])) {
throw new NoSuchModuleException(sprintf(
'The module "%s" was not found.',
$name
));
}
return $this->modules[$name];
} | php | public function get($name)
{
if (!isset($this->modules[$name])) {
throw new NoSuchModuleException(sprintf(
'The module "%s" was not found.',
$name
));
}
return $this->modules[$name];
} | [
"public",
"function",
"get",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"modules",
"[",
"$",
"name",
"]",
")",
")",
"{",
"throw",
"new",
"NoSuchModuleException",
"(",
"sprintf",
"(",
"'The module \"%s\" was not found.'",
... | Returns the module with the given name.
@param string $name The module name.
@return Module The module with the passed name.
@throws NoSuchModuleException If the module was not found. | [
"Returns",
"the",
"module",
"with",
"the",
"given",
"name",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Module/ModuleList.php#L115-L125 |
223,853 | puli/manager | src/Api/Module/ModuleList.php | ModuleList.getInstalledModules | public function getInstalledModules()
{
$modules = $this->modules;
if ($this->rootModule) {
unset($modules[$this->rootModule->getName()]);
}
return $modules;
} | php | public function getInstalledModules()
{
$modules = $this->modules;
if ($this->rootModule) {
unset($modules[$this->rootModule->getName()]);
}
return $modules;
} | [
"public",
"function",
"getInstalledModules",
"(",
")",
"{",
"$",
"modules",
"=",
"$",
"this",
"->",
"modules",
";",
"if",
"(",
"$",
"this",
"->",
"rootModule",
")",
"{",
"unset",
"(",
"$",
"modules",
"[",
"$",
"this",
"->",
"rootModule",
"->",
"getName... | Returns all installed modules.
The installed modules are all modules that are not the root module.
@return Module[] The installed modules indexed by their names. | [
"Returns",
"all",
"installed",
"modules",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Module/ModuleList.php#L170-L179 |
223,854 | puli/manager | src/Conflict/ModuleConflictDetector.php | ModuleConflictDetector.claim | public function claim($token, $moduleName)
{
if (!isset($this->tokens[$token])) {
$this->tokens[$token] = array();
}
$this->tokens[$token][$moduleName] = true;
} | php | public function claim($token, $moduleName)
{
if (!isset($this->tokens[$token])) {
$this->tokens[$token] = array();
}
$this->tokens[$token][$moduleName] = true;
} | [
"public",
"function",
"claim",
"(",
"$",
"token",
",",
"$",
"moduleName",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"tokens",
"[",
"$",
"token",
"]",
")",
")",
"{",
"$",
"this",
"->",
"tokens",
"[",
"$",
"token",
"]",
"=",
"arr... | Claims a token for a module.
@param int|string $token The claimed token. Can be any integer or
string.
@param string $moduleName The module name. | [
"Claims",
"a",
"token",
"for",
"a",
"module",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Conflict/ModuleConflictDetector.php#L98-L105 |
223,855 | puli/manager | src/Conflict/ModuleConflictDetector.php | ModuleConflictDetector.detectConflicts | public function detectConflicts(array $tokens = null)
{
$tokens = null === $tokens ? array_keys($this->tokens) : $tokens;
$conflicts = array();
foreach ($tokens as $token) {
// Claim was released
if (!isset($this->tokens[$token])) {
continue;
... | php | public function detectConflicts(array $tokens = null)
{
$tokens = null === $tokens ? array_keys($this->tokens) : $tokens;
$conflicts = array();
foreach ($tokens as $token) {
// Claim was released
if (!isset($this->tokens[$token])) {
continue;
... | [
"public",
"function",
"detectConflicts",
"(",
"array",
"$",
"tokens",
"=",
"null",
")",
"{",
"$",
"tokens",
"=",
"null",
"===",
"$",
"tokens",
"?",
"array_keys",
"(",
"$",
"this",
"->",
"tokens",
")",
":",
"$",
"tokens",
";",
"$",
"conflicts",
"=",
"... | Checks the passed tokens for conflicts.
If no tokens are passed, all tokens are checked.
A conflict is returned for every token that is claimed by two modules
that are not connected by an edge in the override graph. In other words,
if two modules A and B claim the same token, an edge must exist from A
to B (A is over... | [
"Checks",
"the",
"passed",
"tokens",
"for",
"conflicts",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Conflict/ModuleConflictDetector.php#L138-L175 |
223,856 | OXID-eSales/oxid-eshop-ide-helper | src/Core/DirectoryScanner.php | DirectoryScanner.scanDirectory | private function scanDirectory($directoryPath)
{
if (is_dir($directoryPath)) {
$files = scandir($directoryPath);
foreach ($files as $fileName) {
$filePath = Path::join($directoryPath, $fileName);
if (is_dir($filePath) && !in_array($fileName, ['.', '..'... | php | private function scanDirectory($directoryPath)
{
if (is_dir($directoryPath)) {
$files = scandir($directoryPath);
foreach ($files as $fileName) {
$filePath = Path::join($directoryPath, $fileName);
if (is_dir($filePath) && !in_array($fileName, ['.', '..'... | [
"private",
"function",
"scanDirectory",
"(",
"$",
"directoryPath",
")",
"{",
"if",
"(",
"is_dir",
"(",
"$",
"directoryPath",
")",
")",
"{",
"$",
"files",
"=",
"scandir",
"(",
"$",
"directoryPath",
")",
";",
"foreach",
"(",
"$",
"files",
"as",
"$",
"fil... | Recursive search for matching files.
@param string $clearFolderPath Sub-folder path to check for search file name. | [
"Recursive",
"search",
"for",
"matching",
"files",
"."
] | e29836a482e7e2386ebb1cefd01e31240e2b3847 | https://github.com/OXID-eSales/oxid-eshop-ide-helper/blob/e29836a482e7e2386ebb1cefd01e31240e2b3847/src/Core/DirectoryScanner.php#L60-L73 |
223,857 | puli/manager | src/Installer/ModuleFileInstallerManager.php | ModuleFileInstallerManager.installerToData | private function installerToData(InstallerDescriptor $installer)
{
$data = (object) array(
'class' => $installer->getClassName(),
);
if ($installer->getDescription()) {
$data->description = $installer->getDescription();
}
if ($installer->getParameter... | php | private function installerToData(InstallerDescriptor $installer)
{
$data = (object) array(
'class' => $installer->getClassName(),
);
if ($installer->getDescription()) {
$data->description = $installer->getDescription();
}
if ($installer->getParameter... | [
"private",
"function",
"installerToData",
"(",
"InstallerDescriptor",
"$",
"installer",
")",
"{",
"$",
"data",
"=",
"(",
"object",
")",
"array",
"(",
"'class'",
"=>",
"$",
"installer",
"->",
"getClassName",
"(",
")",
",",
")",
";",
"if",
"(",
"$",
"insta... | Extracting an object containing the data from an installer descriptor.
@param InstallerDescriptor $installer The installer descriptor.
@return stdClass | [
"Extracting",
"an",
"object",
"containing",
"the",
"data",
"from",
"an",
"installer",
"descriptor",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Installer/ModuleFileInstallerManager.php#L472-L487 |
223,858 | madeyourday/contao-rocksolid-frontend-helper | src/BackendHooks.php | BackendHooks.removeRsfhrParam | private function removeRsfhrParam($ref)
{
$session = \System::getContainer()->get('session');
if (!$session->isStarted()) {
return;
}
$referrerSession = $session->get('referer');
if (!empty($referrerSession[$ref]['current'])) {
$referrerSession[$ref]['current'] = preg_replace('(([&?])rsfhr=1(&|$))', '... | php | private function removeRsfhrParam($ref)
{
$session = \System::getContainer()->get('session');
if (!$session->isStarted()) {
return;
}
$referrerSession = $session->get('referer');
if (!empty($referrerSession[$ref]['current'])) {
$referrerSession[$ref]['current'] = preg_replace('(([&?])rsfhr=1(&|$))', '... | [
"private",
"function",
"removeRsfhrParam",
"(",
"$",
"ref",
")",
"{",
"$",
"session",
"=",
"\\",
"System",
"::",
"getContainer",
"(",
")",
"->",
"get",
"(",
"'session'",
")",
";",
"if",
"(",
"!",
"$",
"session",
"->",
"isStarted",
"(",
")",
")",
"{",... | Remove the `rsfhr=1` parameter from the session referer
@param string $ref | [
"Remove",
"the",
"rsfhr",
"=",
"1",
"parameter",
"from",
"the",
"session",
"referer"
] | 1a0bf45a3d3913f8436ccd284965e7c37a463f28 | https://github.com/madeyourday/contao-rocksolid-frontend-helper/blob/1a0bf45a3d3913f8436ccd284965e7c37a463f28/src/BackendHooks.php#L70-L82 |
223,859 | madeyourday/contao-rocksolid-frontend-helper | src/BackendHooks.php | BackendHooks.handleTemplateSelection | private function handleTemplateSelection()
{
if (\Input::get('key') !== 'new_tpl') {
return;
}
if (\Input::get('original') && !\Input::post('original')) {
// Preselect the original template
\Input::setPost('original', \Input::get('original'));
}
if (\Input::get('target') && !\Input::post('target')... | php | private function handleTemplateSelection()
{
if (\Input::get('key') !== 'new_tpl') {
return;
}
if (\Input::get('original') && !\Input::post('original')) {
// Preselect the original template
\Input::setPost('original', \Input::get('original'));
}
if (\Input::get('target') && !\Input::post('target')... | [
"private",
"function",
"handleTemplateSelection",
"(",
")",
"{",
"if",
"(",
"\\",
"Input",
"::",
"get",
"(",
"'key'",
")",
"!==",
"'new_tpl'",
")",
"{",
"return",
";",
"}",
"if",
"(",
"\\",
"Input",
"::",
"get",
"(",
"'original'",
")",
"&&",
"!",
"\\... | Preselects the original template in the template editor | [
"Preselects",
"the",
"original",
"template",
"in",
"the",
"template",
"editor"
] | 1a0bf45a3d3913f8436ccd284965e7c37a463f28 | https://github.com/madeyourday/contao-rocksolid-frontend-helper/blob/1a0bf45a3d3913f8436ccd284965e7c37a463f28/src/BackendHooks.php#L87-L102 |
223,860 | madeyourday/contao-rocksolid-frontend-helper | src/BackendHooks.php | BackendHooks.storeFrontendReferrer | private function storeFrontendReferrer()
{
$base = \Environment::get('path');
$base .= \System::getContainer()->get('router')->generate('contao_backend');
$referrer = parse_url(\Environment::get('httpReferer'));
$referrer = $referrer['path'] . ($referrer['query'] ? '?' . $referrer['query'] : '');
// Stop i... | php | private function storeFrontendReferrer()
{
$base = \Environment::get('path');
$base .= \System::getContainer()->get('router')->generate('contao_backend');
$referrer = parse_url(\Environment::get('httpReferer'));
$referrer = $referrer['path'] . ($referrer['query'] ? '?' . $referrer['query'] : '');
// Stop i... | [
"private",
"function",
"storeFrontendReferrer",
"(",
")",
"{",
"$",
"base",
"=",
"\\",
"Environment",
"::",
"get",
"(",
"'path'",
")",
";",
"$",
"base",
".=",
"\\",
"System",
"::",
"getContainer",
"(",
")",
"->",
"get",
"(",
"'router'",
")",
"->",
"gen... | Saves the referrer in the session if it is a frontend URL | [
"Saves",
"the",
"referrer",
"in",
"the",
"session",
"if",
"it",
"is",
"a",
"frontend",
"URL"
] | 1a0bf45a3d3913f8436ccd284965e7c37a463f28 | https://github.com/madeyourday/contao-rocksolid-frontend-helper/blob/1a0bf45a3d3913f8436ccd284965e7c37a463f28/src/BackendHooks.php#L107-L153 |
223,861 | puli/manager | src/Api/Module/ModuleFile.php | ModuleFile.setVersion | public function setVersion($version)
{
Assert::string($version, 'The module file version must be a string. Got: %s');
Assert::regex($version, '~^\d\.\d$~', 'The module file version must have the format "<digit>.<digit>". Got: %s</digit>');
$this->version = $version;
} | php | public function setVersion($version)
{
Assert::string($version, 'The module file version must be a string. Got: %s');
Assert::regex($version, '~^\d\.\d$~', 'The module file version must have the format "<digit>.<digit>". Got: %s</digit>');
$this->version = $version;
} | [
"public",
"function",
"setVersion",
"(",
"$",
"version",
")",
"{",
"Assert",
"::",
"string",
"(",
"$",
"version",
",",
"'The module file version must be a string. Got: %s'",
")",
";",
"Assert",
"::",
"regex",
"(",
"$",
"version",
",",
"'~^\\d\\.\\d$~'",
",",
"'T... | Sets the version of the module file.
@param string $version The module file version. | [
"Sets",
"the",
"version",
"of",
"the",
"module",
"file",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Module/ModuleFile.php#L106-L112 |
223,862 | puli/manager | src/Api/Module/ModuleFile.php | ModuleFile.setDependencies | public function setDependencies(array $moduleNames)
{
$this->dependencies = array();
foreach ($moduleNames as $moduleName) {
$this->dependencies[$moduleName] = true;
}
} | php | public function setDependencies(array $moduleNames)
{
$this->dependencies = array();
foreach ($moduleNames as $moduleName) {
$this->dependencies[$moduleName] = true;
}
} | [
"public",
"function",
"setDependencies",
"(",
"array",
"$",
"moduleNames",
")",
"{",
"$",
"this",
"->",
"dependencies",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"moduleNames",
"as",
"$",
"moduleName",
")",
"{",
"$",
"this",
"->",
"dependencies",
... | Sets the names of the modules this module depends on.
@param string[] $moduleNames The names of the modules. | [
"Sets",
"the",
"names",
"of",
"the",
"modules",
"this",
"module",
"depends",
"on",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Module/ModuleFile.php#L154-L161 |
223,863 | puli/manager | src/Api/Module/ModuleFile.php | ModuleFile.getPathMapping | public function getPathMapping($repositoryPath)
{
if (!isset($this->pathMappings[$repositoryPath])) {
throw NoSuchPathMappingException::forRepositoryPath($repositoryPath);
}
return $this->pathMappings[$repositoryPath];
} | php | public function getPathMapping($repositoryPath)
{
if (!isset($this->pathMappings[$repositoryPath])) {
throw NoSuchPathMappingException::forRepositoryPath($repositoryPath);
}
return $this->pathMappings[$repositoryPath];
} | [
"public",
"function",
"getPathMapping",
"(",
"$",
"repositoryPath",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"pathMappings",
"[",
"$",
"repositoryPath",
"]",
")",
")",
"{",
"throw",
"NoSuchPathMappingException",
"::",
"forRepositoryPath",
"("... | Returns the path mapping for a repository path.
@param string $repositoryPath The repository path.
@return PathMapping The corresponding path mapping.
@throws NoSuchPathMappingException If the repository path is not mapped. | [
"Returns",
"the",
"path",
"mapping",
"for",
"a",
"repository",
"path",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Module/ModuleFile.php#L243-L250 |
223,864 | puli/manager | src/Api/Module/ModuleFile.php | ModuleFile.getBindingDescriptor | public function getBindingDescriptor(Uuid $uuid)
{
$uuidString = $uuid->toString();
if (!isset($this->bindingDescriptors[$uuidString])) {
throw NoSuchBindingException::forUuid($uuid);
}
return $this->bindingDescriptors[$uuidString];
} | php | public function getBindingDescriptor(Uuid $uuid)
{
$uuidString = $uuid->toString();
if (!isset($this->bindingDescriptors[$uuidString])) {
throw NoSuchBindingException::forUuid($uuid);
}
return $this->bindingDescriptors[$uuidString];
} | [
"public",
"function",
"getBindingDescriptor",
"(",
"Uuid",
"$",
"uuid",
")",
"{",
"$",
"uuidString",
"=",
"$",
"uuid",
"->",
"toString",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"bindingDescriptors",
"[",
"$",
"uuidString",
"]",
... | Returns the binding descriptor with the given UUID.
@param Uuid $uuid The UUID of the binding descriptor.
@return BindingDescriptor The binding descriptor.
@throws NoSuchBindingException If the UUID was not found. | [
"Returns",
"the",
"binding",
"descriptor",
"with",
"the",
"given",
"UUID",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Module/ModuleFile.php#L324-L333 |
223,865 | puli/manager | src/Api/Module/ModuleFile.php | ModuleFile.getExtraKey | public function getExtraKey($key, $default = null)
{
return array_key_exists($key, $this->extra) ? $this->extra[$key] : $default;
} | php | public function getExtraKey($key, $default = null)
{
return array_key_exists($key, $this->extra) ? $this->extra[$key] : $default;
} | [
"public",
"function",
"getExtraKey",
"(",
"$",
"key",
",",
"$",
"default",
"=",
"null",
")",
"{",
"return",
"array_key_exists",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"extra",
")",
"?",
"$",
"this",
"->",
"extra",
"[",
"$",
"key",
"]",
":",
"$",
... | Returns the value of an extra key.
@param string $key The name of the key.
@param mixed $default The value to return if the key was not set.
@return mixed The value stored for the key.
@see setExtraKey() | [
"Returns",
"the",
"value",
"of",
"an",
"extra",
"key",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Module/ModuleFile.php#L540-L543 |
223,866 | bitverseio/identicon | src/Bitverse/Identicon/Generator/RingsGenerator.php | RingsGenerator.getBackground | private function getBackground()
{
return (new Circle($this->getX(), $this->getY(), $this->getRadius()))
->setFillColor($this->getBackgroundColor())
->setStrokeWidth(0);
} | php | private function getBackground()
{
return (new Circle($this->getX(), $this->getY(), $this->getRadius()))
->setFillColor($this->getBackgroundColor())
->setStrokeWidth(0);
} | [
"private",
"function",
"getBackground",
"(",
")",
"{",
"return",
"(",
"new",
"Circle",
"(",
"$",
"this",
"->",
"getX",
"(",
")",
",",
"$",
"this",
"->",
"getY",
"(",
")",
",",
"$",
"this",
"->",
"getRadius",
"(",
")",
")",
")",
"->",
"setFillColor"... | Returns the background for the image.
@return SvgNode | [
"Returns",
"the",
"background",
"for",
"the",
"image",
"."
] | 5a015546e7f29d537807e0877446e2cd704ca438 | https://github.com/bitverseio/identicon/blob/5a015546e7f29d537807e0877446e2cd704ca438/src/Bitverse/Identicon/Generator/RingsGenerator.php#L57-L62 |
223,867 | bitverseio/identicon | src/Bitverse/Identicon/Generator/RingsGenerator.php | RingsGenerator.getCenter | private function getCenter(Color $color)
{
return (new Circle($this->getX(), $this->getY(), $this->getCenterRadius()))
->setFillColor($color)
->setStrokeWidth(0);
} | php | private function getCenter(Color $color)
{
return (new Circle($this->getX(), $this->getY(), $this->getCenterRadius()))
->setFillColor($color)
->setStrokeWidth(0);
} | [
"private",
"function",
"getCenter",
"(",
"Color",
"$",
"color",
")",
"{",
"return",
"(",
"new",
"Circle",
"(",
"$",
"this",
"->",
"getX",
"(",
")",
",",
"$",
"this",
"->",
"getY",
"(",
")",
",",
"$",
"this",
"->",
"getCenterRadius",
"(",
")",
")",
... | Returns the center dot for the image.
@param Color $color Color for the dot.
@return SvgNode | [
"Returns",
"the",
"center",
"dot",
"for",
"the",
"image",
"."
] | 5a015546e7f29d537807e0877446e2cd704ca438 | https://github.com/bitverseio/identicon/blob/5a015546e7f29d537807e0877446e2cd704ca438/src/Bitverse/Identicon/Generator/RingsGenerator.php#L71-L76 |
223,868 | bitverseio/identicon | src/Bitverse/Identicon/Generator/RingsGenerator.php | RingsGenerator.getArc | private function getArc(Color $color, $x, $y, $radius, $angle, $width, $start = 0)
{
return (new Path(
$x + $radius * cos(deg2rad($start)),
$y + $radius * sin(deg2rad($start))
))
->setFillColor($color)
->setStrokeColor($color)
-... | php | private function getArc(Color $color, $x, $y, $radius, $angle, $width, $start = 0)
{
return (new Path(
$x + $radius * cos(deg2rad($start)),
$y + $radius * sin(deg2rad($start))
))
->setFillColor($color)
->setStrokeColor($color)
-... | [
"private",
"function",
"getArc",
"(",
"Color",
"$",
"color",
",",
"$",
"x",
",",
"$",
"y",
",",
"$",
"radius",
",",
"$",
"angle",
",",
"$",
"width",
",",
"$",
"start",
"=",
"0",
")",
"{",
"return",
"(",
"new",
"Path",
"(",
"$",
"x",
"+",
"$",... | Returns an arc drawn according to the passed specification.
@param float $radius Radius of the arc.
@param float $angle Angle of the arc.
@param float $start Starting angle for the arc.
@return SvgNode | [
"Returns",
"an",
"arc",
"drawn",
"according",
"to",
"the",
"passed",
"specification",
"."
] | 5a015546e7f29d537807e0877446e2cd704ca438 | https://github.com/bitverseio/identicon/blob/5a015546e7f29d537807e0877446e2cd704ca438/src/Bitverse/Identicon/Generator/RingsGenerator.php#L87-L122 |
223,869 | bitverseio/identicon | src/Bitverse/Identicon/Generator/RingsGenerator.php | RingsGenerator.getRingAngle | private function getRingAngle($ring, $hash)
{
return 10 * pow(2, 3 - $ring) * array_reduce(
str_split($hash, pow(2, 3 - $ring)),
function ($total, $substr) {
return $total + (hexdec($substr) % 2);
},
0
);
} | php | private function getRingAngle($ring, $hash)
{
return 10 * pow(2, 3 - $ring) * array_reduce(
str_split($hash, pow(2, 3 - $ring)),
function ($total, $substr) {
return $total + (hexdec($substr) % 2);
},
0
);
} | [
"private",
"function",
"getRingAngle",
"(",
"$",
"ring",
",",
"$",
"hash",
")",
"{",
"return",
"10",
"*",
"pow",
"(",
"2",
",",
"3",
"-",
"$",
"ring",
")",
"*",
"array_reduce",
"(",
"str_split",
"(",
"$",
"hash",
",",
"pow",
"(",
"2",
",",
"3",
... | Returns the angle in degrees for the given ring, based on the hash.
@param integer $ring
@param string $hash
@return integer | [
"Returns",
"the",
"angle",
"in",
"degrees",
"for",
"the",
"given",
"ring",
"based",
"on",
"the",
"hash",
"."
] | 5a015546e7f29d537807e0877446e2cd704ca438 | https://github.com/bitverseio/identicon/blob/5a015546e7f29d537807e0877446e2cd704ca438/src/Bitverse/Identicon/Generator/RingsGenerator.php#L184-L193 |
223,870 | GGGGino/WordBundle | Factory.php | Factory.createPHPWordObject | public function createPHPWordObject($filename = null)
{
return (null === $filename) ? new PhpWord() : call_user_func(array($this->phpWordIO, 'load'), $filename);
} | php | public function createPHPWordObject($filename = null)
{
return (null === $filename) ? new PhpWord() : call_user_func(array($this->phpWordIO, 'load'), $filename);
} | [
"public",
"function",
"createPHPWordObject",
"(",
"$",
"filename",
"=",
"null",
")",
"{",
"return",
"(",
"null",
"===",
"$",
"filename",
")",
"?",
"new",
"PhpWord",
"(",
")",
":",
"call_user_func",
"(",
"array",
"(",
"$",
"this",
"->",
"phpWordIO",
",",
... | Creates an empty PhpWord Object if the filename is empty, otherwise loads the file into the object.
@param string $filename
@return PhpWord | [
"Creates",
"an",
"empty",
"PhpWord",
"Object",
"if",
"the",
"filename",
"is",
"empty",
"otherwise",
"loads",
"the",
"file",
"into",
"the",
"object",
"."
] | 2a1ace7c89326d0e64d1a1cbfb0224eebeb2fe36 | https://github.com/GGGGino/WordBundle/blob/2a1ace7c89326d0e64d1a1cbfb0224eebeb2fe36/Factory.php#L33-L36 |
223,871 | GGGGino/WordBundle | Factory.php | Factory.getPhpWordObjFromTemplate | public function getPhpWordObjFromTemplate($templateobj)
{
$fileName = $templateobj->save();
$phpWordObject = IOFactory::load($fileName);
unlink($fileName);
return $phpWordObject;
} | php | public function getPhpWordObjFromTemplate($templateobj)
{
$fileName = $templateobj->save();
$phpWordObject = IOFactory::load($fileName);
unlink($fileName);
return $phpWordObject;
} | [
"public",
"function",
"getPhpWordObjFromTemplate",
"(",
"$",
"templateobj",
")",
"{",
"$",
"fileName",
"=",
"$",
"templateobj",
"->",
"save",
"(",
")",
";",
"$",
"phpWordObject",
"=",
"IOFactory",
"::",
"load",
"(",
"$",
"fileName",
")",
";",
"unlink",
"("... | From the template load the
@param TemplateProcessor $templateobj
@return PhpWord | [
"From",
"the",
"template",
"load",
"the"
] | 2a1ace7c89326d0e64d1a1cbfb0224eebeb2fe36 | https://github.com/GGGGino/WordBundle/blob/2a1ace7c89326d0e64d1a1cbfb0224eebeb2fe36/Factory.php#L57-L66 |
223,872 | phonetworks/pho-microkernel | src/Pho/Kernel/Init.php | Init.reconfigure | public function reconfigure( array $settings = [] ): void
{
if($this->is_running) {
throw new Exceptions\KernelAlreadyRunningException("You cannot reconfigure a running kernel.");
}
$this["settings"] = $settings;
$this["config"] = $this->share(function($c) {
$config = new \Zend\Config\C... | php | public function reconfigure( array $settings = [] ): void
{
if($this->is_running) {
throw new Exceptions\KernelAlreadyRunningException("You cannot reconfigure a running kernel.");
}
$this["settings"] = $settings;
$this["config"] = $this->share(function($c) {
$config = new \Zend\Config\C... | [
"public",
"function",
"reconfigure",
"(",
"array",
"$",
"settings",
"=",
"[",
"]",
")",
":",
"void",
"{",
"if",
"(",
"$",
"this",
"->",
"is_running",
")",
"{",
"throw",
"new",
"Exceptions",
"\\",
"KernelAlreadyRunningException",
"(",
"\"You cannot reconfigure ... | Sets up the kernel settings.
Configuration variables can be passed to the kernel either
at construction (e.g. ```$kernel = new Kernel(...);```)
or afterwards, using this function ```$kernel->reconfigure(...);```
Please note, this function should be run before calling the
*boot* function, or otherwise it will not have ... | [
"Sets",
"up",
"the",
"kernel",
"settings",
"."
] | 3983764e4e7cf980bc11d0385f1c6ea57ae723b1 | https://github.com/phonetworks/pho-microkernel/blob/3983764e4e7cf980bc11d0385f1c6ea57ae723b1/src/Pho/Kernel/Init.php#L67-L90 |
223,873 | phonetworks/pho-microkernel | src/Pho/Kernel/Init.php | Init.setupServices | protected function setupServices(): void
{
$service_factory = new Services\ServiceFactory($this);
foreach($this->config()->services->toArray() as $key => $service) {
$this[$key] = $this->share( function($c) use($key, $service, $service_factory) {
try {
return $ser... | php | protected function setupServices(): void
{
$service_factory = new Services\ServiceFactory($this);
foreach($this->config()->services->toArray() as $key => $service) {
$this[$key] = $this->share( function($c) use($key, $service, $service_factory) {
try {
return $ser... | [
"protected",
"function",
"setupServices",
"(",
")",
":",
"void",
"{",
"$",
"service_factory",
"=",
"new",
"Services",
"\\",
"ServiceFactory",
"(",
"$",
"this",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"config",
"(",
")",
"->",
"services",
"->",
"toAr... | Sets up kernel services.
Private method that readies kernel services according to user settings and system
defaults. The services don't initialize right away but start when requested. | [
"Sets",
"up",
"kernel",
"services",
"."
] | 3983764e4e7cf980bc11d0385f1c6ea57ae723b1 | https://github.com/phonetworks/pho-microkernel/blob/3983764e4e7cf980bc11d0385f1c6ea57ae723b1/src/Pho/Kernel/Init.php#L99-L112 |
223,874 | phonetworks/pho-microkernel | src/Pho/Kernel/Init.php | Init.registerListeners | protected function registerListeners(Graph\GraphInterface $graph): void
{
$this->logger()->info("Registering listeners.");
$nodes = array_values($graph->members());
$node_count = count($nodes);
$this->logger()->info(
"Total # of nodes for the graph \"%s\": %s", $graph->id(), (string) $nod... | php | protected function registerListeners(Graph\GraphInterface $graph): void
{
$this->logger()->info("Registering listeners.");
$nodes = array_values($graph->members());
$node_count = count($nodes);
$this->logger()->info(
"Total # of nodes for the graph \"%s\": %s", $graph->id(), (string) $nod... | [
"protected",
"function",
"registerListeners",
"(",
"Graph",
"\\",
"GraphInterface",
"$",
"graph",
")",
":",
"void",
"{",
"$",
"this",
"->",
"logger",
"(",
")",
"->",
"info",
"(",
"\"Registering listeners.\"",
")",
";",
"$",
"nodes",
"=",
"array_values",
"(",... | Registers listeners that are default to the kernel.
@param AbstractContext $graph The graph object to start traversal from. | [
"Registers",
"listeners",
"that",
"are",
"default",
"to",
"the",
"kernel",
"."
] | 3983764e4e7cf980bc11d0385f1c6ea57ae723b1 | https://github.com/phonetworks/pho-microkernel/blob/3983764e4e7cf980bc11d0385f1c6ea57ae723b1/src/Pho/Kernel/Init.php#L120-L152 |
223,875 | phonetworks/pho-microkernel | src/Pho/Kernel/Init.php | Init.seedRoot | protected function seedRoot(? Foundation\AbstractActor $founder = null): void
{
$graph_id = $this->database()->get("configs:graph_id");
if(isset($graph_id)) {
$this->logger()->info(
"Existing network with id: %s",
$graph_id
);
$this["graph"] = $this-... | php | protected function seedRoot(? Foundation\AbstractActor $founder = null): void
{
$graph_id = $this->database()->get("configs:graph_id");
if(isset($graph_id)) {
$this->logger()->info(
"Existing network with id: %s",
$graph_id
);
$this["graph"] = $this-... | [
"protected",
"function",
"seedRoot",
"(",
"?",
"Foundation",
"\\",
"AbstractActor",
"$",
"founder",
"=",
"null",
")",
":",
"void",
"{",
"$",
"graph_id",
"=",
"$",
"this",
"->",
"database",
"(",
")",
"->",
"get",
"(",
"\"configs:graph_id\"",
")",
";",
"if... | Ensures that there is a root Graph attached to the kernel.
Used privately by the kernel.
@param ?Foundation\AbstractActor The founder object or null (to set
it up with default values or retrieve from the database)
@return void | [
"Ensures",
"that",
"there",
"is",
"a",
"root",
"Graph",
"attached",
"to",
"the",
"kernel",
".",
"Used",
"privately",
"by",
"the",
"kernel",
"."
] | 3983764e4e7cf980bc11d0385f1c6ea57ae723b1 | https://github.com/phonetworks/pho-microkernel/blob/3983764e4e7cf980bc11d0385f1c6ea57ae723b1/src/Pho/Kernel/Init.php#L163-L217 |
223,876 | tivie/php-git-log-parser | src/Format.php | Format.setFormat | public function setFormat($format, $commitDelimiter, $fieldDelimiter)
{
if (!is_string($format)) {
throw new InvalidArgumentException('string', 0);
}
if (!is_string($commitDelimiter)) {
throw new InvalidArgumentException('string', 1);
}
if (!is_string(... | php | public function setFormat($format, $commitDelimiter, $fieldDelimiter)
{
if (!is_string($format)) {
throw new InvalidArgumentException('string', 0);
}
if (!is_string($commitDelimiter)) {
throw new InvalidArgumentException('string', 1);
}
if (!is_string(... | [
"public",
"function",
"setFormat",
"(",
"$",
"format",
",",
"$",
"commitDelimiter",
",",
"$",
"fieldDelimiter",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"format",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'string'",
",",
"0",... | Set the format that should be used by git log command
@param string $format A string that follows the git log format specification.
@param string $commitDelimiter The commit delimiter used by this format
@param string $fieldDelimiter The field delimiter used by this format
@return $this
@throws InvalidArgumentExceptio... | [
"Set",
"the",
"format",
"that",
"should",
"be",
"used",
"by",
"git",
"log",
"command"
] | bb6742cbbd4dd293f92b0d50b63c458b9b3986c2 | https://github.com/tivie/php-git-log-parser/blob/bb6742cbbd4dd293f92b0d50b63c458b9b3986c2/src/Format.php#L133-L149 |
223,877 | koala-framework/composer-extra-assets | Kwf/ComposerExtraAssets/LinkWriter.php | LinkWriter.writeLink | public function writeLink($target)
{
$fileName = basename($target);
$realTarget = realpath($target);
$relativePathToTarget = $this->makePathRelative(dirname($realTarget), $this->binaryDir).basename($realTarget);
// If Windows cmd link
if (pathinfo($target, PATHINFO_EXTENSION... | php | public function writeLink($target)
{
$fileName = basename($target);
$realTarget = realpath($target);
$relativePathToTarget = $this->makePathRelative(dirname($realTarget), $this->binaryDir).basename($realTarget);
// If Windows cmd link
if (pathinfo($target, PATHINFO_EXTENSION... | [
"public",
"function",
"writeLink",
"(",
"$",
"target",
")",
"{",
"$",
"fileName",
"=",
"basename",
"(",
"$",
"target",
")",
";",
"$",
"realTarget",
"=",
"realpath",
"(",
"$",
"target",
")",
";",
"$",
"relativePathToTarget",
"=",
"$",
"this",
"->",
"mak... | Writes a shortcut to the target link in the vendor directory.
@param string $target | [
"Writes",
"a",
"shortcut",
"to",
"the",
"target",
"link",
"in",
"the",
"vendor",
"directory",
"."
] | 8421543ac20ee59f5171e7b36a8830b7070a57cb | https://github.com/koala-framework/composer-extra-assets/blob/8421543ac20ee59f5171e7b36a8830b7070a57cb/Kwf/ComposerExtraAssets/LinkWriter.php#L26-L38 |
223,878 | harryxu/laravel-theme | src/Bigecko/LaravelTheme/Theme.php | Theme.viewPath | public function viewPath()
{
return is_null($this->options['views_path'])
? public_path($this->options['public_dirname'] . '/' . $this->name() . '/views')
: rtrim($this->options['views_path'], '/') . '/' . $this->name();
} | php | public function viewPath()
{
return is_null($this->options['views_path'])
? public_path($this->options['public_dirname'] . '/' . $this->name() . '/views')
: rtrim($this->options['views_path'], '/') . '/' . $this->name();
} | [
"public",
"function",
"viewPath",
"(",
")",
"{",
"return",
"is_null",
"(",
"$",
"this",
"->",
"options",
"[",
"'views_path'",
"]",
")",
"?",
"public_path",
"(",
"$",
"this",
"->",
"options",
"[",
"'public_dirname'",
"]",
".",
"'/'",
".",
"$",
"this",
"... | Get current theme view path. | [
"Get",
"current",
"theme",
"view",
"path",
"."
] | cd856ce82226bdef01c332002105c55eda856a94 | https://github.com/harryxu/laravel-theme/blob/cd856ce82226bdef01c332002105c55eda856a94/src/Bigecko/LaravelTheme/Theme.php#L63-L68 |
223,879 | harryxu/laravel-theme | src/Bigecko/LaravelTheme/Theme.php | Theme.publicPath | public function publicPath($path = '')
{
return public_path($this->options['public_dirname'] . '/' . $this->name()
. (empty($path) ? '' : '/' . rtrim($path)));
} | php | public function publicPath($path = '')
{
return public_path($this->options['public_dirname'] . '/' . $this->name()
. (empty($path) ? '' : '/' . rtrim($path)));
} | [
"public",
"function",
"publicPath",
"(",
"$",
"path",
"=",
"''",
")",
"{",
"return",
"public_path",
"(",
"$",
"this",
"->",
"options",
"[",
"'public_dirname'",
"]",
".",
"'/'",
".",
"$",
"this",
"->",
"name",
"(",
")",
".",
"(",
"empty",
"(",
"$",
... | Get the fully qualified path to the theme public directory. | [
"Get",
"the",
"fully",
"qualified",
"path",
"to",
"the",
"theme",
"public",
"directory",
"."
] | cd856ce82226bdef01c332002105c55eda856a94 | https://github.com/harryxu/laravel-theme/blob/cd856ce82226bdef01c332002105c55eda856a94/src/Bigecko/LaravelTheme/Theme.php#L73-L77 |
223,880 | shiftonelabs/laravel-nomad | src/LaravelNomadServiceProvider.php | LaravelNomadServiceProvider.registerConnections | public function registerConnections()
{
$driver = $this->app['nomad.feature.detection']->connectionResolverDriver();
$method = 'registerVia'.studly_case($driver);
if (method_exists($this, $method)) {
return $this->{$method}();
}
throw new LogicException(sprintf... | php | public function registerConnections()
{
$driver = $this->app['nomad.feature.detection']->connectionResolverDriver();
$method = 'registerVia'.studly_case($driver);
if (method_exists($this, $method)) {
return $this->{$method}();
}
throw new LogicException(sprintf... | [
"public",
"function",
"registerConnections",
"(",
")",
"{",
"$",
"driver",
"=",
"$",
"this",
"->",
"app",
"[",
"'nomad.feature.detection'",
"]",
"->",
"connectionResolverDriver",
"(",
")",
";",
"$",
"method",
"=",
"'registerVia'",
".",
"studly_case",
"(",
"$",... | Register the database connection extensions.
@return void | [
"Register",
"the",
"database",
"connection",
"extensions",
"."
] | 818b54ea10f92b91ad357386a70b9a2bb9058194 | https://github.com/shiftonelabs/laravel-nomad/blob/818b54ea10f92b91ad357386a70b9a2bb9058194/src/LaravelNomadServiceProvider.php#L50-L61 |
223,881 | shiftonelabs/laravel-nomad | src/LaravelNomadServiceProvider.php | LaravelNomadServiceProvider.registerViaConnectionMethod | public function registerViaConnectionMethod()
{
foreach ($this->classes as $driver => $class) {
Connection::resolverFor($driver, function ($connection, $database, $prefix, $config) use ($class) {
return new $class($connection, $database, $prefix, $config);
});
... | php | public function registerViaConnectionMethod()
{
foreach ($this->classes as $driver => $class) {
Connection::resolverFor($driver, function ($connection, $database, $prefix, $config) use ($class) {
return new $class($connection, $database, $prefix, $config);
});
... | [
"public",
"function",
"registerViaConnectionMethod",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"classes",
"as",
"$",
"driver",
"=>",
"$",
"class",
")",
"{",
"Connection",
"::",
"resolverFor",
"(",
"$",
"driver",
",",
"function",
"(",
"$",
"connecti... | Register the database connection extensions through the `Connection` method.
@return void | [
"Register",
"the",
"database",
"connection",
"extensions",
"through",
"the",
"Connection",
"method",
"."
] | 818b54ea10f92b91ad357386a70b9a2bb9058194 | https://github.com/shiftonelabs/laravel-nomad/blob/818b54ea10f92b91ad357386a70b9a2bb9058194/src/LaravelNomadServiceProvider.php#L80-L87 |
223,882 | shiftonelabs/laravel-nomad | src/Traits/Database/Schema/Grammars/PassthruTrait.php | PassthruTrait.typePassthru | protected function typePassthru(Fluent $column)
{
return !empty($column->definition) ? $column->definition : $column->realType;
} | php | protected function typePassthru(Fluent $column)
{
return !empty($column->definition) ? $column->definition : $column->realType;
} | [
"protected",
"function",
"typePassthru",
"(",
"Fluent",
"$",
"column",
")",
"{",
"return",
"!",
"empty",
"(",
"$",
"column",
"->",
"definition",
")",
"?",
"$",
"column",
"->",
"definition",
":",
"$",
"column",
"->",
"realType",
";",
"}"
] | Create the column definition for a string type.
@param \Illuminate\Support\Fluent $column
@return string | [
"Create",
"the",
"column",
"definition",
"for",
"a",
"string",
"type",
"."
] | 818b54ea10f92b91ad357386a70b9a2bb9058194 | https://github.com/shiftonelabs/laravel-nomad/blob/818b54ea10f92b91ad357386a70b9a2bb9058194/src/Traits/Database/Schema/Grammars/PassthruTrait.php#L16-L19 |
223,883 | jakoch/nginx-conf | src/Parser.php | Parser.readComment | function readComment()
{
$str = substr($this->source, $this->index);
$result = preg_match('/^(.*?)(?:\r\n|\n|$)/', $str, $matches);
$this->index += ($result) ? strlen($matches[0]) : 0;
return substr($matches[1], 1); // ignore # character and EOL
} | php | function readComment()
{
$str = substr($this->source, $this->index);
$result = preg_match('/^(.*?)(?:\r\n|\n|$)/', $str, $matches);
$this->index += ($result) ? strlen($matches[0]) : 0;
return substr($matches[1], 1); // ignore # character and EOL
} | [
"function",
"readComment",
"(",
")",
"{",
"$",
"str",
"=",
"substr",
"(",
"$",
"this",
"->",
"source",
",",
"$",
"this",
"->",
"index",
")",
";",
"$",
"result",
"=",
"preg_match",
"(",
"'/^(.*?)(?:\\r\\n|\\n|$)/'",
",",
"$",
"str",
",",
"$",
"matches",... | a comment doesn't have to end with a semicolon | [
"a",
"comment",
"doesn",
"t",
"have",
"to",
"end",
"with",
"a",
"semicolon"
] | 9647f883a1e9e25d48463741d4966ea2f72feff5 | https://github.com/jakoch/nginx-conf/blob/9647f883a1e9e25d48463741d4966ea2f72feff5/src/Parser.php#L183-L191 |
223,884 | RikudouSage/QrPaymentCZ | src/QrPayment.php | QrPayment.checkProperties | protected function checkProperties(): void
{
foreach (get_object_vars($this) as $property => $value) {
if ($property !== "dueDate" && strpos($value, "*") !== false) {
throw new QrPaymentException("Error: properties cannot contain asterisk (*). Property $property contains it.", Qr... | php | protected function checkProperties(): void
{
foreach (get_object_vars($this) as $property => $value) {
if ($property !== "dueDate" && strpos($value, "*") !== false) {
throw new QrPaymentException("Error: properties cannot contain asterisk (*). Property $property contains it.", Qr... | [
"protected",
"function",
"checkProperties",
"(",
")",
":",
"void",
"{",
"foreach",
"(",
"get_object_vars",
"(",
"$",
"this",
")",
"as",
"$",
"property",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"property",
"!==",
"\"dueDate\"",
"&&",
"strpos",
"(",
... | Checks all properties for asterisk and throws exception if asterisk
is found
@throws \rikudou\CzQrPayment\QrPaymentException | [
"Checks",
"all",
"properties",
"for",
"asterisk",
"and",
"throws",
"exception",
"if",
"asterisk",
"is",
"found"
] | ef94ef5551363cc3486bfdaac6af69395fbb9088 | https://github.com/RikudouSage/QrPaymentCZ/blob/ef94ef5551363cc3486bfdaac6af69395fbb9088/src/QrPayment.php#L187-L194 |
223,885 | RikudouSage/QrPaymentCZ | src/QrPayment.php | QrPayment.getQrImage | public function getQrImage(bool $setPngHeader = false): QrCode
{
if (!class_exists("Endroid\QrCode\QrCode")) {
throw new QrPaymentException("Error: library endroid/qr-code is not loaded.", QrPaymentException::ERR_MISSING_LIBRARY);
}
if ($setPngHeader) {
header("Conte... | php | public function getQrImage(bool $setPngHeader = false): QrCode
{
if (!class_exists("Endroid\QrCode\QrCode")) {
throw new QrPaymentException("Error: library endroid/qr-code is not loaded.", QrPaymentException::ERR_MISSING_LIBRARY);
}
if ($setPngHeader) {
header("Conte... | [
"public",
"function",
"getQrImage",
"(",
"bool",
"$",
"setPngHeader",
"=",
"false",
")",
":",
"QrCode",
"{",
"if",
"(",
"!",
"class_exists",
"(",
"\"Endroid\\QrCode\\QrCode\"",
")",
")",
"{",
"throw",
"new",
"QrPaymentException",
"(",
"\"Error: library endroid/qr-... | Return QrCode object with QrString set, for more info see Endroid QrCode
documentation
@param bool $setPngHeader
@return \Endroid\QrCode\QrCode
@throws \rikudou\CzQrPayment\QrPaymentException | [
"Return",
"QrCode",
"object",
"with",
"QrString",
"set",
"for",
"more",
"info",
"see",
"Endroid",
"QrCode",
"documentation"
] | ef94ef5551363cc3486bfdaac6af69395fbb9088 | https://github.com/RikudouSage/QrPaymentCZ/blob/ef94ef5551363cc3486bfdaac6af69395fbb9088/src/QrPayment.php#L204-L215 |
223,886 | thephpleague/phpunit-coverage-listener | src/League/PHPUnitCoverageListener/Listener.php | Listener.collectAndWriteCoverage | public function collectAndWriteCoverage($args)
{
if ($this->valid($args)) {
extract($args);
// Check for exist and valid hook
if (isset($hook) && $hook instanceof HookInterface) {
$this->hook = $hook;
unset($hook);
}
... | php | public function collectAndWriteCoverage($args)
{
if ($this->valid($args)) {
extract($args);
// Check for exist and valid hook
if (isset($hook) && $hook instanceof HookInterface) {
$this->hook = $hook;
unset($hook);
}
... | [
"public",
"function",
"collectAndWriteCoverage",
"(",
"$",
"args",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"valid",
"(",
"$",
"args",
")",
")",
"{",
"extract",
"(",
"$",
"args",
")",
";",
"// Check for exist and valid hook",
"if",
"(",
"isset",
"(",
"$",... | Main api for collecting code-coverage information and write it into json payload
@param array | [
"Main",
"api",
"for",
"collecting",
"code",
"-",
"coverage",
"information",
"and",
"write",
"it",
"into",
"json",
"payload"
] | dbc833a21990973e1182431b42842918595dc20a | https://github.com/thephpleague/phpunit-coverage-listener/blob/dbc833a21990973e1182431b42842918595dc20a/src/League/PHPUnitCoverageListener/Listener.php#L104-L134 |
223,887 | thephpleague/phpunit-coverage-listener | src/League/PHPUnitCoverageListener/Listener.php | Listener.collectAndSendCoverage | public function collectAndSendCoverage($args)
{
// Collect and write out the data
$this->collectAndWriteCoverage($args);
if ($this->valid($args)) {
extract($args);
// Get the realpath coverage directory
$coverage_dir = realpath($coverage_dir);
... | php | public function collectAndSendCoverage($args)
{
// Collect and write out the data
$this->collectAndWriteCoverage($args);
if ($this->valid($args)) {
extract($args);
// Get the realpath coverage directory
$coverage_dir = realpath($coverage_dir);
... | [
"public",
"function",
"collectAndSendCoverage",
"(",
"$",
"args",
")",
"{",
"// Collect and write out the data",
"$",
"this",
"->",
"collectAndWriteCoverage",
"(",
"$",
"args",
")",
";",
"if",
"(",
"$",
"this",
"->",
"valid",
"(",
"$",
"args",
")",
")",
"{",... | Main api for collecting code-coverage information
@param array Contains repo secret hash, target url, coverage directory and optional Namespace | [
"Main",
"api",
"for",
"collecting",
"code",
"-",
"coverage",
"information"
] | dbc833a21990973e1182431b42842918595dc20a | https://github.com/thephpleague/phpunit-coverage-listener/blob/dbc833a21990973e1182431b42842918595dc20a/src/League/PHPUnitCoverageListener/Listener.php#L141-L179 |
223,888 | thephpleague/phpunit-coverage-listener | src/League/PHPUnitCoverageListener/Listener.php | Listener.collect | protected function collect(SimpleXMLElement $coverage, $args = array())
{
extract($args);
$data = new Collection(array(
'repo_token' => $repo_token,
'source_files' => array(),
'run_at' => gmdate('Y-m-d H:i:s -0000'),
'git' => $this->collectFromGit()->all(),... | php | protected function collect(SimpleXMLElement $coverage, $args = array())
{
extract($args);
$data = new Collection(array(
'repo_token' => $repo_token,
'source_files' => array(),
'run_at' => gmdate('Y-m-d H:i:s -0000'),
'git' => $this->collectFromGit()->all(),... | [
"protected",
"function",
"collect",
"(",
"SimpleXMLElement",
"$",
"coverage",
",",
"$",
"args",
"=",
"array",
"(",
")",
")",
"{",
"extract",
"(",
"$",
"args",
")",
";",
"$",
"data",
"=",
"new",
"Collection",
"(",
"array",
"(",
"'repo_token'",
"=>",
"$"... | Main collector method
@param SimpleXMLElement Coverage report from PHPUnit
@param array
@return Collection | [
"Main",
"collector",
"method"
] | dbc833a21990973e1182431b42842918595dc20a | https://github.com/thephpleague/phpunit-coverage-listener/blob/dbc833a21990973e1182431b42842918595dc20a/src/League/PHPUnitCoverageListener/Listener.php#L220-L278 |
223,889 | thephpleague/phpunit-coverage-listener | src/League/PHPUnitCoverageListener/Listener.php | Listener.collectFromFile | protected function collectFromFile(SimpleXMLElement $file, $namespace = '')
{
// Validate
if ( ! is_file($file['name'])) throw new \RuntimeException('Invalid '.self::COVERAGE_FILE.' file');
// Get current dir
$currentDir = $this->getDirectory();
// Initial return values
... | php | protected function collectFromFile(SimpleXMLElement $file, $namespace = '')
{
// Validate
if ( ! is_file($file['name'])) throw new \RuntimeException('Invalid '.self::COVERAGE_FILE.' file');
// Get current dir
$currentDir = $this->getDirectory();
// Initial return values
... | [
"protected",
"function",
"collectFromFile",
"(",
"SimpleXMLElement",
"$",
"file",
",",
"$",
"namespace",
"=",
"''",
")",
"{",
"// Validate",
"if",
"(",
"!",
"is_file",
"(",
"$",
"file",
"[",
"'name'",
"]",
")",
")",
"throw",
"new",
"\\",
"RuntimeException"... | Collect code-coverage information from a file
@param SimpleXMLElement contains coverage information
@param string Optional file namespace identifier
@throws RuntimeException
@return array contains code-coverage data with keys as follow : name, source, coverage | [
"Collect",
"code",
"-",
"coverage",
"information",
"from",
"a",
"file"
] | dbc833a21990973e1182431b42842918595dc20a | https://github.com/thephpleague/phpunit-coverage-listener/blob/dbc833a21990973e1182431b42842918595dc20a/src/League/PHPUnitCoverageListener/Listener.php#L288-L351 |
223,890 | thephpleague/phpunit-coverage-listener | src/League/PHPUnitCoverageListener/Listener.php | Listener.collectFromGit | public function collectFromGit()
{
// Initial git data
$git = new Collection();
$gitDirectory = $this->getDirectory().DIRECTORY_SEPARATOR.self::GIT_DIRECTORY;
if (is_dir($gitDirectory)) {
// Get refs info from HEAD
$branch = '';
$head = Yaml::par... | php | public function collectFromGit()
{
// Initial git data
$git = new Collection();
$gitDirectory = $this->getDirectory().DIRECTORY_SEPARATOR.self::GIT_DIRECTORY;
if (is_dir($gitDirectory)) {
// Get refs info from HEAD
$branch = '';
$head = Yaml::par... | [
"public",
"function",
"collectFromGit",
"(",
")",
"{",
"// Initial git data",
"$",
"git",
"=",
"new",
"Collection",
"(",
")",
";",
"$",
"gitDirectory",
"=",
"$",
"this",
"->",
"getDirectory",
"(",
")",
".",
"DIRECTORY_SEPARATOR",
".",
"self",
"::",
"GIT_DIRE... | Collect git information
@return Collection | [
"Collect",
"git",
"information"
] | dbc833a21990973e1182431b42842918595dc20a | https://github.com/thephpleague/phpunit-coverage-listener/blob/dbc833a21990973e1182431b42842918595dc20a/src/League/PHPUnitCoverageListener/Listener.php#L358-L421 |
223,891 | thephpleague/phpunit-coverage-listener | src/League/PHPUnitCoverageListener/Listener.php | Listener.execute | protected static function execute($command)
{
$res = array();
ob_start();
passthru($command, $success);
$output = ob_get_clean();
foreach ((explode("\n", $output)) as $line) $res[] = trim($line);
return array_filter($res);
} | php | protected static function execute($command)
{
$res = array();
ob_start();
passthru($command, $success);
$output = ob_get_clean();
foreach ((explode("\n", $output)) as $line) $res[] = trim($line);
return array_filter($res);
} | [
"protected",
"static",
"function",
"execute",
"(",
"$",
"command",
")",
"{",
"$",
"res",
"=",
"array",
"(",
")",
";",
"ob_start",
"(",
")",
";",
"passthru",
"(",
"$",
"command",
",",
"$",
"success",
")",
";",
"$",
"output",
"=",
"ob_get_clean",
"(",
... | Execute a command and parse the output as array
@param string
@return array | [
"Execute",
"a",
"command",
"and",
"parse",
"the",
"output",
"as",
"array"
] | dbc833a21990973e1182431b42842918595dc20a | https://github.com/thephpleague/phpunit-coverage-listener/blob/dbc833a21990973e1182431b42842918595dc20a/src/League/PHPUnitCoverageListener/Listener.php#L429-L440 |
223,892 | phonetworks/pho-microkernel | src/Pho/Kernel/Acl/AbstractAcl.php | AbstractAcl._setPermission | protected function _setPermission(string $pointer, string $mode): void
{
$this->permissions[$pointer] = $mode;
$pointer_with_special_graph = '/^g:([a-f0-9\-]+):$/i';
if(preg_match($pointer_with_special_graph, $pointer, $matches)) {
$this->permissions_with_graph[] = $matches[1];
... | php | protected function _setPermission(string $pointer, string $mode): void
{
$this->permissions[$pointer] = $mode;
$pointer_with_special_graph = '/^g:([a-f0-9\-]+):$/i';
if(preg_match($pointer_with_special_graph, $pointer, $matches)) {
$this->permissions_with_graph[] = $matches[1];
... | [
"protected",
"function",
"_setPermission",
"(",
"string",
"$",
"pointer",
",",
"string",
"$",
"mode",
")",
":",
"void",
"{",
"$",
"this",
"->",
"permissions",
"[",
"$",
"pointer",
"]",
"=",
"$",
"mode",
";",
"$",
"pointer_with_special_graph",
"=",
"'/^g:([... | Internal permission setter
**Warning:** This function is for internal use only. To
set up a new permission, use the ```set``` function instead.
This does not perform checks, assumes it was done apriori.
Do not use this function unless you know what you are doing,
use ```set()``` instead.
This function is responsible... | [
"Internal",
"permission",
"setter"
] | 3983764e4e7cf980bc11d0385f1c6ea57ae723b1 | https://github.com/phonetworks/pho-microkernel/blob/3983764e4e7cf980bc11d0385f1c6ea57ae723b1/src/Pho/Kernel/Acl/AbstractAcl.php#L97-L104 |
223,893 | phonetworks/pho-microkernel | src/Pho/Kernel/Acl/AbstractAcl.php | AbstractAcl.get | public function get(string $entity_pointer): string
{
if(isset($this->permissions[$entity_pointer])) {
return $this->permissions[$entity_pointer];
}
throw new Exceptions\NonExistentAclPointer($entity_pointer, (string) $this->core->id());
} | php | public function get(string $entity_pointer): string
{
if(isset($this->permissions[$entity_pointer])) {
return $this->permissions[$entity_pointer];
}
throw new Exceptions\NonExistentAclPointer($entity_pointer, (string) $this->core->id());
} | [
"public",
"function",
"get",
"(",
"string",
"$",
"entity_pointer",
")",
":",
"string",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"permissions",
"[",
"$",
"entity_pointer",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"permissions",
"[",
"$",... | Retrieves the permissions for this node with the given pointer
@param string $entity_pointer The entity pointer
@return string The permissions in string format
@throws Exceptions\NonExistentAclPointer thrown when there is no such pointer for given node. | [
"Retrieves",
"the",
"permissions",
"for",
"this",
"node",
"with",
"the",
"given",
"pointer"
] | 3983764e4e7cf980bc11d0385f1c6ea57ae723b1 | https://github.com/phonetworks/pho-microkernel/blob/3983764e4e7cf980bc11d0385f1c6ea57ae723b1/src/Pho/Kernel/Acl/AbstractAcl.php#L154-L160 |
223,894 | phonetworks/pho-microkernel | src/Pho/Kernel/Acl/AbstractAcl.php | AbstractAcl.del | public function del(string $entity_pointer): void
{
$valid_pointer = "/^([ug]):([a-f0-9\-]+):$/i";
if(!preg_match($valid_pointer, $entity_pointer, $matches)) {
throw new Exceptions\InvalidAclPointerException($entity_pointer, $valid_pointer, __FUNCTION__);
}
$type = $matc... | php | public function del(string $entity_pointer): void
{
$valid_pointer = "/^([ug]):([a-f0-9\-]+):$/i";
if(!preg_match($valid_pointer, $entity_pointer, $matches)) {
throw new Exceptions\InvalidAclPointerException($entity_pointer, $valid_pointer, __FUNCTION__);
}
$type = $matc... | [
"public",
"function",
"del",
"(",
"string",
"$",
"entity_pointer",
")",
":",
"void",
"{",
"$",
"valid_pointer",
"=",
"\"/^([ug]):([a-f0-9\\-]+):$/i\"",
";",
"if",
"(",
"!",
"preg_match",
"(",
"$",
"valid_pointer",
",",
"$",
"entity_pointer",
",",
"$",
"matches... | can delete specific users and graphs | [
"can",
"delete",
"specific",
"users",
"and",
"graphs"
] | 3983764e4e7cf980bc11d0385f1c6ea57ae723b1 | https://github.com/phonetworks/pho-microkernel/blob/3983764e4e7cf980bc11d0385f1c6ea57ae723b1/src/Pho/Kernel/Acl/AbstractAcl.php#L182-L195 |
223,895 | Orajo/zf2-tus-server | src/ZfTusServer/Server.php | Server.process | public function process($send = false) {
try {
$method = $this->getRequest()->getMethod();
switch ($method) {
case 'POST':
if(!$this->checkTusVersion()) {
throw new Exception\Request('The requested protocol version is not supp... | php | public function process($send = false) {
try {
$method = $this->getRequest()->getMethod();
switch ($method) {
case 'POST':
if(!$this->checkTusVersion()) {
throw new Exception\Request('The requested protocol version is not supp... | [
"public",
"function",
"process",
"(",
"$",
"send",
"=",
"false",
")",
"{",
"try",
"{",
"$",
"method",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"getMethod",
"(",
")",
";",
"switch",
"(",
"$",
"method",
")",
"{",
"case",
"'POST'",
":",
... | Process the client request
@param bool $send True to send the response, false to return the response
@return void|Symfony\Component\HttpFoundation\Response void if send = true else Response object
@throws \\Exception\Request If the method isn't available
@access public | [
"Process",
"the",
"client",
"request"
] | 38deebf73e6144217498bfafc3999a0b7e783736 | https://github.com/Orajo/zf2-tus-server/blob/38deebf73e6144217498bfafc3999a0b7e783736/src/ZfTusServer/Server.php#L73-L154 |
223,896 | Orajo/zf2-tus-server | src/ZfTusServer/Server.php | Server.checkTusVersion | private function checkTusVersion() {
$tusVersion = $this->getRequest()->getHeader('Tus-Resumable');
if ($tusVersion instanceof \Zend\Http\Header\HeaderInterface) {
return $tusVersion->getFieldValue() === self::TUS_VERSION;
}
return false;
} | php | private function checkTusVersion() {
$tusVersion = $this->getRequest()->getHeader('Tus-Resumable');
if ($tusVersion instanceof \Zend\Http\Header\HeaderInterface) {
return $tusVersion->getFieldValue() === self::TUS_VERSION;
}
return false;
} | [
"private",
"function",
"checkTusVersion",
"(",
")",
"{",
"$",
"tusVersion",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"getHeader",
"(",
"'Tus-Resumable'",
")",
";",
"if",
"(",
"$",
"tusVersion",
"instanceof",
"\\",
"Zend",
"\\",
"Http",
"\\",
... | Checks compatibility with requested Tus protocol
@return boolean | [
"Checks",
"compatibility",
"with",
"requested",
"Tus",
"protocol"
] | 38deebf73e6144217498bfafc3999a0b7e783736 | https://github.com/Orajo/zf2-tus-server/blob/38deebf73e6144217498bfafc3999a0b7e783736/src/ZfTusServer/Server.php#L161-L167 |
223,897 | Orajo/zf2-tus-server | src/ZfTusServer/Server.php | Server.processPost | private function processPost() {
if ($this->existsInMetaData($this->uuid, 'ID') === true) {
throw new \Exception('The UUID already exists');
}
$headers = $this->extractHeaders(array('Upload-Length', 'Upload-Metadata'));
if (is_numeric($headers['Upload-Length']) === false |... | php | private function processPost() {
if ($this->existsInMetaData($this->uuid, 'ID') === true) {
throw new \Exception('The UUID already exists');
}
$headers = $this->extractHeaders(array('Upload-Length', 'Upload-Metadata'));
if (is_numeric($headers['Upload-Length']) === false |... | [
"private",
"function",
"processPost",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"existsInMetaData",
"(",
"$",
"this",
"->",
"uuid",
",",
"'ID'",
")",
"===",
"true",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'The UUID already exists'",
")",
";... | Process the POST request
@throws \Exception If the uuid already exists
@throws \ZfTusServer\Exception\BadHeader If the final length header isn't a positive integer
@throws \ZfTusServer\Exception\File If the file already exists in the filesystem
@throws \ZfTusServer\Exception\File ... | [
"Process",
"the",
"POST",
"request"
] | 38deebf73e6144217498bfafc3999a0b7e783736 | https://github.com/Orajo/zf2-tus-server/blob/38deebf73e6144217498bfafc3999a0b7e783736/src/ZfTusServer/Server.php#L207-L244 |
223,898 | Orajo/zf2-tus-server | src/ZfTusServer/Server.php | Server.processHead | private function processHead() {
if ($this->existsInMetaData($this->uuid, 'ID') === false) {
$this->getResponse()->setStatusCode(PhpResponse::STATUS_CODE_404);
return;
}
// if file in storage does not exists
if (!file_exists($this->directory . $this->getFilename(... | php | private function processHead() {
if ($this->existsInMetaData($this->uuid, 'ID') === false) {
$this->getResponse()->setStatusCode(PhpResponse::STATUS_CODE_404);
return;
}
// if file in storage does not exists
if (!file_exists($this->directory . $this->getFilename(... | [
"private",
"function",
"processHead",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"existsInMetaData",
"(",
"$",
"this",
"->",
"uuid",
",",
"'ID'",
")",
"===",
"false",
")",
"{",
"$",
"this",
"->",
"getResponse",
"(",
")",
"->",
"setStatusCode",
"(",
... | Process the HEAD request
@link http://tus.io/protocols/resumable-upload.html#head Description of this reuest type
@throws \Exception If the uuid isn't know | [
"Process",
"the",
"HEAD",
"request"
] | 38deebf73e6144217498bfafc3999a0b7e783736 | https://github.com/Orajo/zf2-tus-server/blob/38deebf73e6144217498bfafc3999a0b7e783736/src/ZfTusServer/Server.php#L253-L277 |
223,899 | Orajo/zf2-tus-server | src/ZfTusServer/Server.php | Server.processGet | private function processGet($send) {
if (!$this->allowGetMethod) {
throw new Exception\Request('The requested method ' . $method . ' is not allowed', \Zend\Http\Response::STATUS_CODE_405);
}
$file = $this->directory . $this->getFilename();
if (!file_exists($file)) {
... | php | private function processGet($send) {
if (!$this->allowGetMethod) {
throw new Exception\Request('The requested method ' . $method . ' is not allowed', \Zend\Http\Response::STATUS_CODE_405);
}
$file = $this->directory . $this->getFilename();
if (!file_exists($file)) {
... | [
"private",
"function",
"processGet",
"(",
"$",
"send",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"allowGetMethod",
")",
"{",
"throw",
"new",
"Exception",
"\\",
"Request",
"(",
"'The requested method '",
".",
"$",
"method",
".",
"' is not allowed'",
",",
... | Process the GET request
FIXME: check and eventually remove $send param
@param bool $send Description
@access private | [
"Process",
"the",
"GET",
"request"
] | 38deebf73e6144217498bfafc3999a0b7e783736 | https://github.com/Orajo/zf2-tus-server/blob/38deebf73e6144217498bfafc3999a0b7e783736/src/ZfTusServer/Server.php#L468-L502 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.