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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
1,600 | xmlsquad/capture-lookups | src/Service/GoogleApiService.php | GoogleApiService.setCredentials | public function setCredentials(?string $gApiServiceAccountCredentialsFilePath = null): string
{
$this->client = null;
$this->getClient($gApiServiceAccountCredentialsFilePath);
return $this->getCredentialsFilePath();
} | php | public function setCredentials(?string $gApiServiceAccountCredentialsFilePath = null): string
{
$this->client = null;
$this->getClient($gApiServiceAccountCredentialsFilePath);
return $this->getCredentialsFilePath();
} | [
"public",
"function",
"setCredentials",
"(",
"?",
"string",
"$",
"gApiServiceAccountCredentialsFilePath",
"=",
"null",
")",
":",
"string",
"{",
"$",
"this",
"->",
"client",
"=",
"null",
";",
"$",
"this",
"->",
"getClient",
"(",
"$",
"gApiServiceAccountCredential... | A helper method allowing to use different credentials during the lifecycle of the application.
@param null|string $gApiServiceAccountCredentialsFilePath
@return string
@throws \Exception | [
"A",
"helper",
"method",
"allowing",
"to",
"use",
"different",
"credentials",
"during",
"the",
"lifecycle",
"of",
"the",
"application",
"."
] | 8696a4a425176c39417c3b925615d3e6171d9546 | https://github.com/xmlsquad/capture-lookups/blob/8696a4a425176c39417c3b925615d3e6171d9546/src/Service/GoogleApiService.php#L54-L60 |
1,601 | xmlsquad/capture-lookups | src/Service/GoogleApiService.php | GoogleApiService.getMapping | public function getMapping()
{
if (null === $this->mapping) {
$mappingFilePath = $this->locateFile($this->mappingFileName);
if (is_array($mappingFilePath)) {
throw new \Exception("The mapping file wasn't found. Locations we tried: ".join(', ', $mappingFilePath));
... | php | public function getMapping()
{
if (null === $this->mapping) {
$mappingFilePath = $this->locateFile($this->mappingFileName);
if (is_array($mappingFilePath)) {
throw new \Exception("The mapping file wasn't found. Locations we tried: ".join(', ', $mappingFilePath));
... | [
"public",
"function",
"getMapping",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"mapping",
")",
"{",
"$",
"mappingFilePath",
"=",
"$",
"this",
"->",
"locateFile",
"(",
"$",
"this",
"->",
"mappingFileName",
")",
";",
"if",
"(",
"is_array... | Returns the array resulting from mapping.yaml.
@return array|mixed
@throws \Exception | [
"Returns",
"the",
"array",
"resulting",
"from",
"mapping",
".",
"yaml",
"."
] | 8696a4a425176c39417c3b925615d3e6171d9546 | https://github.com/xmlsquad/capture-lookups/blob/8696a4a425176c39417c3b925615d3e6171d9546/src/Service/GoogleApiService.php#L89-L105 |
1,602 | xmlsquad/capture-lookups | src/Service/GoogleApiService.php | GoogleApiService.locateFile | private function locateFile($fileName, ?string $userSuppliedPath = null)
{
// These are the primary gApiServiceAccountCredentialsFile file locations
$locations = [
// First check the project file
$this->projectDir.DIRECTORY_SEPARATOR.$fileName,
];
// Then the... | php | private function locateFile($fileName, ?string $userSuppliedPath = null)
{
// These are the primary gApiServiceAccountCredentialsFile file locations
$locations = [
// First check the project file
$this->projectDir.DIRECTORY_SEPARATOR.$fileName,
];
// Then the... | [
"private",
"function",
"locateFile",
"(",
"$",
"fileName",
",",
"?",
"string",
"$",
"userSuppliedPath",
"=",
"null",
")",
"{",
"// These are the primary gApiServiceAccountCredentialsFile file locations",
"$",
"locations",
"=",
"[",
"// First check the project file",
"$",
... | Looks for a specified file name in various locations.
Returns path to the file if found, or array of tried locations if not found.
Locations checked:
- Project root dir
- Current working directory
@param $fileName
@param null|string $userSuppliedPath
@return string|array | [
"Looks",
"for",
"a",
"specified",
"file",
"name",
"in",
"various",
"locations",
"."
] | 8696a4a425176c39417c3b925615d3e6171d9546 | https://github.com/xmlsquad/capture-lookups/blob/8696a4a425176c39417c3b925615d3e6171d9546/src/Service/GoogleApiService.php#L237-L297 |
1,603 | eghojansu/nutrition | src/App.php | App.error | public function error(Base $app, array $params)
{
$eol = PHP_EOL;
$req = $app['VERB'].' '.$app['PATH'];
$error = ($app['ERROR']?:[]) + [
'text' => 'No-Message',
'trace' => 'No-Trace',
'status' => 'No-Status',
'code' => '000',
];
... | php | public function error(Base $app, array $params)
{
$eol = PHP_EOL;
$req = $app['VERB'].' '.$app['PATH'];
$error = ($app['ERROR']?:[]) + [
'text' => 'No-Message',
'trace' => 'No-Trace',
'status' => 'No-Status',
'code' => '000',
];
... | [
"public",
"function",
"error",
"(",
"Base",
"$",
"app",
",",
"array",
"$",
"params",
")",
"{",
"$",
"eol",
"=",
"PHP_EOL",
";",
"$",
"req",
"=",
"$",
"app",
"[",
"'VERB'",
"]",
".",
"' '",
".",
"$",
"app",
"[",
"'PATH'",
"]",
";",
"$",
"error",... | Custom error handler with ability to log error and its trace
@param Base $app
@param array $params
@return void | [
"Custom",
"error",
"handler",
"with",
"ability",
"to",
"log",
"error",
"and",
"its",
"trace"
] | 3941c62aeb6dafda55349a38dd4107d521f8964a | https://github.com/eghojansu/nutrition/blob/3941c62aeb6dafda55349a38dd4107d521f8964a/src/App.php#L94-L147 |
1,604 | agalbourdin/agl-core | src/Auth/Acl.php | Acl._loadRoles | private function _loadRoles(array $aclConfig)
{
foreach ($aclConfig as $role => $acl) {
if (isset($acl[self::CONFIG_FIELD_RESOURCE])
and is_array($acl[self::CONFIG_FIELD_RESOURCE])) {
$this->_roles[$role] = $acl[self::CONFIG_FIELD_RESOURCE];
} else {
$this->_roles[$role] = array();
}
if (iss... | php | private function _loadRoles(array $aclConfig)
{
foreach ($aclConfig as $role => $acl) {
if (isset($acl[self::CONFIG_FIELD_RESOURCE])
and is_array($acl[self::CONFIG_FIELD_RESOURCE])) {
$this->_roles[$role] = $acl[self::CONFIG_FIELD_RESOURCE];
} else {
$this->_roles[$role] = array();
}
if (iss... | [
"private",
"function",
"_loadRoles",
"(",
"array",
"$",
"aclConfig",
")",
"{",
"foreach",
"(",
"$",
"aclConfig",
"as",
"$",
"role",
"=>",
"$",
"acl",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"acl",
"[",
"self",
"::",
"CONFIG_FIELD_RESOURCE",
"]",
")",
... | Load the roles from the ACL configuration file.
@param array $aclConfig Roles and Resources configuration
@return array | [
"Load",
"the",
"roles",
"from",
"the",
"ACL",
"configuration",
"file",
"."
] | 1db556f9a49488aa9fab6887fefb7141a79ad97d | https://github.com/agalbourdin/agl-core/blob/1db556f9a49488aa9fab6887fefb7141a79ad97d/src/Auth/Acl.php#L63-L85 |
1,605 | agalbourdin/agl-core | src/Auth/Acl.php | Acl.isAllowed | public function isAllowed($pRole, array $pResources)
{
foreach ($pResources as $resource) {
if (! isset($this->_roles[$pRole]) or ! in_array($resource, $this->_roles[$pRole])) {
return false;
}
}
return true;
} | php | public function isAllowed($pRole, array $pResources)
{
foreach ($pResources as $resource) {
if (! isset($this->_roles[$pRole]) or ! in_array($resource, $this->_roles[$pRole])) {
return false;
}
}
return true;
} | [
"public",
"function",
"isAllowed",
"(",
"$",
"pRole",
",",
"array",
"$",
"pResources",
")",
"{",
"foreach",
"(",
"$",
"pResources",
"as",
"$",
"resource",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_roles",
"[",
"$",
"pRole",
"]",
... | Check if the role exists and if the resource is available with this role.
@param string $pRole Role identifier
@param array $pResource Required resources | [
"Check",
"if",
"the",
"role",
"exists",
"and",
"if",
"the",
"resource",
"is",
"available",
"with",
"this",
"role",
"."
] | 1db556f9a49488aa9fab6887fefb7141a79ad97d | https://github.com/agalbourdin/agl-core/blob/1db556f9a49488aa9fab6887fefb7141a79ad97d/src/Auth/Acl.php#L93-L102 |
1,606 | ironedgesoftware/file-utils | src/File/Json.php | Json.decode | public function decode(array $options = [])
{
$json = json_decode($this->getContents(), true);
if ($json === null && json_last_error() === JSON_ERROR_NONE) {
$this->validateSyntax();
return $this;
}
$this->validateSchema();
return $json;
} | php | public function decode(array $options = [])
{
$json = json_decode($this->getContents(), true);
if ($json === null && json_last_error() === JSON_ERROR_NONE) {
$this->validateSyntax();
return $this;
}
$this->validateSchema();
return $json;
} | [
"public",
"function",
"decode",
"(",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"json",
"=",
"json_decode",
"(",
"$",
"this",
"->",
"getContents",
"(",
")",
",",
"true",
")",
";",
"if",
"(",
"$",
"json",
"===",
"null",
"&&",
"json_last_... | Decodes JSON data.
@param array $options - Options.
@throws DecodeException
@return array | [
"Decodes",
"JSON",
"data",
"."
] | d9f79d6f23db0e5ccb147b4d1fdbccbb70bd5beb | https://github.com/ironedgesoftware/file-utils/blob/d9f79d6f23db0e5ccb147b4d1fdbccbb70bd5beb/src/File/Json.php#L34-L47 |
1,607 | ironedgesoftware/file-utils | src/File/Json.php | Json.validateSchema | protected function validateSchema()
{
$schemaPath = $this->getOption('schemaPath');
if ($schemaPath === null) {
return;
}
$schemaData = json_decode(file_get_contents($schemaPath));
if (!class_exists('\\JsonSchema\\Validator')) {
throw new \RuntimeEx... | php | protected function validateSchema()
{
$schemaPath = $this->getOption('schemaPath');
if ($schemaPath === null) {
return;
}
$schemaData = json_decode(file_get_contents($schemaPath));
if (!class_exists('\\JsonSchema\\Validator')) {
throw new \RuntimeEx... | [
"protected",
"function",
"validateSchema",
"(",
")",
"{",
"$",
"schemaPath",
"=",
"$",
"this",
"->",
"getOption",
"(",
"'schemaPath'",
")",
";",
"if",
"(",
"$",
"schemaPath",
"===",
"null",
")",
"{",
"return",
";",
"}",
"$",
"schemaData",
"=",
"json_deco... | Validates JSON schema.
@throws DecodeException
@return void | [
"Validates",
"JSON",
"schema",
"."
] | d9f79d6f23db0e5ccb147b4d1fdbccbb70bd5beb | https://github.com/ironedgesoftware/file-utils/blob/d9f79d6f23db0e5ccb147b4d1fdbccbb70bd5beb/src/File/Json.php#L120-L148 |
1,608 | ironedgesoftware/file-utils | src/File/Json.php | Json.validateSyntax | protected function validateSyntax()
{
if (!class_exists('\\Seld\\JsonLint\\JsonParser')) {
throw new \RuntimeException(
'If you want to validate JSON syntax using lint, you must require package "seld/jsonlint".'
);
}
$parser = new \Seld\JsonLint\JsonP... | php | protected function validateSyntax()
{
if (!class_exists('\\Seld\\JsonLint\\JsonParser')) {
throw new \RuntimeException(
'If you want to validate JSON syntax using lint, you must require package "seld/jsonlint".'
);
}
$parser = new \Seld\JsonLint\JsonP... | [
"protected",
"function",
"validateSyntax",
"(",
")",
"{",
"if",
"(",
"!",
"class_exists",
"(",
"'\\\\Seld\\\\JsonLint\\\\JsonParser'",
")",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'If you want to validate JSON syntax using lint, you must require package \"se... | Validates JSON syntax using lint.
@throws DecodeException
@return bool | [
"Validates",
"JSON",
"syntax",
"using",
"lint",
"."
] | d9f79d6f23db0e5ccb147b4d1fdbccbb70bd5beb | https://github.com/ironedgesoftware/file-utils/blob/d9f79d6f23db0e5ccb147b4d1fdbccbb70bd5beb/src/File/Json.php#L157-L182 |
1,609 | jeromeklam/freefw | src/FreeFW/Model/Query.php | Query.addSimpleCondition | public function addSimpleCondition(string $p_operator, string $p_left, $p_right = null)
{
/**
* condition
* @var \FreeFW\Model\Condition $condition
*/
$condition = \FreeFW\DI\DI::get('FreeFW::Model::Condition');
$left = null;
if (strpos($p_left, '::Model::'... | php | public function addSimpleCondition(string $p_operator, string $p_left, $p_right = null)
{
/**
* condition
* @var \FreeFW\Model\Condition $condition
*/
$condition = \FreeFW\DI\DI::get('FreeFW::Model::Condition');
$left = null;
if (strpos($p_left, '::Model::'... | [
"public",
"function",
"addSimpleCondition",
"(",
"string",
"$",
"p_operator",
",",
"string",
"$",
"p_left",
",",
"$",
"p_right",
"=",
"null",
")",
"{",
"/**\n * condition\n * @var \\FreeFW\\Model\\Condition $condition\n */",
"$",
"condition",
"=",
... | Add simple condition
@param string $p_operator
@param string $p_left
@param mixed $p_right
@return \FreeFW\Model\Query | [
"Add",
"simple",
"condition"
] | 16ecf24192375c920a070296f396b9d3fd994a1e | https://github.com/jeromeklam/freefw/blob/16ecf24192375c920a070296f396b9d3fd994a1e/src/FreeFW/Model/Query.php#L141-L174 |
1,610 | jeromeklam/freefw | src/FreeFW/Model/Query.php | Query.conditionLower | public function conditionLower(string $p_member, $p_value)
{
return $this->addSimpleCondition(\FreeFW\Storage\Storage::COND_LOWER, $p_member, $p_value);
} | php | public function conditionLower(string $p_member, $p_value)
{
return $this->addSimpleCondition(\FreeFW\Storage\Storage::COND_LOWER, $p_member, $p_value);
} | [
"public",
"function",
"conditionLower",
"(",
"string",
"$",
"p_member",
",",
"$",
"p_value",
")",
"{",
"return",
"$",
"this",
"->",
"addSimpleCondition",
"(",
"\\",
"FreeFW",
"\\",
"Storage",
"\\",
"Storage",
"::",
"COND_LOWER",
",",
"$",
"p_member",
",",
... | Simple lower condition
@param string $p_member
@param mixed $p_value
@return \FreeFW\Core\StorageModel | [
"Simple",
"lower",
"condition"
] | 16ecf24192375c920a070296f396b9d3fd994a1e | https://github.com/jeromeklam/freefw/blob/16ecf24192375c920a070296f396b9d3fd994a1e/src/FreeFW/Model/Query.php#L184-L187 |
1,611 | bmdevel/php-index | classes/binarySearch/BinarySearch.php | BinarySearch.search | public function search($key)
{
// split the range
$splitOffset = $this->getSplitOffset();
// search right side
$keys = $this->index->getKeyReader()->readKeys($splitOffset, self::DIRECTION_FORWARD);
$foundKey = $this->findKey($key, $keys);
// found
if ... | php | public function search($key)
{
// split the range
$splitOffset = $this->getSplitOffset();
// search right side
$keys = $this->index->getKeyReader()->readKeys($splitOffset, self::DIRECTION_FORWARD);
$foundKey = $this->findKey($key, $keys);
// found
if ... | [
"public",
"function",
"search",
"(",
"$",
"key",
")",
"{",
"// split the range",
"$",
"splitOffset",
"=",
"$",
"this",
"->",
"getSplitOffset",
"(",
")",
";",
"// search right side",
"$",
"keys",
"=",
"$",
"this",
"->",
"index",
"->",
"getKeyReader",
"(",
"... | Searches for a key or some neighbour
If it doesn't find the key. A neighbour will be returned. The
neighbour mustn't be the closest neighbour. It's just a good hint
where the key should be expected.
Returns null if no key could be found at all.
@param string $key Key
@return Result
@throws IOIndexException | [
"Searches",
"for",
"a",
"key",
"or",
"some",
"neighbour"
] | 6a6b476f1706b9524bfb34f6ce0963b1aea91259 | https://github.com/bmdevel/php-index/blob/6a6b476f1706b9524bfb34f6ce0963b1aea91259/classes/binarySearch/BinarySearch.php#L54-L119 |
1,612 | bmdevel/php-index | classes/binarySearch/BinarySearch.php | BinarySearch.isKeyRange | private function isKeyRange($key, Array $keys)
{
if (empty($keys)) {
return false;
}
return \reset($keys)->getKey() <= $key
&& \end($keys)->getKey() >= $key;
} | php | private function isKeyRange($key, Array $keys)
{
if (empty($keys)) {
return false;
}
return \reset($keys)->getKey() <= $key
&& \end($keys)->getKey() >= $key;
} | [
"private",
"function",
"isKeyRange",
"(",
"$",
"key",
",",
"Array",
"$",
"keys",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"keys",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"\\",
"reset",
"(",
"$",
"keys",
")",
"->",
"getKey",
"(",
")",... | Returns true if the key is expected to be in the key list
If the key list is a subset of the index, and the key sould not be in
this list, the key is nowhere else in the index.
@param type $key
@param array $keys
@return bool | [
"Returns",
"true",
"if",
"the",
"key",
"is",
"expected",
"to",
"be",
"in",
"the",
"key",
"list"
] | 6a6b476f1706b9524bfb34f6ce0963b1aea91259 | https://github.com/bmdevel/php-index/blob/6a6b476f1706b9524bfb34f6ce0963b1aea91259/classes/binarySearch/BinarySearch.php#L132-L140 |
1,613 | bmdevel/php-index | classes/binarySearch/BinarySearch.php | BinarySearch.getSplitOffset | private function getSplitOffset()
{
$blocks = (int) $this->range->getLength() / $this->index->getKeyReader()->getReadLength();
$centerBlock = (int) $blocks / 2;
return $this->range->getOffset() + $centerBlock * $this->index->getKeyReader()->getReadLength();
} | php | private function getSplitOffset()
{
$blocks = (int) $this->range->getLength() / $this->index->getKeyReader()->getReadLength();
$centerBlock = (int) $blocks / 2;
return $this->range->getOffset() + $centerBlock * $this->index->getKeyReader()->getReadLength();
} | [
"private",
"function",
"getSplitOffset",
"(",
")",
"{",
"$",
"blocks",
"=",
"(",
"int",
")",
"$",
"this",
"->",
"range",
"->",
"getLength",
"(",
")",
"/",
"$",
"this",
"->",
"index",
"->",
"getKeyReader",
"(",
")",
"->",
"getReadLength",
"(",
")",
";... | Returns the offset for the split
@return int | [
"Returns",
"the",
"offset",
"for",
"the",
"split"
] | 6a6b476f1706b9524bfb34f6ce0963b1aea91259 | https://github.com/bmdevel/php-index/blob/6a6b476f1706b9524bfb34f6ce0963b1aea91259/classes/binarySearch/BinarySearch.php#L163-L168 |
1,614 | mothepro/YQL-Builder | src/Query.php | Query.execute | public static function execute($q) {
if(!isset(self::$pest))
$p = new \Pest(self::API);
$json = $p->get('', [
'q' => $q,
'format' => 'json',
'diagnostics' => false,
'env' => 'http://datatables.org/alltables.env',
]);
ret... | php | public static function execute($q) {
if(!isset(self::$pest))
$p = new \Pest(self::API);
$json = $p->get('', [
'q' => $q,
'format' => 'json',
'diagnostics' => false,
'env' => 'http://datatables.org/alltables.env',
]);
ret... | [
"public",
"static",
"function",
"execute",
"(",
"$",
"q",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"pest",
")",
")",
"$",
"p",
"=",
"new",
"\\",
"Pest",
"(",
"self",
"::",
"API",
")",
";",
"$",
"json",
"=",
"$",
"p",
"->",
... | Runs the Query against Yahoo's Database
@param string $q the query to run
@return Result | [
"Runs",
"the",
"Query",
"against",
"Yahoo",
"s",
"Database"
] | 814c8ea142546fa08d0b28be728d865451efddcd | https://github.com/mothepro/YQL-Builder/blob/814c8ea142546fa08d0b28be728d865451efddcd/src/Query.php#L29-L41 |
1,615 | squire-assistant/config | Definition/Dumper/XmlReferenceDumper.php | XmlReferenceDumper.writeLine | private function writeLine($text, $indent = 0)
{
$indent = strlen($text) + $indent;
$format = '%'.$indent.'s';
$this->reference .= sprintf($format, $text).PHP_EOL;
} | php | private function writeLine($text, $indent = 0)
{
$indent = strlen($text) + $indent;
$format = '%'.$indent.'s';
$this->reference .= sprintf($format, $text).PHP_EOL;
} | [
"private",
"function",
"writeLine",
"(",
"$",
"text",
",",
"$",
"indent",
"=",
"0",
")",
"{",
"$",
"indent",
"=",
"strlen",
"(",
"$",
"text",
")",
"+",
"$",
"indent",
";",
"$",
"format",
"=",
"'%'",
".",
"$",
"indent",
".",
"'s'",
";",
"$",
"th... | Outputs a single config reference line.
@param string $text
@param int $indent | [
"Outputs",
"a",
"single",
"config",
"reference",
"line",
"."
] | 474835b35fa34fbba4fe15a484299a526c082cc5 | https://github.com/squire-assistant/config/blob/474835b35fa34fbba4fe15a484299a526c082cc5/Definition/Dumper/XmlReferenceDumper.php#L262-L268 |
1,616 | o3co/query.core | Criteria/SimpleParser.php | SimpleParser.parse | public function parse(array $criteria, array $orderBy = array(), $limit = null, $offset = null)
{
$statement = new Expr\Statement();
if(!empty($criteria)) {
$statement->setClause('condition', $this->parseCriteria($criteria));
}
if(!empty($orderBy))
$stateme... | php | public function parse(array $criteria, array $orderBy = array(), $limit = null, $offset = null)
{
$statement = new Expr\Statement();
if(!empty($criteria)) {
$statement->setClause('condition', $this->parseCriteria($criteria));
}
if(!empty($orderBy))
$stateme... | [
"public",
"function",
"parse",
"(",
"array",
"$",
"criteria",
",",
"array",
"$",
"orderBy",
"=",
"array",
"(",
")",
",",
"$",
"limit",
"=",
"null",
",",
"$",
"offset",
"=",
"null",
")",
"{",
"$",
"statement",
"=",
"new",
"Expr",
"\\",
"Statement",
... | parse
Parse fields criteria and order
@param array $criteria
@param array $order
@access public
@return void | [
"parse",
"Parse",
"fields",
"criteria",
"and",
"order"
] | 92478f21d2b04e21fef936944c7b688a092a4bf4 | https://github.com/o3co/query.core/blob/92478f21d2b04e21fef936944c7b688a092a4bf4/Criteria/SimpleParser.php#L76-L92 |
1,617 | o3co/query.core | Criteria/SimpleParser.php | SimpleParser.parseOrXValues | protected function parseOrXValues($field, $values)
{
$exprs = array();
foreach($values as $value) {
$exprs[] = $this->parseFieldValue($field, $value);
}
return $this->expr()->orX($exprs);
} | php | protected function parseOrXValues($field, $values)
{
$exprs = array();
foreach($values as $value) {
$exprs[] = $this->parseFieldValue($field, $value);
}
return $this->expr()->orX($exprs);
} | [
"protected",
"function",
"parseOrXValues",
"(",
"$",
"field",
",",
"$",
"values",
")",
"{",
"$",
"exprs",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"values",
"as",
"$",
"value",
")",
"{",
"$",
"exprs",
"[",
"]",
"=",
"$",
"this",
"->",
"p... | parseOrXValues
parse deep array as a orx
@param mixed $field
@param mixed $values
@access protected
@return void | [
"parseOrXValues",
"parse",
"deep",
"array",
"as",
"a",
"orx"
] | 92478f21d2b04e21fef936944c7b688a092a4bf4 | https://github.com/o3co/query.core/blob/92478f21d2b04e21fef936944c7b688a092a4bf4/Criteria/SimpleParser.php#L151-L159 |
1,618 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/database/query/builder/update.php | Database_Query_Builder_Update.set | public function set(array $pairs)
{
foreach ($pairs as $column => $value)
{
$this->_set[] = array($column, $value);
}
return $this;
} | php | public function set(array $pairs)
{
foreach ($pairs as $column => $value)
{
$this->_set[] = array($column, $value);
}
return $this;
} | [
"public",
"function",
"set",
"(",
"array",
"$",
"pairs",
")",
"{",
"foreach",
"(",
"$",
"pairs",
"as",
"$",
"column",
"=>",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"_set",
"[",
"]",
"=",
"array",
"(",
"$",
"column",
",",
"$",
"value",
")",
"... | Set the values to update with an associative array.
@param array $pairs associative (column => value) list
@return $this | [
"Set",
"the",
"values",
"to",
"update",
"with",
"an",
"associative",
"array",
"."
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/database/query/builder/update.php#L76-L84 |
1,619 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/database/query/builder/update.php | Database_Query_Builder_Update.on | public function on($c1, $op, $c2)
{
$this->_last_join->on($c1, $op, $c2);
return $this;
} | php | public function on($c1, $op, $c2)
{
$this->_last_join->on($c1, $op, $c2);
return $this;
} | [
"public",
"function",
"on",
"(",
"$",
"c1",
",",
"$",
"op",
",",
"$",
"c2",
")",
"{",
"$",
"this",
"->",
"_last_join",
"->",
"on",
"(",
"$",
"c1",
",",
"$",
"op",
",",
"$",
"c2",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Adds "ON ..." conditions for the last created JOIN statement.
@param mixed $c1 column name or array($column, $alias) or object
@param string $op logic operator
@param mixed $c2 column name or array($column, $alias) or object
@return $this | [
"Adds",
"ON",
"...",
"conditions",
"for",
"the",
"last",
"created",
"JOIN",
"statement",
"."
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/database/query/builder/update.php#L192-L197 |
1,620 | atanvarno69/test-util | src/CallProtectedMethodTrait.php | CallProtectedMethodTrait.callProtectedMethod | public function callProtectedMethod(
$object,
string $method,
array $arguments = []
) {
if (!is_object($object)) {
$msg = $this->getErrorMessage(1, __METHOD__, $object);
throw new InvalidArgumentException($msg);
}
$class = new ReflectionClass($... | php | public function callProtectedMethod(
$object,
string $method,
array $arguments = []
) {
if (!is_object($object)) {
$msg = $this->getErrorMessage(1, __METHOD__, $object);
throw new InvalidArgumentException($msg);
}
$class = new ReflectionClass($... | [
"public",
"function",
"callProtectedMethod",
"(",
"$",
"object",
",",
"string",
"$",
"method",
",",
"array",
"$",
"arguments",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"object",
")",
")",
"{",
"$",
"msg",
"=",
"$",
"this",
"-... | Calls a protected or private method and returns its result.
@param object $object The instance containing the method to call.
@param string $method The method name.
@param array $arguments Arguments to pass to the method.
@throws InvalidArgumentException Non-object passed as first parameter.
@return mixed The... | [
"Calls",
"a",
"protected",
"or",
"private",
"method",
"and",
"returns",
"its",
"result",
"."
] | b4e2623118c0489caab883acc832ec9e3787d876 | https://github.com/atanvarno69/test-util/blob/b4e2623118c0489caab883acc832ec9e3787d876/src/CallProtectedMethodTrait.php#L38-L51 |
1,621 | masando/eDemyMainBundle | Controller/CssController.php | CssController.onCssLastModified | public function onCssLastModified(ContentEvent $event)
{
// @TODO lastmodified files from themeBundle templates
$reflection = new \ReflectionClass(get_class($this));
// @TODO
if(strpos($reflection->getFileName(), '/cache/')) {
$dir = dirname($reflection->getFileName()) . ... | php | public function onCssLastModified(ContentEvent $event)
{
// @TODO lastmodified files from themeBundle templates
$reflection = new \ReflectionClass(get_class($this));
// @TODO
if(strpos($reflection->getFileName(), '/cache/')) {
$dir = dirname($reflection->getFileName()) . ... | [
"public",
"function",
"onCssLastModified",
"(",
"ContentEvent",
"$",
"event",
")",
"{",
"// @TODO lastmodified files from themeBundle templates",
"$",
"reflection",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"get_class",
"(",
"$",
"this",
")",
")",
";",
"// @TODO",
"... | Este listener calcula lastmodified de la ruta
@param ContentEvent $event
@return bool | [
"Este",
"listener",
"calcula",
"lastmodified",
"de",
"la",
"ruta"
] | cd9058e58d3a5ab06824f7ebc217a32c42f56a23 | https://github.com/masando/eDemyMainBundle/blob/cd9058e58d3a5ab06824f7ebc217a32c42f56a23/Controller/CssController.php#L78-L111 |
1,622 | GrupaZero/core | src/Gzero/Core/Models/User.php | User.hasPermission | public function hasPermission($permission)
{
if (!is_array($this->permissionsMap)) {
$permissionsMap = cache()->get('permissions:' . $this->id, null);
if ($permissionsMap === null) { // Not in cache
$this->permissionsMap = $this->buildPermissionsMap();
... | php | public function hasPermission($permission)
{
if (!is_array($this->permissionsMap)) {
$permissionsMap = cache()->get('permissions:' . $this->id, null);
if ($permissionsMap === null) { // Not in cache
$this->permissionsMap = $this->buildPermissionsMap();
... | [
"public",
"function",
"hasPermission",
"(",
"$",
"permission",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"this",
"->",
"permissionsMap",
")",
")",
"{",
"$",
"permissionsMap",
"=",
"cache",
"(",
")",
"->",
"get",
"(",
"'permissions:'",
".",
"$",
"... | It checks if given user have specified permission
@param string $permission Permission name
@return bool | [
"It",
"checks",
"if",
"given",
"user",
"have",
"specified",
"permission"
] | 093e515234fa0385b259ba4d8bc7832174a44eab | https://github.com/GrupaZero/core/blob/093e515234fa0385b259ba4d8bc7832174a44eab/src/Gzero/Core/Models/User.php#L121-L133 |
1,623 | GrupaZero/core | src/Gzero/Core/Models/User.php | User.buildPermissionsMap | private function buildPermissionsMap()
{
$permissionsMap = [];
$roles = $this->roles()->with('permissions')->get()->toArray();
foreach ($roles as $role) {
if (!empty($role['permissions'])) {
foreach ($role['permissions'] as $permission) {
... | php | private function buildPermissionsMap()
{
$permissionsMap = [];
$roles = $this->roles()->with('permissions')->get()->toArray();
foreach ($roles as $role) {
if (!empty($role['permissions'])) {
foreach ($role['permissions'] as $permission) {
... | [
"private",
"function",
"buildPermissionsMap",
"(",
")",
"{",
"$",
"permissionsMap",
"=",
"[",
"]",
";",
"$",
"roles",
"=",
"$",
"this",
"->",
"roles",
"(",
")",
"->",
"with",
"(",
"'permissions'",
")",
"->",
"get",
"(",
")",
"->",
"toArray",
"(",
")"... | It build permission map.
Later we store this map cache.
@return array | [
"It",
"build",
"permission",
"map",
".",
"Later",
"we",
"store",
"this",
"map",
"cache",
"."
] | 093e515234fa0385b259ba4d8bc7832174a44eab | https://github.com/GrupaZero/core/blob/093e515234fa0385b259ba4d8bc7832174a44eab/src/Gzero/Core/Models/User.php#L168-L180 |
1,624 | j-arens/container | src/Container.php | Container.singleton | public function singleton($className) {
$closure = function(ContainerInterface $container) use($className) {
static $instance;
if (is_null($instance)) {
$instance = $container->make($className);
}
return $instance;
};
... | php | public function singleton($className) {
$closure = function(ContainerInterface $container) use($className) {
static $instance;
if (is_null($instance)) {
$instance = $container->make($className);
}
return $instance;
};
... | [
"public",
"function",
"singleton",
"(",
"$",
"className",
")",
"{",
"$",
"closure",
"=",
"function",
"(",
"ContainerInterface",
"$",
"container",
")",
"use",
"(",
"$",
"className",
")",
"{",
"static",
"$",
"instance",
";",
"if",
"(",
"is_null",
"(",
"$",... | Register a shared binding
@param string $className | [
"Register",
"a",
"shared",
"binding"
] | 8fec5bf358ff83e88d3b13c1c5500314bc5c873b | https://github.com/j-arens/container/blob/8fec5bf358ff83e88d3b13c1c5500314bc5c873b/src/Container.php#L41-L53 |
1,625 | j-arens/container | src/Container.php | Container.resolve | public function resolve($key) {
if (!array_key_exists($key, $this->bindings)) {
throw new InvalidArgumentException("{$key} is not bound.");
}
$binding = $this->bindings[$key];
$value = $binding['value'];
// singleton
if ($value instanceof Closure) {
... | php | public function resolve($key) {
if (!array_key_exists($key, $this->bindings)) {
throw new InvalidArgumentException("{$key} is not bound.");
}
$binding = $this->bindings[$key];
$value = $binding['value'];
// singleton
if ($value instanceof Closure) {
... | [
"public",
"function",
"resolve",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"bindings",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"\"{$key} is not bound.\"",
")",
";",
"}",
... | Resolve the value from the given offset
@param string $key
@return mixed | [
"Resolve",
"the",
"value",
"from",
"the",
"given",
"offset"
] | 8fec5bf358ff83e88d3b13c1c5500314bc5c873b | https://github.com/j-arens/container/blob/8fec5bf358ff83e88d3b13c1c5500314bc5c873b/src/Container.php#L61-L85 |
1,626 | j-arens/container | src/Container.php | Container.getDependencies | protected function getDependencies(ReflectionClass $refl) {
if (!$refl->isInstantiable()) {
return [];
}
$constr = $refl->getConstructor();
if (!$constr) {
return [];
}
return $constr->getParameters();
} | php | protected function getDependencies(ReflectionClass $refl) {
if (!$refl->isInstantiable()) {
return [];
}
$constr = $refl->getConstructor();
if (!$constr) {
return [];
}
return $constr->getParameters();
} | [
"protected",
"function",
"getDependencies",
"(",
"ReflectionClass",
"$",
"refl",
")",
"{",
"if",
"(",
"!",
"$",
"refl",
"->",
"isInstantiable",
"(",
")",
")",
"{",
"return",
"[",
"]",
";",
"}",
"$",
"constr",
"=",
"$",
"refl",
"->",
"getConstructor",
"... | Get an array of object dependencies
@param ReflectionClass $refl
@return array | [
"Get",
"an",
"array",
"of",
"object",
"dependencies"
] | 8fec5bf358ff83e88d3b13c1c5500314bc5c873b | https://github.com/j-arens/container/blob/8fec5bf358ff83e88d3b13c1c5500314bc5c873b/src/Container.php#L112-L124 |
1,627 | j-arens/container | src/Container.php | Container.resolveDependency | protected function resolveDependency(ReflectionParameter $dep) {
$depName = $dep->getName();
if ($dep->getClass()) {
$depName = $dep->getClass()->name;
}
// bound
if (array_key_exists($depName, $this->bindings)) {
return $this->resolve($depName);
... | php | protected function resolveDependency(ReflectionParameter $dep) {
$depName = $dep->getName();
if ($dep->getClass()) {
$depName = $dep->getClass()->name;
}
// bound
if (array_key_exists($depName, $this->bindings)) {
return $this->resolve($depName);
... | [
"protected",
"function",
"resolveDependency",
"(",
"ReflectionParameter",
"$",
"dep",
")",
"{",
"$",
"depName",
"=",
"$",
"dep",
"->",
"getName",
"(",
")",
";",
"if",
"(",
"$",
"dep",
"->",
"getClass",
"(",
")",
")",
"{",
"$",
"depName",
"=",
"$",
"d... | Resolve object dependency
@param ReflectionParameter $dep
@return mixed | [
"Resolve",
"object",
"dependency"
] | 8fec5bf358ff83e88d3b13c1c5500314bc5c873b | https://github.com/j-arens/container/blob/8fec5bf358ff83e88d3b13c1c5500314bc5c873b/src/Container.php#L132-L157 |
1,628 | allebb/git-version-number | src/Version.php | Version.getVersionString | public function getVersionString($bits = null)
{
if (is_null($bits)) {
return $this->version;
}
return implode('.', $this->versionFromBits($bits));
} | php | public function getVersionString($bits = null)
{
if (is_null($bits)) {
return $this->version;
}
return implode('.', $this->versionFromBits($bits));
} | [
"public",
"function",
"getVersionString",
"(",
"$",
"bits",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"bits",
")",
")",
"{",
"return",
"$",
"this",
"->",
"version",
";",
"}",
"return",
"implode",
"(",
"'.'",
",",
"$",
"this",
"->",
"ve... | Get the version number as a dot seperated string.
@param int $bits Optional version number bits to return.
@return string | [
"Get",
"the",
"version",
"number",
"as",
"a",
"dot",
"seperated",
"string",
"."
] | fc75f52e714d363627f02ff6df82e3097ffa7148 | https://github.com/allebb/git-version-number/blob/fc75f52e714d363627f02ff6df82e3097ffa7148/src/Version.php#L61-L67 |
1,629 | allebb/git-version-number | src/Version.php | Version.extractVersion | private function extractVersion()
{
$git = Executable::make($this->gitBin)
->addArgument(sprintf('--git-dir=%s', $this->gitPath))
->addArgument('describe')
->addArgument('--tags')
->addArgument('--always');
try {
$git->execute();
}... | php | private function extractVersion()
{
$git = Executable::make($this->gitBin)
->addArgument(sprintf('--git-dir=%s', $this->gitPath))
->addArgument('describe')
->addArgument('--tags')
->addArgument('--always');
try {
$git->execute();
}... | [
"private",
"function",
"extractVersion",
"(",
")",
"{",
"$",
"git",
"=",
"Executable",
"::",
"make",
"(",
"$",
"this",
"->",
"gitBin",
")",
"->",
"addArgument",
"(",
"sprintf",
"(",
"'--git-dir=%s'",
",",
"$",
"this",
"->",
"gitPath",
")",
")",
"->",
"... | Extracts the version from the Git repository.
@return void | [
"Extracts",
"the",
"version",
"from",
"the",
"Git",
"repository",
"."
] | fc75f52e714d363627f02ff6df82e3097ffa7148 | https://github.com/allebb/git-version-number/blob/fc75f52e714d363627f02ff6df82e3097ffa7148/src/Version.php#L122-L143 |
1,630 | allebb/git-version-number | src/Version.php | Version.versionBits | private function versionBits()
{
$versionBits = explode('-', $this->version);
if (strlen($versionBits[0])) {
$this->version = $versionBits[0];
if (isset($versionBits[1])) {
$this->version = $versionBits[0] . '.' . $versionBits[1];
}
if ... | php | private function versionBits()
{
$versionBits = explode('-', $this->version);
if (strlen($versionBits[0])) {
$this->version = $versionBits[0];
if (isset($versionBits[1])) {
$this->version = $versionBits[0] . '.' . $versionBits[1];
}
if ... | [
"private",
"function",
"versionBits",
"(",
")",
"{",
"$",
"versionBits",
"=",
"explode",
"(",
"'-'",
",",
"$",
"this",
"->",
"version",
")",
";",
"if",
"(",
"strlen",
"(",
"$",
"versionBits",
"[",
"0",
"]",
")",
")",
"{",
"$",
"this",
"->",
"versio... | Computes and sets the version number and object hash properties.
@return void | [
"Computes",
"and",
"sets",
"the",
"version",
"number",
"and",
"object",
"hash",
"properties",
"."
] | fc75f52e714d363627f02ff6df82e3097ffa7148 | https://github.com/allebb/git-version-number/blob/fc75f52e714d363627f02ff6df82e3097ffa7148/src/Version.php#L149-L161 |
1,631 | allebb/git-version-number | src/Version.php | Version.versionFromBits | private function versionFromBits($bits)
{
$version = [];
foreach (range(0, ($bits - 1)) as $bit) {
$version[$bit] = $this->getVersionBits()[$bit];
}
return $version;
} | php | private function versionFromBits($bits)
{
$version = [];
foreach (range(0, ($bits - 1)) as $bit) {
$version[$bit] = $this->getVersionBits()[$bit];
}
return $version;
} | [
"private",
"function",
"versionFromBits",
"(",
"$",
"bits",
")",
"{",
"$",
"version",
"=",
"[",
"]",
";",
"foreach",
"(",
"range",
"(",
"0",
",",
"(",
"$",
"bits",
"-",
"1",
")",
")",
"as",
"$",
"bit",
")",
"{",
"$",
"version",
"[",
"$",
"bit",... | Returns an customised array of the total number of version bits.
@param int $bits The total number of bits (segments) to return.
@return array | [
"Returns",
"an",
"customised",
"array",
"of",
"the",
"total",
"number",
"of",
"version",
"bits",
"."
] | fc75f52e714d363627f02ff6df82e3097ffa7148 | https://github.com/allebb/git-version-number/blob/fc75f52e714d363627f02ff6df82e3097ffa7148/src/Version.php#L168-L175 |
1,632 | integratedfordevelopers/integrated-solr-bundle | DependencyInjection/IntegratedSolrExtension.php | IntegratedSolrExtension.load | public function load(array $configs, ContainerBuilder $container)
{
$loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$loader->load('converter.xml');
$loader->load('event.xml');
$loader->load('event_listeners.xml');
$loader->load('co... | php | public function load(array $configs, ContainerBuilder $container)
{
$loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$loader->load('converter.xml');
$loader->load('event.xml');
$loader->load('event_listeners.xml');
$loader->load('co... | [
"public",
"function",
"load",
"(",
"array",
"$",
"configs",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"loader",
"=",
"new",
"XmlFileLoader",
"(",
"$",
"container",
",",
"new",
"FileLocator",
"(",
"__DIR__",
".",
"'/../Resources/config'",
")",
... | Load the configuration
@param array $configs
@param ContainerBuilder $container | [
"Load",
"the",
"configuration"
] | 9d9bb4071e13ed4686fbc97b6286a475ac5b2162 | https://github.com/integratedfordevelopers/integrated-solr-bundle/blob/9d9bb4071e13ed4686fbc97b6286a475ac5b2162/DependencyInjection/IntegratedSolrExtension.php#L37-L88 |
1,633 | xmmedia/XMSecurityBundle | Entity/User.php | User.setEmail | public function setEmail($email)
{
$email = is_null($email) ? '' : $email;
parent::setEmail($email);
$this->setUsername($email);
return $this;
} | php | public function setEmail($email)
{
$email = is_null($email) ? '' : $email;
parent::setEmail($email);
$this->setUsername($email);
return $this;
} | [
"public",
"function",
"setEmail",
"(",
"$",
"email",
")",
"{",
"$",
"email",
"=",
"is_null",
"(",
"$",
"email",
")",
"?",
"''",
":",
"$",
"email",
";",
"parent",
"::",
"setEmail",
"(",
"$",
"email",
")",
";",
"$",
"this",
"->",
"setUsername",
"(",
... | Set email
Also sets the username to the email
@param string $email
@return User | [
"Set",
"email",
"Also",
"sets",
"the",
"username",
"to",
"the",
"email"
] | ee71a1bb4fe038e5a08e44f73247c4e03631a840 | https://github.com/xmmedia/XMSecurityBundle/blob/ee71a1bb4fe038e5a08e44f73247c4e03631a840/Entity/User.php#L103-L110 |
1,634 | Sowapps/orpheus-entitydescriptor | src/EntityDescriptor/User/AbstractUser.php | AbstractUser.login | public function login($force=false) {
if( !$force && static::isLogged() ) {
static::throwException('alreadyLoggedin');
}
/**
* @var AbstractUser $USER
* @deprecated
*/
global $USER;
$_SESSION['USER'] = $USER = $this;
$this->login = $force ? self::LOGGED_FORCED : self::IS_LOGGED;
if( !$force ) ... | php | public function login($force=false) {
if( !$force && static::isLogged() ) {
static::throwException('alreadyLoggedin');
}
/**
* @var AbstractUser $USER
* @deprecated
*/
global $USER;
$_SESSION['USER'] = $USER = $this;
$this->login = $force ? self::LOGGED_FORCED : self::IS_LOGGED;
if( !$force ) ... | [
"public",
"function",
"login",
"(",
"$",
"force",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"force",
"&&",
"static",
"::",
"isLogged",
"(",
")",
")",
"{",
"static",
"::",
"throwException",
"(",
"'alreadyLoggedin'",
")",
";",
"}",
"/**\n\t\t * @var Abs... | Log in this user to the current session.
@param string $force | [
"Log",
"in",
"this",
"user",
"to",
"the",
"current",
"session",
"."
] | b9cc04c42e7955b11f37a70ee7cd2a518f5983b2 | https://github.com/Sowapps/orpheus-entitydescriptor/blob/b9cc04c42e7955b11f37a70ee7cd2a518f5983b2/src/EntityDescriptor/User/AbstractUser.php#L110-L125 |
1,635 | Sowapps/orpheus-entitydescriptor | src/EntityDescriptor/User/AbstractUser.php | AbstractUser.logout | public function logout($reason=null) {
global $USER;
if( !$this->login ) {
// debug('user is not logged in');
return false;
}
$this->login = self::NOT_LOGGED;
$_SESSION['USER'] = $USER = null;
$_SESSION['LOGOUT_REASON'] = $reason;
//debug('Session updated');
return true;
} | php | public function logout($reason=null) {
global $USER;
if( !$this->login ) {
// debug('user is not logged in');
return false;
}
$this->login = self::NOT_LOGGED;
$_SESSION['USER'] = $USER = null;
$_SESSION['LOGOUT_REASON'] = $reason;
//debug('Session updated');
return true;
} | [
"public",
"function",
"logout",
"(",
"$",
"reason",
"=",
"null",
")",
"{",
"global",
"$",
"USER",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"login",
")",
"{",
"// \t\t\tdebug('user is not logged in');",
"return",
"false",
";",
"}",
"$",
"this",
"->",
"logi... | Log out this user from the current session.
@param string $reason
@return boolean | [
"Log",
"out",
"this",
"user",
"from",
"the",
"current",
"session",
"."
] | b9cc04c42e7955b11f37a70ee7cd2a518f5983b2 | https://github.com/Sowapps/orpheus-entitydescriptor/blob/b9cc04c42e7955b11f37a70ee7cd2a518f5983b2/src/EntityDescriptor/User/AbstractUser.php#L133-L144 |
1,636 | Sowapps/orpheus-entitydescriptor | src/EntityDescriptor/User/AbstractUser.php | AbstractUser.checkAccess | public function checkAccess($module) {
//$module pdoit être un nom de module.
if( !isset($GLOBALS['ACCESS']->$module) ) {
return true;
}
return $this->checkPerm((int) $GLOBALS['ACCESS']->$module);
} | php | public function checkAccess($module) {
//$module pdoit être un nom de module.
if( !isset($GLOBALS['ACCESS']->$module) ) {
return true;
}
return $this->checkPerm((int) $GLOBALS['ACCESS']->$module);
} | [
"public",
"function",
"checkAccess",
"(",
"$",
"module",
")",
"{",
"//$module pdoit être un nom de module.",
"if",
"(",
"!",
"isset",
"(",
"$",
"GLOBALS",
"[",
"'ACCESS'",
"]",
"->",
"$",
"module",
")",
")",
"{",
"return",
"true",
";",
"}",
"return",
"$",
... | Check access permissions
@param string $module The module to check
@return boolean True if this user has enough acess level to access to this module
@see checkPerm()
@warning Obsolete | [
"Check",
"access",
"permissions"
] | b9cc04c42e7955b11f37a70ee7cd2a518f5983b2 | https://github.com/Sowapps/orpheus-entitydescriptor/blob/b9cc04c42e7955b11f37a70ee7cd2a518f5983b2/src/EntityDescriptor/User/AbstractUser.php#L173-L179 |
1,637 | Sowapps/orpheus-entitydescriptor | src/EntityDescriptor/User/AbstractUser.php | AbstractUser.canDo | public function canDo($action, $object=null) {
return $this->equals($object) || ( $this->checkPerm($action) && ( !($object instanceof AbstractUser) || $this->canAlter($object) ) );
} | php | public function canDo($action, $object=null) {
return $this->equals($object) || ( $this->checkPerm($action) && ( !($object instanceof AbstractUser) || $this->canAlter($object) ) );
} | [
"public",
"function",
"canDo",
"(",
"$",
"action",
",",
"$",
"object",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"equals",
"(",
"$",
"object",
")",
"||",
"(",
"$",
"this",
"->",
"checkPerm",
"(",
"$",
"action",
")",
"&&",
"(",
"!",
"(",... | Check if this user can affect data on the given user
@param string $action The action to look for
@param object $object The object we want to edit
@return boolean True if this user has enough access level to alter $object (or he is altering himself)
@see loggedCanDo()
@see canAlter()
Check if this user can affect $ob... | [
"Check",
"if",
"this",
"user",
"can",
"affect",
"data",
"on",
"the",
"given",
"user"
] | b9cc04c42e7955b11f37a70ee7cd2a518f5983b2 | https://github.com/Sowapps/orpheus-entitydescriptor/blob/b9cc04c42e7955b11f37a70ee7cd2a518f5983b2/src/EntityDescriptor/User/AbstractUser.php#L215-L217 |
1,638 | Sowapps/orpheus-entitydescriptor | src/EntityDescriptor/User/AbstractUser.php | AbstractUser.userLogin | public static function userLogin($data, $loginField='email') {
if( empty($data[$loginField]) ) {
static::throwException('invalidLoginID');
}
$name = $data[$loginField];
if( empty($data['password']) ) {
static::throwException('invalidPassword');
}
$password = hashString($data['password']);
//self::... | php | public static function userLogin($data, $loginField='email') {
if( empty($data[$loginField]) ) {
static::throwException('invalidLoginID');
}
$name = $data[$loginField];
if( empty($data['password']) ) {
static::throwException('invalidPassword');
}
$password = hashString($data['password']);
//self::... | [
"public",
"static",
"function",
"userLogin",
"(",
"$",
"data",
",",
"$",
"loginField",
"=",
"'email'",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"data",
"[",
"$",
"loginField",
"]",
")",
")",
"{",
"static",
"::",
"throwException",
"(",
"'invalidLoginID'",
... | Logs in an user using data
@param array $data
@param string $loginField
@return \Orpheus\SQLRequest\SQLSelectRequest|\Orpheus\EntityDescriptor\User\AbstractUser|\Orpheus\Publisher\PermanentObject\static[] | [
"Logs",
"in",
"an",
"user",
"using",
"data"
] | b9cc04c42e7955b11f37a70ee7cd2a518f5983b2 | https://github.com/Sowapps/orpheus-entitydescriptor/blob/b9cc04c42e7955b11f37a70ee7cd2a518f5983b2/src/EntityDescriptor/User/AbstractUser.php#L226-L255 |
1,639 | Sowapps/orpheus-entitydescriptor | src/EntityDescriptor/User/AbstractUser.php | AbstractUser.httpLogin | public static function httpLogin() {
$user = static::get(array(
'where' => 'name LIKE '.static::formatValue($_SERVER['PHP_AUTH_USER']),
// 'number' => 1,
'output' => SQLAdapter::OBJECT
));
if( empty($user) ) {
static::throwNotFound();
}
if( $user->password != static::hashPassword($_SERVER['PHP_AU... | php | public static function httpLogin() {
$user = static::get(array(
'where' => 'name LIKE '.static::formatValue($_SERVER['PHP_AUTH_USER']),
// 'number' => 1,
'output' => SQLAdapter::OBJECT
));
if( empty($user) ) {
static::throwNotFound();
}
if( $user->password != static::hashPassword($_SERVER['PHP_AU... | [
"public",
"static",
"function",
"httpLogin",
"(",
")",
"{",
"$",
"user",
"=",
"static",
"::",
"get",
"(",
"array",
"(",
"'where'",
"=>",
"'name LIKE '",
".",
"static",
"::",
"formatValue",
"(",
"$",
"_SERVER",
"[",
"'PHP_AUTH_USER'",
"]",
")",
",",
"// \... | Log in an user from HTTP authentication according to server variables PHP_AUTH_USER and PHP_AUTH_PW | [
"Log",
"in",
"an",
"user",
"from",
"HTTP",
"authentication",
"according",
"to",
"server",
"variables",
"PHP_AUTH_USER",
"and",
"PHP_AUTH_PW"
] | b9cc04c42e7955b11f37a70ee7cd2a518f5983b2 | https://github.com/Sowapps/orpheus-entitydescriptor/blob/b9cc04c42e7955b11f37a70ee7cd2a518f5983b2/src/EntityDescriptor/User/AbstractUser.php#L279-L293 |
1,640 | Sowapps/orpheus-entitydescriptor | src/EntityDescriptor/User/AbstractUser.php | AbstractUser.httpAuthenticate | public static function httpAuthenticate() {
try {
static::httpLogin();
return true;
} catch( NotFoundException $e ) {
if( Config::get('httpauth_autocreate') ) {
$user = static::httpCreate();
$user->login();
return true;
}
} catch( UserException $e ) { }
return false;
} | php | public static function httpAuthenticate() {
try {
static::httpLogin();
return true;
} catch( NotFoundException $e ) {
if( Config::get('httpauth_autocreate') ) {
$user = static::httpCreate();
$user->login();
return true;
}
} catch( UserException $e ) { }
return false;
} | [
"public",
"static",
"function",
"httpAuthenticate",
"(",
")",
"{",
"try",
"{",
"static",
"::",
"httpLogin",
"(",
")",
";",
"return",
"true",
";",
"}",
"catch",
"(",
"NotFoundException",
"$",
"e",
")",
"{",
"if",
"(",
"Config",
"::",
"get",
"(",
"'httpa... | Login from HTTP authentication, create user if not existing
@return boolean
@warning Require other data than name and password are optional
Create user from HTTP authentication | [
"Login",
"from",
"HTTP",
"authentication",
"create",
"user",
"if",
"not",
"existing"
] | b9cc04c42e7955b11f37a70ee7cd2a518f5983b2 | https://github.com/Sowapps/orpheus-entitydescriptor/blob/b9cc04c42e7955b11f37a70ee7cd2a518f5983b2/src/EntityDescriptor/User/AbstractUser.php#L315-L327 |
1,641 | Sowapps/orpheus-entitydescriptor | src/EntityDescriptor/User/AbstractUser.php | AbstractUser.load | public static function load($id, $nullable=true, $usingCache=true) {
if( static::getLoggedUserID() == $id ) {
return $GLOBALS['USER'];
}
return parent::load($id, $nullable, $usingCache);
} | php | public static function load($id, $nullable=true, $usingCache=true) {
if( static::getLoggedUserID() == $id ) {
return $GLOBALS['USER'];
}
return parent::load($id, $nullable, $usingCache);
} | [
"public",
"static",
"function",
"load",
"(",
"$",
"id",
",",
"$",
"nullable",
"=",
"true",
",",
"$",
"usingCache",
"=",
"true",
")",
"{",
"if",
"(",
"static",
"::",
"getLoggedUserID",
"(",
")",
"==",
"$",
"id",
")",
"{",
"return",
"$",
"GLOBALS",
"... | Load an user object
@param mixed|mixed[] $id The object ID to load or a valid array of the object's data
@param boolean $nullable True to silent errors row and return null
@param boolean $usingCache True to cache load and set cache, false to not cache
@return PermanentObject The object
It tries to optimize by getting... | [
"Load",
"an",
"user",
"object"
] | b9cc04c42e7955b11f37a70ee7cd2a518f5983b2 | https://github.com/Sowapps/orpheus-entitydescriptor/blob/b9cc04c42e7955b11f37a70ee7cd2a518f5983b2/src/EntityDescriptor/User/AbstractUser.php#L384-L389 |
1,642 | Sowapps/orpheus-entitydescriptor | src/EntityDescriptor/User/AbstractUser.php | AbstractUser.loggedCanAccessToRoute | public static function loggedCanAccessToRoute($route, $accesslevel) {
$user = static::getLoggedUser();
if( !ctype_digit($accesslevel) ) {
$accesslevel = static::getRoleAccesslevel($accesslevel);
}
$accesslevel = (int) $accesslevel;
return ( empty($user) && $accesslevel < 0 ) ||
( !empty($user) && $acces... | php | public static function loggedCanAccessToRoute($route, $accesslevel) {
$user = static::getLoggedUser();
if( !ctype_digit($accesslevel) ) {
$accesslevel = static::getRoleAccesslevel($accesslevel);
}
$accesslevel = (int) $accesslevel;
return ( empty($user) && $accesslevel < 0 ) ||
( !empty($user) && $acces... | [
"public",
"static",
"function",
"loggedCanAccessToRoute",
"(",
"$",
"route",
",",
"$",
"accesslevel",
")",
"{",
"$",
"user",
"=",
"static",
"::",
"getLoggedUser",
"(",
")",
";",
"if",
"(",
"!",
"ctype_digit",
"(",
"$",
"accesslevel",
")",
")",
"{",
"$",
... | Check if this user can access to a module
@param string $route The route to look for
@param int $accesslevel The access level
@return boolean True if this user can access to $module | [
"Check",
"if",
"this",
"user",
"can",
"access",
"to",
"a",
"module"
] | b9cc04c42e7955b11f37a70ee7cd2a518f5983b2 | https://github.com/Sowapps/orpheus-entitydescriptor/blob/b9cc04c42e7955b11f37a70ee7cd2a518f5983b2/src/EntityDescriptor/User/AbstractUser.php#L411-L420 |
1,643 | Sowapps/orpheus-entitydescriptor | src/EntityDescriptor/User/AbstractUser.php | AbstractUser.loggedHasDeveloperAccess | public static function loggedHasDeveloperAccess() {
$user = static::getLoggedUser();
$requiredAccessLevel = (int) static::getRoleAccesslevel('developer');
return $user && $user->checkPerm($requiredAccessLevel);
} | php | public static function loggedHasDeveloperAccess() {
$user = static::getLoggedUser();
$requiredAccessLevel = (int) static::getRoleAccesslevel('developer');
return $user && $user->checkPerm($requiredAccessLevel);
} | [
"public",
"static",
"function",
"loggedHasDeveloperAccess",
"(",
")",
"{",
"$",
"user",
"=",
"static",
"::",
"getLoggedUser",
"(",
")",
";",
"$",
"requiredAccessLevel",
"=",
"(",
"int",
")",
"static",
"::",
"getRoleAccesslevel",
"(",
"'developer'",
")",
";",
... | Check if this user has developer access
@return boolean True if this user has developer access | [
"Check",
"if",
"this",
"user",
"has",
"developer",
"access"
] | b9cc04c42e7955b11f37a70ee7cd2a518f5983b2 | https://github.com/Sowapps/orpheus-entitydescriptor/blob/b9cc04c42e7955b11f37a70ee7cd2a518f5983b2/src/EntityDescriptor/User/AbstractUser.php#L427-L431 |
1,644 | Sowapps/orpheus-entitydescriptor | src/EntityDescriptor/User/AbstractUser.php | AbstractUser.loggedCanDo | public static function loggedCanDo($action, AbstractUser $object=null) {
global $USER;
return !empty($USER) && $USER->canDo($action, $object);
} | php | public static function loggedCanDo($action, AbstractUser $object=null) {
global $USER;
return !empty($USER) && $USER->canDo($action, $object);
} | [
"public",
"static",
"function",
"loggedCanDo",
"(",
"$",
"action",
",",
"AbstractUser",
"$",
"object",
"=",
"null",
")",
"{",
"global",
"$",
"USER",
";",
"return",
"!",
"empty",
"(",
"$",
"USER",
")",
"&&",
"$",
"USER",
"->",
"canDo",
"(",
"$",
"acti... | Check if this user can do a restricted action
@param string $action The action to look for
@param AbstractUser $object The object to edit if editing one or null. Default value is null
@return boolean True if this user can do this $action | [
"Check",
"if",
"this",
"user",
"can",
"do",
"a",
"restricted",
"action"
] | b9cc04c42e7955b11f37a70ee7cd2a518f5983b2 | https://github.com/Sowapps/orpheus-entitydescriptor/blob/b9cc04c42e7955b11f37a70ee7cd2a518f5983b2/src/EntityDescriptor/User/AbstractUser.php#L469-L472 |
1,645 | Sowapps/orpheus-entitydescriptor | src/EntityDescriptor/User/AbstractUser.php | AbstractUser.checkForObject | public static function checkForObject($data, $ref=null) {
if( empty($data['email']) ) {
return;//Nothing to check. Email is mandatory.
}
$where = 'email LIKE '.static::formatValue($data['email']);
$what = 'email';
if( !empty($data['name']) ) {
$what .= ', name';
$where .= ' OR name LIKE '.static::for... | php | public static function checkForObject($data, $ref=null) {
if( empty($data['email']) ) {
return;//Nothing to check. Email is mandatory.
}
$where = 'email LIKE '.static::formatValue($data['email']);
$what = 'email';
if( !empty($data['name']) ) {
$what .= ', name';
$where .= ' OR name LIKE '.static::for... | [
"public",
"static",
"function",
"checkForObject",
"(",
"$",
"data",
",",
"$",
"ref",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"data",
"[",
"'email'",
"]",
")",
")",
"{",
"return",
";",
"//Nothing to check. Email is mandatory.",
"}",
"$",
"whe... | Check for object
@param $data The new data to process.
@param $ref The referenced object (update only). Default value is null.
@see create()
@see update()
This function is called by create() after checking user input data and before running for them.
In the base class, this method does nothing. | [
"Check",
"for",
"object"
] | b9cc04c42e7955b11f37a70ee7cd2a518f5983b2 | https://github.com/Sowapps/orpheus-entitydescriptor/blob/b9cc04c42e7955b11f37a70ee7cd2a518f5983b2/src/EntityDescriptor/User/AbstractUser.php#L485-L508 |
1,646 | nattreid/latte | src/Filters.php | Filters.localeNumber | private static function localeNumber($number, int $decimal = 2): string
{
return Number::getNumber(self::prepareFloat($number), $decimal);
} | php | private static function localeNumber($number, int $decimal = 2): string
{
return Number::getNumber(self::prepareFloat($number), $decimal);
} | [
"private",
"static",
"function",
"localeNumber",
"(",
"$",
"number",
",",
"int",
"$",
"decimal",
"=",
"2",
")",
":",
"string",
"{",
"return",
"Number",
"::",
"getNumber",
"(",
"self",
"::",
"prepareFloat",
"(",
"$",
"number",
")",
",",
"$",
"decimal",
... | Vrati zformatovane cislo
@param float|string|null $number
@param int $decimal
@return string | [
"Vrati",
"zformatovane",
"cislo"
] | f80f8de758b259c320dca0eb68d8b39982a1e172 | https://github.com/nattreid/latte/blob/f80f8de758b259c320dca0eb68d8b39982a1e172/src/Filters.php#L57-L60 |
1,647 | nattreid/latte | src/Filters.php | Filters.localeDateTime | private static function localeDateTime($datetime, bool $withSeconds = false): string
{
return Date::getDateTime($datetime, $withSeconds);
} | php | private static function localeDateTime($datetime, bool $withSeconds = false): string
{
return Date::getDateTime($datetime, $withSeconds);
} | [
"private",
"static",
"function",
"localeDateTime",
"(",
"$",
"datetime",
",",
"bool",
"$",
"withSeconds",
"=",
"false",
")",
":",
"string",
"{",
"return",
"Date",
"::",
"getDateTime",
"(",
"$",
"datetime",
",",
"$",
"withSeconds",
")",
";",
"}"
] | Lokalizovane datum s casem
@param Datetime|int $datetime
@param bool $withSeconds
@return string | [
"Lokalizovane",
"datum",
"s",
"casem"
] | f80f8de758b259c320dca0eb68d8b39982a1e172 | https://github.com/nattreid/latte/blob/f80f8de758b259c320dca0eb68d8b39982a1e172/src/Filters.php#L102-L105 |
1,648 | cosmow/riak | lib/CosmoW/Riak/Collection.php | Collection.aggregate | public function aggregate(array $pipeline, array $options = array() /* , array $op, ... */)
{
/* If the single array argument contains a zeroth index, consider it an
* array of pipeline operators. Otherwise, assume that each argument is
* a pipeline operator.
*/
if ( ! arr... | php | public function aggregate(array $pipeline, array $options = array() /* , array $op, ... */)
{
/* If the single array argument contains a zeroth index, consider it an
* array of pipeline operators. Otherwise, assume that each argument is
* a pipeline operator.
*/
if ( ! arr... | [
"public",
"function",
"aggregate",
"(",
"array",
"$",
"pipeline",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
"/* , array $op, ... */",
")",
"{",
"/* If the single array argument contains a zeroth index, consider it an\n * array of pipeline operators. Otherwise,... | Invokes the aggregate command.
This method will dispatch preAggregate and postAggregate events.
By default, the results from a non-cursor aggregate command will be
returned as an ArrayIterator; however, if the pipeline ends in an $out
operator, a cursor on the output collection will be returned instead.
If the "curs... | [
"Invokes",
"the",
"aggregate",
"command",
"."
] | 49c2bbfbbc036cd38babfeba1e93667ceca5ec0a | https://github.com/cosmow/riak/blob/49c2bbfbbc036cd38babfeba1e93667ceca5ec0a/lib/CosmoW/Riak/Collection.php#L111-L135 |
1,649 | cosmow/riak | lib/CosmoW/Riak/Collection.php | Collection.count | public function count(array $query = array(), $limitOrOptions = 0, $skip = 0)
{
$options = is_array($limitOrOptions)
? array_merge(array('limit' => 0, 'skip' => 0), $limitOrOptions)
: array('limit' => $limitOrOptions, 'skip' => $skip);
$options['limit'] = (integer) $options[... | php | public function count(array $query = array(), $limitOrOptions = 0, $skip = 0)
{
$options = is_array($limitOrOptions)
? array_merge(array('limit' => 0, 'skip' => 0), $limitOrOptions)
: array('limit' => $limitOrOptions, 'skip' => $skip);
$options['limit'] = (integer) $options[... | [
"public",
"function",
"count",
"(",
"array",
"$",
"query",
"=",
"array",
"(",
")",
",",
"$",
"limitOrOptions",
"=",
"0",
",",
"$",
"skip",
"=",
"0",
")",
"{",
"$",
"options",
"=",
"is_array",
"(",
"$",
"limitOrOptions",
")",
"?",
"array_merge",
"(",
... | Invokes the count command.
@see http://php.net/manual/en/mongocollection.count.php
@see http://docs.mongodb.org/manual/reference/command/count/
@param array $query
@param integer|array $limitOrOptions Limit or options array
@param integer $skip
@return integer | [
"Invokes",
"the",
"count",
"command",
"."
] | 49c2bbfbbc036cd38babfeba1e93667ceca5ec0a | https://github.com/cosmow/riak/blob/49c2bbfbbc036cd38babfeba1e93667ceca5ec0a/lib/CosmoW/Riak/Collection.php#L174-L184 |
1,650 | cosmow/riak | lib/CosmoW/Riak/Collection.php | Collection.distinct | public function distinct($field, array $query = array(), array $options = array())
{
if ($this->eventManager->hasListeners(Events::preDistinct)) {
/* The distinct command currently does not have options beyond field
* and query, so do not include it in the event args.
*... | php | public function distinct($field, array $query = array(), array $options = array())
{
if ($this->eventManager->hasListeners(Events::preDistinct)) {
/* The distinct command currently does not have options beyond field
* and query, so do not include it in the event args.
*... | [
"public",
"function",
"distinct",
"(",
"$",
"field",
",",
"array",
"$",
"query",
"=",
"array",
"(",
")",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"eventManager",
"->",
"hasListeners",
"(",
"Events"... | Invokes the distinct command.
This method will dispatch preDistinct and postDistinct events.
@see http://php.net/manual/en/mongocollection.distinct.php
@see http://docs.mongodb.org/manual/reference/command/distinct/
@param string $field
@param array $query
@param array $options
@return ArrayIterator
@throws ResultE... | [
"Invokes",
"the",
"distinct",
"command",
"."
] | 49c2bbfbbc036cd38babfeba1e93667ceca5ec0a | https://github.com/cosmow/riak/blob/49c2bbfbbc036cd38babfeba1e93667ceca5ec0a/lib/CosmoW/Riak/Collection.php#L254-L272 |
1,651 | cosmow/riak | lib/CosmoW/Riak/Collection.php | Collection.near | public function near($near, array $query = array(), array $options = array())
{
if ($this->eventManager->hasListeners(Events::preNear)) {
$this->eventManager->dispatchEvent(Events::preNear, new NearEventArgs($this, $query, $near, $options));
}
$result = $this->doNear($near, $que... | php | public function near($near, array $query = array(), array $options = array())
{
if ($this->eventManager->hasListeners(Events::preNear)) {
$this->eventManager->dispatchEvent(Events::preNear, new NearEventArgs($this, $query, $near, $options));
}
$result = $this->doNear($near, $que... | [
"public",
"function",
"near",
"(",
"$",
"near",
",",
"array",
"$",
"query",
"=",
"array",
"(",
")",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"eventManager",
"->",
"hasListeners",
"(",
"Events",
"... | Invokes the geoNear command.
This method will dispatch preNear and postNear events.
The $near parameter may be a GeoJSON point or a legacy coordinate pair,
which is an array of float values in x, y order (easting, northing for
projected coordinates, longitude, latitude for geographic coordinates).
A GeoJSON point may... | [
"Invokes",
"the",
"geoNear",
"command",
"."
] | 49c2bbfbbc036cd38babfeba1e93667ceca5ec0a | https://github.com/cosmow/riak/blob/49c2bbfbbc036cd38babfeba1e93667ceca5ec0a/lib/CosmoW/Riak/Collection.php#L706-L721 |
1,652 | cosmow/riak | lib/CosmoW/Riak/Collection.php | Collection.doAggregate | protected function doAggregate(array $pipeline, array $options = array())
{
if (isset($options['cursor']) && ($options['cursor'] || is_array($options['cursor']))) {
return $this->doAggregateCursor($pipeline, $options);
}
unset($options['cursor']);
list($commandOptions, ... | php | protected function doAggregate(array $pipeline, array $options = array())
{
if (isset($options['cursor']) && ($options['cursor'] || is_array($options['cursor']))) {
return $this->doAggregateCursor($pipeline, $options);
}
unset($options['cursor']);
list($commandOptions, ... | [
"protected",
"function",
"doAggregate",
"(",
"array",
"$",
"pipeline",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"options",
"[",
"'cursor'",
"]",
")",
"&&",
"(",
"$",
"options",
"[",
"'cursor'",
"]"... | Execute the aggregate command.
@see Collection::aggregate()
@param array $pipeline
@param array $options
@return Iterator | [
"Execute",
"the",
"aggregate",
"command",
"."
] | 49c2bbfbbc036cd38babfeba1e93667ceca5ec0a | https://github.com/cosmow/riak/blob/49c2bbfbbc036cd38babfeba1e93667ceca5ec0a/lib/CosmoW/Riak/Collection.php#L889-L928 |
1,653 | cosmow/riak | lib/CosmoW/Riak/Collection.php | Collection.doAggregateCursor | protected function doAggregateCursor(array $pipeline, array $options = array())
{
if ( ! method_exists('RiakCollection', 'aggregateCursor')) {
throw new BadMethodCallException('RiakCollection::aggregateCursor() is not available');
}
list($commandOptions, $clientOptions) = isset(... | php | protected function doAggregateCursor(array $pipeline, array $options = array())
{
if ( ! method_exists('RiakCollection', 'aggregateCursor')) {
throw new BadMethodCallException('RiakCollection::aggregateCursor() is not available');
}
list($commandOptions, $clientOptions) = isset(... | [
"protected",
"function",
"doAggregateCursor",
"(",
"array",
"$",
"pipeline",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"method_exists",
"(",
"'RiakCollection'",
",",
"'aggregateCursor'",
")",
")",
"{",
"throw",
"new",
... | Executes the aggregate command and returns a RiakCommandCursor.
@param array $pipeline
@param array $options
@return CommandCursor
@throws BadMethodCallException if RiakCollection::aggregateCursor() is not available | [
"Executes",
"the",
"aggregate",
"command",
"and",
"returns",
"a",
"RiakCommandCursor",
"."
] | 49c2bbfbbc036cd38babfeba1e93667ceca5ec0a | https://github.com/cosmow/riak/blob/49c2bbfbbc036cd38babfeba1e93667ceca5ec0a/lib/CosmoW/Riak/Collection.php#L938-L968 |
1,654 | cosmow/riak | lib/CosmoW/Riak/Collection.php | Collection.doBatchInsert | protected function doBatchInsert(array &$a, array $options = array())
{
$options = isset($options['safe']) ? $this->convertWriteConcern($options) : $options;
$options = isset($options['wtimeout']) ? $this->convertWriteTimeout($options) : $options;
$options = isset($options['timeout']) ? $thi... | php | protected function doBatchInsert(array &$a, array $options = array())
{
$options = isset($options['safe']) ? $this->convertWriteConcern($options) : $options;
$options = isset($options['wtimeout']) ? $this->convertWriteTimeout($options) : $options;
$options = isset($options['timeout']) ? $thi... | [
"protected",
"function",
"doBatchInsert",
"(",
"array",
"&",
"$",
"a",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"options",
"=",
"isset",
"(",
"$",
"options",
"[",
"'safe'",
"]",
")",
"?",
"$",
"this",
"->",
"convertWriteCo... | Execute the batchInsert query.
@see Collection::batchInsert()
@param array $a
@param array $options
@return array|boolean | [
"Execute",
"the",
"batchInsert",
"query",
"."
] | 49c2bbfbbc036cd38babfeba1e93667ceca5ec0a | https://github.com/cosmow/riak/blob/49c2bbfbbc036cd38babfeba1e93667ceca5ec0a/lib/CosmoW/Riak/Collection.php#L978-L984 |
1,655 | cosmow/riak | lib/CosmoW/Riak/Collection.php | Collection.doFindAndUpdate | protected function doFindAndUpdate(array $query, array $newObj, array $options)
{
list($commandOptions, $clientOptions) = isset($options['socketTimeoutMS']) || isset($options['timeout'])
? $this->splitCommandAndClientOptions($options)
: array($options, array());
$command = a... | php | protected function doFindAndUpdate(array $query, array $newObj, array $options)
{
list($commandOptions, $clientOptions) = isset($options['socketTimeoutMS']) || isset($options['timeout'])
? $this->splitCommandAndClientOptions($options)
: array($options, array());
$command = a... | [
"protected",
"function",
"doFindAndUpdate",
"(",
"array",
"$",
"query",
",",
"array",
"$",
"newObj",
",",
"array",
"$",
"options",
")",
"{",
"list",
"(",
"$",
"commandOptions",
",",
"$",
"clientOptions",
")",
"=",
"isset",
"(",
"$",
"options",
"[",
"'soc... | Execute the findAndModify command with the update option.
@see Collection::findAndUpdate()
@param array $query
@param array $newObj
@param array $options
@return array|null
@throws ResultException if the command fails | [
"Execute",
"the",
"findAndModify",
"command",
"with",
"the",
"update",
"option",
"."
] | 49c2bbfbbc036cd38babfeba1e93667ceca5ec0a | https://github.com/cosmow/riak/blob/49c2bbfbbc036cd38babfeba1e93667ceca5ec0a/lib/CosmoW/Riak/Collection.php#L1123-L1142 |
1,656 | cosmow/riak | lib/CosmoW/Riak/Collection.php | Collection.doSave | protected function doSave(array &$a, array $options)
{
$options = isset($options['safe']) ? $this->convertWriteConcern($options) : $options;
$options = isset($options['wtimeout']) ? $this->convertWriteTimeout($options) : $options;
$options = isset($options['timeout']) ? $this->convertSocketT... | php | protected function doSave(array &$a, array $options)
{
$options = isset($options['safe']) ? $this->convertWriteConcern($options) : $options;
$options = isset($options['wtimeout']) ? $this->convertWriteTimeout($options) : $options;
$options = isset($options['timeout']) ? $this->convertSocketT... | [
"protected",
"function",
"doSave",
"(",
"array",
"&",
"$",
"a",
",",
"array",
"$",
"options",
")",
"{",
"$",
"options",
"=",
"isset",
"(",
"$",
"options",
"[",
"'safe'",
"]",
")",
"?",
"$",
"this",
"->",
"convertWriteConcern",
"(",
"$",
"options",
")... | Execute the save query.
@see Collection::save()
@param array $a
@param array $options
@return array|boolean | [
"Execute",
"the",
"save",
"query",
"."
] | 49c2bbfbbc036cd38babfeba1e93667ceca5ec0a | https://github.com/cosmow/riak/blob/49c2bbfbbc036cd38babfeba1e93667ceca5ec0a/lib/CosmoW/Riak/Collection.php#L1372-L1378 |
1,657 | cosmow/riak | lib/CosmoW/Riak/Collection.php | Collection.doUpdate | protected function doUpdate(array $query, array $newObj, array $options)
{
$options = isset($options['safe']) ? $this->convertWriteConcern($options) : $options;
$options = isset($options['wtimeout']) ? $this->convertWriteTimeout($options) : $options;
$options = isset($options['timeout']) ? $... | php | protected function doUpdate(array $query, array $newObj, array $options)
{
$options = isset($options['safe']) ? $this->convertWriteConcern($options) : $options;
$options = isset($options['wtimeout']) ? $this->convertWriteTimeout($options) : $options;
$options = isset($options['timeout']) ? $... | [
"protected",
"function",
"doUpdate",
"(",
"array",
"$",
"query",
",",
"array",
"$",
"newObj",
",",
"array",
"$",
"options",
")",
"{",
"$",
"options",
"=",
"isset",
"(",
"$",
"options",
"[",
"'safe'",
"]",
")",
"?",
"$",
"this",
"->",
"convertWriteConce... | Execute the update query.
@see Collection::update()
@param array $query
@param array $newObj
@param array $options
@return array|boolean | [
"Execute",
"the",
"update",
"query",
"."
] | 49c2bbfbbc036cd38babfeba1e93667ceca5ec0a | https://github.com/cosmow/riak/blob/49c2bbfbbc036cd38babfeba1e93667ceca5ec0a/lib/CosmoW/Riak/Collection.php#L1389-L1404 |
1,658 | cosmow/riak | lib/CosmoW/Riak/Collection.php | Collection.wrapCursor | protected function wrapCursor(\RiakCursor $cursor, $query, $fields)
{
return new Cursor($this, $cursor, $query, $fields, $this->numRetries);
} | php | protected function wrapCursor(\RiakCursor $cursor, $query, $fields)
{
return new Cursor($this, $cursor, $query, $fields, $this->numRetries);
} | [
"protected",
"function",
"wrapCursor",
"(",
"\\",
"RiakCursor",
"$",
"cursor",
",",
"$",
"query",
",",
"$",
"fields",
")",
"{",
"return",
"new",
"Cursor",
"(",
"$",
"this",
",",
"$",
"cursor",
",",
"$",
"query",
",",
"$",
"fields",
",",
"$",
"this",
... | Wraps a RiakCursor instance with a Cursor.
@param \RiakCursor $cursor
@param array $query
@param array $fields
@return Cursor | [
"Wraps",
"a",
"RiakCursor",
"instance",
"with",
"a",
"Cursor",
"."
] | 49c2bbfbbc036cd38babfeba1e93667ceca5ec0a | https://github.com/cosmow/riak/blob/49c2bbfbbc036cd38babfeba1e93667ceca5ec0a/lib/CosmoW/Riak/Collection.php#L1458-L1461 |
1,659 | swoopaholic/Components | Table/TableView.php | TableView.isRendered | public function isRendered()
{
$hasChildren = 0 < count($this->children);
if (true === $this->rendered || !$hasChildren) {
return $this->rendered;
}
if ($hasChildren) {
foreach ($this->children as $child) {
if (!$child->isRendered()) {
... | php | public function isRendered()
{
$hasChildren = 0 < count($this->children);
if (true === $this->rendered || !$hasChildren) {
return $this->rendered;
}
if ($hasChildren) {
foreach ($this->children as $child) {
if (!$child->isRendered()) {
... | [
"public",
"function",
"isRendered",
"(",
")",
"{",
"$",
"hasChildren",
"=",
"0",
"<",
"count",
"(",
"$",
"this",
"->",
"children",
")",
";",
"if",
"(",
"true",
"===",
"$",
"this",
"->",
"rendered",
"||",
"!",
"$",
"hasChildren",
")",
"{",
"return",
... | Returns whether the view was already rendered.
@return bool Whether this view's widget is rendered. | [
"Returns",
"whether",
"the",
"view",
"was",
"already",
"rendered",
"."
] | a665248a4d3285dea936579a763b5a7ecfe62c4a | https://github.com/swoopaholic/Components/blob/a665248a4d3285dea936579a763b5a7ecfe62c4a/Table/TableView.php#L52-L71 |
1,660 | stakhanovist/worker | library/ProcessEvent.php | ProcessEvent.getParam | public function getParam($name, $default = null)
{
switch ($name) {
case 'processor':
return $this->getProcessor();
case 'message':
return $this->getMessage();
case 'result':
return $this->getResult();
default:
... | php | public function getParam($name, $default = null)
{
switch ($name) {
case 'processor':
return $this->getProcessor();
case 'message':
return $this->getMessage();
case 'result':
return $this->getResult();
default:
... | [
"public",
"function",
"getParam",
"(",
"$",
"name",
",",
"$",
"default",
"=",
"null",
")",
"{",
"switch",
"(",
"$",
"name",
")",
"{",
"case",
"'processor'",
":",
"return",
"$",
"this",
"->",
"getProcessor",
"(",
")",
";",
"case",
"'message'",
":",
"r... | Get event parameter
@param string $name
@param mixed $default
@return mixed | [
"Get",
"event",
"parameter"
] | 63f6aaeb06986a7c39b5e5c4be742b92942b5d3f | https://github.com/stakhanovist/worker/blob/63f6aaeb06986a7c39b5e5c4be742b92942b5d3f/library/ProcessEvent.php#L144-L156 |
1,661 | stakhanovist/worker | library/ProcessEvent.php | ProcessEvent.getParams | public function getParams()
{
$params = parent::getParams();
$params['processor'] = $this->getProcessor();
$params['message'] = $this->getMessage();
$params['result'] = $this->getResult();
return $params;
} | php | public function getParams()
{
$params = parent::getParams();
$params['processor'] = $this->getProcessor();
$params['message'] = $this->getMessage();
$params['result'] = $this->getResult();
return $params;
} | [
"public",
"function",
"getParams",
"(",
")",
"{",
"$",
"params",
"=",
"parent",
"::",
"getParams",
"(",
")",
";",
"$",
"params",
"[",
"'processor'",
"]",
"=",
"$",
"this",
"->",
"getProcessor",
"(",
")",
";",
"$",
"params",
"[",
"'message'",
"]",
"="... | Get all event parameters
@return array|\ArrayAccess | [
"Get",
"all",
"event",
"parameters"
] | 63f6aaeb06986a7c39b5e5c4be742b92942b5d3f | https://github.com/stakhanovist/worker/blob/63f6aaeb06986a7c39b5e5c4be742b92942b5d3f/library/ProcessEvent.php#L163-L170 |
1,662 | stakhanovist/worker | library/ProcessEvent.php | ProcessEvent.setParam | public function setParam($name, $value)
{
switch ($name) {
case 'processor':
$this->setProcessor($value);
break;
case 'message':
$this->setMessage($value);
break;
case 'result':
$this->setResu... | php | public function setParam($name, $value)
{
switch ($name) {
case 'processor':
$this->setProcessor($value);
break;
case 'message':
$this->setMessage($value);
break;
case 'result':
$this->setResu... | [
"public",
"function",
"setParam",
"(",
"$",
"name",
",",
"$",
"value",
")",
"{",
"switch",
"(",
"$",
"name",
")",
"{",
"case",
"'processor'",
":",
"$",
"this",
"->",
"setProcessor",
"(",
"$",
"value",
")",
";",
"break",
";",
"case",
"'message'",
":",... | Set an individual event parameter
@param string $name
@param mixed $value
@return $this | [
"Set",
"an",
"individual",
"event",
"parameter"
] | 63f6aaeb06986a7c39b5e5c4be742b92942b5d3f | https://github.com/stakhanovist/worker/blob/63f6aaeb06986a7c39b5e5c4be742b92942b5d3f/library/ProcessEvent.php#L200-L217 |
1,663 | jamiehannaford/php-opencloud-zf2 | src/Factory/ProviderBuilder.php | ProviderBuilder.build | public function build()
{
switch ($this->provider) {
default:
case Provider::RACKSPACE:
$class = __NAMESPACE__ . '\\RackspaceFactory';
break;
case Provider::OPENSTACK:
$class = __NAMESPACE__ . '\\OpenStackFactory';
... | php | public function build()
{
switch ($this->provider) {
default:
case Provider::RACKSPACE:
$class = __NAMESPACE__ . '\\RackspaceFactory';
break;
case Provider::OPENSTACK:
$class = __NAMESPACE__ . '\\OpenStackFactory';
... | [
"public",
"function",
"build",
"(",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"provider",
")",
"{",
"default",
":",
"case",
"Provider",
"::",
"RACKSPACE",
":",
"$",
"class",
"=",
"__NAMESPACE__",
".",
"'\\\\RackspaceFactory'",
";",
"break",
";",
"case",
... | Will initialize the build process; first the factory is built, then the factory builds the client
@return \Guzzle\Http\ClientInterface | [
"Will",
"initialize",
"the",
"build",
"process",
";",
"first",
"the",
"factory",
"is",
"built",
"then",
"the",
"factory",
"builds",
"the",
"client"
] | 74140adaffc0b46d7bbe1d7b3441c61f2cf6a656 | https://github.com/jamiehannaford/php-opencloud-zf2/blob/74140adaffc0b46d7bbe1d7b3441c61f2cf6a656/src/Factory/ProviderBuilder.php#L53-L66 |
1,664 | jamiehannaford/php-opencloud-zf2 | src/Factory/ProviderBuilder.php | ProviderBuilder.buildFactory | protected function buildFactory($factoryClass)
{
$factory = $factoryClass::newInstance();
$factory->setConfig($this->config);
$factory->validateConfig();
return $factory;
} | php | protected function buildFactory($factoryClass)
{
$factory = $factoryClass::newInstance();
$factory->setConfig($this->config);
$factory->validateConfig();
return $factory;
} | [
"protected",
"function",
"buildFactory",
"(",
"$",
"factoryClass",
")",
"{",
"$",
"factory",
"=",
"$",
"factoryClass",
"::",
"newInstance",
"(",
")",
";",
"$",
"factory",
"->",
"setConfig",
"(",
"$",
"this",
"->",
"config",
")",
";",
"$",
"factory",
"->"... | Build the concrete factory class responsible for creating a concrete client object
@param $factoryClass string FQCN of factory class
@return ProviderFactoryInterface | [
"Build",
"the",
"concrete",
"factory",
"class",
"responsible",
"for",
"creating",
"a",
"concrete",
"client",
"object"
] | 74140adaffc0b46d7bbe1d7b3441c61f2cf6a656 | https://github.com/jamiehannaford/php-opencloud-zf2/blob/74140adaffc0b46d7bbe1d7b3441c61f2cf6a656/src/Factory/ProviderBuilder.php#L74-L81 |
1,665 | FelixOnline/Core | src/FelixOnline/Core/Topic.php | Topic.getStartDate | public function getStartDate()
{
$topic = BaseManager::build('FelixOnline\Core\Topic', 'article_topic', 'topic')
->filter('topic = "%s"', array($this->getSlug()));
$article = BaseManager::build('FelixOnline\Core\Article', 'article', 'id')
->join($topic, 'LEFT', 'id', 'articl... | php | public function getStartDate()
{
$topic = BaseManager::build('FelixOnline\Core\Topic', 'article_topic', 'topic')
->filter('topic = "%s"', array($this->getSlug()));
$article = BaseManager::build('FelixOnline\Core\Article', 'article', 'id')
->join($topic, 'LEFT', 'id', 'articl... | [
"public",
"function",
"getStartDate",
"(",
")",
"{",
"$",
"topic",
"=",
"BaseManager",
"::",
"build",
"(",
"'FelixOnline\\Core\\Topic'",
",",
"'article_topic'",
",",
"'topic'",
")",
"->",
"filter",
"(",
"'topic = \"%s\"'",
",",
"array",
"(",
"$",
"this",
"->",... | Get date that the first article was posted | [
"Get",
"date",
"that",
"the",
"first",
"article",
"was",
"posted"
] | b29f50cd96cee73da83968ee1eb88d8b3ab1c430 | https://github.com/FelixOnline/Core/blob/b29f50cd96cee73da83968ee1eb88d8b3ab1c430/src/FelixOnline/Core/Topic.php#L38-L55 |
1,666 | fortifi/sdk | src/Fortifi.php | Fortifi.setEnvironment | public static function setEnvironment($env = self::ENV_STAGE)
{
$prefix = '';
if($env === self::ENV_STAGE)
{
$prefix = 's';
}
static::$apiHost = $prefix . 'api.fortifi.io';
} | php | public static function setEnvironment($env = self::ENV_STAGE)
{
$prefix = '';
if($env === self::ENV_STAGE)
{
$prefix = 's';
}
static::$apiHost = $prefix . 'api.fortifi.io';
} | [
"public",
"static",
"function",
"setEnvironment",
"(",
"$",
"env",
"=",
"self",
"::",
"ENV_STAGE",
")",
"{",
"$",
"prefix",
"=",
"''",
";",
"if",
"(",
"$",
"env",
"===",
"self",
"::",
"ENV_STAGE",
")",
"{",
"$",
"prefix",
"=",
"'s'",
";",
"}",
"sta... | Set the environment to connect to
@param string $env | [
"Set",
"the",
"environment",
"to",
"connect",
"to"
] | 4d0471c72c7954271c692d32265fd42f698392e4 | https://github.com/fortifi/sdk/blob/4d0471c72c7954271c692d32265fd42f698392e4/src/Fortifi.php#L63-L72 |
1,667 | potfur/statemachine | src/StateMachine/Event.php | Event.trigger | public function trigger(Payload $payload)
{
if (!$this->command) {
return $this->targetState();
}
return call_user_func($this->command, $payload) ? $this->targetState() : $this->errorState();
} | php | public function trigger(Payload $payload)
{
if (!$this->command) {
return $this->targetState();
}
return call_user_func($this->command, $payload) ? $this->targetState() : $this->errorState();
} | [
"public",
"function",
"trigger",
"(",
"Payload",
"$",
"payload",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"command",
")",
"{",
"return",
"$",
"this",
"->",
"targetState",
"(",
")",
";",
"}",
"return",
"call_user_func",
"(",
"$",
"this",
"->",
"co... | Triggers event and return next state name or null if there is no state change
@param Payload $payload
@return null|string | [
"Triggers",
"event",
"and",
"return",
"next",
"state",
"name",
"or",
"null",
"if",
"there",
"is",
"no",
"state",
"change"
] | 6b68535e6c94b10bf618a7809a48f6a8f6d30deb | https://github.com/potfur/statemachine/blob/6b68535e6c94b10bf618a7809a48f6a8f6d30deb/src/StateMachine/Event.php#L139-L146 |
1,668 | solo-framework/solo-logger | examples/004-custom-parser.php | WeatherParser.parse | public function parse()
{
// get current weather, just for fun
$data = file_get_contents("http://api.openweathermap.org/data/2.5/weather?zip=420000,ru&units=metric");
$this->record->formatted = str_replace("{weather}", $data, $this->record->formatted);
return $this->record;
} | php | public function parse()
{
// get current weather, just for fun
$data = file_get_contents("http://api.openweathermap.org/data/2.5/weather?zip=420000,ru&units=metric");
$this->record->formatted = str_replace("{weather}", $data, $this->record->formatted);
return $this->record;
} | [
"public",
"function",
"parse",
"(",
")",
"{",
"// get current weather, just for fun",
"$",
"data",
"=",
"file_get_contents",
"(",
"\"http://api.openweathermap.org/data/2.5/weather?zip=420000,ru&units=metric\"",
")",
";",
"$",
"this",
"->",
"record",
"->",
"formatted",
"=",
... | Replace macros with useful data
@return \Solo\Logger\LogRecord | [
"Replace",
"macros",
"with",
"useful",
"data"
] | 2f0a9f789479c4e9ab6ee9fe5817f256eb18db70 | https://github.com/solo-framework/solo-logger/blob/2f0a9f789479c4e9ab6ee9fe5817f256eb18db70/examples/004-custom-parser.php#L56-L62 |
1,669 | DiegoSilva94/magento-client-v2 | src/Smalot/V2/Magento/Order/Order.php | Order.addComment | public function addComment($orderIncrementId, $status, $comment = null, $notify = null)
{
return $this->__createAction('salesOrderAddComment', func_get_args());
} | php | public function addComment($orderIncrementId, $status, $comment = null, $notify = null)
{
return $this->__createAction('salesOrderAddComment', func_get_args());
} | [
"public",
"function",
"addComment",
"(",
"$",
"orderIncrementId",
",",
"$",
"status",
",",
"$",
"comment",
"=",
"null",
",",
"$",
"notify",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"__createAction",
"(",
"'salesOrderAddComment'",
",",
"func_get_ar... | Allows you to add a new comment to the order.
@param string $orderIncrementId
@param string $status
@param string $comment
@param string $notify
@return ActionInterface | [
"Allows",
"you",
"to",
"add",
"a",
"new",
"comment",
"to",
"the",
"order",
"."
] | b36e6535f9f8be702043df0e74249b805f8d9b9f | https://github.com/DiegoSilva94/magento-client-v2/blob/b36e6535f9f8be702043df0e74249b805f8d9b9f/src/Smalot/V2/Magento/Order/Order.php#L39-L42 |
1,670 | bkdotcom/Toolbox | src/Cookie.php | Cookie.getRaw | public static function getRaw($name)
{
$value = null;
$rawCookies = !empty($_SERVER['HTTP_COOKIE'])
? explode('; ', $_SERVER['HTTP_COOKIE'])
: array();
foreach ($rawCookies as $kv) {
$pair = explode('=', $kv, 2);
$k = array_shift($pair);
$v = array_shift($pair);
$k = str_replace(' ', '_', urlde... | php | public static function getRaw($name)
{
$value = null;
$rawCookies = !empty($_SERVER['HTTP_COOKIE'])
? explode('; ', $_SERVER['HTTP_COOKIE'])
: array();
foreach ($rawCookies as $kv) {
$pair = explode('=', $kv, 2);
$k = array_shift($pair);
$v = array_shift($pair);
$k = str_replace(' ', '_', urlde... | [
"public",
"static",
"function",
"getRaw",
"(",
"$",
"name",
")",
"{",
"$",
"value",
"=",
"null",
";",
"$",
"rawCookies",
"=",
"!",
"empty",
"(",
"$",
"_SERVER",
"[",
"'HTTP_COOKIE'",
"]",
")",
"?",
"explode",
"(",
"'; '",
",",
"$",
"_SERVER",
"[",
... | Returns the coocie value that's received in the header
@param name $name name of cookie
@return string
@internal | [
"Returns",
"the",
"coocie",
"value",
"that",
"s",
"received",
"in",
"the",
"header"
] | 2f9d34fd57bd8382baee4c29aac13a6710e3a994 | https://github.com/bkdotcom/Toolbox/blob/2f9d34fd57bd8382baee4c29aac13a6710e3a994/src/Cookie.php#L99-L116 |
1,671 | bkdotcom/Toolbox | src/Cookie.php | Cookie.cookieParams | protected static function cookieParams($args = array())
{
$params = array();
if (count($args) == 1) {
if (is_array($args[0])) {
$params = $args[0];
} else {
$params['value'] = $args[0];
}
} elseif (count($args) == 2) {
if (is_string($args[1])) {
$params['name'] = $args[1];
} else {
... | php | protected static function cookieParams($args = array())
{
$params = array();
if (count($args) == 1) {
if (is_array($args[0])) {
$params = $args[0];
} else {
$params['value'] = $args[0];
}
} elseif (count($args) == 2) {
if (is_string($args[1])) {
$params['name'] = $args[1];
} else {
... | [
"protected",
"static",
"function",
"cookieParams",
"(",
"$",
"args",
"=",
"array",
"(",
")",
")",
"{",
"$",
"params",
"=",
"array",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"args",
")",
"==",
"1",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
... | return cookie parameters
@param array $args as passed to setCookieValue
@return array | [
"return",
"cookie",
"parameters"
] | 2f9d34fd57bd8382baee4c29aac13a6710e3a994 | https://github.com/bkdotcom/Toolbox/blob/2f9d34fd57bd8382baee4c29aac13a6710e3a994/src/Cookie.php#L211-L252 |
1,672 | frozensheep/synthesize | src/Type/TypeFactory.php | TypeFactory.getType | static public function getType($strType){
//convert reserved names to the actual objects
$arrReservere = array(
'array' => 'ArrayObject',
'bool' => 'BooleanObject',
'boolean' => 'BooleanObject',
'datetime' => 'DateTimeObject',
'dictionary' => 'DictionaryObject',
'enum' => 'EnumObject',
'id' => ... | php | static public function getType($strType){
//convert reserved names to the actual objects
$arrReservere = array(
'array' => 'ArrayObject',
'bool' => 'BooleanObject',
'boolean' => 'BooleanObject',
'datetime' => 'DateTimeObject',
'dictionary' => 'DictionaryObject',
'enum' => 'EnumObject',
'id' => ... | [
"static",
"public",
"function",
"getType",
"(",
"$",
"strType",
")",
"{",
"//convert reserved names to the actual objects",
"$",
"arrReservere",
"=",
"array",
"(",
"'array'",
"=>",
"'ArrayObject'",
",",
"'bool'",
"=>",
"'BooleanObject'",
",",
"'boolean'",
"=>",
"'Bo... | Get Type Method
Returns a type object based on the options given.
@param string $strType The name of the type.
return string | [
"Get",
"Type",
"Method"
] | 18e4ece4f02ad2fbd5510eac6342b8c2d31ccc51 | https://github.com/frozensheep/synthesize/blob/18e4ece4f02ad2fbd5510eac6342b8c2d31ccc51/src/Type/TypeFactory.php#L50-L78 |
1,673 | tmquang6805/phalex | library/Phalex/Events/Listener/Application.php | Application.setViewService | private function setViewService(Di $di, Config $config, $moduleName)
{
$viewsDir = $config['view'][$moduleName];
$volt = $this->setVoltOptions($config, $moduleName);
$options = [
'di' => $di,
'views_dir' => $viewsDir,
'volt' => $volt
... | php | private function setViewService(Di $di, Config $config, $moduleName)
{
$viewsDir = $config['view'][$moduleName];
$volt = $this->setVoltOptions($config, $moduleName);
$options = [
'di' => $di,
'views_dir' => $viewsDir,
'volt' => $volt
... | [
"private",
"function",
"setViewService",
"(",
"Di",
"$",
"di",
",",
"Config",
"$",
"config",
",",
"$",
"moduleName",
")",
"{",
"$",
"viewsDir",
"=",
"$",
"config",
"[",
"'view'",
"]",
"[",
"$",
"moduleName",
"]",
";",
"$",
"volt",
"=",
"$",
"this",
... | Set service view for application when module start
@param Di $di
@param Config $config
@param string $moduleName
@return \Phalex\Events\Listener\Application | [
"Set",
"service",
"view",
"for",
"application",
"when",
"module",
"start"
] | 6452b4e695b456838d9d553d96f2b114e1c110b4 | https://github.com/tmquang6805/phalex/blob/6452b4e695b456838d9d553d96f2b114e1c110b4/library/Phalex/Events/Listener/Application.php#L60-L72 |
1,674 | tmquang6805/phalex | library/Phalex/Events/Listener/Application.php | Application.setUrlService | private function setUrlService(Di $di, Config $config, $name)
{
$base = $static = '/';
if (isset($config['url'])) {
$default = isset($config['url']['default']) ? $config['url']['default'] : '/';
if (isset($config['url'][$name])) {
$base = isset($config['ur... | php | private function setUrlService(Di $di, Config $config, $name)
{
$base = $static = '/';
if (isset($config['url'])) {
$default = isset($config['url']['default']) ? $config['url']['default'] : '/';
if (isset($config['url'][$name])) {
$base = isset($config['ur... | [
"private",
"function",
"setUrlService",
"(",
"Di",
"$",
"di",
",",
"Config",
"$",
"config",
",",
"$",
"name",
")",
"{",
"$",
"base",
"=",
"$",
"static",
"=",
"'/'",
";",
"if",
"(",
"isset",
"(",
"$",
"config",
"[",
"'url'",
"]",
")",
")",
"{",
... | Set url service when module start
@param Di $di
@param Config $config
@param string $name Module name
@return \Phalex\Events\Listener\Application | [
"Set",
"url",
"service",
"when",
"module",
"start"
] | 6452b4e695b456838d9d553d96f2b114e1c110b4 | https://github.com/tmquang6805/phalex/blob/6452b4e695b456838d9d553d96f2b114e1c110b4/library/Phalex/Events/Listener/Application.php#L81-L97 |
1,675 | dendevs/plpconfig | src/libs/FileLib.php | FileLib.check_dir | public function check_dir( $need_not_empty = true )
{
$ok = false;
if( is_dir( $this->_dir_path ) && is_readable( $this->_dir_path ) )
{
$ok = true;
if( $need_not_empty )
{
$ok = ( count( scandir( $this->_dir_path ) ) > 0 ) ? true: false;
}
}
return $ok;
} | php | public function check_dir( $need_not_empty = true )
{
$ok = false;
if( is_dir( $this->_dir_path ) && is_readable( $this->_dir_path ) )
{
$ok = true;
if( $need_not_empty )
{
$ok = ( count( scandir( $this->_dir_path ) ) > 0 ) ? true: false;
}
}
return $ok;
} | [
"public",
"function",
"check_dir",
"(",
"$",
"need_not_empty",
"=",
"true",
")",
"{",
"$",
"ok",
"=",
"false",
";",
"if",
"(",
"is_dir",
"(",
"$",
"this",
"->",
"_dir_path",
")",
"&&",
"is_readable",
"(",
"$",
"this",
"->",
"_dir_path",
")",
")",
"{"... | Verifie la validite du repertoire.
Verifie si il existe, est un repertoire non vide
@param bool $need_not_empty rajoute une condition de validation, le repertoire ne peut etre vide
@return bool true si le repertoire est utilisable | [
"Verifie",
"la",
"validite",
"du",
"repertoire",
"."
] | fa198ed504a248420d1a6b59397438a3cfd83d49 | https://github.com/dendevs/plpconfig/blob/fa198ed504a248420d1a6b59397438a3cfd83d49/src/libs/FileLib.php#L37-L50 |
1,676 | dendevs/plpconfig | src/libs/FileLib.php | FileLib.get_path_files | public function get_path_files()
{
$path_files = array();
$tmp_contents_dir = scandir( $this->_dir_path );
foreach( $tmp_contents_dir as $tmp_content_dir )
{
if( is_file( $this->_dir_path . $tmp_content_dir ) )
{
$service_name = strtolower( preg_replace('/\\.[^.\\s]{3,4}$/', '', $tmp_content_dir ) ... | php | public function get_path_files()
{
$path_files = array();
$tmp_contents_dir = scandir( $this->_dir_path );
foreach( $tmp_contents_dir as $tmp_content_dir )
{
if( is_file( $this->_dir_path . $tmp_content_dir ) )
{
$service_name = strtolower( preg_replace('/\\.[^.\\s]{3,4}$/', '', $tmp_content_dir ) ... | [
"public",
"function",
"get_path_files",
"(",
")",
"{",
"$",
"path_files",
"=",
"array",
"(",
")",
";",
"$",
"tmp_contents_dir",
"=",
"scandir",
"(",
"$",
"this",
"->",
"_dir_path",
")",
";",
"foreach",
"(",
"$",
"tmp_contents_dir",
"as",
"$",
"tmp_content_... | Donne le chemin de tout les fichiers contenus dans le repertoire
@return array tabeau des fichiers trouver | [
"Donne",
"le",
"chemin",
"de",
"tout",
"les",
"fichiers",
"contenus",
"dans",
"le",
"repertoire"
] | fa198ed504a248420d1a6b59397438a3cfd83d49 | https://github.com/dendevs/plpconfig/blob/fa198ed504a248420d1a6b59397438a3cfd83d49/src/libs/FileLib.php#L57-L72 |
1,677 | Dhii/tokenizer-abstract | src/ColumnNumberAwareTrait.php | ColumnNumberAwareTrait._setColumnNumber | protected function _setColumnNumber($columnNumber)
{
if ($columnNumber !== null) {
try {
$columnNumber = $this->_normalizeInt($columnNumber);
} catch (RootException $e) {
throw $this->_createInvalidArgumentException($this->__('Invalid column number'), ... | php | protected function _setColumnNumber($columnNumber)
{
if ($columnNumber !== null) {
try {
$columnNumber = $this->_normalizeInt($columnNumber);
} catch (RootException $e) {
throw $this->_createInvalidArgumentException($this->__('Invalid column number'), ... | [
"protected",
"function",
"_setColumnNumber",
"(",
"$",
"columnNumber",
")",
"{",
"if",
"(",
"$",
"columnNumber",
"!==",
"null",
")",
"{",
"try",
"{",
"$",
"columnNumber",
"=",
"$",
"this",
"->",
"_normalizeInt",
"(",
"$",
"columnNumber",
")",
";",
"}",
"... | Assigns a column number to this instance.
@since [*next-version*]
@param int|string|Stringable|float|null $columnNumber The column number.
Must be a whole positive number. | [
"Assigns",
"a",
"column",
"number",
"to",
"this",
"instance",
"."
] | 45588113b1fca6daf62b776aade8627d08970565 | https://github.com/Dhii/tokenizer-abstract/blob/45588113b1fca6daf62b776aade8627d08970565/src/ColumnNumberAwareTrait.php#L42-L57 |
1,678 | Solve/Solve | SolveConsole/Controllers/DbController.php | DbController.wizardAction | public function wizardAction() {
$this->writeln('DB wizard for a profile');
$profileName = $this->ask('Enter the <underline>profile name</underline> to edit', 'default');
$fields = $this->askArray(array(
'name' => array('DB name',),
'user' => array('DB user', 'root',),
... | php | public function wizardAction() {
$this->writeln('DB wizard for a profile');
$profileName = $this->ask('Enter the <underline>profile name</underline> to edit', 'default');
$fields = $this->askArray(array(
'name' => array('DB name',),
'user' => array('DB user', 'root',),
... | [
"public",
"function",
"wizardAction",
"(",
")",
"{",
"$",
"this",
"->",
"writeln",
"(",
"'DB wizard for a profile'",
")",
";",
"$",
"profileName",
"=",
"$",
"this",
"->",
"ask",
"(",
"'Enter the <underline>profile name</underline> to edit'",
",",
"'default'",
")",
... | Using for generating profile for database
@help Using for generating profile for database
@optional [profile name] to specify profile | [
"Using",
"for",
"generating",
"profile",
"for",
"database"
] | b2ac834c37831ba6049dafa28255d32b4ea0bf1d | https://github.com/Solve/Solve/blob/b2ac834c37831ba6049dafa28255d32b4ea0bf1d/SolveConsole/Controllers/DbController.php#L61-L80 |
1,679 | Solve/Solve | SolveConsole/Controllers/DbController.php | DbController.updateAllAction | public function updateAllAction() {
QC::executeSQL('SET FOREIGN_KEY_CHECKS = 0');
ModelOperator::getInstance(DC::getEnvironment()->getUserClassesRoot().'db/')->updateDBForAllModels();
ModelOperator::getInstance()->generateAllModelClasses();
$this->writeln('DB updated');
} | php | public function updateAllAction() {
QC::executeSQL('SET FOREIGN_KEY_CHECKS = 0');
ModelOperator::getInstance(DC::getEnvironment()->getUserClassesRoot().'db/')->updateDBForAllModels();
ModelOperator::getInstance()->generateAllModelClasses();
$this->writeln('DB updated');
} | [
"public",
"function",
"updateAllAction",
"(",
")",
"{",
"QC",
"::",
"executeSQL",
"(",
"'SET FOREIGN_KEY_CHECKS = 0'",
")",
";",
"ModelOperator",
"::",
"getInstance",
"(",
"DC",
"::",
"getEnvironment",
"(",
")",
"->",
"getUserClassesRoot",
"(",
")",
".",
"'db/'"... | Update database and models | [
"Update",
"database",
"and",
"models"
] | b2ac834c37831ba6049dafa28255d32b4ea0bf1d | https://github.com/Solve/Solve/blob/b2ac834c37831ba6049dafa28255d32b4ea0bf1d/SolveConsole/Controllers/DbController.php#L85-L90 |
1,680 | Solve/Solve | SolveConsole/Controllers/DbController.php | DbController.createDbAction | public function createDbAction() {
$config = DC::getDatabaseConfig('profiles/default');
DatabaseService::configProfile(array(
'user' => $config['user'],
'pass' => $config['pass'],
));
DBOperator::getInstance()->createDB($config['name']);
$this->noti... | php | public function createDbAction() {
$config = DC::getDatabaseConfig('profiles/default');
DatabaseService::configProfile(array(
'user' => $config['user'],
'pass' => $config['pass'],
));
DBOperator::getInstance()->createDB($config['name']);
$this->noti... | [
"public",
"function",
"createDbAction",
"(",
")",
"{",
"$",
"config",
"=",
"DC",
"::",
"getDatabaseConfig",
"(",
"'profiles/default'",
")",
";",
"DatabaseService",
"::",
"configProfile",
"(",
"array",
"(",
"'user'",
"=>",
"$",
"config",
"[",
"'user'",
"]",
"... | Created database for profile default | [
"Created",
"database",
"for",
"profile",
"default"
] | b2ac834c37831ba6049dafa28255d32b4ea0bf1d | https://github.com/Solve/Solve/blob/b2ac834c37831ba6049dafa28255d32b4ea0bf1d/SolveConsole/Controllers/DbController.php#L95-L104 |
1,681 | cityware/city-utility | src/Recursivity/Tree/Node.php | Node.addChild | public function addChild(Node $child)
{
$this->children[] = $child;
$child->parent = $this;
$child->properties['parent'] = $this->getId();
} | php | public function addChild(Node $child)
{
$this->children[] = $child;
$child->parent = $this;
$child->properties['parent'] = $this->getId();
} | [
"public",
"function",
"addChild",
"(",
"Node",
"$",
"child",
")",
"{",
"$",
"this",
"->",
"children",
"[",
"]",
"=",
"$",
"child",
";",
"$",
"child",
"->",
"parent",
"=",
"$",
"this",
";",
"$",
"child",
"->",
"properties",
"[",
"'parent'",
"]",
"="... | Adds the given node to this node's children
@param Node $child | [
"Adds",
"the",
"given",
"node",
"to",
"this",
"node",
"s",
"children"
] | fadd33233cdaf743d87c3c30e341f2b96e96e476 | https://github.com/cityware/city-utility/blob/fadd33233cdaf743d87c3c30e341f2b96e96e476/src/Recursivity/Tree/Node.php#L74-L79 |
1,682 | cityware/city-utility | src/Recursivity/Tree/Node.php | Node.getSibling | private function getSibling($offset)
{
$siblingsAndSelf = $this->parent->getChildren();
$pos = array_search($this, $siblingsAndSelf);
if (isset($siblingsAndSelf[$pos + $offset])) {
return $siblingsAndSelf[$pos + $offset]; // Next / prev. node
}
return ... | php | private function getSibling($offset)
{
$siblingsAndSelf = $this->parent->getChildren();
$pos = array_search($this, $siblingsAndSelf);
if (isset($siblingsAndSelf[$pos + $offset])) {
return $siblingsAndSelf[$pos + $offset]; // Next / prev. node
}
return ... | [
"private",
"function",
"getSibling",
"(",
"$",
"offset",
")",
"{",
"$",
"siblingsAndSelf",
"=",
"$",
"this",
"->",
"parent",
"->",
"getChildren",
"(",
")",
";",
"$",
"pos",
"=",
"array_search",
"(",
"$",
"this",
",",
"$",
"siblingsAndSelf",
")",
";",
"... | Returns the sibling with the given offset from this node,
or NULL if there is no such sibling
@param int $offset If 1, the next node is returned, if -1, then
the previous one. Can be called with arbitrary
values, too, if desired.
@return Node|null | [
"Returns",
"the",
"sibling",
"with",
"the",
"given",
"offset",
"from",
"this",
"node",
"or",
"NULL",
"if",
"there",
"is",
"no",
"such",
"sibling"
] | fadd33233cdaf743d87c3c30e341f2b96e96e476 | https://github.com/cityware/city-utility/blob/fadd33233cdaf743d87c3c30e341f2b96e96e476/src/Recursivity/Tree/Node.php#L111-L119 |
1,683 | cityware/city-utility | src/Recursivity/Tree/Node.php | Node.getSiblings | public function getSiblings($includeSelf = false)
{
$siblings = array();
foreach ($this->parent->getChildren() as $child) {
if ($includeSelf || $child->getId() != $this->getId()) {
$siblings[] = $child;
}
}
return $siblings;
} | php | public function getSiblings($includeSelf = false)
{
$siblings = array();
foreach ($this->parent->getChildren() as $child) {
if ($includeSelf || $child->getId() != $this->getId()) {
$siblings[] = $child;
}
}
return $siblings;
} | [
"public",
"function",
"getSiblings",
"(",
"$",
"includeSelf",
"=",
"false",
")",
"{",
"$",
"siblings",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"parent",
"->",
"getChildren",
"(",
")",
"as",
"$",
"child",
")",
"{",
"if",
"(",
... | Returns siblings of the node, optionally including the node itself.
@param bool $includeSelf If true, the node itself will be included in the resulting
array. In either case, the sort order will be correct.
This argument is deprecated and will be removed in v2.0
Note: The argument is deprecated and will be removed in... | [
"Returns",
"siblings",
"of",
"the",
"node",
"optionally",
"including",
"the",
"node",
"itself",
"."
] | fadd33233cdaf743d87c3c30e341f2b96e96e476 | https://github.com/cityware/city-utility/blob/fadd33233cdaf743d87c3c30e341f2b96e96e476/src/Recursivity/Tree/Node.php#L133-L142 |
1,684 | cityware/city-utility | src/Recursivity/Tree/Node.php | Node.get | public function get($name)
{
$lowerName = strtolower($name);
if (isset($this->properties[$lowerName])) {
return $this->properties[$lowerName];
}
throw new \InvalidArgumentException(
"Undefined property: $name (Node ID: ".$this->properties['id'].')'
);
... | php | public function get($name)
{
$lowerName = strtolower($name);
if (isset($this->properties[$lowerName])) {
return $this->properties[$lowerName];
}
throw new \InvalidArgumentException(
"Undefined property: $name (Node ID: ".$this->properties['id'].')'
);
... | [
"public",
"function",
"get",
"(",
"$",
"name",
")",
"{",
"$",
"lowerName",
"=",
"strtolower",
"(",
"$",
"name",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"properties",
"[",
"$",
"lowerName",
"]",
")",
")",
"{",
"return",
"$",
"this",
... | Returns a single node property by its name.
@param string $name
@throws \InvalidArgumentException
@return mixed | [
"Returns",
"a",
"single",
"node",
"property",
"by",
"its",
"name",
"."
] | fadd33233cdaf743d87c3c30e341f2b96e96e476 | https://github.com/cityware/city-utility/blob/fadd33233cdaf743d87c3c30e341f2b96e96e476/src/Recursivity/Tree/Node.php#L196-L205 |
1,685 | veridu/idos-sdk-php | src/idOS/Endpoint/Company/Credentials.php | Credentials.createNew | public function createNew(
string $name,
bool $production
) : array {
return $this->sendPost(
sprintf('/companies/%s/credentials', $this->companySlug),
[],
[
'name' => $name,
'production' => $production
]
... | php | public function createNew(
string $name,
bool $production
) : array {
return $this->sendPost(
sprintf('/companies/%s/credentials', $this->companySlug),
[],
[
'name' => $name,
'production' => $production
]
... | [
"public",
"function",
"createNew",
"(",
"string",
"$",
"name",
",",
"bool",
"$",
"production",
")",
":",
"array",
"{",
"return",
"$",
"this",
"->",
"sendPost",
"(",
"sprintf",
"(",
"'/companies/%s/credentials'",
",",
"$",
"this",
"->",
"companySlug",
")",
... | Creates a new credential for the given company.
@param string $name
@param bool $production
@return array Response | [
"Creates",
"a",
"new",
"credential",
"for",
"the",
"given",
"company",
"."
] | e56757bed10404756f2f0485a4b7f55794192008 | https://github.com/veridu/idos-sdk-php/blob/e56757bed10404756f2f0485a4b7f55794192008/src/idOS/Endpoint/Company/Credentials.php#L33-L46 |
1,686 | sagebind/libnntp | src/server/Server.php | Server.listen | public function listen(int $port = 119, string $address = self::DEFAULT_ADDRESS, array $options = [])
{
// Create a server for the requested address and port.
$server = $this->factory->create($address, $port, $options);
$this->servers[] = $server;
$coroutine = new Coroutine($this->a... | php | public function listen(int $port = 119, string $address = self::DEFAULT_ADDRESS, array $options = [])
{
// Create a server for the requested address and port.
$server = $this->factory->create($address, $port, $options);
$this->servers[] = $server;
$coroutine = new Coroutine($this->a... | [
"public",
"function",
"listen",
"(",
"int",
"$",
"port",
"=",
"119",
",",
"string",
"$",
"address",
"=",
"self",
"::",
"DEFAULT_ADDRESS",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"// Create a server for the requested address and port.",
"$",
"ser... | Starts the server and begins listening for connections. | [
"Starts",
"the",
"server",
"and",
"begins",
"listening",
"for",
"connections",
"."
] | 4bb81847ec08df89bb77377e5da0b017613a0447 | https://github.com/sagebind/libnntp/blob/4bb81847ec08df89bb77377e5da0b017613a0447/src/server/Server.php#L40-L48 |
1,687 | sagebind/libnntp | src/server/Server.php | Server.getHandler | public function getHandler(string $handler): Handler
{
if (!isset($this->handlers[$handler])) {
if (!class_exists($handler) || !class_implements($handler, Handler::class)) {
throw new \RuntimeException("No handler found for '$handler'.");
}
$instance = ne... | php | public function getHandler(string $handler): Handler
{
if (!isset($this->handlers[$handler])) {
if (!class_exists($handler) || !class_implements($handler, Handler::class)) {
throw new \RuntimeException("No handler found for '$handler'.");
}
$instance = ne... | [
"public",
"function",
"getHandler",
"(",
"string",
"$",
"handler",
")",
":",
"Handler",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"handlers",
"[",
"$",
"handler",
"]",
")",
")",
"{",
"if",
"(",
"!",
"class_exists",
"(",
"$",
"handler",
... | Gets a command handler instance.
Handler instances are lazy-instantiated. | [
"Gets",
"a",
"command",
"handler",
"instance",
"."
] | 4bb81847ec08df89bb77377e5da0b017613a0447 | https://github.com/sagebind/libnntp/blob/4bb81847ec08df89bb77377e5da0b017613a0447/src/server/Server.php#L65-L79 |
1,688 | sagebind/libnntp | src/server/Server.php | Server.accept | private function accept(SocketServer $server): Generator
{
yield from log()->log(
Log::INFO,
'NNTP server listening on %s:%d',
$server->getAddress(),
$server->getPort()
);
while ($server->isOpen()) {
// Wait for a client to connect... | php | private function accept(SocketServer $server): Generator
{
yield from log()->log(
Log::INFO,
'NNTP server listening on %s:%d',
$server->getAddress(),
$server->getPort()
);
while ($server->isOpen()) {
// Wait for a client to connect... | [
"private",
"function",
"accept",
"(",
"SocketServer",
"$",
"server",
")",
":",
"Generator",
"{",
"yield",
"from",
"log",
"(",
")",
"->",
"log",
"(",
"Log",
"::",
"INFO",
",",
"'NNTP server listening on %s:%d'",
",",
"$",
"server",
"->",
"getAddress",
"(",
... | Accepts incoming connections as they are made. | [
"Accepts",
"incoming",
"connections",
"as",
"they",
"are",
"made",
"."
] | 4bb81847ec08df89bb77377e5da0b017613a0447 | https://github.com/sagebind/libnntp/blob/4bb81847ec08df89bb77377e5da0b017613a0447/src/server/Server.php#L84-L101 |
1,689 | snowiow/cocurl | src/Location.php | Location.create | public static function create(array $data): Location
{
$location = new Location();
parent::fill($data, $location);
return $location;
} | php | public static function create(array $data): Location
{
$location = new Location();
parent::fill($data, $location);
return $location;
} | [
"public",
"static",
"function",
"create",
"(",
"array",
"$",
"data",
")",
":",
"Location",
"{",
"$",
"location",
"=",
"new",
"Location",
"(",
")",
";",
"parent",
"::",
"fill",
"(",
"$",
"data",
",",
"$",
"location",
")",
";",
"return",
"$",
"location... | Creates a location object with the given data
@param array $data an associative array to fill up the members of the
location class
@return Location a location object with the data given as it's members | [
"Creates",
"a",
"location",
"object",
"with",
"the",
"given",
"data"
] | 583df05bd3c8f24fd99f294da9906a3e4b1a9c7b | https://github.com/snowiow/cocurl/blob/583df05bd3c8f24fd99f294da9906a3e4b1a9c7b/src/Location.php#L43-L48 |
1,690 | jayaregalinada/chikka | src/Forms/SenderForm.php | SenderForm.createId | protected function createId($id)
{
if (is_null($id)) {
return md5(join('_', [
$this->config['shortcode'],
$this->mobile,
time(),
]));
}
return $id;
} | php | protected function createId($id)
{
if (is_null($id)) {
return md5(join('_', [
$this->config['shortcode'],
$this->mobile,
time(),
]));
}
return $id;
} | [
"protected",
"function",
"createId",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"id",
")",
")",
"{",
"return",
"md5",
"(",
"join",
"(",
"'_'",
",",
"[",
"$",
"this",
"->",
"config",
"[",
"'shortcode'",
"]",
",",
"$",
"this",
"->",
... | Create a message id.
@param mixed $id
@return mixed | [
"Create",
"a",
"message",
"id",
"."
] | eefd52c6a7c0e22fe82cef00c52874865456dddf | https://github.com/jayaregalinada/chikka/blob/eefd52c6a7c0e22fe82cef00c52874865456dddf/src/Forms/SenderForm.php#L93-L104 |
1,691 | lamjack/php-tools | lib/Network/File.php | File.getHeaders | static public function getHeaders($url)
{
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_NOBODY, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, false);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_... | php | static public function getHeaders($url)
{
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_NOBODY, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, false);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_... | [
"static",
"public",
"function",
"getHeaders",
"(",
"$",
"url",
")",
"{",
"$",
"ch",
"=",
"curl_init",
"(",
"$",
"url",
")",
";",
"curl_setopt",
"(",
"$",
"ch",
",",
"CURLOPT_NOBODY",
",",
"true",
")",
";",
"curl_setopt",
"(",
"$",
"ch",
",",
"CURLOPT... | Get Headers function
@param string $url
@return array | [
"Get",
"Headers",
"function"
] | f7d9ffa17312dc2378003e8f917543adc95dddbd | https://github.com/lamjack/php-tools/blob/f7d9ffa17312dc2378003e8f917543adc95dddbd/lib/Network/File.php#L31-L44 |
1,692 | gamernetwork/yolk-core | src/helpers/ArrayHelper.php | ArrayHelper.get | public static function get( $var, $key, $default = null ) {
if( $key === null )
return $var;
elseif( isset($var->$key) )
return $var->$key;
elseif( isset($var[$key]) )
return $var[$key];
else
return $default;
} | php | public static function get( $var, $key, $default = null ) {
if( $key === null )
return $var;
elseif( isset($var->$key) )
return $var->$key;
elseif( isset($var[$key]) )
return $var[$key];
else
return $default;
} | [
"public",
"static",
"function",
"get",
"(",
"$",
"var",
",",
"$",
"key",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"key",
"===",
"null",
")",
"return",
"$",
"var",
";",
"elseif",
"(",
"isset",
"(",
"$",
"var",
"->",
"$",
"key"... | Return value of the specified key from an array or object or a default if the key isn't set.
@param array|object $var
@param string|integer $key
@param mixed $default
@return mixed | [
"Return",
"value",
"of",
"the",
"specified",
"key",
"from",
"an",
"array",
"or",
"object",
"or",
"a",
"default",
"if",
"the",
"key",
"isn",
"t",
"set",
"."
] | d9567dd55c51507dd34a55fd335a7b333e3db269 | https://github.com/gamernetwork/yolk-core/blob/d9567dd55c51507dd34a55fd335a7b333e3db269/src/helpers/ArrayHelper.php#L86-L97 |
1,693 | gamernetwork/yolk-core | src/helpers/ArrayHelper.php | ArrayHelper.pluck | public static function pluck( $vars, $field, $preserve_keys = true ) {
$values = [];
foreach( $vars as $k => $v ) {
$values[$k] = static::get($v, $field);
}
return $preserve_keys ? $values : array_values($values);
} | php | public static function pluck( $vars, $field, $preserve_keys = true ) {
$values = [];
foreach( $vars as $k => $v ) {
$values[$k] = static::get($v, $field);
}
return $preserve_keys ? $values : array_values($values);
} | [
"public",
"static",
"function",
"pluck",
"(",
"$",
"vars",
",",
"$",
"field",
",",
"$",
"preserve_keys",
"=",
"true",
")",
"{",
"$",
"values",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"vars",
"as",
"$",
"k",
"=>",
"$",
"v",
")",
"{",
"$",
"valu... | Extract a single field from an array of arrays or objects.
@param array $vars An array or arrays or objects
@param string $field The field to get values from
@param boolean $preserve_keys Whether or not to preserve the array keys
@return array | [
"Extract",
"a",
"single",
"field",
"from",
"an",
"array",
"of",
"arrays",
"or",
"objects",
"."
] | d9567dd55c51507dd34a55fd335a7b333e3db269 | https://github.com/gamernetwork/yolk-core/blob/d9567dd55c51507dd34a55fd335a7b333e3db269/src/helpers/ArrayHelper.php#L116-L122 |
1,694 | webriq/core | module/Core/src/Grid/Core/Model/SubDomain/Model.php | Model.findActual | public function findActual()
{
if ( null === $this->actual )
{
$this->actual = $this->find( $this->getSiteInfo()
->getSubdomainId() );
}
return $this->actual;
} | php | public function findActual()
{
if ( null === $this->actual )
{
$this->actual = $this->find( $this->getSiteInfo()
->getSubdomainId() );
}
return $this->actual;
} | [
"public",
"function",
"findActual",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"actual",
")",
"{",
"$",
"this",
"->",
"actual",
"=",
"$",
"this",
"->",
"find",
"(",
"$",
"this",
"->",
"getSiteInfo",
"(",
")",
"->",
"getSubdomainId",
... | Find the current actual sub-domain
@return \Grid\Core\Model\SubDomain\Structure | [
"Find",
"the",
"current",
"actual",
"sub",
"-",
"domain"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Core/src/Grid/Core/Model/SubDomain/Model.php#L69-L78 |
1,695 | internalsystemerror/ise-module-bootstrap | src/Form/View/Helper/FormButton.php | FormButton.renderElementIcon | protected function renderElementIcon(ElementInterface $element)
{
$render = '';
$icon = $element->getOption('icon');
if ($icon) {
$iconHelper = $this->getIconHelper();
$render = $iconHelper($icon);
}
return $render;
} | php | protected function renderElementIcon(ElementInterface $element)
{
$render = '';
$icon = $element->getOption('icon');
if ($icon) {
$iconHelper = $this->getIconHelper();
$render = $iconHelper($icon);
}
return $render;
} | [
"protected",
"function",
"renderElementIcon",
"(",
"ElementInterface",
"$",
"element",
")",
"{",
"$",
"render",
"=",
"''",
";",
"$",
"icon",
"=",
"$",
"element",
"->",
"getOption",
"(",
"'icon'",
")",
";",
"if",
"(",
"$",
"icon",
")",
"{",
"$",
"iconHe... | Render element icon
@param ElementInterface $element
@return string | [
"Render",
"element",
"icon"
] | 289afa531a12e6159568b592b95964374442e850 | https://github.com/internalsystemerror/ise-module-bootstrap/blob/289afa531a12e6159568b592b95964374442e850/src/Form/View/Helper/FormButton.php#L156-L165 |
1,696 | internalsystemerror/ise-module-bootstrap | src/Form/View/Helper/FormButton.php | FormButton.setElementClass | protected function setElementClass(ElementInterface $element)
{
$class = $element->getAttribute('class');
$type = $element->getOption('type') ? : self::TYPE_DEFAULT;
if (!in_array($type, self::TYPES, true)) {
throw new Exception\DomainException(sprintf(
'%s requ... | php | protected function setElementClass(ElementInterface $element)
{
$class = $element->getAttribute('class');
$type = $element->getOption('type') ? : self::TYPE_DEFAULT;
if (!in_array($type, self::TYPES, true)) {
throw new Exception\DomainException(sprintf(
'%s requ... | [
"protected",
"function",
"setElementClass",
"(",
"ElementInterface",
"$",
"element",
")",
"{",
"$",
"class",
"=",
"$",
"element",
"->",
"getAttribute",
"(",
"'class'",
")",
";",
"$",
"type",
"=",
"$",
"element",
"->",
"getOption",
"(",
"'type'",
")",
"?",
... | Set element class
@param ElementInterface $element
@throws Exception\DomainException | [
"Set",
"element",
"class"
] | 289afa531a12e6159568b592b95964374442e850 | https://github.com/internalsystemerror/ise-module-bootstrap/blob/289afa531a12e6159568b592b95964374442e850/src/Form/View/Helper/FormButton.php#L173-L190 |
1,697 | BapCat/Propifier | src/ArrayProperty.php | ArrayProperty.offsetGet | public function offsetGet($offset) {
if($this->get !== null) {
return $this->get->invoke($this->obj, $offset);
}
throw new NoSuchPropertyException($this->name);
} | php | public function offsetGet($offset) {
if($this->get !== null) {
return $this->get->invoke($this->obj, $offset);
}
throw new NoSuchPropertyException($this->name);
} | [
"public",
"function",
"offsetGet",
"(",
"$",
"offset",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"get",
"!==",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"get",
"->",
"invoke",
"(",
"$",
"this",
"->",
"obj",
",",
"$",
"offset",
")",
";",
"}",
... | Executes the accessor for a given array property
@throws NoSuchPropertyException If there is no accessor for this array property
@param mixed $offset The index into the array to access
@return mixed The return value of the accessor | [
"Executes",
"the",
"accessor",
"for",
"a",
"given",
"array",
"property"
] | a106b89585a32b2660076b635fb77a3729f8eeda | https://github.com/BapCat/Propifier/blob/a106b89585a32b2660076b635fb77a3729f8eeda/src/ArrayProperty.php#L78-L84 |
1,698 | BapCat/Propifier | src/ArrayProperty.php | ArrayProperty.offsetSet | public function offsetSet($offset, $value): void {
if($this->set !== null) {
$this->set->invoke($this->obj, $offset, $value);
return;
}
throw new NoSuchPropertyException($this->name);
} | php | public function offsetSet($offset, $value): void {
if($this->set !== null) {
$this->set->invoke($this->obj, $offset, $value);
return;
}
throw new NoSuchPropertyException($this->name);
} | [
"public",
"function",
"offsetSet",
"(",
"$",
"offset",
",",
"$",
"value",
")",
":",
"void",
"{",
"if",
"(",
"$",
"this",
"->",
"set",
"!==",
"null",
")",
"{",
"$",
"this",
"->",
"set",
"->",
"invoke",
"(",
"$",
"this",
"->",
"obj",
",",
"$",
"o... | Executes the mutator for a given array property
@throws NoSuchPropertyException If there is no mutator for this array property
@param mixed $offset The index into the array to mutate
@param mixed $value The new value | [
"Executes",
"the",
"mutator",
"for",
"a",
"given",
"array",
"property"
] | a106b89585a32b2660076b635fb77a3729f8eeda | https://github.com/BapCat/Propifier/blob/a106b89585a32b2660076b635fb77a3729f8eeda/src/ArrayProperty.php#L94-L101 |
1,699 | BapCat/Propifier | src/ArrayProperty.php | ArrayProperty.getIterator | public function getIterator(): Traversable {
if($this->iterator !== null) {
return $this->iterator->invoke($this->obj);
}
throw new NoSuchPropertyException($this->name);
} | php | public function getIterator(): Traversable {
if($this->iterator !== null) {
return $this->iterator->invoke($this->obj);
}
throw new NoSuchPropertyException($this->name);
} | [
"public",
"function",
"getIterator",
"(",
")",
":",
"Traversable",
"{",
"if",
"(",
"$",
"this",
"->",
"iterator",
"!==",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"iterator",
"->",
"invoke",
"(",
"$",
"this",
"->",
"obj",
")",
";",
"}",
"throw",... | Returns the iterator for the array
@throws NoSuchPropertyException If there is no iterator for the array
@return Traversable The iterator | [
"Returns",
"the",
"iterator",
"for",
"the",
"array"
] | a106b89585a32b2660076b635fb77a3729f8eeda | https://github.com/BapCat/Propifier/blob/a106b89585a32b2660076b635fb77a3729f8eeda/src/ArrayProperty.php#L132-L138 |
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.