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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
20,100 | haldayne/boost | src/Map.php | Map.walk | protected function walk(callable $code)
{
foreach ($this->array as $hash => &$value) {
$key = $this->hash_to_key($hash);
if (! $this->passes($this->call($code, $value, $key))) {
break;
}
}
return $this;
} | php | protected function walk(callable $code)
{
foreach ($this->array as $hash => &$value) {
$key = $this->hash_to_key($hash);
if (! $this->passes($this->call($code, $value, $key))) {
break;
}
}
return $this;
} | [
"protected",
"function",
"walk",
"(",
"callable",
"$",
"code",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"array",
"as",
"$",
"hash",
"=>",
"&",
"$",
"value",
")",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"hash_to_key",
"(",
"$",
"hash",
")",
"... | Execute the given code over each element of the map. The code receives
the value by reference and then the key as formal parameters.
The items are walked in the order they exist in the map. If the code
returns boolean false, then the iteration halts. Values can be modified
from within the callback, but not keys.
Exam... | [
"Execute",
"the",
"given",
"code",
"over",
"each",
"element",
"of",
"the",
"map",
".",
"The",
"code",
"receives",
"the",
"value",
"by",
"reference",
"and",
"then",
"the",
"key",
"as",
"formal",
"parameters",
"."
] | d18cc398557e23f9c316ea7fb40b90f84cc53650 | https://github.com/haldayne/boost/blob/d18cc398557e23f9c316ea7fb40b90f84cc53650/src/Map.php#L956-L965 |
20,101 | haldayne/boost | src/Map.php | Map.walk_backward | protected function walk_backward(callable $code)
{
for (end($this->array); null !== ($hash = key($this->array)); prev($this->array)) {
$key = $this->hash_to_key($hash);
$current = current($this->array);
$value =& $current;
if (! $this->passes($this->call($co... | php | protected function walk_backward(callable $code)
{
for (end($this->array); null !== ($hash = key($this->array)); prev($this->array)) {
$key = $this->hash_to_key($hash);
$current = current($this->array);
$value =& $current;
if (! $this->passes($this->call($co... | [
"protected",
"function",
"walk_backward",
"(",
"callable",
"$",
"code",
")",
"{",
"for",
"(",
"end",
"(",
"$",
"this",
"->",
"array",
")",
";",
"null",
"!==",
"(",
"$",
"hash",
"=",
"key",
"(",
"$",
"this",
"->",
"array",
")",
")",
";",
"prev",
"... | Like `walk`, except walk from the end toward the front.
@param callable $code
@return $this | [
"Like",
"walk",
"except",
"walk",
"from",
"the",
"end",
"toward",
"the",
"front",
"."
] | d18cc398557e23f9c316ea7fb40b90f84cc53650 | https://github.com/haldayne/boost/blob/d18cc398557e23f9c316ea7fb40b90f84cc53650/src/Map.php#L973-L984 |
20,102 | haldayne/boost | src/Map.php | Map.key_to_hash | private function key_to_hash($key)
{
if (null === $key) {
$hash = 'null';
} else if (is_int($key)) {
$hash = $key;
} else if (is_float($key)) {
$hash = "f_$key";
} else if (is_bool($key)) {
$hash = "b_$key";
} else if (is_st... | php | private function key_to_hash($key)
{
if (null === $key) {
$hash = 'null';
} else if (is_int($key)) {
$hash = $key;
} else if (is_float($key)) {
$hash = "f_$key";
} else if (is_bool($key)) {
$hash = "b_$key";
} else if (is_st... | [
"private",
"function",
"key_to_hash",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"key",
")",
"{",
"$",
"hash",
"=",
"'null'",
";",
"}",
"else",
"if",
"(",
"is_int",
"(",
"$",
"key",
")",
")",
"{",
"$",
"hash",
"=",
"$",
"key",
... | Lookup the hash for the given key. If a hash does not yet exist, one is
created.
@param mixed $key
@return string
@throws \InvalidArgumentException | [
"Lookup",
"the",
"hash",
"for",
"the",
"given",
"key",
".",
"If",
"a",
"hash",
"does",
"not",
"yet",
"exist",
"one",
"is",
"created",
"."
] | d18cc398557e23f9c316ea7fb40b90f84cc53650 | https://github.com/haldayne/boost/blob/d18cc398557e23f9c316ea7fb40b90f84cc53650/src/Map.php#L1009-L1044 |
20,103 | haldayne/boost | src/Map.php | Map.hash_to_key | private function hash_to_key($hash)
{
if (array_key_exists($hash, $this->map_hash_to_key)) {
return $this->map_hash_to_key[$hash];
} else {
throw new \OutOfBoundsException(sprintf(
'Hash "%s" has not been created',
$hash
));
... | php | private function hash_to_key($hash)
{
if (array_key_exists($hash, $this->map_hash_to_key)) {
return $this->map_hash_to_key[$hash];
} else {
throw new \OutOfBoundsException(sprintf(
'Hash "%s" has not been created',
$hash
));
... | [
"private",
"function",
"hash_to_key",
"(",
"$",
"hash",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"hash",
",",
"$",
"this",
"->",
"map_hash_to_key",
")",
")",
"{",
"return",
"$",
"this",
"->",
"map_hash_to_key",
"[",
"$",
"hash",
"]",
";",
"}"... | Lookup the key for the given hash.
@param string $hash
@return mixed | [
"Lookup",
"the",
"key",
"for",
"the",
"given",
"hash",
"."
] | d18cc398557e23f9c316ea7fb40b90f84cc53650 | https://github.com/haldayne/boost/blob/d18cc398557e23f9c316ea7fb40b90f84cc53650/src/Map.php#L1052-L1062 |
20,104 | atkrad/data-tables | src/DataSource/ServerSide/CakePHP.php | CakePHP.setQuery | public function setQuery(Query $query)
{
$this->query = $query;
$this->clonedQuery = clone $query;
return $this;
} | php | public function setQuery(Query $query)
{
$this->query = $query;
$this->clonedQuery = clone $query;
return $this;
} | [
"public",
"function",
"setQuery",
"(",
"Query",
"$",
"query",
")",
"{",
"$",
"this",
"->",
"query",
"=",
"$",
"query",
";",
"$",
"this",
"->",
"clonedQuery",
"=",
"clone",
"$",
"query",
";",
"return",
"$",
"this",
";",
"}"
] | Set CakePHP query
@param Query $query CakePHP query
@return CakePHP | [
"Set",
"CakePHP",
"query"
] | 5afcc337ab624ca626e29d9674459c5105982b16 | https://github.com/atkrad/data-tables/blob/5afcc337ab624ca626e29d9674459c5105982b16/src/DataSource/ServerSide/CakePHP.php#L166-L172 |
20,105 | atkrad/data-tables | src/DataSource/ServerSide/CakePHP.php | CakePHP.preparePaging | protected function preparePaging(Request $request)
{
self::$countBeforePaging = $this->query->count();
$this->query->limit($request->getLength());
$this->query->offset($request->getStart());
} | php | protected function preparePaging(Request $request)
{
self::$countBeforePaging = $this->query->count();
$this->query->limit($request->getLength());
$this->query->offset($request->getStart());
} | [
"protected",
"function",
"preparePaging",
"(",
"Request",
"$",
"request",
")",
"{",
"self",
"::",
"$",
"countBeforePaging",
"=",
"$",
"this",
"->",
"query",
"->",
"count",
"(",
")",
";",
"$",
"this",
"->",
"query",
"->",
"limit",
"(",
"$",
"request",
"... | Prepare CakePHP paging
@param Request $request DataTable request | [
"Prepare",
"CakePHP",
"paging"
] | 5afcc337ab624ca626e29d9674459c5105982b16 | https://github.com/atkrad/data-tables/blob/5afcc337ab624ca626e29d9674459c5105982b16/src/DataSource/ServerSide/CakePHP.php#L179-L184 |
20,106 | atkrad/data-tables | src/DataSource/ServerSide/CakePHP.php | CakePHP.prepareSearch | protected function prepareSearch(Request $request)
{
$value = $request->getSearch()->getValue();
if (!empty($value)) {
$where = [];
foreach ($request->getColumns() as $column) {
if ($column->getSearchable() === true) {
$where[$column->getD... | php | protected function prepareSearch(Request $request)
{
$value = $request->getSearch()->getValue();
if (!empty($value)) {
$where = [];
foreach ($request->getColumns() as $column) {
if ($column->getSearchable() === true) {
$where[$column->getD... | [
"protected",
"function",
"prepareSearch",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"value",
"=",
"$",
"request",
"->",
"getSearch",
"(",
")",
"->",
"getValue",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"value",
")",
")",
"{",
"$",
"wh... | Prepare CakePHP search
@param Request $request DataTable request | [
"Prepare",
"CakePHP",
"search"
] | 5afcc337ab624ca626e29d9674459c5105982b16 | https://github.com/atkrad/data-tables/blob/5afcc337ab624ca626e29d9674459c5105982b16/src/DataSource/ServerSide/CakePHP.php#L191-L209 |
20,107 | atkrad/data-tables | src/DataSource/ServerSide/CakePHP.php | CakePHP.prepareOrder | protected function prepareOrder(Request $request)
{
foreach ($request->getOrder() as $order) {
$this->query->order(
[$this->table->getColumns()[$order->getColumn()]->getData() => strtoupper($order->getDir())]
);
}
} | php | protected function prepareOrder(Request $request)
{
foreach ($request->getOrder() as $order) {
$this->query->order(
[$this->table->getColumns()[$order->getColumn()]->getData() => strtoupper($order->getDir())]
);
}
} | [
"protected",
"function",
"prepareOrder",
"(",
"Request",
"$",
"request",
")",
"{",
"foreach",
"(",
"$",
"request",
"->",
"getOrder",
"(",
")",
"as",
"$",
"order",
")",
"{",
"$",
"this",
"->",
"query",
"->",
"order",
"(",
"[",
"$",
"this",
"->",
"tabl... | Prepare CakePHP order
@param Request $request DataTable request | [
"Prepare",
"CakePHP",
"order"
] | 5afcc337ab624ca626e29d9674459c5105982b16 | https://github.com/atkrad/data-tables/blob/5afcc337ab624ca626e29d9674459c5105982b16/src/DataSource/ServerSide/CakePHP.php#L216-L223 |
20,108 | atkrad/data-tables | src/DataSource/ServerSide/CakePHP.php | CakePHP.getProperty | protected function getProperty($dataName)
{
$dataName = explode('.', trim($dataName));
if (count($dataName) != 2) {
throw new Exception('You are set invalid date.');
}
$tableAlias = $dataName[0];
$colName = $dataName[1];
if ($this->query->repository()->... | php | protected function getProperty($dataName)
{
$dataName = explode('.', trim($dataName));
if (count($dataName) != 2) {
throw new Exception('You are set invalid date.');
}
$tableAlias = $dataName[0];
$colName = $dataName[1];
if ($this->query->repository()->... | [
"protected",
"function",
"getProperty",
"(",
"$",
"dataName",
")",
"{",
"$",
"dataName",
"=",
"explode",
"(",
"'.'",
",",
"trim",
"(",
"$",
"dataName",
")",
")",
";",
"if",
"(",
"count",
"(",
"$",
"dataName",
")",
"!=",
"2",
")",
"{",
"throw",
"new... | Get CakePHP property
@param string $dataName Column data name
@throws Exception
@return array|string | [
"Get",
"CakePHP",
"property"
] | 5afcc337ab624ca626e29d9674459c5105982b16 | https://github.com/atkrad/data-tables/blob/5afcc337ab624ca626e29d9674459c5105982b16/src/DataSource/ServerSide/CakePHP.php#L233-L253 |
20,109 | qcubed/orm | src/Query/Clause/OrderBy.php | OrderBy._UpdateQueryBuilder | public function _UpdateQueryBuilder(Builder $objBuilder)
{
$intLength = count($this->objNodeArray);
for ($intIndex = 0; $intIndex < $intLength; $intIndex++) {
$objNode = $this->objNodeArray[$intIndex];
if ($objNode instanceof Node\Virtual) {
if ($objNode->hasS... | php | public function _UpdateQueryBuilder(Builder $objBuilder)
{
$intLength = count($this->objNodeArray);
for ($intIndex = 0; $intIndex < $intLength; $intIndex++) {
$objNode = $this->objNodeArray[$intIndex];
if ($objNode instanceof Node\Virtual) {
if ($objNode->hasS... | [
"public",
"function",
"_UpdateQueryBuilder",
"(",
"Builder",
"$",
"objBuilder",
")",
"{",
"$",
"intLength",
"=",
"count",
"(",
"$",
"this",
"->",
"objNodeArray",
")",
";",
"for",
"(",
"$",
"intIndex",
"=",
"0",
";",
"$",
"intIndex",
"<",
"$",
"intLength"... | Updates the query builder according to this clause. This is called by the query builder only.
@param Builder $objBuilder
@throws Caller | [
"Updates",
"the",
"query",
"builder",
"according",
"to",
"this",
"clause",
".",
"This",
"is",
"called",
"by",
"the",
"query",
"builder",
"only",
"."
] | f320eba671f20874b1f3809c5293f8c02d5b1204 | https://github.com/qcubed/orm/blob/f320eba671f20874b1f3809c5293f8c02d5b1204/src/Query/Clause/OrderBy.php#L114-L150 |
20,110 | 2amigos/yiifoundation | widgets/Orbit.php | Orbit.renderOrbit | public function renderOrbit()
{
$contents = $list = array();
foreach ($this->items as $item) {
$list[] = $this->renderItem($item);
}
if ($this->showPreloader) {
$contents[] = \CHtml::tag('div', array('class' => Enum::ORBIT_LOADER), ' ');
}
... | php | public function renderOrbit()
{
$contents = $list = array();
foreach ($this->items as $item) {
$list[] = $this->renderItem($item);
}
if ($this->showPreloader) {
$contents[] = \CHtml::tag('div', array('class' => Enum::ORBIT_LOADER), ' ');
}
... | [
"public",
"function",
"renderOrbit",
"(",
")",
"{",
"$",
"contents",
"=",
"$",
"list",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"items",
"as",
"$",
"item",
")",
"{",
"$",
"list",
"[",
"]",
"=",
"$",
"this",
"->",
"renderIte... | Renders the orbit plugin
@return string the generated HTML string | [
"Renders",
"the",
"orbit",
"plugin"
] | 49bed0d3ca1a9bac9299000e48a2661bdc8f9a29 | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/widgets/Orbit.php#L112-L132 |
20,111 | 2amigos/yiifoundation | widgets/Orbit.php | Orbit.renderItem | public function renderItem($item)
{
$content = ArrayHelper::getValue($item, 'content', '');
$caption = ArrayHelper::getValue($item, 'caption');
if ($caption !== null) {
$caption = \CHtml::tag('div', array('class' => Enum::ORBIT_CAPTION), $caption);
}
return \CHtm... | php | public function renderItem($item)
{
$content = ArrayHelper::getValue($item, 'content', '');
$caption = ArrayHelper::getValue($item, 'caption');
if ($caption !== null) {
$caption = \CHtml::tag('div', array('class' => Enum::ORBIT_CAPTION), $caption);
}
return \CHtm... | [
"public",
"function",
"renderItem",
"(",
"$",
"item",
")",
"{",
"$",
"content",
"=",
"ArrayHelper",
"::",
"getValue",
"(",
"$",
"item",
",",
"'content'",
",",
"''",
")",
";",
"$",
"caption",
"=",
"ArrayHelper",
"::",
"getValue",
"(",
"$",
"item",
",",
... | Returns a generated LI tag item
@param array $item the item configuration
@return string the resulting li tag | [
"Returns",
"a",
"generated",
"LI",
"tag",
"item"
] | 49bed0d3ca1a9bac9299000e48a2661bdc8f9a29 | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/widgets/Orbit.php#L139-L148 |
20,112 | 2amigos/yiifoundation | widgets/Orbit.php | Orbit.registerClientScript | public function registerClientScript()
{
if (!empty($this->pluginOptions)) {
$options = \CJavaScript::encode($this->pluginOptions);
\Yii::app()->clientScript
->registerScript('Orbit#' . $this->getId(), "$(document).foundation('orbit', {$options});");
}
... | php | public function registerClientScript()
{
if (!empty($this->pluginOptions)) {
$options = \CJavaScript::encode($this->pluginOptions);
\Yii::app()->clientScript
->registerScript('Orbit#' . $this->getId(), "$(document).foundation('orbit', {$options});");
}
... | [
"public",
"function",
"registerClientScript",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"pluginOptions",
")",
")",
"{",
"$",
"options",
"=",
"\\",
"CJavaScript",
"::",
"encode",
"(",
"$",
"this",
"->",
"pluginOptions",
")",
";",
"... | Registers the plugin script | [
"Registers",
"the",
"plugin",
"script"
] | 49bed0d3ca1a9bac9299000e48a2661bdc8f9a29 | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/widgets/Orbit.php#L153-L164 |
20,113 | parsnick/steak | src/Console/BuildCommand.php | BuildCommand.runCleanTask | protected function runCleanTask($outputDir)
{
$cleanTime = $this->runTimedTask(function () use ($outputDir) {
$this->builder->clean($outputDir);
});
$this->output->writeln(
"<comment>Cleaned <path>{$outputDir}</path> in <time>{$cleanTime}ms</time></comment>",
... | php | protected function runCleanTask($outputDir)
{
$cleanTime = $this->runTimedTask(function () use ($outputDir) {
$this->builder->clean($outputDir);
});
$this->output->writeln(
"<comment>Cleaned <path>{$outputDir}</path> in <time>{$cleanTime}ms</time></comment>",
... | [
"protected",
"function",
"runCleanTask",
"(",
"$",
"outputDir",
")",
"{",
"$",
"cleanTime",
"=",
"$",
"this",
"->",
"runTimedTask",
"(",
"function",
"(",
")",
"use",
"(",
"$",
"outputDir",
")",
"{",
"$",
"this",
"->",
"builder",
"->",
"clean",
"(",
"$"... | Clean the output build directory.
@param string $outputDir | [
"Clean",
"the",
"output",
"build",
"directory",
"."
] | 461869189a640938438187330f6c50aca97c5ccc | https://github.com/parsnick/steak/blob/461869189a640938438187330f6c50aca97c5ccc/src/Console/BuildCommand.php#L92-L102 |
20,114 | parsnick/steak | src/Console/BuildCommand.php | BuildCommand.runBuildTask | protected function runBuildTask($sourceDir, $outputDir)
{
$buildTime = $this->runTimedTask(function () use ($sourceDir, $outputDir) {
$this->builder->build($sourceDir, $outputDir);
});
$this->output->writeln(
"<comment>PHP built in <time>{$buildTime}ms</time></commen... | php | protected function runBuildTask($sourceDir, $outputDir)
{
$buildTime = $this->runTimedTask(function () use ($sourceDir, $outputDir) {
$this->builder->build($sourceDir, $outputDir);
});
$this->output->writeln(
"<comment>PHP built in <time>{$buildTime}ms</time></commen... | [
"protected",
"function",
"runBuildTask",
"(",
"$",
"sourceDir",
",",
"$",
"outputDir",
")",
"{",
"$",
"buildTime",
"=",
"$",
"this",
"->",
"runTimedTask",
"(",
"function",
"(",
")",
"use",
"(",
"$",
"sourceDir",
",",
"$",
"outputDir",
")",
"{",
"$",
"t... | Build the new site pages.
@param string $sourceDir
@param string $outputDir | [
"Build",
"the",
"new",
"site",
"pages",
"."
] | 461869189a640938438187330f6c50aca97c5ccc | https://github.com/parsnick/steak/blob/461869189a640938438187330f6c50aca97c5ccc/src/Console/BuildCommand.php#L110-L120 |
20,115 | parsnick/steak | src/Console/BuildCommand.php | BuildCommand.runGulpTask | protected function runGulpTask()
{
$this->output->writeln("<comment>Starting gulp...</comment>", OutputInterface::VERBOSITY_VERY_VERBOSE);
$process = $this->createGulpProcess('steak:build');
$callback = $this->getProcessLogger($this->output);
$timer = new Stopwatch();
$time... | php | protected function runGulpTask()
{
$this->output->writeln("<comment>Starting gulp...</comment>", OutputInterface::VERBOSITY_VERY_VERBOSE);
$process = $this->createGulpProcess('steak:build');
$callback = $this->getProcessLogger($this->output);
$timer = new Stopwatch();
$time... | [
"protected",
"function",
"runGulpTask",
"(",
")",
"{",
"$",
"this",
"->",
"output",
"->",
"writeln",
"(",
"\"<comment>Starting gulp...</comment>\"",
",",
"OutputInterface",
"::",
"VERBOSITY_VERY_VERBOSE",
")",
";",
"$",
"process",
"=",
"$",
"this",
"->",
"createGu... | Trigger gulp to copy other assets to the build dir. | [
"Trigger",
"gulp",
"to",
"copy",
"other",
"assets",
"to",
"the",
"build",
"dir",
"."
] | 461869189a640938438187330f6c50aca97c5ccc | https://github.com/parsnick/steak/blob/461869189a640938438187330f6c50aca97c5ccc/src/Console/BuildCommand.php#L125-L173 |
20,116 | comodojo/cookies | src/Comodojo/Cookies/Cookie.php | Cookie.create | public static function create($name, array $properties = [], $serialize = true) {
try {
$class = get_called_class();
$cookie = new $class($name);
CookieTools::setCookieProperties($cookie, $properties, $serialize);
} catch (CookieException $ce) {
... | php | public static function create($name, array $properties = [], $serialize = true) {
try {
$class = get_called_class();
$cookie = new $class($name);
CookieTools::setCookieProperties($cookie, $properties, $serialize);
} catch (CookieException $ce) {
... | [
"public",
"static",
"function",
"create",
"(",
"$",
"name",
",",
"array",
"$",
"properties",
"=",
"[",
"]",
",",
"$",
"serialize",
"=",
"true",
")",
"{",
"try",
"{",
"$",
"class",
"=",
"get_called_class",
"(",
")",
";",
"$",
"cookie",
"=",
"new",
"... | Static method to quickly create a cookie
@param string $name
The cookie name
@param array $properties
Array of properties cookie should have
@return self
@throws CookieException | [
"Static",
"method",
"to",
"quickly",
"create",
"a",
"cookie"
] | a81c7dff37d52c1a75462c0ad30db75d0c3b0081 | https://github.com/comodojo/cookies/blob/a81c7dff37d52c1a75462c0ad30db75d0c3b0081/src/Comodojo/Cookies/Cookie.php#L63-L81 |
20,117 | comodojo/cookies | src/Comodojo/Cookies/Cookie.php | Cookie.retrieve | public static function retrieve($name) {
try {
$class = get_called_class();
$cookie = new $class($name);
return $cookie->load();
} catch (CookieException $ce) {
throw $ce;
}
} | php | public static function retrieve($name) {
try {
$class = get_called_class();
$cookie = new $class($name);
return $cookie->load();
} catch (CookieException $ce) {
throw $ce;
}
} | [
"public",
"static",
"function",
"retrieve",
"(",
"$",
"name",
")",
"{",
"try",
"{",
"$",
"class",
"=",
"get_called_class",
"(",
")",
";",
"$",
"cookie",
"=",
"new",
"$",
"class",
"(",
"$",
"name",
")",
";",
"return",
"$",
"cookie",
"->",
"load",
"(... | Static method to quickly get a cookie
@param string $name
The cookie name
@return self
@throws CookieException | [
"Static",
"method",
"to",
"quickly",
"get",
"a",
"cookie"
] | a81c7dff37d52c1a75462c0ad30db75d0c3b0081 | https://github.com/comodojo/cookies/blob/a81c7dff37d52c1a75462c0ad30db75d0c3b0081/src/Comodojo/Cookies/Cookie.php#L92-L108 |
20,118 | ronanguilloux/SilexMarkdownServiceProvider | src/Rg/Markdown/Finder.php | Finder.getContent | public function getContent($path)
{
// only a page index was given ?
if (('0' == $path) || (int) ($path) > 0) {
$path = $this->findByIndex($path);
} else {
$path = $this->basePath . '/' . $path;
$infos = pathinfo($path);
// was the extension gi... | php | public function getContent($path)
{
// only a page index was given ?
if (('0' == $path) || (int) ($path) > 0) {
$path = $this->findByIndex($path);
} else {
$path = $this->basePath . '/' . $path;
$infos = pathinfo($path);
// was the extension gi... | [
"public",
"function",
"getContent",
"(",
"$",
"path",
")",
"{",
"// only a page index was given ?",
"if",
"(",
"(",
"'0'",
"==",
"$",
"path",
")",
"||",
"(",
"int",
")",
"(",
"$",
"path",
")",
">",
"0",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->"... | getContent
Retrieve a file content using the given path
@param string $path the markdown file path
@return mixed: false or the markdown file raw content (string) | [
"getContent",
"Retrieve",
"a",
"file",
"content",
"using",
"the",
"given",
"path"
] | 8266baf0b8a74a98ea32ba1417d767dca6b374b3 | https://github.com/ronanguilloux/SilexMarkdownServiceProvider/blob/8266baf0b8a74a98ea32ba1417d767dca6b374b3/src/Rg/Markdown/Finder.php#L51-L69 |
20,119 | ronanguilloux/SilexMarkdownServiceProvider | src/Rg/Markdown/Finder.php | Finder.getList | public function getList()
{
$list = glob($this->basePath . "/*.md");
foreach ($list as $key=>$item) {
$item = pathinfo($item);
$item = $item['filename'];
$item = preg_split("/^[\d-]+/", $item, 2, PREG_SPLIT_NO_EMPTY);
$list[$key] = ucfirst(str_replace(... | php | public function getList()
{
$list = glob($this->basePath . "/*.md");
foreach ($list as $key=>$item) {
$item = pathinfo($item);
$item = $item['filename'];
$item = preg_split("/^[\d-]+/", $item, 2, PREG_SPLIT_NO_EMPTY);
$list[$key] = ucfirst(str_replace(... | [
"public",
"function",
"getList",
"(",
")",
"{",
"$",
"list",
"=",
"glob",
"(",
"$",
"this",
"->",
"basePath",
".",
"\"/*.md\"",
")",
";",
"foreach",
"(",
"$",
"list",
"as",
"$",
"key",
"=>",
"$",
"item",
")",
"{",
"$",
"item",
"=",
"pathinfo",
"(... | getList
In the file list returned, in array values, '-' become spaces.
@return array mardown file list | [
"getList",
"In",
"the",
"file",
"list",
"returned",
"in",
"array",
"values",
"-",
"become",
"spaces",
"."
] | 8266baf0b8a74a98ea32ba1417d767dca6b374b3 | https://github.com/ronanguilloux/SilexMarkdownServiceProvider/blob/8266baf0b8a74a98ea32ba1417d767dca6b374b3/src/Rg/Markdown/Finder.php#L96-L107 |
20,120 | jpcercal/resource-query-language | src/Parser/AbstractParser.php | AbstractParser.process | public function process(ExprBuilder $builder, $field, $expression, $value)
{
if (!Expr::isValidExpression($expression)) {
throw new ParserException(sprintf(
'The expression "%s" is not allowed or not exists.',
$expression
));
}
switch ... | php | public function process(ExprBuilder $builder, $field, $expression, $value)
{
if (!Expr::isValidExpression($expression)) {
throw new ParserException(sprintf(
'The expression "%s" is not allowed or not exists.',
$expression
));
}
switch ... | [
"public",
"function",
"process",
"(",
"ExprBuilder",
"$",
"builder",
",",
"$",
"field",
",",
"$",
"expression",
",",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"Expr",
"::",
"isValidExpression",
"(",
"$",
"expression",
")",
")",
"{",
"throw",
"new",
"Pars... | Process one expression an enqueue it using the ExprBuilder instance.
@param ExprBuilder $builder
@param string $field
@param string $expression
@param string $value
@return ExprBuilder
@throws ParserException | [
"Process",
"one",
"expression",
"an",
"enqueue",
"it",
"using",
"the",
"ExprBuilder",
"instance",
"."
] | 2a1520198c717a8199cd8d3d85ca2557e24cb7f5 | https://github.com/jpcercal/resource-query-language/blob/2a1520198c717a8199cd8d3d85ca2557e24cb7f5/src/Parser/AbstractParser.php#L53-L94 |
20,121 | yuncms/framework | src/filters/OAuth2Authorize.php | OAuth2Authorize.afterAction | public function afterAction($action, $result)
{
if (Yii::$app->user->isGuest) {
return $result;
} else {
return $this->finishAuthorization();
}
} | php | public function afterAction($action, $result)
{
if (Yii::$app->user->isGuest) {
return $result;
} else {
return $this->finishAuthorization();
}
} | [
"public",
"function",
"afterAction",
"(",
"$",
"action",
",",
"$",
"result",
")",
"{",
"if",
"(",
"Yii",
"::",
"$",
"app",
"->",
"user",
"->",
"isGuest",
")",
"{",
"return",
"$",
"result",
";",
"}",
"else",
"{",
"return",
"$",
"this",
"->",
"finish... | If user is logged on, do oauth login immediatly,
continue authorization in the another case
@param \yii\base\Action $action
@param mixed $result
@return mixed
@throws Exception | [
"If",
"user",
"is",
"logged",
"on",
"do",
"oauth",
"login",
"immediatly",
"continue",
"authorization",
"in",
"the",
"another",
"case"
] | af42e28ea4ae15ab8eead3f6d119f93863b94154 | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/filters/OAuth2Authorize.php#L95-L102 |
20,122 | silverbusters/silverstripe-simplelistfield | forms/SimpleListField/SimpleListField.php | SimpleListField.addScenarioFromYml | public static function addScenarioFromYml($key){
$cfg = Config::inst()->get('SimpleListField', 'Scenarios');
if( isset($cfg[$key]) ){
if( (isset($cfg[$key]['preload']) && !$cfg[$key]['preload']) || !isset($cfg[$key]['preload']) ){
self::$scenarios[$key] = $cfg[$key];
}
}
} | php | public static function addScenarioFromYml($key){
$cfg = Config::inst()->get('SimpleListField', 'Scenarios');
if( isset($cfg[$key]) ){
if( (isset($cfg[$key]['preload']) && !$cfg[$key]['preload']) || !isset($cfg[$key]['preload']) ){
self::$scenarios[$key] = $cfg[$key];
}
}
} | [
"public",
"static",
"function",
"addScenarioFromYml",
"(",
"$",
"key",
")",
"{",
"$",
"cfg",
"=",
"Config",
"::",
"inst",
"(",
")",
"->",
"get",
"(",
"'SimpleListField'",
",",
"'Scenarios'",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"cfg",
"[",
"$",
"k... | Add single scenario by using yml configuration | [
"Add",
"single",
"scenario",
"by",
"using",
"yml",
"configuration"
] | c883e13b1b877d74e266edf2a646661039803440 | https://github.com/silverbusters/silverstripe-simplelistfield/blob/c883e13b1b877d74e266edf2a646661039803440/forms/SimpleListField/SimpleListField.php#L115-L123 |
20,123 | askupasoftware/amarkal | Extensions/WordPress/MetaBox/MetaBox.php | MetaBox.add_meta_boxes | public function add_meta_boxes( $post_type )
{
if ( in_array( $post_type, $this->settings['post_types'] )) {
add_meta_box(
$this->settings['id'],
$this->settings['title'],
array( $this, 'render' ),
$post_type,
$t... | php | public function add_meta_boxes( $post_type )
{
if ( in_array( $post_type, $this->settings['post_types'] )) {
add_meta_box(
$this->settings['id'],
$this->settings['title'],
array( $this, 'render' ),
$post_type,
$t... | [
"public",
"function",
"add_meta_boxes",
"(",
"$",
"post_type",
")",
"{",
"if",
"(",
"in_array",
"(",
"$",
"post_type",
",",
"$",
"this",
"->",
"settings",
"[",
"'post_types'",
"]",
")",
")",
"{",
"add_meta_box",
"(",
"$",
"this",
"->",
"settings",
"[",
... | Adds the meta box container. | [
"Adds",
"the",
"meta",
"box",
"container",
"."
] | fe8283e2d6847ef697abec832da7ee741a85058c | https://github.com/askupasoftware/amarkal/blob/fe8283e2d6847ef697abec832da7ee741a85058c/Extensions/WordPress/MetaBox/MetaBox.php#L114-L126 |
20,124 | askupasoftware/amarkal | Extensions/WordPress/MetaBox/MetaBox.php | MetaBox.save | public function save( $post_id )
{
/**
* A note on security:
*
* We need to verify this came from the our screen and with proper authorization,
* because save_post can be triggered at other times. since metaboxes can
* be removed - by having a nonce field in o... | php | public function save( $post_id )
{
/**
* A note on security:
*
* We need to verify this came from the our screen and with proper authorization,
* because save_post can be triggered at other times. since metaboxes can
* be removed - by having a nonce field in o... | [
"public",
"function",
"save",
"(",
"$",
"post_id",
")",
"{",
"/**\n * A note on security:\n * \n * We need to verify this came from the our screen and with proper authorization,\n * because save_post can be triggered at other times. since metaboxes can \n * be... | Save the meta when the post is saved.
@param int $post_id The ID of the post being saved. | [
"Save",
"the",
"meta",
"when",
"the",
"post",
"is",
"saved",
"."
] | fe8283e2d6847ef697abec832da7ee741a85058c | https://github.com/askupasoftware/amarkal/blob/fe8283e2d6847ef697abec832da7ee741a85058c/Extensions/WordPress/MetaBox/MetaBox.php#L133-L195 |
20,125 | askupasoftware/amarkal | Extensions/WordPress/MetaBox/MetaBox.php | MetaBox.render | public function render( $post )
{
$old_instance = \get_post_meta( $post->ID, $this->settings['id'], true );
$this->form->updater->update( $old_instance === "" ? array() : $old_instance );
// Add an nonce field so we can check for it later.
wp_nonce_field( $this->action_name(), $this... | php | public function render( $post )
{
$old_instance = \get_post_meta( $post->ID, $this->settings['id'], true );
$this->form->updater->update( $old_instance === "" ? array() : $old_instance );
// Add an nonce field so we can check for it later.
wp_nonce_field( $this->action_name(), $this... | [
"public",
"function",
"render",
"(",
"$",
"post",
")",
"{",
"$",
"old_instance",
"=",
"\\",
"get_post_meta",
"(",
"$",
"post",
"->",
"ID",
",",
"$",
"this",
"->",
"settings",
"[",
"'id'",
"]",
",",
"true",
")",
";",
"$",
"this",
"->",
"form",
"->",... | Render Meta Box content.
@param WP_Post $post The post object. | [
"Render",
"Meta",
"Box",
"content",
"."
] | fe8283e2d6847ef697abec832da7ee741a85058c | https://github.com/askupasoftware/amarkal/blob/fe8283e2d6847ef697abec832da7ee741a85058c/Extensions/WordPress/MetaBox/MetaBox.php#L202-L209 |
20,126 | askupasoftware/amarkal | Extensions/WordPress/MetaBox/MetaBox.php | MetaBox.get_meta_value | static function get_meta_value( $post_id, $metabox_id, $field_name = null )
{
$meta = \get_post_meta( $post_id, $metabox_id, true );
if( null == $field_name )
{
return $meta;
}
if( isset($meta[$field_name]) )
{
return $meta[$field_name... | php | static function get_meta_value( $post_id, $metabox_id, $field_name = null )
{
$meta = \get_post_meta( $post_id, $metabox_id, true );
if( null == $field_name )
{
return $meta;
}
if( isset($meta[$field_name]) )
{
return $meta[$field_name... | [
"static",
"function",
"get_meta_value",
"(",
"$",
"post_id",
",",
"$",
"metabox_id",
",",
"$",
"field_name",
"=",
"null",
")",
"{",
"$",
"meta",
"=",
"\\",
"get_post_meta",
"(",
"$",
"post_id",
",",
"$",
"metabox_id",
",",
"true",
")",
";",
"if",
"(",
... | Get a meta box value for a given post id, by specifying the metabox
id and field name. If no field name is given, an associative array with
all the meta box values will be returned.
@param int $post_id The post's id
@param string $metabox_id The metabox id
@param string $field_name (optional) The metabox field name
@r... | [
"Get",
"a",
"meta",
"box",
"value",
"for",
"a",
"given",
"post",
"id",
"by",
"specifying",
"the",
"metabox",
"id",
"and",
"field",
"name",
".",
"If",
"no",
"field",
"name",
"is",
"given",
"an",
"associative",
"array",
"with",
"all",
"the",
"meta",
"box... | fe8283e2d6847ef697abec832da7ee741a85058c | https://github.com/askupasoftware/amarkal/blob/fe8283e2d6847ef697abec832da7ee741a85058c/Extensions/WordPress/MetaBox/MetaBox.php#L221-L233 |
20,127 | webforge-labs/psc-cms | lib/Psc/PHPExcel/SimpleImporter.php | SimpleImporter.findAll | public function findAll() {
$sheets = array();
foreach ($this->readSelectedSheets() as $selectName => $excelSheet) {
$sheets[$selectName] = new Sheet($selectName, $this->readRows($excelSheet));
}
return $sheets;
} | php | public function findAll() {
$sheets = array();
foreach ($this->readSelectedSheets() as $selectName => $excelSheet) {
$sheets[$selectName] = new Sheet($selectName, $this->readRows($excelSheet));
}
return $sheets;
} | [
"public",
"function",
"findAll",
"(",
")",
"{",
"$",
"sheets",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"readSelectedSheets",
"(",
")",
"as",
"$",
"selectName",
"=>",
"$",
"excelSheet",
")",
"{",
"$",
"sheets",
"[",
"$",
"selec... | Returns all selected Sheets with all rows
@return Sheet[] | [
"Returns",
"all",
"selected",
"Sheets",
"with",
"all",
"rows"
] | 467bfa2547e6b4fa487d2d7f35fa6cc618dbc763 | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/PHPExcel/SimpleImporter.php#L65-L73 |
20,128 | Nozemi/SlickBoard-Library | lib/SBLib/Utilities/MISC.php | MISC.findFile | public static function findFile($file, $loops = 3) {
// Checks whether or not $file exists.
if (!file_exists($file)) {
// How many parent folders it'll check. (3 by default)
for ($i = 0; $i < $loops; $i++) {
if (!file_exists($file)) {
$file = '... | php | public static function findFile($file, $loops = 3) {
// Checks whether or not $file exists.
if (!file_exists($file)) {
// How many parent folders it'll check. (3 by default)
for ($i = 0; $i < $loops; $i++) {
if (!file_exists($file)) {
$file = '... | [
"public",
"static",
"function",
"findFile",
"(",
"$",
"file",
",",
"$",
"loops",
"=",
"3",
")",
"{",
"// Checks whether or not $file exists.",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"file",
")",
")",
"{",
"// How many parent folders it'll check. (3 by default)",
... | Finds a file, by default it will try up to 3 parent folders. | [
"Finds",
"a",
"file",
"by",
"default",
"it",
"will",
"try",
"up",
"to",
"3",
"parent",
"folders",
"."
] | c9f0a26a30f8127c997f75d7232eac170972418d | https://github.com/Nozemi/SlickBoard-Library/blob/c9f0a26a30f8127c997f75d7232eac170972418d/lib/SBLib/Utilities/MISC.php#L31-L43 |
20,129 | Nozemi/SlickBoard-Library | lib/SBLib/Utilities/MISC.php | MISC.findKey | public static function findKey($aKey, $array) {
// Check if an array is provided.
if (is_array($array)) {
// Loops through the array.
foreach ($array as $key => $item) {
// Checks if it did find the matching key. If it doesn't, it continues looping until it does,
... | php | public static function findKey($aKey, $array) {
// Check if an array is provided.
if (is_array($array)) {
// Loops through the array.
foreach ($array as $key => $item) {
// Checks if it did find the matching key. If it doesn't, it continues looping until it does,
... | [
"public",
"static",
"function",
"findKey",
"(",
"$",
"aKey",
",",
"$",
"array",
")",
"{",
"// Check if an array is provided.",
"if",
"(",
"is_array",
"(",
"$",
"array",
")",
")",
"{",
"// Loops through the array.",
"foreach",
"(",
"$",
"array",
"as",
"$",
"k... | in the array the key is, just that it exists in there somewhere. | [
"in",
"the",
"array",
"the",
"key",
"is",
"just",
"that",
"it",
"exists",
"in",
"there",
"somewhere",
"."
] | c9f0a26a30f8127c997f75d7232eac170972418d | https://github.com/Nozemi/SlickBoard-Library/blob/c9f0a26a30f8127c997f75d7232eac170972418d/lib/SBLib/Utilities/MISC.php#L55-L73 |
20,130 | daithi-coombes/bluemix-personality-insights-php | lib/Config.php | Config.getInstance | public static function getInstance($configFile='config.yml')
{
static $instance = null;
if (null === $instance) {
$instance = new static();
}
$configuration = Yaml::parse(file_get_contents($configFile));
$instance->setParams($configuration);
return $inst... | php | public static function getInstance($configFile='config.yml')
{
static $instance = null;
if (null === $instance) {
$instance = new static();
}
$configuration = Yaml::parse(file_get_contents($configFile));
$instance->setParams($configuration);
return $inst... | [
"public",
"static",
"function",
"getInstance",
"(",
"$",
"configFile",
"=",
"'config.yml'",
")",
"{",
"static",
"$",
"instance",
"=",
"null",
";",
"if",
"(",
"null",
"===",
"$",
"instance",
")",
"{",
"$",
"instance",
"=",
"new",
"static",
"(",
")",
";"... | Config singleton.
@param string $configFile The yaml config file relative to project root.
@return Config The *Singleton* instance. | [
"Config",
"singleton",
"."
] | 171bd0a6deb3e1e9a7b38fc61c2a7ae601d76a9a | https://github.com/daithi-coombes/bluemix-personality-insights-php/blob/171bd0a6deb3e1e9a7b38fc61c2a7ae601d76a9a/lib/Config.php#L26-L37 |
20,131 | PortaText/php-sdk | src/PortaText/Client/Base.php | Base.assertResult | protected function assertResult($descriptor, $result)
{
$errors = array(
401 => "InvalidCredentials",
402 => "PaymentRequired",
403 => "Forbidden",
404 => "NotFound",
405 => "InvalidMethod",
406 => "NotAcceptable",
415 => "I... | php | protected function assertResult($descriptor, $result)
{
$errors = array(
401 => "InvalidCredentials",
402 => "PaymentRequired",
403 => "Forbidden",
404 => "NotFound",
405 => "InvalidMethod",
406 => "NotAcceptable",
415 => "I... | [
"protected",
"function",
"assertResult",
"(",
"$",
"descriptor",
",",
"$",
"result",
")",
"{",
"$",
"errors",
"=",
"array",
"(",
"401",
"=>",
"\"InvalidCredentials\"",
",",
"402",
"=>",
"\"PaymentRequired\"",
",",
"403",
"=>",
"\"Forbidden\"",
",",
"404",
"=... | Will assert that the request finished successfuly.
@param PortaText\Command\Descriptor $descriptor The Command execution
descriptor.
@param PortaText\Command\Result $result Request execution result.
@return void
@throws PortaText\Exception\ServerError
@throws PortaText\Exception\ClientError
@throws PortaText\Exceptio... | [
"Will",
"assert",
"that",
"the",
"request",
"finished",
"successfuly",
"."
] | dbe04ef043db5b251953f9de57aa4d0f1785dfcc | https://github.com/PortaText/php-sdk/blob/dbe04ef043db5b251953f9de57aa4d0f1785dfcc/src/PortaText/Client/Base.php#L275-L294 |
20,132 | webforge-labs/psc-cms | lib/Psc/Form/ValidationPackage.php | ValidationPackage.createValidator | public function createValidator(Array $simpleRules = array()) {
$validator = new Validator();
if (count($simpleRules) > 0) {
$validator->addSimpleRules($simpleRules);
}
return $validator;
} | php | public function createValidator(Array $simpleRules = array()) {
$validator = new Validator();
if (count($simpleRules) > 0) {
$validator->addSimpleRules($simpleRules);
}
return $validator;
} | [
"public",
"function",
"createValidator",
"(",
"Array",
"$",
"simpleRules",
"=",
"array",
"(",
")",
")",
"{",
"$",
"validator",
"=",
"new",
"Validator",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"simpleRules",
")",
">",
"0",
")",
"{",
"$",
"validat... | Erstellt einen Validator mit den SimpleRules
'field'=>'nes'
$validator->validate('field', $formValue); | [
"Erstellt",
"einen",
"Validator",
"mit",
"den",
"SimpleRules"
] | 467bfa2547e6b4fa487d2d7f35fa6cc618dbc763 | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Form/ValidationPackage.php#L74-L81 |
20,133 | webforge-labs/psc-cms | lib/Psc/Form/ValidationPackage.php | ValidationPackage.createComponentsValidator | public function createComponentsValidator(FormData $requestData, EntityFormPanel $panel, DCPackage $dc, Array $components = NULL) {
$this->validationEntity = $entity = $panel->getEntityForm()->getEntity();
$components = isset($components) ? Code::castCollection($components) : $panel->getEntityForm()->getCo... | php | public function createComponentsValidator(FormData $requestData, EntityFormPanel $panel, DCPackage $dc, Array $components = NULL) {
$this->validationEntity = $entity = $panel->getEntityForm()->getEntity();
$components = isset($components) ? Code::castCollection($components) : $panel->getEntityForm()->getCo... | [
"public",
"function",
"createComponentsValidator",
"(",
"FormData",
"$",
"requestData",
",",
"EntityFormPanel",
"$",
"panel",
",",
"DCPackage",
"$",
"dc",
",",
"Array",
"$",
"components",
"=",
"NULL",
")",
"{",
"$",
"this",
"->",
"validationEntity",
"=",
"$",
... | Erstellt einen ComponentsValidator anhand des EntityFormPanels
Der FormPanel muss die Componenten schon erstellt haben sie werden mit getComponents() aus dem Formular genommen | [
"Erstellt",
"einen",
"ComponentsValidator",
"anhand",
"des",
"EntityFormPanels"
] | 467bfa2547e6b4fa487d2d7f35fa6cc618dbc763 | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Form/ValidationPackage.php#L108-L118 |
20,134 | webforge-labs/psc-cms | lib/Psc/Form/ValidationPackage.php | ValidationPackage.createFormDataSet | public function createFormDataSet(FormData $requestData, EntityFormPanel $panel, Entity $entity) {
$meta = $entity->getSetMeta();
// wir müssen die Spezial-Felder vom EntityFormPanel hier tracken
foreach ($panel->getControlFields() as $field) {
$meta->setFieldType($field, Type::create('String'));... | php | public function createFormDataSet(FormData $requestData, EntityFormPanel $panel, Entity $entity) {
$meta = $entity->getSetMeta();
// wir müssen die Spezial-Felder vom EntityFormPanel hier tracken
foreach ($panel->getControlFields() as $field) {
$meta->setFieldType($field, Type::create('String'));... | [
"public",
"function",
"createFormDataSet",
"(",
"FormData",
"$",
"requestData",
",",
"EntityFormPanel",
"$",
"panel",
",",
"Entity",
"$",
"entity",
")",
"{",
"$",
"meta",
"=",
"$",
"entity",
"->",
"getSetMeta",
"(",
")",
";",
"// wir müssen die Spezial-Felder vo... | Erstellt aus dem Request und dem FormPanel ein Set mit allen FormularDaten
man könnte sich hier auch mal vorstellen die formulardaten im set aufzusplitten
Sicherheit: alle Felder die nicht registriert sind durch Componenten oder den Formpanel (getControlFields) schmeissen hier eine Exception | [
"Erstellt",
"aus",
"dem",
"Request",
"und",
"dem",
"FormPanel",
"ein",
"Set",
"mit",
"allen",
"FormularDaten"
] | 467bfa2547e6b4fa487d2d7f35fa6cc618dbc763 | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Form/ValidationPackage.php#L137-L156 |
20,135 | aedart/laravel-helpers | src/Traits/Cache/CacheTrait.php | CacheTrait.getDefaultCache | public function getDefaultCache(): ?Repository
{
// By default, the Cache Facade does not return the
// any actual cache repository, but rather an
// instance of \Illuminate\Cache\CacheManager.
// Therefore, we make sure only to obtain its
// "store", to make sure that its on... | php | public function getDefaultCache(): ?Repository
{
// By default, the Cache Facade does not return the
// any actual cache repository, but rather an
// instance of \Illuminate\Cache\CacheManager.
// Therefore, we make sure only to obtain its
// "store", to make sure that its on... | [
"public",
"function",
"getDefaultCache",
"(",
")",
":",
"?",
"Repository",
"{",
"// By default, the Cache Facade does not return the",
"// any actual cache repository, but rather an",
"// instance of \\Illuminate\\Cache\\CacheManager.",
"// Therefore, we make sure only to obtain its",
"// ... | Get a default cache value, if any is available
@return Repository|null A default cache value or Null if no default value is available | [
"Get",
"a",
"default",
"cache",
"value",
"if",
"any",
"is",
"available"
] | 8b81a2d6658f3f8cb62b6be2c34773aaa2df219a | https://github.com/aedart/laravel-helpers/blob/8b81a2d6658f3f8cb62b6be2c34773aaa2df219a/src/Traits/Cache/CacheTrait.php#L76-L89 |
20,136 | aryelgois/yasql-php | src/Composer.php | Composer.generate | public static function generate(Event $event)
{
$args = $event->getArguments();
if (empty($args)) {
echo "Usage:\n\n"
. " composer yasql-generate -- YASQL_FILE [INDENTATION]\n\n"
. "By default, INDENTATION is 2\n";
die(1);
}
... | php | public static function generate(Event $event)
{
$args = $event->getArguments();
if (empty($args)) {
echo "Usage:\n\n"
. " composer yasql-generate -- YASQL_FILE [INDENTATION]\n\n"
. "By default, INDENTATION is 2\n";
die(1);
}
... | [
"public",
"static",
"function",
"generate",
"(",
"Event",
"$",
"event",
")",
"{",
"$",
"args",
"=",
"$",
"event",
"->",
"getArguments",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"args",
")",
")",
"{",
"echo",
"\"Usage:\\n\\n\"",
".",
"\" composer... | Generates the SQL from a YASQL file
Arguments:
string $1 Path to YASQL file
int $2 How many spaces per indentation level
@param Event $event Composer run-script event | [
"Generates",
"the",
"SQL",
"from",
"a",
"YASQL",
"file"
] | f428b180d35bfc1ddf1f9b3323f9b085fbc09ac7 | https://github.com/aryelgois/yasql-php/blob/f428b180d35bfc1ddf1f9b3323f9b085fbc09ac7/src/Composer.php#L101-L116 |
20,137 | webforge-labs/psc-cms | lib/Psc/Doctrine/PhpParser.php | PhpParser.parseUseStatement | private function parseUseStatement()
{
$class = '';
$alias = '';
$statements = array();
$explicitAlias = false;
while (($token = $this->next())) {
$isNameToken = $token[0] === T_STRING || $token[0] === T_NS_SEPARATOR;
if (!$explicitAlias && $isNameToke... | php | private function parseUseStatement()
{
$class = '';
$alias = '';
$statements = array();
$explicitAlias = false;
while (($token = $this->next())) {
$isNameToken = $token[0] === T_STRING || $token[0] === T_NS_SEPARATOR;
if (!$explicitAlias && $isNameToke... | [
"private",
"function",
"parseUseStatement",
"(",
")",
"{",
"$",
"class",
"=",
"''",
";",
"$",
"alias",
"=",
"''",
";",
"$",
"statements",
"=",
"array",
"(",
")",
";",
"$",
"explicitAlias",
"=",
"false",
";",
"while",
"(",
"(",
"$",
"token",
"=",
"$... | Parse a single use statement.
@return array A list with all found class names for a use statement. | [
"Parse",
"a",
"single",
"use",
"statement",
"."
] | 467bfa2547e6b4fa487d2d7f35fa6cc618dbc763 | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Doctrine/PhpParser.php#L195-L225 |
20,138 | antonmedv/silicone | src/Silicone/Routing/Loader/AnnotatedRouteControllerLoader.php | AnnotatedRouteControllerLoader.getDefaultRouteName | protected function getDefaultRouteName(\ReflectionClass $class, \ReflectionMethod $method)
{
$routeName = parent::getDefaultRouteName($class, $method);
return preg_replace(array(
'/(module_|controller_?)/',
'/__/'
), array(
'_',
'_'
),... | php | protected function getDefaultRouteName(\ReflectionClass $class, \ReflectionMethod $method)
{
$routeName = parent::getDefaultRouteName($class, $method);
return preg_replace(array(
'/(module_|controller_?)/',
'/__/'
), array(
'_',
'_'
),... | [
"protected",
"function",
"getDefaultRouteName",
"(",
"\\",
"ReflectionClass",
"$",
"class",
",",
"\\",
"ReflectionMethod",
"$",
"method",
")",
"{",
"$",
"routeName",
"=",
"parent",
"::",
"getDefaultRouteName",
"(",
"$",
"class",
",",
"$",
"method",
")",
";",
... | Makes the default route name more sane by removing common keywords.
@param \ReflectionClass $class A ReflectionClass instance
@param \ReflectionMethod $method A ReflectionMethod instance
@return string | [
"Makes",
"the",
"default",
"route",
"name",
"more",
"sane",
"by",
"removing",
"common",
"keywords",
"."
] | e4a67ed41f0f419984df642b303f2a491c9a3933 | https://github.com/antonmedv/silicone/blob/e4a67ed41f0f419984df642b303f2a491c9a3933/src/Silicone/Routing/Loader/AnnotatedRouteControllerLoader.php#L36-L47 |
20,139 | Double-Opt-in/php-client-api | src/Client/Api.php | Api.resolveClient | private function resolveClient($client)
{
$client = ! empty($client)
? $client
: new Client();
$client->setBaseUrl(Properties::baseUrl())
->setUserAgent('Double Opt-in php-api/' . self::VERSION);
$httpClientConfig = $this->config->getHttpClientConfig();
if (array_key_exists('verify', $httpClientConf... | php | private function resolveClient($client)
{
$client = ! empty($client)
? $client
: new Client();
$client->setBaseUrl(Properties::baseUrl())
->setUserAgent('Double Opt-in php-api/' . self::VERSION);
$httpClientConfig = $this->config->getHttpClientConfig();
if (array_key_exists('verify', $httpClientConf... | [
"private",
"function",
"resolveClient",
"(",
"$",
"client",
")",
"{",
"$",
"client",
"=",
"!",
"empty",
"(",
"$",
"client",
")",
"?",
"$",
"client",
":",
"new",
"Client",
"(",
")",
";",
"$",
"client",
"->",
"setBaseUrl",
"(",
"Properties",
"::",
"bas... | resolves a http client
@param ClientInterface|null $client
@return ClientInterface|Client | [
"resolves",
"a",
"http",
"client"
] | 2f17da58ec20a408bbd55b2cdd053bc689f995f4 | https://github.com/Double-Opt-in/php-client-api/blob/2f17da58ec20a408bbd55b2cdd053bc689f995f4/src/Client/Api.php#L84-L101 |
20,140 | Double-Opt-in/php-client-api | src/Client/Api.php | Api.setupOAuth2Plugin | private function setupOAuth2Plugin()
{
$oauth2AuthorizationClient = $this->resolveClient(null);
$oauth2AuthorizationClient->setBaseUrl(Properties::authorizationUrl());
$clientCredentials = new ClientCredentials($oauth2AuthorizationClient, $this->config->toArray());
$oauth2Plugin = new OAuth2Plugin($clientCred... | php | private function setupOAuth2Plugin()
{
$oauth2AuthorizationClient = $this->resolveClient(null);
$oauth2AuthorizationClient->setBaseUrl(Properties::authorizationUrl());
$clientCredentials = new ClientCredentials($oauth2AuthorizationClient, $this->config->toArray());
$oauth2Plugin = new OAuth2Plugin($clientCred... | [
"private",
"function",
"setupOAuth2Plugin",
"(",
")",
"{",
"$",
"oauth2AuthorizationClient",
"=",
"$",
"this",
"->",
"resolveClient",
"(",
"null",
")",
";",
"$",
"oauth2AuthorizationClient",
"->",
"setBaseUrl",
"(",
"Properties",
"::",
"authorizationUrl",
"(",
")"... | setting up the oauth2 plugin for authorizing the requests | [
"setting",
"up",
"the",
"oauth2",
"plugin",
"for",
"authorizing",
"the",
"requests"
] | 2f17da58ec20a408bbd55b2cdd053bc689f995f4 | https://github.com/Double-Opt-in/php-client-api/blob/2f17da58ec20a408bbd55b2cdd053bc689f995f4/src/Client/Api.php#L106-L116 |
20,141 | Double-Opt-in/php-client-api | src/Client/Api.php | Api.send | public function send(ClientCommand $command)
{
$request = $this->client->createRequest(
$command->method(),
$this->client->getBaseUrl() . $command->uri($this->cryptographyEngine),
$this->headers($command->apiVersion(), $command->format(), $command->headers()),
$command->body($this->cryptographyEngine),
... | php | public function send(ClientCommand $command)
{
$request = $this->client->createRequest(
$command->method(),
$this->client->getBaseUrl() . $command->uri($this->cryptographyEngine),
$this->headers($command->apiVersion(), $command->format(), $command->headers()),
$command->body($this->cryptographyEngine),
... | [
"public",
"function",
"send",
"(",
"ClientCommand",
"$",
"command",
")",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"client",
"->",
"createRequest",
"(",
"$",
"command",
"->",
"method",
"(",
")",
",",
"$",
"this",
"->",
"client",
"->",
"getBaseUrl",
... | get all actions
@param ClientCommand $command
@return Response|CommandResponse|DecryptedCommandResponse|StatusResponse | [
"get",
"all",
"actions"
] | 2f17da58ec20a408bbd55b2cdd053bc689f995f4 | https://github.com/Double-Opt-in/php-client-api/blob/2f17da58ec20a408bbd55b2cdd053bc689f995f4/src/Client/Api.php#L125-L144 |
20,142 | lode/fem | src/login_token.php | login_token.get_by_token | public static function get_by_token($token) {
$mysql = bootstrap::get_library('mysql');
$sql = "SELECT * FROM `login_tokens` WHERE `code` = '%s';";
$login = $mysql::select('row', $sql, $token);
if (empty($login)) {
return false;
}
return new static($login['id']);
} | php | public static function get_by_token($token) {
$mysql = bootstrap::get_library('mysql');
$sql = "SELECT * FROM `login_tokens` WHERE `code` = '%s';";
$login = $mysql::select('row', $sql, $token);
if (empty($login)) {
return false;
}
return new static($login['id']);
} | [
"public",
"static",
"function",
"get_by_token",
"(",
"$",
"token",
")",
"{",
"$",
"mysql",
"=",
"bootstrap",
"::",
"get_library",
"(",
"'mysql'",
")",
";",
"$",
"sql",
"=",
"\"SELECT * FROM `login_tokens` WHERE `code` = '%s';\"",
";",
"$",
"login",
"=",
"$",
"... | checks whether the given token match one on file
@param string $token
@return $this|boolean false when the token is not found | [
"checks",
"whether",
"the",
"given",
"token",
"match",
"one",
"on",
"file"
] | c1c466c1a904d99452b341c5ae7cbc3e22b106e1 | https://github.com/lode/fem/blob/c1c466c1a904d99452b341c5ae7cbc3e22b106e1/src/login_token.php#L80-L90 |
20,143 | lode/fem | src/login_token.php | login_token.is_valid | public function is_valid($mark_as_used=true) {
if (!empty($this->data['used'])) {
return false;
}
if (time() > $this->data['expire_at']) {
return false;
}
if ($mark_as_used) {
$this->mark_as_used();
}
return true;
} | php | public function is_valid($mark_as_used=true) {
if (!empty($this->data['used'])) {
return false;
}
if (time() > $this->data['expire_at']) {
return false;
}
if ($mark_as_used) {
$this->mark_as_used();
}
return true;
} | [
"public",
"function",
"is_valid",
"(",
"$",
"mark_as_used",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"data",
"[",
"'used'",
"]",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"time",
"(",
")",
">",
"$",
"... | check if the token is still valid
also marks the token as used to prevent more people getting in
@param boolean $mark_as_used set to false to validate w/o user action
@return boolean | [
"check",
"if",
"the",
"token",
"is",
"still",
"valid",
"also",
"marks",
"the",
"token",
"as",
"used",
"to",
"prevent",
"more",
"people",
"getting",
"in"
] | c1c466c1a904d99452b341c5ae7cbc3e22b106e1 | https://github.com/lode/fem/blob/c1c466c1a904d99452b341c5ae7cbc3e22b106e1/src/login_token.php#L99-L112 |
20,144 | lode/fem | src/login_token.php | login_token.create | public static function create($user_id) {
$text = bootstrap::get_library('text');
$mysql = bootstrap::get_library('mysql');
$new_token = $text::generate_token(self::TOKEN_LENGTH);
$expiration = (time() + self::EXPIRATION);
$sql = "INSERT INTO `login_tokens` SET `code` = '%s', `user_id` = %d, `expire_at` = ... | php | public static function create($user_id) {
$text = bootstrap::get_library('text');
$mysql = bootstrap::get_library('mysql');
$new_token = $text::generate_token(self::TOKEN_LENGTH);
$expiration = (time() + self::EXPIRATION);
$sql = "INSERT INTO `login_tokens` SET `code` = '%s', `user_id` = %d, `expire_at` = ... | [
"public",
"static",
"function",
"create",
"(",
"$",
"user_id",
")",
"{",
"$",
"text",
"=",
"bootstrap",
"::",
"get_library",
"(",
"'text'",
")",
";",
"$",
"mysql",
"=",
"bootstrap",
"::",
"get_library",
"(",
"'mysql'",
")",
";",
"$",
"new_token",
"=",
... | create a new temporary login token
@param int $user_id
@return $this | [
"create",
"a",
"new",
"temporary",
"login",
"token"
] | c1c466c1a904d99452b341c5ae7cbc3e22b106e1 | https://github.com/lode/fem/blob/c1c466c1a904d99452b341c5ae7cbc3e22b106e1/src/login_token.php#L143-L155 |
20,145 | 2amigos/yiifoundation | helpers/Icon.php | Icon.registerIconFontSet | public static function registerIconFontSet($fontName, $forceCopyAssets = false)
{
if (!in_array($fontName, static::getAvailableIconFontSets())) {
return false;
}
$fontPath = \Yii::getPathOfAlias('foundation.fonts.foundation_icons_' . $fontName);
$fontUrl = \Yii::app()->... | php | public static function registerIconFontSet($fontName, $forceCopyAssets = false)
{
if (!in_array($fontName, static::getAvailableIconFontSets())) {
return false;
}
$fontPath = \Yii::getPathOfAlias('foundation.fonts.foundation_icons_' . $fontName);
$fontUrl = \Yii::app()->... | [
"public",
"static",
"function",
"registerIconFontSet",
"(",
"$",
"fontName",
",",
"$",
"forceCopyAssets",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"fontName",
",",
"static",
"::",
"getAvailableIconFontSets",
"(",
")",
")",
")",
"{",
"r... | Registers a specific Icon Set. They are registered individually
@param $fontName
@param $forceCopyAssets
@return bool | [
"Registers",
"a",
"specific",
"Icon",
"Set",
".",
"They",
"are",
"registered",
"individually"
] | 49bed0d3ca1a9bac9299000e48a2661bdc8f9a29 | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/helpers/Icon.php#L46-L60 |
20,146 | phossa2/config | src/Config/Loader/ConfigFileLoader.php | ConfigFileLoader.setRootDir | public function setRootDir(/*# string */ $rootDir)
{
$dir = realpath($rootDir);
if (false === $dir) {
throw new InvalidArgumentException(
Message::get(Message::CONFIG_ROOT_INVALID, $rootDir),
Message::CONFIG_ROOT_INVALID
);
}
... | php | public function setRootDir(/*# string */ $rootDir)
{
$dir = realpath($rootDir);
if (false === $dir) {
throw new InvalidArgumentException(
Message::get(Message::CONFIG_ROOT_INVALID, $rootDir),
Message::CONFIG_ROOT_INVALID
);
}
... | [
"public",
"function",
"setRootDir",
"(",
"/*# string */",
"$",
"rootDir",
")",
"{",
"$",
"dir",
"=",
"realpath",
"(",
"$",
"rootDir",
")",
";",
"if",
"(",
"false",
"===",
"$",
"dir",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"Message",
"... | Set config file root directory
@param string $rootDir
@return $this
@throws InvalidArgumentException if root dir is unknown
@access public
@api | [
"Set",
"config",
"file",
"root",
"directory"
] | 7c046fd2c97633b69545b4745d8bffe28e19b1df | https://github.com/phossa2/config/blob/7c046fd2c97633b69545b4745d8bffe28e19b1df/src/Config/Loader/ConfigFileLoader.php#L120-L134 |
20,147 | phossa2/config | src/Config/Loader/ConfigFileLoader.php | ConfigFileLoader.globFiles | protected function globFiles(
/*# string */ $group,
/*# string */ $environment
)/*# : array */ {
$files = [];
$group = '' === $group ? '*' : $group;
foreach ($this->getSearchDirs($environment) as $dir) {
$file = $dir . $group . '.' . $this->file_type;
... | php | protected function globFiles(
/*# string */ $group,
/*# string */ $environment
)/*# : array */ {
$files = [];
$group = '' === $group ? '*' : $group;
foreach ($this->getSearchDirs($environment) as $dir) {
$file = $dir . $group . '.' . $this->file_type;
... | [
"protected",
"function",
"globFiles",
"(",
"/*# string */",
"$",
"group",
",",
"/*# string */",
"$",
"environment",
")",
"/*# : array */",
"{",
"$",
"files",
"=",
"[",
"]",
";",
"$",
"group",
"=",
"''",
"===",
"$",
"group",
"?",
"'*'",
":",
"$",
"group",... | Returns an array of files to read from
@param string $group
@param string $environment
@return array
@access protected | [
"Returns",
"an",
"array",
"of",
"files",
"to",
"read",
"from"
] | 7c046fd2c97633b69545b4745d8bffe28e19b1df | https://github.com/phossa2/config/blob/7c046fd2c97633b69545b4745d8bffe28e19b1df/src/Config/Loader/ConfigFileLoader.php#L181-L192 |
20,148 | phossa2/config | src/Config/Loader/ConfigFileLoader.php | ConfigFileLoader.getSearchDirs | protected function getSearchDirs(/*# string */ $env)/*# : array */
{
if (!isset($this->sub_dirs[$env])) {
$this->sub_dirs[$env] = $this->buildSearchDirs($env);
}
return $this->sub_dirs[$env];
} | php | protected function getSearchDirs(/*# string */ $env)/*# : array */
{
if (!isset($this->sub_dirs[$env])) {
$this->sub_dirs[$env] = $this->buildSearchDirs($env);
}
return $this->sub_dirs[$env];
} | [
"protected",
"function",
"getSearchDirs",
"(",
"/*# string */",
"$",
"env",
")",
"/*# : array */",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"sub_dirs",
"[",
"$",
"env",
"]",
")",
")",
"{",
"$",
"this",
"->",
"sub_dirs",
"[",
"$",
"env",
... | Get the search directories
@param string $env
@return array
@access protected | [
"Get",
"the",
"search",
"directories"
] | 7c046fd2c97633b69545b4745d8bffe28e19b1df | https://github.com/phossa2/config/blob/7c046fd2c97633b69545b4745d8bffe28e19b1df/src/Config/Loader/ConfigFileLoader.php#L201-L207 |
20,149 | phossa2/config | src/Config/Loader/ConfigFileLoader.php | ConfigFileLoader.buildSearchDirs | protected function buildSearchDirs(/*# string */ $env)/*# : array */
{
$path = $this->root_dir;
$part = preg_split(
'/[\/\\\]/',
trim($env, '/\\'),
0,
\PREG_SPLIT_NO_EMPTY
);
$subdirs = [$path];
foreach ($part as $dir) {
... | php | protected function buildSearchDirs(/*# string */ $env)/*# : array */
{
$path = $this->root_dir;
$part = preg_split(
'/[\/\\\]/',
trim($env, '/\\'),
0,
\PREG_SPLIT_NO_EMPTY
);
$subdirs = [$path];
foreach ($part as $dir) {
... | [
"protected",
"function",
"buildSearchDirs",
"(",
"/*# string */",
"$",
"env",
")",
"/*# : array */",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"root_dir",
";",
"$",
"part",
"=",
"preg_split",
"(",
"'/[\\/\\\\\\]/'",
",",
"trim",
"(",
"$",
"env",
",",
"'/\\... | Build search directories
@param string $env
@return array
@access protected | [
"Build",
"search",
"directories"
] | 7c046fd2c97633b69545b4745d8bffe28e19b1df | https://github.com/phossa2/config/blob/7c046fd2c97633b69545b4745d8bffe28e19b1df/src/Config/Loader/ConfigFileLoader.php#L216-L238 |
20,150 | ConnectHolland/tulip-api-client | src/Client.php | Client.getServiceUrl | public function getServiceUrl($serviceName, $action)
{
return sprintf('%s/api/%s/%s/%s', $this->tulipUrl, $this->apiVersion, $serviceName, $action);
} | php | public function getServiceUrl($serviceName, $action)
{
return sprintf('%s/api/%s/%s/%s', $this->tulipUrl, $this->apiVersion, $serviceName, $action);
} | [
"public",
"function",
"getServiceUrl",
"(",
"$",
"serviceName",
",",
"$",
"action",
")",
"{",
"return",
"sprintf",
"(",
"'%s/api/%s/%s/%s'",
",",
"$",
"this",
"->",
"tulipUrl",
",",
"$",
"this",
"->",
"apiVersion",
",",
"$",
"serviceName",
",",
"$",
"actio... | Returns the full Tulip API URL for the specified service and action.
@param string $serviceName
@param string $action
@return string | [
"Returns",
"the",
"full",
"Tulip",
"API",
"URL",
"for",
"the",
"specified",
"service",
"and",
"action",
"."
] | 641325e2d57c1c272ede7fd8b47d4f2b67b73507 | https://github.com/ConnectHolland/tulip-api-client/blob/641325e2d57c1c272ede7fd8b47d4f2b67b73507/src/Client.php#L85-L88 |
20,151 | ConnectHolland/tulip-api-client | src/Client.php | Client.callService | public function callService($serviceName, $action, array $parameters = array(), array $files = array())
{
$httpClient = $this->getHTTPClient();
$url = $this->getServiceUrl($serviceName, $action);
$request = new Request('POST', $url, $this->getRequestHeaders($url, $parameters), $this->getReq... | php | public function callService($serviceName, $action, array $parameters = array(), array $files = array())
{
$httpClient = $this->getHTTPClient();
$url = $this->getServiceUrl($serviceName, $action);
$request = new Request('POST', $url, $this->getRequestHeaders($url, $parameters), $this->getReq... | [
"public",
"function",
"callService",
"(",
"$",
"serviceName",
",",
"$",
"action",
",",
"array",
"$",
"parameters",
"=",
"array",
"(",
")",
",",
"array",
"$",
"files",
"=",
"array",
"(",
")",
")",
"{",
"$",
"httpClient",
"=",
"$",
"this",
"->",
"getHT... | Call a Tulip API service.
@param string $serviceName
@param string $action
@param array $parameters
@param array $files
@return ResponseInterface
@throws RequestException | [
"Call",
"a",
"Tulip",
"API",
"service",
"."
] | 641325e2d57c1c272ede7fd8b47d4f2b67b73507 | https://github.com/ConnectHolland/tulip-api-client/blob/641325e2d57c1c272ede7fd8b47d4f2b67b73507/src/Client.php#L112-L128 |
20,152 | ConnectHolland/tulip-api-client | src/Client.php | Client.getHTTPClient | private function getHTTPClient()
{
if ($this->httpClient instanceof ClientInterface === false) {
$this->httpClient = new HTTPClient();
}
return $this->httpClient;
} | php | private function getHTTPClient()
{
if ($this->httpClient instanceof ClientInterface === false) {
$this->httpClient = new HTTPClient();
}
return $this->httpClient;
} | [
"private",
"function",
"getHTTPClient",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"httpClient",
"instanceof",
"ClientInterface",
"===",
"false",
")",
"{",
"$",
"this",
"->",
"httpClient",
"=",
"new",
"HTTPClient",
"(",
")",
";",
"}",
"return",
"$",
"t... | Returns a ClientInterface instance.
@return ClientInterface | [
"Returns",
"a",
"ClientInterface",
"instance",
"."
] | 641325e2d57c1c272ede7fd8b47d4f2b67b73507 | https://github.com/ConnectHolland/tulip-api-client/blob/641325e2d57c1c272ede7fd8b47d4f2b67b73507/src/Client.php#L135-L142 |
20,153 | ConnectHolland/tulip-api-client | src/Client.php | Client.getRequestHeaders | private function getRequestHeaders($url, array $parameters)
{
$headers = array();
if (isset($this->clientId) && isset($this->sharedSecret)) {
$objectIdentifier = null;
if ($this->apiVersion === '1.1' && isset($parameters['id'])) {
$objectIdentifier = $paramet... | php | private function getRequestHeaders($url, array $parameters)
{
$headers = array();
if (isset($this->clientId) && isset($this->sharedSecret)) {
$objectIdentifier = null;
if ($this->apiVersion === '1.1' && isset($parameters['id'])) {
$objectIdentifier = $paramet... | [
"private",
"function",
"getRequestHeaders",
"(",
"$",
"url",
",",
"array",
"$",
"parameters",
")",
"{",
"$",
"headers",
"=",
"array",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"clientId",
")",
"&&",
"isset",
"(",
"$",
"this",
"->",
... | Returns the request authentication headers when a client ID and shared secret are provided.
@param string $url
@param array $parameters
@return array | [
"Returns",
"the",
"request",
"authentication",
"headers",
"when",
"a",
"client",
"ID",
"and",
"shared",
"secret",
"are",
"provided",
"."
] | 641325e2d57c1c272ede7fd8b47d4f2b67b73507 | https://github.com/ConnectHolland/tulip-api-client/blob/641325e2d57c1c272ede7fd8b47d4f2b67b73507/src/Client.php#L152-L169 |
20,154 | ConnectHolland/tulip-api-client | src/Client.php | Client.getRequestBody | private function getRequestBody(array $parameters, array $files)
{
$body = array();
foreach ($parameters as $parameterName => $parameterValue) {
if (is_scalar($parameterValue) || (is_null($parameterValue) && $parameterName !== 'id')) {
$body[] = array(
... | php | private function getRequestBody(array $parameters, array $files)
{
$body = array();
foreach ($parameters as $parameterName => $parameterValue) {
if (is_scalar($parameterValue) || (is_null($parameterValue) && $parameterName !== 'id')) {
$body[] = array(
... | [
"private",
"function",
"getRequestBody",
"(",
"array",
"$",
"parameters",
",",
"array",
"$",
"files",
")",
"{",
"$",
"body",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"parameters",
"as",
"$",
"parameterName",
"=>",
"$",
"parameterValue",
")",
"{"... | Returns the multipart request body with the parameters and files.
@param array $parameters
@param array $files
@return MultipartStream | [
"Returns",
"the",
"multipart",
"request",
"body",
"with",
"the",
"parameters",
"and",
"files",
"."
] | 641325e2d57c1c272ede7fd8b47d4f2b67b73507 | https://github.com/ConnectHolland/tulip-api-client/blob/641325e2d57c1c272ede7fd8b47d4f2b67b73507/src/Client.php#L179-L204 |
20,155 | ConnectHolland/tulip-api-client | src/Client.php | Client.validateAPIResponseCode | private function validateAPIResponseCode(RequestInterface $request, ResponseInterface $response)
{
$responseParser = new ResponseParser($response);
switch ($responseParser->getResponseCode()) {
case ResponseCodes::SUCCESS:
break;
case ResponseCodes::NOT_AUTHOR... | php | private function validateAPIResponseCode(RequestInterface $request, ResponseInterface $response)
{
$responseParser = new ResponseParser($response);
switch ($responseParser->getResponseCode()) {
case ResponseCodes::SUCCESS:
break;
case ResponseCodes::NOT_AUTHOR... | [
"private",
"function",
"validateAPIResponseCode",
"(",
"RequestInterface",
"$",
"request",
",",
"ResponseInterface",
"$",
"response",
")",
"{",
"$",
"responseParser",
"=",
"new",
"ResponseParser",
"(",
"$",
"response",
")",
";",
"switch",
"(",
"$",
"responseParser... | Validates the Tulip API response code.
@param RequestInterface $request
@param ResponseInterface $response
@throws NotAuthorizedException when not authenticated / authorized correctly.
@throws UnknownServiceException when the called API service is not found within the Tulip API.
@throws ParametersRequiredEx... | [
"Validates",
"the",
"Tulip",
"API",
"response",
"code",
"."
] | 641325e2d57c1c272ede7fd8b47d4f2b67b73507 | https://github.com/ConnectHolland/tulip-api-client/blob/641325e2d57c1c272ede7fd8b47d4f2b67b73507/src/Client.php#L218-L236 |
20,156 | webforge-labs/psc-cms | lib/Psc/Data/Set.php | Set.setFieldsFromArray | public function setFieldsFromArray(Array $fields) {
foreach ($fields as $field => $value) {
$this->set($field, $value);
}
return $this;
} | php | public function setFieldsFromArray(Array $fields) {
foreach ($fields as $field => $value) {
$this->set($field, $value);
}
return $this;
} | [
"public",
"function",
"setFieldsFromArray",
"(",
"Array",
"$",
"fields",
")",
"{",
"foreach",
"(",
"$",
"fields",
"as",
"$",
"field",
"=>",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"set",
"(",
"$",
"field",
",",
"$",
"value",
")",
";",
"}",
"retu... | Setzt mehrere Felder aus einem Array
die Felder die als Schlüssel angegeben werden, müssen alle als Meta existieren
@param array $fields Schlüssel sind mit . getrennte strings Werte sind die Werte der Felder | [
"Setzt",
"mehrere",
"Felder",
"aus",
"einem",
"Array"
] | 467bfa2547e6b4fa487d2d7f35fa6cc618dbc763 | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Data/Set.php#L112-L117 |
20,157 | webforge-labs/psc-cms | lib/Psc/Data/Set.php | Set.createFromStruct | public static function createFromStruct(Array $struct, SetMeta $meta = NULL) {
if (!isset($meta)) $meta = new SetMeta();
$set = new static(array(), $meta);
foreach ($struct as $field => $list) {
list($value, $type) = $list;
$set->set($field, $value, $type);
}
return $set;
} | php | public static function createFromStruct(Array $struct, SetMeta $meta = NULL) {
if (!isset($meta)) $meta = new SetMeta();
$set = new static(array(), $meta);
foreach ($struct as $field => $list) {
list($value, $type) = $list;
$set->set($field, $value, $type);
}
return $set;
} | [
"public",
"static",
"function",
"createFromStruct",
"(",
"Array",
"$",
"struct",
",",
"SetMeta",
"$",
"meta",
"=",
"NULL",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"meta",
")",
")",
"$",
"meta",
"=",
"new",
"SetMeta",
"(",
")",
";",
"$",
"set",... | Erstellt ein Set mit angegebenen Metadaten
Shortcoming um die Felder des Sets nicht doppelt bezeichnen zu müssen
struct ist ein Array von Listen mit jeweils genau 2 elementen (key 0 und key 1)
@param list[] $struct die Listen sind von der Form: list(mixed $fieldValue, Webforge\Types\Type $fieldType). Die Schlüssel si... | [
"Erstellt",
"ein",
"Set",
"mit",
"angegebenen",
"Metadaten"
] | 467bfa2547e6b4fa487d2d7f35fa6cc618dbc763 | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Data/Set.php#L166-L176 |
20,158 | webforge-labs/psc-cms | lib/Psc/PHP/Lexer.php | Lexer.init | public function init($source) {
$this->source = $source; // für debug
$this->scan($source);
$this->reset();
} | php | public function init($source) {
$this->source = $source; // für debug
$this->scan($source);
$this->reset();
} | [
"public",
"function",
"init",
"(",
"$",
"source",
")",
"{",
"$",
"this",
"->",
"source",
"=",
"$",
"source",
";",
"// für debug",
"$",
"this",
"->",
"scan",
"(",
"$",
"source",
")",
";",
"$",
"this",
"->",
"reset",
"(",
")",
";",
"}"
] | Initialisiert den Lexer
der Sourcecode wird gelesen und in tokens übersetzt
nach diesem Befehl ist der erste token in $this->token gesetzt | [
"Initialisiert",
"den",
"Lexer"
] | 467bfa2547e6b4fa487d2d7f35fa6cc618dbc763 | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/PHP/Lexer.php#L114-L118 |
20,159 | webforge-labs/psc-cms | lib/Psc/Doctrine/EntityRepository.php | EntityRepository.save | public function save(Entity $entity) {
$this->_em->persist($entity);
$this->_em->flush();
return $this;
} | php | public function save(Entity $entity) {
$this->_em->persist($entity);
$this->_em->flush();
return $this;
} | [
"public",
"function",
"save",
"(",
"Entity",
"$",
"entity",
")",
"{",
"$",
"this",
"->",
"_em",
"->",
"persist",
"(",
"$",
"entity",
")",
";",
"$",
"this",
"->",
"_em",
"->",
"flush",
"(",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Persisted das Entity und flushed den EntityManager | [
"Persisted",
"das",
"Entity",
"und",
"flushed",
"den",
"EntityManager"
] | 467bfa2547e6b4fa487d2d7f35fa6cc618dbc763 | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Doctrine/EntityRepository.php#L40-L44 |
20,160 | webforge-labs/psc-cms | lib/Psc/Doctrine/EntityRepository.php | EntityRepository.hydrateRole | public function hydrateRole($role, $identifier) {
return $this->_em->getRepository($this->_class->namespace.'\\'.ucfirst($role))->hydrate($identifier);
} | php | public function hydrateRole($role, $identifier) {
return $this->_em->getRepository($this->_class->namespace.'\\'.ucfirst($role))->hydrate($identifier);
} | [
"public",
"function",
"hydrateRole",
"(",
"$",
"role",
",",
"$",
"identifier",
")",
"{",
"return",
"$",
"this",
"->",
"_em",
"->",
"getRepository",
"(",
"$",
"this",
"->",
"_class",
"->",
"namespace",
".",
"'\\\\'",
".",
"ucfirst",
"(",
"$",
"role",
")... | Returns an entity of the project, which implements a specific Psc\CMS\Role
@return Psc\CMS\Role\$role.toCamelCase() | [
"Returns",
"an",
"entity",
"of",
"the",
"project",
"which",
"implements",
"a",
"specific",
"Psc",
"\\",
"CMS",
"\\",
"Role"
] | 467bfa2547e6b4fa487d2d7f35fa6cc618dbc763 | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Doctrine/EntityRepository.php#L104-L106 |
20,161 | webforge-labs/psc-cms | lib/Psc/Doctrine/EntityRepository.php | EntityRepository.hydrateBy | public function hydrateBy(array $criterias) {
$entity = $this->findOneBy($criterias);
if (!($entity instanceof $this->_entityName)) {
throw new EntityNotFoundException(sprintf('Entity %s nicht gefunden: criterias: %s', $this->_entityName, Code::varInfo($criterias)));
}
return $ent... | php | public function hydrateBy(array $criterias) {
$entity = $this->findOneBy($criterias);
if (!($entity instanceof $this->_entityName)) {
throw new EntityNotFoundException(sprintf('Entity %s nicht gefunden: criterias: %s', $this->_entityName, Code::varInfo($criterias)));
}
return $ent... | [
"public",
"function",
"hydrateBy",
"(",
"array",
"$",
"criterias",
")",
"{",
"$",
"entity",
"=",
"$",
"this",
"->",
"findOneBy",
"(",
"$",
"criterias",
")",
";",
"if",
"(",
"!",
"(",
"$",
"entity",
"instanceof",
"$",
"this",
"->",
"_entityName",
")",
... | Sowie findOneBy aber mit exception
@throws \Psc\Exception | [
"Sowie",
"findOneBy",
"aber",
"mit",
"exception"
] | 467bfa2547e6b4fa487d2d7f35fa6cc618dbc763 | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Doctrine/EntityRepository.php#L135-L143 |
20,162 | webforge-labs/psc-cms | lib/Psc/Doctrine/EntityRepository.php | EntityRepository.configureUniqueConstraintValidator | public function configureUniqueConstraintValidator(UniqueConstraintValidator $validator = NULL) {
$uniqueConstraints = $this->getUniqueConstraints();
if (!isset($validator)) {
// erstelle einen neuen
$constraint = array_shift($uniqueConstraints);
$validator = new UniqueConstraintVal... | php | public function configureUniqueConstraintValidator(UniqueConstraintValidator $validator = NULL) {
$uniqueConstraints = $this->getUniqueConstraints();
if (!isset($validator)) {
// erstelle einen neuen
$constraint = array_shift($uniqueConstraints);
$validator = new UniqueConstraintVal... | [
"public",
"function",
"configureUniqueConstraintValidator",
"(",
"UniqueConstraintValidator",
"$",
"validator",
"=",
"NULL",
")",
"{",
"$",
"uniqueConstraints",
"=",
"$",
"this",
"->",
"getUniqueConstraints",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"va... | Setzt einen UniqueConstraintValidator mit den passenden UniqueConstraints des Entities
sind keine Unique-Constraints für diese Klasse gesetzt, wird eine \Psc\Doctrine\NoUniqueConstraintException geworfen
@throws Psc\Doctrine\UniqueConstraintException, wenn $this->getUniqueIndex() einen inkonsistenten Index zurückgibt ... | [
"Setzt",
"einen",
"UniqueConstraintValidator",
"mit",
"den",
"passenden",
"UniqueConstraints",
"des",
"Entities"
] | 467bfa2547e6b4fa487d2d7f35fa6cc618dbc763 | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Doctrine/EntityRepository.php#L222-L242 |
20,163 | davidgorges/color-contrast-php | src/ColorContrast.php | ColorContrast.calculateYIQValue | private function calculateYIQValue(RGB $color)
{
$yiq = (($color->getRed() * 299) + ($color->getGreen() * 587) + ($color->getBlue() * 114)) / 1000;
return $yiq;
} | php | private function calculateYIQValue(RGB $color)
{
$yiq = (($color->getRed() * 299) + ($color->getGreen() * 587) + ($color->getBlue() * 114)) / 1000;
return $yiq;
} | [
"private",
"function",
"calculateYIQValue",
"(",
"RGB",
"$",
"color",
")",
"{",
"$",
"yiq",
"=",
"(",
"(",
"$",
"color",
"->",
"getRed",
"(",
")",
"*",
"299",
")",
"+",
"(",
"$",
"color",
"->",
"getGreen",
"(",
")",
"*",
"587",
")",
"+",
"(",
"... | calculates the YIQ value for a given color.
@param RGB $color
@return float 0-255 | [
"calculates",
"the",
"YIQ",
"value",
"for",
"a",
"given",
"color",
"."
] | 11edc6e04ce73d8d9b0bffeda1586f2c2fa22e71 | https://github.com/davidgorges/color-contrast-php/blob/11edc6e04ce73d8d9b0bffeda1586f2c2fa22e71/src/ColorContrast.php#L169-L173 |
20,164 | aryelgois/yasql-php | src/Parser.php | Parser.extractKeyword | protected static function extractKeyword(
string $haystack,
string $needle,
&$matches = null
) {
$pattern = '/' . (strpos($needle, '^') === 0 ? '' : ' ?') . $needle
. (strrpos($needle, '$') === strlen($needle)-1 ? '' : ' ?') . '/i';
if (preg_match($pattern, $hays... | php | protected static function extractKeyword(
string $haystack,
string $needle,
&$matches = null
) {
$pattern = '/' . (strpos($needle, '^') === 0 ? '' : ' ?') . $needle
. (strrpos($needle, '$') === strlen($needle)-1 ? '' : ' ?') . '/i';
if (preg_match($pattern, $hays... | [
"protected",
"static",
"function",
"extractKeyword",
"(",
"string",
"$",
"haystack",
",",
"string",
"$",
"needle",
",",
"&",
"$",
"matches",
"=",
"null",
")",
"{",
"$",
"pattern",
"=",
"'/'",
".",
"(",
"strpos",
"(",
"$",
"needle",
",",
"'^'",
")",
"... | Extracts a keyword from a string
@param string $haystack String to look for the keyword
@param string $needle PCRE subpattern with the keyword (insensitive)
@param string $matches @see \preg_match() $matches (PREG_OFFSET_CAPTURE)
@return false If the keyword was not found
@return string The string without the key... | [
"Extracts",
"a",
"keyword",
"from",
"a",
"string"
] | f428b180d35bfc1ddf1f9b3323f9b085fbc09ac7 | https://github.com/aryelgois/yasql-php/blob/f428b180d35bfc1ddf1f9b3323f9b085fbc09ac7/src/Parser.php#L404-L418 |
20,165 | titon/db | src/Titon/Db/Database.php | Database.getDriver | public function getDriver($key) {
if (isset($this->_drivers[$key])) {
return $this->_drivers[$key];
}
throw new MissingDriverException(sprintf('Driver %s does not exist', $key));
} | php | public function getDriver($key) {
if (isset($this->_drivers[$key])) {
return $this->_drivers[$key];
}
throw new MissingDriverException(sprintf('Driver %s does not exist', $key));
} | [
"public",
"function",
"getDriver",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_drivers",
"[",
"$",
"key",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"_drivers",
"[",
"$",
"key",
"]",
";",
"}",
"throw",
"new",
... | Return a driver by key.
@param string $key
@return \Titon\Db\Driver
@throws \Titon\Db\Exception\MissingDriverException | [
"Return",
"a",
"driver",
"by",
"key",
"."
] | fbc5159d1ce9d2139759c9367565986981485604 | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Database.php#L49-L55 |
20,166 | claroline/ForumBundle | Controller/ForumController.php | ForumController.createSubjectAction | public function createSubjectAction(Category $category)
{
$forum = $category->getForum();
$collection = new ResourceCollection(array($forum->getResourceNode()));
if (!$this->authorization->isGranted('post', $collection)) {
throw new AccessDeniedException($collection->getErrorsFo... | php | public function createSubjectAction(Category $category)
{
$forum = $category->getForum();
$collection = new ResourceCollection(array($forum->getResourceNode()));
if (!$this->authorization->isGranted('post', $collection)) {
throw new AccessDeniedException($collection->getErrorsFo... | [
"public",
"function",
"createSubjectAction",
"(",
"Category",
"$",
"category",
")",
"{",
"$",
"forum",
"=",
"$",
"category",
"->",
"getForum",
"(",
")",
";",
"$",
"collection",
"=",
"new",
"ResourceCollection",
"(",
"array",
"(",
"$",
"forum",
"->",
"getRe... | The form submission is working but I had to do some weird things to make it works.
@Route(
"/subject/create/{category}",
name="claro_forum_create_subject"
)
@ParamConverter("authenticatedUser", options={"authenticatedUser" = true})
@Template("ClarolineForumBundle:Forum:subjectForm.html.twig")
@param Category $category... | [
"The",
"form",
"submission",
"is",
"working",
"but",
"I",
"had",
"to",
"do",
"some",
"weird",
"things",
"to",
"make",
"it",
"works",
"."
] | bd85dfd870cacee541ea94fec8e59744bf90eaf4 | https://github.com/claroline/ForumBundle/blob/bd85dfd870cacee541ea94fec8e59744bf90eaf4/Controller/ForumController.php#L272-L317 |
20,167 | anexia-it/anexia-laravel-encryption | src/DatabaseEncryptionScope.php | DatabaseEncryptionScope.addWithDecryptKey | protected function addWithDecryptKey(Builder $builder)
{
$builder->macro('withDecryptKey', function (Builder $builder, $decryptKey) {
$model = $builder->getModel();
$encryptedFields = $model::getEncryptedFields();
if (!empty($encryptedFields)) {
$builder->... | php | protected function addWithDecryptKey(Builder $builder)
{
$builder->macro('withDecryptKey', function (Builder $builder, $decryptKey) {
$model = $builder->getModel();
$encryptedFields = $model::getEncryptedFields();
if (!empty($encryptedFields)) {
$builder->... | [
"protected",
"function",
"addWithDecryptKey",
"(",
"Builder",
"$",
"builder",
")",
"{",
"$",
"builder",
"->",
"macro",
"(",
"'withDecryptKey'",
",",
"function",
"(",
"Builder",
"$",
"builder",
",",
"$",
"decryptKey",
")",
"{",
"$",
"model",
"=",
"$",
"buil... | Add the with-decrypt-key extension to the builder.
@param \Illuminate\Database\Eloquent\Builder $builder
@return void | [
"Add",
"the",
"with",
"-",
"decrypt",
"-",
"key",
"extension",
"to",
"the",
"builder",
"."
] | b7c72d99916ebca2d2cf2dbab1d4c0f84e383081 | https://github.com/anexia-it/anexia-laravel-encryption/blob/b7c72d99916ebca2d2cf2dbab1d4c0f84e383081/src/DatabaseEncryptionScope.php#L61-L81 |
20,168 | neilime/zf2-browscap | src/Browscap/BrowscapService.php | BrowscapService.factory | public static function factory($aOptions){
if($aOptions instanceof \Traversable)$aOptions = \Zend\Stdlib\ArrayUtils::iteratorToArray($aOptions);
elseif(!is_array($aOptions))throw new \InvalidArgumentException(__METHOD__.' expects an array or Traversable object; received "'.(is_object($aOptions)?get_class($aOptions)... | php | public static function factory($aOptions){
if($aOptions instanceof \Traversable)$aOptions = \Zend\Stdlib\ArrayUtils::iteratorToArray($aOptions);
elseif(!is_array($aOptions))throw new \InvalidArgumentException(__METHOD__.' expects an array or Traversable object; received "'.(is_object($aOptions)?get_class($aOptions)... | [
"public",
"static",
"function",
"factory",
"(",
"$",
"aOptions",
")",
"{",
"if",
"(",
"$",
"aOptions",
"instanceof",
"\\",
"Traversable",
")",
"$",
"aOptions",
"=",
"\\",
"Zend",
"\\",
"Stdlib",
"\\",
"ArrayUtils",
"::",
"iteratorToArray",
"(",
"$",
"aOpti... | Instantiate AccessControl Authentication Service
@param array|Traversable $aConfiguration
@param \Zend\ServiceManager\ServiceLocatorInterface $oServiceLocator
@throws \InvalidArgumentException
@return \BoilerAppAccessControl\Authentication\AccessControlAuthenticationService | [
"Instantiate",
"AccessControl",
"Authentication",
"Service"
] | 490a4d573a2f6340c67a4254d5a46d3276583e1b | https://github.com/neilime/zf2-browscap/blob/490a4d573a2f6340c67a4254d5a46d3276583e1b/src/Browscap/BrowscapService.php#L41-L56 |
20,169 | neilime/zf2-browscap | src/Browscap/BrowscapService.php | BrowscapService.loadBrowscapIni | public function loadBrowscapIni(){
$sBrowscapIniPath = $this->getBrowscapIniPath();
//Local file
if(is_readable($sBrowscapIniPath)){
$aBrowscap = parse_ini_file($this->getBrowscapIniPath(), true, INI_SCANNER_RAW);
if($aBrowscap === false)throw new \RuntimeException('Error appends while parsing browscap.ini... | php | public function loadBrowscapIni(){
$sBrowscapIniPath = $this->getBrowscapIniPath();
//Local file
if(is_readable($sBrowscapIniPath)){
$aBrowscap = parse_ini_file($this->getBrowscapIniPath(), true, INI_SCANNER_RAW);
if($aBrowscap === false)throw new \RuntimeException('Error appends while parsing browscap.ini... | [
"public",
"function",
"loadBrowscapIni",
"(",
")",
"{",
"$",
"sBrowscapIniPath",
"=",
"$",
"this",
"->",
"getBrowscapIniPath",
"(",
")",
";",
"//Local file",
"if",
"(",
"is_readable",
"(",
"$",
"sBrowscapIniPath",
")",
")",
"{",
"$",
"aBrowscap",
"=",
"parse... | Load and parse browscap.ini file
@throws \RuntimeException
@return \Neilime\Browscap\BrowscapService | [
"Load",
"and",
"parse",
"browscap",
".",
"ini",
"file"
] | 490a4d573a2f6340c67a4254d5a46d3276583e1b | https://github.com/neilime/zf2-browscap/blob/490a4d573a2f6340c67a4254d5a46d3276583e1b/src/Browscap/BrowscapService.php#L182-L228 |
20,170 | left-right/center | src/controllers/FileController.php | FileController.image | public function image() {
if (Request::hasFile('image') && Request::has('table_name') && Request::has('field_name')) {
return json_encode(self::saveImage(
Request::input('table_name'),
Request::input('field_name'),
Request::file('image'),
null,
Request::file('image')->getClientOriginalExtensi... | php | public function image() {
if (Request::hasFile('image') && Request::has('table_name') && Request::has('field_name')) {
return json_encode(self::saveImage(
Request::input('table_name'),
Request::input('field_name'),
Request::file('image'),
null,
Request::file('image')->getClientOriginalExtensi... | [
"public",
"function",
"image",
"(",
")",
"{",
"if",
"(",
"Request",
"::",
"hasFile",
"(",
"'image'",
")",
"&&",
"Request",
"::",
"has",
"(",
"'table_name'",
")",
"&&",
"Request",
"::",
"has",
"(",
"'field_name'",
")",
")",
"{",
"return",
"json_encode",
... | handle image upload route | [
"handle",
"image",
"upload",
"route"
] | 47c225538475ca3e87fa49f31a323b6e6bd4eff2 | https://github.com/left-right/center/blob/47c225538475ca3e87fa49f31a323b6e6bd4eff2/src/controllers/FileController.php#L28-L44 |
20,171 | ppetermann/king23 | src/Http/Router.php | Router.addRoute | public function addRoute($route, $class, $action, $parameters = [], $hostparameters = [])
{
$this->log->debug('adding route : ' . $route . ' to class ' . $class . ' and action ' . $action);
$this->routes[$route] = [
"class" => $class,
"action" => $action,
"parame... | php | public function addRoute($route, $class, $action, $parameters = [], $hostparameters = [])
{
$this->log->debug('adding route : ' . $route . ' to class ' . $class . ' and action ' . $action);
$this->routes[$route] = [
"class" => $class,
"action" => $action,
"parame... | [
"public",
"function",
"addRoute",
"(",
"$",
"route",
",",
"$",
"class",
",",
"$",
"action",
",",
"$",
"parameters",
"=",
"[",
"]",
",",
"$",
"hostparameters",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"log",
"->",
"debug",
"(",
"'adding route : '",... | add route to list of known routes
@param String $route beginning string of the route
@param String $class to be used for this route
@param String $action method to be called
@param string[] $parameters list of parameters that should be retrieved from url
@param array $hostparameters - allows to use subdomains as param... | [
"add",
"route",
"to",
"list",
"of",
"known",
"routes"
] | 603896083ec89f5ac4d744abd3b1b4db3e914c95 | https://github.com/ppetermann/king23/blob/603896083ec89f5ac4d744abd3b1b4db3e914c95/src/Http/Router.php#L87-L98 |
20,172 | ppetermann/king23 | src/Http/Router.php | Router.setBaseHost | public function setBaseHost($baseHost = null)
{
$this->log->debug('Setting Router baseHost to ' . $baseHost);
$this->baseHost = $baseHost;
return $this;
} | php | public function setBaseHost($baseHost = null)
{
$this->log->debug('Setting Router baseHost to ' . $baseHost);
$this->baseHost = $baseHost;
return $this;
} | [
"public",
"function",
"setBaseHost",
"(",
"$",
"baseHost",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"log",
"->",
"debug",
"(",
"'Setting Router baseHost to '",
".",
"$",
"baseHost",
")",
";",
"$",
"this",
"->",
"baseHost",
"=",
"$",
"baseHost",
";",
"re... | method to set the basicHost for hostparameters in routing
@see King23_Router::$basicHost
@param String $baseHost
@return self | [
"method",
"to",
"set",
"the",
"basicHost",
"for",
"hostparameters",
"in",
"routing"
] | 603896083ec89f5ac4d744abd3b1b4db3e914c95 | https://github.com/ppetermann/king23/blob/603896083ec89f5ac4d744abd3b1b4db3e914c95/src/Http/Router.php#L107-L112 |
20,173 | ppetermann/king23 | src/Http/Router.php | Router.handleRoute | private function handleRoute($info, ServerRequestInterface $request, $route) : ResponseInterface
{
// initialize router attributes for the request
$attributes = [
'params' => [
'url' => [],
'host' => []
]
];
// prepare paramete... | php | private function handleRoute($info, ServerRequestInterface $request, $route) : ResponseInterface
{
// initialize router attributes for the request
$attributes = [
'params' => [
'url' => [],
'host' => []
]
];
// prepare paramete... | [
"private",
"function",
"handleRoute",
"(",
"$",
"info",
",",
"ServerRequestInterface",
"$",
"request",
",",
"$",
"route",
")",
":",
"ResponseInterface",
"{",
"// initialize router attributes for the request",
"$",
"attributes",
"=",
"[",
"'params'",
"=>",
"[",
"'url... | Handle a regular route
@param array $info
@param ServerRequestInterface $request
@param string $route
@return ResponseInterface
@throws \King23\Controller\Exceptions\ActionDoesNotExistException | [
"Handle",
"a",
"regular",
"route"
] | 603896083ec89f5ac4d744abd3b1b4db3e914c95 | https://github.com/ppetermann/king23/blob/603896083ec89f5ac4d744abd3b1b4db3e914c95/src/Http/Router.php#L149-L176 |
20,174 | ppetermann/king23 | src/Http/Router.php | Router.extractHostParameters | private function extractHostParameters($request, $info)
{
$hostname = $this->cleanHostName($request);
if (empty($hostname)) {
$params = [];
} else {
$params = array_reverse(explode(".", $hostname));
}
$parameters = $this->filterParameters($info['host... | php | private function extractHostParameters($request, $info)
{
$hostname = $this->cleanHostName($request);
if (empty($hostname)) {
$params = [];
} else {
$params = array_reverse(explode(".", $hostname));
}
$parameters = $this->filterParameters($info['host... | [
"private",
"function",
"extractHostParameters",
"(",
"$",
"request",
",",
"$",
"info",
")",
"{",
"$",
"hostname",
"=",
"$",
"this",
"->",
"cleanHostName",
"(",
"$",
"request",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"hostname",
")",
")",
"{",
"$",
"p... | extract parameters from hostname
@param ServerRequestInterface $request
@param array $info
@return array | [
"extract",
"parameters",
"from",
"hostname"
] | 603896083ec89f5ac4d744abd3b1b4db3e914c95 | https://github.com/ppetermann/king23/blob/603896083ec89f5ac4d744abd3b1b4db3e914c95/src/Http/Router.php#L203-L215 |
20,175 | ppetermann/king23 | src/Http/Router.php | Router.cleanHostName | private function cleanHostName(ServerRequestInterface $request)
{
if (is_null($this->baseHost)) {
$hostname = $request->getUri()->getHost();
} else {
$hostname = str_replace($this->baseHost, "", $request->getUri()->getHost());
}
if (substr($hostname, -1) == ... | php | private function cleanHostName(ServerRequestInterface $request)
{
if (is_null($this->baseHost)) {
$hostname = $request->getUri()->getHost();
} else {
$hostname = str_replace($this->baseHost, "", $request->getUri()->getHost());
}
if (substr($hostname, -1) == ... | [
"private",
"function",
"cleanHostName",
"(",
"ServerRequestInterface",
"$",
"request",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"baseHost",
")",
")",
"{",
"$",
"hostname",
"=",
"$",
"request",
"->",
"getUri",
"(",
")",
"->",
"getHost",
"("... | will get hostname, and clean basehost off it
@param ServerRequestInterface $request
@return string | [
"will",
"get",
"hostname",
"and",
"clean",
"basehost",
"off",
"it"
] | 603896083ec89f5ac4d744abd3b1b4db3e914c95 | https://github.com/ppetermann/king23/blob/603896083ec89f5ac4d744abd3b1b4db3e914c95/src/Http/Router.php#L223-L237 |
20,176 | kharanenka/laravel-cache-helper | src/Kharanenka/Helper/CCache.php | CCache.put | public static function put($arTags, $sKeys, &$arValue, $iMinute)
{
$obDate = Carbon::now()->addMinute($iMinute);
$sCacheDriver = config('cache.default');
if(!empty($arTags)) {
if($sCacheDriver == 'redis') {
Cache::tags($arTags)->put($sKeys, $arValue, $obDate);
... | php | public static function put($arTags, $sKeys, &$arValue, $iMinute)
{
$obDate = Carbon::now()->addMinute($iMinute);
$sCacheDriver = config('cache.default');
if(!empty($arTags)) {
if($sCacheDriver == 'redis') {
Cache::tags($arTags)->put($sKeys, $arValue, $obDate);
... | [
"public",
"static",
"function",
"put",
"(",
"$",
"arTags",
",",
"$",
"sKeys",
",",
"&",
"$",
"arValue",
",",
"$",
"iMinute",
")",
"{",
"$",
"obDate",
"=",
"Carbon",
"::",
"now",
"(",
")",
"->",
"addMinute",
"(",
"$",
"iMinute",
")",
";",
"$",
"sC... | Put cache data
@param array $arTags
@param string $sKeys
@param mixed $arValue
@param int $iMinute | [
"Put",
"cache",
"data"
] | 5423eed6830ade6f7af8b02eb6ad33a97db7b848 | https://github.com/kharanenka/laravel-cache-helper/blob/5423eed6830ade6f7af8b02eb6ad33a97db7b848/src/Kharanenka/Helper/CCache.php#L62-L77 |
20,177 | kharanenka/laravel-cache-helper | src/Kharanenka/Helper/CCache.php | CCache.forever | public static function forever($arTags, $sKeys, &$arValue)
{
$sCacheDriver = config('cache.default');
if(!empty($arTags)) {
if($sCacheDriver == 'redis') {
Cache::tags($arTags)->forever($sKeys, $arValue);
return;
} else {
$sKeys ... | php | public static function forever($arTags, $sKeys, &$arValue)
{
$sCacheDriver = config('cache.default');
if(!empty($arTags)) {
if($sCacheDriver == 'redis') {
Cache::tags($arTags)->forever($sKeys, $arValue);
return;
} else {
$sKeys ... | [
"public",
"static",
"function",
"forever",
"(",
"$",
"arTags",
",",
"$",
"sKeys",
",",
"&",
"$",
"arValue",
")",
"{",
"$",
"sCacheDriver",
"=",
"config",
"(",
"'cache.default'",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"arTags",
")",
")",
"{",
... | Forever cache data
@param array $arTags
@param string $sKeys
@param mixed $arValue | [
"Forever",
"cache",
"data"
] | 5423eed6830ade6f7af8b02eb6ad33a97db7b848 | https://github.com/kharanenka/laravel-cache-helper/blob/5423eed6830ade6f7af8b02eb6ad33a97db7b848/src/Kharanenka/Helper/CCache.php#L85-L98 |
20,178 | kharanenka/laravel-cache-helper | src/Kharanenka/Helper/CCache.php | CCache.clear | public static function clear($arTags, $sKeys = null)
{
$sCacheDriver = config('cache.default');
if(!empty($arTags)) {
if($sCacheDriver == 'redis') {
if(!empty($sKeys)) {
Cache::tags($arTags)->forget($sKeys);
} else {
... | php | public static function clear($arTags, $sKeys = null)
{
$sCacheDriver = config('cache.default');
if(!empty($arTags)) {
if($sCacheDriver == 'redis') {
if(!empty($sKeys)) {
Cache::tags($arTags)->forget($sKeys);
} else {
... | [
"public",
"static",
"function",
"clear",
"(",
"$",
"arTags",
",",
"$",
"sKeys",
"=",
"null",
")",
"{",
"$",
"sCacheDriver",
"=",
"config",
"(",
"'cache.default'",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"arTags",
")",
")",
"{",
"if",
"(",
"$",... | Clear cache data
@param array $arTags
@param string $sKeys | [
"Clear",
"cache",
"data"
] | 5423eed6830ade6f7af8b02eb6ad33a97db7b848 | https://github.com/kharanenka/laravel-cache-helper/blob/5423eed6830ade6f7af8b02eb6ad33a97db7b848/src/Kharanenka/Helper/CCache.php#L105-L120 |
20,179 | infinity-next/braintree | src/Billable.php | Billable.onTrial | public function onTrial()
{
if (! is_null($this->getTrialEndDate())) {
return Carbon::today()->lt($this->getTrialEndDate());
} else {
return false;
}
} | php | public function onTrial()
{
if (! is_null($this->getTrialEndDate())) {
return Carbon::today()->lt($this->getTrialEndDate());
} else {
return false;
}
} | [
"public",
"function",
"onTrial",
"(",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
"->",
"getTrialEndDate",
"(",
")",
")",
")",
"{",
"return",
"Carbon",
"::",
"today",
"(",
")",
"->",
"lt",
"(",
"$",
"this",
"->",
"getTrialEndDate",
"(",
... | Determine if the entity is within their trial period.
@return bool | [
"Determine",
"if",
"the",
"entity",
"is",
"within",
"their",
"trial",
"period",
"."
] | 4bf6f49d4d8a05734a295003137f360e331cc10f | https://github.com/infinity-next/braintree/blob/4bf6f49d4d8a05734a295003137f360e331cc10f/src/Billable.php#L196-L203 |
20,180 | infinity-next/braintree | src/Billable.php | Billable.onGracePeriod | public function onGracePeriod()
{
if (! is_null($endsAt = $this->getSubscriptionEndDate())) {
return Carbon::now()->lt(Carbon::instance($endsAt));
} else {
return false;
}
} | php | public function onGracePeriod()
{
if (! is_null($endsAt = $this->getSubscriptionEndDate())) {
return Carbon::now()->lt(Carbon::instance($endsAt));
} else {
return false;
}
} | [
"public",
"function",
"onGracePeriod",
"(",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"endsAt",
"=",
"$",
"this",
"->",
"getSubscriptionEndDate",
"(",
")",
")",
")",
"{",
"return",
"Carbon",
"::",
"now",
"(",
")",
"->",
"lt",
"(",
"Carbon",
"::"... | Determine if the entity is on grace period after cancellation.
@return bool | [
"Determine",
"if",
"the",
"entity",
"is",
"on",
"grace",
"period",
"after",
"cancellation",
"."
] | 4bf6f49d4d8a05734a295003137f360e331cc10f | https://github.com/infinity-next/braintree/blob/4bf6f49d4d8a05734a295003137f360e331cc10f/src/Billable.php#L210-L217 |
20,181 | infinity-next/braintree | src/Billable.php | Billable.subscribed | public function subscribed()
{
if ($this->requiresCardUpFront()) {
return $this->braintreeIsActive() || $this->onGracePeriod();
}
else {
return $this->braintreeIsActive() || $this->onTrial() || $this->onGracePeriod();
}
} | php | public function subscribed()
{
if ($this->requiresCardUpFront()) {
return $this->braintreeIsActive() || $this->onGracePeriod();
}
else {
return $this->braintreeIsActive() || $this->onTrial() || $this->onGracePeriod();
}
} | [
"public",
"function",
"subscribed",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"requiresCardUpFront",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"braintreeIsActive",
"(",
")",
"||",
"$",
"this",
"->",
"onGracePeriod",
"(",
")",
";",
"}",
"else"... | Determine if the entity has an active subscription.
@return bool | [
"Determine",
"if",
"the",
"entity",
"has",
"an",
"active",
"subscription",
"."
] | 4bf6f49d4d8a05734a295003137f360e331cc10f | https://github.com/infinity-next/braintree/blob/4bf6f49d4d8a05734a295003137f360e331cc10f/src/Billable.php#L224-L232 |
20,182 | tbreuss/pvc | src/Middleware/MiddlewareStack.php | MiddlewareStack.push | public function push(MiddlewareInterface $middleware): self
{
$stack = clone $this;
array_unshift($stack->middlewares, $middleware);
return $stack;
} | php | public function push(MiddlewareInterface $middleware): self
{
$stack = clone $this;
array_unshift($stack->middlewares, $middleware);
return $stack;
} | [
"public",
"function",
"push",
"(",
"MiddlewareInterface",
"$",
"middleware",
")",
":",
"self",
"{",
"$",
"stack",
"=",
"clone",
"$",
"this",
";",
"array_unshift",
"(",
"$",
"stack",
"->",
"middlewares",
",",
"$",
"middleware",
")",
";",
"return",
"$",
"s... | Creates a new stack with the given middleware pushed.
@param MiddlewareInterface $middleware
@return self | [
"Creates",
"a",
"new",
"stack",
"with",
"the",
"given",
"middleware",
"pushed",
"."
] | ae100351010a8c9f645ccb918f70a26e167de7a7 | https://github.com/tbreuss/pvc/blob/ae100351010a8c9f645ccb918f70a26e167de7a7/src/Middleware/MiddlewareStack.php#L65-L70 |
20,183 | HedronDev/hedron | src/Parser/BaseParser.php | BaseParser.getDataDirectoryPath | protected function getDataDirectoryPath() {
$data_dir = $this->getEnvironment()->getDataDirectory();
$config = $this->getConfiguration();
return str_replace('{branch}', $config->getBranch(), $data_dir);
} | php | protected function getDataDirectoryPath() {
$data_dir = $this->getEnvironment()->getDataDirectory();
$config = $this->getConfiguration();
return str_replace('{branch}', $config->getBranch(), $data_dir);
} | [
"protected",
"function",
"getDataDirectoryPath",
"(",
")",
"{",
"$",
"data_dir",
"=",
"$",
"this",
"->",
"getEnvironment",
"(",
")",
"->",
"getDataDirectory",
"(",
")",
";",
"$",
"config",
"=",
"$",
"this",
"->",
"getConfiguration",
"(",
")",
";",
"return"... | The absolute path of the client site data directory.
@return string
The absolute path of the client site data directory. | [
"The",
"absolute",
"path",
"of",
"the",
"client",
"site",
"data",
"directory",
"."
] | 3b4adec4912f2d7c0b7e7262dc36515fbc2e8e00 | https://github.com/HedronDev/hedron/blob/3b4adec4912f2d7c0b7e7262dc36515fbc2e8e00/src/Parser/BaseParser.php#L119-L123 |
20,184 | giftcards/Encryption | Cipher/MysqlAes.php | MysqlAes.mysqlAesKey | protected function mysqlAesKey($key)
{
$newKey = str_repeat(chr(0), 16);
for ($i = 0, $len = strlen($key); $i < $len; $i++) {
$newKey[$i % 16] = $newKey[$i % 16] ^ $key[$i];
}
return $newKey;
} | php | protected function mysqlAesKey($key)
{
$newKey = str_repeat(chr(0), 16);
for ($i = 0, $len = strlen($key); $i < $len; $i++) {
$newKey[$i % 16] = $newKey[$i % 16] ^ $key[$i];
}
return $newKey;
} | [
"protected",
"function",
"mysqlAesKey",
"(",
"$",
"key",
")",
"{",
"$",
"newKey",
"=",
"str_repeat",
"(",
"chr",
"(",
"0",
")",
",",
"16",
")",
";",
"for",
"(",
"$",
"i",
"=",
"0",
",",
"$",
"len",
"=",
"strlen",
"(",
"$",
"key",
")",
";",
"$... | Converts the key into the MySQL equivalent version
@param $key
@return string | [
"Converts",
"the",
"key",
"into",
"the",
"MySQL",
"equivalent",
"version"
] | a48f92408538e2ffe1c8603f168d57803aad7100 | https://github.com/giftcards/Encryption/blob/a48f92408538e2ffe1c8603f168d57803aad7100/Cipher/MysqlAes.php#L61-L70 |
20,185 | Smile-SA/EzUICronBundle | DependencyInjection/SmileEzUICronExtension.php | SmileEzUICronExtension.prependYui | private function prependYui(ContainerBuilder $container)
{
$container->setParameter(
'smile_ez_uicron.public_dir',
'bundles/smileezuicron'
);
$yuiConfigFile = __DIR__ . '/../Resources/config/yui.yml';
$config = Yaml::parse(file_get_contents($yuiConfigFile));
... | php | private function prependYui(ContainerBuilder $container)
{
$container->setParameter(
'smile_ez_uicron.public_dir',
'bundles/smileezuicron'
);
$yuiConfigFile = __DIR__ . '/../Resources/config/yui.yml';
$config = Yaml::parse(file_get_contents($yuiConfigFile));
... | [
"private",
"function",
"prependYui",
"(",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"container",
"->",
"setParameter",
"(",
"'smile_ez_uicron.public_dir'",
",",
"'bundles/smileezuicron'",
")",
";",
"$",
"yuiConfigFile",
"=",
"__DIR__",
".",
"'/../Resources/... | Prepend ezplatform yui interface plugin
@param ContainerBuilder $container | [
"Prepend",
"ezplatform",
"yui",
"interface",
"plugin"
] | c62fc6a3ab0b39e3f911742d9affe4aade90cf66 | https://github.com/Smile-SA/EzUICronBundle/blob/c62fc6a3ab0b39e3f911742d9affe4aade90cf66/DependencyInjection/SmileEzUICronExtension.php#L48-L58 |
20,186 | Smile-SA/EzUICronBundle | DependencyInjection/SmileEzUICronExtension.php | SmileEzUICronExtension.prependCss | private function prependCss(ContainerBuilder $container)
{
$container->setParameter(
'smile_ez_uicron.css_dir',
'bundles/smileezuicron/css'
);
$cssConfigFile = __DIR__ . '/../Resources/config/css.yml';
$config = Yaml::parse(file_get_contents($cssConfigFile));
... | php | private function prependCss(ContainerBuilder $container)
{
$container->setParameter(
'smile_ez_uicron.css_dir',
'bundles/smileezuicron/css'
);
$cssConfigFile = __DIR__ . '/../Resources/config/css.yml';
$config = Yaml::parse(file_get_contents($cssConfigFile));
... | [
"private",
"function",
"prependCss",
"(",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"container",
"->",
"setParameter",
"(",
"'smile_ez_uicron.css_dir'",
",",
"'bundles/smileezuicron/css'",
")",
";",
"$",
"cssConfigFile",
"=",
"__DIR__",
".",
"'/../Resources... | Prepend ezplatform css interface plugin
@param ContainerBuilder $container | [
"Prepend",
"ezplatform",
"css",
"interface",
"plugin"
] | c62fc6a3ab0b39e3f911742d9affe4aade90cf66 | https://github.com/Smile-SA/EzUICronBundle/blob/c62fc6a3ab0b39e3f911742d9affe4aade90cf66/DependencyInjection/SmileEzUICronExtension.php#L65-L75 |
20,187 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/parts/text.php | ezcMailText.generateHeaders | public function generateHeaders()
{
$this->setHeader( "Content-Type", "text/" . $this->subType . "; charset=" . $this->charset );
$this->setHeader( "Content-Transfer-Encoding", $this->encoding );
return parent::generateHeaders();
} | php | public function generateHeaders()
{
$this->setHeader( "Content-Type", "text/" . $this->subType . "; charset=" . $this->charset );
$this->setHeader( "Content-Transfer-Encoding", $this->encoding );
return parent::generateHeaders();
} | [
"public",
"function",
"generateHeaders",
"(",
")",
"{",
"$",
"this",
"->",
"setHeader",
"(",
"\"Content-Type\"",
",",
"\"text/\"",
".",
"$",
"this",
"->",
"subType",
".",
"\"; charset=\"",
".",
"$",
"this",
"->",
"charset",
")",
";",
"$",
"this",
"->",
"... | Returns the headers set for this part as a RFC822 compliant string.
This method does not add the required two lines of space
to separate the headers from the body of the part.
@see setHeader()
@return string | [
"Returns",
"the",
"headers",
"set",
"for",
"this",
"part",
"as",
"a",
"RFC822",
"compliant",
"string",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/parts/text.php#L155-L160 |
20,188 | heidelpay/PhpDoc | src/phpDocumentor/Plugin/Scrybe/Command/Manual/BaseConvertCommand.php | BaseConvertCommand.buildCollection | protected function buildCollection(array $sources, array $extensions)
{
$collection = new Collection();
$collection->setAllowedExtensions($extensions);
foreach ($sources as $path) {
if (is_dir($path)) {
$collection->addDirectory($path);
continue;
... | php | protected function buildCollection(array $sources, array $extensions)
{
$collection = new Collection();
$collection->setAllowedExtensions($extensions);
foreach ($sources as $path) {
if (is_dir($path)) {
$collection->addDirectory($path);
continue;
... | [
"protected",
"function",
"buildCollection",
"(",
"array",
"$",
"sources",
",",
"array",
"$",
"extensions",
")",
"{",
"$",
"collection",
"=",
"new",
"Collection",
"(",
")",
";",
"$",
"collection",
"->",
"setAllowedExtensions",
"(",
"$",
"extensions",
")",
";"... | Constructs a Fileset collection and returns that.
@param array $sources List of source paths.
@param array $extensions List of extensions to scan for in directories.
@return Collection | [
"Constructs",
"a",
"Fileset",
"collection",
"and",
"returns",
"that",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Scrybe/Command/Manual/BaseConvertCommand.php#L195-L209 |
20,189 | gregoryv/php-logger | src/CachedWriter.php | CachedWriter.swrite | public function swrite($severity, $value='')
{
if(sizeof($this->cache) == $this->messageLimit) {
array_shift($this->cache);
}
$this->cache[] = $value;
} | php | public function swrite($severity, $value='')
{
if(sizeof($this->cache) == $this->messageLimit) {
array_shift($this->cache);
}
$this->cache[] = $value;
} | [
"public",
"function",
"swrite",
"(",
"$",
"severity",
",",
"$",
"value",
"=",
"''",
")",
"{",
"if",
"(",
"sizeof",
"(",
"$",
"this",
"->",
"cache",
")",
"==",
"$",
"this",
"->",
"messageLimit",
")",
"{",
"array_shift",
"(",
"$",
"this",
"->",
"cach... | Stores messages in the public cache by priority | [
"Stores",
"messages",
"in",
"the",
"public",
"cache",
"by",
"priority"
] | 0f8ffc360a0233531a9775359929af8876997862 | https://github.com/gregoryv/php-logger/blob/0f8ffc360a0233531a9775359929af8876997862/src/CachedWriter.php#L29-L35 |
20,190 | DevGroup-ru/yii2-users-module | src/controllers/RbacManageController.php | RbacManageController.actionRemoveItems | public function actionRemoveItems()
{
if (false === Yii::$app->request->isAjax) {
throw new NotFoundHttpException(Yii::t('users', 'Page not found'));
}
$type = Yii::$app->request->post('item-type', 0);
self::checkPermissions($type);
$items = Yii::$app->request->po... | php | public function actionRemoveItems()
{
if (false === Yii::$app->request->isAjax) {
throw new NotFoundHttpException(Yii::t('users', 'Page not found'));
}
$type = Yii::$app->request->post('item-type', 0);
self::checkPermissions($type);
$items = Yii::$app->request->po... | [
"public",
"function",
"actionRemoveItems",
"(",
")",
"{",
"if",
"(",
"false",
"===",
"Yii",
"::",
"$",
"app",
"->",
"request",
"->",
"isAjax",
")",
"{",
"throw",
"new",
"NotFoundHttpException",
"(",
"Yii",
"::",
"t",
"(",
"'users'",
",",
"'Page not found'"... | Respond only on Ajax
@throws NotFoundHttpException | [
"Respond",
"only",
"on",
"Ajax"
] | ff0103dc55c3462627ccc704c33e70c96053f750 | https://github.com/DevGroup-ru/yii2-users-module/blob/ff0103dc55c3462627ccc704c33e70c96053f750/src/controllers/RbacManageController.php#L90-L117 |
20,191 | DevGroup-ru/yii2-users-module | src/controllers/RbacManageController.php | RbacManageController.actionDelete | public function actionDelete($id, $type, $returnUrl = '')
{
self::checkPermissions($type);
if (true === Yii::$app->getAuthManager()->remove(new Item(['name' => $id]))) {
Yii::$app->session->setFlash(
'info',
Yii::t('users', "Item successfully removed")
... | php | public function actionDelete($id, $type, $returnUrl = '')
{
self::checkPermissions($type);
if (true === Yii::$app->getAuthManager()->remove(new Item(['name' => $id]))) {
Yii::$app->session->setFlash(
'info',
Yii::t('users', "Item successfully removed")
... | [
"public",
"function",
"actionDelete",
"(",
"$",
"id",
",",
"$",
"type",
",",
"$",
"returnUrl",
"=",
"''",
")",
"{",
"self",
"::",
"checkPermissions",
"(",
"$",
"type",
")",
";",
"if",
"(",
"true",
"===",
"Yii",
"::",
"$",
"app",
"->",
"getAuthManager... | Deletes an existing RBAC Item model.
@param integer $id
@param $type
@param string $returnUrl
@return mixed
@throws ForbiddenHttpException | [
"Deletes",
"an",
"existing",
"RBAC",
"Item",
"model",
"."
] | ff0103dc55c3462627ccc704c33e70c96053f750 | https://github.com/DevGroup-ru/yii2-users-module/blob/ff0103dc55c3462627ccc704c33e70c96053f750/src/controllers/RbacManageController.php#L128-L144 |
20,192 | creolab/resources | src/Transformer.php | Transformer.transform | public function transform($data = null, $rules = null)
{
// The data
if ( ! $data) $data = $this->data;
// The rules
if ( ! $rules) $rules = $this->rules;
// Merge the default ones in
$rules = array_merge($this->defaultRules, $rules);
foreach ($rules as $key => $rule)
{
if (isset($data[$key]))
... | php | public function transform($data = null, $rules = null)
{
// The data
if ( ! $data) $data = $this->data;
// The rules
if ( ! $rules) $rules = $this->rules;
// Merge the default ones in
$rules = array_merge($this->defaultRules, $rules);
foreach ($rules as $key => $rule)
{
if (isset($data[$key]))
... | [
"public",
"function",
"transform",
"(",
"$",
"data",
"=",
"null",
",",
"$",
"rules",
"=",
"null",
")",
"{",
"// The data",
"if",
"(",
"!",
"$",
"data",
")",
"$",
"data",
"=",
"$",
"this",
"->",
"data",
";",
"// The rules",
"if",
"(",
"!",
"$",
"r... | Transform data types for item
@param array $data
@param array $rules
@return array | [
"Transform",
"data",
"types",
"for",
"item"
] | 6e1bdd266aa373f6dafd2408b230f7d2fa05a637 | https://github.com/creolab/resources/blob/6e1bdd266aa373f6dafd2408b230f7d2fa05a637/src/Transformer.php#L39-L65 |
20,193 | legalthings/permission-matcher | src/PermissionMatcher.php | PermissionMatcher.match | public function match($permissions, array $authzGroups)
{
$privileges = [];
foreach ($permissions as $permissionAuthzGroup => $permissionPrivileges) {
$matchingAuthzGroup = $this->getMatchingAuthzGroup($permissionAuthzGroup, $authzGroups);
if (!$matchingAuthzGro... | php | public function match($permissions, array $authzGroups)
{
$privileges = [];
foreach ($permissions as $permissionAuthzGroup => $permissionPrivileges) {
$matchingAuthzGroup = $this->getMatchingAuthzGroup($permissionAuthzGroup, $authzGroups);
if (!$matchingAuthzGro... | [
"public",
"function",
"match",
"(",
"$",
"permissions",
",",
"array",
"$",
"authzGroups",
")",
"{",
"$",
"privileges",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"permissions",
"as",
"$",
"permissionAuthzGroup",
"=>",
"$",
"permissionPrivileges",
")",
"{",
"... | Get a flat list of privileges for matching authz groups
@param array|object $permissions
@param array $authzGroups
@return array | [
"Get",
"a",
"flat",
"list",
"of",
"privileges",
"for",
"matching",
"authz",
"groups"
] | fbfa925e92406fe9dac83b387be47931e6de0f81 | https://github.com/legalthings/permission-matcher/blob/fbfa925e92406fe9dac83b387be47931e6de0f81/src/PermissionMatcher.php#L17-L32 |
20,194 | legalthings/permission-matcher | src/PermissionMatcher.php | PermissionMatcher.matchFull | public function matchFull($permissions, array $authzGroups)
{
$privileges = [];
foreach ($permissions as $permissionAuthzGroup => $permissionPrivileges) {
$matchingAuthzGroup = $this->getMatchingAuthzGroup($permissionAuthzGroup, $authzGroups);
if (!$matchingAuth... | php | public function matchFull($permissions, array $authzGroups)
{
$privileges = [];
foreach ($permissions as $permissionAuthzGroup => $permissionPrivileges) {
$matchingAuthzGroup = $this->getMatchingAuthzGroup($permissionAuthzGroup, $authzGroups);
if (!$matchingAuth... | [
"public",
"function",
"matchFull",
"(",
"$",
"permissions",
",",
"array",
"$",
"authzGroups",
")",
"{",
"$",
"privileges",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"permissions",
"as",
"$",
"permissionAuthzGroup",
"=>",
"$",
"permissionPrivileges",
")",
"{",... | Get a list of privileges for matching authz groups containing more information
Returns an array of objects where the privilege is the key and authzgroups the value
@param array|object $permissions
@param array $authzGroups
@return array | [
"Get",
"a",
"list",
"of",
"privileges",
"for",
"matching",
"authz",
"groups",
"containing",
"more",
"information",
"Returns",
"an",
"array",
"of",
"objects",
"where",
"the",
"privilege",
"is",
"the",
"key",
"and",
"authzgroups",
"the",
"value"
] | fbfa925e92406fe9dac83b387be47931e6de0f81 | https://github.com/legalthings/permission-matcher/blob/fbfa925e92406fe9dac83b387be47931e6de0f81/src/PermissionMatcher.php#L42-L59 |
20,195 | legalthings/permission-matcher | src/PermissionMatcher.php | PermissionMatcher.getMatchingAuthzGroup | protected function getMatchingAuthzGroup($permissionAuthzGroup, array $authzGroups)
{
$invert = $this->stringStartsWith($permissionAuthzGroup, '!');
if ($invert) {
$permissionAuthzGroup = substr($permissionAuthzGroup, 1);
}
$matches = [];
... | php | protected function getMatchingAuthzGroup($permissionAuthzGroup, array $authzGroups)
{
$invert = $this->stringStartsWith($permissionAuthzGroup, '!');
if ($invert) {
$permissionAuthzGroup = substr($permissionAuthzGroup, 1);
}
$matches = [];
... | [
"protected",
"function",
"getMatchingAuthzGroup",
"(",
"$",
"permissionAuthzGroup",
",",
"array",
"$",
"authzGroups",
")",
"{",
"$",
"invert",
"=",
"$",
"this",
"->",
"stringStartsWith",
"(",
"$",
"permissionAuthzGroup",
",",
"'!'",
")",
";",
"if",
"(",
"$",
... | Check if one of the authz groups match
@param string $permissionAuthzGroup
@param array $authzGroups
@return string|null | [
"Check",
"if",
"one",
"of",
"the",
"authz",
"groups",
"match"
] | fbfa925e92406fe9dac83b387be47931e6de0f81 | https://github.com/legalthings/permission-matcher/blob/fbfa925e92406fe9dac83b387be47931e6de0f81/src/PermissionMatcher.php#L68-L91 |
20,196 | legalthings/permission-matcher | src/PermissionMatcher.php | PermissionMatcher.authzGroupsAreEqual | protected function authzGroupsAreEqual($permissionAuthzGroup, $authzGroup)
{
return $this->pathsAreEqual($permissionAuthzGroup, $authzGroup) &&
$this->queryParamsAreEqual($permissionAuthzGroup, $authzGroup);
} | php | protected function authzGroupsAreEqual($permissionAuthzGroup, $authzGroup)
{
return $this->pathsAreEqual($permissionAuthzGroup, $authzGroup) &&
$this->queryParamsAreEqual($permissionAuthzGroup, $authzGroup);
} | [
"protected",
"function",
"authzGroupsAreEqual",
"(",
"$",
"permissionAuthzGroup",
",",
"$",
"authzGroup",
")",
"{",
"return",
"$",
"this",
"->",
"pathsAreEqual",
"(",
"$",
"permissionAuthzGroup",
",",
"$",
"authzGroup",
")",
"&&",
"$",
"this",
"->",
"queryParams... | Check if authz groups match
@param string $permissionAuthzGroup
@param string $authzGroup
@return boolean | [
"Check",
"if",
"authz",
"groups",
"match"
] | fbfa925e92406fe9dac83b387be47931e6de0f81 | https://github.com/legalthings/permission-matcher/blob/fbfa925e92406fe9dac83b387be47931e6de0f81/src/PermissionMatcher.php#L101-L105 |
20,197 | legalthings/permission-matcher | src/PermissionMatcher.php | PermissionMatcher.pathsAreEqual | protected function pathsAreEqual($permissionAuthzGroup, $authzGroup)
{
$permissionAuthzGroupPath = rtrim(strtok($permissionAuthzGroup, '?'), '/');
$authzGroupPath = rtrim(strtok($authzGroup, '?'), '/');
return $this->matchAuthzGroupPaths($permissionAuthzGroupPath, $authzGroupPath) ||
... | php | protected function pathsAreEqual($permissionAuthzGroup, $authzGroup)
{
$permissionAuthzGroupPath = rtrim(strtok($permissionAuthzGroup, '?'), '/');
$authzGroupPath = rtrim(strtok($authzGroup, '?'), '/');
return $this->matchAuthzGroupPaths($permissionAuthzGroupPath, $authzGroupPath) ||
... | [
"protected",
"function",
"pathsAreEqual",
"(",
"$",
"permissionAuthzGroup",
",",
"$",
"authzGroup",
")",
"{",
"$",
"permissionAuthzGroupPath",
"=",
"rtrim",
"(",
"strtok",
"(",
"$",
"permissionAuthzGroup",
",",
"'?'",
")",
",",
"'/'",
")",
";",
"$",
"authzGrou... | Compare the paths of two authz groups
@param string $permissionAuthzGroup
@param string $authzGroup
@return boolean | [
"Compare",
"the",
"paths",
"of",
"two",
"authz",
"groups"
] | fbfa925e92406fe9dac83b387be47931e6de0f81 | https://github.com/legalthings/permission-matcher/blob/fbfa925e92406fe9dac83b387be47931e6de0f81/src/PermissionMatcher.php#L114-L121 |
20,198 | legalthings/permission-matcher | src/PermissionMatcher.php | PermissionMatcher.matchAuthzGroupPaths | protected function matchAuthzGroupPaths($pattern, $subject)
{
$regex = '^' . str_replace('[^/]+', '\\*', preg_quote($pattern, '~')) . '$';
$regex = str_replace('\\*', '(.*)', $regex);
$match = preg_match('~' . $regex . '~i', $subject);
return $match;
} | php | protected function matchAuthzGroupPaths($pattern, $subject)
{
$regex = '^' . str_replace('[^/]+', '\\*', preg_quote($pattern, '~')) . '$';
$regex = str_replace('\\*', '(.*)', $regex);
$match = preg_match('~' . $regex . '~i', $subject);
return $match;
} | [
"protected",
"function",
"matchAuthzGroupPaths",
"(",
"$",
"pattern",
",",
"$",
"subject",
")",
"{",
"$",
"regex",
"=",
"'^'",
".",
"str_replace",
"(",
"'[^/]+'",
",",
"'\\\\*'",
",",
"preg_quote",
"(",
"$",
"pattern",
",",
"'~'",
")",
")",
".",
"'$'",
... | Check if one paths mathes the other
@param string $pattern
@param string $subject
@return boolean | [
"Check",
"if",
"one",
"paths",
"mathes",
"the",
"other"
] | fbfa925e92406fe9dac83b387be47931e6de0f81 | https://github.com/legalthings/permission-matcher/blob/fbfa925e92406fe9dac83b387be47931e6de0f81/src/PermissionMatcher.php#L130-L138 |
20,199 | legalthings/permission-matcher | src/PermissionMatcher.php | PermissionMatcher.queryParamsAreEqual | protected function queryParamsAreEqual($permissionAuthzGroup, $authzGroup)
{
$authzGroupQueryParams = array_change_key_case($this->getStringQueryParameters($authzGroup), CASE_LOWER);
$permissionAuthzGroupQueryParams = array_change_key_case($this->getStringQueryParameters($permissionAuthzGroup), CASE... | php | protected function queryParamsAreEqual($permissionAuthzGroup, $authzGroup)
{
$authzGroupQueryParams = array_change_key_case($this->getStringQueryParameters($authzGroup), CASE_LOWER);
$permissionAuthzGroupQueryParams = array_change_key_case($this->getStringQueryParameters($permissionAuthzGroup), CASE... | [
"protected",
"function",
"queryParamsAreEqual",
"(",
"$",
"permissionAuthzGroup",
",",
"$",
"authzGroup",
")",
"{",
"$",
"authzGroupQueryParams",
"=",
"array_change_key_case",
"(",
"$",
"this",
"->",
"getStringQueryParameters",
"(",
"$",
"authzGroup",
")",
",",
"CAS... | Compare the query parameters of two authz groups
@param string $permissionAuthzGroup
@param string $authzGroup
@return boolean | [
"Compare",
"the",
"query",
"parameters",
"of",
"two",
"authz",
"groups"
] | fbfa925e92406fe9dac83b387be47931e6de0f81 | https://github.com/legalthings/permission-matcher/blob/fbfa925e92406fe9dac83b387be47931e6de0f81/src/PermissionMatcher.php#L148-L157 |
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.