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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
19,200 | xinix-technology/norm | src/Norm/Model.php | Model.prepare | public function prepare($key, $value, $schema = null)
{
if ($this->collection) {
return $this->collection->prepare($key, $value, $schema);
} else {
return $value;
}
} | php | public function prepare($key, $value, $schema = null)
{
if ($this->collection) {
return $this->collection->prepare($key, $value, $schema);
} else {
return $value;
}
} | [
"public",
"function",
"prepare",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"schema",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"collection",
")",
"{",
"return",
"$",
"this",
"->",
"collection",
"->",
"prepare",
"(",
"$",
"key",
",",
... | Prepare model to be sync'd.
@method prepare
@param string $key
@param string $value
@param mixed $schema
@return [type] | [
"Prepare",
"model",
"to",
"be",
"sync",
"d",
"."
] | c357f7d3a75d05324dd84b8f6a968a094c53d603 | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Model.php#L302-L309 |
19,201 | xinix-technology/norm | src/Norm/Model.php | Model.toArray | public function toArray($fetchType = Model::FETCH_ALL)
{
if ($fetchType === Model::FETCH_RAW) {
return $this->attributes;
}
$attributes = array();
if (empty($this->attributes)) {
$this->attributes = array();
}
if ($fetchType === Model::FETCH... | php | public function toArray($fetchType = Model::FETCH_ALL)
{
if ($fetchType === Model::FETCH_RAW) {
return $this->attributes;
}
$attributes = array();
if (empty($this->attributes)) {
$this->attributes = array();
}
if ($fetchType === Model::FETCH... | [
"public",
"function",
"toArray",
"(",
"$",
"fetchType",
"=",
"Model",
"::",
"FETCH_ALL",
")",
"{",
"if",
"(",
"$",
"fetchType",
"===",
"Model",
"::",
"FETCH_RAW",
")",
"{",
"return",
"$",
"this",
"->",
"attributes",
";",
"}",
"$",
"attributes",
"=",
"a... | Get array structure of model
@param mixed $fetchType
@return array | [
"Get",
"array",
"structure",
"of",
"model"
] | c357f7d3a75d05324dd84b8f6a968a094c53d603 | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Model.php#L352-L384 |
19,202 | xinix-technology/norm | src/Norm/Model.php | Model.jsonSerialize | public function jsonSerialize()
{
if (! Norm::options('include')) {
return $this->toArray();
}
$destination = array();
$source = $this->toArray();
$schema = $this->collection->schema();
foreach ($source as $key => $value) {
if (isset($schem... | php | public function jsonSerialize()
{
if (! Norm::options('include')) {
return $this->toArray();
}
$destination = array();
$source = $this->toArray();
$schema = $this->collection->schema();
foreach ($source as $key => $value) {
if (isset($schem... | [
"public",
"function",
"jsonSerialize",
"(",
")",
"{",
"if",
"(",
"!",
"Norm",
"::",
"options",
"(",
"'include'",
")",
")",
"{",
"return",
"$",
"this",
"->",
"toArray",
"(",
")",
";",
"}",
"$",
"destination",
"=",
"array",
"(",
")",
";",
"$",
"sourc... | Implement the json serializer normalizing the data structures.
@return array | [
"Implement",
"the",
"json",
"serializer",
"normalizing",
"the",
"data",
"structures",
"."
] | c357f7d3a75d05324dd84b8f6a968a094c53d603 | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Model.php#L448-L470 |
19,203 | xinix-technology/norm | src/Norm/Model.php | Model.previous | public function previous($key = null)
{
if (is_null($key)) {
return $this->oldAttributes;
}
return $this->oldAttributes[$key];
} | php | public function previous($key = null)
{
if (is_null($key)) {
return $this->oldAttributes;
}
return $this->oldAttributes[$key];
} | [
"public",
"function",
"previous",
"(",
"$",
"key",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"key",
")",
")",
"{",
"return",
"$",
"this",
"->",
"oldAttributes",
";",
"}",
"return",
"$",
"this",
"->",
"oldAttributes",
"[",
"$",
"key",
"... | Get original attributes
@method previous
@param string $key
@return mixed | [
"Get",
"original",
"attributes"
] | c357f7d3a75d05324dd84b8f6a968a094c53d603 | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Model.php#L493-L500 |
19,204 | xinix-technology/norm | src/Norm/Model.php | Model.schemaByIndex | public function schemaByIndex($index)
{
$schema = array();
foreach ($this->collection->schema() as $value) {
$schema[] = $value;
}
return (empty($schema[$index])) ? null : $schema[$index];
} | php | public function schemaByIndex($index)
{
$schema = array();
foreach ($this->collection->schema() as $value) {
$schema[] = $value;
}
return (empty($schema[$index])) ? null : $schema[$index];
} | [
"public",
"function",
"schemaByIndex",
"(",
"$",
"index",
")",
"{",
"$",
"schema",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"collection",
"->",
"schema",
"(",
")",
"as",
"$",
"value",
")",
"{",
"$",
"schema",
"[",
"]",
"=",
... | Get schema configuration by offset name.
@method schemaByIndex
@param string $index
@return mixed | [
"Get",
"schema",
"configuration",
"by",
"offset",
"name",
"."
] | c357f7d3a75d05324dd84b8f6a968a094c53d603 | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Model.php#L553-L562 |
19,205 | xinix-technology/norm | src/Norm/Model.php | Model.format | public function format($field = null, $format = null)
{
$numArgs = func_num_args();
if ($numArgs === 0) {
$formatter = $this->collection->option('format');
if (is_null($formatter)) {
$schema = $this->schemaByIndex(0);
if (!is_null($schema)) {... | php | public function format($field = null, $format = null)
{
$numArgs = func_num_args();
if ($numArgs === 0) {
$formatter = $this->collection->option('format');
if (is_null($formatter)) {
$schema = $this->schemaByIndex(0);
if (!is_null($schema)) {... | [
"public",
"function",
"format",
"(",
"$",
"field",
"=",
"null",
",",
"$",
"format",
"=",
"null",
")",
"{",
"$",
"numArgs",
"=",
"func_num_args",
"(",
")",
";",
"if",
"(",
"$",
"numArgs",
"===",
"0",
")",
"{",
"$",
"formatter",
"=",
"$",
"this",
"... | Format the model to HTML file. Bind it's attributes to view.
@method format
@param string $field
@param string $format
@return mixed | [
"Format",
"the",
"model",
"to",
"HTML",
"file",
".",
"Bind",
"it",
"s",
"attributes",
"to",
"view",
"."
] | c357f7d3a75d05324dd84b8f6a968a094c53d603 | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Model.php#L574-L615 |
19,206 | yuncms/framework | src/admin/widgets/Inspinia.php | Inspinia.endBodyToolbar | public function endBodyToolbar()
{
$this->_setBeginning(false);
$toolbar = trim(ob_get_clean());
if (is_string($this->bodyToolbar)) {
$this->bodyToolbar = [$this->bodyToolbar];
}
$this->bodyToolbar[] = [
'body' => $toolbar,
'options' => $th... | php | public function endBodyToolbar()
{
$this->_setBeginning(false);
$toolbar = trim(ob_get_clean());
if (is_string($this->bodyToolbar)) {
$this->bodyToolbar = [$this->bodyToolbar];
}
$this->bodyToolbar[] = [
'body' => $toolbar,
'options' => $th... | [
"public",
"function",
"endBodyToolbar",
"(",
")",
"{",
"$",
"this",
"->",
"_setBeginning",
"(",
"false",
")",
";",
"$",
"toolbar",
"=",
"trim",
"(",
"ob_get_clean",
"(",
")",
")",
";",
"if",
"(",
"is_string",
"(",
"$",
"this",
"->",
"bodyToolbar",
")",... | End Body Toolbar
@throws Exception | [
"End",
"Body",
"Toolbar"
] | af42e28ea4ae15ab8eead3f6d119f93863b94154 | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/admin/widgets/Inspinia.php#L196-L208 |
19,207 | yuncms/framework | src/admin/widgets/Inspinia.php | Inspinia._getBodyToolbar | private function _getBodyToolbar()
{
if ($this->bodyToolbar !== null) {
Html::addCssClass($this->bodyToolbarOptions, 'widget-body-toolbar');
$toolbars = is_string($this->bodyToolbar) ? [$this->bodyToolbar] : $this->bodyToolbar;
foreach ($toolbars as $toolbar) {
... | php | private function _getBodyToolbar()
{
if ($this->bodyToolbar !== null) {
Html::addCssClass($this->bodyToolbarOptions, 'widget-body-toolbar');
$toolbars = is_string($this->bodyToolbar) ? [$this->bodyToolbar] : $this->bodyToolbar;
foreach ($toolbars as $toolbar) {
... | [
"private",
"function",
"_getBodyToolbar",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"bodyToolbar",
"!==",
"null",
")",
"{",
"Html",
"::",
"addCssClass",
"(",
"$",
"this",
"->",
"bodyToolbarOptions",
",",
"'widget-body-toolbar'",
")",
";",
"$",
"toolbars",... | Get body toolbar | [
"Get",
"body",
"toolbar"
] | af42e28ea4ae15ab8eead3f6d119f93863b94154 | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/admin/widgets/Inspinia.php#L259-L275 |
19,208 | activecollab/configfile | src/ConfigFile.php | ConfigFile.getFromConst | private function getFromConst($line)
{
$eq_pos = strpos($line, '=');
$semicolon_pos = strrpos($line, ';');
$constant_name = trim(substr($line, 6, $eq_pos - 6));
$value = trim(substr($line, $eq_pos + 1, $semicolon_pos - $eq_pos - 1));
return [$constant_name, $this->getNative... | php | private function getFromConst($line)
{
$eq_pos = strpos($line, '=');
$semicolon_pos = strrpos($line, ';');
$constant_name = trim(substr($line, 6, $eq_pos - 6));
$value = trim(substr($line, $eq_pos + 1, $semicolon_pos - $eq_pos - 1));
return [$constant_name, $this->getNative... | [
"private",
"function",
"getFromConst",
"(",
"$",
"line",
")",
"{",
"$",
"eq_pos",
"=",
"strpos",
"(",
"$",
"line",
",",
"'='",
")",
";",
"$",
"semicolon_pos",
"=",
"strrpos",
"(",
"$",
"line",
",",
"';'",
")",
";",
"$",
"constant_name",
"=",
"trim",
... | Return single option from const DB_XYZ defition line
@param string $line
@return string | [
"Return",
"single",
"option",
"from",
"const",
"DB_XYZ",
"defition",
"line"
] | fe0ae7da3466f26e49e54b6dd3508c85421c0bdf | https://github.com/activecollab/configfile/blob/fe0ae7da3466f26e49e54b6dd3508c85421c0bdf/src/ConfigFile.php#L113-L122 |
19,209 | activecollab/configfile | src/ConfigFile.php | ConfigFile.getOptionNameFromDefinition | public function getOptionNameFromDefinition($constant_name)
{
if ($this->strStartsWith($constant_name, "'") && $this->strEndsWith($constant_name, "'")) {
return trim(trim($constant_name, "'")); // single quote
} else {
if ($this->strStartsWith($constant_name, '"') && $this->s... | php | public function getOptionNameFromDefinition($constant_name)
{
if ($this->strStartsWith($constant_name, "'") && $this->strEndsWith($constant_name, "'")) {
return trim(trim($constant_name, "'")); // single quote
} else {
if ($this->strStartsWith($constant_name, '"') && $this->s... | [
"public",
"function",
"getOptionNameFromDefinition",
"(",
"$",
"constant_name",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"strStartsWith",
"(",
"$",
"constant_name",
",",
"\"'\"",
")",
"&&",
"$",
"this",
"->",
"strEndsWith",
"(",
"$",
"constant_name",
",",
"\"... | Return config option name from defintiion string
@param string $constant_name
@return string | [
"Return",
"config",
"option",
"name",
"from",
"defintiion",
"string"
] | fe0ae7da3466f26e49e54b6dd3508c85421c0bdf | https://github.com/activecollab/configfile/blob/fe0ae7da3466f26e49e54b6dd3508c85421c0bdf/src/ConfigFile.php#L189-L200 |
19,210 | activecollab/configfile | src/ConfigFile.php | ConfigFile.getNativeValueFromDefinition | private function getNativeValueFromDefinition($value)
{
if ($this->strStartsWith($value, "'") && $this->strEndsWith($value, "'")) {
$value = trim(trim($value, "'")); // single quote
} else {
if ($this->strStartsWith($value, '"') && $this->strEndsWith($value, '"')) {
... | php | private function getNativeValueFromDefinition($value)
{
if ($this->strStartsWith($value, "'") && $this->strEndsWith($value, "'")) {
$value = trim(trim($value, "'")); // single quote
} else {
if ($this->strStartsWith($value, '"') && $this->strEndsWith($value, '"')) {
... | [
"private",
"function",
"getNativeValueFromDefinition",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"strStartsWith",
"(",
"$",
"value",
",",
"\"'\"",
")",
"&&",
"$",
"this",
"->",
"strEndsWith",
"(",
"$",
"value",
",",
"\"'\"",
")",
")",
... | Cast declared value to internal type
@param string $value
@return mixed | [
"Cast",
"declared",
"value",
"to",
"internal",
"type"
] | fe0ae7da3466f26e49e54b6dd3508c85421c0bdf | https://github.com/activecollab/configfile/blob/fe0ae7da3466f26e49e54b6dd3508c85421c0bdf/src/ConfigFile.php#L208-L235 |
19,211 | activecollab/configfile | src/ConfigFile.php | ConfigFile.strStartsWith | private function strStartsWith($string, $niddle)
{
return mb_strtolower(substr($string, 0, mb_strlen($niddle))) == mb_strtolower($niddle);
} | php | private function strStartsWith($string, $niddle)
{
return mb_strtolower(substr($string, 0, mb_strlen($niddle))) == mb_strtolower($niddle);
} | [
"private",
"function",
"strStartsWith",
"(",
"$",
"string",
",",
"$",
"niddle",
")",
"{",
"return",
"mb_strtolower",
"(",
"substr",
"(",
"$",
"string",
",",
"0",
",",
"mb_strlen",
"(",
"$",
"niddle",
")",
")",
")",
"==",
"mb_strtolower",
"(",
"$",
"nid... | Case insensitive string begins with
@param string $string
@param string $niddle
@return boolean | [
"Case",
"insensitive",
"string",
"begins",
"with"
] | fe0ae7da3466f26e49e54b6dd3508c85421c0bdf | https://github.com/activecollab/configfile/blob/fe0ae7da3466f26e49e54b6dd3508c85421c0bdf/src/ConfigFile.php#L266-L269 |
19,212 | activecollab/configfile | src/ConfigFile.php | ConfigFile.strEndsWith | private function strEndsWith($string, $niddle)
{
return mb_substr($string, mb_strlen($string) - mb_strlen($niddle), mb_strlen($niddle)) == $niddle;
} | php | private function strEndsWith($string, $niddle)
{
return mb_substr($string, mb_strlen($string) - mb_strlen($niddle), mb_strlen($niddle)) == $niddle;
} | [
"private",
"function",
"strEndsWith",
"(",
"$",
"string",
",",
"$",
"niddle",
")",
"{",
"return",
"mb_substr",
"(",
"$",
"string",
",",
"mb_strlen",
"(",
"$",
"string",
")",
"-",
"mb_strlen",
"(",
"$",
"niddle",
")",
",",
"mb_strlen",
"(",
"$",
"niddle... | Case insensitive string ends with
@param string $string
@param string $niddle
@return boolean | [
"Case",
"insensitive",
"string",
"ends",
"with"
] | fe0ae7da3466f26e49e54b6dd3508c85421c0bdf | https://github.com/activecollab/configfile/blob/fe0ae7da3466f26e49e54b6dd3508c85421c0bdf/src/ConfigFile.php#L290-L293 |
19,213 | 2amigos/yiifoundation | helpers/Typo.php | Typo.vCard | public static function vCard($name, $address = '', $locality = '', $state = '', $zip = '', $email = '')
{
$items = array();
$items[] = \CHtml::tag('li', array('class' => 'fn'), $name);
$items[] = \CHtml::tag('li', array('class' => 'street-address'), $address);
$items[] = \CHtml::ta... | php | public static function vCard($name, $address = '', $locality = '', $state = '', $zip = '', $email = '')
{
$items = array();
$items[] = \CHtml::tag('li', array('class' => 'fn'), $name);
$items[] = \CHtml::tag('li', array('class' => 'street-address'), $address);
$items[] = \CHtml::ta... | [
"public",
"static",
"function",
"vCard",
"(",
"$",
"name",
",",
"$",
"address",
"=",
"''",
",",
"$",
"locality",
"=",
"''",
",",
"$",
"state",
"=",
"''",
",",
"$",
"zip",
"=",
"''",
",",
"$",
"email",
"=",
"''",
")",
"{",
"$",
"items",
"=",
"... | Renders a handy microformat-friendly list for addresses
@param string $name
@param string $address
@param string $locality
@param string $state
@param string $zip
@param string $email
@return string the generated vcard | [
"Renders",
"a",
"handy",
"microformat",
"-",
"friendly",
"list",
"for",
"addresses"
] | 49bed0d3ca1a9bac9299000e48a2661bdc8f9a29 | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/helpers/Typo.php#L64-L77 |
19,214 | 2amigos/yiifoundation | helpers/Typo.php | Typo.inlineList | public static function inlineList($items, $htmlOptions = array())
{
$listItems = array();
Html::addCssClass($htmlOptions, 'inline-list');
foreach ($items as $item) {
$listItems[] = \CHtml::tag('li', $htmlOptions, $item);
}
if (!empty($listItems)) {
re... | php | public static function inlineList($items, $htmlOptions = array())
{
$listItems = array();
Html::addCssClass($htmlOptions, 'inline-list');
foreach ($items as $item) {
$listItems[] = \CHtml::tag('li', $htmlOptions, $item);
}
if (!empty($listItems)) {
re... | [
"public",
"static",
"function",
"inlineList",
"(",
"$",
"items",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
")",
"{",
"$",
"listItems",
"=",
"array",
"(",
")",
";",
"Html",
"::",
"addCssClass",
"(",
"$",
"htmlOptions",
",",
"'inline-list'",
")",
... | Renders and inline list
@param array $items the items to render
@param array $htmlOptions the HTML attributes
@return string the generated list | [
"Renders",
"and",
"inline",
"list"
] | 49bed0d3ca1a9bac9299000e48a2661bdc8f9a29 | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/helpers/Typo.php#L85-L96 |
19,215 | 2amigos/yiifoundation | helpers/Typo.php | Typo.label | public static function label($text, $htmlOptions = array())
{
ArrayHelper::addValue('class', 'label', $htmlOptions);
return \CHtml::tag('span', $htmlOptions, $text);
} | php | public static function label($text, $htmlOptions = array())
{
ArrayHelper::addValue('class', 'label', $htmlOptions);
return \CHtml::tag('span', $htmlOptions, $text);
} | [
"public",
"static",
"function",
"label",
"(",
"$",
"text",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
")",
"{",
"ArrayHelper",
"::",
"addValue",
"(",
"'class'",
",",
"'label'",
",",
"$",
"htmlOptions",
")",
";",
"return",
"\\",
"CHtml",
"::",
"ta... | Renders a Foundation label
@param string $text the text to render within the label
@param array $htmlOptions the HTML attributes
@return string the generated label | [
"Renders",
"a",
"Foundation",
"label"
] | 49bed0d3ca1a9bac9299000e48a2661bdc8f9a29 | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/helpers/Typo.php#L104-L108 |
19,216 | austinkregel/Warden | src/Warden/Http/Controllers/ApiController.php | ApiController.modelHasBeenSaved | protected function modelHasBeenSaved($saved, $type, $request)
{
if (!$saved) {
return response()->json(['message' => 'Failed to '.$type.' resource', 'code' => 422], 422);
}
$status = $request->ajax() ? 202 : 200;
if ($request->ajax()) {
return response()->json... | php | protected function modelHasBeenSaved($saved, $type, $request)
{
if (!$saved) {
return response()->json(['message' => 'Failed to '.$type.' resource', 'code' => 422], 422);
}
$status = $request->ajax() ? 202 : 200;
if ($request->ajax()) {
return response()->json... | [
"protected",
"function",
"modelHasBeenSaved",
"(",
"$",
"saved",
",",
"$",
"type",
",",
"$",
"request",
")",
"{",
"if",
"(",
"!",
"$",
"saved",
")",
"{",
"return",
"response",
"(",
")",
"->",
"json",
"(",
"[",
"'message'",
"=>",
"'Failed to '",
".",
... | This method handles how submitted quests are handle, the main related methods for it are
POST and.
@param $saved
@param $request
@return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse | [
"This",
"method",
"handles",
"how",
"submitted",
"quests",
"are",
"handle",
"the",
"main",
"related",
"methods",
"for",
"it",
"are",
"POST",
"and",
"."
] | 6f5a98bd79a488f0f300f4851061ac6f7d19f8a3 | https://github.com/austinkregel/Warden/blob/6f5a98bd79a488f0f300f4851061ac6f7d19f8a3/src/Warden/Http/Controllers/ApiController.php#L123-L139 |
19,217 | austinkregel/Warden | src/Warden/Http/Controllers/ApiController.php | ApiController.validatePut | public function validatePut($input, $model, $model_name)
{
return collect($input)->filter(function ($value, $key) use ($model, $input) {
// Remove _token
if (!isset($value) || $key === '_token') {
return false;
}
//Remove values that are the s... | php | public function validatePut($input, $model, $model_name)
{
return collect($input)->filter(function ($value, $key) use ($model, $input) {
// Remove _token
if (!isset($value) || $key === '_token') {
return false;
}
//Remove values that are the s... | [
"public",
"function",
"validatePut",
"(",
"$",
"input",
",",
"$",
"model",
",",
"$",
"model_name",
")",
"{",
"return",
"collect",
"(",
"$",
"input",
")",
"->",
"filter",
"(",
"function",
"(",
"$",
"value",
",",
"$",
"key",
")",
"use",
"(",
"$",
"mo... | This Checks for any values and the _token for csrf and removes it from any
blank values and it also removes the _token from the input. If there is
a password within the request it will compare it to the current hash.
@param $input
@param $model
@return Collection | [
"This",
"Checks",
"for",
"any",
"values",
"and",
"the",
"_token",
"for",
"csrf",
"and",
"removes",
"it",
"from",
"any",
"blank",
"values",
"and",
"it",
"also",
"removes",
"the",
"_token",
"from",
"the",
"input",
".",
"If",
"there",
"is",
"a",
"password",... | 6f5a98bd79a488f0f300f4851061ac6f7d19f8a3 | https://github.com/austinkregel/Warden/blob/6f5a98bd79a488f0f300f4851061ac6f7d19f8a3/src/Warden/Http/Controllers/ApiController.php#L248-L284 |
19,218 | Chill-project/Main | Routing/MenuComposer.php | MenuComposer.resolveOrder | private function resolveOrder($routes, $order){
if (isset($routes[$order])) {
return $this->resolveOrder($routes, $order + 1);
} else {
return $order;
}
} | php | private function resolveOrder($routes, $order){
if (isset($routes[$order])) {
return $this->resolveOrder($routes, $order + 1);
} else {
return $order;
}
} | [
"private",
"function",
"resolveOrder",
"(",
"$",
"routes",
",",
"$",
"order",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"routes",
"[",
"$",
"order",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"resolveOrder",
"(",
"$",
"routes",
",",
"$",
"order... | recursive function to resolve the order of a array of routes.
If the order chosen in routing.yml is already in used, find the
first next order available.
@param array $routes the routes previously added
@param int $order
@return int | [
"recursive",
"function",
"to",
"resolve",
"the",
"order",
"of",
"a",
"array",
"of",
"routes",
".",
"If",
"the",
"order",
"chosen",
"in",
"routing",
".",
"yml",
"is",
"already",
"in",
"used",
"find",
"the",
"first",
"next",
"order",
"available",
"."
] | 384cb6c793072a4f1047dc5cafc2157ee2419f60 | https://github.com/Chill-project/Main/blob/384cb6c793072a4f1047dc5cafc2157ee2419f60/Routing/MenuComposer.php#L95-L101 |
19,219 | ondrakoupil/tools | src/Arrays.php | Arrays.normaliseValues | static public function normaliseValues($array) {
$array=self::arrayize($array);
if (!$array) return $array;
$minValue=min($array);
$maxValue=max($array);
if ($maxValue==$minValue) {
$minValue-=1;
}
foreach($array as $index=>$value) {
$array[$index]=($value-$minValue)/($maxValue-$minValue);
}
ret... | php | static public function normaliseValues($array) {
$array=self::arrayize($array);
if (!$array) return $array;
$minValue=min($array);
$maxValue=max($array);
if ($maxValue==$minValue) {
$minValue-=1;
}
foreach($array as $index=>$value) {
$array[$index]=($value-$minValue)/($maxValue-$minValue);
}
ret... | [
"static",
"public",
"function",
"normaliseValues",
"(",
"$",
"array",
")",
"{",
"$",
"array",
"=",
"self",
"::",
"arrayize",
"(",
"$",
"array",
")",
";",
"if",
"(",
"!",
"$",
"array",
")",
"return",
"$",
"array",
";",
"$",
"minValue",
"=",
"min",
"... | Normalizuje hodnoty v poli do rozsahu <0-1>
@param array $array
@return array | [
"Normalizuje",
"hodnoty",
"v",
"poli",
"do",
"rozsahu",
"<",
";",
"0",
"-",
"1>",
";"
] | 7ecbe3652e379802fbaabf4fe8f27b96dcbadb22 | https://github.com/ondrakoupil/tools/blob/7ecbe3652e379802fbaabf4fe8f27b96dcbadb22/src/Arrays.php#L364-L376 |
19,220 | lode/fem | src/login_password.php | login_password.get_by_email | public static function get_by_email($email_address) {
$mysql = bootstrap::get_library('mysql');
$sql = "SELECT * FROM `login_passwords` WHERE `email_address` = '%s';";
$login = $mysql::select('row', $sql, $email_address);
if (empty($login)) {
return false;
}
return new static($login['id']);
} | php | public static function get_by_email($email_address) {
$mysql = bootstrap::get_library('mysql');
$sql = "SELECT * FROM `login_passwords` WHERE `email_address` = '%s';";
$login = $mysql::select('row', $sql, $email_address);
if (empty($login)) {
return false;
}
return new static($login['id']);
} | [
"public",
"static",
"function",
"get_by_email",
"(",
"$",
"email_address",
")",
"{",
"$",
"mysql",
"=",
"bootstrap",
"::",
"get_library",
"(",
"'mysql'",
")",
";",
"$",
"sql",
"=",
"\"SELECT * FROM `login_passwords` WHERE `email_address` = '%s';\"",
";",
"$",
"login... | checks whether the given email address match one on file
@param string $email_address
@return $this|boolean false when the email address is not found | [
"checks",
"whether",
"the",
"given",
"email",
"address",
"match",
"one",
"on",
"file"
] | c1c466c1a904d99452b341c5ae7cbc3e22b106e1 | https://github.com/lode/fem/blob/c1c466c1a904d99452b341c5ae7cbc3e22b106e1/src/login_password.php#L74-L84 |
19,221 | lode/fem | src/login_password.php | login_password.is_valid | public function is_valid($password, $check_rehash=true) {
if (password_verify($password, $this->data['hash']) == false) {
return false;
}
if ($check_rehash && password_needs_rehash($this->data['hash'], PASSWORD_DEFAULT)) {
$new_hash = self::hash_password($password);
$this->set_new_hash($this->data['user_id']... | php | public function is_valid($password, $check_rehash=true) {
if (password_verify($password, $this->data['hash']) == false) {
return false;
}
if ($check_rehash && password_needs_rehash($this->data['hash'], PASSWORD_DEFAULT)) {
$new_hash = self::hash_password($password);
$this->set_new_hash($this->data['user_id']... | [
"public",
"function",
"is_valid",
"(",
"$",
"password",
",",
"$",
"check_rehash",
"=",
"true",
")",
"{",
"if",
"(",
"password_verify",
"(",
"$",
"password",
",",
"$",
"this",
"->",
"data",
"[",
"'hash'",
"]",
")",
"==",
"false",
")",
"{",
"return",
"... | check if the password gives access to the login
also re-hashes the password hash if the algorithm is out of date
@param string $password in plain text
@param boolean $check_rehash set to false to skip re-hashing
@return boolean | [
"check",
"if",
"the",
"password",
"gives",
"access",
"to",
"the",
"login",
"also",
"re",
"-",
"hashes",
"the",
"password",
"hash",
"if",
"the",
"algorithm",
"is",
"out",
"of",
"date"
] | c1c466c1a904d99452b341c5ae7cbc3e22b106e1 | https://github.com/lode/fem/blob/c1c466c1a904d99452b341c5ae7cbc3e22b106e1/src/login_password.php#L94-L105 |
19,222 | lode/fem | src/login_password.php | login_password.add | public function add($user_id, $email_address, $password) {
$mysql = bootstrap::get_library('mysql');
$sql = "INSERT INTO `login_passwords` SET `user_id` = %d, `email_address` = '%s';";
$binds = [$user_id, $email_address];
$mysql::query($sql, $binds);
$login = new static($mysql::$insert_id);
$hash = self::... | php | public function add($user_id, $email_address, $password) {
$mysql = bootstrap::get_library('mysql');
$sql = "INSERT INTO `login_passwords` SET `user_id` = %d, `email_address` = '%s';";
$binds = [$user_id, $email_address];
$mysql::query($sql, $binds);
$login = new static($mysql::$insert_id);
$hash = self::... | [
"public",
"function",
"add",
"(",
"$",
"user_id",
",",
"$",
"email_address",
",",
"$",
"password",
")",
"{",
"$",
"mysql",
"=",
"bootstrap",
"::",
"get_library",
"(",
"'mysql'",
")",
";",
"$",
"sql",
"=",
"\"INSERT INTO `login_passwords` SET `user_id` = %d, `ema... | adds a login
@param int $user_id
@param string $email_address
@param string $password in plain text | [
"adds",
"a",
"login"
] | c1c466c1a904d99452b341c5ae7cbc3e22b106e1 | https://github.com/lode/fem/blob/c1c466c1a904d99452b341c5ae7cbc3e22b106e1/src/login_password.php#L123-L134 |
19,223 | lode/fem | src/login_password.php | login_password.set_new_hash | public function set_new_hash($new_hash) {
$mysql = bootstrap::get_library('mysql');
$sql = "UPDATE `login_passwords` SET `hash` = '%s' WHERE `id` = %d;";
$binds = [$new_hash, $this->data['id']];
$mysql::query($sql, $binds);
$this->data['hash'] = $new_hash;
} | php | public function set_new_hash($new_hash) {
$mysql = bootstrap::get_library('mysql');
$sql = "UPDATE `login_passwords` SET `hash` = '%s' WHERE `id` = %d;";
$binds = [$new_hash, $this->data['id']];
$mysql::query($sql, $binds);
$this->data['hash'] = $new_hash;
} | [
"public",
"function",
"set_new_hash",
"(",
"$",
"new_hash",
")",
"{",
"$",
"mysql",
"=",
"bootstrap",
"::",
"get_library",
"(",
"'mysql'",
")",
";",
"$",
"sql",
"=",
"\"UPDATE `login_passwords` SET `hash` = '%s' WHERE `id` = %d;\"",
";",
"$",
"binds",
"=",
"[",
... | stores a new hash for the current login
@param string $new_hash
@return void | [
"stores",
"a",
"new",
"hash",
"for",
"the",
"current",
"login"
] | c1c466c1a904d99452b341c5ae7cbc3e22b106e1 | https://github.com/lode/fem/blob/c1c466c1a904d99452b341c5ae7cbc3e22b106e1/src/login_password.php#L142-L150 |
19,224 | lode/fem | src/login_password.php | login_password.hash_password | public static function hash_password($password) {
$exception = bootstrap::get_library('exception');
if (mb_strlen($password) < self::MINIMUM_LENGTH) {
throw new $exception('passwords need a minimum length of '.self::MINIMUM_LENGTH);
}
$hash = password_hash($password, PASSWORD_DEFAULT);
if (empty($hash)) {
... | php | public static function hash_password($password) {
$exception = bootstrap::get_library('exception');
if (mb_strlen($password) < self::MINIMUM_LENGTH) {
throw new $exception('passwords need a minimum length of '.self::MINIMUM_LENGTH);
}
$hash = password_hash($password, PASSWORD_DEFAULT);
if (empty($hash)) {
... | [
"public",
"static",
"function",
"hash_password",
"(",
"$",
"password",
")",
"{",
"$",
"exception",
"=",
"bootstrap",
"::",
"get_library",
"(",
"'exception'",
")",
";",
"if",
"(",
"mb_strlen",
"(",
"$",
"password",
")",
"<",
"self",
"::",
"MINIMUM_LENGTH",
... | generates a new hash for the given password
we wrap the native method to ensure a successful hash
also enforces a minimum length for passwords
@see ::MINIMUM_LENGTH
@param string $password
@return string | [
"generates",
"a",
"new",
"hash",
"for",
"the",
"given",
"password",
"we",
"wrap",
"the",
"native",
"method",
"to",
"ensure",
"a",
"successful",
"hash"
] | c1c466c1a904d99452b341c5ae7cbc3e22b106e1 | https://github.com/lode/fem/blob/c1c466c1a904d99452b341c5ae7cbc3e22b106e1/src/login_password.php#L162-L175 |
19,225 | slashworks/control-bundle | src/Slashworks/BackendBundle/Controller/InstallController.php | InstallController.requirementsAction | public function requirementsAction()
{
// include symfony requirements class
$sAppPath = $this->getParameter('kernel.root_dir');
require_once $sAppPath.'/SymfonyRequirements.php';
$symfonyRequirements = new \SymfonyRequirements();
// add additional r... | php | public function requirementsAction()
{
// include symfony requirements class
$sAppPath = $this->getParameter('kernel.root_dir');
require_once $sAppPath.'/SymfonyRequirements.php';
$symfonyRequirements = new \SymfonyRequirements();
// add additional r... | [
"public",
"function",
"requirementsAction",
"(",
")",
"{",
"// include symfony requirements class",
"$",
"sAppPath",
"=",
"$",
"this",
"->",
"getParameter",
"(",
"'kernel.root_dir'",
")",
";",
"require_once",
"$",
"sAppPath",
".",
"'/SymfonyRequirements.php'",
";",
"$... | Check System Requirements
@return \Symfony\Component\HttpFoundation\Response | [
"Check",
"System",
"Requirements"
] | 2ba86d96f1f41f9424e2229c4e2b13017e973f89 | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Controller/InstallController.php#L43-L63 |
19,226 | slashworks/control-bundle | src/Slashworks/BackendBundle/Controller/InstallController.php | InstallController.installAction | public function installAction()
{
// create install form
$form = $this->createForm(new InstallType(), null, array('action' => $this->generateUrl('install_process')));
// redirect to login if config already filled
if ($this->container->getParameter('database_pass... | php | public function installAction()
{
// create install form
$form = $this->createForm(new InstallType(), null, array('action' => $this->generateUrl('install_process')));
// redirect to login if config already filled
if ($this->container->getParameter('database_pass... | [
"public",
"function",
"installAction",
"(",
")",
"{",
"// create install form",
"$",
"form",
"=",
"$",
"this",
"->",
"createForm",
"(",
"new",
"InstallType",
"(",
")",
",",
"null",
",",
"array",
"(",
"'action'",
"=>",
"$",
"this",
"->",
"generateUrl",
"(",... | Display install form
@return \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response | [
"Display",
"install",
"form"
] | 2ba86d96f1f41f9424e2229c4e2b13017e973f89 | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Controller/InstallController.php#L96-L108 |
19,227 | slashworks/control-bundle | src/Slashworks/BackendBundle/Controller/InstallController.php | InstallController.processInstallAction | public function processInstallAction(Request $request)
{
// include symfony requirements class
$sAppPath = $this->getParameter('kernel.root_dir');
require_once $sAppPath.'/SymfonyRequirements.php';
// prevent from being called directly after install...
... | php | public function processInstallAction(Request $request)
{
// include symfony requirements class
$sAppPath = $this->getParameter('kernel.root_dir');
require_once $sAppPath.'/SymfonyRequirements.php';
// prevent from being called directly after install...
... | [
"public",
"function",
"processInstallAction",
"(",
"Request",
"$",
"request",
")",
"{",
"// include symfony requirements class",
"$",
"sAppPath",
"=",
"$",
"this",
"->",
"getParameter",
"(",
"'kernel.root_dir'",
")",
";",
"require_once",
"$",
"sAppPath",
".",
"'/Sym... | Process provided informations and perform installation
@param \Symfony\Component\HttpFoundation\Request $request
@return \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response | [
"Process",
"provided",
"informations",
"and",
"perform",
"installation"
] | 2ba86d96f1f41f9424e2229c4e2b13017e973f89 | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Controller/InstallController.php#L118-L150 |
19,228 | joomlatools/joomlatools-platform-legacy | code/request/request.php | JRequest.getVar | public static function getVar($name, $default = null, $hash = 'default', $type = 'none', $mask = 0)
{
// Ensure hash and type are uppercase
$hash = strtoupper($hash);
if ($hash === 'METHOD')
{
$hash = strtoupper($_SERVER['REQUEST_METHOD']);
}
$type = strtoupper($type);
$sig = $hash . $type . $mask;
... | php | public static function getVar($name, $default = null, $hash = 'default', $type = 'none', $mask = 0)
{
// Ensure hash and type are uppercase
$hash = strtoupper($hash);
if ($hash === 'METHOD')
{
$hash = strtoupper($_SERVER['REQUEST_METHOD']);
}
$type = strtoupper($type);
$sig = $hash . $type . $mask;
... | [
"public",
"static",
"function",
"getVar",
"(",
"$",
"name",
",",
"$",
"default",
"=",
"null",
",",
"$",
"hash",
"=",
"'default'",
",",
"$",
"type",
"=",
"'none'",
",",
"$",
"mask",
"=",
"0",
")",
"{",
"// Ensure hash and type are uppercase",
"$",
"hash",... | Fetches and returns a given variable.
The default behaviour is fetching variables depending on the
current request method: GET and HEAD will result in returning
an entry from $_GET, POST and PUT will result in returning an
entry from $_POST.
You can force the source by setting the $hash parameter:
post $_POST
get... | [
"Fetches",
"and",
"returns",
"a",
"given",
"variable",
"."
] | 3a76944e2f2c415faa6504754c75321a3b478c06 | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/request/request.php#L101-L172 |
19,229 | joomlatools/joomlatools-platform-legacy | code/request/request.php | JRequest.get | public static function get($hash = 'default', $mask = 0)
{
$hash = strtoupper($hash);
if ($hash === 'METHOD')
{
$hash = strtoupper($_SERVER['REQUEST_METHOD']);
}
switch ($hash)
{
case 'GET':
$input = $_GET;
break;
case 'POST':
$input = $_POST;
break;
case 'FILES':
$input... | php | public static function get($hash = 'default', $mask = 0)
{
$hash = strtoupper($hash);
if ($hash === 'METHOD')
{
$hash = strtoupper($_SERVER['REQUEST_METHOD']);
}
switch ($hash)
{
case 'GET':
$input = $_GET;
break;
case 'POST':
$input = $_POST;
break;
case 'FILES':
$input... | [
"public",
"static",
"function",
"get",
"(",
"$",
"hash",
"=",
"'default'",
",",
"$",
"mask",
"=",
"0",
")",
"{",
"$",
"hash",
"=",
"strtoupper",
"(",
"$",
"hash",
")",
";",
"if",
"(",
"$",
"hash",
"===",
"'METHOD'",
")",
"{",
"$",
"hash",
"=",
... | Fetches and returns a request array.
The default behaviour is fetching variables depending on the
current request method: GET and HEAD will result in returning
$_GET, POST and PUT will result in returning $_POST.
You can force the source by setting the $hash parameter:
post $_POST
get $_GET
files $_FILES... | [
"Fetches",
"and",
"returns",
"a",
"request",
"array",
"."
] | 3a76944e2f2c415faa6504754c75321a3b478c06 | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/request/request.php#L423-L466 |
19,230 | joomlatools/joomlatools-platform-legacy | code/request/request.php | JRequest.set | public static function set($array, $hash = 'default', $overwrite = true)
{
foreach ($array as $key => $value)
{
self::setVar($key, $value, $hash, $overwrite);
}
} | php | public static function set($array, $hash = 'default', $overwrite = true)
{
foreach ($array as $key => $value)
{
self::setVar($key, $value, $hash, $overwrite);
}
} | [
"public",
"static",
"function",
"set",
"(",
"$",
"array",
",",
"$",
"hash",
"=",
"'default'",
",",
"$",
"overwrite",
"=",
"true",
")",
"{",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"self",
"::",
"setVar",
"(",
... | Sets a request variable.
@param array $array An associative array of key-value pairs.
@param string $hash The request variable to set (POST, GET, FILES, METHOD).
@param boolean $overwrite If true and an existing key is found, the value is overwritten, otherwise it is ignored.
@return void
@d... | [
"Sets",
"a",
"request",
"variable",
"."
] | 3a76944e2f2c415faa6504754c75321a3b478c06 | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/request/request.php#L481-L487 |
19,231 | joomlatools/joomlatools-platform-legacy | code/request/request.php | JRequest._cleanVar | protected static function _cleanVar($var, $mask = 0, $type = null)
{
// If the no trim flag is not set, trim the variable
if (!($mask & 1) && is_string($var))
{
$var = trim($var);
}
// Now we handle input filtering
if ($mask & 2)
{
// If the allow raw flag is set, do not modify the variable
$va... | php | protected static function _cleanVar($var, $mask = 0, $type = null)
{
// If the no trim flag is not set, trim the variable
if (!($mask & 1) && is_string($var))
{
$var = trim($var);
}
// Now we handle input filtering
if ($mask & 2)
{
// If the allow raw flag is set, do not modify the variable
$va... | [
"protected",
"static",
"function",
"_cleanVar",
"(",
"$",
"var",
",",
"$",
"mask",
"=",
"0",
",",
"$",
"type",
"=",
"null",
")",
"{",
"// If the no trim flag is not set, trim the variable",
"if",
"(",
"!",
"(",
"$",
"mask",
"&",
"1",
")",
"&&",
"is_string"... | Clean up an input variable.
@param mixed $var The input variable.
@param integer $mask Filter bit mask.
1 = no trim: If this flag is cleared and the input is a string, the string will have leading and trailing
whitespace trimmed.
2 = allow_raw: If set, no more filtering is performed, higher bits are ignored... | [
"Clean",
"up",
"an",
"input",
"variable",
"."
] | 3a76944e2f2c415faa6504754c75321a3b478c06 | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/request/request.php#L528-L557 |
19,232 | webforge-labs/psc-cms | lib/Psc/UI/Component/SingleImage.php | SingleImage.dpi | public function dpi(EntityMeta $entityMeta, DCPackage $dc) {
$this->entityMeta = $entityMeta;
$this->dc = $dc;
return $this;
} | php | public function dpi(EntityMeta $entityMeta, DCPackage $dc) {
$this->entityMeta = $entityMeta;
$this->dc = $dc;
return $this;
} | [
"public",
"function",
"dpi",
"(",
"EntityMeta",
"$",
"entityMeta",
",",
"DCPackage",
"$",
"dc",
")",
"{",
"$",
"this",
"->",
"entityMeta",
"=",
"$",
"entityMeta",
";",
"$",
"this",
"->",
"dc",
"=",
"$",
"dc",
";",
"return",
"$",
"this",
";",
"}"
] | EntityMeta der Bild-Klasse | [
"EntityMeta",
"der",
"Bild",
"-",
"Klasse"
] | 467bfa2547e6b4fa487d2d7f35fa6cc618dbc763 | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/UI/Component/SingleImage.php#L33-L37 |
19,233 | netgen/ngopengraph | autoloads/opengraphoperator.php | OpenGraphOperator.modify | function modify( &$tpl, &$operatorName, &$operatorParameters, &$rootNamespace,
&$currentNamespace, &$operatorValue, &$namedParameters )
{
switch ( $operatorName )
{
case 'opengraph':
{
$operatorValue = $this->generateOpenGraphTags( $namedPar... | php | function modify( &$tpl, &$operatorName, &$operatorParameters, &$rootNamespace,
&$currentNamespace, &$operatorValue, &$namedParameters )
{
switch ( $operatorName )
{
case 'opengraph':
{
$operatorValue = $this->generateOpenGraphTags( $namedPar... | [
"function",
"modify",
"(",
"&",
"$",
"tpl",
",",
"&",
"$",
"operatorName",
",",
"&",
"$",
"operatorParameters",
",",
"&",
"$",
"rootNamespace",
",",
"&",
"$",
"currentNamespace",
",",
"&",
"$",
"operatorValue",
",",
"&",
"$",
"namedParameters",
")",
"{",... | Executes the operators
@param eZTemplate $tpl
@param string $operatorName
@param array $operatorParameters
@param string $rootNamespace
@param string $currentNamespace
@param mixed $operatorValue
@param array $namedParameters | [
"Executes",
"the",
"operators"
] | 68a99862f240ee74174ea9b888a9a33743142e27 | https://github.com/netgen/ngopengraph/blob/68a99862f240ee74174ea9b888a9a33743142e27/autoloads/opengraphoperator.php#L78-L94 |
19,234 | netgen/ngopengraph | autoloads/opengraphoperator.php | OpenGraphOperator.generateOpenGraphTags | function generateOpenGraphTags( $nodeID )
{
$this->ogIni = eZINI::instance( 'ngopengraph.ini' );
$this->facebookCompatible = $this->ogIni->variable( 'General', 'FacebookCompatible' );
$this->debug = $this->ogIni->variable( 'General', 'Debug' ) == 'enabled';
$availableClasses = $this... | php | function generateOpenGraphTags( $nodeID )
{
$this->ogIni = eZINI::instance( 'ngopengraph.ini' );
$this->facebookCompatible = $this->ogIni->variable( 'General', 'FacebookCompatible' );
$this->debug = $this->ogIni->variable( 'General', 'Debug' ) == 'enabled';
$availableClasses = $this... | [
"function",
"generateOpenGraphTags",
"(",
"$",
"nodeID",
")",
"{",
"$",
"this",
"->",
"ogIni",
"=",
"eZINI",
"::",
"instance",
"(",
"'ngopengraph.ini'",
")",
";",
"$",
"this",
"->",
"facebookCompatible",
"=",
"$",
"this",
"->",
"ogIni",
"->",
"variable",
"... | Executes opengraph operator
@param int|eZContentObjectTreeNode $nodeID
@return array | [
"Executes",
"opengraph",
"operator"
] | 68a99862f240ee74174ea9b888a9a33743142e27 | https://github.com/netgen/ngopengraph/blob/68a99862f240ee74174ea9b888a9a33743142e27/autoloads/opengraphoperator.php#L103-L148 |
19,235 | netgen/ngopengraph | autoloads/opengraphoperator.php | OpenGraphOperator.processGenericData | function processGenericData( $contentNode )
{
$returnArray = array();
$siteName = trim( eZINI::instance()->variable( 'SiteSettings', 'SiteName' ) );
if ( !empty( $siteName ) )
{
$returnArray['og:site_name'] = $siteName;
}
$urlAlias = $contentNode->urlAli... | php | function processGenericData( $contentNode )
{
$returnArray = array();
$siteName = trim( eZINI::instance()->variable( 'SiteSettings', 'SiteName' ) );
if ( !empty( $siteName ) )
{
$returnArray['og:site_name'] = $siteName;
}
$urlAlias = $contentNode->urlAli... | [
"function",
"processGenericData",
"(",
"$",
"contentNode",
")",
"{",
"$",
"returnArray",
"=",
"array",
"(",
")",
";",
"$",
"siteName",
"=",
"trim",
"(",
"eZINI",
"::",
"instance",
"(",
")",
"->",
"variable",
"(",
"'SiteSettings'",
",",
"'SiteName'",
")",
... | Processes literal Open Graph metadata
@param eZContentObjectTreeNode $contentNode
@return array | [
"Processes",
"literal",
"Open",
"Graph",
"metadata"
] | 68a99862f240ee74174ea9b888a9a33743142e27 | https://github.com/netgen/ngopengraph/blob/68a99862f240ee74174ea9b888a9a33743142e27/autoloads/opengraphoperator.php#L157-L201 |
19,236 | netgen/ngopengraph | autoloads/opengraphoperator.php | OpenGraphOperator.processObject | function processObject( $contentObject, $returnArray )
{
if ( $this->ogIni->hasVariable( $contentObject->contentClassIdentifier(), 'LiteralMap' ) )
{
$literalValues = $this->ogIni->variable( $contentObject->contentClassIdentifier(), 'LiteralMap' );
if ( $this->debug )
... | php | function processObject( $contentObject, $returnArray )
{
if ( $this->ogIni->hasVariable( $contentObject->contentClassIdentifier(), 'LiteralMap' ) )
{
$literalValues = $this->ogIni->variable( $contentObject->contentClassIdentifier(), 'LiteralMap' );
if ( $this->debug )
... | [
"function",
"processObject",
"(",
"$",
"contentObject",
",",
"$",
"returnArray",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"ogIni",
"->",
"hasVariable",
"(",
"$",
"contentObject",
"->",
"contentClassIdentifier",
"(",
")",
",",
"'LiteralMap'",
")",
")",
"{",
... | Processes Open Graph metadata from object attributes
@param eZContentObject $contentObject
@param array $returnArray
@return array | [
"Processes",
"Open",
"Graph",
"metadata",
"from",
"object",
"attributes"
] | 68a99862f240ee74174ea9b888a9a33743142e27 | https://github.com/netgen/ngopengraph/blob/68a99862f240ee74174ea9b888a9a33743142e27/autoloads/opengraphoperator.php#L211-L281 |
19,237 | netgen/ngopengraph | autoloads/opengraphoperator.php | OpenGraphOperator.checkRequirements | function checkRequirements( $returnArray )
{
$arrayKeys = array_keys( $returnArray );
if ( !in_array( 'og:title', $arrayKeys ) || !in_array( 'og:type', $arrayKeys ) ||
!in_array( 'og:image', $arrayKeys ) || !in_array( 'og:url', $arrayKeys ) )
{
if ( $this->debug )
... | php | function checkRequirements( $returnArray )
{
$arrayKeys = array_keys( $returnArray );
if ( !in_array( 'og:title', $arrayKeys ) || !in_array( 'og:type', $arrayKeys ) ||
!in_array( 'og:image', $arrayKeys ) || !in_array( 'og:url', $arrayKeys ) )
{
if ( $this->debug )
... | [
"function",
"checkRequirements",
"(",
"$",
"returnArray",
")",
"{",
"$",
"arrayKeys",
"=",
"array_keys",
"(",
"$",
"returnArray",
")",
";",
"if",
"(",
"!",
"in_array",
"(",
"'og:title'",
",",
"$",
"arrayKeys",
")",
"||",
"!",
"in_array",
"(",
"'og:type'",
... | Checks if all required Open Graph metadata are present
@param array $returnArray
@return bool | [
"Checks",
"if",
"all",
"required",
"Open",
"Graph",
"metadata",
"are",
"present"
] | 68a99862f240ee74174ea9b888a9a33743142e27 | https://github.com/netgen/ngopengraph/blob/68a99862f240ee74174ea9b888a9a33743142e27/autoloads/opengraphoperator.php#L290-L319 |
19,238 | dunkelfrosch/phpcoverfish | src/PHPCoverFish/Base/BaseScanner.php | BaseScanner.scanFilesInPath | public function scanFilesInPath($sourcePath)
{
$filePattern = $this->filePattern;
if (strpos($sourcePath, str_replace('*', null, $filePattern))) {
$filePattern = $this->coverFishHelper->getFileNameFromPath($sourcePath);
}
$facade = new FinderFacade(
array($so... | php | public function scanFilesInPath($sourcePath)
{
$filePattern = $this->filePattern;
if (strpos($sourcePath, str_replace('*', null, $filePattern))) {
$filePattern = $this->coverFishHelper->getFileNameFromPath($sourcePath);
}
$facade = new FinderFacade(
array($so... | [
"public",
"function",
"scanFilesInPath",
"(",
"$",
"sourcePath",
")",
"{",
"$",
"filePattern",
"=",
"$",
"this",
"->",
"filePattern",
";",
"if",
"(",
"strpos",
"(",
"$",
"sourcePath",
",",
"str_replace",
"(",
"'*'",
",",
"null",
",",
"$",
"filePattern",
... | scan all files by given path recursively, if one php file will be provided within given path,
this file will be returned in finder format
@param string $sourcePath
@return array | [
"scan",
"all",
"files",
"by",
"given",
"path",
"recursively",
"if",
"one",
"php",
"file",
"will",
"be",
"provided",
"within",
"given",
"path",
"this",
"file",
"will",
"be",
"returned",
"in",
"finder",
"format"
] | 779bd399ec8f4cadb3b7854200695c5eb3f5a8ad | https://github.com/dunkelfrosch/phpcoverfish/blob/779bd399ec8f4cadb3b7854200695c5eb3f5a8ad/src/PHPCoverFish/Base/BaseScanner.php#L397-L411 |
19,239 | jfusion/org.jfusion.framework | src/Factory.php | Factory.& | public static function &getAuth($instance)
{
static $instances;
if (!isset($instances)) {
$instances = array();
}
//only create a new authentication instance if it has not been created before
if (!isset($instances[$instance])) {
$name = static::getNameFromInstance($instance);
static::pluginAutoLoad... | php | public static function &getAuth($instance)
{
static $instances;
if (!isset($instances)) {
$instances = array();
}
//only create a new authentication instance if it has not been created before
if (!isset($instances[$instance])) {
$name = static::getNameFromInstance($instance);
static::pluginAutoLoad... | [
"public",
"static",
"function",
"&",
"getAuth",
"(",
"$",
"instance",
")",
"{",
"static",
"$",
"instances",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"instances",
")",
")",
"{",
"$",
"instances",
"=",
"array",
"(",
")",
";",
"}",
"//only create a new aut... | Gets an Authentication Class for the JFusion Plugin
@param string $instance name of the JFusion plugin used
@return Auth JFusion Authentication class for the JFusion plugin | [
"Gets",
"an",
"Authentication",
"Class",
"for",
"the",
"JFusion",
"Plugin"
] | 65771963f23ccabcf1f867eb17c9452299cfe683 | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Factory.php#L203-L222 |
19,240 | jfusion/org.jfusion.framework | src/Factory.php | Factory.& | public static function &getUser($instance)
{
static $instances;
if (!isset($instances)) {
$instances = array();
}
//only create a new user instance if it has not been created before
if (!isset($instances[$instance])) {
$name = static::getNameFromInstance($instance);
static::pluginAutoLoad($name);
... | php | public static function &getUser($instance)
{
static $instances;
if (!isset($instances)) {
$instances = array();
}
//only create a new user instance if it has not been created before
if (!isset($instances[$instance])) {
$name = static::getNameFromInstance($instance);
static::pluginAutoLoad($name);
... | [
"public",
"static",
"function",
"&",
"getUser",
"(",
"$",
"instance",
")",
"{",
"static",
"$",
"instances",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"instances",
")",
")",
"{",
"$",
"instances",
"=",
"array",
"(",
")",
";",
"}",
"//only create a new use... | Gets an User Class for the JFusion Plugin
@param string $instance name of the JFusion plugin used
@return User JFusion User class for the JFusion plugin | [
"Gets",
"an",
"User",
"Class",
"for",
"the",
"JFusion",
"Plugin"
] | 65771963f23ccabcf1f867eb17c9452299cfe683 | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Factory.php#L231-L250 |
19,241 | jfusion/org.jfusion.framework | src/Factory.php | Factory.& | public static function &getPlatform($platform, $instance)
{
static $instances;
if (!isset($instances)) {
$instances = array();
}
$platform = ucfirst(strtolower($platform));
//only create a new thread instance if it has not been created before
if (!isset($instances[$platform][$instance])) {
$name = ... | php | public static function &getPlatform($platform, $instance)
{
static $instances;
if (!isset($instances)) {
$instances = array();
}
$platform = ucfirst(strtolower($platform));
//only create a new thread instance if it has not been created before
if (!isset($instances[$platform][$instance])) {
$name = ... | [
"public",
"static",
"function",
"&",
"getPlatform",
"(",
"$",
"platform",
",",
"$",
"instance",
")",
"{",
"static",
"$",
"instances",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"instances",
")",
")",
"{",
"$",
"instances",
"=",
"array",
"(",
")",
";",
... | Gets a Forum Class for the JFusion Plugin
@param string $platform
@param string $instance name of the JFusion plugin used
@return Platform JFusion Thread class for the JFusion plugin | [
"Gets",
"a",
"Forum",
"Class",
"for",
"the",
"JFusion",
"Plugin"
] | 65771963f23ccabcf1f867eb17c9452299cfe683 | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Factory.php#L260-L285 |
19,242 | jfusion/org.jfusion.framework | src/Factory.php | Factory.& | public static function &getHelper($instance)
{
static $instances;
if (!isset($instances)) {
$instances = array();
}
//only create a new thread instance if it has not been created before
if (!isset($instances[$instance])) {
$name = static::getNameFromInstance($instance);
static::pluginAutoLoad($name... | php | public static function &getHelper($instance)
{
static $instances;
if (!isset($instances)) {
$instances = array();
}
//only create a new thread instance if it has not been created before
if (!isset($instances[$instance])) {
$name = static::getNameFromInstance($instance);
static::pluginAutoLoad($name... | [
"public",
"static",
"function",
"&",
"getHelper",
"(",
"$",
"instance",
")",
"{",
"static",
"$",
"instances",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"instances",
")",
")",
"{",
"$",
"instances",
"=",
"array",
"(",
")",
";",
"}",
"//only create a new t... | Gets a Helper Class for the JFusion Plugin which is only used internally by the plugin
@param string $instance name of the JFusion plugin used
@return Plugin|false JFusion Helper class for the JFusion plugin | [
"Gets",
"a",
"Helper",
"Class",
"for",
"the",
"JFusion",
"Plugin",
"which",
"is",
"only",
"used",
"internally",
"by",
"the",
"plugin"
] | 65771963f23ccabcf1f867eb17c9452299cfe683 | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Factory.php#L294-L314 |
19,243 | jfusion/org.jfusion.framework | src/Factory.php | Factory.& | public static function &getDatabase($jname)
{
static $instances;
if (!isset($instances)) {
$instances = array();
}
//only create a new database instance if it has not been created before
if (!isset($instances[$jname])) {
/**
* TODO: MUST BE CHANGED! as do not rely on joomla_int
*/
if ($jname... | php | public static function &getDatabase($jname)
{
static $instances;
if (!isset($instances)) {
$instances = array();
}
//only create a new database instance if it has not been created before
if (!isset($instances[$jname])) {
/**
* TODO: MUST BE CHANGED! as do not rely on joomla_int
*/
if ($jname... | [
"public",
"static",
"function",
"&",
"getDatabase",
"(",
"$",
"jname",
")",
"{",
"static",
"$",
"instances",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"instances",
")",
")",
"{",
"$",
"instances",
"=",
"array",
"(",
")",
";",
"}",
"//only create a new da... | Gets an Database Connection for the JFusion Plugin
@param string $jname name of the JFusion plugin used
@return DatabaseDriver Database connection for the JFusion plugin
@throws RuntimeException | [
"Gets",
"an",
"Database",
"Connection",
"for",
"the",
"JFusion",
"Plugin"
] | 65771963f23ccabcf1f867eb17c9452299cfe683 | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Factory.php#L338-L380 |
19,244 | jfusion/org.jfusion.framework | src/Factory.php | Factory.& | public static function &getParams($jname, $reset = false)
{
static $instances;
if (!isset($instances)) {
$instances = array();
}
try {
//only create a new parameter instance if it has not been created before
if (!isset($instances[$jname]) || $reset) {
$db = self::getDBO();
$query = $db->getQ... | php | public static function &getParams($jname, $reset = false)
{
static $instances;
if (!isset($instances)) {
$instances = array();
}
try {
//only create a new parameter instance if it has not been created before
if (!isset($instances[$jname]) || $reset) {
$db = self::getDBO();
$query = $db->getQ... | [
"public",
"static",
"function",
"&",
"getParams",
"(",
"$",
"jname",
",",
"$",
"reset",
"=",
"false",
")",
"{",
"static",
"$",
"instances",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"instances",
")",
")",
"{",
"$",
"instances",
"=",
"array",
"(",
")"... | Gets an Parameter Object for the JFusion Plugin
@param string $jname name of the JFusion plugin used
@param boolean $reset switch to force a recreate of the instance
@return Registry JParam object for the JFusion plugin | [
"Gets",
"an",
"Parameter",
"Object",
"for",
"the",
"JFusion",
"Plugin"
] | 65771963f23ccabcf1f867eb17c9452299cfe683 | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Factory.php#L390-L415 |
19,245 | jfusion/org.jfusion.framework | src/Factory.php | Factory.getPlugins | public static function getPlugins($criteria = 'both', $exclude = false, $status = 2)
{
static $instances;
if (!isset($instances)) {
$instances = array();
}
$db = self::getDBO();
$query = $db->getQuery(true)
->select('*')
->from('#__jfusion');
$key = $criteria . '_' . $exclude . '_' . $status;
... | php | public static function getPlugins($criteria = 'both', $exclude = false, $status = 2)
{
static $instances;
if (!isset($instances)) {
$instances = array();
}
$db = self::getDBO();
$query = $db->getQuery(true)
->select('*')
->from('#__jfusion');
$key = $criteria . '_' . $exclude . '_' . $status;
... | [
"public",
"static",
"function",
"getPlugins",
"(",
"$",
"criteria",
"=",
"'both'",
",",
"$",
"exclude",
"=",
"false",
",",
"$",
"status",
"=",
"2",
")",
"{",
"static",
"$",
"instances",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"instances",
")",
")",
... | returns array of plugins depending on the arguments
@param string $criteria the type of plugins to retrieve Use: master | slave | both
@param string|boolean $exclude should we exclude joomla_int
@param int $status only plugins with status equal or higher.
@return array|stdClass plugin details | [
"returns",
"array",
"of",
"plugins",
"depending",
"on",
"the",
"arguments"
] | 65771963f23ccabcf1f867eb17c9452299cfe683 | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Factory.php#L426-L466 |
19,246 | jfusion/org.jfusion.framework | src/Factory.php | Factory.getPluginNodeId | public static function getPluginNodeId($jname) {
$params = static::getParams($jname);
$source_url = $params->get('source_url');
return strtolower(rtrim(parse_url($source_url, PHP_URL_HOST) . parse_url($source_url, PHP_URL_PATH), '/'));
} | php | public static function getPluginNodeId($jname) {
$params = static::getParams($jname);
$source_url = $params->get('source_url');
return strtolower(rtrim(parse_url($source_url, PHP_URL_HOST) . parse_url($source_url, PHP_URL_PATH), '/'));
} | [
"public",
"static",
"function",
"getPluginNodeId",
"(",
"$",
"jname",
")",
"{",
"$",
"params",
"=",
"static",
"::",
"getParams",
"(",
"$",
"jname",
")",
";",
"$",
"source_url",
"=",
"$",
"params",
"->",
"get",
"(",
"'source_url'",
")",
";",
"return",
"... | Gets the jnode_id for the JFusion Plugin
@param string $jname name of the JFusion plugin used
@return string jnodeid for the JFusion Plugin | [
"Gets",
"the",
"jnode_id",
"for",
"the",
"JFusion",
"Plugin"
] | 65771963f23ccabcf1f867eb17c9452299cfe683 | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Factory.php#L473-L477 |
19,247 | jfusion/org.jfusion.framework | src/Factory.php | Factory.& | public static function &getCookies() {
static $instance;
//only create a new plugin instance if it has not been created before
if (!isset($instance)) {
$instance = new Cookies(Config::get()->get('apikey'));
}
return $instance;
} | php | public static function &getCookies() {
static $instance;
//only create a new plugin instance if it has not been created before
if (!isset($instance)) {
$instance = new Cookies(Config::get()->get('apikey'));
}
return $instance;
} | [
"public",
"static",
"function",
"&",
"getCookies",
"(",
")",
"{",
"static",
"$",
"instance",
";",
"//only create a new plugin instance if it has not been created before",
"if",
"(",
"!",
"isset",
"(",
"$",
"instance",
")",
")",
"{",
"$",
"instance",
"=",
"new",
... | Gets an JFusion cross domain cookie object
@return Cookies object for the JFusion cookies | [
"Gets",
"an",
"JFusion",
"cross",
"domain",
"cookie",
"object"
] | 65771963f23ccabcf1f867eb17c9452299cfe683 | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Factory.php#L503-L510 |
19,248 | jfusion/org.jfusion.framework | src/Factory.php | Factory.getDbo | public static function getDbo()
{
if (!self::$database)
{
//get config values
$host = Config::get()->get('database.host');
$user = Config::get()->get('database.user');
$password = Config::get()->get('database.password');
$database = Config::get()->get('database.name');
$prefix = Config::get()->g... | php | public static function getDbo()
{
if (!self::$database)
{
//get config values
$host = Config::get()->get('database.host');
$user = Config::get()->get('database.user');
$password = Config::get()->get('database.password');
$database = Config::get()->get('database.name');
$prefix = Config::get()->g... | [
"public",
"static",
"function",
"getDbo",
"(",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"$",
"database",
")",
"{",
"//get config values",
"$",
"host",
"=",
"Config",
"::",
"get",
"(",
")",
"->",
"get",
"(",
"'database.host'",
")",
";",
"$",
"user",
"=... | Get a database object.
Returns the global {@link Driver} object, only creating it if it doesn't already exist.
@return DatabaseDriver | [
"Get",
"a",
"database",
"object",
"."
] | 65771963f23ccabcf1f867eb17c9452299cfe683 | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Factory.php#L519-L543 |
19,249 | jfusion/org.jfusion.framework | src/Factory.php | Factory.getLanguage | public static function getLanguage()
{
if (!self::$language)
{
$locale = Config::get()->get('language.language');
$debug = Config::get()->get('language.debug');
self::$language = Language::getInstance($locale, $debug);
Text::setLanguage(self::$language);
}
return self::$language;
} | php | public static function getLanguage()
{
if (!self::$language)
{
$locale = Config::get()->get('language.language');
$debug = Config::get()->get('language.debug');
self::$language = Language::getInstance($locale, $debug);
Text::setLanguage(self::$language);
}
return self::$language;
} | [
"public",
"static",
"function",
"getLanguage",
"(",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"$",
"language",
")",
"{",
"$",
"locale",
"=",
"Config",
"::",
"get",
"(",
")",
"->",
"get",
"(",
"'language.language'",
")",
";",
"$",
"debug",
"=",
"Config"... | Get a language object.
Returns the global {@link JLanguage} object, only creating it if it doesn't already exist.
@return Language object
@see Language
@since 11.1 | [
"Get",
"a",
"language",
"object",
"."
] | 65771963f23ccabcf1f867eb17c9452299cfe683 | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Factory.php#L555-L566 |
19,250 | ClanCats/Core | src/classes/CCRouter.php | CCRouter._init | public static function _init()
{
// default string
static::filter( 'any', '[a-zA-Z0-9'.ClanCats::$config->get( 'router.allowed_special_chars' ).']' );
// only numbers
static::filter( 'num', '[0-9]' );
// only alpha characters
static::filter( 'alpha', '[a-zA-Z]' );
// only alphanumeric characte... | php | public static function _init()
{
// default string
static::filter( 'any', '[a-zA-Z0-9'.ClanCats::$config->get( 'router.allowed_special_chars' ).']' );
// only numbers
static::filter( 'num', '[0-9]' );
// only alpha characters
static::filter( 'alpha', '[a-zA-Z]' );
// only alphanumeric characte... | [
"public",
"static",
"function",
"_init",
"(",
")",
"{",
"// default string",
"static",
"::",
"filter",
"(",
"'any'",
",",
"'[a-zA-Z0-9'",
".",
"ClanCats",
"::",
"$",
"config",
"->",
"get",
"(",
"'router.allowed_special_chars'",
")",
".",
"']'",
")",
";",
"//... | Set up the basic uri filters in our static init and
also add a default 404 response
@return void | [
"Set",
"up",
"the",
"basic",
"uri",
"filters",
"in",
"our",
"static",
"init",
"and",
"also",
"add",
"a",
"default",
"404",
"response"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCRouter.php#L64-L83 |
19,251 | ClanCats/Core | src/classes/CCRouter.php | CCRouter.alias | public static function alias( $key, $to = null )
{
if ( is_null( $to ) || is_array( $to ) )
{
if ( array_key_exists( $key, static::$aliases ) )
{
if ( is_array( $to ) )
{
// Workaround for HHVM: return preg_replace( "/\[\w+\]/e", 'array_shift($to)', static::$aliases[$key] );
$return = sta... | php | public static function alias( $key, $to = null )
{
if ( is_null( $to ) || is_array( $to ) )
{
if ( array_key_exists( $key, static::$aliases ) )
{
if ( is_array( $to ) )
{
// Workaround for HHVM: return preg_replace( "/\[\w+\]/e", 'array_shift($to)', static::$aliases[$key] );
$return = sta... | [
"public",
"static",
"function",
"alias",
"(",
"$",
"key",
",",
"$",
"to",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"to",
")",
"||",
"is_array",
"(",
"$",
"to",
")",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"key",
",",
"s... | Creates an alias to a route or gets one
@param string $key
@param string $to
@return void | false | [
"Creates",
"an",
"alias",
"to",
"a",
"route",
"or",
"gets",
"one"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCRouter.php#L92-L115 |
19,252 | ClanCats/Core | src/classes/CCRouter.php | CCRouter.events_matching | public static function events_matching( $event, $rule )
{
if ( !array_key_exists( $event, static::$events ) )
{
return array();
}
$callbacks = array();
foreach( static::$events[$event] as $route => $events )
{
$rgx = "~^".str_replace( '*', '(.*)', $route )."$~";
if ( preg_match( $rgx, $rule ... | php | public static function events_matching( $event, $rule )
{
if ( !array_key_exists( $event, static::$events ) )
{
return array();
}
$callbacks = array();
foreach( static::$events[$event] as $route => $events )
{
$rgx = "~^".str_replace( '*', '(.*)', $route )."$~";
if ( preg_match( $rgx, $rule ... | [
"public",
"static",
"function",
"events_matching",
"(",
"$",
"event",
",",
"$",
"rule",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"event",
",",
"static",
"::",
"$",
"events",
")",
")",
"{",
"return",
"array",
"(",
")",
";",
"}",
"$",
... | Get all events matching a rule
@param string $event
@param string $route
@param mixed $callback
@return void | [
"Get",
"all",
"events",
"matching",
"a",
"rule"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCRouter.php#L138-L157 |
19,253 | ClanCats/Core | src/classes/CCRouter.php | CCRouter.prepare | protected static function prepare( $routes )
{
// flatten if needed
if ( ClanCats::$config->get( 'router.flatten_routes' ) )
{
$routes = static::flatten( $routes );
}
foreach( $routes as $uri => $route )
{
// check for an alias to a private
if ( is_string( $route ) )
{
if ( substr... | php | protected static function prepare( $routes )
{
// flatten if needed
if ( ClanCats::$config->get( 'router.flatten_routes' ) )
{
$routes = static::flatten( $routes );
}
foreach( $routes as $uri => $route )
{
// check for an alias to a private
if ( is_string( $route ) )
{
if ( substr... | [
"protected",
"static",
"function",
"prepare",
"(",
"$",
"routes",
")",
"{",
"// flatten if needed",
"if",
"(",
"ClanCats",
"::",
"$",
"config",
"->",
"get",
"(",
"'router.flatten_routes'",
")",
")",
"{",
"$",
"routes",
"=",
"static",
"::",
"flatten",
"(",
... | Prepare the routes assing them to their containers
@param array $routes
@return void | [
"Prepare",
"the",
"routes",
"assing",
"them",
"to",
"their",
"containers"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCRouter.php#L217-L263 |
19,254 | ClanCats/Core | src/classes/CCRouter.php | CCRouter.flatten | protected static function flatten( $routes, $param_prefix = '' )
{
$flattened = array();
foreach( $routes as $prefix => $route )
{
if ( is_array( $route ) && !is_callable( $route ) )
{
$flattened = array_merge( static::flatten( $route, $param_prefix.$prefix.'/' ), $flattened );
}
else
... | php | protected static function flatten( $routes, $param_prefix = '' )
{
$flattened = array();
foreach( $routes as $prefix => $route )
{
if ( is_array( $route ) && !is_callable( $route ) )
{
$flattened = array_merge( static::flatten( $route, $param_prefix.$prefix.'/' ), $flattened );
}
else
... | [
"protected",
"static",
"function",
"flatten",
"(",
"$",
"routes",
",",
"$",
"param_prefix",
"=",
"''",
")",
"{",
"$",
"flattened",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"routes",
"as",
"$",
"prefix",
"=>",
"$",
"route",
")",
"{",
"if",
... | Flatten the routes
@param array $routes
@param string $param_prefix
@return array | [
"Flatten",
"the",
"routes"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCRouter.php#L284-L311 |
19,255 | ClanCats/Core | src/classes/CCRouter.php | CCRouter.configure | protected static function configure( $route, $raw_route )
{
// deal with emptiness
if ( is_null( $raw_route ) )
{
return false;
}
// this might be a controller
if ( is_string( $raw_route ) )
{
// are there overwrite parameters?
if ( strpos( $raw_route, '?' ) !== false )
{
$route->pa... | php | protected static function configure( $route, $raw_route )
{
// deal with emptiness
if ( is_null( $raw_route ) )
{
return false;
}
// this might be a controller
if ( is_string( $raw_route ) )
{
// are there overwrite parameters?
if ( strpos( $raw_route, '?' ) !== false )
{
$route->pa... | [
"protected",
"static",
"function",
"configure",
"(",
"$",
"route",
",",
"$",
"raw_route",
")",
"{",
"// deal with emptiness",
"if",
"(",
"is_null",
"(",
"$",
"raw_route",
")",
")",
"{",
"return",
"false",
";",
"}",
"// this might be a controller",
"if",
"(",
... | Check and complete a route
@param CCRoute $route
@param mixed $raw_route
@return false|CCRoute | [
"Check",
"and",
"complete",
"a",
"route"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCRouter.php#L452-L489 |
19,256 | webtown-php/KunstmaanExtensionBundle | src/Command/UserEditCommand.php | UserEditCommand.selectionHandler | protected function selectionHandler()
{
$userCount = count($this->choices);
if ($userCount > static::MAX_USER_CHOICES) {
$this->autocomplete();
} elseif ($userCount > 1) {
$this->selector();
} elseif (1 === $userCount) {
$this->editor($this->choice... | php | protected function selectionHandler()
{
$userCount = count($this->choices);
if ($userCount > static::MAX_USER_CHOICES) {
$this->autocomplete();
} elseif ($userCount > 1) {
$this->selector();
} elseif (1 === $userCount) {
$this->editor($this->choice... | [
"protected",
"function",
"selectionHandler",
"(",
")",
"{",
"$",
"userCount",
"=",
"count",
"(",
"$",
"this",
"->",
"choices",
")",
";",
"if",
"(",
"$",
"userCount",
">",
"static",
"::",
"MAX_USER_CHOICES",
")",
"{",
"$",
"this",
"->",
"autocomplete",
"(... | Handle user selection depending on options and user count in db | [
"Handle",
"user",
"selection",
"depending",
"on",
"options",
"and",
"user",
"count",
"in",
"db"
] | 86c656c131295fe1f3f7694fd4da1e5e454076b9 | https://github.com/webtown-php/KunstmaanExtensionBundle/blob/86c656c131295fe1f3f7694fd4da1e5e454076b9/src/Command/UserEditCommand.php#L84-L94 |
19,257 | webtown-php/KunstmaanExtensionBundle | src/Command/UserEditCommand.php | UserEditCommand.selector | protected function selector(&$choices = null)
{
$choices = $choices ? $choices : $this->choices;
$choices = $this->userEditor->getChoicesAsEmailUsername($choices);
$question = new ChoiceQuestion(static::PLEASE_SELECT_A_USER, $choices);
$selectedUser = $this->ask($question);
$... | php | protected function selector(&$choices = null)
{
$choices = $choices ? $choices : $this->choices;
$choices = $this->userEditor->getChoicesAsEmailUsername($choices);
$question = new ChoiceQuestion(static::PLEASE_SELECT_A_USER, $choices);
$selectedUser = $this->ask($question);
$... | [
"protected",
"function",
"selector",
"(",
"&",
"$",
"choices",
"=",
"null",
")",
"{",
"$",
"choices",
"=",
"$",
"choices",
"?",
"$",
"choices",
":",
"$",
"this",
"->",
"choices",
";",
"$",
"choices",
"=",
"$",
"this",
"->",
"userEditor",
"->",
"getCh... | Multiple choices user select
@param User[] $choices | [
"Multiple",
"choices",
"user",
"select"
] | 86c656c131295fe1f3f7694fd4da1e5e454076b9 | https://github.com/webtown-php/KunstmaanExtensionBundle/blob/86c656c131295fe1f3f7694fd4da1e5e454076b9/src/Command/UserEditCommand.php#L101-L111 |
19,258 | webtown-php/KunstmaanExtensionBundle | src/Command/UserEditCommand.php | UserEditCommand.autocomplete | protected function autocomplete()
{
$question = new Question(static::PLEASE_SELECT_A_USER);
$question->setAutocompleterValues($this->userEditor->getChoicesAsSeparateEmailUsername($this->choices));
$selectedUser = $this->ask($question);
// nem választott usert, vége
if ('' ===... | php | protected function autocomplete()
{
$question = new Question(static::PLEASE_SELECT_A_USER);
$question->setAutocompleterValues($this->userEditor->getChoicesAsSeparateEmailUsername($this->choices));
$selectedUser = $this->ask($question);
// nem választott usert, vége
if ('' ===... | [
"protected",
"function",
"autocomplete",
"(",
")",
"{",
"$",
"question",
"=",
"new",
"Question",
"(",
"static",
"::",
"PLEASE_SELECT_A_USER",
")",
";",
"$",
"question",
"->",
"setAutocompleterValues",
"(",
"$",
"this",
"->",
"userEditor",
"->",
"getChoicesAsSepa... | Autocomplete user select | [
"Autocomplete",
"user",
"select"
] | 86c656c131295fe1f3f7694fd4da1e5e454076b9 | https://github.com/webtown-php/KunstmaanExtensionBundle/blob/86c656c131295fe1f3f7694fd4da1e5e454076b9/src/Command/UserEditCommand.php#L116-L134 |
19,259 | webtown-php/KunstmaanExtensionBundle | src/Command/UserEditCommand.php | UserEditCommand.editor | protected function editor(User $user)
{
// store props
$oldProps = new UserUpdater($user);
$newProps = $this->getNewValues($user);
// confirm
$ln = <<<EOL
Summary
-------
Username: "{$newProps->getUsername()}"
Email: "{$newProps->getEmail()}"
Password: "{$newProps->getPas... | php | protected function editor(User $user)
{
// store props
$oldProps = new UserUpdater($user);
$newProps = $this->getNewValues($user);
// confirm
$ln = <<<EOL
Summary
-------
Username: "{$newProps->getUsername()}"
Email: "{$newProps->getEmail()}"
Password: "{$newProps->getPas... | [
"protected",
"function",
"editor",
"(",
"User",
"$",
"user",
")",
"{",
"// store props",
"$",
"oldProps",
"=",
"new",
"UserUpdater",
"(",
"$",
"user",
")",
";",
"$",
"newProps",
"=",
"$",
"this",
"->",
"getNewValues",
"(",
"$",
"user",
")",
";",
"// co... | Show user editor
@param User $user | [
"Show",
"user",
"editor"
] | 86c656c131295fe1f3f7694fd4da1e5e454076b9 | https://github.com/webtown-php/KunstmaanExtensionBundle/blob/86c656c131295fe1f3f7694fd4da1e5e454076b9/src/Command/UserEditCommand.php#L141-L181 |
19,260 | webtown-php/KunstmaanExtensionBundle | src/Command/UserEditCommand.php | UserEditCommand.sendNotification | protected function sendNotification($to, array $changedValues)
{
$message = \Swift_Message::newInstance()
->setSubject('User details updated')
->setFrom($this->getContainer()->getParameter('fos_user.resetting.email.from_email'))
->setTo($to)
->setBody(
... | php | protected function sendNotification($to, array $changedValues)
{
$message = \Swift_Message::newInstance()
->setSubject('User details updated')
->setFrom($this->getContainer()->getParameter('fos_user.resetting.email.from_email'))
->setTo($to)
->setBody(
... | [
"protected",
"function",
"sendNotification",
"(",
"$",
"to",
",",
"array",
"$",
"changedValues",
")",
"{",
"$",
"message",
"=",
"\\",
"Swift_Message",
"::",
"newInstance",
"(",
")",
"->",
"setSubject",
"(",
"'User details updated'",
")",
"->",
"setFrom",
"(",
... | Send email notification about changes
@param $to
@param array $changedValues | [
"Send",
"email",
"notification",
"about",
"changes"
] | 86c656c131295fe1f3f7694fd4da1e5e454076b9 | https://github.com/webtown-php/KunstmaanExtensionBundle/blob/86c656c131295fe1f3f7694fd4da1e5e454076b9/src/Command/UserEditCommand.php#L189-L203 |
19,261 | webtown-php/KunstmaanExtensionBundle | src/Command/UserEditCommand.php | UserEditCommand.getChoiceBySelection | protected function getChoiceBySelection($selection)
{
preg_match('/^[^(]+\(([^\)]+)\)$/', $selection, $matches);
if (count($matches) < 2) {
return;
}
$username = $matches[1];
foreach ($this->choices as $item) {
if ($item->getUsername() === $username) {... | php | protected function getChoiceBySelection($selection)
{
preg_match('/^[^(]+\(([^\)]+)\)$/', $selection, $matches);
if (count($matches) < 2) {
return;
}
$username = $matches[1];
foreach ($this->choices as $item) {
if ($item->getUsername() === $username) {... | [
"protected",
"function",
"getChoiceBySelection",
"(",
"$",
"selection",
")",
"{",
"preg_match",
"(",
"'/^[^(]+\\(([^\\)]+)\\)$/'",
",",
"$",
"selection",
",",
"$",
"matches",
")",
";",
"if",
"(",
"count",
"(",
"$",
"matches",
")",
"<",
"2",
")",
"{",
"retu... | Find User by username
@param string $username
@return User | [
"Find",
"User",
"by",
"username"
] | 86c656c131295fe1f3f7694fd4da1e5e454076b9 | https://github.com/webtown-php/KunstmaanExtensionBundle/blob/86c656c131295fe1f3f7694fd4da1e5e454076b9/src/Command/UserEditCommand.php#L212-L226 |
19,262 | webtown-php/KunstmaanExtensionBundle | src/Command/UserEditCommand.php | UserEditCommand.getChoiceByUsernameOrEmail | protected function getChoiceByUsernameOrEmail($selection)
{
foreach ($this->choices as $item) {
if ($item->getUsername() === $selection) {
return $item;
}
if ($item->getEmail() === $selection) {
return $item;
}
}
... | php | protected function getChoiceByUsernameOrEmail($selection)
{
foreach ($this->choices as $item) {
if ($item->getUsername() === $selection) {
return $item;
}
if ($item->getEmail() === $selection) {
return $item;
}
}
... | [
"protected",
"function",
"getChoiceByUsernameOrEmail",
"(",
"$",
"selection",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"choices",
"as",
"$",
"item",
")",
"{",
"if",
"(",
"$",
"item",
"->",
"getUsername",
"(",
")",
"===",
"$",
"selection",
")",
"{",
... | Find User by username or email
@param string $username
@return User | [
"Find",
"User",
"by",
"username",
"or",
"email"
] | 86c656c131295fe1f3f7694fd4da1e5e454076b9 | https://github.com/webtown-php/KunstmaanExtensionBundle/blob/86c656c131295fe1f3f7694fd4da1e5e454076b9/src/Command/UserEditCommand.php#L235-L247 |
19,263 | webtown-php/KunstmaanExtensionBundle | src/Command/UserEditCommand.php | UserEditCommand.getNewValues | protected function getNewValues(User $user)
{
$newProps = new UserUpdater();
$this->logger->section('Editing user ' . $user->getEmail() . ' (' . $user->getUsername() . ')');
$this->logger->comment('leave empty to keep unchanged');
$newProps->setUsername($this->ask(new Question('Usern... | php | protected function getNewValues(User $user)
{
$newProps = new UserUpdater();
$this->logger->section('Editing user ' . $user->getEmail() . ' (' . $user->getUsername() . ')');
$this->logger->comment('leave empty to keep unchanged');
$newProps->setUsername($this->ask(new Question('Usern... | [
"protected",
"function",
"getNewValues",
"(",
"User",
"$",
"user",
")",
"{",
"$",
"newProps",
"=",
"new",
"UserUpdater",
"(",
")",
";",
"$",
"this",
"->",
"logger",
"->",
"section",
"(",
"'Editing user '",
".",
"$",
"user",
"->",
"getEmail",
"(",
")",
... | Ask for new user properties
@param User $user
@return UserUpdater | [
"Ask",
"for",
"new",
"user",
"properties"
] | 86c656c131295fe1f3f7694fd4da1e5e454076b9 | https://github.com/webtown-php/KunstmaanExtensionBundle/blob/86c656c131295fe1f3f7694fd4da1e5e454076b9/src/Command/UserEditCommand.php#L268-L280 |
19,264 | askupasoftware/amarkal | Extensions/WordPress/Admin/Notifier.php | Notifier.notify | static function notify( $message, $type, $page = null )
{
global $pagenow;
if( ( null != $page && $page == $pagenow ) ||
null == $page)
{
add_action( 'admin_notices', create_function( '',"echo '<div class=\"".$type."\"><p>".$message."</p></div>';" ) );
}
... | php | static function notify( $message, $type, $page = null )
{
global $pagenow;
if( ( null != $page && $page == $pagenow ) ||
null == $page)
{
add_action( 'admin_notices', create_function( '',"echo '<div class=\"".$type."\"><p>".$message."</p></div>';" ) );
}
... | [
"static",
"function",
"notify",
"(",
"$",
"message",
",",
"$",
"type",
",",
"$",
"page",
"=",
"null",
")",
"{",
"global",
"$",
"pagenow",
";",
"if",
"(",
"(",
"null",
"!=",
"$",
"page",
"&&",
"$",
"page",
"==",
"$",
"pagenow",
")",
"||",
"null",
... | Register an admin notification.
@global string $pagenow The current admin page.
@param string $message The message to print.
@param string $type The type of notification [self::ERROR|self::SUCCESS].
@param string $page (optional) A specific admin page in which the
notification should appear. If no page is... | [
"Register",
"an",
"admin",
"notification",
"."
] | fe8283e2d6847ef697abec832da7ee741a85058c | https://github.com/askupasoftware/amarkal/blob/fe8283e2d6847ef697abec832da7ee741a85058c/Extensions/WordPress/Admin/Notifier.php#L39-L47 |
19,265 | factorio-item-browser/export-data | src/Registry/EntityRegistry.php | EntityRegistry.set | public function set(EntityInterface $entity): string
{
$hash = $entity->calculateHash();
$content = $this->encodeContent($entity->writeData());
$this->saveContent($hash, $content);
return $hash;
} | php | public function set(EntityInterface $entity): string
{
$hash = $entity->calculateHash();
$content = $this->encodeContent($entity->writeData());
$this->saveContent($hash, $content);
return $hash;
} | [
"public",
"function",
"set",
"(",
"EntityInterface",
"$",
"entity",
")",
":",
"string",
"{",
"$",
"hash",
"=",
"$",
"entity",
"->",
"calculateHash",
"(",
")",
";",
"$",
"content",
"=",
"$",
"this",
"->",
"encodeContent",
"(",
"$",
"entity",
"->",
"writ... | Sets the specified entity into the registry.
@param EntityInterface $entity
@return string The hash used to save the entity. | [
"Sets",
"the",
"specified",
"entity",
"into",
"the",
"registry",
"."
] | 1413b2eed0fbfed0521457ac7ef0d668ac30c212 | https://github.com/factorio-item-browser/export-data/blob/1413b2eed0fbfed0521457ac7ef0d668ac30c212/src/Registry/EntityRegistry.php#L51-L57 |
19,266 | factorio-item-browser/export-data | src/Registry/EntityRegistry.php | EntityRegistry.get | public function get(string $hash): ?EntityInterface
{
$result = null;
$content = $this->loadContent($hash);
if ($content !== null) {
$result = $this->createEntityFromContent($content);
}
return $result;
} | php | public function get(string $hash): ?EntityInterface
{
$result = null;
$content = $this->loadContent($hash);
if ($content !== null) {
$result = $this->createEntityFromContent($content);
}
return $result;
} | [
"public",
"function",
"get",
"(",
"string",
"$",
"hash",
")",
":",
"?",
"EntityInterface",
"{",
"$",
"result",
"=",
"null",
";",
"$",
"content",
"=",
"$",
"this",
"->",
"loadContent",
"(",
"$",
"hash",
")",
";",
"if",
"(",
"$",
"content",
"!==",
"n... | Returns the entity with the specified hash.
@param string $hash
@return EntityInterface|null | [
"Returns",
"the",
"entity",
"with",
"the",
"specified",
"hash",
"."
] | 1413b2eed0fbfed0521457ac7ef0d668ac30c212 | https://github.com/factorio-item-browser/export-data/blob/1413b2eed0fbfed0521457ac7ef0d668ac30c212/src/Registry/EntityRegistry.php#L64-L72 |
19,267 | factorio-item-browser/export-data | src/Registry/EntityRegistry.php | EntityRegistry.createEntityFromContent | protected function createEntityFromContent(string $content): EntityInterface
{
$result = $this->createEntity();
$result->readData(new DataContainer($this->decodeContent($content)));
return $result;
} | php | protected function createEntityFromContent(string $content): EntityInterface
{
$result = $this->createEntity();
$result->readData(new DataContainer($this->decodeContent($content)));
return $result;
} | [
"protected",
"function",
"createEntityFromContent",
"(",
"string",
"$",
"content",
")",
":",
"EntityInterface",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"createEntity",
"(",
")",
";",
"$",
"result",
"->",
"readData",
"(",
"new",
"DataContainer",
"(",
"$",... | Creates an entity from the specified content.
@param string $content
@return EntityInterface | [
"Creates",
"an",
"entity",
"from",
"the",
"specified",
"content",
"."
] | 1413b2eed0fbfed0521457ac7ef0d668ac30c212 | https://github.com/factorio-item-browser/export-data/blob/1413b2eed0fbfed0521457ac7ef0d668ac30c212/src/Registry/EntityRegistry.php#L97-L102 |
19,268 | redaigbaria/oauth2 | src/Entity/SessionEntity.php | SessionEntity.associateScope | public function associateScope(ScopeEntity $scope)
{
if (!isset($this->scopes[$scope->getId()])) {
$this->scopes[$scope->getId()] = $scope;
}
return $this;
} | php | public function associateScope(ScopeEntity $scope)
{
if (!isset($this->scopes[$scope->getId()])) {
$this->scopes[$scope->getId()] = $scope;
}
return $this;
} | [
"public",
"function",
"associateScope",
"(",
"ScopeEntity",
"$",
"scope",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"scopes",
"[",
"$",
"scope",
"->",
"getId",
"(",
")",
"]",
")",
")",
"{",
"$",
"this",
"->",
"scopes",
"[",
"$",
... | Associate a scope
@param \League\OAuth2\Server\Entity\ScopeEntity $scope
@return self | [
"Associate",
"a",
"scope"
] | 54cca4aaaff6a095cbf1c8010f2fe2cc7de4e45a | https://github.com/redaigbaria/oauth2/blob/54cca4aaaff6a095cbf1c8010f2fe2cc7de4e45a/src/Entity/SessionEntity.php#L130-L137 |
19,269 | redaigbaria/oauth2 | src/Entity/SessionEntity.php | SessionEntity.hasScope | public function hasScope($scope)
{
if ($this->scopes === null) {
$this->getScopes();
}
return isset($this->scopes[$scope]);
} | php | public function hasScope($scope)
{
if ($this->scopes === null) {
$this->getScopes();
}
return isset($this->scopes[$scope]);
} | [
"public",
"function",
"hasScope",
"(",
"$",
"scope",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"scopes",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"getScopes",
"(",
")",
";",
"}",
"return",
"isset",
"(",
"$",
"this",
"->",
"scopes",
"[",
"$",
"sc... | Check if access token has an associated scope
@param string $scope Scope to check
@return bool | [
"Check",
"if",
"access",
"token",
"has",
"an",
"associated",
"scope"
] | 54cca4aaaff6a095cbf1c8010f2fe2cc7de4e45a | https://github.com/redaigbaria/oauth2/blob/54cca4aaaff6a095cbf1c8010f2fe2cc7de4e45a/src/Entity/SessionEntity.php#L146-L153 |
19,270 | redaigbaria/oauth2 | src/Entity/SessionEntity.php | SessionEntity.getClient | public function getClient()
{
if ($this->client instanceof ClientEntity) {
return $this->client;
}
$this->client = $this->server->getClientStorage()->getBySession($this);
return $this->client;
} | php | public function getClient()
{
if ($this->client instanceof ClientEntity) {
return $this->client;
}
$this->client = $this->server->getClientStorage()->getBySession($this);
return $this->client;
} | [
"public",
"function",
"getClient",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"client",
"instanceof",
"ClientEntity",
")",
"{",
"return",
"$",
"this",
"->",
"client",
";",
"}",
"$",
"this",
"->",
"client",
"=",
"$",
"this",
"->",
"server",
"->",
"g... | Return the session client
@return \League\OAuth2\Server\Entity\ClientEntity | [
"Return",
"the",
"session",
"client"
] | 54cca4aaaff6a095cbf1c8010f2fe2cc7de4e45a | https://github.com/redaigbaria/oauth2/blob/54cca4aaaff6a095cbf1c8010f2fe2cc7de4e45a/src/Entity/SessionEntity.php#L237-L246 |
19,271 | redaigbaria/oauth2 | src/Entity/SessionEntity.php | SessionEntity.setOwner | public function setOwner($type, $id)
{
$this->ownerType = $type;
$this->ownerId = $id;
$this->server->getEventEmitter()->emit(new SessionOwnerEvent($this));
return $this;
} | php | public function setOwner($type, $id)
{
$this->ownerType = $type;
$this->ownerId = $id;
$this->server->getEventEmitter()->emit(new SessionOwnerEvent($this));
return $this;
} | [
"public",
"function",
"setOwner",
"(",
"$",
"type",
",",
"$",
"id",
")",
"{",
"$",
"this",
"->",
"ownerType",
"=",
"$",
"type",
";",
"$",
"this",
"->",
"ownerId",
"=",
"$",
"id",
";",
"$",
"this",
"->",
"server",
"->",
"getEventEmitter",
"(",
")",
... | Set the session owner
@param string $type The type of the owner (e.g. user, app)
@param string $id The identifier of the owner
@return self | [
"Set",
"the",
"session",
"owner"
] | 54cca4aaaff6a095cbf1c8010f2fe2cc7de4e45a | https://github.com/redaigbaria/oauth2/blob/54cca4aaaff6a095cbf1c8010f2fe2cc7de4e45a/src/Entity/SessionEntity.php#L256-L264 |
19,272 | redaigbaria/oauth2 | src/Entity/SessionEntity.php | SessionEntity.save | public function save()
{
// Save the session and get an identifier
$id = $this->server->getSessionStorage()->create(
$this->getOwnerType(),
$this->getOwnerId(),
$this->getClient()->getId(),
$this->getClient()->getRedirectUri()
);
$this... | php | public function save()
{
// Save the session and get an identifier
$id = $this->server->getSessionStorage()->create(
$this->getOwnerType(),
$this->getOwnerId(),
$this->getClient()->getId(),
$this->getClient()->getRedirectUri()
);
$this... | [
"public",
"function",
"save",
"(",
")",
"{",
"// Save the session and get an identifier",
"$",
"id",
"=",
"$",
"this",
"->",
"server",
"->",
"getSessionStorage",
"(",
")",
"->",
"create",
"(",
"$",
"this",
"->",
"getOwnerType",
"(",
")",
",",
"$",
"this",
... | Save the session
@return void | [
"Save",
"the",
"session"
] | 54cca4aaaff6a095cbf1c8010f2fe2cc7de4e45a | https://github.com/redaigbaria/oauth2/blob/54cca4aaaff6a095cbf1c8010f2fe2cc7de4e45a/src/Entity/SessionEntity.php#L291-L307 |
19,273 | webforge-labs/psc-cms | lib/Psc/UI/DropBox2.php | DropBox2.convertButtons | protected function convertButtons() {
$buttons = array();
$snippets = array();
if (isset($this->assignedValues)) {
foreach ($this->assignedValues as $item) {
if ($item instanceof \Psc\UI\ButtonInterface) {
$button = $item;
} elseif ($item instanceof \Psc\CMS\Entity) {
... | php | protected function convertButtons() {
$buttons = array();
$snippets = array();
if (isset($this->assignedValues)) {
foreach ($this->assignedValues as $item) {
if ($item instanceof \Psc\UI\ButtonInterface) {
$button = $item;
} elseif ($item instanceof \Psc\CMS\Entity) {
... | [
"protected",
"function",
"convertButtons",
"(",
")",
"{",
"$",
"buttons",
"=",
"array",
"(",
")",
";",
"$",
"snippets",
"=",
"array",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"assignedValues",
")",
")",
"{",
"foreach",
"(",
"$",
"... | Wandelt die assignedValues in Buttons um
die JooseSnippets werden gesammelt, wenn sie extrahierbar sind
@return list($buttons, $snippets) | [
"Wandelt",
"die",
"assignedValues",
"in",
"Buttons",
"um"
] | 467bfa2547e6b4fa487d2d7f35fa6cc618dbc763 | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/UI/DropBox2.php#L115-L150 |
19,274 | atkrad/data-tables | src/Render.php | Render.prepareColumnsConfig | protected function prepareColumnsConfig()
{
$columns = [];
foreach ($this->table->getColumns() as $column) {
$columns[] = $column->getProperties();
}
$this->table->setColumns($columns);
} | php | protected function prepareColumnsConfig()
{
$columns = [];
foreach ($this->table->getColumns() as $column) {
$columns[] = $column->getProperties();
}
$this->table->setColumns($columns);
} | [
"protected",
"function",
"prepareColumnsConfig",
"(",
")",
"{",
"$",
"columns",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"table",
"->",
"getColumns",
"(",
")",
"as",
"$",
"column",
")",
"{",
"$",
"columns",
"[",
"]",
"=",
"$",
"column",... | Prepare columns config | [
"Prepare",
"columns",
"config"
] | 5afcc337ab624ca626e29d9674459c5105982b16 | https://github.com/atkrad/data-tables/blob/5afcc337ab624ca626e29d9674459c5105982b16/src/Render.php#L136-L145 |
19,275 | atkrad/data-tables | src/Render.php | Render.prepareExtensionsConfig | protected function prepareExtensionsConfig()
{
foreach ($this->table->getExtensions() as $extension) {
$properties = $extension->getProperties();
if (isset($properties)) {
$this->table->setProperty($extension->getPropertyName(), $properties);
}
}
... | php | protected function prepareExtensionsConfig()
{
foreach ($this->table->getExtensions() as $extension) {
$properties = $extension->getProperties();
if (isset($properties)) {
$this->table->setProperty($extension->getPropertyName(), $properties);
}
}
... | [
"protected",
"function",
"prepareExtensionsConfig",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"table",
"->",
"getExtensions",
"(",
")",
"as",
"$",
"extension",
")",
"{",
"$",
"properties",
"=",
"$",
"extension",
"->",
"getProperties",
"(",
")",
";"... | Prepare extensions config | [
"Prepare",
"extensions",
"config"
] | 5afcc337ab624ca626e29d9674459c5105982b16 | https://github.com/atkrad/data-tables/blob/5afcc337ab624ca626e29d9674459c5105982b16/src/Render.php#L150-L158 |
19,276 | CakeCMS/Core | src/Path/Path.php | Path.dirs | public function dirs($resource, $recursive = false, $filter = null)
{
return $this->ls($resource, self::LS_MODE_DIR, $recursive, $filter);
} | php | public function dirs($resource, $recursive = false, $filter = null)
{
return $this->ls($resource, self::LS_MODE_DIR, $recursive, $filter);
} | [
"public",
"function",
"dirs",
"(",
"$",
"resource",
",",
"$",
"recursive",
"=",
"false",
",",
"$",
"filter",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"ls",
"(",
"$",
"resource",
",",
"self",
"::",
"LS_MODE_DIR",
",",
"$",
"recursive",
",",... | Get a list of directories from a resource.
@param string $resource
@param bool $recursive
@param null $filter
@return mixed | [
"Get",
"a",
"list",
"of",
"directories",
"from",
"a",
"resource",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Path/Path.php#L50-L53 |
19,277 | CakeCMS/Core | src/Path/Path.php | Path.ls | public function ls($resource, $mode = self::LS_MODE_FILE, $recursive = false, $filter = null)
{
$files = [];
list (, $paths, $path) = $this->_parse($resource);
foreach ((array) $paths as $_path) {
if (file_exists($_path . '/' . $path)) {
foreach ($this->_list(FS:... | php | public function ls($resource, $mode = self::LS_MODE_FILE, $recursive = false, $filter = null)
{
$files = [];
list (, $paths, $path) = $this->_parse($resource);
foreach ((array) $paths as $_path) {
if (file_exists($_path . '/' . $path)) {
foreach ($this->_list(FS:... | [
"public",
"function",
"ls",
"(",
"$",
"resource",
",",
"$",
"mode",
"=",
"self",
"::",
"LS_MODE_FILE",
",",
"$",
"recursive",
"=",
"false",
",",
"$",
"filter",
"=",
"null",
")",
"{",
"$",
"files",
"=",
"[",
"]",
";",
"list",
"(",
",",
"$",
"paths... | Get a list of files or diretories from a resource.
@param string $resource
@param string $mode
@param bool $recursive
@param null $filter
@return array
@SuppressWarnings(PHPMD.ShortMethodName) | [
"Get",
"a",
"list",
"of",
"files",
"or",
"diretories",
"from",
"a",
"resource",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Path/Path.php#L105-L121 |
19,278 | CakeCMS/Core | src/Path/Path.php | Path._list | protected function _list($path, $prefix = '', $mode = 'file', $recursive = false, $filter = null)
{
$files = [];
$ignore = ['.', '..', '.DS_Store', '.svn', '.git', '.gitignore', '.gitmodules', 'cgi-bin'];
if ($scan = @scandir($path)) {
foreach ($scan as $file) {
... | php | protected function _list($path, $prefix = '', $mode = 'file', $recursive = false, $filter = null)
{
$files = [];
$ignore = ['.', '..', '.DS_Store', '.svn', '.git', '.gitignore', '.gitmodules', 'cgi-bin'];
if ($scan = @scandir($path)) {
foreach ($scan as $file) {
... | [
"protected",
"function",
"_list",
"(",
"$",
"path",
",",
"$",
"prefix",
"=",
"''",
",",
"$",
"mode",
"=",
"'file'",
",",
"$",
"recursive",
"=",
"false",
",",
"$",
"filter",
"=",
"null",
")",
"{",
"$",
"files",
"=",
"[",
"]",
";",
"$",
"ignore",
... | Get the list of files or directories in a given path.
@param string $path
@param string $prefix
@param string $mode
@param bool $recursive
@param null $filter
@return array
@SuppressWarnings(PHPMD.CyclomaticComplexity) | [
"Get",
"the",
"list",
"of",
"files",
"or",
"directories",
"in",
"a",
"given",
"path",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Path/Path.php#L134-L183 |
19,279 | zodream/thirdparty | src/API/Search.php | Search.putBaiDu | public function putBaiDu(array $urls) {
return $this->getBaiDu()->setHeader([
'Content-Type' => 'text/plain'
])->parameters($this->merge([
'urls' => $urls
]))->encode(function ($data) {
return implode("\n", $data['urls']);
})->json();
} | php | public function putBaiDu(array $urls) {
return $this->getBaiDu()->setHeader([
'Content-Type' => 'text/plain'
])->parameters($this->merge([
'urls' => $urls
]))->encode(function ($data) {
return implode("\n", $data['urls']);
})->json();
} | [
"public",
"function",
"putBaiDu",
"(",
"array",
"$",
"urls",
")",
"{",
"return",
"$",
"this",
"->",
"getBaiDu",
"(",
")",
"->",
"setHeader",
"(",
"[",
"'Content-Type'",
"=>",
"'text/plain'",
"]",
")",
"->",
"parameters",
"(",
"$",
"this",
"->",
"merge",
... | INITIATIVE PUT URLS TO BAIDU
@param array $urls
@return array
@throws \Exception | [
"INITIATIVE",
"PUT",
"URLS",
"TO",
"BAIDU"
] | b9d39087913850f1c5c7c9165105fec22a128f8f | https://github.com/zodream/thirdparty/blob/b9d39087913850f1c5c7c9165105fec22a128f8f/src/API/Search.php#L29-L37 |
19,280 | Chill-project/Main | Controller/PermissionsGroupController.php | PermissionsGroupController.createCreateForm | private function createCreateForm(PermissionsGroup $permissionsGroup)
{
$form = $this->createForm(new PermissionsGroupType(), $permissionsGroup, array(
'action' => $this->generateUrl('admin_permissionsgroup_create'),
'method' => 'POST',
));
$form->add('submit', 'subm... | php | private function createCreateForm(PermissionsGroup $permissionsGroup)
{
$form = $this->createForm(new PermissionsGroupType(), $permissionsGroup, array(
'action' => $this->generateUrl('admin_permissionsgroup_create'),
'method' => 'POST',
));
$form->add('submit', 'subm... | [
"private",
"function",
"createCreateForm",
"(",
"PermissionsGroup",
"$",
"permissionsGroup",
")",
"{",
"$",
"form",
"=",
"$",
"this",
"->",
"createForm",
"(",
"new",
"PermissionsGroupType",
"(",
")",
",",
"$",
"permissionsGroup",
",",
"array",
"(",
"'action'",
... | Creates a form to create a PermissionsGroup entity.
@param PermissionsGroup $permissionsGroup The entity
@return \Symfony\Component\Form\Form The form | [
"Creates",
"a",
"form",
"to",
"create",
"a",
"PermissionsGroup",
"entity",
"."
] | 384cb6c793072a4f1047dc5cafc2157ee2419f60 | https://github.com/Chill-project/Main/blob/384cb6c793072a4f1047dc5cafc2157ee2419f60/Controller/PermissionsGroupController.php#L68-L78 |
19,281 | Chill-project/Main | Controller/PermissionsGroupController.php | PermissionsGroupController.newAction | public function newAction()
{
$permissionsGroup = new PermissionsGroup();
$form = $this->createCreateForm($permissionsGroup);
return $this->render('ChillMainBundle:PermissionsGroup:new.html.twig', array(
'entity' => $permissionsGroup,
'form' => $form->createView(... | php | public function newAction()
{
$permissionsGroup = new PermissionsGroup();
$form = $this->createCreateForm($permissionsGroup);
return $this->render('ChillMainBundle:PermissionsGroup:new.html.twig', array(
'entity' => $permissionsGroup,
'form' => $form->createView(... | [
"public",
"function",
"newAction",
"(",
")",
"{",
"$",
"permissionsGroup",
"=",
"new",
"PermissionsGroup",
"(",
")",
";",
"$",
"form",
"=",
"$",
"this",
"->",
"createCreateForm",
"(",
"$",
"permissionsGroup",
")",
";",
"return",
"$",
"this",
"->",
"render"... | Displays a form to create a new PermissionsGroup entity. | [
"Displays",
"a",
"form",
"to",
"create",
"a",
"new",
"PermissionsGroup",
"entity",
"."
] | 384cb6c793072a4f1047dc5cafc2157ee2419f60 | https://github.com/Chill-project/Main/blob/384cb6c793072a4f1047dc5cafc2157ee2419f60/Controller/PermissionsGroupController.php#L84-L93 |
19,282 | Chill-project/Main | Controller/PermissionsGroupController.php | PermissionsGroupController.showAction | public function showAction($id)
{
$em = $this->getDoctrine()->getManager();
$permissionsGroup = $em->getRepository('ChillMainBundle:PermissionsGroup')->find($id);
if (!$permissionsGroup) {
throw $this->createNotFoundException('Unable to find PermissionsGroup entity.');
... | php | public function showAction($id)
{
$em = $this->getDoctrine()->getManager();
$permissionsGroup = $em->getRepository('ChillMainBundle:PermissionsGroup')->find($id);
if (!$permissionsGroup) {
throw $this->createNotFoundException('Unable to find PermissionsGroup entity.');
... | [
"public",
"function",
"showAction",
"(",
"$",
"id",
")",
"{",
"$",
"em",
"=",
"$",
"this",
"->",
"getDoctrine",
"(",
")",
"->",
"getManager",
"(",
")",
";",
"$",
"permissionsGroup",
"=",
"$",
"em",
"->",
"getRepository",
"(",
"'ChillMainBundle:PermissionsG... | Finds and displays a PermissionsGroup entity. | [
"Finds",
"and",
"displays",
"a",
"PermissionsGroup",
"entity",
"."
] | 384cb6c793072a4f1047dc5cafc2157ee2419f60 | https://github.com/Chill-project/Main/blob/384cb6c793072a4f1047dc5cafc2157ee2419f60/Controller/PermissionsGroupController.php#L99-L131 |
19,283 | Chill-project/Main | Controller/PermissionsGroupController.php | PermissionsGroupController.getExpandedRoles | private function getExpandedRoles(array $roleScopes)
{
$expandedRoles = array();
foreach ($roleScopes as $roleScope) {
if (!array_key_exists($roleScope->getRole(), $expandedRoles)) {
$expandedRoles[$roleScope->getRole()] =
array_map(
... | php | private function getExpandedRoles(array $roleScopes)
{
$expandedRoles = array();
foreach ($roleScopes as $roleScope) {
if (!array_key_exists($roleScope->getRole(), $expandedRoles)) {
$expandedRoles[$roleScope->getRole()] =
array_map(
... | [
"private",
"function",
"getExpandedRoles",
"(",
"array",
"$",
"roleScopes",
")",
"{",
"$",
"expandedRoles",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"roleScopes",
"as",
"$",
"roleScope",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"r... | expand roleScopes to be easily shown in template
@param array $roleScopes
@return array | [
"expand",
"roleScopes",
"to",
"be",
"easily",
"shown",
"in",
"template"
] | 384cb6c793072a4f1047dc5cafc2157ee2419f60 | https://github.com/Chill-project/Main/blob/384cb6c793072a4f1047dc5cafc2157ee2419f60/Controller/PermissionsGroupController.php#L139-L158 |
19,284 | Chill-project/Main | Controller/PermissionsGroupController.php | PermissionsGroupController.editAction | public function editAction($id)
{
$em = $this->getDoctrine()->getManager();
$permissionsGroup = $em->getRepository('ChillMainBundle:PermissionsGroup')->find($id);
if (!$permissionsGroup) {
throw $this->createNotFoundException('Unable to find PermissionsGroup entity.');
... | php | public function editAction($id)
{
$em = $this->getDoctrine()->getManager();
$permissionsGroup = $em->getRepository('ChillMainBundle:PermissionsGroup')->find($id);
if (!$permissionsGroup) {
throw $this->createNotFoundException('Unable to find PermissionsGroup entity.');
... | [
"public",
"function",
"editAction",
"(",
"$",
"id",
")",
"{",
"$",
"em",
"=",
"$",
"this",
"->",
"getDoctrine",
"(",
")",
"->",
"getManager",
"(",
")",
";",
"$",
"permissionsGroup",
"=",
"$",
"em",
"->",
"getRepository",
"(",
"'ChillMainBundle:PermissionsG... | Displays a form to edit an existing PermissionsGroup entity. | [
"Displays",
"a",
"form",
"to",
"edit",
"an",
"existing",
"PermissionsGroup",
"entity",
"."
] | 384cb6c793072a4f1047dc5cafc2157ee2419f60 | https://github.com/Chill-project/Main/blob/384cb6c793072a4f1047dc5cafc2157ee2419f60/Controller/PermissionsGroupController.php#L164-L194 |
19,285 | Chill-project/Main | Controller/PermissionsGroupController.php | PermissionsGroupController.createEditForm | private function createEditForm(PermissionsGroup $permissionsGroup)
{
$form = $this->createForm(new PermissionsGroupType(), $permissionsGroup, array(
'action' => $this->generateUrl('admin_permissionsgroup_update', array('id' => $permissionsGroup->getId())),
'method' => 'PUT',
... | php | private function createEditForm(PermissionsGroup $permissionsGroup)
{
$form = $this->createForm(new PermissionsGroupType(), $permissionsGroup, array(
'action' => $this->generateUrl('admin_permissionsgroup_update', array('id' => $permissionsGroup->getId())),
'method' => 'PUT',
... | [
"private",
"function",
"createEditForm",
"(",
"PermissionsGroup",
"$",
"permissionsGroup",
")",
"{",
"$",
"form",
"=",
"$",
"this",
"->",
"createForm",
"(",
"new",
"PermissionsGroupType",
"(",
")",
",",
"$",
"permissionsGroup",
",",
"array",
"(",
"'action'",
"... | Creates a form to edit a PermissionsGroup entity.
@param PermissionsGroup $permissionsGroup The entity
@return \Symfony\Component\Form\Form The form | [
"Creates",
"a",
"form",
"to",
"edit",
"a",
"PermissionsGroup",
"entity",
"."
] | 384cb6c793072a4f1047dc5cafc2157ee2419f60 | https://github.com/Chill-project/Main/blob/384cb6c793072a4f1047dc5cafc2157ee2419f60/Controller/PermissionsGroupController.php#L203-L213 |
19,286 | Chill-project/Main | Controller/PermissionsGroupController.php | PermissionsGroupController.updateAction | public function updateAction(Request $request, $id)
{
$em = $this->getDoctrine()->getManager();
$permissionsGroup = $em->getRepository('ChillMainBundle:PermissionsGroup')->find($id);
if (!$permissionsGroup) {
throw $this->createNotFoundException('Unable to find PermissionsGroup... | php | public function updateAction(Request $request, $id)
{
$em = $this->getDoctrine()->getManager();
$permissionsGroup = $em->getRepository('ChillMainBundle:PermissionsGroup')->find($id);
if (!$permissionsGroup) {
throw $this->createNotFoundException('Unable to find PermissionsGroup... | [
"public",
"function",
"updateAction",
"(",
"Request",
"$",
"request",
",",
"$",
"id",
")",
"{",
"$",
"em",
"=",
"$",
"this",
"->",
"getDoctrine",
"(",
")",
"->",
"getManager",
"(",
")",
";",
"$",
"permissionsGroup",
"=",
"$",
"em",
"->",
"getRepository... | Edits an existing PermissionsGroup entity. | [
"Edits",
"an",
"existing",
"PermissionsGroup",
"entity",
"."
] | 384cb6c793072a4f1047dc5cafc2157ee2419f60 | https://github.com/Chill-project/Main/blob/384cb6c793072a4f1047dc5cafc2157ee2419f60/Controller/PermissionsGroupController.php#L219-L257 |
19,287 | Chill-project/Main | Controller/PermissionsGroupController.php | PermissionsGroupController.getPersistentRoleScopeBy | protected function getPersistentRoleScopeBy($role, Scope $scope = null)
{
$em = $this->getDoctrine()->getManager();
$roleScope = $em->getRepository('ChillMainBundle:RoleScope')
->findOneBy(array('role' => $role, 'scope' => $scope));
if ($roleScope === NULL)... | php | protected function getPersistentRoleScopeBy($role, Scope $scope = null)
{
$em = $this->getDoctrine()->getManager();
$roleScope = $em->getRepository('ChillMainBundle:RoleScope')
->findOneBy(array('role' => $role, 'scope' => $scope));
if ($roleScope === NULL)... | [
"protected",
"function",
"getPersistentRoleScopeBy",
"(",
"$",
"role",
",",
"Scope",
"$",
"scope",
"=",
"null",
")",
"{",
"$",
"em",
"=",
"$",
"this",
"->",
"getDoctrine",
"(",
")",
"->",
"getManager",
"(",
")",
";",
"$",
"roleScope",
"=",
"$",
"em",
... | get a role scope by his parameters. The role scope is persisted if it
doesn't exists in database.
@param Scope $scope
@param string $role
@return RoleScope | [
"get",
"a",
"role",
"scope",
"by",
"his",
"parameters",
".",
"The",
"role",
"scope",
"is",
"persisted",
"if",
"it",
"doesn",
"t",
"exists",
"in",
"database",
"."
] | 384cb6c793072a4f1047dc5cafc2157ee2419f60 | https://github.com/Chill-project/Main/blob/384cb6c793072a4f1047dc5cafc2157ee2419f60/Controller/PermissionsGroupController.php#L267-L284 |
19,288 | Chill-project/Main | Controller/PermissionsGroupController.php | PermissionsGroupController.deleteLinkRoleScopeAction | public function deleteLinkRoleScopeAction($pgid, $rsid)
{
$em = $this->getDoctrine()->getManager();
$permissionsGroup = $em->getRepository('ChillMainBundle:PermissionsGroup')->find($pgid);
$roleScope = $em->getRepository('ChillMainBundle:RoleScope')->find($rsid);
if (!$per... | php | public function deleteLinkRoleScopeAction($pgid, $rsid)
{
$em = $this->getDoctrine()->getManager();
$permissionsGroup = $em->getRepository('ChillMainBundle:PermissionsGroup')->find($pgid);
$roleScope = $em->getRepository('ChillMainBundle:RoleScope')->find($rsid);
if (!$per... | [
"public",
"function",
"deleteLinkRoleScopeAction",
"(",
"$",
"pgid",
",",
"$",
"rsid",
")",
"{",
"$",
"em",
"=",
"$",
"this",
"->",
"getDoctrine",
"(",
")",
"->",
"getManager",
"(",
")",
";",
"$",
"permissionsGroup",
"=",
"$",
"em",
"->",
"getRepository"... | remove an association between permissionsGroup and roleScope
@param int $pgid permissionsGroup id
@param int $rsid roleScope id
@return redirection to edit form | [
"remove",
"an",
"association",
"between",
"permissionsGroup",
"and",
"roleScope"
] | 384cb6c793072a4f1047dc5cafc2157ee2419f60 | https://github.com/Chill-project/Main/blob/384cb6c793072a4f1047dc5cafc2157ee2419f60/Controller/PermissionsGroupController.php#L293-L335 |
19,289 | Chill-project/Main | Controller/PermissionsGroupController.php | PermissionsGroupController.createDeleteRoleScopeForm | private function createDeleteRoleScopeForm(PermissionsGroup $permissionsGroup,
RoleScope $roleScope)
{
return $this->createFormBuilder()
->setAction($this->generateUrl('admin_permissionsgroup_delete_role_scope',
array('pgid' => $permissionsGroup->getId(), 'rsid' ... | php | private function createDeleteRoleScopeForm(PermissionsGroup $permissionsGroup,
RoleScope $roleScope)
{
return $this->createFormBuilder()
->setAction($this->generateUrl('admin_permissionsgroup_delete_role_scope',
array('pgid' => $permissionsGroup->getId(), 'rsid' ... | [
"private",
"function",
"createDeleteRoleScopeForm",
"(",
"PermissionsGroup",
"$",
"permissionsGroup",
",",
"RoleScope",
"$",
"roleScope",
")",
"{",
"return",
"$",
"this",
"->",
"createFormBuilder",
"(",
")",
"->",
"setAction",
"(",
"$",
"this",
"->",
"generateUrl"... | Creates a form to delete a link to roleScope.
@param mixed $permissionsGroup The entity id
@return \Symfony\Component\Form\Form The form | [
"Creates",
"a",
"form",
"to",
"delete",
"a",
"link",
"to",
"roleScope",
"."
] | 384cb6c793072a4f1047dc5cafc2157ee2419f60 | https://github.com/Chill-project/Main/blob/384cb6c793072a4f1047dc5cafc2157ee2419f60/Controller/PermissionsGroupController.php#L416-L426 |
19,290 | Chill-project/Main | Controller/PermissionsGroupController.php | PermissionsGroupController.createAddRoleScopeForm | private function createAddRoleScopeForm(PermissionsGroup $permissionsGroup)
{
return $this->createFormBuilder()
->setAction($this->generateUrl('admin_permissionsgroup_add_role_scope',
array('id' => $permissionsGroup->getId())))
->setMethod('PUT')
... | php | private function createAddRoleScopeForm(PermissionsGroup $permissionsGroup)
{
return $this->createFormBuilder()
->setAction($this->generateUrl('admin_permissionsgroup_add_role_scope',
array('id' => $permissionsGroup->getId())))
->setMethod('PUT')
... | [
"private",
"function",
"createAddRoleScopeForm",
"(",
"PermissionsGroup",
"$",
"permissionsGroup",
")",
"{",
"return",
"$",
"this",
"->",
"createFormBuilder",
"(",
")",
"->",
"setAction",
"(",
"$",
"this",
"->",
"generateUrl",
"(",
"'admin_permissionsgroup_add_role_sc... | creates a form to add a role scope to permissionsgroup
@param PermissionsGroup $permissionsGroup
@return \Symfony\Component\Form\Form The form | [
"creates",
"a",
"form",
"to",
"add",
"a",
"role",
"scope",
"to",
"permissionsgroup"
] | 384cb6c793072a4f1047dc5cafc2157ee2419f60 | https://github.com/Chill-project/Main/blob/384cb6c793072a4f1047dc5cafc2157ee2419f60/Controller/PermissionsGroupController.php#L434-L444 |
19,291 | aedart/laravel-helpers | src/Traits/Queue/QueueTrait.php | QueueTrait.getDefaultQueue | public function getDefaultQueue(): ?Queue
{
// By default, the Queue Facade does not return the
// any actual database connection, but rather an
// instance of \Illuminate\Queue\QueueManager.
// Therefore, we make sure only to obtain its
// "connection", to make sure that its... | php | public function getDefaultQueue(): ?Queue
{
// By default, the Queue Facade does not return the
// any actual database connection, but rather an
// instance of \Illuminate\Queue\QueueManager.
// Therefore, we make sure only to obtain its
// "connection", to make sure that its... | [
"public",
"function",
"getDefaultQueue",
"(",
")",
":",
"?",
"Queue",
"{",
"// By default, the Queue Facade does not return the",
"// any actual database connection, but rather an",
"// instance of \\Illuminate\\Queue\\QueueManager.",
"// Therefore, we make sure only to obtain its",
"// \"... | Get a default queue value, if any is available
@return Queue|null A default queue value or Null if no default value is available | [
"Get",
"a",
"default",
"queue",
"value",
"if",
"any",
"is",
"available"
] | 8b81a2d6658f3f8cb62b6be2c34773aaa2df219a | https://github.com/aedart/laravel-helpers/blob/8b81a2d6658f3f8cb62b6be2c34773aaa2df219a/src/Traits/Queue/QueueTrait.php#L76-L89 |
19,292 | SAREhub/PHP_Commons | src/SAREhub/Commons/Misc/SqliteHashStorage.php | SqliteHashStorage.insertMulti | public function insertMulti(array $hashes)
{
$valuesString = '';
foreach ($hashes as $id => $hash) {
$valuesString .= "('$id','$hash'),";
}
$this->storage->exec("INSERT INTO " . $this->tableName . "(id, hash) VALUES " . rtrim($valuesString, ','));
} | php | public function insertMulti(array $hashes)
{
$valuesString = '';
foreach ($hashes as $id => $hash) {
$valuesString .= "('$id','$hash'),";
}
$this->storage->exec("INSERT INTO " . $this->tableName . "(id, hash) VALUES " . rtrim($valuesString, ','));
} | [
"public",
"function",
"insertMulti",
"(",
"array",
"$",
"hashes",
")",
"{",
"$",
"valuesString",
"=",
"''",
";",
"foreach",
"(",
"$",
"hashes",
"as",
"$",
"id",
"=>",
"$",
"hash",
")",
"{",
"$",
"valuesString",
".=",
"\"('$id','$hash'),\"",
";",
"}",
"... | Inserts hashes in batch for better performance
@param array $hashes 'id' => 'hash' | [
"Inserts",
"hashes",
"in",
"batch",
"for",
"better",
"performance"
] | 4e1769ab6411a584112df1151dcc90e6b82fe2bb | https://github.com/SAREhub/PHP_Commons/blob/4e1769ab6411a584112df1151dcc90e6b82fe2bb/src/SAREhub/Commons/Misc/SqliteHashStorage.php#L83-L91 |
19,293 | SAREhub/PHP_Commons | src/SAREhub/Commons/Misc/SqliteHashStorage.php | SqliteHashStorage.updateMulti | public function updateMulti(array $hashes)
{
$startSql = "UPDATE " . $this->tableName;
$this->storage->exec('BEGIN TRANSACTION');
foreach ($hashes as $id => $hash) {
$this->storage->exec($startSql . " SET hash='$hash' WHERE id='$id'");
}
$this->storage->exec('END ... | php | public function updateMulti(array $hashes)
{
$startSql = "UPDATE " . $this->tableName;
$this->storage->exec('BEGIN TRANSACTION');
foreach ($hashes as $id => $hash) {
$this->storage->exec($startSql . " SET hash='$hash' WHERE id='$id'");
}
$this->storage->exec('END ... | [
"public",
"function",
"updateMulti",
"(",
"array",
"$",
"hashes",
")",
"{",
"$",
"startSql",
"=",
"\"UPDATE \"",
".",
"$",
"this",
"->",
"tableName",
";",
"$",
"this",
"->",
"storage",
"->",
"exec",
"(",
"'BEGIN TRANSACTION'",
")",
";",
"foreach",
"(",
"... | Updating hashes in batch for better performance
@param array $hashes 'id' => 'hash' | [
"Updating",
"hashes",
"in",
"batch",
"for",
"better",
"performance"
] | 4e1769ab6411a584112df1151dcc90e6b82fe2bb | https://github.com/SAREhub/PHP_Commons/blob/4e1769ab6411a584112df1151dcc90e6b82fe2bb/src/SAREhub/Commons/Misc/SqliteHashStorage.php#L97-L105 |
19,294 | webforge-labs/psc-cms | lib/PHPWord/PHPWord/Style.php | PHPWord_Style.addParagraphStyle | public static function addParagraphStyle($styleName, $styles) {
if(!array_key_exists($styleName, self::$_styleElements)) {
$style = new PHPWord_Style_Paragraph();
foreach($styles as $key => $value) {
if(substr($key, 0, 1) != '_') {
$key = '_'.$key;
}
$style->setStyleValue($key, $value);
... | php | public static function addParagraphStyle($styleName, $styles) {
if(!array_key_exists($styleName, self::$_styleElements)) {
$style = new PHPWord_Style_Paragraph();
foreach($styles as $key => $value) {
if(substr($key, 0, 1) != '_') {
$key = '_'.$key;
}
$style->setStyleValue($key, $value);
... | [
"public",
"static",
"function",
"addParagraphStyle",
"(",
"$",
"styleName",
",",
"$",
"styles",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"styleName",
",",
"self",
"::",
"$",
"_styleElements",
")",
")",
"{",
"$",
"style",
"=",
"new",
"PHPWo... | Add a paragraph style
@param string $styleName
@param array $styles | [
"Add",
"a",
"paragraph",
"style"
] | 467bfa2547e6b4fa487d2d7f35fa6cc618dbc763 | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/PHPWord/PHPWord/Style.php#L52-L64 |
19,295 | webforge-labs/psc-cms | lib/PHPWord/PHPWord/Style.php | PHPWord_Style.addFontStyle | public static function addFontStyle($styleName, $styleFont, $styleParagraph = null) {
if(!array_key_exists($styleName, self::$_styleElements)) {
$font = new PHPWord_Style_Font('text', $styleParagraph);
foreach($styleFont as $key => $value) {
if(substr($key, 0, 1) != '_') {
$key = '_'.$key;
}
... | php | public static function addFontStyle($styleName, $styleFont, $styleParagraph = null) {
if(!array_key_exists($styleName, self::$_styleElements)) {
$font = new PHPWord_Style_Font('text', $styleParagraph);
foreach($styleFont as $key => $value) {
if(substr($key, 0, 1) != '_') {
$key = '_'.$key;
}
... | [
"public",
"static",
"function",
"addFontStyle",
"(",
"$",
"styleName",
",",
"$",
"styleFont",
",",
"$",
"styleParagraph",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"styleName",
",",
"self",
"::",
"$",
"_styleElements",
")",
")",
... | Add a font style
@param string $styleName
@param array $styleFont
@param array $styleParagraph | [
"Add",
"a",
"font",
"style"
] | 467bfa2547e6b4fa487d2d7f35fa6cc618dbc763 | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/PHPWord/PHPWord/Style.php#L73-L84 |
19,296 | webforge-labs/psc-cms | lib/PHPWord/PHPWord/Style.php | PHPWord_Style.addLinkStyle | public static function addLinkStyle($styleName, $styles) {
if(!array_key_exists($styleName, self::$_styleElements)) {
$style = new PHPWord_Style_Font('link');
foreach($styles as $key => $value) {
if(substr($key, 0, 1) != '_') {
$key = '_'.$key;
}
$style->setStyleValue($key, $value);
... | php | public static function addLinkStyle($styleName, $styles) {
if(!array_key_exists($styleName, self::$_styleElements)) {
$style = new PHPWord_Style_Font('link');
foreach($styles as $key => $value) {
if(substr($key, 0, 1) != '_') {
$key = '_'.$key;
}
$style->setStyleValue($key, $value);
... | [
"public",
"static",
"function",
"addLinkStyle",
"(",
"$",
"styleName",
",",
"$",
"styles",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"styleName",
",",
"self",
"::",
"$",
"_styleElements",
")",
")",
"{",
"$",
"style",
"=",
"new",
"PHPWord_St... | Add a link style
@param string $styleName
@param array $styles | [
"Add",
"a",
"link",
"style"
] | 467bfa2547e6b4fa487d2d7f35fa6cc618dbc763 | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/PHPWord/PHPWord/Style.php#L92-L104 |
19,297 | webforge-labs/psc-cms | lib/PHPWord/PHPWord/Style.php | PHPWord_Style.addTableStyle | public static function addTableStyle($styleName, $styleTable, $styleFirstRow = null, $styleLastRow = null) {
if(!array_key_exists($styleName, self::$_styleElements)) {
$style = new PHPWord_Style_TableFull($styleTable, $styleFirstRow, $styleLastRow);
self::$_styleElements[$styleName] = $style;
}
} | php | public static function addTableStyle($styleName, $styleTable, $styleFirstRow = null, $styleLastRow = null) {
if(!array_key_exists($styleName, self::$_styleElements)) {
$style = new PHPWord_Style_TableFull($styleTable, $styleFirstRow, $styleLastRow);
self::$_styleElements[$styleName] = $style;
}
} | [
"public",
"static",
"function",
"addTableStyle",
"(",
"$",
"styleName",
",",
"$",
"styleTable",
",",
"$",
"styleFirstRow",
"=",
"null",
",",
"$",
"styleLastRow",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"styleName",
",",
"self",... | Add a table style
@param string $styleName
@param array $styles | [
"Add",
"a",
"table",
"style"
] | 467bfa2547e6b4fa487d2d7f35fa6cc618dbc763 | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/PHPWord/PHPWord/Style.php#L112-L118 |
19,298 | struzik-vladislav/php-error-handler | src/ErrorHandler.php | ErrorHandler.setProcessorsStack | public function setProcessorsStack(array $stack)
{
$this->processorsStack = [];
foreach (array_reverse($stack) as $processor) {
$this->pushProcessor($processor);
}
return $this;
} | php | public function setProcessorsStack(array $stack)
{
$this->processorsStack = [];
foreach (array_reverse($stack) as $processor) {
$this->pushProcessor($processor);
}
return $this;
} | [
"public",
"function",
"setProcessorsStack",
"(",
"array",
"$",
"stack",
")",
"{",
"$",
"this",
"->",
"processorsStack",
"=",
"[",
"]",
";",
"foreach",
"(",
"array_reverse",
"(",
"$",
"stack",
")",
"as",
"$",
"processor",
")",
"{",
"$",
"this",
"->",
"p... | Setting the processors stack as array.
@param ProcessorInterface[] $stack processors stack
@return ErrorHandler | [
"Setting",
"the",
"processors",
"stack",
"as",
"array",
"."
] | 87fa9f56edca7011f78e00659bb094b4fe713ebe | https://github.com/struzik-vladislav/php-error-handler/blob/87fa9f56edca7011f78e00659bb094b4fe713ebe/src/ErrorHandler.php#L102-L110 |
19,299 | webforge-labs/psc-cms | lib/Psc/CMS/Action.php | Action.getEntityMeta | public function getEntityMeta(EntityMetaProvider $entityMetaProvider = NULL) {
if (!isset($this->entityMeta) && $this->type === self::SPECIFIC) {
if (!isset($entityMetaProvider)) throw new \LogicException('Missing Parameter 1 (EntityMetaProvider) for '.__FUNCTION__);
$this->entityMeta = $entityMe... | php | public function getEntityMeta(EntityMetaProvider $entityMetaProvider = NULL) {
if (!isset($this->entityMeta) && $this->type === self::SPECIFIC) {
if (!isset($entityMetaProvider)) throw new \LogicException('Missing Parameter 1 (EntityMetaProvider) for '.__FUNCTION__);
$this->entityMeta = $entityMe... | [
"public",
"function",
"getEntityMeta",
"(",
"EntityMetaProvider",
"$",
"entityMetaProvider",
"=",
"NULL",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"entityMeta",
")",
"&&",
"$",
"this",
"->",
"type",
"===",
"self",
"::",
"SPECIFIC",
")",
... | Returns the EntityMeta for specific or general type
Attention: When type is specific $dc is not optional!
@return Psc\CMS\EntityMeta | [
"Returns",
"the",
"EntityMeta",
"for",
"specific",
"or",
"general",
"type"
] | 467bfa2547e6b4fa487d2d7f35fa6cc618dbc763 | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/CMS/Action.php#L48-L56 |
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.