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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
239,400 | digipolisgent/robo-digipolis-code-validation | src/PhpMd.php | PhpMd.ignorePatterns | public function ignorePatterns($ignorePatterns)
{
if (!is_array($ignorePatterns)) {
$ignorePatterns = [$ignorePatterns];
}
$this->ignorePatterns = array_unique(array_merge($this->ignorePatterns, $ignorePatterns));
return $this;
} | php | public function ignorePatterns($ignorePatterns)
{
if (!is_array($ignorePatterns)) {
$ignorePatterns = [$ignorePatterns];
}
$this->ignorePatterns = array_unique(array_merge($this->ignorePatterns, $ignorePatterns));
return $this;
} | [
"public",
"function",
"ignorePatterns",
"(",
"$",
"ignorePatterns",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"ignorePatterns",
")",
")",
"{",
"$",
"ignorePatterns",
"=",
"[",
"$",
"ignorePatterns",
"]",
";",
"}",
"$",
"this",
"->",
"ignorePatterns",... | Sets a list of ignore patterns that is used to exclude directories from
the source analysis.
@param array|string $ignorePatterns
List of ignore patterns.
@return $this | [
"Sets",
"a",
"list",
"of",
"ignore",
"patterns",
"that",
"is",
"used",
"to",
"exclude",
"directories",
"from",
"the",
"source",
"analysis",
"."
] | 56f69f88a368a5049af7021901042820bee914df | https://github.com/digipolisgent/robo-digipolis-code-validation/blob/56f69f88a368a5049af7021901042820bee914df/src/PhpMd.php#L168-L176 |
239,401 | elumina-elearning/oauth2-server | src/ResourceServer.php | ResourceServer.isValidRequest | public function isValidRequest($headerOnly = true, $accessToken = null)
{
$accessTokenString = ($accessToken !== null)
? $accessToken
: $this->determineAccessToken($headerOnly);
// Set the access token
$this->accessToken = $thi... | php | public function isValidRequest($headerOnly = true, $accessToken = null)
{
$accessTokenString = ($accessToken !== null)
? $accessToken
: $this->determineAccessToken($headerOnly);
// Set the access token
$this->accessToken = $thi... | [
"public",
"function",
"isValidRequest",
"(",
"$",
"headerOnly",
"=",
"true",
",",
"$",
"accessToken",
"=",
"null",
")",
"{",
"$",
"accessTokenString",
"=",
"(",
"$",
"accessToken",
"!==",
"null",
")",
"?",
"$",
"accessToken",
":",
"$",
"this",
"->",
"det... | Checks if the access token is valid or not
@param bool $headerOnly Limit Access Token to Authorization header
@param \EluminaElearning\OAuth2\Server\Entity\AccessTokenEntity|null $accessToken Access Token
@throws \EluminaElearning\OAuth2\Server\Exception\AccessDeniedExce... | [
"Checks",
"if",
"the",
"access",
"token",
"is",
"valid",
"or",
"not"
] | 9adff5ef58b36fc879637faa518a8025e4b8cd56 | https://github.com/elumina-elearning/oauth2-server/blob/9adff5ef58b36fc879637faa518a8025e4b8cd56/src/ResourceServer.php#L107-L130 |
239,402 | elumina-elearning/oauth2-server | src/ResourceServer.php | ResourceServer.determineAccessToken | public function determineAccessToken($headerOnly = false)
{
if (!empty($this->getRequest()->headers->get('Authorization'))) {
$accessToken = $this->getTokenType()->determineAccessTokenInHeader($this->getRequest());
} elseif ($headerOnly === false && (! $this->getTokenType() instanceof MA... | php | public function determineAccessToken($headerOnly = false)
{
if (!empty($this->getRequest()->headers->get('Authorization'))) {
$accessToken = $this->getTokenType()->determineAccessTokenInHeader($this->getRequest());
} elseif ($headerOnly === false && (! $this->getTokenType() instanceof MA... | [
"public",
"function",
"determineAccessToken",
"(",
"$",
"headerOnly",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"headers",
"->",
"get",
"(",
"'Authorization'",
")",
")",
")",
"{",
"$",
"acces... | Reads in the access token from the headers
@param bool $headerOnly Limit Access Token to Authorization header
@throws \EluminaElearning\OAuth2\Server\Exception\InvalidRequestException Thrown if there is no access token presented
@return string | [
"Reads",
"in",
"the",
"access",
"token",
"from",
"the",
"headers"
] | 9adff5ef58b36fc879637faa518a8025e4b8cd56 | https://github.com/elumina-elearning/oauth2-server/blob/9adff5ef58b36fc879637faa518a8025e4b8cd56/src/ResourceServer.php#L141-L156 |
239,403 | gap-db/orm | GapOrm/Commands/SynchronizeController.php | SynchronizeController.indexAction | public function indexAction()
{
$models = $this->getAllModels();
foreach($models as $model) {
$this->checkTable(new $model['namespace']);
}
} | php | public function indexAction()
{
$models = $this->getAllModels();
foreach($models as $model) {
$this->checkTable(new $model['namespace']);
}
} | [
"public",
"function",
"indexAction",
"(",
")",
"{",
"$",
"models",
"=",
"$",
"this",
"->",
"getAllModels",
"(",
")",
";",
"foreach",
"(",
"$",
"models",
"as",
"$",
"model",
")",
"{",
"$",
"this",
"->",
"checkTable",
"(",
"new",
"$",
"model",
"[",
"... | Synchronize all table fields
@Route ('GapOrm:synchronize') | [
"Synchronize",
"all",
"table",
"fields"
] | bcd8e3d27b19b14814d3207489071c4a250a6ac5 | https://github.com/gap-db/orm/blob/bcd8e3d27b19b14814d3207489071c4a250a6ac5/GapOrm/Commands/SynchronizeController.php#L25-L32 |
239,404 | gap-db/orm | GapOrm/Commands/SynchronizeController.php | SynchronizeController.checkTable | private function checkTable($modelObj)
{
if (!method_exists($modelObj, 'table')) {
return false;
}
// get table name
$tableName = $modelObj->table();
// check table, add if not exist
$existTable = PdoDriver::getInstance()->tableExists($tableName);
... | php | private function checkTable($modelObj)
{
if (!method_exists($modelObj, 'table')) {
return false;
}
// get table name
$tableName = $modelObj->table();
// check table, add if not exist
$existTable = PdoDriver::getInstance()->tableExists($tableName);
... | [
"private",
"function",
"checkTable",
"(",
"$",
"modelObj",
")",
"{",
"if",
"(",
"!",
"method_exists",
"(",
"$",
"modelObj",
",",
"'table'",
")",
")",
"{",
"return",
"false",
";",
"}",
"// get table name",
"$",
"tableName",
"=",
"$",
"modelObj",
"->",
"ta... | Check Table fields
@param $modelObj
@return bool | [
"Check",
"Table",
"fields"
] | bcd8e3d27b19b14814d3207489071c4a250a6ac5 | https://github.com/gap-db/orm/blob/bcd8e3d27b19b14814d3207489071c4a250a6ac5/GapOrm/Commands/SynchronizeController.php#L40-L92 |
239,405 | gap-db/orm | GapOrm/Commands/SynchronizeController.php | SynchronizeController.getAllModels | private function getAllModels()
{
$modules = Safan::handler()->getModules();
$modelClasses = [];
foreach ($modules as $moduleName => $modulePath) {
$modelsPath = APP_BASE_PATH . DS . $modulePath . DS . 'Models';
$modelFiles = [];
if (is_dir($models... | php | private function getAllModels()
{
$modules = Safan::handler()->getModules();
$modelClasses = [];
foreach ($modules as $moduleName => $modulePath) {
$modelsPath = APP_BASE_PATH . DS . $modulePath . DS . 'Models';
$modelFiles = [];
if (is_dir($models... | [
"private",
"function",
"getAllModels",
"(",
")",
"{",
"$",
"modules",
"=",
"Safan",
"::",
"handler",
"(",
")",
"->",
"getModules",
"(",
")",
";",
"$",
"modelClasses",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"modules",
"as",
"$",
"moduleName",
"=>",
... | Return all Model Class names
@return array | [
"Return",
"all",
"Model",
"Class",
"names"
] | bcd8e3d27b19b14814d3207489071c4a250a6ac5 | https://github.com/gap-db/orm/blob/bcd8e3d27b19b14814d3207489071c4a250a6ac5/GapOrm/Commands/SynchronizeController.php#L99-L140 |
239,406 | phossa2/libs | src/Phossa2/Query/Traits/Clause/ClauseTrait.php | ClauseTrait.quoteAlias | protected function quoteAlias($alias, array $settings)/*# : string */
{
if (is_int($alias)) {
return '';
} else {
$prefix = $settings['quotePrefix'];
$suffix = $settings['quoteSuffix'];
return ' AS ' . $this->quoteSpace($alias, $prefix, $suffix);
... | php | protected function quoteAlias($alias, array $settings)/*# : string */
{
if (is_int($alias)) {
return '';
} else {
$prefix = $settings['quotePrefix'];
$suffix = $settings['quoteSuffix'];
return ' AS ' . $this->quoteSpace($alias, $prefix, $suffix);
... | [
"protected",
"function",
"quoteAlias",
"(",
"$",
"alias",
",",
"array",
"$",
"settings",
")",
"/*# : string */",
"{",
"if",
"(",
"is_int",
"(",
"$",
"alias",
")",
")",
"{",
"return",
"''",
";",
"}",
"else",
"{",
"$",
"prefix",
"=",
"$",
"settings",
"... | Quote an alias if not an int
@param int|string $alias
@param array $settings
@return string
@access protected | [
"Quote",
"an",
"alias",
"if",
"not",
"an",
"int"
] | 921e485c8cc29067f279da2cdd06f47a9bddd115 | https://github.com/phossa2/libs/blob/921e485c8cc29067f279da2cdd06f47a9bddd115/src/Phossa2/Query/Traits/Clause/ClauseTrait.php#L71-L80 |
239,407 | phossa2/libs | src/Phossa2/Query/Traits/Clause/ClauseTrait.php | ClauseTrait.& | protected function &getClause(/*# string */ $clauseName)/*# : array */
{
if (empty($clauseName)) {
return $this->clause;
} else {
if (!isset($this->clause[$clauseName])) {
$this->clause[$clauseName] = [];
}
return $this->clause[$clauseN... | php | protected function &getClause(/*# string */ $clauseName)/*# : array */
{
if (empty($clauseName)) {
return $this->clause;
} else {
if (!isset($this->clause[$clauseName])) {
$this->clause[$clauseName] = [];
}
return $this->clause[$clauseN... | [
"protected",
"function",
"&",
"getClause",
"(",
"/*# string */",
"$",
"clauseName",
")",
"/*# : array */",
"{",
"if",
"(",
"empty",
"(",
"$",
"clauseName",
")",
")",
"{",
"return",
"$",
"this",
"->",
"clause",
";",
"}",
"else",
"{",
"if",
"(",
"!",
"is... | Return specific clause part
@param string $clauseName
@param array
@access protected | [
"Return",
"specific",
"clause",
"part"
] | 921e485c8cc29067f279da2cdd06f47a9bddd115 | https://github.com/phossa2/libs/blob/921e485c8cc29067f279da2cdd06f47a9bddd115/src/Phossa2/Query/Traits/Clause/ClauseTrait.php#L130-L140 |
239,408 | phossa2/libs | src/Phossa2/Query/Traits/Clause/ClauseTrait.php | ClauseTrait.processValue | protected function processValue(
$value,
array $settings,
/*# bool */ $between = false
)/*# : string */ {
if (is_object($value)) {
return $this->quoteObject($value, $settings);
} elseif (is_array($value)) {
return $this->processArrayValue($value, $sett... | php | protected function processValue(
$value,
array $settings,
/*# bool */ $between = false
)/*# : string */ {
if (is_object($value)) {
return $this->quoteObject($value, $settings);
} elseif (is_array($value)) {
return $this->processArrayValue($value, $sett... | [
"protected",
"function",
"processValue",
"(",
"$",
"value",
",",
"array",
"$",
"settings",
",",
"/*# bool */",
"$",
"between",
"=",
"false",
")",
"/*# : string */",
"{",
"if",
"(",
"is_object",
"(",
"$",
"value",
")",
")",
"{",
"return",
"$",
"this",
"->... | Process value part in the clause
@param mixed $value
@param array $settings
@return string
@access protected | [
"Process",
"value",
"part",
"in",
"the",
"clause"
] | 921e485c8cc29067f279da2cdd06f47a9bddd115 | https://github.com/phossa2/libs/blob/921e485c8cc29067f279da2cdd06f47a9bddd115/src/Phossa2/Query/Traits/Clause/ClauseTrait.php#L167-L179 |
239,409 | phossa2/libs | src/Phossa2/Query/Traits/Clause/ClauseTrait.php | ClauseTrait.processArrayValue | protected function processArrayValue(
array $value,
array $settings,
/*# bool */ $between = false
)/*# : string */ {
if ($between) {
$v1 = $this->processValue($value[0], $settings);
$v2 = $this->processValue($value[1], $settings);
return $v1 . ' AN... | php | protected function processArrayValue(
array $value,
array $settings,
/*# bool */ $between = false
)/*# : string */ {
if ($between) {
$v1 = $this->processValue($value[0], $settings);
$v2 = $this->processValue($value[1], $settings);
return $v1 . ' AN... | [
"protected",
"function",
"processArrayValue",
"(",
"array",
"$",
"value",
",",
"array",
"$",
"settings",
",",
"/*# bool */",
"$",
"between",
"=",
"false",
")",
"/*# : string */",
"{",
"if",
"(",
"$",
"between",
")",
"{",
"$",
"v1",
"=",
"$",
"this",
"->"... | Process value array
@param array $value
@param array $settings
@return string
@access protected | [
"Process",
"value",
"array"
] | 921e485c8cc29067f279da2cdd06f47a9bddd115 | https://github.com/phossa2/libs/blob/921e485c8cc29067f279da2cdd06f47a9bddd115/src/Phossa2/Query/Traits/Clause/ClauseTrait.php#L189-L205 |
239,410 | phossa2/libs | src/Phossa2/Query/Traits/Clause/ClauseTrait.php | ClauseTrait.processScalarValue | protected function processScalarValue($value)/*# : string */
{
if (ClauseInterface::NO_VALUE == $value) {
return '?';
} elseif (is_null($value) || is_bool($value)) {
return strtoupper(var_export($value, true));
} else {
return $this->getBuilder()->getParam... | php | protected function processScalarValue($value)/*# : string */
{
if (ClauseInterface::NO_VALUE == $value) {
return '?';
} elseif (is_null($value) || is_bool($value)) {
return strtoupper(var_export($value, true));
} else {
return $this->getBuilder()->getParam... | [
"protected",
"function",
"processScalarValue",
"(",
"$",
"value",
")",
"/*# : string */",
"{",
"if",
"(",
"ClauseInterface",
"::",
"NO_VALUE",
"==",
"$",
"value",
")",
"{",
"return",
"'?'",
";",
"}",
"elseif",
"(",
"is_null",
"(",
"$",
"value",
")",
"||",
... | Process scalar value
@param mixed $value
@return string
@access protected | [
"Process",
"scalar",
"value"
] | 921e485c8cc29067f279da2cdd06f47a9bddd115 | https://github.com/phossa2/libs/blob/921e485c8cc29067f279da2cdd06f47a9bddd115/src/Phossa2/Query/Traits/Clause/ClauseTrait.php#L214-L223 |
239,411 | phossa2/libs | src/Phossa2/Query/Traits/Clause/ClauseTrait.php | ClauseTrait.joinClause | protected function joinClause(
/*# : string */ $prefix,
/*# : string */ $seperator,
array $clause,
array $settings
)/*# : string */ {
if (empty($clause)) {
return '';
} else {
$sepr = $settings['seperator'];
$join = $settings['join'... | php | protected function joinClause(
/*# : string */ $prefix,
/*# : string */ $seperator,
array $clause,
array $settings
)/*# : string */ {
if (empty($clause)) {
return '';
} else {
$sepr = $settings['seperator'];
$join = $settings['join'... | [
"protected",
"function",
"joinClause",
"(",
"/*# : string */",
"$",
"prefix",
",",
"/*# : string */",
"$",
"seperator",
",",
"array",
"$",
"clause",
",",
"array",
"$",
"settings",
")",
"/*# : string */",
"{",
"if",
"(",
"empty",
"(",
"$",
"clause",
")",
")",... | Join a clause with prefix and its parts
@param string $prefix
@param string $seperator
@param array $clause
@param array $settings
@return string
@access protected | [
"Join",
"a",
"clause",
"with",
"prefix",
"and",
"its",
"parts"
] | 921e485c8cc29067f279da2cdd06f47a9bddd115 | https://github.com/phossa2/libs/blob/921e485c8cc29067f279da2cdd06f47a9bddd115/src/Phossa2/Query/Traits/Clause/ClauseTrait.php#L235-L249 |
239,412 | phossa2/libs | src/Phossa2/Query/Traits/Clause/ClauseTrait.php | ClauseTrait.buildClause | protected function buildClause(
/*# string */ $clauseName,
/*# string */ $clausePrefix,
array $settings,
array $clauseParts = []
)/*# string */ {
$clause = &$this->getClause($clauseName);
foreach ($clause as $alias => $field) {
$part =
$thi... | php | protected function buildClause(
/*# string */ $clauseName,
/*# string */ $clausePrefix,
array $settings,
array $clauseParts = []
)/*# string */ {
$clause = &$this->getClause($clauseName);
foreach ($clause as $alias => $field) {
$part =
$thi... | [
"protected",
"function",
"buildClause",
"(",
"/*# string */",
"$",
"clauseName",
",",
"/*# string */",
"$",
"clausePrefix",
",",
"array",
"$",
"settings",
",",
"array",
"$",
"clauseParts",
"=",
"[",
"]",
")",
"/*# string */",
"{",
"$",
"clause",
"=",
"&",
"$... | Build a generic clause
@param string $clauseName
@param string $clausePrefix
@param array $settings
@param array $clauseParts
@return string
@access protected | [
"Build",
"a",
"generic",
"clause"
] | 921e485c8cc29067f279da2cdd06f47a9bddd115 | https://github.com/phossa2/libs/blob/921e485c8cc29067f279da2cdd06f47a9bddd115/src/Phossa2/Query/Traits/Clause/ClauseTrait.php#L261-L276 |
239,413 | jmpantoja/planb-utils | src/DS/Deque/Deque.php | Deque.typed | public static function typed(string $type, iterable $input = []): Deque
{
$resolver = Resolver::typed($type);
return new static($input, $resolver);
} | php | public static function typed(string $type, iterable $input = []): Deque
{
$resolver = Resolver::typed($type);
return new static($input, $resolver);
} | [
"public",
"static",
"function",
"typed",
"(",
"string",
"$",
"type",
",",
"iterable",
"$",
"input",
"=",
"[",
"]",
")",
":",
"Deque",
"{",
"$",
"resolver",
"=",
"Resolver",
"::",
"typed",
"(",
"$",
"type",
")",
";",
"return",
"new",
"static",
"(",
... | Deque named constructor.
@param string $type
@param mixed[] $input
@return \PlanB\DS\Deque\Deque | [
"Deque",
"named",
"constructor",
"."
] | d17fbced4a285275928f8428ee56e269eb851690 | https://github.com/jmpantoja/planb-utils/blob/d17fbced4a285275928f8428ee56e269eb851690/src/DS/Deque/Deque.php#L49-L55 |
239,414 | rseyferth/chickenwire | src/ChickenWire/Util/Html.php | Html.link | public function link($target, $caption = null, $attributes = array())
{
// Check if target needs to be resolved
if (is_object($target)) {
// Try to get a link
$target = Url::instance()->show($target);
}
// Create element
$link = new \HtmlObject\Link($target, $caption, $attributes);
retur... | php | public function link($target, $caption = null, $attributes = array())
{
// Check if target needs to be resolved
if (is_object($target)) {
// Try to get a link
$target = Url::instance()->show($target);
}
// Create element
$link = new \HtmlObject\Link($target, $caption, $attributes);
retur... | [
"public",
"function",
"link",
"(",
"$",
"target",
",",
"$",
"caption",
"=",
"null",
",",
"$",
"attributes",
"=",
"array",
"(",
")",
")",
"{",
"// Check if target needs to be resolved",
"if",
"(",
"is_object",
"(",
"$",
"target",
")",
")",
"{",
"// Try to g... | Create a new Link element
<code>
echo $this->html->link('http://www.google.com/', 'Google', array("target" => "_blank"));
</code>
<code>
<a href="http://www.google.com/" target="_blank">Google</a>
</code>
<br>
<code>
$person = People::find(1);
echo $this->html->link($person, $person->name);
</code>
<code>
<a href="/p... | [
"Create",
"a",
"new",
"Link",
"element"
] | 74921f0a0d489366602e25df43eda894719e43d3 | https://github.com/rseyferth/chickenwire/blob/74921f0a0d489366602e25df43eda894719e43d3/src/ChickenWire/Util/Html.php#L102-L117 |
239,415 | rseyferth/chickenwire | src/ChickenWire/Util/Html.php | Html.deleteLink | public function deleteLink($target, $caption = null, $confirmMessage = 'Are you sure?', $attributes = array())
{
// Check if target needs to be resolved
if (is_array($target) || is_object($target)) {
// Try to get a link
$target = Url::instance()->delete($target);
}
// Set method to delete
... | php | public function deleteLink($target, $caption = null, $confirmMessage = 'Are you sure?', $attributes = array())
{
// Check if target needs to be resolved
if (is_array($target) || is_object($target)) {
// Try to get a link
$target = Url::instance()->delete($target);
}
// Set method to delete
... | [
"public",
"function",
"deleteLink",
"(",
"$",
"target",
",",
"$",
"caption",
"=",
"null",
",",
"$",
"confirmMessage",
"=",
"'Are you sure?'",
",",
"$",
"attributes",
"=",
"array",
"(",
")",
")",
"{",
"// Check if target needs to be resolved",
"if",
"(",
"is_ar... | Create new delete Link element
**Note** This requires the ChickenWire front-end Javascript library to be included in your page.
@param \ChickenWire\Model|string The Model instance to create the delete link for, or a string containing a url.
@param string The text/elements to put inside the link.
@param stri... | [
"Create",
"new",
"delete",
"Link",
"element"
] | 74921f0a0d489366602e25df43eda894719e43d3 | https://github.com/rseyferth/chickenwire/blob/74921f0a0d489366602e25df43eda894719e43d3/src/ChickenWire/Util/Html.php#L130-L158 |
239,416 | rseyferth/chickenwire | src/ChickenWire/Util/Html.php | Html.listingFor | public function listingFor($items, \Closure $callback, $attributes = array(), $element = 'ul', $childElement = 'li')
{
// Create the element
$list = \HtmlObject\Element::$element('', $attributes);
// Get closure info
$closureMethod = Reflection::getClosureMethod($callback);
$closureArgs = Reflection:... | php | public function listingFor($items, \Closure $callback, $attributes = array(), $element = 'ul', $childElement = 'li')
{
// Create the element
$list = \HtmlObject\Element::$element('', $attributes);
// Get closure info
$closureMethod = Reflection::getClosureMethod($callback);
$closureArgs = Reflection:... | [
"public",
"function",
"listingFor",
"(",
"$",
"items",
",",
"\\",
"Closure",
"$",
"callback",
",",
"$",
"attributes",
"=",
"array",
"(",
")",
",",
"$",
"element",
"=",
"'ul'",
",",
"$",
"childElement",
"=",
"'li'",
")",
"{",
"// Create the element",
"$",... | Create a listing for the given array of items, using a callback for each item
For example, in a view you might do:
<code>
$this->html->listingFor($this->people, function($person) {
return $person->name;
});
</code>
<code>
<ul>
<li>John Doe</li>
<li>Phil Spector</li>
</ul>
</code>
<br>
Or a little more complex:
<code>... | [
"Create",
"a",
"listing",
"for",
"the",
"given",
"array",
"of",
"items",
"using",
"a",
"callback",
"for",
"each",
"item"
] | 74921f0a0d489366602e25df43eda894719e43d3 | https://github.com/rseyferth/chickenwire/blob/74921f0a0d489366602e25df43eda894719e43d3/src/ChickenWire/Util/Html.php#L215-L270 |
239,417 | rseyferth/chickenwire | src/ChickenWire/Util/Html.php | Html.listing | public function listing($contents = array(), $attributes = array(), $element = 'ul', $childElement = 'li')
{
// Create list
$list = \HtmlObject\Element::$element('', $attributes);
// Array?
if (!is_null($contents) && !is_array($contents)) {
$contents = array($contents);
}
// Loop contents
... | php | public function listing($contents = array(), $attributes = array(), $element = 'ul', $childElement = 'li')
{
// Create list
$list = \HtmlObject\Element::$element('', $attributes);
// Array?
if (!is_null($contents) && !is_array($contents)) {
$contents = array($contents);
}
// Loop contents
... | [
"public",
"function",
"listing",
"(",
"$",
"contents",
"=",
"array",
"(",
")",
",",
"$",
"attributes",
"=",
"array",
"(",
")",
",",
"$",
"element",
"=",
"'ul'",
",",
"$",
"childElement",
"=",
"'li'",
")",
"{",
"// Create list",
"$",
"list",
"=",
"\\"... | Create a new listing
**Simple list**
<code>
$this->html->listing(array('item 1', 'item 2', 'item 3'));
</code>
<code>
$this->html->ul(array('item 1', 'item 2', 'item 3'));
</code>
<code>
<ul>
<li>item 1</li>
<li>item 2</li>
<li>item 3</li>
</ul>
</code>
<br>
**Ordered list**
<code>
$this->html->listing(array('item 1'... | [
"Create",
"a",
"new",
"listing"
] | 74921f0a0d489366602e25df43eda894719e43d3 | https://github.com/rseyferth/chickenwire/blob/74921f0a0d489366602e25df43eda894719e43d3/src/ChickenWire/Util/Html.php#L337-L387 |
239,418 | rseyferth/chickenwire | src/ChickenWire/Util/Html.php | Html.li | public function li($contents = '', $attributes = array())
{
$li = \HtmlObject\Element::li($contents, $attributes);
return $li;
} | php | public function li($contents = '', $attributes = array())
{
$li = \HtmlObject\Element::li($contents, $attributes);
return $li;
} | [
"public",
"function",
"li",
"(",
"$",
"contents",
"=",
"''",
",",
"$",
"attributes",
"=",
"array",
"(",
")",
")",
"{",
"$",
"li",
"=",
"\\",
"HtmlObject",
"\\",
"Element",
"::",
"li",
"(",
"$",
"contents",
",",
"$",
"attributes",
")",
";",
"return"... | Create a new list item
@param string|Element The contents of the list item
@param array Attributes to add to the element
@return \HtmlObject\Element The created element | [
"Create",
"a",
"new",
"list",
"item"
] | 74921f0a0d489366602e25df43eda894719e43d3 | https://github.com/rseyferth/chickenwire/blob/74921f0a0d489366602e25df43eda894719e43d3/src/ChickenWire/Util/Html.php#L418-L424 |
239,419 | railsphp/framework | src/Rails/ActionDispatch/Http/Session.php | Session.start | public function start($name = null, $id = null)
{
if (!session_id()) {
if ($name) {
session_name($name);
}
if ($id) {
session_id($this->id);
}
session_start();
return true;
}
return false;... | php | public function start($name = null, $id = null)
{
if (!session_id()) {
if ($name) {
session_name($name);
}
if ($id) {
session_id($this->id);
}
session_start();
return true;
}
return false;... | [
"public",
"function",
"start",
"(",
"$",
"name",
"=",
"null",
",",
"$",
"id",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"session_id",
"(",
")",
")",
"{",
"if",
"(",
"$",
"name",
")",
"{",
"session_name",
"(",
"$",
"name",
")",
";",
"}",
"if",
"(... | Starts the PHP session, if not yet started. | [
"Starts",
"the",
"PHP",
"session",
"if",
"not",
"yet",
"started",
"."
] | 2ac9d3e493035dcc68f3c3812423327127327cd5 | https://github.com/railsphp/framework/blob/2ac9d3e493035dcc68f3c3812423327127327cd5/src/Rails/ActionDispatch/Http/Session.php#L82-L95 |
239,420 | railsphp/framework | src/Rails/ActionDispatch/Http/Session.php | Session.destroy | public function destroy()
{
$_SESSION = [];
if ($this->cookieJar) {
$this->cookieJar->remove($this->name());
} else {
$params = session_get_cookie_params();
setcookie($this->name(), '', time() - 42000,
$params["path"], $params["dom... | php | public function destroy()
{
$_SESSION = [];
if ($this->cookieJar) {
$this->cookieJar->remove($this->name());
} else {
$params = session_get_cookie_params();
setcookie($this->name(), '', time() - 42000,
$params["path"], $params["dom... | [
"public",
"function",
"destroy",
"(",
")",
"{",
"$",
"_SESSION",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"this",
"->",
"cookieJar",
")",
"{",
"$",
"this",
"->",
"cookieJar",
"->",
"remove",
"(",
"$",
"this",
"->",
"name",
"(",
")",
")",
";",
"}",
"... | Destroys the PHP session. | [
"Destroys",
"the",
"PHP",
"session",
"."
] | 2ac9d3e493035dcc68f3c3812423327127327cd5 | https://github.com/railsphp/framework/blob/2ac9d3e493035dcc68f3c3812423327127327cd5/src/Rails/ActionDispatch/Http/Session.php#L100-L115 |
239,421 | zepi/turbo-base | Zepi/Web/UserInterface/src/Form/Group.php | Group.getHtmlId | public function getHtmlId()
{
$form = $this->getParentOfType('\\Zepi\\Web\\UserInterface\\Form\\Form');
// If the group isn't assigned to a data form we can not generate
// the id of the group.
if (!$form) {
return $this->key;
}
return $form->get... | php | public function getHtmlId()
{
$form = $this->getParentOfType('\\Zepi\\Web\\UserInterface\\Form\\Form');
// If the group isn't assigned to a data form we can not generate
// the id of the group.
if (!$form) {
return $this->key;
}
return $form->get... | [
"public",
"function",
"getHtmlId",
"(",
")",
"{",
"$",
"form",
"=",
"$",
"this",
"->",
"getParentOfType",
"(",
"'\\\\Zepi\\\\Web\\\\UserInterface\\\\Form\\\\Form'",
")",
";",
"// If the group isn't assigned to a data form we can not generate",
"// the id of the group.",
"if",
... | Returns the html id of this group
@access public
@return string | [
"Returns",
"the",
"html",
"id",
"of",
"this",
"group"
] | 9a36d8c7649317f55f91b2adf386bd1f04ec02a3 | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Web/UserInterface/src/Form/Group.php#L94-L105 |
239,422 | coolms/common | src/Form/Annotation/AnnotationBuilderTrait.php | AnnotationBuilderTrait.getFormFactory | public function getFormFactory()
{
if ($this->formFactory) {
return $this->formFactory;
}
$this->formFactory = new Factory();
return $this->formFactory;
} | php | public function getFormFactory()
{
if ($this->formFactory) {
return $this->formFactory;
}
$this->formFactory = new Factory();
return $this->formFactory;
} | [
"public",
"function",
"getFormFactory",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"formFactory",
")",
"{",
"return",
"$",
"this",
"->",
"formFactory",
";",
"}",
"$",
"this",
"->",
"formFactory",
"=",
"new",
"Factory",
"(",
")",
";",
"return",
"$",
... | Retrieve form factory
Lazy-loads the default form factory if none is currently set.
@return Factory | [
"Retrieve",
"form",
"factory"
] | 3572993cdcdb2898cdde396a2f1de9864b193660 | https://github.com/coolms/common/blob/3572993cdcdb2898cdde396a2f1de9864b193660/src/Form/Annotation/AnnotationBuilderTrait.php#L32-L40 |
239,423 | coolms/common | src/Form/Annotation/AnnotationBuilderTrait.php | AnnotationBuilderTrait.createForm | public function createForm($entity)
{
$formSpec = ArrayUtils::iteratorToArray($this->getFormSpecification($entity));
if (!isset($formSpec['options']['merge_input_filter'])) {
$formSpec['options']['merge_input_filter'] = true;
}
return $this->getFormFactory()->createForm(... | php | public function createForm($entity)
{
$formSpec = ArrayUtils::iteratorToArray($this->getFormSpecification($entity));
if (!isset($formSpec['options']['merge_input_filter'])) {
$formSpec['options']['merge_input_filter'] = true;
}
return $this->getFormFactory()->createForm(... | [
"public",
"function",
"createForm",
"(",
"$",
"entity",
")",
"{",
"$",
"formSpec",
"=",
"ArrayUtils",
"::",
"iteratorToArray",
"(",
"$",
"this",
"->",
"getFormSpecification",
"(",
"$",
"entity",
")",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"formSpec... | Create a form from an object.
@param string|object $entity
@return \CmsCommon\Form\FormInterface | [
"Create",
"a",
"form",
"from",
"an",
"object",
"."
] | 3572993cdcdb2898cdde396a2f1de9864b193660 | https://github.com/coolms/common/blob/3572993cdcdb2898cdde396a2f1de9864b193660/src/Form/Annotation/AnnotationBuilderTrait.php#L48-L56 |
239,424 | coolms/common | src/Form/Annotation/AnnotationBuilderTrait.php | AnnotationBuilderTrait.configureElement | protected function configureElement($annotations, $reflection, $formSpec, $filterSpec)
{
// If the element is marked as exclude, return early
if ($this->checkForExclude($annotations)) {
return;
}
$events = $this->getEventManager();
$name = $this->discoverName($... | php | protected function configureElement($annotations, $reflection, $formSpec, $filterSpec)
{
// If the element is marked as exclude, return early
if ($this->checkForExclude($annotations)) {
return;
}
$events = $this->getEventManager();
$name = $this->discoverName($... | [
"protected",
"function",
"configureElement",
"(",
"$",
"annotations",
",",
"$",
"reflection",
",",
"$",
"formSpec",
",",
"$",
"filterSpec",
")",
"{",
"// If the element is marked as exclude, return early",
"if",
"(",
"$",
"this",
"->",
"checkForExclude",
"(",
"$",
... | Configure an element from annotations
@param AnnotationCollection $annotations
@param PropertyReflection $reflection
@param ArrayObject $formSpec
@param ArrayObject $filterSpec
@return void
@triggers checkForExclude
@triggers discoverName
@triggers configureElement | [
"Configure",
"an",
"element",
"from",
"annotations"
] | 3572993cdcdb2898cdde396a2f1de9864b193660 | https://github.com/coolms/common/blob/3572993cdcdb2898cdde396a2f1de9864b193660/src/Form/Annotation/AnnotationBuilderTrait.php#L71-L146 |
239,425 | Fenzland/Htsl.php | libs/Htsl.php | Htsl.compile | public function compile( string$fromFile, string$toFile='' )
{
$fromFile= $this->getFilePath($fromFile);
$result= $this->execute(new FileBuffer($this,$fromFile));
if( $toFile ){
return file_put_contents($toFile,$result);
}else{
return $result;
}
} | php | public function compile( string$fromFile, string$toFile='' )
{
$fromFile= $this->getFilePath($fromFile);
$result= $this->execute(new FileBuffer($this,$fromFile));
if( $toFile ){
return file_put_contents($toFile,$result);
}else{
return $result;
}
} | [
"public",
"function",
"compile",
"(",
"string",
"$",
"fromFile",
",",
"string",
"$",
"toFile",
"=",
"''",
")",
"{",
"$",
"fromFile",
"=",
"$",
"this",
"->",
"getFilePath",
"(",
"$",
"fromFile",
")",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"execut... | Compiling a HTSL file into a HTML or PHP file.
@api
@access public
@param string $fromFile
@param string $toFile
@return int|string | [
"Compiling",
"a",
"HTSL",
"file",
"into",
"a",
"HTML",
"or",
"PHP",
"file",
"."
] | 28ecc4afd1a5bdb29dea3589c8132adba87f3947 | https://github.com/Fenzland/Htsl.php/blob/28ecc4afd1a5bdb29dea3589c8132adba87f3947/libs/Htsl.php#L92-L103 |
239,426 | Fenzland/Htsl.php | libs/Htsl.php | Htsl.setBasePath | public function setBasePath( string$basePath ):self
{
$this->basePath= '/'===substr($basePath,-1) ? substr($basePath,0,-1) : $basePath;
return $this;
} | php | public function setBasePath( string$basePath ):self
{
$this->basePath= '/'===substr($basePath,-1) ? substr($basePath,0,-1) : $basePath;
return $this;
} | [
"public",
"function",
"setBasePath",
"(",
"string",
"$",
"basePath",
")",
":",
"self",
"{",
"$",
"this",
"->",
"basePath",
"=",
"'/'",
"===",
"substr",
"(",
"$",
"basePath",
",",
"-",
"1",
")",
"?",
"substr",
"(",
"$",
"basePath",
",",
"0",
",",
"-... | Setting the base path of the HTSL project to parse.
@api
@access public
@param string $basePath
@return self | [
"Setting",
"the",
"base",
"path",
"of",
"the",
"HTSL",
"project",
"to",
"parse",
"."
] | 28ecc4afd1a5bdb29dea3589c8132adba87f3947 | https://github.com/Fenzland/Htsl.php/blob/28ecc4afd1a5bdb29dea3589c8132adba87f3947/libs/Htsl.php#L132-L137 |
239,427 | Fenzland/Htsl.php | libs/Htsl.php | Htsl.getConfig | public function getConfig( string...$keys )
{
$result= $this->config;
foreach( $keys as $key ){
if( !isset($result[$key]) )
{ return null; }
$result= $result[$key];
}
return $result;
} | php | public function getConfig( string...$keys )
{
$result= $this->config;
foreach( $keys as $key ){
if( !isset($result[$key]) )
{ return null; }
$result= $result[$key];
}
return $result;
} | [
"public",
"function",
"getConfig",
"(",
"string",
"...",
"$",
"keys",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"config",
";",
"foreach",
"(",
"$",
"keys",
"as",
"$",
"key",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"result",
"[",
"$",
... | Getting the config of Htsl.
@internal
@access public
@param string $keys
@return mixed | [
"Getting",
"the",
"config",
"of",
"Htsl",
"."
] | 28ecc4afd1a5bdb29dea3589c8132adba87f3947 | https://github.com/Fenzland/Htsl.php/blob/28ecc4afd1a5bdb29dea3589c8132adba87f3947/libs/Htsl.php#L180-L192 |
239,428 | Fenzland/Htsl.php | libs/Htsl.php | Htsl.getFilePath | public function getFilePath( string$filePath, string$path=null ):string
{
if( !isset($this->basePath) )
{ throw new \Exception('BasePath musbe set.'); }
if( !strlen($filePath) )
{ throw new \Exception('FilePath cannot be empty.'); }
if( '/'===$filePath{0} ){
if( is_null($path) )
{ return $filePath... | php | public function getFilePath( string$filePath, string$path=null ):string
{
if( !isset($this->basePath) )
{ throw new \Exception('BasePath musbe set.'); }
if( !strlen($filePath) )
{ throw new \Exception('FilePath cannot be empty.'); }
if( '/'===$filePath{0} ){
if( is_null($path) )
{ return $filePath... | [
"public",
"function",
"getFilePath",
"(",
"string",
"$",
"filePath",
",",
"string",
"$",
"path",
"=",
"null",
")",
":",
"string",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"basePath",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",... | Getting the real file path of the HTSL file by relative path.
@internal
@access public
@param string $filePath
@param string|null $path
@return string | [
"Getting",
"the",
"real",
"file",
"path",
"of",
"the",
"HTSL",
"file",
"by",
"relative",
"path",
"."
] | 28ecc4afd1a5bdb29dea3589c8132adba87f3947 | https://github.com/Fenzland/Htsl.php/blob/28ecc4afd1a5bdb29dea3589c8132adba87f3947/libs/Htsl.php#L206-L228 |
239,429 | Fenzland/Htsl.php | libs/Htsl.php | Htsl.getFileContent | public function getFileContent( string$filePath ):string
{
return isset($this->fileGetter) ? $this->fileGetter($filePath) : file_get_contents($filePath);
} | php | public function getFileContent( string$filePath ):string
{
return isset($this->fileGetter) ? $this->fileGetter($filePath) : file_get_contents($filePath);
} | [
"public",
"function",
"getFileContent",
"(",
"string",
"$",
"filePath",
")",
":",
"string",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"fileGetter",
")",
"?",
"$",
"this",
"->",
"fileGetter",
"(",
"$",
"filePath",
")",
":",
"file_get_contents",
"(",
... | Getting the content of file.
@internal
@access public
@param string $filePath
@return string | [
"Getting",
"the",
"content",
"of",
"file",
"."
] | 28ecc4afd1a5bdb29dea3589c8132adba87f3947 | https://github.com/Fenzland/Htsl.php/blob/28ecc4afd1a5bdb29dea3589c8132adba87f3947/libs/Htsl.php#L241-L244 |
239,430 | mpaleo/scaffolder-support | src/Scaffolder/Support/InputTypeResolverTrait.php | InputTypeResolverTrait.getInputFor | public static function getInputFor(\stdClass $fieldData)
{
$formData = explode(':', $fieldData->type->ui);
$type = $formData[0];
$options = isset($formData[1]) ? $formData[1] : '[]';
if ($type == 'text' ||
$type == 'number' ||
$type == 'textarea' ||
... | php | public static function getInputFor(\stdClass $fieldData)
{
$formData = explode(':', $fieldData->type->ui);
$type = $formData[0];
$options = isset($formData[1]) ? $formData[1] : '[]';
if ($type == 'text' ||
$type == 'number' ||
$type == 'textarea' ||
... | [
"public",
"static",
"function",
"getInputFor",
"(",
"\\",
"stdClass",
"$",
"fieldData",
")",
"{",
"$",
"formData",
"=",
"explode",
"(",
"':'",
",",
"$",
"fieldData",
"->",
"type",
"->",
"ui",
")",
";",
"$",
"type",
"=",
"$",
"formData",
"[",
"0",
"]"... | Get the input for the field.
@param \stdClass $fieldData
@return string
@throws \Exception | [
"Get",
"the",
"input",
"for",
"the",
"field",
"."
] | d599c88596c65302a984078cd0519221a2d2ceac | https://github.com/mpaleo/scaffolder-support/blob/d599c88596c65302a984078cd0519221a2d2ceac/src/Scaffolder/Support/InputTypeResolverTrait.php#L15-L70 |
239,431 | harpya/ufw-base | src/ufw/Router.php | Router.processMap | protected function processMap($arr, $prefix='') {
foreach ($arr as $uri => $options) {
$uri = $prefix . $this->preProcessURI($uri);
foreach ($options as $method => $target) {
if (!is_array($target)) continue;
if (array_... | php | protected function processMap($arr, $prefix='') {
foreach ($arr as $uri => $options) {
$uri = $prefix . $this->preProcessURI($uri);
foreach ($options as $method => $target) {
if (!is_array($target)) continue;
if (array_... | [
"protected",
"function",
"processMap",
"(",
"$",
"arr",
",",
"$",
"prefix",
"=",
"''",
")",
"{",
"foreach",
"(",
"$",
"arr",
"as",
"$",
"uri",
"=>",
"$",
"options",
")",
"{",
"$",
"uri",
"=",
"$",
"prefix",
".",
"$",
"this",
"->",
"preProcessURI",
... | For each array item, pre process and add to global mapping
@param array $arr
@param string $prefix | [
"For",
"each",
"array",
"item",
"pre",
"process",
"and",
"add",
"to",
"global",
"mapping"
] | 9e2db1d9625f4b875783f98830e0410cf4fd125b | https://github.com/harpya/ufw-base/blob/9e2db1d9625f4b875783f98830e0410cf4fd125b/src/ufw/Router.php#L74-L92 |
239,432 | harpya/ufw-base | src/ufw/Router.php | Router.preProcessURI | public function preProcessURI($uri) {
$s = preg_replace("/\{([\w]+)\}/", "[*:$1]", $uri);
if (!empty($s)) {
$uri = $s;
}
return $uri;
} | php | public function preProcessURI($uri) {
$s = preg_replace("/\{([\w]+)\}/", "[*:$1]", $uri);
if (!empty($s)) {
$uri = $s;
}
return $uri;
} | [
"public",
"function",
"preProcessURI",
"(",
"$",
"uri",
")",
"{",
"$",
"s",
"=",
"preg_replace",
"(",
"\"/\\{([\\w]+)\\}/\"",
",",
"\"[*:$1]\"",
",",
"$",
"uri",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"s",
")",
")",
"{",
"$",
"uri",
"=",
"$",... | Replace the macros by regular expressions to extract arguments from URL
@param string $uri
@return string | [
"Replace",
"the",
"macros",
"by",
"regular",
"expressions",
"to",
"extract",
"arguments",
"from",
"URL"
] | 9e2db1d9625f4b875783f98830e0410cf4fd125b | https://github.com/harpya/ufw-base/blob/9e2db1d9625f4b875783f98830e0410cf4fd125b/src/ufw/Router.php#L99-L107 |
239,433 | harpya/ufw-base | src/ufw/Router.php | Router.evaluate | public function evaluate($target) {
switch (Utils::get('type', $target)) {
case 'class' :
$return = $this->processClass(Utils::get('target',$target), Utils::get('match', $target));
break;
case 'controller' :
$... | php | public function evaluate($target) {
switch (Utils::get('type', $target)) {
case 'class' :
$return = $this->processClass(Utils::get('target',$target), Utils::get('match', $target));
break;
case 'controller' :
$... | [
"public",
"function",
"evaluate",
"(",
"$",
"target",
")",
"{",
"switch",
"(",
"Utils",
"::",
"get",
"(",
"'type'",
",",
"$",
"target",
")",
")",
"{",
"case",
"'class'",
":",
"$",
"return",
"=",
"$",
"this",
"->",
"processClass",
"(",
"Utils",
"::",
... | Determine which type of target is, and execute it.
@param array $target
@return mixed
@throws \Exception | [
"Determine",
"which",
"type",
"of",
"target",
"is",
"and",
"execute",
"it",
"."
] | 9e2db1d9625f4b875783f98830e0410cf4fd125b | https://github.com/harpya/ufw-base/blob/9e2db1d9625f4b875783f98830e0410cf4fd125b/src/ufw/Router.php#L120-L140 |
239,434 | harpya/ufw-base | src/ufw/Router.php | Router.resolve | public function resolve() {
$return = false;
$match = $this->match();
if (!$match) {
$target = $this->getDefaultRoute();
if ($target) {
$match = ['target' => $target];
}
}
if (substr(Ut... | php | public function resolve() {
$return = false;
$match = $this->match();
if (!$match) {
$target = $this->getDefaultRoute();
if ($target) {
$match = ['target' => $target];
}
}
if (substr(Ut... | [
"public",
"function",
"resolve",
"(",
")",
"{",
"$",
"return",
"=",
"false",
";",
"$",
"match",
"=",
"$",
"this",
"->",
"match",
"(",
")",
";",
"if",
"(",
"!",
"$",
"match",
")",
"{",
"$",
"target",
"=",
"$",
"this",
"->",
"getDefaultRoute",
"(",... | Perform the match among the URI and the routes available
@return mixed | [
"Perform",
"the",
"match",
"among",
"the",
"URI",
"and",
"the",
"routes",
"available"
] | 9e2db1d9625f4b875783f98830e0410cf4fd125b | https://github.com/harpya/ufw-base/blob/9e2db1d9625f4b875783f98830e0410cf4fd125b/src/ufw/Router.php#L164-L203 |
239,435 | frogsystem/legacy-bridge | src/Controllers/AdminController.php | AdminController.assets | public function assets(Response $response, $asset)
{
$filesystem = new Filesystem(new Adapter(FS2ADMIN));
$expires = 8640000;
try {
// generate cache data
$timestamp_string = gmdate('D, d M Y H:i:s ', $filesystem->getTimestamp($asset)) . 'GMT';
$etag = md... | php | public function assets(Response $response, $asset)
{
$filesystem = new Filesystem(new Adapter(FS2ADMIN));
$expires = 8640000;
try {
// generate cache data
$timestamp_string = gmdate('D, d M Y H:i:s ', $filesystem->getTimestamp($asset)) . 'GMT';
$etag = md... | [
"public",
"function",
"assets",
"(",
"Response",
"$",
"response",
",",
"$",
"asset",
")",
"{",
"$",
"filesystem",
"=",
"new",
"Filesystem",
"(",
"new",
"Adapter",
"(",
"FS2ADMIN",
")",
")",
";",
"$",
"expires",
"=",
"8640000",
";",
"try",
"{",
"// gene... | Return admin assets
@param Response $response
@param $asset
@return Response|static
@throws FileNotFoundException | [
"Return",
"admin",
"assets"
] | a4ea3bea701e2b737c119a5d89b7778e8745658c | https://github.com/frogsystem/legacy-bridge/blob/a4ea3bea701e2b737c119a5d89b7778e8745658c/src/Controllers/AdminController.php#L56-L95 |
239,436 | laravie/quemon | src/Http/Controllers/QueueController.php | QueueController.index | public function index()
{
try {
$jobs = FailedJob::orderBy('id', 'DESC')->paginate();
} catch (QueryException $e) {
return $this->setup();
}
return view('laravie/quemon::index', compact('jobs'));
} | php | public function index()
{
try {
$jobs = FailedJob::orderBy('id', 'DESC')->paginate();
} catch (QueryException $e) {
return $this->setup();
}
return view('laravie/quemon::index', compact('jobs'));
} | [
"public",
"function",
"index",
"(",
")",
"{",
"try",
"{",
"$",
"jobs",
"=",
"FailedJob",
"::",
"orderBy",
"(",
"'id'",
",",
"'DESC'",
")",
"->",
"paginate",
"(",
")",
";",
"}",
"catch",
"(",
"QueryException",
"$",
"e",
")",
"{",
"return",
"$",
"thi... | List of failed jobs.
@return mixed | [
"List",
"of",
"failed",
"jobs",
"."
] | e548782301934d99c7e7262386e14e263a9d5422 | https://github.com/laravie/quemon/blob/e548782301934d99c7e7262386e14e263a9d5422/src/Http/Controllers/QueueController.php#L29-L38 |
239,437 | dazarobbo/Cola | src/ArrayList.php | ArrayList.add | public function add($value) {
if($this->_ReadOnly){
throw new ReadOnlyException(\get_called_class() . ' is read only');
}
$this->_Arr = \array_merge($this->_Arr, \func_get_args());
return $this;
} | php | public function add($value) {
if($this->_ReadOnly){
throw new ReadOnlyException(\get_called_class() . ' is read only');
}
$this->_Arr = \array_merge($this->_Arr, \func_get_args());
return $this;
} | [
"public",
"function",
"add",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_ReadOnly",
")",
"{",
"throw",
"new",
"ReadOnlyException",
"(",
"\\",
"get_called_class",
"(",
")",
".",
"' is read only'",
")",
";",
"}",
"$",
"this",
"->",
"_Arr... | Adds a value to the list, multiple can be given
@param mixed $value
@return \Cola\ArrayList
@throws ReadOnlyException | [
"Adds",
"a",
"value",
"to",
"the",
"list",
"multiple",
"can",
"be",
"given"
] | b101b73ebeb8a571345a303cbc75168f60d0e64f | https://github.com/dazarobbo/Cola/blob/b101b73ebeb8a571345a303cbc75168f60d0e64f/src/ArrayList.php#L73-L83 |
239,438 | dazarobbo/Cola | src/ArrayList.php | ArrayList.average | public function average(){
Number::setScale(static::NUMERIC_FUNCTIONS_SCALE);
return Number::divide($this->sum(), \strval($this->count()));
} | php | public function average(){
Number::setScale(static::NUMERIC_FUNCTIONS_SCALE);
return Number::divide($this->sum(), \strval($this->count()));
} | [
"public",
"function",
"average",
"(",
")",
"{",
"Number",
"::",
"setScale",
"(",
"static",
"::",
"NUMERIC_FUNCTIONS_SCALE",
")",
";",
"return",
"Number",
"::",
"divide",
"(",
"$",
"this",
"->",
"sum",
"(",
")",
",",
"\\",
"strval",
"(",
"$",
"this",
"-... | Computes the average value for a list of numbers
@return string | [
"Computes",
"the",
"average",
"value",
"for",
"a",
"list",
"of",
"numbers"
] | b101b73ebeb8a571345a303cbc75168f60d0e64f | https://github.com/dazarobbo/Cola/blob/b101b73ebeb8a571345a303cbc75168f60d0e64f/src/ArrayList.php#L89-L92 |
239,439 | dazarobbo/Cola | src/ArrayList.php | ArrayList.chunk | public function chunk($size){
$outer = new static();
$chunks = \array_chunk($this->_Arr, $size);
foreach($chunks as $chunk){
$outer->pushBack(new static($chunk));
}
return $outer;
} | php | public function chunk($size){
$outer = new static();
$chunks = \array_chunk($this->_Arr, $size);
foreach($chunks as $chunk){
$outer->pushBack(new static($chunk));
}
return $outer;
} | [
"public",
"function",
"chunk",
"(",
"$",
"size",
")",
"{",
"$",
"outer",
"=",
"new",
"static",
"(",
")",
";",
"$",
"chunks",
"=",
"\\",
"array_chunk",
"(",
"$",
"this",
"->",
"_Arr",
",",
"$",
"size",
")",
";",
"foreach",
"(",
"$",
"chunks",
"as"... | Divides this list into a list of smaller-chunked lists
@param int $size Size of each chunked list
@return \static | [
"Divides",
"this",
"list",
"into",
"a",
"list",
"of",
"smaller",
"-",
"chunked",
"lists"
] | b101b73ebeb8a571345a303cbc75168f60d0e64f | https://github.com/dazarobbo/Cola/blob/b101b73ebeb8a571345a303cbc75168f60d0e64f/src/ArrayList.php#L113-L124 |
239,440 | dazarobbo/Cola | src/ArrayList.php | ArrayList.concat | public function concat(ICollection $coll){
$arr = array();
$coll->copyTo($arr);
return new static(\array_merge($this->_Arr, \array_values($arr)));
} | php | public function concat(ICollection $coll){
$arr = array();
$coll->copyTo($arr);
return new static(\array_merge($this->_Arr, \array_values($arr)));
} | [
"public",
"function",
"concat",
"(",
"ICollection",
"$",
"coll",
")",
"{",
"$",
"arr",
"=",
"array",
"(",
")",
";",
"$",
"coll",
"->",
"copyTo",
"(",
"$",
"arr",
")",
";",
"return",
"new",
"static",
"(",
"\\",
"array_merge",
"(",
"$",
"this",
"->",... | Concatenates this list with an ICollection and returns a
new list
@param \Cola\ICollection $coll
@return \static | [
"Concatenates",
"this",
"list",
"with",
"an",
"ICollection",
"and",
"returns",
"a",
"new",
"list"
] | b101b73ebeb8a571345a303cbc75168f60d0e64f | https://github.com/dazarobbo/Cola/blob/b101b73ebeb8a571345a303cbc75168f60d0e64f/src/ArrayList.php#L149-L156 |
239,441 | dazarobbo/Cola | src/ArrayList.php | ArrayList.copy | public function copy($deep = true){
$arr = array();
foreach($this->_Arr as $key => $item){
$arr[$key] = $deep
? Functions\Object::copy($item)
: $item;
}
return new static($arr);
} | php | public function copy($deep = true){
$arr = array();
foreach($this->_Arr as $key => $item){
$arr[$key] = $deep
? Functions\Object::copy($item)
: $item;
}
return new static($arr);
} | [
"public",
"function",
"copy",
"(",
"$",
"deep",
"=",
"true",
")",
"{",
"$",
"arr",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"_Arr",
"as",
"$",
"key",
"=>",
"$",
"item",
")",
"{",
"$",
"arr",
"[",
"$",
"key",
"]",
"=",
... | Creates a copy of this list. By default, a deep-copy
is performed.
@param bool $deep True for deep copy, false for shallow
@return \static | [
"Creates",
"a",
"copy",
"of",
"this",
"list",
".",
"By",
"default",
"a",
"deep",
"-",
"copy",
"is",
"performed",
"."
] | b101b73ebeb8a571345a303cbc75168f60d0e64f | https://github.com/dazarobbo/Cola/blob/b101b73ebeb8a571345a303cbc75168f60d0e64f/src/ArrayList.php#L173-L185 |
239,442 | dazarobbo/Cola | src/ArrayList.php | ArrayList.copyTo | public function copyTo(array &$arr, $index = 0) {
if(!$this->offsetExists($index)){
throw new \OutOfRangeException('$index is invalid');
}
$arr = \array_slice($this->_Arr, $index);
return $this;
} | php | public function copyTo(array &$arr, $index = 0) {
if(!$this->offsetExists($index)){
throw new \OutOfRangeException('$index is invalid');
}
$arr = \array_slice($this->_Arr, $index);
return $this;
} | [
"public",
"function",
"copyTo",
"(",
"array",
"&",
"$",
"arr",
",",
"$",
"index",
"=",
"0",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"offsetExists",
"(",
"$",
"index",
")",
")",
"{",
"throw",
"new",
"\\",
"OutOfRangeException",
"(",
"'$index is i... | Copies this list to a given array by reference
@param array $arr destination
@param int $index Where to start copying, the start by default
@return \Cola\ArrayList | [
"Copies",
"this",
"list",
"to",
"a",
"given",
"array",
"by",
"reference"
] | b101b73ebeb8a571345a303cbc75168f60d0e64f | https://github.com/dazarobbo/Cola/blob/b101b73ebeb8a571345a303cbc75168f60d0e64f/src/ArrayList.php#L193-L203 |
239,443 | dazarobbo/Cola | src/ArrayList.php | ArrayList.intersect | public function intersect(ICollection $coll){
//array_intersect does not work on \Closure objects
$arr = array();
$coll->copyTo($arr);
$ret = array();
foreach($this->_Arr as $outerItem){
foreach($arr as $innerItem){
if($innerItem === $outerItem){
$ret[] = $outerItem;
break;
... | php | public function intersect(ICollection $coll){
//array_intersect does not work on \Closure objects
$arr = array();
$coll->copyTo($arr);
$ret = array();
foreach($this->_Arr as $outerItem){
foreach($arr as $innerItem){
if($innerItem === $outerItem){
$ret[] = $outerItem;
break;
... | [
"public",
"function",
"intersect",
"(",
"ICollection",
"$",
"coll",
")",
"{",
"//array_intersect does not work on \\Closure objects",
"$",
"arr",
"=",
"array",
"(",
")",
";",
"$",
"coll",
"->",
"copyTo",
"(",
"$",
"arr",
")",
";",
"$",
"ret",
"=",
"array",
... | Returns a new list with each element existing in
this list and a given ICollection
@param \Cola\ICollection $coll
@return \static | [
"Returns",
"a",
"new",
"list",
"with",
"each",
"element",
"existing",
"in",
"this",
"list",
"and",
"a",
"given",
"ICollection"
] | b101b73ebeb8a571345a303cbc75168f60d0e64f | https://github.com/dazarobbo/Cola/blob/b101b73ebeb8a571345a303cbc75168f60d0e64f/src/ArrayList.php#L283-L305 |
239,444 | dazarobbo/Cola | src/ArrayList.php | ArrayList.insert | public function insert($index, $value) {
if($this->_ReadOnly){
throw new ReadOnlyException(\get_called_class() . ' is read only');
}
//Permit 0-index insertion
if(!$this->offsetExists($index)){
throw new \OutOfRangeException('$index is invalid');
}
\array_splice($this->_Arr, $index, 0, array(... | php | public function insert($index, $value) {
if($this->_ReadOnly){
throw new ReadOnlyException(\get_called_class() . ' is read only');
}
//Permit 0-index insertion
if(!$this->offsetExists($index)){
throw new \OutOfRangeException('$index is invalid');
}
\array_splice($this->_Arr, $index, 0, array(... | [
"public",
"function",
"insert",
"(",
"$",
"index",
",",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_ReadOnly",
")",
"{",
"throw",
"new",
"ReadOnlyException",
"(",
"\\",
"get_called_class",
"(",
")",
".",
"' is read only'",
")",
";",
"}",
"/... | Inserts a value into the list at a given index
@param int $index
@param mixed $value
@return \Cola\ArrayList
@throws ReadOnlyException|\OutOfRangeException | [
"Inserts",
"a",
"value",
"into",
"the",
"list",
"at",
"a",
"given",
"index"
] | b101b73ebeb8a571345a303cbc75168f60d0e64f | https://github.com/dazarobbo/Cola/blob/b101b73ebeb8a571345a303cbc75168f60d0e64f/src/ArrayList.php#L332-L347 |
239,445 | dazarobbo/Cola | src/ArrayList.php | ArrayList.insertRange | public function insertRange($index, ICollection $coll){
if($this->_ReadOnly){
throw new \RuntimeException(\get_called_class() . ' is read only');
}
if(!$this->offsetExists($index)){
throw new \OutOfRangeException('$index is invalid');
}
$arr = array();
$coll->copyTo($arr);
\array_splice(... | php | public function insertRange($index, ICollection $coll){
if($this->_ReadOnly){
throw new \RuntimeException(\get_called_class() . ' is read only');
}
if(!$this->offsetExists($index)){
throw new \OutOfRangeException('$index is invalid');
}
$arr = array();
$coll->copyTo($arr);
\array_splice(... | [
"public",
"function",
"insertRange",
"(",
"$",
"index",
",",
"ICollection",
"$",
"coll",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_ReadOnly",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"\\",
"get_called_class",
"(",
")",
".",
"' is read only'... | Inserts a collection of items into the list at a given index
@param int $index
@param \Cola\ICollection $coll
@return \Cola\ArrayList
@throws ReadOnlyException|\OutOfRangeException | [
"Inserts",
"a",
"collection",
"of",
"items",
"into",
"the",
"list",
"at",
"a",
"given",
"index"
] | b101b73ebeb8a571345a303cbc75168f60d0e64f | https://github.com/dazarobbo/Cola/blob/b101b73ebeb8a571345a303cbc75168f60d0e64f/src/ArrayList.php#L356-L373 |
239,446 | dazarobbo/Cola | src/ArrayList.php | ArrayList.lastIndexOf | public function lastIndexOf($value){
$i = $this->count() - 1;
while($i >= 0 && $this->_Arr[$i] !== $value){
--$i;
}
return $i;
} | php | public function lastIndexOf($value){
$i = $this->count() - 1;
while($i >= 0 && $this->_Arr[$i] !== $value){
--$i;
}
return $i;
} | [
"public",
"function",
"lastIndexOf",
"(",
"$",
"value",
")",
"{",
"$",
"i",
"=",
"$",
"this",
"->",
"count",
"(",
")",
"-",
"1",
";",
"while",
"(",
"$",
"i",
">=",
"0",
"&&",
"$",
"this",
"->",
"_Arr",
"[",
"$",
"i",
"]",
"!==",
"$",
"value",... | Returns the index of the last matching value
@param mixed $value
@return int -1 if not found | [
"Returns",
"the",
"index",
"of",
"the",
"last",
"matching",
"value"
] | b101b73ebeb8a571345a303cbc75168f60d0e64f | https://github.com/dazarobbo/Cola/blob/b101b73ebeb8a571345a303cbc75168f60d0e64f/src/ArrayList.php#L406-L416 |
239,447 | dazarobbo/Cola | src/ArrayList.php | ArrayList.max | public function max(){
if($this->isEmpty()){
throw new \UnderflowException(\get_called_class() . ' is empty');
}
$max = $this->front();
for($i = 1, $l = $this->count(); $i < $l; ++$i){
if(Number::greaterThan($this->_Arr[$i], $max)){
$max = $this->_Arr[$i];
}
}
return $max;
} | php | public function max(){
if($this->isEmpty()){
throw new \UnderflowException(\get_called_class() . ' is empty');
}
$max = $this->front();
for($i = 1, $l = $this->count(); $i < $l; ++$i){
if(Number::greaterThan($this->_Arr[$i], $max)){
$max = $this->_Arr[$i];
}
}
return $max;
} | [
"public",
"function",
"max",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"\\",
"UnderflowException",
"(",
"\\",
"get_called_class",
"(",
")",
".",
"' is empty'",
")",
";",
"}",
"$",
"max",
"=",
"$",
"... | Returns the maximum value of this list. Result is undefined
for non numeric lists.
@return string
@throws \UnderflowException | [
"Returns",
"the",
"maximum",
"value",
"of",
"this",
"list",
".",
"Result",
"is",
"undefined",
"for",
"non",
"numeric",
"lists",
"."
] | b101b73ebeb8a571345a303cbc75168f60d0e64f | https://github.com/dazarobbo/Cola/blob/b101b73ebeb8a571345a303cbc75168f60d0e64f/src/ArrayList.php#L434-L450 |
239,448 | dazarobbo/Cola | src/ArrayList.php | ArrayList.min | public function min(){
if($this->isEmpty()){
throw new \UnderflowException(\get_called_class() . ' is empty');
}
$min = $this->front();
for($i = 1, $l = $this->count(); $i < $l; ++$i){
if(Number::lessThan($this->_Arr[$i], $min)){
$min = $this->_Arr[$i];
}
}
return $min;
} | php | public function min(){
if($this->isEmpty()){
throw new \UnderflowException(\get_called_class() . ' is empty');
}
$min = $this->front();
for($i = 1, $l = $this->count(); $i < $l; ++$i){
if(Number::lessThan($this->_Arr[$i], $min)){
$min = $this->_Arr[$i];
}
}
return $min;
} | [
"public",
"function",
"min",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"\\",
"UnderflowException",
"(",
"\\",
"get_called_class",
"(",
")",
".",
"' is empty'",
")",
";",
"}",
"$",
"min",
"=",
"$",
"... | Returns the minimum value of this list. Result is undefined
for non numeric lists.
@return string
@throws \UnderflowException | [
"Returns",
"the",
"minimum",
"value",
"of",
"this",
"list",
".",
"Result",
"is",
"undefined",
"for",
"non",
"numeric",
"lists",
"."
] | b101b73ebeb8a571345a303cbc75168f60d0e64f | https://github.com/dazarobbo/Cola/blob/b101b73ebeb8a571345a303cbc75168f60d0e64f/src/ArrayList.php#L458-L474 |
239,449 | dazarobbo/Cola | src/ArrayList.php | ArrayList.popBack | public function popBack(){
if($this->_ReadOnly){
throw new ReadOnlyException(\get_called_class() . ' is read only');
}
if($this->isEmpty()){
throw new \UnderflowException(\get_called_class() . ' is empty');
}
return \array_pop($this->_Arr);
} | php | public function popBack(){
if($this->_ReadOnly){
throw new ReadOnlyException(\get_called_class() . ' is read only');
}
if($this->isEmpty()){
throw new \UnderflowException(\get_called_class() . ' is empty');
}
return \array_pop($this->_Arr);
} | [
"public",
"function",
"popBack",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_ReadOnly",
")",
"{",
"throw",
"new",
"ReadOnlyException",
"(",
"\\",
"get_called_class",
"(",
")",
".",
"' is read only'",
")",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"isE... | Removes and returns the last element of the list
@return mixed
@throws ReadOnlyException | [
"Removes",
"and",
"returns",
"the",
"last",
"element",
"of",
"the",
"list"
] | b101b73ebeb8a571345a303cbc75168f60d0e64f | https://github.com/dazarobbo/Cola/blob/b101b73ebeb8a571345a303cbc75168f60d0e64f/src/ArrayList.php#L529-L541 |
239,450 | dazarobbo/Cola | src/ArrayList.php | ArrayList.popFront | public function popFront(){
if($this->_ReadOnly){
throw new ReadOnlyException(\get_called_class() . ' is read only');
}
if($this->isEmpty()){
throw new \UnderflowException(\get_called_class() . ' is empty');
}
return \array_shift($this->_Arr);
} | php | public function popFront(){
if($this->_ReadOnly){
throw new ReadOnlyException(\get_called_class() . ' is read only');
}
if($this->isEmpty()){
throw new \UnderflowException(\get_called_class() . ' is empty');
}
return \array_shift($this->_Arr);
} | [
"public",
"function",
"popFront",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_ReadOnly",
")",
"{",
"throw",
"new",
"ReadOnlyException",
"(",
"\\",
"get_called_class",
"(",
")",
".",
"' is read only'",
")",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"is... | Removes and returns the first element of the list
@return mixed
@throws ReadOnlyException | [
"Removes",
"and",
"returns",
"the",
"first",
"element",
"of",
"the",
"list"
] | b101b73ebeb8a571345a303cbc75168f60d0e64f | https://github.com/dazarobbo/Cola/blob/b101b73ebeb8a571345a303cbc75168f60d0e64f/src/ArrayList.php#L548-L560 |
239,451 | dazarobbo/Cola | src/ArrayList.php | ArrayList.product | public function product(){
Number::setScale(static::NUMERIC_FUNCTIONS_SCALE);
$total = \strval($this->front());
for($i = 1, $l = $this->count(); $i < $l; ++$i){
$total = Number::multiply($total, \strval($this->_Arr[$i]));
}
return $total;
} | php | public function product(){
Number::setScale(static::NUMERIC_FUNCTIONS_SCALE);
$total = \strval($this->front());
for($i = 1, $l = $this->count(); $i < $l; ++$i){
$total = Number::multiply($total, \strval($this->_Arr[$i]));
}
return $total;
} | [
"public",
"function",
"product",
"(",
")",
"{",
"Number",
"::",
"setScale",
"(",
"static",
"::",
"NUMERIC_FUNCTIONS_SCALE",
")",
";",
"$",
"total",
"=",
"\\",
"strval",
"(",
"$",
"this",
"->",
"front",
"(",
")",
")",
";",
"for",
"(",
"$",
"i",
"=",
... | Computes the product of a list of numbers
@return string | [
"Computes",
"the",
"product",
"of",
"a",
"list",
"of",
"numbers"
] | b101b73ebeb8a571345a303cbc75168f60d0e64f | https://github.com/dazarobbo/Cola/blob/b101b73ebeb8a571345a303cbc75168f60d0e64f/src/ArrayList.php#L566-L578 |
239,452 | dazarobbo/Cola | src/ArrayList.php | ArrayList.pushBack | public function pushBack(){
if($this->_ReadOnly){
throw new ReadOnlyException(\get_called_class() . ' is read only');
}
$this->_Arr = \array_merge($this->_Arr, \func_get_args());
return $this;
} | php | public function pushBack(){
if($this->_ReadOnly){
throw new ReadOnlyException(\get_called_class() . ' is read only');
}
$this->_Arr = \array_merge($this->_Arr, \func_get_args());
return $this;
} | [
"public",
"function",
"pushBack",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_ReadOnly",
")",
"{",
"throw",
"new",
"ReadOnlyException",
"(",
"\\",
"get_called_class",
"(",
")",
".",
"' is read only'",
")",
";",
"}",
"$",
"this",
"->",
"_Arr",
"=",
"... | Adds items to the end of this list. Multiple arguments can be given.
@return \Cola\ArrayList
@throws ReadOnlyException | [
"Adds",
"items",
"to",
"the",
"end",
"of",
"this",
"list",
".",
"Multiple",
"arguments",
"can",
"be",
"given",
"."
] | b101b73ebeb8a571345a303cbc75168f60d0e64f | https://github.com/dazarobbo/Cola/blob/b101b73ebeb8a571345a303cbc75168f60d0e64f/src/ArrayList.php#L585-L595 |
239,453 | dazarobbo/Cola | src/ArrayList.php | ArrayList.pushFront | public function pushFront(){
if($this->_ReadOnly){
throw new ReadOnlyException(\get_called_class() . ' is read only');
}
$this->_Arr = \array_merge(\func_get_args(), $this->_Arr);
return $this;
} | php | public function pushFront(){
if($this->_ReadOnly){
throw new ReadOnlyException(\get_called_class() . ' is read only');
}
$this->_Arr = \array_merge(\func_get_args(), $this->_Arr);
return $this;
} | [
"public",
"function",
"pushFront",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_ReadOnly",
")",
"{",
"throw",
"new",
"ReadOnlyException",
"(",
"\\",
"get_called_class",
"(",
")",
".",
"' is read only'",
")",
";",
"}",
"$",
"this",
"->",
"_Arr",
"=",
... | Adds items to the beginning of this list. Multiple arguments can be given.
@return \Cola\ArrayList
@throws ReadOnlyException | [
"Adds",
"items",
"to",
"the",
"beginning",
"of",
"this",
"list",
".",
"Multiple",
"arguments",
"can",
"be",
"given",
"."
] | b101b73ebeb8a571345a303cbc75168f60d0e64f | https://github.com/dazarobbo/Cola/blob/b101b73ebeb8a571345a303cbc75168f60d0e64f/src/ArrayList.php#L602-L612 |
239,454 | dazarobbo/Cola | src/ArrayList.php | ArrayList.& | public function &random(){
if($this->isEmpty()){
throw new \UnderflowException(\get_called_class() . ' is empty');
}
return $this->_Arr[\array_rand($this->_Arr, 1)];
} | php | public function &random(){
if($this->isEmpty()){
throw new \UnderflowException(\get_called_class() . ' is empty');
}
return $this->_Arr[\array_rand($this->_Arr, 1)];
} | [
"public",
"function",
"&",
"random",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"\\",
"UnderflowException",
"(",
"\\",
"get_called_class",
"(",
")",
".",
"' is empty'",
")",
";",
"}",
"return",
"$",
"t... | Returns a reference to a random item from the list
@return mixed | [
"Returns",
"a",
"reference",
"to",
"a",
"random",
"item",
"from",
"the",
"list"
] | b101b73ebeb8a571345a303cbc75168f60d0e64f | https://github.com/dazarobbo/Cola/blob/b101b73ebeb8a571345a303cbc75168f60d0e64f/src/ArrayList.php#L618-L626 |
239,455 | dazarobbo/Cola | src/ArrayList.php | ArrayList.readOnly | public function readOnly($bool = true){
$list = $this->copy(false);
$list->setReadOnly();
return $list;
} | php | public function readOnly($bool = true){
$list = $this->copy(false);
$list->setReadOnly();
return $list;
} | [
"public",
"function",
"readOnly",
"(",
"$",
"bool",
"=",
"true",
")",
"{",
"$",
"list",
"=",
"$",
"this",
"->",
"copy",
"(",
"false",
")",
";",
"$",
"list",
"->",
"setReadOnly",
"(",
")",
";",
"return",
"$",
"list",
";",
"}"
] | Creates a shallow copy of this list and sets it to read only
@param bool $bool
@return \static | [
"Creates",
"a",
"shallow",
"copy",
"of",
"this",
"list",
"and",
"sets",
"it",
"to",
"read",
"only"
] | b101b73ebeb8a571345a303cbc75168f60d0e64f | https://github.com/dazarobbo/Cola/blob/b101b73ebeb8a571345a303cbc75168f60d0e64f/src/ArrayList.php#L633-L637 |
239,456 | dazarobbo/Cola | src/ArrayList.php | ArrayList.remove | public function remove($value) {
if($this->_ReadOnly){
throw new ReadOnlyException(\get_called_class() . ' is read only');
}
if(($key = \array_search($value, $this->_Arr)) !== false){
\array_splice($this->_Arr, $key, 1);
}
return $this;
} | php | public function remove($value) {
if($this->_ReadOnly){
throw new ReadOnlyException(\get_called_class() . ' is read only');
}
if(($key = \array_search($value, $this->_Arr)) !== false){
\array_splice($this->_Arr, $key, 1);
}
return $this;
} | [
"public",
"function",
"remove",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_ReadOnly",
")",
"{",
"throw",
"new",
"ReadOnlyException",
"(",
"\\",
"get_called_class",
"(",
")",
".",
"' is read only'",
")",
";",
"}",
"if",
"(",
"(",
"$",
... | Removes the first matching value from the list
@param mixed $value
@return \Cola\ArrayList
@throws ReadOnlyException | [
"Removes",
"the",
"first",
"matching",
"value",
"from",
"the",
"list"
] | b101b73ebeb8a571345a303cbc75168f60d0e64f | https://github.com/dazarobbo/Cola/blob/b101b73ebeb8a571345a303cbc75168f60d0e64f/src/ArrayList.php#L645-L657 |
239,457 | dazarobbo/Cola | src/ArrayList.php | ArrayList.removeAt | public function removeAt($index) {
if($this->_ReadOnly){
throw new \RuntimeException(\get_called_class() . ' is read only');
}
if(!$this->offsetExists($index)){
throw new \OutOfRangeException('$index is invalid');
}
\array_splice($this->_Arr, $index, 1);
return $this;
} | php | public function removeAt($index) {
if($this->_ReadOnly){
throw new \RuntimeException(\get_called_class() . ' is read only');
}
if(!$this->offsetExists($index)){
throw new \OutOfRangeException('$index is invalid');
}
\array_splice($this->_Arr, $index, 1);
return $this;
} | [
"public",
"function",
"removeAt",
"(",
"$",
"index",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_ReadOnly",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"\\",
"get_called_class",
"(",
")",
".",
"' is read only'",
")",
";",
"}",
"if",
"(",
"!"... | Removes a value at the given index
@param int $index
@return \Cola\ArrayList
@throws ReadOnlyException|\OutOfRangeException | [
"Removes",
"a",
"value",
"at",
"the",
"given",
"index"
] | b101b73ebeb8a571345a303cbc75168f60d0e64f | https://github.com/dazarobbo/Cola/blob/b101b73ebeb8a571345a303cbc75168f60d0e64f/src/ArrayList.php#L665-L679 |
239,458 | dazarobbo/Cola | src/ArrayList.php | ArrayList.resize | public function resize($size, $value = null){
if($this->_ReadOnly){
throw new ReadOnlyException(\get_called_class() . ' is read only');
}
if(!\is_int($size)){
throw new \InvalidArgumentException('$size is not an int');
}
if($size < 0){
throw new \OutOfBoundsException('$size cannot be less th... | php | public function resize($size, $value = null){
if($this->_ReadOnly){
throw new ReadOnlyException(\get_called_class() . ' is read only');
}
if(!\is_int($size)){
throw new \InvalidArgumentException('$size is not an int');
}
if($size < 0){
throw new \OutOfBoundsException('$size cannot be less th... | [
"public",
"function",
"resize",
"(",
"$",
"size",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_ReadOnly",
")",
"{",
"throw",
"new",
"ReadOnlyException",
"(",
"\\",
"get_called_class",
"(",
")",
".",
"' is read only'",
")",
... | Resizes this list to a given size. Expanding the list will
pad it with a value. Contracting the list cuts off extraneous
values.
@param int $size
@param mixed $value
@return \Cola\ArrayList
@throws ReadOnlyException
@throws \InvalidArgumentException
@throws \OutOfBoundsException | [
"Resizes",
"this",
"list",
"to",
"a",
"given",
"size",
".",
"Expanding",
"the",
"list",
"will",
"pad",
"it",
"with",
"a",
"value",
".",
"Contracting",
"the",
"list",
"cuts",
"off",
"extraneous",
"values",
"."
] | b101b73ebeb8a571345a303cbc75168f60d0e64f | https://github.com/dazarobbo/Cola/blob/b101b73ebeb8a571345a303cbc75168f60d0e64f/src/ArrayList.php#L734-L759 |
239,459 | dazarobbo/Cola | src/ArrayList.php | ArrayList.reverse | public function reverse(){
if($this->_ReadOnly){
throw new ReadOnlyException(\get_called_class() . ' is read only');
}
$this->_Arr = \array_reverse($this->_Arr);
return $this;
} | php | public function reverse(){
if($this->_ReadOnly){
throw new ReadOnlyException(\get_called_class() . ' is read only');
}
$this->_Arr = \array_reverse($this->_Arr);
return $this;
} | [
"public",
"function",
"reverse",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_ReadOnly",
")",
"{",
"throw",
"new",
"ReadOnlyException",
"(",
"\\",
"get_called_class",
"(",
")",
".",
"' is read only'",
")",
";",
"}",
"$",
"this",
"->",
"_Arr",
"=",
"\... | Reverses this list
@return \Cola\ArrayList
@throws ReadOnlyException | [
"Reverses",
"this",
"list"
] | b101b73ebeb8a571345a303cbc75168f60d0e64f | https://github.com/dazarobbo/Cola/blob/b101b73ebeb8a571345a303cbc75168f60d0e64f/src/ArrayList.php#L766-L776 |
239,460 | dazarobbo/Cola | src/ArrayList.php | ArrayList.sentinelSearch | public function sentinelSearch($value){
$l = $this->count();
$arr = $this->_Arr;
$arr[$l] = $value;
$i = 0;
while($arr[$i] !== $value){
++$i;
}
return $i !== $l ? $i : static::NO_INDEX;
} | php | public function sentinelSearch($value){
$l = $this->count();
$arr = $this->_Arr;
$arr[$l] = $value;
$i = 0;
while($arr[$i] !== $value){
++$i;
}
return $i !== $l ? $i : static::NO_INDEX;
} | [
"public",
"function",
"sentinelSearch",
"(",
"$",
"value",
")",
"{",
"$",
"l",
"=",
"$",
"this",
"->",
"count",
"(",
")",
";",
"$",
"arr",
"=",
"$",
"this",
"->",
"_Arr",
";",
"$",
"arr",
"[",
"$",
"l",
"]",
"=",
"$",
"value",
";",
"$",
"i",
... | Performs a sentinel search for a value
@param mixed $value
@return int -1 for no match | [
"Performs",
"a",
"sentinel",
"search",
"for",
"a",
"value"
] | b101b73ebeb8a571345a303cbc75168f60d0e64f | https://github.com/dazarobbo/Cola/blob/b101b73ebeb8a571345a303cbc75168f60d0e64f/src/ArrayList.php#L783-L796 |
239,461 | dazarobbo/Cola | src/ArrayList.php | ArrayList.slice | public function slice($index, $count = null){
if(!$this->offsetExists($index)){
throw new \OutOfRangeException('$index is invalid');
}
$arr = \array_slice($this->_Arr, $index, $count);
return new static($arr);
} | php | public function slice($index, $count = null){
if(!$this->offsetExists($index)){
throw new \OutOfRangeException('$index is invalid');
}
$arr = \array_slice($this->_Arr, $index, $count);
return new static($arr);
} | [
"public",
"function",
"slice",
"(",
"$",
"index",
",",
"$",
"count",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"offsetExists",
"(",
"$",
"index",
")",
")",
"{",
"throw",
"new",
"\\",
"OutOfRangeException",
"(",
"'$index is invalid'",
")... | Creates a new list from a subset of this list
@param int $index index to start the subset at
@param int $count number of items to include
@throws \OutOfRangeException
@return \static | [
"Creates",
"a",
"new",
"list",
"from",
"a",
"subset",
"of",
"this",
"list"
] | b101b73ebeb8a571345a303cbc75168f60d0e64f | https://github.com/dazarobbo/Cola/blob/b101b73ebeb8a571345a303cbc75168f60d0e64f/src/ArrayList.php#L813-L822 |
239,462 | dazarobbo/Cola | src/ArrayList.php | ArrayList.sort | public function sort(\Closure $compare = null){
if($this->_ReadOnly){
throw new ReadOnlyException(\get_called_class() . ' is read only');
}
if(\is_callable($compare)){
\usort($this->_Arr, $compare);
}
else{
\sort($this->_Arr);
}
return $this;
} | php | public function sort(\Closure $compare = null){
if($this->_ReadOnly){
throw new ReadOnlyException(\get_called_class() . ' is read only');
}
if(\is_callable($compare)){
\usort($this->_Arr, $compare);
}
else{
\sort($this->_Arr);
}
return $this;
} | [
"public",
"function",
"sort",
"(",
"\\",
"Closure",
"$",
"compare",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_ReadOnly",
")",
"{",
"throw",
"new",
"ReadOnlyException",
"(",
"\\",
"get_called_class",
"(",
")",
".",
"' is read only'",
")",
";"... | Sorts this list, optionally by a user defined compare function
@param \Closure $compare
@return \Cola\ArrayList
@throws ReadOnlyException | [
"Sorts",
"this",
"list",
"optionally",
"by",
"a",
"user",
"defined",
"compare",
"function"
] | b101b73ebeb8a571345a303cbc75168f60d0e64f | https://github.com/dazarobbo/Cola/blob/b101b73ebeb8a571345a303cbc75168f60d0e64f/src/ArrayList.php#L839-L854 |
239,463 | dazarobbo/Cola | src/ArrayList.php | ArrayList.sum | public function sum(){
Number::setScale(static::NUMERIC_FUNCTIONS_SCALE);
$total = '0';
foreach($this->_Arr as $item){
$total = Number::add($total, \strval($item));
}
return $total;
} | php | public function sum(){
Number::setScale(static::NUMERIC_FUNCTIONS_SCALE);
$total = '0';
foreach($this->_Arr as $item){
$total = Number::add($total, \strval($item));
}
return $total;
} | [
"public",
"function",
"sum",
"(",
")",
"{",
"Number",
"::",
"setScale",
"(",
"static",
"::",
"NUMERIC_FUNCTIONS_SCALE",
")",
";",
"$",
"total",
"=",
"'0'",
";",
"foreach",
"(",
"$",
"this",
"->",
"_Arr",
"as",
"$",
"item",
")",
"{",
"$",
"total",
"="... | Computes the sum of all numbers in this list
@return string | [
"Computes",
"the",
"sum",
"of",
"all",
"numbers",
"in",
"this",
"list"
] | b101b73ebeb8a571345a303cbc75168f60d0e64f | https://github.com/dazarobbo/Cola/blob/b101b73ebeb8a571345a303cbc75168f60d0e64f/src/ArrayList.php#L860-L872 |
239,464 | dazarobbo/Cola | src/ArrayList.php | ArrayList.stdDev | public function stdDev(){
Number::setScale(static::NUMERIC_FUNCTIONS_SCALE);
$mean = $this->average();
$squares = new static();
foreach($this->_Arr as $num){
$squares->add(Number::pow(Number::sub(\strval($num), $mean), '2'));
}
return Number::sqrt($squares->average());
} | php | public function stdDev(){
Number::setScale(static::NUMERIC_FUNCTIONS_SCALE);
$mean = $this->average();
$squares = new static();
foreach($this->_Arr as $num){
$squares->add(Number::pow(Number::sub(\strval($num), $mean), '2'));
}
return Number::sqrt($squares->average());
} | [
"public",
"function",
"stdDev",
"(",
")",
"{",
"Number",
"::",
"setScale",
"(",
"static",
"::",
"NUMERIC_FUNCTIONS_SCALE",
")",
";",
"$",
"mean",
"=",
"$",
"this",
"->",
"average",
"(",
")",
";",
"$",
"squares",
"=",
"new",
"static",
"(",
")",
";",
"... | Computes the population standard deviation for the numbers
in this list
@return string | [
"Computes",
"the",
"population",
"standard",
"deviation",
"for",
"the",
"numbers",
"in",
"this",
"list"
] | b101b73ebeb8a571345a303cbc75168f60d0e64f | https://github.com/dazarobbo/Cola/blob/b101b73ebeb8a571345a303cbc75168f60d0e64f/src/ArrayList.php#L879-L892 |
239,465 | dazarobbo/Cola | src/ArrayList.php | ArrayList.unique | public function unique(\Closure $compare = null){
if(\is_callable($compare)){
$arr = new static();
$this->each(function($outerItem) use (&$arr, $compare){
if(!$arr->some(function($cmpItem) use ($outerItem, $compare){
return $compare($outerItem, $cmpItem);
})){
$arr->_Arr[] = $o... | php | public function unique(\Closure $compare = null){
if(\is_callable($compare)){
$arr = new static();
$this->each(function($outerItem) use (&$arr, $compare){
if(!$arr->some(function($cmpItem) use ($outerItem, $compare){
return $compare($outerItem, $cmpItem);
})){
$arr->_Arr[] = $o... | [
"public",
"function",
"unique",
"(",
"\\",
"Closure",
"$",
"compare",
"=",
"null",
")",
"{",
"if",
"(",
"\\",
"is_callable",
"(",
"$",
"compare",
")",
")",
"{",
"$",
"arr",
"=",
"new",
"static",
"(",
")",
";",
"$",
"this",
"->",
"each",
"(",
"fun... | Eliminates duplicate values from this list, optionally according
to a user defined compare function
@param \Closure $compare
@return \static | [
"Eliminates",
"duplicate",
"values",
"from",
"this",
"list",
"optionally",
"according",
"to",
"a",
"user",
"defined",
"compare",
"function"
] | b101b73ebeb8a571345a303cbc75168f60d0e64f | https://github.com/dazarobbo/Cola/blob/b101b73ebeb8a571345a303cbc75168f60d0e64f/src/ArrayList.php#L908-L932 |
239,466 | BlackBoxRepo/PandoContentBundle | Service/MethodService.php | MethodService.call | public function call(MethodArgumentDocument $methodArgument)
{
$serviceName = $methodArgument->getMethod()->getService()->getServiceName();
$service = $this->container->get($serviceName);
if (null === $service) {
throw new UndefinedServiceException(sprintf('"%s" is not a service'... | php | public function call(MethodArgumentDocument $methodArgument)
{
$serviceName = $methodArgument->getMethod()->getService()->getServiceName();
$service = $this->container->get($serviceName);
if (null === $service) {
throw new UndefinedServiceException(sprintf('"%s" is not a service'... | [
"public",
"function",
"call",
"(",
"MethodArgumentDocument",
"$",
"methodArgument",
")",
"{",
"$",
"serviceName",
"=",
"$",
"methodArgument",
"->",
"getMethod",
"(",
")",
"->",
"getService",
"(",
")",
"->",
"getServiceName",
"(",
")",
";",
"$",
"service",
"=... | Executes the passed in method via the associated service that's retrieved from the container.
This gets called recursively to supply all the arguments for each given method.
@param MethodArgumentDocument $methodArgument
@throws WrongNumberOfArgumentsException if we have more or less arguments than the method requires... | [
"Executes",
"the",
"passed",
"in",
"method",
"via",
"the",
"associated",
"service",
"that",
"s",
"retrieved",
"from",
"the",
"container",
".",
"This",
"gets",
"called",
"recursively",
"to",
"supply",
"all",
"the",
"arguments",
"for",
"each",
"given",
"method",... | fa54d0c7542c1d359a5dbb4f32dab3e195e41007 | https://github.com/BlackBoxRepo/PandoContentBundle/blob/fa54d0c7542c1d359a5dbb4f32dab3e195e41007/Service/MethodService.php#L44-L72 |
239,467 | Palmabit-IT/authenticator | src/Palmabit/Authentication/Helpers/SentryAuthenticationHelper.php | SentryAuthenticationHelper.checkProfileEditPermission | public function checkProfileEditPermission($user_id) {
$current_user_id = App::make('sentry')->getUser()->id;
// edit his profile
if ($user_id == $current_user_id) {
return true;
}
// has special permission to edit other user profiles
$edit_perm = Config::get('authentication::permissions.... | php | public function checkProfileEditPermission($user_id) {
$current_user_id = App::make('sentry')->getUser()->id;
// edit his profile
if ($user_id == $current_user_id) {
return true;
}
// has special permission to edit other user profiles
$edit_perm = Config::get('authentication::permissions.... | [
"public",
"function",
"checkProfileEditPermission",
"(",
"$",
"user_id",
")",
"{",
"$",
"current_user_id",
"=",
"App",
"::",
"make",
"(",
"'sentry'",
")",
"->",
"getUser",
"(",
")",
"->",
"id",
";",
"// edit his profile",
"if",
"(",
"$",
"user_id",
"==",
"... | Check if the current user has permission to edit the profile
@return boolean | [
"Check",
"if",
"the",
"current",
"user",
"has",
"permission",
"to",
"edit",
"the",
"profile"
] | 986cfc7e666e0e1b0312e518d586ec61b08cdb42 | https://github.com/Palmabit-IT/authenticator/blob/986cfc7e666e0e1b0312e518d586ec61b08cdb42/src/Palmabit/Authentication/Helpers/SentryAuthenticationHelper.php#L38-L52 |
239,468 | Palmabit-IT/authenticator | src/Palmabit/Authentication/Helpers/SentryAuthenticationHelper.php | SentryAuthenticationHelper.getNotificationRegistrationUsersEmail | public function getNotificationRegistrationUsersEmail() {
$group_name = Config::get('authentication::permissions.profile_notification_group');
$user_r = App::make('user_repository');
$users = $user_r->findFromGroupName($group_name)->lists('email');
return $users;
} | php | public function getNotificationRegistrationUsersEmail() {
$group_name = Config::get('authentication::permissions.profile_notification_group');
$user_r = App::make('user_repository');
$users = $user_r->findFromGroupName($group_name)->lists('email');
return $users;
} | [
"public",
"function",
"getNotificationRegistrationUsersEmail",
"(",
")",
"{",
"$",
"group_name",
"=",
"Config",
"::",
"get",
"(",
"'authentication::permissions.profile_notification_group'",
")",
";",
"$",
"user_r",
"=",
"App",
"::",
"make",
"(",
"'user_repository'",
"... | Obtain the user that needs to be notificated on registration
@return array | [
"Obtain",
"the",
"user",
"that",
"needs",
"to",
"be",
"notificated",
"on",
"registration"
] | 986cfc7e666e0e1b0312e518d586ec61b08cdb42 | https://github.com/Palmabit-IT/authenticator/blob/986cfc7e666e0e1b0312e518d586ec61b08cdb42/src/Palmabit/Authentication/Helpers/SentryAuthenticationHelper.php#L59-L65 |
239,469 | opsbears/piccolo-templating | src/TemplatingModule.php | TemplatingModule.addTemplatingEngineClass | public function addTemplatingEngineClass(array &$globalConfig, string $templateEngineClass) {
$globalConfig[$this->getModuleKey()][self::CONFIG_ENGINES][] = $templateEngineClass;
} | php | public function addTemplatingEngineClass(array &$globalConfig, string $templateEngineClass) {
$globalConfig[$this->getModuleKey()][self::CONFIG_ENGINES][] = $templateEngineClass;
} | [
"public",
"function",
"addTemplatingEngineClass",
"(",
"array",
"&",
"$",
"globalConfig",
",",
"string",
"$",
"templateEngineClass",
")",
"{",
"$",
"globalConfig",
"[",
"$",
"this",
"->",
"getModuleKey",
"(",
")",
"]",
"[",
"self",
"::",
"CONFIG_ENGINES",
"]",... | Adds a class as a possible template engine. This must be done before the configureDependencyInjection function
is called.
@param array $globalConfig
@param string $templateEngineClass
@throws ConfigurationException if the DIC configuration phase has already finished. | [
"Adds",
"a",
"class",
"as",
"a",
"possible",
"template",
"engine",
".",
"This",
"must",
"be",
"done",
"before",
"the",
"configureDependencyInjection",
"function",
"is",
"called",
"."
] | b5faeb2fc4c8f2b003aa5edb245f9559cd0101c3 | https://github.com/opsbears/piccolo-templating/blob/b5faeb2fc4c8f2b003aa5edb245f9559cd0101c3/src/TemplatingModule.php#L47-L49 |
239,470 | opsbears/piccolo-templating | src/TemplatingModule.php | TemplatingModule.configureDependencyInjection | public function configureDependencyInjection(DependencyInjectionContainer $dic,
array $moduleConfig,
array $globalConfig) {
/**
* @var TemplateEngine[] $engines
*/
$engines = [];
if (empty($moduleConfig[self::CONFIG_ENGINES])) {
throw new ConfigurationException('The templating m... | php | public function configureDependencyInjection(DependencyInjectionContainer $dic,
array $moduleConfig,
array $globalConfig) {
/**
* @var TemplateEngine[] $engines
*/
$engines = [];
if (empty($moduleConfig[self::CONFIG_ENGINES])) {
throw new ConfigurationException('The templating m... | [
"public",
"function",
"configureDependencyInjection",
"(",
"DependencyInjectionContainer",
"$",
"dic",
",",
"array",
"$",
"moduleConfig",
",",
"array",
"$",
"globalConfig",
")",
"{",
"/**\n\t\t * @var TemplateEngine[] $engines\n\t\t */",
"$",
"engines",
"=",
"[",
"]",
"... | Configures the TemplateRenderingChain with the previously registered templating engines.
@param DependencyInjectionContainer $dic
@param array $moduleConfig
@param array $globalConfig
@throws ConfigurationException if no templating module was loaded. | [
"Configures",
"the",
"TemplateRenderingChain",
"with",
"the",
"previously",
"registered",
"templating",
"engines",
"."
] | b5faeb2fc4c8f2b003aa5edb245f9559cd0101c3 | https://github.com/opsbears/piccolo-templating/blob/b5faeb2fc4c8f2b003aa5edb245f9559cd0101c3/src/TemplatingModule.php#L72-L112 |
239,471 | cawaphp/serializer | src/Serializer.php | Serializer.serializeObject | private function serializeObject($object, string $className = null)
{
if (is_null($className)) {
$index = array_search($object, $this->references, true);
if ($index !== false) {
$this->referencesUsed[] = $index;
return ['@ref' => $index];
... | php | private function serializeObject($object, string $className = null)
{
if (is_null($className)) {
$index = array_search($object, $this->references, true);
if ($index !== false) {
$this->referencesUsed[] = $index;
return ['@ref' => $index];
... | [
"private",
"function",
"serializeObject",
"(",
"$",
"object",
",",
"string",
"$",
"className",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"className",
")",
")",
"{",
"$",
"index",
"=",
"array_search",
"(",
"$",
"object",
",",
"$",
"this",
... | Recursive serialize.
@param object $object
@param string $className
@return array | [
"Recursive",
"serialize",
"."
] | dedf2206d6a617086321060429c2c9bb227ffc71 | https://github.com/cawaphp/serializer/blob/dedf2206d6a617086321060429c2c9bb227ffc71/src/Serializer.php#L77-L136 |
239,472 | cawaphp/serializer | src/Serializer.php | Serializer.unserializeObject | private function unserializeObject($object, &$data, string $className = null) : array
{
$reflectionClass = new \ReflectionClass($className ? $className : $object);
unset($data['@type']);
// parent class
$parent = $reflectionClass->getParentClass();
if ($parent) {
... | php | private function unserializeObject($object, &$data, string $className = null) : array
{
$reflectionClass = new \ReflectionClass($className ? $className : $object);
unset($data['@type']);
// parent class
$parent = $reflectionClass->getParentClass();
if ($parent) {
... | [
"private",
"function",
"unserializeObject",
"(",
"$",
"object",
",",
"&",
"$",
"data",
",",
"string",
"$",
"className",
"=",
"null",
")",
":",
"array",
"{",
"$",
"reflectionClass",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"className",
"?",
"$",
"cl... | Recursive unserialize to get parent class property.
@param object $object
@param array $data
@param string $className
@return array | [
"Recursive",
"unserialize",
"to",
"get",
"parent",
"class",
"property",
"."
] | dedf2206d6a617086321060429c2c9bb227ffc71 | https://github.com/cawaphp/serializer/blob/dedf2206d6a617086321060429c2c9bb227ffc71/src/Serializer.php#L171-L237 |
239,473 | EarthlingInteractive/PHPCMIPREST | lib/EarthIT/CMIPREST/ResultAssembler/JAOResultAssembler.php | EarthIT_CMIPREST_ResultAssembler_JAOResultAssembler._q45 | protected function _q45( EarthIT_Schema_ResourceClass $rc, array $items ) {
$restObjects = array();
foreach( $items as $item ) {
$restObjects[] = $this->internalObjectToJao($rc, $item);
}
return $restObjects;
} | php | protected function _q45( EarthIT_Schema_ResourceClass $rc, array $items ) {
$restObjects = array();
foreach( $items as $item ) {
$restObjects[] = $this->internalObjectToJao($rc, $item);
}
return $restObjects;
} | [
"protected",
"function",
"_q45",
"(",
"EarthIT_Schema_ResourceClass",
"$",
"rc",
",",
"array",
"$",
"items",
")",
"{",
"$",
"restObjects",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"items",
"as",
"$",
"item",
")",
"{",
"$",
"restObjects",
"[",
... | Convert the given rows from internal to REST format according to the
specified resource class. | [
"Convert",
"the",
"given",
"rows",
"from",
"internal",
"to",
"REST",
"format",
"according",
"to",
"the",
"specified",
"resource",
"class",
"."
] | db0398ea4fc07fa62f2de9ba43f2f3137170d9f0 | https://github.com/EarthlingInteractive/PHPCMIPREST/blob/db0398ea4fc07fa62f2de9ba43f2f3137170d9f0/lib/EarthIT/CMIPREST/ResultAssembler/JAOResultAssembler.php#L101-L107 |
239,474 | jfortunato/fortune | src/ResourceFactory.php | ResourceFactory.newSimpleOutput | public function newSimpleOutput()
{
$config = $this->config->getCurrentResourceConfiguration();
return new SimpleOutput(
$this->newSerializer($config),
$this->newResource($config)
);
} | php | public function newSimpleOutput()
{
$config = $this->config->getCurrentResourceConfiguration();
return new SimpleOutput(
$this->newSerializer($config),
$this->newResource($config)
);
} | [
"public",
"function",
"newSimpleOutput",
"(",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"config",
"->",
"getCurrentResourceConfiguration",
"(",
")",
";",
"return",
"new",
"SimpleOutput",
"(",
"$",
"this",
"->",
"newSerializer",
"(",
"$",
"config",
")"... | Creates a SimpleOutput instance to be used with native PHP.
@return SimpleOutput | [
"Creates",
"a",
"SimpleOutput",
"instance",
"to",
"be",
"used",
"with",
"native",
"PHP",
"."
] | 3bbf66a85304070562e54a66c99145f58f32877e | https://github.com/jfortunato/fortune/blob/3bbf66a85304070562e54a66c99145f58f32877e/src/ResourceFactory.php#L68-L76 |
239,475 | jfortunato/fortune | src/ResourceFactory.php | ResourceFactory.newSlimOutput | public function newSlimOutput(Request $request, Response $response)
{
$config = $this->config->getCurrentResourceConfiguration();
return new SlimOutput(
$request,
$response,
$this->newSerializer($config),
$this->newResource($config)
);
} | php | public function newSlimOutput(Request $request, Response $response)
{
$config = $this->config->getCurrentResourceConfiguration();
return new SlimOutput(
$request,
$response,
$this->newSerializer($config),
$this->newResource($config)
);
} | [
"public",
"function",
"newSlimOutput",
"(",
"Request",
"$",
"request",
",",
"Response",
"$",
"response",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"config",
"->",
"getCurrentResourceConfiguration",
"(",
")",
";",
"return",
"new",
"SlimOutput",
"(",
"$... | Creates a SlimOutput instance to be used with the slim PHP framework.
@param Request $request
@param Response $response
@return SlimOutput | [
"Creates",
"a",
"SlimOutput",
"instance",
"to",
"be",
"used",
"with",
"the",
"slim",
"PHP",
"framework",
"."
] | 3bbf66a85304070562e54a66c99145f58f32877e | https://github.com/jfortunato/fortune/blob/3bbf66a85304070562e54a66c99145f58f32877e/src/ResourceFactory.php#L85-L95 |
239,476 | jfortunato/fortune | src/ResourceFactory.php | ResourceFactory.generateSlimRoutes | public function generateSlimRoutes(Slim $slim)
{
// if we are not on a resources's route, then dont generate any routes
if (!$this->config->getCurrentResourceConfiguration()) {
return;
}
$output = $this->newSlimOutput($slim->request, $slim->response);
$generator... | php | public function generateSlimRoutes(Slim $slim)
{
// if we are not on a resources's route, then dont generate any routes
if (!$this->config->getCurrentResourceConfiguration()) {
return;
}
$output = $this->newSlimOutput($slim->request, $slim->response);
$generator... | [
"public",
"function",
"generateSlimRoutes",
"(",
"Slim",
"$",
"slim",
")",
"{",
"// if we are not on a resources's route, then dont generate any routes",
"if",
"(",
"!",
"$",
"this",
"->",
"config",
"->",
"getCurrentResourceConfiguration",
"(",
")",
")",
"{",
"return",
... | Helper for generating all the routes for the configured resources in slim.
@param Slim $slim
@return void | [
"Helper",
"for",
"generating",
"all",
"the",
"routes",
"for",
"the",
"configured",
"resources",
"in",
"slim",
"."
] | 3bbf66a85304070562e54a66c99145f58f32877e | https://github.com/jfortunato/fortune/blob/3bbf66a85304070562e54a66c99145f58f32877e/src/ResourceFactory.php#L103-L115 |
239,477 | jfortunato/fortune | src/ResourceFactory.php | ResourceFactory.resourceFor | public function resourceFor($resourceName)
{
$resourceConfig = $this->config->resourceConfigurationFor($resourceName);
return $this->newResource($resourceConfig);
} | php | public function resourceFor($resourceName)
{
$resourceConfig = $this->config->resourceConfigurationFor($resourceName);
return $this->newResource($resourceConfig);
} | [
"public",
"function",
"resourceFor",
"(",
"$",
"resourceName",
")",
"{",
"$",
"resourceConfig",
"=",
"$",
"this",
"->",
"config",
"->",
"resourceConfigurationFor",
"(",
"$",
"resourceName",
")",
";",
"return",
"$",
"this",
"->",
"newResource",
"(",
"$",
"res... | Finds a ResourceConfiguration for given resource name.
@param string $resourceName
@return ResourceConfiguration | [
"Finds",
"a",
"ResourceConfiguration",
"for",
"given",
"resource",
"name",
"."
] | 3bbf66a85304070562e54a66c99145f58f32877e | https://github.com/jfortunato/fortune/blob/3bbf66a85304070562e54a66c99145f58f32877e/src/ResourceFactory.php#L133-L138 |
239,478 | jfortunato/fortune | src/ResourceFactory.php | ResourceFactory.newRepository | protected function newRepository(ResourceConfiguration $config)
{
if ($this->database instanceof EntityManager) {
return $this->newDoctrineRepository($this->database, $config->getEntityClass(), $config->getParent());
} elseif ($this->database instanceof PDO) {
return $this->n... | php | protected function newRepository(ResourceConfiguration $config)
{
if ($this->database instanceof EntityManager) {
return $this->newDoctrineRepository($this->database, $config->getEntityClass(), $config->getParent());
} elseif ($this->database instanceof PDO) {
return $this->n... | [
"protected",
"function",
"newRepository",
"(",
"ResourceConfiguration",
"$",
"config",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"database",
"instanceof",
"EntityManager",
")",
"{",
"return",
"$",
"this",
"->",
"newDoctrineRepository",
"(",
"$",
"this",
"->",
"d... | Determines which repository to use based on the database connection
that was passed in.
@param string $entityClass
@return ResourceRepositoryInterface | [
"Determines",
"which",
"repository",
"to",
"use",
"based",
"on",
"the",
"database",
"connection",
"that",
"was",
"passed",
"in",
"."
] | 3bbf66a85304070562e54a66c99145f58f32877e | https://github.com/jfortunato/fortune/blob/3bbf66a85304070562e54a66c99145f58f32877e/src/ResourceFactory.php#L171-L180 |
239,479 | jfortunato/fortune | src/ResourceFactory.php | ResourceFactory.newSerializer | protected function newSerializer(ResourceConfiguration $config)
{
return new JMSSerializer(
SerializerBuilder::create()->build(),
new SerializationContext,
new JMSPropertyExcluder($config->getExcludedProperties())
);
} | php | protected function newSerializer(ResourceConfiguration $config)
{
return new JMSSerializer(
SerializerBuilder::create()->build(),
new SerializationContext,
new JMSPropertyExcluder($config->getExcludedProperties())
);
} | [
"protected",
"function",
"newSerializer",
"(",
"ResourceConfiguration",
"$",
"config",
")",
"{",
"return",
"new",
"JMSSerializer",
"(",
"SerializerBuilder",
"::",
"create",
"(",
")",
"->",
"build",
"(",
")",
",",
"new",
"SerializationContext",
",",
"new",
"JMSPr... | Creates JMSSerializer instance.
@return JMSSerializer | [
"Creates",
"JMSSerializer",
"instance",
"."
] | 3bbf66a85304070562e54a66c99145f58f32877e | https://github.com/jfortunato/fortune/blob/3bbf66a85304070562e54a66c99145f58f32877e/src/ResourceFactory.php#L187-L194 |
239,480 | jfortunato/fortune | src/ResourceFactory.php | ResourceFactory.newResource | protected function newResource(ResourceConfiguration $config)
{
return new Resource(
$this->newRepository($config),
$this->newValidator($config),
$this->newSecurity(),
$this,
$config
);
} | php | protected function newResource(ResourceConfiguration $config)
{
return new Resource(
$this->newRepository($config),
$this->newValidator($config),
$this->newSecurity(),
$this,
$config
);
} | [
"protected",
"function",
"newResource",
"(",
"ResourceConfiguration",
"$",
"config",
")",
"{",
"return",
"new",
"Resource",
"(",
"$",
"this",
"->",
"newRepository",
"(",
"$",
"config",
")",
",",
"$",
"this",
"->",
"newValidator",
"(",
"$",
"config",
")",
"... | Creates a new Resource based off its ResourceConfiguration
@param ResourceConfiguration $config
@return Resource | [
"Creates",
"a",
"new",
"Resource",
"based",
"off",
"its",
"ResourceConfiguration"
] | 3bbf66a85304070562e54a66c99145f58f32877e | https://github.com/jfortunato/fortune/blob/3bbf66a85304070562e54a66c99145f58f32877e/src/ResourceFactory.php#L202-L211 |
239,481 | jfortunato/fortune | src/ResourceFactory.php | ResourceFactory.newValidator | protected function newValidator(ResourceConfiguration $config)
{
$class = $config->getValidatorClass();
return $config->isUsingYamlValidation() ?
new YamlResourceValidator($config->getYamlValidation()) : new $class();
} | php | protected function newValidator(ResourceConfiguration $config)
{
$class = $config->getValidatorClass();
return $config->isUsingYamlValidation() ?
new YamlResourceValidator($config->getYamlValidation()) : new $class();
} | [
"protected",
"function",
"newValidator",
"(",
"ResourceConfiguration",
"$",
"config",
")",
"{",
"$",
"class",
"=",
"$",
"config",
"->",
"getValidatorClass",
"(",
")",
";",
"return",
"$",
"config",
"->",
"isUsingYamlValidation",
"(",
")",
"?",
"new",
"YamlResou... | Checks the configuration to decide what validation class to use.
@param ResourceConfiguration $config
@return YamlResourceValidator|object | [
"Checks",
"the",
"configuration",
"to",
"decide",
"what",
"validation",
"class",
"to",
"use",
"."
] | 3bbf66a85304070562e54a66c99145f58f32877e | https://github.com/jfortunato/fortune/blob/3bbf66a85304070562e54a66c99145f58f32877e/src/ResourceFactory.php#L219-L225 |
239,482 | jfortunato/fortune | src/ResourceFactory.php | ResourceFactory.newSecurity | protected function newSecurity()
{
$config = $this->config->getCurrentResourceConfiguration();
return new Security(
new SimpleAuthenticationBouncer($config),
new SimpleRoleBouncer($config),
new ParentBouncer($config)
);
} | php | protected function newSecurity()
{
$config = $this->config->getCurrentResourceConfiguration();
return new Security(
new SimpleAuthenticationBouncer($config),
new SimpleRoleBouncer($config),
new ParentBouncer($config)
);
} | [
"protected",
"function",
"newSecurity",
"(",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"config",
"->",
"getCurrentResourceConfiguration",
"(",
")",
";",
"return",
"new",
"Security",
"(",
"new",
"SimpleAuthenticationBouncer",
"(",
"$",
"config",
")",
","... | Creates a Security gateway with all Bouncers
@return Security | [
"Creates",
"a",
"Security",
"gateway",
"with",
"all",
"Bouncers"
] | 3bbf66a85304070562e54a66c99145f58f32877e | https://github.com/jfortunato/fortune/blob/3bbf66a85304070562e54a66c99145f58f32877e/src/ResourceFactory.php#L232-L241 |
239,483 | yoozoo/protoapiphp | src/httpClient.php | HttpClient.callApi | public function callApi(Message $req, $method, $uri, $handler)
{
// check handler, php before 5.4 doesn't support Type Hinting of callable
if (!is_callable($handler)) {
throw new GeneralException("Can not find response handler.");
}
$data = [
'json' => (objec... | php | public function callApi(Message $req, $method, $uri, $handler)
{
// check handler, php before 5.4 doesn't support Type Hinting of callable
if (!is_callable($handler)) {
throw new GeneralException("Can not find response handler.");
}
$data = [
'json' => (objec... | [
"public",
"function",
"callApi",
"(",
"Message",
"$",
"req",
",",
"$",
"method",
",",
"$",
"uri",
",",
"$",
"handler",
")",
"{",
"// check handler, php before 5.4 doesn't support Type Hinting of callable",
"if",
"(",
"!",
"is_callable",
"(",
"$",
"handler",
")",
... | call api, handle error, return response
@param Message $req
@param String $method
@param String $uri
@param function $handler function($response, $bizerror, $common) create response oject or throw biz error exception
@return Message $result | [
"call",
"api",
"handle",
"error",
"return",
"response"
] | 524f7688e55a616f9edca8711b101c058a1ce6e5 | https://github.com/yoozoo/protoapiphp/blob/524f7688e55a616f9edca8711b101c058a1ce6e5/src/httpClient.php#L23-L71 |
239,484 | bytepark/lib-migration | src/Repository/AbstractRepository.php | AbstractRepository.diff | public function diff(Repository $otherRepository)
{
$diffRepository = new Memory();
foreach ($this->unitOfWorkStore as $unitOfWork) {
if (!$otherRepository->contains($unitOfWork)) {
$diffRepository->add($unitOfWork);
}
}
$diffRepository->sort... | php | public function diff(Repository $otherRepository)
{
$diffRepository = new Memory();
foreach ($this->unitOfWorkStore as $unitOfWork) {
if (!$otherRepository->contains($unitOfWork)) {
$diffRepository->add($unitOfWork);
}
}
$diffRepository->sort... | [
"public",
"function",
"diff",
"(",
"Repository",
"$",
"otherRepository",
")",
"{",
"$",
"diffRepository",
"=",
"new",
"Memory",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"unitOfWorkStore",
"as",
"$",
"unitOfWork",
")",
"{",
"if",
"(",
"!",
"$",
... | Calculates the diff to the given repository
The method returns a Repository including all Migrations present in this
instance but not the given other repository.
@param Repository $otherRepository The repository to diff to
@throws \Bytepark\Component\Migration\Exception\UnitIsAlreadyPresentException
@return Reposit... | [
"Calculates",
"the",
"diff",
"to",
"the",
"given",
"repository"
] | 14d75f6978e257f456493c673175ca5d07b28c84 | https://github.com/bytepark/lib-migration/blob/14d75f6978e257f456493c673175ca5d07b28c84/src/Repository/AbstractRepository.php#L59-L72 |
239,485 | bytepark/lib-migration | src/Repository/AbstractRepository.php | AbstractRepository.find | public function find(Uid $uniqueId)
{
if (!array_key_exists((string) $uniqueId, $this->unitOfWorkStore)) {
throw new UnitNotFoundException();
}
return $this->unitOfWorkStore[(string) $uniqueId];
} | php | public function find(Uid $uniqueId)
{
if (!array_key_exists((string) $uniqueId, $this->unitOfWorkStore)) {
throw new UnitNotFoundException();
}
return $this->unitOfWorkStore[(string) $uniqueId];
} | [
"public",
"function",
"find",
"(",
"Uid",
"$",
"uniqueId",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"(",
"string",
")",
"$",
"uniqueId",
",",
"$",
"this",
"->",
"unitOfWorkStore",
")",
")",
"{",
"throw",
"new",
"UnitNotFoundException",
"(",
")"... | Finds the unit with the given Uid
@param Uid $uniqueId The Uid of the unit to find
@throws UnitNotFoundException
@return UnitOfWork | [
"Finds",
"the",
"unit",
"with",
"the",
"given",
"Uid"
] | 14d75f6978e257f456493c673175ca5d07b28c84 | https://github.com/bytepark/lib-migration/blob/14d75f6978e257f456493c673175ca5d07b28c84/src/Repository/AbstractRepository.php#L83-L90 |
239,486 | bytepark/lib-migration | src/Repository/AbstractRepository.php | AbstractRepository.add | public function add(UnitOfWork $unitOfWork)
{
if ($this->contains($unitOfWork)) {
throw new UnitIsAlreadyPresentException();
}
$this->unitOfWorkStore[$unitOfWork->getUniqueId()] = $unitOfWork;
} | php | public function add(UnitOfWork $unitOfWork)
{
if ($this->contains($unitOfWork)) {
throw new UnitIsAlreadyPresentException();
}
$this->unitOfWorkStore[$unitOfWork->getUniqueId()] = $unitOfWork;
} | [
"public",
"function",
"add",
"(",
"UnitOfWork",
"$",
"unitOfWork",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"contains",
"(",
"$",
"unitOfWork",
")",
")",
"{",
"throw",
"new",
"UnitIsAlreadyPresentException",
"(",
")",
";",
"}",
"$",
"this",
"->",
"unitOfW... | Adds a UnitOfWork to the repository
@param UnitOfWork $unitOfWork The migration to add
@throws UnitIsAlreadyPresentException
@return void | [
"Adds",
"a",
"UnitOfWork",
"to",
"the",
"repository"
] | 14d75f6978e257f456493c673175ca5d07b28c84 | https://github.com/bytepark/lib-migration/blob/14d75f6978e257f456493c673175ca5d07b28c84/src/Repository/AbstractRepository.php#L101-L108 |
239,487 | bytepark/lib-migration | src/Repository/AbstractRepository.php | AbstractRepository.replace | public function replace(UnitOfWork $unitOfWork)
{
if (!$this->contains($unitOfWork)) {
throw new UnitNotPresentException;
}
$this->unitOfWorkStore[$unitOfWork->getUniqueId()] = $unitOfWork;
} | php | public function replace(UnitOfWork $unitOfWork)
{
if (!$this->contains($unitOfWork)) {
throw new UnitNotPresentException;
}
$this->unitOfWorkStore[$unitOfWork->getUniqueId()] = $unitOfWork;
} | [
"public",
"function",
"replace",
"(",
"UnitOfWork",
"$",
"unitOfWork",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"contains",
"(",
"$",
"unitOfWork",
")",
")",
"{",
"throw",
"new",
"UnitNotPresentException",
";",
"}",
"$",
"this",
"->",
"unitOfWorkStore"... | Replaces with the given unit of work
@param UnitOfWork $unitOfWork The unit of work to replace with
@throws UnitNotPresentException
@return void | [
"Replaces",
"with",
"the",
"given",
"unit",
"of",
"work"
] | 14d75f6978e257f456493c673175ca5d07b28c84 | https://github.com/bytepark/lib-migration/blob/14d75f6978e257f456493c673175ca5d07b28c84/src/Repository/AbstractRepository.php#L119-L126 |
239,488 | silencedis/protected-members-accessor | src/ProtectedMembersAccessor.php | ProtectedMembersAccessor.getReflectionMethod | protected function getReflectionMethod($class, $method)
{
if (!isset($this->methodReflectors[$class])) {
$this->methodReflectors[$class] = [];
}
if (!isset($this->methodReflectors[$class][$method])) {
$this->methodReflectors[$class][$method] = new \ReflectionMethod($c... | php | protected function getReflectionMethod($class, $method)
{
if (!isset($this->methodReflectors[$class])) {
$this->methodReflectors[$class] = [];
}
if (!isset($this->methodReflectors[$class][$method])) {
$this->methodReflectors[$class][$method] = new \ReflectionMethod($c... | [
"protected",
"function",
"getReflectionMethod",
"(",
"$",
"class",
",",
"$",
"method",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"methodReflectors",
"[",
"$",
"class",
"]",
")",
")",
"{",
"$",
"this",
"->",
"methodReflectors",
"[",
"$"... | Returns a method reflection
@param string $class
@param string $method
@return \ReflectionMethod | [
"Returns",
"a",
"method",
"reflection"
] | 0fcf525858a9555f3b4a90ad302549ea235678ff | https://github.com/silencedis/protected-members-accessor/blob/0fcf525858a9555f3b4a90ad302549ea235678ff/src/ProtectedMembersAccessor.php#L25-L35 |
239,489 | silencedis/protected-members-accessor | src/ProtectedMembersAccessor.php | ProtectedMembersAccessor.getReflectionProperty | protected function getReflectionProperty($class, $property)
{
if (!isset($this->propertyReflectors[$class])) {
$this->propertyReflectors[$class] = [];
}
if (!isset($this->propertyReflectors[$class][$property])) {
$this->propertyReflectors[$class][$property] = new \Ref... | php | protected function getReflectionProperty($class, $property)
{
if (!isset($this->propertyReflectors[$class])) {
$this->propertyReflectors[$class] = [];
}
if (!isset($this->propertyReflectors[$class][$property])) {
$this->propertyReflectors[$class][$property] = new \Ref... | [
"protected",
"function",
"getReflectionProperty",
"(",
"$",
"class",
",",
"$",
"property",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"propertyReflectors",
"[",
"$",
"class",
"]",
")",
")",
"{",
"$",
"this",
"->",
"propertyReflectors",
"[... | Returns a property reflection
@param string $class
@param string $property
@return \ReflectionProperty | [
"Returns",
"a",
"property",
"reflection"
] | 0fcf525858a9555f3b4a90ad302549ea235678ff | https://github.com/silencedis/protected-members-accessor/blob/0fcf525858a9555f3b4a90ad302549ea235678ff/src/ProtectedMembersAccessor.php#L45-L55 |
239,490 | silencedis/protected-members-accessor | src/ProtectedMembersAccessor.php | ProtectedMembersAccessor.getProtectedMethod | public function getProtectedMethod(...$params)
{
if (is_string($params[0])) {
list($className, $object, $name) = $params;
} elseif (is_object($params[0])) {
list($object, $name) = $params;
$className = get_class($object);
}
/** @var string $classN... | php | public function getProtectedMethod(...$params)
{
if (is_string($params[0])) {
list($className, $object, $name) = $params;
} elseif (is_object($params[0])) {
list($object, $name) = $params;
$className = get_class($object);
}
/** @var string $classN... | [
"public",
"function",
"getProtectedMethod",
"(",
"...",
"$",
"params",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"params",
"[",
"0",
"]",
")",
")",
"{",
"list",
"(",
"$",
"className",
",",
"$",
"object",
",",
"$",
"name",
")",
"=",
"$",
"params",... | Returns a method as closure
@param array ...$params
@return \Closure
@throws ProtectedMembersAccessException | [
"Returns",
"a",
"method",
"as",
"closure"
] | 0fcf525858a9555f3b4a90ad302549ea235678ff | https://github.com/silencedis/protected-members-accessor/blob/0fcf525858a9555f3b4a90ad302549ea235678ff/src/ProtectedMembersAccessor.php#L91-L111 |
239,491 | silencedis/protected-members-accessor | src/ProtectedMembersAccessor.php | ProtectedMembersAccessor.getProtectedProperty | public function getProtectedProperty(...$params)
{
if (is_string($params[0])) {
list($className, $object, $name) = $params;
} elseif (is_object($params[0])) {
list($object, $name) = $params;
$className = get_class($object);
}
/** @var string $clas... | php | public function getProtectedProperty(...$params)
{
if (is_string($params[0])) {
list($className, $object, $name) = $params;
} elseif (is_object($params[0])) {
list($object, $name) = $params;
$className = get_class($object);
}
/** @var string $clas... | [
"public",
"function",
"getProtectedProperty",
"(",
"...",
"$",
"params",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"params",
"[",
"0",
"]",
")",
")",
"{",
"list",
"(",
"$",
"className",
",",
"$",
"object",
",",
"$",
"name",
")",
"=",
"$",
"params... | Returns a value of a protected property of the object
@param array ...$params
@return mixed
@throws ProtectedMembersAccessException | [
"Returns",
"a",
"value",
"of",
"a",
"protected",
"property",
"of",
"the",
"object"
] | 0fcf525858a9555f3b4a90ad302549ea235678ff | https://github.com/silencedis/protected-members-accessor/blob/0fcf525858a9555f3b4a90ad302549ea235678ff/src/ProtectedMembersAccessor.php#L121-L149 |
239,492 | silencedis/protected-members-accessor | src/ProtectedMembersAccessor.php | ProtectedMembersAccessor.setProtectedProperty | public function setProtectedProperty(...$params)
{
if (is_string($params[0])) {
list($className, $object, $name, $value) = $params;
} elseif (is_object($params[0])) {
list($object, $name, $value) = $params;
$className = get_class($object);
}
/** @... | php | public function setProtectedProperty(...$params)
{
if (is_string($params[0])) {
list($className, $object, $name, $value) = $params;
} elseif (is_object($params[0])) {
list($object, $name, $value) = $params;
$className = get_class($object);
}
/** @... | [
"public",
"function",
"setProtectedProperty",
"(",
"...",
"$",
"params",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"params",
"[",
"0",
"]",
")",
")",
"{",
"list",
"(",
"$",
"className",
",",
"$",
"object",
",",
"$",
"name",
",",
"$",
"value",
")"... | Sets a protected property for the object
@param array ...$params
@throws ProtectedMembersAccessException | [
"Sets",
"a",
"protected",
"property",
"for",
"the",
"object"
] | 0fcf525858a9555f3b4a90ad302549ea235678ff | https://github.com/silencedis/protected-members-accessor/blob/0fcf525858a9555f3b4a90ad302549ea235678ff/src/ProtectedMembersAccessor.php#L157-L184 |
239,493 | flavorzyb/simple | src/Middleware/VerifyCsrfToken.php | VerifyCsrfToken.getTokenString | protected function getTokenString()
{
$result = Request::post('_token', '');
if ('' == $result) {
$result = Request::get('_token', '');
}
if ('' == $result) {
$result = isset($_SERVER['X-CSRF-TOKEN']) ? $_SERVER['X-CSRF-TOKEN'] : '';
}
return... | php | protected function getTokenString()
{
$result = Request::post('_token', '');
if ('' == $result) {
$result = Request::get('_token', '');
}
if ('' == $result) {
$result = isset($_SERVER['X-CSRF-TOKEN']) ? $_SERVER['X-CSRF-TOKEN'] : '';
}
return... | [
"protected",
"function",
"getTokenString",
"(",
")",
"{",
"$",
"result",
"=",
"Request",
"::",
"post",
"(",
"'_token'",
",",
"''",
")",
";",
"if",
"(",
"''",
"==",
"$",
"result",
")",
"{",
"$",
"result",
"=",
"Request",
"::",
"get",
"(",
"'_token'",
... | get token string
@return string | [
"get",
"token",
"string"
] | 8c4c539ae2057217b2637fc72c2a90ba266e8e6c | https://github.com/flavorzyb/simple/blob/8c4c539ae2057217b2637fc72c2a90ba266e8e6c/src/Middleware/VerifyCsrfToken.php#L40-L52 |
239,494 | uthando-cms/uthando-common | src/UthandoCommon/Stdlib/ArrayUtils.php | ArrayUtils.removeKeysFromMultiArray | public static function removeKeysFromMultiArray(&$array, $keys)
{
foreach ($array as $key => &$value) {
if (is_array($value)) {
self::traverseArray($value, $keys);
} else {
if (in_array($key, $keys) || '' == $value) {
unset($array[$... | php | public static function removeKeysFromMultiArray(&$array, $keys)
{
foreach ($array as $key => &$value) {
if (is_array($value)) {
self::traverseArray($value, $keys);
} else {
if (in_array($key, $keys) || '' == $value) {
unset($array[$... | [
"public",
"static",
"function",
"removeKeysFromMultiArray",
"(",
"&",
"$",
"array",
",",
"$",
"keys",
")",
"{",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"&",
"$",
"value",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
")",
"... | Traverse an array unsetting keys
@param array $array array to traverse
@param array $keys keys to remove
@return array | [
"Traverse",
"an",
"array",
"unsetting",
"keys"
] | feb915da5d26b60f536282e1bc3ad5c22e53f485 | https://github.com/uthando-cms/uthando-common/blob/feb915da5d26b60f536282e1bc3ad5c22e53f485/src/UthandoCommon/Stdlib/ArrayUtils.php#L28-L41 |
239,495 | uthando-cms/uthando-common | src/UthandoCommon/Stdlib/ArrayUtils.php | ArrayUtils.listToMultiArray | public static function listToMultiArray($array)
{
$nested = [];
$depths = [];
foreach ($array as $key => $arr) {
if ($arr['depth'] == 0) {
$nested[$key] = $arr;
} else {
$parent =& $nested;
for ($i = 1; $i <= ($arr['d... | php | public static function listToMultiArray($array)
{
$nested = [];
$depths = [];
foreach ($array as $key => $arr) {
if ($arr['depth'] == 0) {
$nested[$key] = $arr;
} else {
$parent =& $nested;
for ($i = 1; $i <= ($arr['d... | [
"public",
"static",
"function",
"listToMultiArray",
"(",
"$",
"array",
")",
"{",
"$",
"nested",
"=",
"[",
"]",
";",
"$",
"depths",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"$",
"arr",
")",
"{",
"if",
"(",
"$",
"... | transform a list into a multidimensional array
using a depth value
@param array $array
@return array | [
"transform",
"a",
"list",
"into",
"a",
"multidimensional",
"array",
"using",
"a",
"depth",
"value"
] | feb915da5d26b60f536282e1bc3ad5c22e53f485 | https://github.com/uthando-cms/uthando-common/blob/feb915da5d26b60f536282e1bc3ad5c22e53f485/src/UthandoCommon/Stdlib/ArrayUtils.php#L50-L73 |
239,496 | keboola/debug-log-uploader | src/Keboola/DebugLogUploader/UploaderS3.php | UploaderS3.upload | public function upload($filePath, $contentType = 'text/plain')
{
$s3FileName = $this->getFilePathAndUniquePrefix() . basename($filePath);
list($bucket, $prefix) = explode('/', $this->s3path, 2);
$this->s3client->putObject([
'Bucket' => $bucket,
'Key' => (empty($prefi... | php | public function upload($filePath, $contentType = 'text/plain')
{
$s3FileName = $this->getFilePathAndUniquePrefix() . basename($filePath);
list($bucket, $prefix) = explode('/', $this->s3path, 2);
$this->s3client->putObject([
'Bucket' => $bucket,
'Key' => (empty($prefi... | [
"public",
"function",
"upload",
"(",
"$",
"filePath",
",",
"$",
"contentType",
"=",
"'text/plain'",
")",
"{",
"$",
"s3FileName",
"=",
"$",
"this",
"->",
"getFilePathAndUniquePrefix",
"(",
")",
".",
"basename",
"(",
"$",
"filePath",
")",
";",
"list",
"(",
... | Uploads file to s3
@param $filePath
@param string $contentType
@return string | [
"Uploads",
"file",
"to",
"s3"
] | ea124d136e8c6d18ce1768da5dcc51994df8b764 | https://github.com/keboola/debug-log-uploader/blob/ea124d136e8c6d18ce1768da5dcc51994df8b764/src/Keboola/DebugLogUploader/UploaderS3.php#L43-L58 |
239,497 | keboola/debug-log-uploader | src/Keboola/DebugLogUploader/UploaderS3.php | UploaderS3.uploadString | public function uploadString($name, $content, $contentType = 'text/plain')
{
$s3FileName = $this->getFilePathAndUniquePrefix() . $name;
list($bucket, $prefix) = explode('/', $this->s3path, 2);
$this->s3client->putObject([
'Bucket' => $bucket,
'Key' => (empty($prefix)... | php | public function uploadString($name, $content, $contentType = 'text/plain')
{
$s3FileName = $this->getFilePathAndUniquePrefix() . $name;
list($bucket, $prefix) = explode('/', $this->s3path, 2);
$this->s3client->putObject([
'Bucket' => $bucket,
'Key' => (empty($prefix)... | [
"public",
"function",
"uploadString",
"(",
"$",
"name",
",",
"$",
"content",
",",
"$",
"contentType",
"=",
"'text/plain'",
")",
"{",
"$",
"s3FileName",
"=",
"$",
"this",
"->",
"getFilePathAndUniquePrefix",
"(",
")",
".",
"$",
"name",
";",
"list",
"(",
"$... | Uploads string as file to s3
@param $name
@param $content
@param string $contentType
@return string | [
"Uploads",
"string",
"as",
"file",
"to",
"s3"
] | ea124d136e8c6d18ce1768da5dcc51994df8b764 | https://github.com/keboola/debug-log-uploader/blob/ea124d136e8c6d18ce1768da5dcc51994df8b764/src/Keboola/DebugLogUploader/UploaderS3.php#L67-L82 |
239,498 | CableFramework/ServiceContainer | src/Cable/Component/Factory.php | Factory.create | public static function create(ProviderRepository $providerRepository = null)
{
$container = new Container(
$providerRepository
);
if (!$container->isProvided(AnnotationServiceProvider::class)) {
$container->addProvider(AnnotationServiceProvider::class);
}
... | php | public static function create(ProviderRepository $providerRepository = null)
{
$container = new Container(
$providerRepository
);
if (!$container->isProvided(AnnotationServiceProvider::class)) {
$container->addProvider(AnnotationServiceProvider::class);
}
... | [
"public",
"static",
"function",
"create",
"(",
"ProviderRepository",
"$",
"providerRepository",
"=",
"null",
")",
"{",
"$",
"container",
"=",
"new",
"Container",
"(",
"$",
"providerRepository",
")",
";",
"if",
"(",
"!",
"$",
"container",
"->",
"isProvided",
... | create a new container instance
@param ProviderRepository|null $providerRepository
@throws ProviderException
@return Container | [
"create",
"a",
"new",
"container",
"instance"
] | 0e48ad2e26de9b780d8fe336dd9ac48357285486 | https://github.com/CableFramework/ServiceContainer/blob/0e48ad2e26de9b780d8fe336dd9ac48357285486/src/Cable/Component/Factory.php#L22-L41 |
239,499 | carno-php/log | src/Outputter/TCP.php | TCP.connecting | private function connecting() : void
{
$this->connected = false;
$this->closing
? $this->closed()->resolve()
: $this->client = Socket::connect($this->endpoint, $this->events)
;
} | php | private function connecting() : void
{
$this->connected = false;
$this->closing
? $this->closed()->resolve()
: $this->client = Socket::connect($this->endpoint, $this->events)
;
} | [
"private",
"function",
"connecting",
"(",
")",
":",
"void",
"{",
"$",
"this",
"->",
"connected",
"=",
"false",
";",
"$",
"this",
"->",
"closing",
"?",
"$",
"this",
"->",
"closed",
"(",
")",
"->",
"resolve",
"(",
")",
":",
"$",
"this",
"->",
"client... | reconnect to server if conn closed or error | [
"reconnect",
"to",
"server",
"if",
"conn",
"closed",
"or",
"error"
] | a96acf0a25e5ee0a8b763bac4f710f5350f2f70b | https://github.com/carno-php/log/blob/a96acf0a25e5ee0a8b763bac4f710f5350f2f70b/src/Outputter/TCP.php#L102-L109 |
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.