repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
oroinc/OroLayoutComponent | DeferredLayoutManipulator.php | DeferredLayoutManipulator.add | public function add(
$id,
$parentId,
$blockType,
array $options = [],
$siblingId = null,
$prepend = null
) {
$this->actions[self::GROUP_ADD][++$this->lastIndex] = [
self::ADD,
__FUNCTION__,
[$id, $parentId, $blockType, $opti... | php | public function add(
$id,
$parentId,
$blockType,
array $options = [],
$siblingId = null,
$prepend = null
) {
$this->actions[self::GROUP_ADD][++$this->lastIndex] = [
self::ADD,
__FUNCTION__,
[$id, $parentId, $blockType, $opti... | [
"public",
"function",
"add",
"(",
"$",
"id",
",",
"$",
"parentId",
",",
"$",
"blockType",
",",
"array",
"$",
"options",
"=",
"[",
"]",
",",
"$",
"siblingId",
"=",
"null",
",",
"$",
"prepend",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"actions",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/DeferredLayoutManipulator.php#L141-L156 |
oroinc/OroLayoutComponent | DeferredLayoutManipulator.php | DeferredLayoutManipulator.remove | public function remove($id)
{
$this->actions[self::GROUP_REMOVE][++$this->lastIndex] = [
self::REMOVE,
__FUNCTION__,
[$id]
];
$this->links[self::REMOVE][$id][$this->lastIndex] = true;
return $this;
} | php | public function remove($id)
{
$this->actions[self::GROUP_REMOVE][++$this->lastIndex] = [
self::REMOVE,
__FUNCTION__,
[$id]
];
$this->links[self::REMOVE][$id][$this->lastIndex] = true;
return $this;
} | [
"public",
"function",
"remove",
"(",
"$",
"id",
")",
"{",
"$",
"this",
"->",
"actions",
"[",
"self",
"::",
"GROUP_REMOVE",
"]",
"[",
"++",
"$",
"this",
"->",
"lastIndex",
"]",
"=",
"[",
"self",
"::",
"REMOVE",
",",
"__FUNCTION__",
",",
"[",
"$",
"i... | {@inheritdoc} | [
"{"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/DeferredLayoutManipulator.php#L161-L172 |
oroinc/OroLayoutComponent | DeferredLayoutManipulator.php | DeferredLayoutManipulator.move | public function move($id, $parentId = null, $siblingId = null, $prepend = null)
{
$this->actions[self::GROUP_ADD][++$this->lastIndex] = [
self::MOVE,
__FUNCTION__,
[$id, $parentId, $siblingId, $prepend]
];
return $this;
} | php | public function move($id, $parentId = null, $siblingId = null, $prepend = null)
{
$this->actions[self::GROUP_ADD][++$this->lastIndex] = [
self::MOVE,
__FUNCTION__,
[$id, $parentId, $siblingId, $prepend]
];
return $this;
} | [
"public",
"function",
"move",
"(",
"$",
"id",
",",
"$",
"parentId",
"=",
"null",
",",
"$",
"siblingId",
"=",
"null",
",",
"$",
"prepend",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"actions",
"[",
"self",
"::",
"GROUP_ADD",
"]",
"[",
"++",
"$",
"t... | {@inheritdoc} | [
"{"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/DeferredLayoutManipulator.php#L177-L186 |
oroinc/OroLayoutComponent | DeferredLayoutManipulator.php | DeferredLayoutManipulator.addAlias | public function addAlias($alias, $id)
{
$this->actions[self::GROUP_ADD][++$this->lastIndex] = [
self::ADD_ALIAS,
__FUNCTION__,
[$alias, $id]
];
return $this;
} | php | public function addAlias($alias, $id)
{
$this->actions[self::GROUP_ADD][++$this->lastIndex] = [
self::ADD_ALIAS,
__FUNCTION__,
[$alias, $id]
];
return $this;
} | [
"public",
"function",
"addAlias",
"(",
"$",
"alias",
",",
"$",
"id",
")",
"{",
"$",
"this",
"->",
"actions",
"[",
"self",
"::",
"GROUP_ADD",
"]",
"[",
"++",
"$",
"this",
"->",
"lastIndex",
"]",
"=",
"[",
"self",
"::",
"ADD_ALIAS",
",",
"__FUNCTION__"... | {@inheritdoc} | [
"{"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/DeferredLayoutManipulator.php#L191-L200 |
oroinc/OroLayoutComponent | DeferredLayoutManipulator.php | DeferredLayoutManipulator.removeAlias | public function removeAlias($alias)
{
$this->actions[self::GROUP_REMOVE][++$this->lastIndex] = [
self::REMOVE_ALIAS,
__FUNCTION__,
[$alias]
];
return $this;
} | php | public function removeAlias($alias)
{
$this->actions[self::GROUP_REMOVE][++$this->lastIndex] = [
self::REMOVE_ALIAS,
__FUNCTION__,
[$alias]
];
return $this;
} | [
"public",
"function",
"removeAlias",
"(",
"$",
"alias",
")",
"{",
"$",
"this",
"->",
"actions",
"[",
"self",
"::",
"GROUP_REMOVE",
"]",
"[",
"++",
"$",
"this",
"->",
"lastIndex",
"]",
"=",
"[",
"self",
"::",
"REMOVE_ALIAS",
",",
"__FUNCTION__",
",",
"[... | {@inheritdoc} | [
"{"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/DeferredLayoutManipulator.php#L205-L214 |
oroinc/OroLayoutComponent | DeferredLayoutManipulator.php | DeferredLayoutManipulator.setOption | public function setOption($id, $optionName, $optionValue)
{
$this->actions[self::GROUP_ADD][++$this->lastIndex] = [
self::SET_OPTION,
__FUNCTION__,
[$id, $optionName, $optionValue]
];
return $this;
} | php | public function setOption($id, $optionName, $optionValue)
{
$this->actions[self::GROUP_ADD][++$this->lastIndex] = [
self::SET_OPTION,
__FUNCTION__,
[$id, $optionName, $optionValue]
];
return $this;
} | [
"public",
"function",
"setOption",
"(",
"$",
"id",
",",
"$",
"optionName",
",",
"$",
"optionValue",
")",
"{",
"$",
"this",
"->",
"actions",
"[",
"self",
"::",
"GROUP_ADD",
"]",
"[",
"++",
"$",
"this",
"->",
"lastIndex",
"]",
"=",
"[",
"self",
"::",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/DeferredLayoutManipulator.php#L219-L228 |
oroinc/OroLayoutComponent | DeferredLayoutManipulator.php | DeferredLayoutManipulator.appendOption | public function appendOption($id, $optionName, $optionValue)
{
$this->actions[self::GROUP_ADD][++$this->lastIndex] = [
self::APPEND_OPTION,
__FUNCTION__,
[$id, $optionName, $optionValue]
];
return $this;
} | php | public function appendOption($id, $optionName, $optionValue)
{
$this->actions[self::GROUP_ADD][++$this->lastIndex] = [
self::APPEND_OPTION,
__FUNCTION__,
[$id, $optionName, $optionValue]
];
return $this;
} | [
"public",
"function",
"appendOption",
"(",
"$",
"id",
",",
"$",
"optionName",
",",
"$",
"optionValue",
")",
"{",
"$",
"this",
"->",
"actions",
"[",
"self",
"::",
"GROUP_ADD",
"]",
"[",
"++",
"$",
"this",
"->",
"lastIndex",
"]",
"=",
"[",
"self",
"::"... | {@inheritdoc} | [
"{"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/DeferredLayoutManipulator.php#L233-L242 |
oroinc/OroLayoutComponent | DeferredLayoutManipulator.php | DeferredLayoutManipulator.subtractOption | public function subtractOption($id, $optionName, $optionValue)
{
$this->actions[self::GROUP_ADD][++$this->lastIndex] = [
self::SUBTRACT_OPTION,
__FUNCTION__,
[$id, $optionName, $optionValue]
];
return $this;
} | php | public function subtractOption($id, $optionName, $optionValue)
{
$this->actions[self::GROUP_ADD][++$this->lastIndex] = [
self::SUBTRACT_OPTION,
__FUNCTION__,
[$id, $optionName, $optionValue]
];
return $this;
} | [
"public",
"function",
"subtractOption",
"(",
"$",
"id",
",",
"$",
"optionName",
",",
"$",
"optionValue",
")",
"{",
"$",
"this",
"->",
"actions",
"[",
"self",
"::",
"GROUP_ADD",
"]",
"[",
"++",
"$",
"this",
"->",
"lastIndex",
"]",
"=",
"[",
"self",
":... | {@inheritdoc} | [
"{"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/DeferredLayoutManipulator.php#L247-L256 |
oroinc/OroLayoutComponent | DeferredLayoutManipulator.php | DeferredLayoutManipulator.replaceOption | public function replaceOption($id, $optionName, $oldOptionValue, $newOptionValue)
{
$this->actions[self::GROUP_ADD][++$this->lastIndex] = [
self::REPLACE_OPTION,
__FUNCTION__,
[$id, $optionName, $oldOptionValue, $newOptionValue]
];
return $this;
} | php | public function replaceOption($id, $optionName, $oldOptionValue, $newOptionValue)
{
$this->actions[self::GROUP_ADD][++$this->lastIndex] = [
self::REPLACE_OPTION,
__FUNCTION__,
[$id, $optionName, $oldOptionValue, $newOptionValue]
];
return $this;
} | [
"public",
"function",
"replaceOption",
"(",
"$",
"id",
",",
"$",
"optionName",
",",
"$",
"oldOptionValue",
",",
"$",
"newOptionValue",
")",
"{",
"$",
"this",
"->",
"actions",
"[",
"self",
"::",
"GROUP_ADD",
"]",
"[",
"++",
"$",
"this",
"->",
"lastIndex",... | {@inheritdoc} | [
"{"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/DeferredLayoutManipulator.php#L261-L270 |
oroinc/OroLayoutComponent | DeferredLayoutManipulator.php | DeferredLayoutManipulator.removeOption | public function removeOption($id, $optionName)
{
$this->actions[self::GROUP_ADD][++$this->lastIndex] = [
self::REMOVE_OPTION,
__FUNCTION__,
[$id, $optionName]
];
return $this;
} | php | public function removeOption($id, $optionName)
{
$this->actions[self::GROUP_ADD][++$this->lastIndex] = [
self::REMOVE_OPTION,
__FUNCTION__,
[$id, $optionName]
];
return $this;
} | [
"public",
"function",
"removeOption",
"(",
"$",
"id",
",",
"$",
"optionName",
")",
"{",
"$",
"this",
"->",
"actions",
"[",
"self",
"::",
"GROUP_ADD",
"]",
"[",
"++",
"$",
"this",
"->",
"lastIndex",
"]",
"=",
"[",
"self",
"::",
"REMOVE_OPTION",
",",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/DeferredLayoutManipulator.php#L275-L284 |
oroinc/OroLayoutComponent | DeferredLayoutManipulator.php | DeferredLayoutManipulator.changeBlockType | public function changeBlockType($id, $blockType, $optionsCallback = null)
{
$this->actions[self::GROUP_ADD][++$this->lastIndex] = [
self::CHANGE_BLOCK_TYPE,
__FUNCTION__,
[$id, $blockType, $optionsCallback]
];
return $this;
} | php | public function changeBlockType($id, $blockType, $optionsCallback = null)
{
$this->actions[self::GROUP_ADD][++$this->lastIndex] = [
self::CHANGE_BLOCK_TYPE,
__FUNCTION__,
[$id, $blockType, $optionsCallback]
];
return $this;
} | [
"public",
"function",
"changeBlockType",
"(",
"$",
"id",
",",
"$",
"blockType",
",",
"$",
"optionsCallback",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"actions",
"[",
"self",
"::",
"GROUP_ADD",
"]",
"[",
"++",
"$",
"this",
"->",
"lastIndex",
"]",
"=",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/DeferredLayoutManipulator.php#L289-L298 |
oroinc/OroLayoutComponent | DeferredLayoutManipulator.php | DeferredLayoutManipulator.setBlockTheme | public function setBlockTheme($themes, $id = null)
{
$this->actions[self::GROUP_ADD][++$this->lastIndex] = [
self::SET_BLOCK_THEME,
__FUNCTION__,
[$themes, $id]
];
return $this;
} | php | public function setBlockTheme($themes, $id = null)
{
$this->actions[self::GROUP_ADD][++$this->lastIndex] = [
self::SET_BLOCK_THEME,
__FUNCTION__,
[$themes, $id]
];
return $this;
} | [
"public",
"function",
"setBlockTheme",
"(",
"$",
"themes",
",",
"$",
"id",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"actions",
"[",
"self",
"::",
"GROUP_ADD",
"]",
"[",
"++",
"$",
"this",
"->",
"lastIndex",
"]",
"=",
"[",
"self",
"::",
"SET_BLOCK_TH... | {@inheritdoc} | [
"{"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/DeferredLayoutManipulator.php#L303-L312 |
oroinc/OroLayoutComponent | DeferredLayoutManipulator.php | DeferredLayoutManipulator.setFormTheme | public function setFormTheme($themes)
{
$this->actions[self::GROUP_ADD][++$this->lastIndex] = [
self::SET_FORM_THEME,
__FUNCTION__,
[$themes]
];
return $this;
} | php | public function setFormTheme($themes)
{
$this->actions[self::GROUP_ADD][++$this->lastIndex] = [
self::SET_FORM_THEME,
__FUNCTION__,
[$themes]
];
return $this;
} | [
"public",
"function",
"setFormTheme",
"(",
"$",
"themes",
")",
"{",
"$",
"this",
"->",
"actions",
"[",
"self",
"::",
"GROUP_ADD",
"]",
"[",
"++",
"$",
"this",
"->",
"lastIndex",
"]",
"=",
"[",
"self",
"::",
"SET_FORM_THEME",
",",
"__FUNCTION__",
",",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/DeferredLayoutManipulator.php#L317-L326 |
oroinc/OroLayoutComponent | DeferredLayoutManipulator.php | DeferredLayoutManipulator.clear | public function clear()
{
$this->rawLayoutBuilder->clear();
$this->actions = [];
$this->lastIndex = 0;
$this->addCounter = 0;
$this->links = [];
return $this;
} | php | public function clear()
{
$this->rawLayoutBuilder->clear();
$this->actions = [];
$this->lastIndex = 0;
$this->addCounter = 0;
$this->links = [];
return $this;
} | [
"public",
"function",
"clear",
"(",
")",
"{",
"$",
"this",
"->",
"rawLayoutBuilder",
"->",
"clear",
"(",
")",
";",
"$",
"this",
"->",
"actions",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"lastIndex",
"=",
"0",
";",
"$",
"this",
"->",
"addCounter",
"="... | {@inheritdoc} | [
"{"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/DeferredLayoutManipulator.php#L331-L340 |
oroinc/OroLayoutComponent | DeferredLayoutManipulator.php | DeferredLayoutManipulator.applyChanges | public function applyChanges(ContextInterface $context, $finalize = false)
{
$this->addCounter = 0;
$this->item = new LayoutItem($this->rawLayoutBuilder, $context);
try {
$total = $this->calculateActionCount();
if ($total !== 0) {
$this->executeA... | php | public function applyChanges(ContextInterface $context, $finalize = false)
{
$this->addCounter = 0;
$this->item = new LayoutItem($this->rawLayoutBuilder, $context);
try {
$total = $this->calculateActionCount();
if ($total !== 0) {
$this->executeA... | [
"public",
"function",
"applyChanges",
"(",
"ContextInterface",
"$",
"context",
",",
"$",
"finalize",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"addCounter",
"=",
"0",
";",
"$",
"this",
"->",
"item",
"=",
"new",
"LayoutItem",
"(",
"$",
"this",
"->",
"r... | {@inheritdoc} | [
"{"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/DeferredLayoutManipulator.php#L353-L371 |
oroinc/OroLayoutComponent | DeferredLayoutManipulator.php | DeferredLayoutManipulator.calculateActionCount | protected function calculateActionCount()
{
$counter = 0;
foreach ($this->actions as $actions) {
$counter += count($actions);
}
return $counter;
} | php | protected function calculateActionCount()
{
$counter = 0;
foreach ($this->actions as $actions) {
$counter += count($actions);
}
return $counter;
} | [
"protected",
"function",
"calculateActionCount",
"(",
")",
"{",
"$",
"counter",
"=",
"0",
";",
"foreach",
"(",
"$",
"this",
"->",
"actions",
"as",
"$",
"actions",
")",
"{",
"$",
"counter",
"+=",
"count",
"(",
"$",
"actions",
")",
";",
"}",
"return",
... | Returns the total number of actions in all groups
@return int | [
"Returns",
"the",
"total",
"number",
"of",
"actions",
"in",
"all",
"groups"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/DeferredLayoutManipulator.php#L378-L386 |
oroinc/OroLayoutComponent | DeferredLayoutManipulator.php | DeferredLayoutManipulator.removeNotImportantRemainingActions | protected function removeNotImportantRemainingActions()
{
// remove remaining 'move' actions
if (!empty($this->actions[self::GROUP_ADD])) {
foreach ($this->actions[self::GROUP_ADD] as $index => $action) {
if ($action[0] === self::MOVE) {
unset($this->a... | php | protected function removeNotImportantRemainingActions()
{
// remove remaining 'move' actions
if (!empty($this->actions[self::GROUP_ADD])) {
foreach ($this->actions[self::GROUP_ADD] as $index => $action) {
if ($action[0] === self::MOVE) {
unset($this->a... | [
"protected",
"function",
"removeNotImportantRemainingActions",
"(",
")",
"{",
"// remove remaining 'move' actions",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"actions",
"[",
"self",
"::",
"GROUP_ADD",
"]",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->... | Checks if there are any not executed actions and remove actions which are not important | [
"Checks",
"if",
"there",
"are",
"any",
"not",
"executed",
"actions",
"and",
"remove",
"actions",
"which",
"are",
"not",
"important"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/DeferredLayoutManipulator.php#L405-L419 |
oroinc/OroLayoutComponent | DeferredLayoutManipulator.php | DeferredLayoutManipulator.executeAddActions | protected function executeAddActions()
{
if (!empty($this->actions[self::GROUP_ADD])) {
$this->executeDependedActions(self::GROUP_ADD);
}
} | php | protected function executeAddActions()
{
if (!empty($this->actions[self::GROUP_ADD])) {
$this->executeDependedActions(self::GROUP_ADD);
}
} | [
"protected",
"function",
"executeAddActions",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"actions",
"[",
"self",
"::",
"GROUP_ADD",
"]",
")",
")",
"{",
"$",
"this",
"->",
"executeDependedActions",
"(",
"self",
"::",
"GROUP_ADD",
")",... | Executes all add new items related actions like
* add
* move
* addAlias
* setOption
* appendOption
* subtractOption
* replaceOption
* removeOption
* changeBlockType | [
"Executes",
"all",
"add",
"new",
"items",
"related",
"actions",
"like",
"*",
"add",
"*",
"move",
"*",
"addAlias",
"*",
"setOption",
"*",
"appendOption",
"*",
"subtractOption",
"*",
"replaceOption",
"*",
"removeOption",
"*",
"changeBlockType"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/DeferredLayoutManipulator.php#L433-L438 |
oroinc/OroLayoutComponent | DeferredLayoutManipulator.php | DeferredLayoutManipulator.executeAdaptiveAddActions | protected function executeAdaptiveAddActions()
{
// Here are several special rules:
// 1) the siblingId argument in the 'add' action is "optional", this means that
// if it is not possible to add an item near to the sibling item due to it does not exist
// we should try to exec... | php | protected function executeAdaptiveAddActions()
{
// Here are several special rules:
// 1) the siblingId argument in the 'add' action is "optional", this means that
// if it is not possible to add an item near to the sibling item due to it does not exist
// we should try to exec... | [
"protected",
"function",
"executeAdaptiveAddActions",
"(",
")",
"{",
"// Here are several special rules:",
"// 1) the siblingId argument in the 'add' action is \"optional\", this means that",
"// if it is not possible to add an item near to the sibling item due to it does not exist",
"// we ... | Executes all add new items related actions which were skipped by {@see executeAddActions} method,
but may be executed after removing/modifying some arguments | [
"Executes",
"all",
"add",
"new",
"items",
"related",
"actions",
"which",
"were",
"skipped",
"by",
"{"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/DeferredLayoutManipulator.php#L444-L486 |
oroinc/OroLayoutComponent | DeferredLayoutManipulator.php | DeferredLayoutManipulator.executeRemoveActions | protected function executeRemoveActions()
{
if (!empty($this->actions[self::GROUP_REMOVE])) {
$this->executeActions(self::GROUP_REMOVE);
}
} | php | protected function executeRemoveActions()
{
if (!empty($this->actions[self::GROUP_REMOVE])) {
$this->executeActions(self::GROUP_REMOVE);
}
} | [
"protected",
"function",
"executeRemoveActions",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"actions",
"[",
"self",
"::",
"GROUP_REMOVE",
"]",
")",
")",
"{",
"$",
"this",
"->",
"executeActions",
"(",
"self",
"::",
"GROUP_REMOVE",
")"... | Executes all remove items related actions like
* remove
* removeAlias | [
"Executes",
"all",
"remove",
"items",
"related",
"actions",
"like",
"*",
"remove",
"*",
"removeAlias"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/DeferredLayoutManipulator.php#L493-L498 |
oroinc/OroLayoutComponent | DeferredLayoutManipulator.php | DeferredLayoutManipulator.isActionReadyToExecute | protected function isActionReadyToExecute($key, $args)
{
switch ($key) {
case self::ADD:
$parentId = $args[1];
$siblingId = $args[4];
return
!$parentId
|| (
$this->rawLayoutBuilder->... | php | protected function isActionReadyToExecute($key, $args)
{
switch ($key) {
case self::ADD:
$parentId = $args[1];
$siblingId = $args[4];
return
!$parentId
|| (
$this->rawLayoutBuilder->... | [
"protected",
"function",
"isActionReadyToExecute",
"(",
"$",
"key",
",",
"$",
"args",
")",
"{",
"switch",
"(",
"$",
"key",
")",
"{",
"case",
"self",
"::",
"ADD",
":",
"$",
"parentId",
"=",
"$",
"args",
"[",
"1",
"]",
";",
"$",
"siblingId",
"=",
"$"... | Checks whether an action is ready to execute
@param string $key The action key
@param array $args The action arguments
@return bool
@SuppressWarnings(PHPMD.CyclomaticComplexity) | [
"Checks",
"whether",
"an",
"action",
"is",
"ready",
"to",
"execute"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/DeferredLayoutManipulator.php#L510-L559 |
oroinc/OroLayoutComponent | DeferredLayoutManipulator.php | DeferredLayoutManipulator.executeActions | protected function executeActions($group)
{
$executedCount = 0;
reset($this->actions[$group]);
while (list($index, $action) = each($this->actions[$group])) {
if ($this->isActionReadyToExecute($action[0], $action[2])) {
$executedCount += $this->executeAction($index... | php | protected function executeActions($group)
{
$executedCount = 0;
reset($this->actions[$group]);
while (list($index, $action) = each($this->actions[$group])) {
if ($this->isActionReadyToExecute($action[0], $action[2])) {
$executedCount += $this->executeAction($index... | [
"protected",
"function",
"executeActions",
"(",
"$",
"group",
")",
"{",
"$",
"executedCount",
"=",
"0",
";",
"reset",
"(",
"$",
"this",
"->",
"actions",
"[",
"$",
"group",
"]",
")",
";",
"while",
"(",
"list",
"(",
"$",
"index",
",",
"$",
"action",
... | Executes actions from the given group
Use this method if the group does not contain depended each other actions
@param string $group
@return int The number of executed actions | [
"Executes",
"actions",
"from",
"the",
"given",
"group",
"Use",
"this",
"method",
"if",
"the",
"group",
"does",
"not",
"contain",
"depended",
"each",
"other",
"actions"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/DeferredLayoutManipulator.php#L569-L581 |
oroinc/OroLayoutComponent | DeferredLayoutManipulator.php | DeferredLayoutManipulator.executeDependedActions | protected function executeDependedActions($group)
{
$executedCount = 0;
$continue = true;
while ($continue) {
$continue = false;
$hasExecuted = false;
$hasSkipped = false;
reset($this->actions[$group]);
while (list($index, ... | php | protected function executeDependedActions($group)
{
$executedCount = 0;
$continue = true;
while ($continue) {
$continue = false;
$hasExecuted = false;
$hasSkipped = false;
reset($this->actions[$group]);
while (list($index, ... | [
"protected",
"function",
"executeDependedActions",
"(",
"$",
"group",
")",
"{",
"$",
"executedCount",
"=",
"0",
";",
"$",
"continue",
"=",
"true",
";",
"while",
"(",
"$",
"continue",
")",
"{",
"$",
"continue",
"=",
"false",
";",
"$",
"hasExecuted",
"=",
... | Executes depended actions from the given group
Use this method if the group can contain depended each other actions
This method guarantee that all actions are executed in the order they are registered
@param string $group
@return int The number of executed actions | [
"Executes",
"depended",
"actions",
"from",
"the",
"given",
"group",
"Use",
"this",
"method",
"if",
"the",
"group",
"can",
"contain",
"depended",
"each",
"other",
"actions",
"This",
"method",
"guarantee",
"that",
"all",
"actions",
"are",
"executed",
"in",
"the"... | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/DeferredLayoutManipulator.php#L592-L623 |
oroinc/OroLayoutComponent | DeferredLayoutManipulator.php | DeferredLayoutManipulator.executeAction | protected function executeAction($index, $action)
{
list($key, $name, $args) = $action;
$executedCount = $this->preExecuteAction($key, $index, $args);
call_user_func_array([$this->rawLayoutBuilder, $name], $args);
$executedCount++;
$executedCount += $this->postExecuteAction(... | php | protected function executeAction($index, $action)
{
list($key, $name, $args) = $action;
$executedCount = $this->preExecuteAction($key, $index, $args);
call_user_func_array([$this->rawLayoutBuilder, $name], $args);
$executedCount++;
$executedCount += $this->postExecuteAction(... | [
"protected",
"function",
"executeAction",
"(",
"$",
"index",
",",
"$",
"action",
")",
"{",
"list",
"(",
"$",
"key",
",",
"$",
"name",
",",
"$",
"args",
")",
"=",
"$",
"action",
";",
"$",
"executedCount",
"=",
"$",
"this",
"->",
"preExecuteAction",
"(... | @param int $index The action index
@param array $action The action to be executed
@return int The number of executed actions including the given action and all related actions | [
"@param",
"int",
"$index",
"The",
"action",
"index",
"@param",
"array",
"$action",
"The",
"action",
"to",
"be",
"executed"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/DeferredLayoutManipulator.php#L631-L641 |
oroinc/OroLayoutComponent | DeferredLayoutManipulator.php | DeferredLayoutManipulator.preExecuteAction | protected function preExecuteAction($key, $index, $args)
{
$executedCount = 0;
switch ($key) {
case self::ADD:
$id = $args[0];
if ($id && $this->rawLayoutBuilder->has($id)) {
$executedCount += $this->executeDependedRemoveAction($index, ... | php | protected function preExecuteAction($key, $index, $args)
{
$executedCount = 0;
switch ($key) {
case self::ADD:
$id = $args[0];
if ($id && $this->rawLayoutBuilder->has($id)) {
$executedCount += $this->executeDependedRemoveAction($index, ... | [
"protected",
"function",
"preExecuteAction",
"(",
"$",
"key",
",",
"$",
"index",
",",
"$",
"args",
")",
"{",
"$",
"executedCount",
"=",
"0",
";",
"switch",
"(",
"$",
"key",
")",
"{",
"case",
"self",
"::",
"ADD",
":",
"$",
"id",
"=",
"$",
"args",
... | @param int $key The action key
@param int $index The action index
@param array $args The action arguments
@return int The number of executed actions | [
"@param",
"int",
"$key",
"The",
"action",
"key",
"@param",
"int",
"$index",
"The",
"action",
"index",
"@param",
"array",
"$args",
"The",
"action",
"arguments"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/DeferredLayoutManipulator.php#L650-L663 |
oroinc/OroLayoutComponent | DeferredLayoutManipulator.php | DeferredLayoutManipulator.postExecuteAction | protected function postExecuteAction($key, $index, $args)
{
switch ($key) {
case self::ADD:
$this->addCounter++;
$this->item->initialize($args[0]);
$this->registry->updateLayout($args[0], $this, $this->item);
break;
case... | php | protected function postExecuteAction($key, $index, $args)
{
switch ($key) {
case self::ADD:
$this->addCounter++;
$this->item->initialize($args[0]);
$this->registry->updateLayout($args[0], $this, $this->item);
break;
case... | [
"protected",
"function",
"postExecuteAction",
"(",
"$",
"key",
",",
"$",
"index",
",",
"$",
"args",
")",
"{",
"switch",
"(",
"$",
"key",
")",
"{",
"case",
"self",
"::",
"ADD",
":",
"$",
"this",
"->",
"addCounter",
"++",
";",
"$",
"this",
"->",
"ite... | @param int $key The action key
@param int $index The action index
@param array $args The action arguments
@return int The number of executed actions | [
"@param",
"int",
"$key",
"The",
"action",
"key",
"@param",
"int",
"$index",
"The",
"action",
"index",
"@param",
"array",
"$args",
"The",
"action",
"arguments"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/DeferredLayoutManipulator.php#L672-L693 |
oroinc/OroLayoutComponent | DeferredLayoutManipulator.php | DeferredLayoutManipulator.executeDependedRemoveAction | protected function executeDependedRemoveAction($index, $id)
{
$executedCount = 0;
if (isset($this->links[self::REMOVE][$id])) {
$executedCount += $this->executeLinkedAction(self::GROUP_REMOVE, self::REMOVE, $index, $id);
}
if (0 === $executedCount) {
$aliases ... | php | protected function executeDependedRemoveAction($index, $id)
{
$executedCount = 0;
if (isset($this->links[self::REMOVE][$id])) {
$executedCount += $this->executeLinkedAction(self::GROUP_REMOVE, self::REMOVE, $index, $id);
}
if (0 === $executedCount) {
$aliases ... | [
"protected",
"function",
"executeDependedRemoveAction",
"(",
"$",
"index",
",",
"$",
"id",
")",
"{",
"$",
"executedCount",
"=",
"0",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"links",
"[",
"self",
"::",
"REMOVE",
"]",
"[",
"$",
"id",
"]",
")",... | @param int $index The action index
@param string $id The item id
@return int The number of executed actions | [
"@param",
"int",
"$index",
"The",
"action",
"index",
"@param",
"string",
"$id",
"The",
"item",
"id"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/DeferredLayoutManipulator.php#L701-L724 |
oroinc/OroLayoutComponent | DeferredLayoutManipulator.php | DeferredLayoutManipulator.executeLinkedAction | protected function executeLinkedAction($group, $key, $index, $id)
{
$executedCount = 0;
reset($this->links[$key][$id]);
while (isset($this->links[$key][$id]) && list($removeIndex) = each($this->links[$key][$id])) {
if ($removeIndex > $index) {
break;
}... | php | protected function executeLinkedAction($group, $key, $index, $id)
{
$executedCount = 0;
reset($this->links[$key][$id]);
while (isset($this->links[$key][$id]) && list($removeIndex) = each($this->links[$key][$id])) {
if ($removeIndex > $index) {
break;
}... | [
"protected",
"function",
"executeLinkedAction",
"(",
"$",
"group",
",",
"$",
"key",
",",
"$",
"index",
",",
"$",
"id",
")",
"{",
"$",
"executedCount",
"=",
"0",
";",
"reset",
"(",
"$",
"this",
"->",
"links",
"[",
"$",
"key",
"]",
"[",
"$",
"id",
... | @param string $group The action group
@param int $key The action key
@param int $index The action index
@param string $id The item id
@return int The number of executed actions | [
"@param",
"string",
"$group",
"The",
"action",
"group",
"@param",
"int",
"$key",
"The",
"action",
"key",
"@param",
"int",
"$index",
"The",
"action",
"index",
"@param",
"string",
"$id",
"The",
"item",
"id"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/DeferredLayoutManipulator.php#L734-L751 |
heidelpay/PhpDoc | src/phpDocumentor/Descriptor/Builder/Reflector/PropertyAssembler.php | PropertyAssembler.create | public function create($data)
{
$propertyDescriptor = new PropertyDescriptor();
$propertyDescriptor->setFullyQualifiedStructuralElementName($data->getName());
$propertyDescriptor->setName($data->getShortName());
$propertyDescriptor->setVisibility($data->getVisibility() ?: 'public');
... | php | public function create($data)
{
$propertyDescriptor = new PropertyDescriptor();
$propertyDescriptor->setFullyQualifiedStructuralElementName($data->getName());
$propertyDescriptor->setName($data->getShortName());
$propertyDescriptor->setVisibility($data->getVisibility() ?: 'public');
... | [
"public",
"function",
"create",
"(",
"$",
"data",
")",
"{",
"$",
"propertyDescriptor",
"=",
"new",
"PropertyDescriptor",
"(",
")",
";",
"$",
"propertyDescriptor",
"->",
"setFullyQualifiedStructuralElementName",
"(",
"$",
"data",
"->",
"getName",
"(",
")",
")",
... | Creates a Descriptor from the provided data.
@param PropertyReflector $data
@return PropertyDescriptor | [
"Creates",
"a",
"Descriptor",
"from",
"the",
"provided",
"data",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/Builder/Reflector/PropertyAssembler.php#L29-L42 |
spiral-modules/listing | source/Listing/Listing.php | Listing.setSelector | public function setSelector(PaginatorAwareInterface $selector)
{
$this->validateSelector($selector);
$this->selector = $selector;
return $this;
} | php | public function setSelector(PaginatorAwareInterface $selector)
{
$this->validateSelector($selector);
$this->selector = $selector;
return $this;
} | [
"public",
"function",
"setSelector",
"(",
"PaginatorAwareInterface",
"$",
"selector",
")",
"{",
"$",
"this",
"->",
"validateSelector",
"(",
"$",
"selector",
")",
";",
"$",
"this",
"->",
"selector",
"=",
"$",
"selector",
";",
"return",
"$",
"this",
";",
"}"... | Set active listing selector.
@param RecordSelector|DocumentSelector|PaginatorAwareInterface $selector
@return $this
@throws InvalidSelectorException | [
"Set",
"active",
"listing",
"selector",
"."
] | train | https://github.com/spiral-modules/listing/blob/89abe8939ce91cbf61b51b99e93ce1e57c8af83c/source/Listing/Listing.php#L93-L99 |
spiral-modules/listing | source/Listing/Listing.php | Listing.activeState | public function activeState()
{
if (!empty($this->state) && $this->state->isActive()) {
return $this->getState();
}
if (!empty($this->defaultState) && $this->defaultState->isActive()) {
//Falling back to default state
return $this->getDefaultState();
... | php | public function activeState()
{
if (!empty($this->state) && $this->state->isActive()) {
return $this->getState();
}
if (!empty($this->defaultState) && $this->defaultState->isActive()) {
//Falling back to default state
return $this->getDefaultState();
... | [
"public",
"function",
"activeState",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"state",
")",
"&&",
"$",
"this",
"->",
"state",
"->",
"isActive",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"getState",
"(",
")",
";",
"}"... | Active listing state (with fallback to default state)
@return StateInterface
@throws ListingException | [
"Active",
"listing",
"state",
"(",
"with",
"fallback",
"to",
"default",
"state",
")"
] | train | https://github.com/spiral-modules/listing/blob/89abe8939ce91cbf61b51b99e93ce1e57c8af83c/source/Listing/Listing.php#L179-L196 |
spiral-modules/listing | source/Listing/Listing.php | Listing.setLimits | public function setLimits(array $limits = [])
{
if (empty($limits)) {
throw new ListingException("You must provide at least one limit option");
}
$this->limits = array_values($limits);
return $this;
} | php | public function setLimits(array $limits = [])
{
if (empty($limits)) {
throw new ListingException("You must provide at least one limit option");
}
$this->limits = array_values($limits);
return $this;
} | [
"public",
"function",
"setLimits",
"(",
"array",
"$",
"limits",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"limits",
")",
")",
"{",
"throw",
"new",
"ListingException",
"(",
"\"You must provide at least one limit option\"",
")",
";",
"}",
"$",
"... | Set allowed pagination limits
@param array $limits
@return $this | [
"Set",
"allowed",
"pagination",
"limits"
] | train | https://github.com/spiral-modules/listing/blob/89abe8939ce91cbf61b51b99e93ce1e57c8af83c/source/Listing/Listing.php#L227-L236 |
spiral-modules/listing | source/Listing/Listing.php | Listing.configureSelector | public function configureSelector(PaginatorAwareInterface $selector)
{
if (empty($this->state)) {
throw new ListingException("Unable to pagination without state being set");
}
$this->validateSelector($selector);
foreach ($this->activeFilters() as $filter) {
... | php | public function configureSelector(PaginatorAwareInterface $selector)
{
if (empty($this->state)) {
throw new ListingException("Unable to pagination without state being set");
}
$this->validateSelector($selector);
foreach ($this->activeFilters() as $filter) {
... | [
"public",
"function",
"configureSelector",
"(",
"PaginatorAwareInterface",
"$",
"selector",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"state",
")",
")",
"{",
"throw",
"new",
"ListingException",
"(",
"\"Unable to pagination without state being set\"",
")"... | Modify selector
@param PaginatorAwareInterface|RecordSelector|DocumentSelector $selector
@return RecordSelector|DocumentSelector Modified selector
@throws InvalidSelectorException | [
"Modify",
"selector"
] | train | https://github.com/spiral-modules/listing/blob/89abe8939ce91cbf61b51b99e93ce1e57c8af83c/source/Listing/Listing.php#L257-L277 |
spiral-modules/listing | source/Listing/Listing.php | Listing.activeFilters | public function activeFilters()
{
$state = $this->activeState();
$result = [];
foreach ($state->activeFilters() as $name) {
if (!isset($this->filters[$name])) {
//No such filter
continue;
}
$filter = $this->filters[$name];... | php | public function activeFilters()
{
$state = $this->activeState();
$result = [];
foreach ($state->activeFilters() as $name) {
if (!isset($this->filters[$name])) {
//No such filter
continue;
}
$filter = $this->filters[$name];... | [
"public",
"function",
"activeFilters",
"(",
")",
"{",
"$",
"state",
"=",
"$",
"this",
"->",
"activeState",
"(",
")",
";",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"state",
"->",
"activeFilters",
"(",
")",
"as",
"$",
"name",
")",
"{",... | List of filters to be applied to current selection (named list)
@return FilterInterface[]
@throws ListingException | [
"List",
"of",
"filters",
"to",
"be",
"applied",
"to",
"current",
"selection",
"(",
"named",
"list",
")"
] | train | https://github.com/spiral-modules/listing/blob/89abe8939ce91cbf61b51b99e93ce1e57c8af83c/source/Listing/Listing.php#L336-L356 |
spiral-modules/listing | source/Listing/Listing.php | Listing.getSorter | public function getSorter()
{
$state = $this->activeState();
if (!isset($this->sorters[$state->activeSorter()])) {
//No such sorter
return null;
}
return $state->activeSorter();
} | php | public function getSorter()
{
$state = $this->activeState();
if (!isset($this->sorters[$state->activeSorter()])) {
//No such sorter
return null;
}
return $state->activeSorter();
} | [
"public",
"function",
"getSorter",
"(",
")",
"{",
"$",
"state",
"=",
"$",
"this",
"->",
"activeState",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"sorters",
"[",
"$",
"state",
"->",
"activeSorter",
"(",
")",
"]",
")",
")",
"{... | Looking for active sorter name (normalized).
@return string|null | [
"Looking",
"for",
"active",
"sorter",
"name",
"(",
"normalized",
")",
"."
] | train | https://github.com/spiral-modules/listing/blob/89abe8939ce91cbf61b51b99e93ce1e57c8af83c/source/Listing/Listing.php#L363-L373 |
spiral-modules/listing | source/Listing/Listing.php | Listing.activeSorter | public function activeSorter()
{
if (empty($sorter = $this->getSorter())) {
return null;
}
$sorter = $this->sorters[$sorter];
if ($sorter instanceof DirectionalSorterInterface) {
return $sorter->withDirection($this->activeState()->sortDirection());
}... | php | public function activeSorter()
{
if (empty($sorter = $this->getSorter())) {
return null;
}
$sorter = $this->sorters[$sorter];
if ($sorter instanceof DirectionalSorterInterface) {
return $sorter->withDirection($this->activeState()->sortDirection());
}... | [
"public",
"function",
"activeSorter",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"sorter",
"=",
"$",
"this",
"->",
"getSorter",
"(",
")",
")",
")",
"{",
"return",
"null",
";",
"}",
"$",
"sorter",
"=",
"$",
"this",
"->",
"sorters",
"[",
"$",
"so... | Active sorter instance (if any)
@return SorterInterface|null
@throws SorterException | [
"Active",
"sorter",
"instance",
"(",
"if",
"any",
")"
] | train | https://github.com/spiral-modules/listing/blob/89abe8939ce91cbf61b51b99e93ce1e57c8af83c/source/Listing/Listing.php#L382-L395 |
spiral-modules/listing | source/Listing/Listing.php | Listing.createPaginator | protected function createPaginator()
{
$paginator = new Paginator($this->getLimit());
$paginator = $paginator->withPage($this->getPage());
return $paginator;
} | php | protected function createPaginator()
{
$paginator = new Paginator($this->getLimit());
$paginator = $paginator->withPage($this->getPage());
return $paginator;
} | [
"protected",
"function",
"createPaginator",
"(",
")",
"{",
"$",
"paginator",
"=",
"new",
"Paginator",
"(",
"$",
"this",
"->",
"getLimit",
"(",
")",
")",
";",
"$",
"paginator",
"=",
"$",
"paginator",
"->",
"withPage",
"(",
"$",
"this",
"->",
"getPage",
... | Get paginator associated with current listing
@return Paginator | [
"Get",
"paginator",
"associated",
"with",
"current",
"listing"
] | train | https://github.com/spiral-modules/listing/blob/89abe8939ce91cbf61b51b99e93ce1e57c8af83c/source/Listing/Listing.php#L402-L408 |
spiral-modules/listing | source/Listing/Listing.php | Listing.getLimit | protected function getLimit()
{
$limit = $this->activeState()->getLimit();
if (!in_array($limit, $this->limits)) {
//We are using lowest limit by default
return $this->limits[0];
}
return $limit;
} | php | protected function getLimit()
{
$limit = $this->activeState()->getLimit();
if (!in_array($limit, $this->limits)) {
//We are using lowest limit by default
return $this->limits[0];
}
return $limit;
} | [
"protected",
"function",
"getLimit",
"(",
")",
"{",
"$",
"limit",
"=",
"$",
"this",
"->",
"activeState",
"(",
")",
"->",
"getLimit",
"(",
")",
";",
"if",
"(",
"!",
"in_array",
"(",
"$",
"limit",
",",
"$",
"this",
"->",
"limits",
")",
")",
"{",
"/... | Get active pagination limit
@return int | [
"Get",
"active",
"pagination",
"limit"
] | train | https://github.com/spiral-modules/listing/blob/89abe8939ce91cbf61b51b99e93ce1e57c8af83c/source/Listing/Listing.php#L415-L424 |
kouks/laravel-filters | src/Filters/Behavior/Searchable.php | Searchable.search | public function search($pattern = null)
{
if (! $pattern) {
return;
}
foreach ($this->searchable as $column) {
$this->resolveSearch($column, $pattern);
}
} | php | public function search($pattern = null)
{
if (! $pattern) {
return;
}
foreach ($this->searchable as $column) {
$this->resolveSearch($column, $pattern);
}
} | [
"public",
"function",
"search",
"(",
"$",
"pattern",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"pattern",
")",
"{",
"return",
";",
"}",
"foreach",
"(",
"$",
"this",
"->",
"searchable",
"as",
"$",
"column",
")",
"{",
"$",
"this",
"->",
"resolveSea... | Searches given columns.
@param string $pattern
@return void | [
"Searches",
"given",
"columns",
"."
] | train | https://github.com/kouks/laravel-filters/blob/c1a594fd40173dcbb454ea7ec59818a919fff6bd/src/Filters/Behavior/Searchable.php#L13-L22 |
kouks/laravel-filters | src/Filters/Behavior/Searchable.php | Searchable.resolveSearch | protected function resolveSearch($column, $key)
{
$this->resolve($column, $key, $this->getTableName(), function ($query, $pattern) {
$this->builder->orWhere($query, 'LIKE', "%{$pattern}%");
});
} | php | protected function resolveSearch($column, $key)
{
$this->resolve($column, $key, $this->getTableName(), function ($query, $pattern) {
$this->builder->orWhere($query, 'LIKE', "%{$pattern}%");
});
} | [
"protected",
"function",
"resolveSearch",
"(",
"$",
"column",
",",
"$",
"key",
")",
"{",
"$",
"this",
"->",
"resolve",
"(",
"$",
"column",
",",
"$",
"key",
",",
"$",
"this",
"->",
"getTableName",
"(",
")",
",",
"function",
"(",
"$",
"query",
",",
"... | Recursively build up the search query.
@param string $column
@param string $key
@return void | [
"Recursively",
"build",
"up",
"the",
"search",
"query",
"."
] | train | https://github.com/kouks/laravel-filters/blob/c1a594fd40173dcbb454ea7ec59818a919fff6bd/src/Filters/Behavior/Searchable.php#L31-L36 |
willhoffmann/domuserp-php | src/Resources/People/Data/PersonData.php | PersonData.address | public function address(array $address)
{
if (! isset($this->data->addresses)) {
$this->data->addresses = [];
}
return $this->data->addresses[] = (object) $address;
} | php | public function address(array $address)
{
if (! isset($this->data->addresses)) {
$this->data->addresses = [];
}
return $this->data->addresses[] = (object) $address;
} | [
"public",
"function",
"address",
"(",
"array",
"$",
"address",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"data",
"->",
"addresses",
")",
")",
"{",
"$",
"this",
"->",
"data",
"->",
"addresses",
"=",
"[",
"]",
";",
"}",
"return",
"... | Put a address on person data
@param array $address
@return object | [
"Put",
"a",
"address",
"on",
"person",
"data"
] | train | https://github.com/willhoffmann/domuserp-php/blob/44e77a4f02b0252bc26cae4c0e6b2b7d578f10a6/src/Resources/People/Data/PersonData.php#L15-L22 |
willhoffmann/domuserp-php | src/Resources/People/Data/PersonData.php | PersonData.contacts | public function contacts(array $contact)
{
if (! isset($this->data->contacts)) {
$this->data->contacts = [];
}
return $this->data->contacts[] = (object) $contact;
} | php | public function contacts(array $contact)
{
if (! isset($this->data->contacts)) {
$this->data->contacts = [];
}
return $this->data->contacts[] = (object) $contact;
} | [
"public",
"function",
"contacts",
"(",
"array",
"$",
"contact",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"data",
"->",
"contacts",
")",
")",
"{",
"$",
"this",
"->",
"data",
"->",
"contacts",
"=",
"[",
"]",
";",
"}",
"return",
"$... | Put a contact on person data
@param array $contact
@return object | [
"Put",
"a",
"contact",
"on",
"person",
"data"
] | train | https://github.com/willhoffmann/domuserp-php/blob/44e77a4f02b0252bc26cae4c0e6b2b7d578f10a6/src/Resources/People/Data/PersonData.php#L30-L37 |
willhoffmann/domuserp-php | src/Resources/People/Data/PersonData.php | PersonData.references | public function references(array $reference = null)
{
if (! isset($this->data->references)) {
$this->data->references = [];
}
return $this->data->contacts[] = (object) $reference;
} | php | public function references(array $reference = null)
{
if (! isset($this->data->references)) {
$this->data->references = [];
}
return $this->data->contacts[] = (object) $reference;
} | [
"public",
"function",
"references",
"(",
"array",
"$",
"reference",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"data",
"->",
"references",
")",
")",
"{",
"$",
"this",
"->",
"data",
"->",
"references",
"=",
"[",
"]",
";"... | Put a commercial reference on person data
@param array $reference
@return object | [
"Put",
"a",
"commercial",
"reference",
"on",
"person",
"data"
] | train | https://github.com/willhoffmann/domuserp-php/blob/44e77a4f02b0252bc26cae4c0e6b2b7d578f10a6/src/Resources/People/Data/PersonData.php#L45-L52 |
weew/http | src/Weew/Http/CookieParser.php | CookieParser.parse | public function parse($string) {
$cookie = $this->createCookie();
$cookie->setSecure(false);
$cookie->setHttpOnly(false);
$parts = explode(';', $string);
foreach ($parts as $part) {
$part = trim($part);
$this->parseFlags($cookie, $part);
$thi... | php | public function parse($string) {
$cookie = $this->createCookie();
$cookie->setSecure(false);
$cookie->setHttpOnly(false);
$parts = explode(';', $string);
foreach ($parts as $part) {
$part = trim($part);
$this->parseFlags($cookie, $part);
$thi... | [
"public",
"function",
"parse",
"(",
"$",
"string",
")",
"{",
"$",
"cookie",
"=",
"$",
"this",
"->",
"createCookie",
"(",
")",
";",
"$",
"cookie",
"->",
"setSecure",
"(",
"false",
")",
";",
"$",
"cookie",
"->",
"setHttpOnly",
"(",
"false",
")",
";",
... | @param $string
@return Cookie | [
"@param",
"$string"
] | train | https://github.com/weew/http/blob/fd34d3d5643ca01c8e0946e888224a8e8dcc3c0d/src/Weew/Http/CookieParser.php#L11-L25 |
weew/http | src/Weew/Http/CookieParser.php | CookieParser.parseKeyValuePair | protected function parseKeyValuePair($string) {
list($key, $value) = explode('=', $string);
$key = trim($key);
$value = trim($value);
return [$key, $value];
} | php | protected function parseKeyValuePair($string) {
list($key, $value) = explode('=', $string);
$key = trim($key);
$value = trim($value);
return [$key, $value];
} | [
"protected",
"function",
"parseKeyValuePair",
"(",
"$",
"string",
")",
"{",
"list",
"(",
"$",
"key",
",",
"$",
"value",
")",
"=",
"explode",
"(",
"'='",
",",
"$",
"string",
")",
";",
"$",
"key",
"=",
"trim",
"(",
"$",
"key",
")",
";",
"$",
"value... | @param $string
@return array | [
"@param",
"$string"
] | train | https://github.com/weew/http/blob/fd34d3d5643ca01c8e0946e888224a8e8dcc3c0d/src/Weew/Http/CookieParser.php#L66-L73 |
mothership-ec/composer | src/Composer/Repository/CompositeRepository.php | CompositeRepository.filterPackages | public function filterPackages($callback, $class = 'Composer\Package\Package')
{
foreach ($this->repositories as $repository) {
if (false === $repository->filterPackages($callback, $class)) {
return false;
}
}
return true;
} | php | public function filterPackages($callback, $class = 'Composer\Package\Package')
{
foreach ($this->repositories as $repository) {
if (false === $repository->filterPackages($callback, $class)) {
return false;
}
}
return true;
} | [
"public",
"function",
"filterPackages",
"(",
"$",
"callback",
",",
"$",
"class",
"=",
"'Composer\\Package\\Package'",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"repositories",
"as",
"$",
"repository",
")",
"{",
"if",
"(",
"false",
"===",
"$",
"repository"... | {@inheritDoc} | [
"{"
] | train | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/Repository/CompositeRepository.php#L114-L123 |
zicht/z | src/Zicht/Tool/Script/Node/Task/SetNode.php | SetNode.compile | public function compile(Buffer $buffer)
{
$name = explode('.', $this->name);
$phpName = Util::toPhp($name);
$buffer->write('$z->set(')->raw($phpName)->raw(', ');
$buffer->raw('$z->value(');
$this->nodes[0]->compile($buffer);
$buffer->raw('));')->eol();
} | php | public function compile(Buffer $buffer)
{
$name = explode('.', $this->name);
$phpName = Util::toPhp($name);
$buffer->write('$z->set(')->raw($phpName)->raw(', ');
$buffer->raw('$z->value(');
$this->nodes[0]->compile($buffer);
$buffer->raw('));')->eol();
} | [
"public",
"function",
"compile",
"(",
"Buffer",
"$",
"buffer",
")",
"{",
"$",
"name",
"=",
"explode",
"(",
"'.'",
",",
"$",
"this",
"->",
"name",
")",
";",
"$",
"phpName",
"=",
"Util",
"::",
"toPhp",
"(",
"$",
"name",
")",
";",
"$",
"buffer",
"->... | Compiles the arg node.
@param \Zicht\Tool\Script\Buffer $buffer
@return void | [
"Compiles",
"the",
"arg",
"node",
"."
] | train | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Script/Node/Task/SetNode.php#L40-L49 |
dave-redfern/laravel-doctrine-entity-audit | src/Collection/AuditedCollection.php | AuditedCollection.initialize | protected function initialize()
{
if (!$this->initialized) {
$params = [];
$sql = 'SELECT MAX(' . $this->configuration->getRevisionFieldName() . ') as rev, ';
$sql .= $this->configuration->getRevisionTypeFieldName() . ' AS revtype, ';
$sql .= implode(', ', $... | php | protected function initialize()
{
if (!$this->initialized) {
$params = [];
$sql = 'SELECT MAX(' . $this->configuration->getRevisionFieldName() . ') as rev, ';
$sql .= $this->configuration->getRevisionTypeFieldName() . ' AS revtype, ';
$sql .= implode(', ', $... | [
"protected",
"function",
"initialize",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"initialized",
")",
"{",
"$",
"params",
"=",
"[",
"]",
";",
"$",
"sql",
"=",
"'SELECT MAX('",
".",
"$",
"this",
"->",
"configuration",
"->",
"getRevisionFieldName",
... | Initialize the collection | [
"Initialize",
"the",
"collection"
] | train | https://github.com/dave-redfern/laravel-doctrine-entity-audit/blob/ab79e305fe512ceefbc14d585fefe0a40cf911ab/src/Collection/AuditedCollection.php#L467-L561 |
giftcards/Encryption | Form/DataTransformer/EncryptTransformer.php | EncryptTransformer.reverseTransform | public function reverseTransform($value)
{
if ($value == '') {
return null;
}
return $this->encryptor->encrypt($value, $this->profile);
} | php | public function reverseTransform($value)
{
if ($value == '') {
return null;
}
return $this->encryptor->encrypt($value, $this->profile);
} | [
"public",
"function",
"reverseTransform",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"==",
"''",
")",
"{",
"return",
"null",
";",
"}",
"return",
"$",
"this",
"->",
"encryptor",
"->",
"encrypt",
"(",
"$",
"value",
",",
"$",
"this",
"->",
... | Transforms a value from the transformed representation to its original
representation.
This method is called when {@link Form::submit()} is called to transform the requests tainted data
into an acceptable format for your data processing/model layer.
This method must be able to deal with empty values. Usually this wil... | [
"Transforms",
"a",
"value",
"from",
"the",
"transformed",
"representation",
"to",
"its",
"original",
"representation",
"."
] | train | https://github.com/giftcards/Encryption/blob/a48f92408538e2ffe1c8603f168d57803aad7100/Form/DataTransformer/EncryptTransformer.php#L93-L100 |
technote-space/wordpress-plugin-base | src/traits/controller/admin.php | Admin.action | public final function action() {
if ( $this->is_post() && $this->nonce_check() ) {
$this->post_action();
} else {
$this->get_action();
}
$this->common_action();
$this->do_action( 'controller_action', $this->is_post() );
} | php | public final function action() {
if ( $this->is_post() && $this->nonce_check() ) {
$this->post_action();
} else {
$this->get_action();
}
$this->common_action();
$this->do_action( 'controller_action', $this->is_post() );
} | [
"public",
"final",
"function",
"action",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"is_post",
"(",
")",
"&&",
"$",
"this",
"->",
"nonce_check",
"(",
")",
")",
"{",
"$",
"this",
"->",
"post_action",
"(",
")",
";",
"}",
"else",
"{",
"$",
"this",... | action | [
"action"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/traits/controller/admin.php#L86-L94 |
technote-space/wordpress-plugin-base | src/traits/controller/admin.php | Admin.get_help_tab_id | private function get_help_tab_id( $index ) {
$slug = $this->get_page_slug();
return $this->apply_filters( 'get_help_tab_id', $slug . '_help_' . $index, $slug, $index );
} | php | private function get_help_tab_id( $index ) {
$slug = $this->get_page_slug();
return $this->apply_filters( 'get_help_tab_id', $slug . '_help_' . $index, $slug, $index );
} | [
"private",
"function",
"get_help_tab_id",
"(",
"$",
"index",
")",
"{",
"$",
"slug",
"=",
"$",
"this",
"->",
"get_page_slug",
"(",
")",
";",
"return",
"$",
"this",
"->",
"apply_filters",
"(",
"'get_help_tab_id'",
",",
"$",
"slug",
".",
"'_help_'",
".",
"$... | @param int $index
@return string | [
"@param",
"int",
"$index"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/traits/controller/admin.php#L134-L138 |
technote-space/wordpress-plugin-base | src/traits/controller/admin.php | Admin.get_help_content | private function get_help_content( $slug ) {
if ( empty( $slug ) ) {
return '';
}
return $this->get_view( 'admin/help/' . $slug, $this->get_help_content_params(), false, false );
} | php | private function get_help_content( $slug ) {
if ( empty( $slug ) ) {
return '';
}
return $this->get_view( 'admin/help/' . $slug, $this->get_help_content_params(), false, false );
} | [
"private",
"function",
"get_help_content",
"(",
"$",
"slug",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"slug",
")",
")",
"{",
"return",
"''",
";",
"}",
"return",
"$",
"this",
"->",
"get_view",
"(",
"'admin/help/'",
".",
"$",
"slug",
",",
"$",
"this",
... | @param string $slug
@return string | [
"@param",
"string",
"$slug"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/traits/controller/admin.php#L145-L151 |
technote-space/wordpress-plugin-base | src/traits/controller/admin.php | Admin.get_sidebar_content | private function get_sidebar_content( $slug ) {
if ( empty( $slug ) ) {
return '';
}
return $this->get_view( 'admin/sidebar/' . $slug, $this->get_sidebar_content_params(), false, false );
} | php | private function get_sidebar_content( $slug ) {
if ( empty( $slug ) ) {
return '';
}
return $this->get_view( 'admin/sidebar/' . $slug, $this->get_sidebar_content_params(), false, false );
} | [
"private",
"function",
"get_sidebar_content",
"(",
"$",
"slug",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"slug",
")",
")",
"{",
"return",
"''",
";",
"}",
"return",
"$",
"this",
"->",
"get_view",
"(",
"'admin/sidebar/'",
".",
"$",
"slug",
",",
"$",
"th... | @param string $slug
@return string | [
"@param",
"string",
"$slug"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/traits/controller/admin.php#L165-L171 |
technote-space/wordpress-plugin-base | src/traits/controller/admin.php | Admin.setup_help | public function setup_help() {
$slug = $this->get_page_slug();
$contents = $this->apply_filters( 'get_help_contents', $this->get_help_contents(), $slug );
if ( ! empty( $contents ) && is_array( $contents ) ) {
/** @var \WP_Screen|null $current_screen */
$current_screen = get_current_screen();
if ( is... | php | public function setup_help() {
$slug = $this->get_page_slug();
$contents = $this->apply_filters( 'get_help_contents', $this->get_help_contents(), $slug );
if ( ! empty( $contents ) && is_array( $contents ) ) {
/** @var \WP_Screen|null $current_screen */
$current_screen = get_current_screen();
if ( is... | [
"public",
"function",
"setup_help",
"(",
")",
"{",
"$",
"slug",
"=",
"$",
"this",
"->",
"get_page_slug",
"(",
")",
";",
"$",
"contents",
"=",
"$",
"this",
"->",
"apply_filters",
"(",
"'get_help_contents'",
",",
"$",
"this",
"->",
"get_help_contents",
"(",
... | setup help | [
"setup",
"help"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/traits/controller/admin.php#L183-L222 |
gedex/php-janrain-api | lib/Janrain/Api/Capture/Access.php | Access.getAuthorizationCode | public function getAuthorizationCode(array $params)
{
if (isset($params['transaction_state'])) {
$params['transaction_state'] = json_encode($params['transaction_state']);
}
return $this->post('access/getAuthorizationCode', $params);
} | php | public function getAuthorizationCode(array $params)
{
if (isset($params['transaction_state'])) {
$params['transaction_state'] = json_encode($params['transaction_state']);
}
return $this->post('access/getAuthorizationCode', $params);
} | [
"public",
"function",
"getAuthorizationCode",
"(",
"array",
"$",
"params",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"params",
"[",
"'transaction_state'",
"]",
")",
")",
"{",
"$",
"params",
"[",
"'transaction_state'",
"]",
"=",
"json_encode",
"(",
"$",
"para... | Get an authorization code that can be exchanged for an `access_token` and
a `refresh_token`.
@param array $params
@link http://developers.janrain.com/documentation/api-methods/capture/access-codes-and-tokens/getauthorizationcode/ | [
"Get",
"an",
"authorization",
"code",
"that",
"can",
"be",
"exchanged",
"for",
"an",
"access_token",
"and",
"a",
"refresh_token",
"."
] | train | https://github.com/gedex/php-janrain-api/blob/6283f68454e0ad5211ac620f1d337df38cd49597/lib/Janrain/Api/Capture/Access.php#L29-L36 |
zicht/z | src/Zicht/Tool/Command/TaskCommand.php | TaskCommand.setApplication | public function setApplication(Application $application = null)
{
parent::setApplication($application);
if (!is_null($application)) {
try {
foreach($this->getContainer()->plugins as $plugin) {
if ($plugin instanceof PluginTaskListenerInterface) {
... | php | public function setApplication(Application $application = null)
{
parent::setApplication($application);
if (!is_null($application)) {
try {
foreach($this->getContainer()->plugins as $plugin) {
if ($plugin instanceof PluginTaskListenerInterface) {
... | [
"public",
"function",
"setApplication",
"(",
"Application",
"$",
"application",
"=",
"null",
")",
"{",
"parent",
"::",
"setApplication",
"(",
"$",
"application",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"application",
")",
")",
"{",
"try",
"{",
"fo... | Sets the application instance for this command.
@param Application $application An Application instance | [
"Sets",
"the",
"application",
"instance",
"for",
"this",
"command",
"."
] | train | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Command/TaskCommand.php#L79-L97 |
zicht/z | src/Zicht/Tool/Command/TaskCommand.php | TaskCommand.addResolvableOption | public function addResolvableOption($name, $shortcut = null, $mode = null, $help = null, $default = null)
{
$this->opts[] = $name;
return parent::addOption($name, $shortcut, $mode, $help, $default);
} | php | public function addResolvableOption($name, $shortcut = null, $mode = null, $help = null, $default = null)
{
$this->opts[] = $name;
return parent::addOption($name, $shortcut, $mode, $help, $default);
} | [
"public",
"function",
"addResolvableOption",
"(",
"$",
"name",
",",
"$",
"shortcut",
"=",
"null",
",",
"$",
"mode",
"=",
"null",
",",
"$",
"help",
"=",
"null",
",",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"opts",
"[",
"]",
"=",
... | will add the given option the opt stack so it will resolved for the z plugin.
@param string $name
@param null $shortcut
@param null $mode
@param null $help
@param null $default
@return $this | [
"will",
"add",
"the",
"given",
"option",
"the",
"opt",
"stack",
"so",
"it",
"will",
"resolved",
"for",
"the",
"z",
"plugin",
"."
] | train | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Command/TaskCommand.php#L126-L130 |
zicht/z | src/Zicht/Tool/Command/TaskCommand.php | TaskCommand.configure | protected function configure()
{
$this
->addOption('explain', '', InputOption::VALUE_NONE, 'Explains the commands that would be executed.')
->addOption('force', 'f', InputOption::VALUE_NONE, 'Force execution of otherwise skipped tasks.')
->addOption('plugin', '', InputOpt... | php | protected function configure()
{
$this
->addOption('explain', '', InputOption::VALUE_NONE, 'Explains the commands that would be executed.')
->addOption('force', 'f', InputOption::VALUE_NONE, 'Force execution of otherwise skipped tasks.')
->addOption('plugin', '', InputOpt... | [
"protected",
"function",
"configure",
"(",
")",
"{",
"$",
"this",
"->",
"addOption",
"(",
"'explain'",
",",
"''",
",",
"InputOption",
"::",
"VALUE_NONE",
",",
"'Explains the commands that would be executed.'",
")",
"->",
"addOption",
"(",
"'force'",
",",
"'f'",
... | Adds the default '--explain', '--force', '--plugin' and '--debug' options
@return void | [
"Adds",
"the",
"default",
"--",
"explain",
"--",
"force",
"--",
"plugin",
"and",
"--",
"debug",
"options"
] | train | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Command/TaskCommand.php#L196-L204 |
zicht/z | src/Zicht/Tool/Command/TaskCommand.php | TaskCommand.execute | protected function execute(InputInterface $input, Output\OutputInterface $output)
{
foreach ($this->getDefinition()->getArguments() as $arg) {
if ($arg->getName() === 'command') {
continue;
}
if ($input->getArgument($arg->getName())) {
$thi... | php | protected function execute(InputInterface $input, Output\OutputInterface $output)
{
foreach ($this->getDefinition()->getArguments() as $arg) {
if ($arg->getName() === 'command') {
continue;
}
if ($input->getArgument($arg->getName())) {
$thi... | [
"protected",
"function",
"execute",
"(",
"InputInterface",
"$",
"input",
",",
"Output",
"\\",
"OutputInterface",
"$",
"output",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getDefinition",
"(",
")",
"->",
"getArguments",
"(",
")",
"as",
"$",
"arg",
")",
... | Executes the specified task
@param \Symfony\Component\Console\Input\InputInterface $input
@param \Symfony\Component\Console\Output\OutputInterface $output
@return mixed | [
"Executes",
"the",
"specified",
"task"
] | train | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Command/TaskCommand.php#L214-L248 |
raideer/twitch-api | src/Resources/Chat.php | Chat.getEmoticonImages | public function getEmoticonImages($params = [])
{
$defaults = [
'emotesets' => null,
];
return $this->wrapper->request('GET', 'chat/emoticon_images', ['query' => $this->resolveOptions($params, $defaults)]);
} | php | public function getEmoticonImages($params = [])
{
$defaults = [
'emotesets' => null,
];
return $this->wrapper->request('GET', 'chat/emoticon_images', ['query' => $this->resolveOptions($params, $defaults)]);
} | [
"public",
"function",
"getEmoticonImages",
"(",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"defaults",
"=",
"[",
"'emotesets'",
"=>",
"null",
",",
"]",
";",
"return",
"$",
"this",
"->",
"wrapper",
"->",
"request",
"(",
"'GET'",
",",
"'chat/emoticon_ima... | Returns a list of emoticons.
Learn more:
https://github.com/justintv/Twitch-API/blob/master/v3_resources/chat.md#get-chatemoticon_images
@param array $params Optional parameters
@return array | [
"Returns",
"a",
"list",
"of",
"emoticons",
"."
] | train | https://github.com/raideer/twitch-api/blob/27ebf1dcb0315206300d507600b6a82ebe33d57e/src/Resources/Chat.php#L58-L65 |
Erdiko/core | src/datasource/File.php | File.createDir | private function createDir($path)
{
if (!is_dir($path)) {
$success = mkdir($path, 0775, true);
if (!$success) {
throw new \Exception("Cannot create folder {$path}. Check file system permissions.");
}
}
} | php | private function createDir($path)
{
if (!is_dir($path)) {
$success = mkdir($path, 0775, true);
if (!$success) {
throw new \Exception("Cannot create folder {$path}. Check file system permissions.");
}
}
} | [
"private",
"function",
"createDir",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"path",
")",
")",
"{",
"$",
"success",
"=",
"mkdir",
"(",
"$",
"path",
",",
"0775",
",",
"true",
")",
";",
"if",
"(",
"!",
"$",
"success",
")",
... | Create Directory
If path doesn't exist, create it | [
"Create",
"Directory",
"If",
"path",
"doesn",
"t",
"exist",
"create",
"it"
] | train | https://github.com/Erdiko/core/blob/c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6/src/datasource/File.php#L43-L51 |
Erdiko/core | src/datasource/File.php | File.write | public function write($content, $filename, $pathToFile = null, $mode = "w")
{
if ($pathToFile == null) {
$pathToFile = $this->_filePath;
}
$this->createDir($pathToFile);
$fileHandle = fopen($pathToFile."/".$filename, $mode);
$success = fwrite($fileHandle, $conte... | php | public function write($content, $filename, $pathToFile = null, $mode = "w")
{
if ($pathToFile == null) {
$pathToFile = $this->_filePath;
}
$this->createDir($pathToFile);
$fileHandle = fopen($pathToFile."/".$filename, $mode);
$success = fwrite($fileHandle, $conte... | [
"public",
"function",
"write",
"(",
"$",
"content",
",",
"$",
"filename",
",",
"$",
"pathToFile",
"=",
"null",
",",
"$",
"mode",
"=",
"\"w\"",
")",
"{",
"if",
"(",
"$",
"pathToFile",
"==",
"null",
")",
"{",
"$",
"pathToFile",
"=",
"$",
"this",
"->"... | Write string to file
@param string $content
@param string $filename
@param string $pathToFile
@param string $mode - Default mode: w
@return int - bytes written to file | [
"Write",
"string",
"to",
"file"
] | train | https://github.com/Erdiko/core/blob/c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6/src/datasource/File.php#L62-L75 |
Erdiko/core | src/datasource/File.php | File.read | public function read($filename, $pathToFile = null)
{
if(!$this->fileExists($filename, $pathToFile))
throw new \Exception("File, '{$filename}', does not exist.");
if ($pathToFile==null) {
return file_get_contents($this->_filePath."/".$filename);
} else {
... | php | public function read($filename, $pathToFile = null)
{
if(!$this->fileExists($filename, $pathToFile))
throw new \Exception("File, '{$filename}', does not exist.");
if ($pathToFile==null) {
return file_get_contents($this->_filePath."/".$filename);
} else {
... | [
"public",
"function",
"read",
"(",
"$",
"filename",
",",
"$",
"pathToFile",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"fileExists",
"(",
"$",
"filename",
",",
"$",
"pathToFile",
")",
")",
"throw",
"new",
"\\",
"Exception",
"(",
"\"Fil... | Read string to file
@param string $filename
@param string $pathToFile
@return string | [
"Read",
"string",
"to",
"file"
] | train | https://github.com/Erdiko/core/blob/c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6/src/datasource/File.php#L84-L94 |
Erdiko/core | src/datasource/File.php | File.delete | public function delete($filename, $pathToFile = null)
{
if ($pathToFile==null) {
$pathToFile=$this->_filePath;
}
if (file_exists($pathToFile."/".$filename)) {
return unlink($pathToFile."/".$filename);
} else {
return false;
}
} | php | public function delete($filename, $pathToFile = null)
{
if ($pathToFile==null) {
$pathToFile=$this->_filePath;
}
if (file_exists($pathToFile."/".$filename)) {
return unlink($pathToFile."/".$filename);
} else {
return false;
}
} | [
"public",
"function",
"delete",
"(",
"$",
"filename",
",",
"$",
"pathToFile",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"pathToFile",
"==",
"null",
")",
"{",
"$",
"pathToFile",
"=",
"$",
"this",
"->",
"_filePath",
";",
"}",
"if",
"(",
"file_exists",
"("... | Delete a file
@param string $filename
@param string $pathToFile
@return bool | [
"Delete",
"a",
"file"
] | train | https://github.com/Erdiko/core/blob/c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6/src/datasource/File.php#L103-L113 |
Erdiko/core | src/datasource/File.php | File.move | public function move($filename, $pathTo, $pathFrom = null)
{
if ($pathFrom==null) {
$pathFrom=$this->_filePath;
}
if (file_exists($pathFrom."/".$filename)) {
$this->createDir($pathTo);
return rename($pathFrom."/".$filename, $pathTo."/".$filename);
... | php | public function move($filename, $pathTo, $pathFrom = null)
{
if ($pathFrom==null) {
$pathFrom=$this->_filePath;
}
if (file_exists($pathFrom."/".$filename)) {
$this->createDir($pathTo);
return rename($pathFrom."/".$filename, $pathTo."/".$filename);
... | [
"public",
"function",
"move",
"(",
"$",
"filename",
",",
"$",
"pathTo",
",",
"$",
"pathFrom",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"pathFrom",
"==",
"null",
")",
"{",
"$",
"pathFrom",
"=",
"$",
"this",
"->",
"_filePath",
";",
"}",
"if",
"(",
"f... | Move a file
@param string $filename
@param string $pathTo
@param string $pathToFrom
@return bool | [
"Move",
"a",
"file"
] | train | https://github.com/Erdiko/core/blob/c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6/src/datasource/File.php#L123-L134 |
Erdiko/core | src/datasource/File.php | File.rename | public function rename($oldName, $newName, $pathToFile = null)
{
if ($pathToFile==null) {
$pathToFile=$this->_filePath;
}
if (file_exists($pathToFile."/".$oldName)) {
$this->createDir($pathToFile);
return rename($pathToFile."/".$oldName, $pathToFile."/".$n... | php | public function rename($oldName, $newName, $pathToFile = null)
{
if ($pathToFile==null) {
$pathToFile=$this->_filePath;
}
if (file_exists($pathToFile."/".$oldName)) {
$this->createDir($pathToFile);
return rename($pathToFile."/".$oldName, $pathToFile."/".$n... | [
"public",
"function",
"rename",
"(",
"$",
"oldName",
",",
"$",
"newName",
",",
"$",
"pathToFile",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"pathToFile",
"==",
"null",
")",
"{",
"$",
"pathToFile",
"=",
"$",
"this",
"->",
"_filePath",
";",
"}",
"if",
"... | Rename a file
@param string $oldName
@param string $pathTo
@param string $pathToFrom
@return bool
@todo consider merging rename() and move() into one method | [
"Rename",
"a",
"file"
] | train | https://github.com/Erdiko/core/blob/c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6/src/datasource/File.php#L145-L156 |
Erdiko/core | src/datasource/File.php | File.copy | public function copy($filename, $newFilePath, $newFileName = null, $pathToFile = null)
{
if ($pathToFile==null) {
$pathToFile=$this->_filePath;
}
if ($newFileName==null) {
$newFileName=$filename;
}
if (file_exists($pathToFile."/".$filename)) {
... | php | public function copy($filename, $newFilePath, $newFileName = null, $pathToFile = null)
{
if ($pathToFile==null) {
$pathToFile=$this->_filePath;
}
if ($newFileName==null) {
$newFileName=$filename;
}
if (file_exists($pathToFile."/".$filename)) {
... | [
"public",
"function",
"copy",
"(",
"$",
"filename",
",",
"$",
"newFilePath",
",",
"$",
"newFileName",
"=",
"null",
",",
"$",
"pathToFile",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"pathToFile",
"==",
"null",
")",
"{",
"$",
"pathToFile",
"=",
"$",
"this... | Copy a file
@param string $filename
@param string $newFilePath
@param string $newFileName
@param string $pathToFile
@return bool | [
"Copy",
"a",
"file"
] | train | https://github.com/Erdiko/core/blob/c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6/src/datasource/File.php#L167-L180 |
Erdiko/core | src/datasource/File.php | File.fileExists | public function fileExists($filename, $pathToFile = null)
{
if ($pathToFile==null) {
$pathToFile=$this->_filePath;
}
return file_exists($pathToFile."/".$filename);
} | php | public function fileExists($filename, $pathToFile = null)
{
if ($pathToFile==null) {
$pathToFile=$this->_filePath;
}
return file_exists($pathToFile."/".$filename);
} | [
"public",
"function",
"fileExists",
"(",
"$",
"filename",
",",
"$",
"pathToFile",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"pathToFile",
"==",
"null",
")",
"{",
"$",
"pathToFile",
"=",
"$",
"this",
"->",
"_filePath",
";",
"}",
"return",
"file_exists",
"(... | Check if a file exists
@param string $filename
@param string $pathToFile
@return bool | [
"Check",
"if",
"a",
"file",
"exists"
] | train | https://github.com/Erdiko/core/blob/c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6/src/datasource/File.php#L189-L195 |
php-lug/lug | src/Component/Translation/Repository/Doctrine/MongoDB/TranslatableRepository.php | TranslatableRepository.getProperty | public function getProperty($property, $root = null)
{
if ($this->cache === null) {
$translationMetadata = $this
->getDocumentManager()
->getClassMetadata($this->getClassMetadata()->getAssociationTargetClass($this->getTranslationAlias()));
$this->cach... | php | public function getProperty($property, $root = null)
{
if ($this->cache === null) {
$translationMetadata = $this
->getDocumentManager()
->getClassMetadata($this->getClassMetadata()->getAssociationTargetClass($this->getTranslationAlias()));
$this->cach... | [
"public",
"function",
"getProperty",
"(",
"$",
"property",
",",
"$",
"root",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"cache",
"===",
"null",
")",
"{",
"$",
"translationMetadata",
"=",
"$",
"this",
"->",
"getDocumentManager",
"(",
")",
"->"... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Translation/Repository/Doctrine/MongoDB/TranslatableRepository.php#L66-L84 |
php-lug/lug | src/Component/Translation/Repository/Doctrine/MongoDB/TranslatableRepository.php | TranslatableRepository.getProperties | private function getProperties(ClassMetadata $metadata)
{
return array_merge(
$metadata->getFieldNames(),
array_map(function (array $mapping) {
return $mapping['fieldName'];
}, $metadata->getEmbeddedFieldsMappings())
);
} | php | private function getProperties(ClassMetadata $metadata)
{
return array_merge(
$metadata->getFieldNames(),
array_map(function (array $mapping) {
return $mapping['fieldName'];
}, $metadata->getEmbeddedFieldsMappings())
);
} | [
"private",
"function",
"getProperties",
"(",
"ClassMetadata",
"$",
"metadata",
")",
"{",
"return",
"array_merge",
"(",
"$",
"metadata",
"->",
"getFieldNames",
"(",
")",
",",
"array_map",
"(",
"function",
"(",
"array",
"$",
"mapping",
")",
"{",
"return",
"$",... | @param ClassMetadata $metadata
@return string[] | [
"@param",
"ClassMetadata",
"$metadata"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Translation/Repository/Doctrine/MongoDB/TranslatableRepository.php#L99-L107 |
zicht/z | src/Zicht/Tool/Script/Buffer.php | Buffer.indent | public function indent($increment = null)
{
if (null !== $increment) {
$this->indent += $increment;
if ($this->indent < 0) {
throw new \InvalidArgumentException("Indent can not reach below zero!");
}
} else {
$this->raw(str_repeat(' ... | php | public function indent($increment = null)
{
if (null !== $increment) {
$this->indent += $increment;
if ($this->indent < 0) {
throw new \InvalidArgumentException("Indent can not reach below zero!");
}
} else {
$this->raw(str_repeat(' ... | [
"public",
"function",
"indent",
"(",
"$",
"increment",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"increment",
")",
"{",
"$",
"this",
"->",
"indent",
"+=",
"$",
"increment",
";",
"if",
"(",
"$",
"this",
"->",
"indent",
"<",
"0",
")",
"... | Adds indentation to the buffer if $increment is not specified. Otherwise increment the current indentation
$increment steps. You should pass a negative number to outdent.
@param int $increment
@return Buffer | [
"Adds",
"indentation",
"to",
"the",
"buffer",
"if",
"$increment",
"is",
"not",
"specified",
".",
"Otherwise",
"increment",
"the",
"current",
"indentation",
"$increment",
"steps",
".",
"You",
"should",
"pass",
"a",
"negative",
"number",
"to",
"outdent",
"."
] | train | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Script/Buffer.php#L89-L100 |
Eresus/EresusCMS | src/core/Template.php | Eresus_Template.loadFromFile | public static function loadFromFile($filename)
{
$path = $filename;
/* Если это относительный путь, добавляем папку шаблонов */
if (!preg_match('#^(/|\w{1,10}://|[A-Z]:\\\)#', $filename))
{
$templateDir = Eresus_Kernel::app()->getFsRoot();
$path = $templateDir... | php | public static function loadFromFile($filename)
{
$path = $filename;
/* Если это относительный путь, добавляем папку шаблонов */
if (!preg_match('#^(/|\w{1,10}://|[A-Z]:\\\)#', $filename))
{
$templateDir = Eresus_Kernel::app()->getFsRoot();
$path = $templateDir... | [
"public",
"static",
"function",
"loadFromFile",
"(",
"$",
"filename",
")",
"{",
"$",
"path",
"=",
"$",
"filename",
";",
"/* Если это относительный путь, добавляем папку шаблонов */",
"if",
"(",
"!",
"preg_match",
"(",
"'#^(/|\\w{1,10}://|[A-Z]:\\\\\\)#'",
",",
"$",
"f... | Загружает шаблон из файла
Если $filename — относительный путь, то он будет расценен как путь относительно корня сайта.
@param string $filename имя файла шаблона
@return Eresus_Template
@since 3.01 | [
"Загружает",
"шаблон",
"из",
"файла"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Template.php#L62-L74 |
Eresus/EresusCMS | src/core/Template.php | Eresus_Template.loadFile | public function loadFile($filename)
{
$templateDir = Eresus_Kernel::app()->getFsRoot();
$template = $templateDir . '/' . $filename;
$this->template = new TemplateFile($template, null, $filename, $filename);
} | php | public function loadFile($filename)
{
$templateDir = Eresus_Kernel::app()->getFsRoot();
$template = $templateDir . '/' . $filename;
$this->template = new TemplateFile($template, null, $filename, $filename);
} | [
"public",
"function",
"loadFile",
"(",
"$",
"filename",
")",
"{",
"$",
"templateDir",
"=",
"Eresus_Kernel",
"::",
"app",
"(",
")",
"->",
"getFsRoot",
"(",
")",
";",
"$",
"template",
"=",
"$",
"templateDir",
".",
"'/'",
".",
"$",
"filename",
";",
"$",
... | Загружает шаблон из файла
@param string $filename имя файла шаблона | [
"Загружает",
"шаблон",
"из",
"файла"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Template.php#L130-L135 |
Eresus/EresusCMS | src/core/Template.php | Eresus_Template.compile | public function compile($data = null)
{
if ($data)
{
$data = array_merge($data, TemplateSettings::getGlobalValues());
}
else
{
$data = TemplateSettings::getGlobalValues();
}
return self::$dwoo->get($this->template, $data);
} | php | public function compile($data = null)
{
if ($data)
{
$data = array_merge($data, TemplateSettings::getGlobalValues());
}
else
{
$data = TemplateSettings::getGlobalValues();
}
return self::$dwoo->get($this->template, $data);
} | [
"public",
"function",
"compile",
"(",
"$",
"data",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"data",
")",
"{",
"$",
"data",
"=",
"array_merge",
"(",
"$",
"data",
",",
"TemplateSettings",
"::",
"getGlobalValues",
"(",
")",
")",
";",
"}",
"else",
"{",
"... | Компилирует шаблон
@param array $data данные для подстановки в шаблон
@return string | [
"Компилирует",
"шаблон"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Template.php#L144-L156 |
caffeinated/beverage | src/Traits/MultiSingleton.php | MultiSingleton.getInstance | public static function getInstance($name = 'default')
{
if (isset(static::$instances[$name])) {
return static::$instances[$name];
}
$instance = new static();
static::$instances[$name] = $instance;
return $instance;
} | php | public static function getInstance($name = 'default')
{
if (isset(static::$instances[$name])) {
return static::$instances[$name];
}
$instance = new static();
static::$instances[$name] = $instance;
return $instance;
} | [
"public",
"static",
"function",
"getInstance",
"(",
"$",
"name",
"=",
"'default'",
")",
"{",
"if",
"(",
"isset",
"(",
"static",
"::",
"$",
"instances",
"[",
"$",
"name",
"]",
")",
")",
"{",
"return",
"static",
"::",
"$",
"instances",
"[",
"$",
"name"... | Get the current instance.
@param string $name
@return static | [
"Get",
"the",
"current",
"instance",
"."
] | train | https://github.com/caffeinated/beverage/blob/c7d612a1d3bc1baddc97fec60ab17224550efaf3/src/Traits/MultiSingleton.php#L49-L60 |
PeeHaa/AsyncTwitter | src/Api/Request/Search/Search.php | Search.geocode | public function geocode(string $latitude, string $longitude, string $radius): Search
{
$this->parameters['geocode'] = sprintf('%s %s %s', $latitude, $longitude, $radius);
return $this;
} | php | public function geocode(string $latitude, string $longitude, string $radius): Search
{
$this->parameters['geocode'] = sprintf('%s %s %s', $latitude, $longitude, $radius);
return $this;
} | [
"public",
"function",
"geocode",
"(",
"string",
"$",
"latitude",
",",
"string",
"$",
"longitude",
",",
"string",
"$",
"radius",
")",
":",
"Search",
"{",
"$",
"this",
"->",
"parameters",
"[",
"'geocode'",
"]",
"=",
"sprintf",
"(",
"'%s %s %s'",
",",
"$",
... | use string instead of float | [
"use",
"string",
"instead",
"of",
"float"
] | train | https://github.com/PeeHaa/AsyncTwitter/blob/a968909e7ed470bd87a0f25ef0c494338273c29c/src/Api/Request/Search/Search.php#L25-L30 |
inhere/php-librarys | src/Helpers/DataHelper.php | DataHelper.toArray | public static function toArray($data, $recursive = false)
{
// Ensure the input data is an array.
if (\is_object($data)) {
if ($data instanceof \Traversable) {
$data = iterator_to_array($data);
} elseif (method_exists($data, 'toArray')) {
$data... | php | public static function toArray($data, $recursive = false)
{
// Ensure the input data is an array.
if (\is_object($data)) {
if ($data instanceof \Traversable) {
$data = iterator_to_array($data);
} elseif (method_exists($data, 'toArray')) {
$data... | [
"public",
"static",
"function",
"toArray",
"(",
"$",
"data",
",",
"$",
"recursive",
"=",
"false",
")",
"{",
"// Ensure the input data is an array.",
"if",
"(",
"\\",
"is_object",
"(",
"$",
"data",
")",
")",
"{",
"if",
"(",
"$",
"data",
"instanceof",
"\\",
... | php对象转换成为数组
@param iterable|array|\Traversable $data
@param bool $recursive
@return array|bool | [
"php对象转换成为数组"
] | train | https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Helpers/DataHelper.php#L45-L67 |
inhere/php-librarys | src/Helpers/DataHelper.php | DataHelper.toObject | public static function toObject($array, $class = \stdClass::class)
{
$object = new $class;
foreach ($array as $name => $value) {
$name = trim($name);
if (!$name || is_numeric($name)) {
continue;
}
$object->$name = \is_array($value) ?... | php | public static function toObject($array, $class = \stdClass::class)
{
$object = new $class;
foreach ($array as $name => $value) {
$name = trim($name);
if (!$name || is_numeric($name)) {
continue;
}
$object->$name = \is_array($value) ?... | [
"public",
"static",
"function",
"toObject",
"(",
"$",
"array",
",",
"$",
"class",
"=",
"\\",
"stdClass",
"::",
"class",
")",
"{",
"$",
"object",
"=",
"new",
"$",
"class",
";",
"foreach",
"(",
"$",
"array",
"as",
"$",
"name",
"=>",
"$",
"value",
")"... | data to array
@param array|\Traversable $array
@param string $class
@return mixed | [
"data",
"to",
"array"
] | train | https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Helpers/DataHelper.php#L75-L90 |
inhere/php-librarys | src/Helpers/DataHelper.php | DataHelper.safeOutput | public static function safeOutput($string, $clearTag = false)
{
if (!$clearTag) {
$string = strip_tags($string);
}
return @self::htmlentitiesUTF8($string);
} | php | public static function safeOutput($string, $clearTag = false)
{
if (!$clearTag) {
$string = strip_tags($string);
}
return @self::htmlentitiesUTF8($string);
} | [
"public",
"static",
"function",
"safeOutput",
"(",
"$",
"string",
",",
"$",
"clearTag",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"clearTag",
")",
"{",
"$",
"string",
"=",
"strip_tags",
"(",
"$",
"string",
")",
";",
"}",
"return",
"@",
"self",
"... | Sanitize a string
@param string $string String to sanitize
@param bool $clearTag clear html tag
@return string Sanitized string | [
"Sanitize",
"a",
"string"
] | train | https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Helpers/DataHelper.php#L98-L105 |
inhere/php-librarys | src/Helpers/DataHelper.php | DataHelper.stripTags | public static function stripTags($data, $allow_tags = null)
{
if (\is_array($data)) {
foreach ($data as $k => $v) {
$data[$k] = self::stripTags($v, $allow_tags);
}
return $data;
}
if (\is_string($data) || is_numeric($data)) {
... | php | public static function stripTags($data, $allow_tags = null)
{
if (\is_array($data)) {
foreach ($data as $k => $v) {
$data[$k] = self::stripTags($v, $allow_tags);
}
return $data;
}
if (\is_string($data) || is_numeric($data)) {
... | [
"public",
"static",
"function",
"stripTags",
"(",
"$",
"data",
",",
"$",
"allow_tags",
"=",
"null",
")",
"{",
"if",
"(",
"\\",
"is_array",
"(",
"$",
"data",
")",
")",
"{",
"foreach",
"(",
"$",
"data",
"as",
"$",
"k",
"=>",
"$",
"v",
")",
"{",
"... | /*
strip_tags — 从字符串中去除 HTML 和 PHP 标记
由于 strip_tags() 无法实际验证 HTML,不完整或者破损标签将导致更多的数据被删除。
$allow_tags 允许的标记,多个以空格隔开 | [
"/",
"*",
"strip_tags",
"—",
"从字符串中去除",
"HTML",
"和",
"PHP",
"标记",
"由于",
"strip_tags",
"()",
"无法实际验证",
"HTML,不完整或者破损标签将导致更多的数据被删除。",
"$allow_tags",
"允许的标记",
"多个以空格隔开"
] | train | https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Helpers/DataHelper.php#L182-L197 |
inhere/php-librarys | src/Helpers/DataHelper.php | DataHelper.slashes | public static function slashes($data, $escape = 1, $level = 0)
{
if (\is_array($data)) {
foreach ((array)$data as $key => $value) {
$data[$key] = self::slashes($value, $escape, $level);
}
return $data;
}
$data = trim($data);
if (... | php | public static function slashes($data, $escape = 1, $level = 0)
{
if (\is_array($data)) {
foreach ((array)$data as $key => $value) {
$data[$key] = self::slashes($value, $escape, $level);
}
return $data;
}
$data = trim($data);
if (... | [
"public",
"static",
"function",
"slashes",
"(",
"$",
"data",
",",
"$",
"escape",
"=",
"1",
",",
"$",
"level",
"=",
"0",
")",
"{",
"if",
"(",
"\\",
"is_array",
"(",
"$",
"data",
")",
")",
"{",
"foreach",
"(",
"(",
"array",
")",
"$",
"data",
"as"... | 对数组或字符串进行加斜杠\转义处理 去除转义
去除转义返回一个去除反斜线后的字符串(\' 转换为 ' 等等)。双反斜线(\\)被转换为单个反斜线(\)。
@param array|string $data 数据可以是字符串或数组
@param int $escape 进行转义 true 转义处理 false 去除转义
@param int $level 增强
@return array|string | [
"对数组或字符串进行加斜杠",
"\\",
"转义处理",
"去除转义",
"去除转义返回一个去除反斜线后的字符串(",
"\\",
"转换为",
"等等)。双反斜线(",
"\\\\",
")被转换为单个反斜线(",
"\\",
")。"
] | train | https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Helpers/DataHelper.php#L207-L231 |
inhere/php-librarys | src/Helpers/DataHelper.php | DataHelper.changeEncode | public static function changeEncode($data, $in_charset = 'GBK', $out_charset = 'UTF-8')
{
if (\is_array($data)) {
foreach ($data as $key => $value) {
$data[$key] = self::changeEncode($value, $in_charset, $out_charset);
}
return $data;
}
... | php | public static function changeEncode($data, $in_charset = 'GBK', $out_charset = 'UTF-8')
{
if (\is_array($data)) {
foreach ($data as $key => $value) {
$data[$key] = self::changeEncode($value, $in_charset, $out_charset);
}
return $data;
}
... | [
"public",
"static",
"function",
"changeEncode",
"(",
"$",
"data",
",",
"$",
"in_charset",
"=",
"'GBK'",
",",
"$",
"out_charset",
"=",
"'UTF-8'",
")",
"{",
"if",
"(",
"\\",
"is_array",
"(",
"$",
"data",
")",
")",
"{",
"foreach",
"(",
"$",
"data",
"as"... | 对数据进行字符集转换处理,数据可以是字符串或数组及对象
@param array|string $data
@param $in_charset
@param $out_charset
@return array|string | [
"对数据进行字符集转换处理,数据可以是字符串或数组及对象"
] | train | https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Helpers/DataHelper.php#L253-L269 |
technote-space/wordpress-plugin-base | src/classes/models/lib/log.php | Log.shutdown | private function shutdown() {
$error = error_get_last();
if ( $error === null ) {
return;
}
if ( $error['type'] & $this->app->get_config( 'config', 'target_shutdown_error' ) ) {
$suppress = $this->app->get_config( 'config', 'suppress_log_messages' );
$message = str_replace( [ "\r\n", "\r", "\n" ], "\... | php | private function shutdown() {
$error = error_get_last();
if ( $error === null ) {
return;
}
if ( $error['type'] & $this->app->get_config( 'config', 'target_shutdown_error' ) ) {
$suppress = $this->app->get_config( 'config', 'suppress_log_messages' );
$message = str_replace( [ "\r\n", "\r", "\n" ], "\... | [
"private",
"function",
"shutdown",
"(",
")",
"{",
"$",
"error",
"=",
"error_get_last",
"(",
")",
";",
"if",
"(",
"$",
"error",
"===",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"$",
"error",
"[",
"'type'",
"]",
"&",
"$",
"this",
"->",
"app"... | shutdown
@since 2.8.5
@since 2.9.0 Changed: capture error target
@since 2.9.13 Changed: moved function | [
"shutdown"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/classes/models/lib/log.php#L53-L68 |
technote-space/wordpress-plugin-base | src/classes/models/lib/log.php | Log.log | public function log( $message, $context = null, $level = '' ) {
if ( ! $this->is_valid() ) {
return false;
}
$log_level = $this->app->get_config( 'config', 'log_level' );
$level = $this->get_log_level( $level, $log_level );
if ( empty( $log_level[ $level ] ) ) {
return false;
}
global $wp_vers... | php | public function log( $message, $context = null, $level = '' ) {
if ( ! $this->is_valid() ) {
return false;
}
$log_level = $this->app->get_config( 'config', 'log_level' );
$level = $this->get_log_level( $level, $log_level );
if ( empty( $log_level[ $level ] ) ) {
return false;
}
global $wp_vers... | [
"public",
"function",
"log",
"(",
"$",
"message",
",",
"$",
"context",
"=",
"null",
",",
"$",
"level",
"=",
"''",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"is_valid",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"log_level",
"=",
"... | @since 2.7.0 Added: $context
@since 2.9.0 Added: log level arg
@since 2.9.0 Added: send mail feature
@param string $message
@param mixed $context
@param string $level
@return bool | [
"@since",
"2",
".",
"7",
".",
"0",
"Added",
":",
"$context",
"@since",
"2",
".",
"9",
".",
"0",
"Added",
":",
"log",
"level",
"arg",
"@since",
"2",
".",
"9",
".",
"0",
"Added",
":",
"send",
"mail",
"feature"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/classes/models/lib/log.php#L93-L120 |
technote-space/wordpress-plugin-base | src/classes/models/lib/log.php | Log.get_log_level | private function get_log_level( $level, $log_level ) {
if ( ! isset( $log_level[ $level ] ) && ! isset( $log_level[''] ) ) {
return 'info';
}
'' === $level || ! isset( $log_level[ $level ] ) and $level = $log_level[''];
if ( empty( $log_level[ $level ] ) ) {
return 'info';
}
return $level;
} | php | private function get_log_level( $level, $log_level ) {
if ( ! isset( $log_level[ $level ] ) && ! isset( $log_level[''] ) ) {
return 'info';
}
'' === $level || ! isset( $log_level[ $level ] ) and $level = $log_level[''];
if ( empty( $log_level[ $level ] ) ) {
return 'info';
}
return $level;
} | [
"private",
"function",
"get_log_level",
"(",
"$",
"level",
",",
"$",
"log_level",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"log_level",
"[",
"$",
"level",
"]",
")",
"&&",
"!",
"isset",
"(",
"$",
"log_level",
"[",
"''",
"]",
")",
")",
"{",
"re... | @since 2.9.0
@param string $level
@param array $log_level
@return string | [
"@since",
"2",
".",
"9",
".",
"0"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/classes/models/lib/log.php#L130-L140 |
technote-space/wordpress-plugin-base | src/classes/models/lib/log.php | Log.insert_log | private function insert_log( $level, $log_level, $data ) {
if ( empty( $log_level[ $level ]['is_valid_log'] ) ) {
return;
}
if ( $this->apply_filters( 'save___log_term' ) <= 0 ) {
return;
}
$this->app->db->insert( '__log', $data );
} | php | private function insert_log( $level, $log_level, $data ) {
if ( empty( $log_level[ $level ]['is_valid_log'] ) ) {
return;
}
if ( $this->apply_filters( 'save___log_term' ) <= 0 ) {
return;
}
$this->app->db->insert( '__log', $data );
} | [
"private",
"function",
"insert_log",
"(",
"$",
"level",
",",
"$",
"log_level",
",",
"$",
"data",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"log_level",
"[",
"$",
"level",
"]",
"[",
"'is_valid_log'",
"]",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
... | @since 2.9.0
@param string $level
@param array $log_level
@param array $data | [
"@since",
"2",
".",
"9",
".",
"0"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/classes/models/lib/log.php#L149-L157 |
technote-space/wordpress-plugin-base | src/classes/models/lib/log.php | Log.send_mail | private function send_mail( $level, $log_level, $message, $data ) {
if ( empty( $log_level[ $level ]['is_valid_mail'] ) ) {
return;
}
$level = $log_level[ $level ];
$roles = $this->app->utility->array_get( $level, 'roles' );
$emails = $this->app->utility->array_get( $level, 'emails' );
if ( empty( $r... | php | private function send_mail( $level, $log_level, $message, $data ) {
if ( empty( $log_level[ $level ]['is_valid_mail'] ) ) {
return;
}
$level = $log_level[ $level ];
$roles = $this->app->utility->array_get( $level, 'roles' );
$emails = $this->app->utility->array_get( $level, 'emails' );
if ( empty( $r... | [
"private",
"function",
"send_mail",
"(",
"$",
"level",
",",
"$",
"log_level",
",",
"$",
"message",
",",
"$",
"data",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"log_level",
"[",
"$",
"level",
"]",
"[",
"'is_valid_mail'",
"]",
")",
")",
"{",
"return",
... | @since 2.9.0
@param string $level
@param array $log_level
@param string $message
@param array $data | [
"@since",
"2",
".",
"9",
".",
"0"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/classes/models/lib/log.php#L167-L192 |
Eresus/EresusCMS | src/core/files.php | TFiles.renderControls | private function renderControls()
{
$maxFileSize = floor(Eresus_PHP::getMaxUploadSize() / 1024 / 1024) . ' Mb';
$result =
"<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n".
"<tr><td align=\"center\">Загрузить файл</td><td><form name=\"upload\" action=\"".
Eresus_CMS::getLegacyKe... | php | private function renderControls()
{
$maxFileSize = floor(Eresus_PHP::getMaxUploadSize() / 1024 / 1024) . ' Mb';
$result =
"<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n".
"<tr><td align=\"center\">Загрузить файл</td><td><form name=\"upload\" action=\"".
Eresus_CMS::getLegacyKe... | [
"private",
"function",
"renderControls",
"(",
")",
"{",
"$",
"maxFileSize",
"=",
"floor",
"(",
"Eresus_PHP",
"::",
"getMaxUploadSize",
"(",
")",
"/",
"1024",
"/",
"1024",
")",
".",
"' Mb'",
";",
"$",
"result",
"=",
"\"<table width=\\\"100%\\\" cellpadding=\\\"0\... | Возвращает разметку элементов управления
@return string | [
"Возвращает",
"разметку",
"элементов",
"управления"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/files.php#L320-L335 |
Eresus/EresusCMS | src/core/files.php | TFiles.mkDir | function mkDir()
{
$pathname = Eresus_CMS::getLegacyKernel()->froot . $this->root .
$this->panels[$this->sp] . arg('mkdir', FILES_FILTER);
mkdir($pathname, 0777, true);
HTTP::redirect(str_replace('&', '&', $this->url()));
} | php | function mkDir()
{
$pathname = Eresus_CMS::getLegacyKernel()->froot . $this->root .
$this->panels[$this->sp] . arg('mkdir', FILES_FILTER);
mkdir($pathname, 0777, true);
HTTP::redirect(str_replace('&', '&', $this->url()));
} | [
"function",
"mkDir",
"(",
")",
"{",
"$",
"pathname",
"=",
"Eresus_CMS",
"::",
"getLegacyKernel",
"(",
")",
"->",
"froot",
".",
"$",
"this",
"->",
"root",
".",
"$",
"this",
"->",
"panels",
"[",
"$",
"this",
"->",
"sp",
"]",
".",
"arg",
"(",
"'mkdir'... | Создаёт директорию
@return void
@uses FS::mkDir()
@uses HTTP::redirect() | [
"Создаёт",
"директорию"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/files.php#L364-L370 |
Eresus/EresusCMS | src/core/files.php | TFiles.adminRender | public function adminRender()
{
$this->root = 'data/';
$this->panels['l'] = (arg('lf')?preg_replace('!^/|/$!','',arg('lf')).'/':'');
$this->panels['l'] = preg_replace('~(/\.\.|^\.\./)~', '', $this->panels['l']);
$this->panels['l'] = preg_replace('!^/!', '', $this->panels['l']);
while (!empty($this->panels['... | php | public function adminRender()
{
$this->root = 'data/';
$this->panels['l'] = (arg('lf')?preg_replace('!^/|/$!','',arg('lf')).'/':'');
$this->panels['l'] = preg_replace('~(/\.\.|^\.\./)~', '', $this->panels['l']);
$this->panels['l'] = preg_replace('!^/!', '', $this->panels['l']);
while (!empty($this->panels['... | [
"public",
"function",
"adminRender",
"(",
")",
"{",
"$",
"this",
"->",
"root",
"=",
"'data/'",
";",
"$",
"this",
"->",
"panels",
"[",
"'l'",
"]",
"=",
"(",
"arg",
"(",
"'lf'",
")",
"?",
"preg_replace",
"(",
"'!^/|/$!'",
",",
"''",
",",
"arg",
"(",
... | Возвращает разметку интерфейса
@return string | [
"Возвращает",
"разметку",
"интерфейса"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/files.php#L479-L553 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Cache/src/interfaces/base_meta_data.php | ezcCacheStackBaseMetaData.addItem | public function addItem( $storageId, $itemId )
{
$this->storageData[$storageId][$itemId] = true;
// Abstract call
$this->addItemToReplacementData( $itemId );
} | php | public function addItem( $storageId, $itemId )
{
$this->storageData[$storageId][$itemId] = true;
// Abstract call
$this->addItemToReplacementData( $itemId );
} | [
"public",
"function",
"addItem",
"(",
"$",
"storageId",
",",
"$",
"itemId",
")",
"{",
"$",
"this",
"->",
"storageData",
"[",
"$",
"storageId",
"]",
"[",
"$",
"itemId",
"]",
"=",
"true",
";",
"// Abstract call",
"$",
"this",
"->",
"addItemToReplacementData"... | Adds the given $itemId to the storage identified by $storageId.
This method adds the given $itemId to the storage identified by
$storageId. It must also add the $itemId to the replacement data or
update its status there, if the item is already in there.
The method calls the abstract {@link self::addItemToReplacementD... | [
"Adds",
"the",
"given",
"$itemId",
"to",
"the",
"storage",
"identified",
"by",
"$storageId",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Cache/src/interfaces/base_meta_data.php#L93-L98 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Cache/src/interfaces/base_meta_data.php | ezcCacheStackBaseMetaData.removeItem | public function removeItem( $storageId, $itemId )
{
// Remove from storage
if ( isset( $this->storageData[$storageId] ) )
{
// No error if not set
unset( $this->storageData[$storageId][$itemId] );
// Remove empty storage
if ( count( $this->stor... | php | public function removeItem( $storageId, $itemId )
{
// Remove from storage
if ( isset( $this->storageData[$storageId] ) )
{
// No error if not set
unset( $this->storageData[$storageId][$itemId] );
// Remove empty storage
if ( count( $this->stor... | [
"public",
"function",
"removeItem",
"(",
"$",
"storageId",
",",
"$",
"itemId",
")",
"{",
"// Remove from storage",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"storageData",
"[",
"$",
"storageId",
"]",
")",
")",
"{",
"// No error if not set",
"unset",
"(",
... | Removes the given $itemId from the storage identified by $storageId.
Removes the given $itemId from the storage identified by $storageId in
{@link self::$storageData} and also removes the key from {@link
self::$metaData}.
@param string $storageId
@param string $itemId | [
"Removes",
"the",
"given",
"$itemId",
"from",
"the",
"storage",
"identified",
"by",
"$storageId",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Cache/src/interfaces/base_meta_data.php#L127-L152 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Cache/src/interfaces/base_meta_data.php | ezcCacheStackBaseMetaData.reachedItemLimit | public function reachedItemLimit( $storageId, $limit )
{
return (
isset( $this->storageData[$storageId] )
&& count( $this->storageData[$storageId] ) >= $limit
);
} | php | public function reachedItemLimit( $storageId, $limit )
{
return (
isset( $this->storageData[$storageId] )
&& count( $this->storageData[$storageId] ) >= $limit
);
} | [
"public",
"function",
"reachedItemLimit",
"(",
"$",
"storageId",
",",
"$",
"limit",
")",
"{",
"return",
"(",
"isset",
"(",
"$",
"this",
"->",
"storageData",
"[",
"$",
"storageId",
"]",
")",
"&&",
"count",
"(",
"$",
"this",
"->",
"storageData",
"[",
"$"... | Returns if the given $storageId has reached the given $limit of items.
Returns if the storage identified by $storageId has $limit or more items
stored.
@param string $storageId
@param int $limit
@return bool | [
"Returns",
"if",
"the",
"given",
"$storageId",
"has",
"reached",
"the",
"given",
"$limit",
"of",
"items",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Cache/src/interfaces/base_meta_data.php#L179-L185 |
gregorybesson/PlaygroundCms | src/Entity/Block.php | Block.populate | public function populate($data = array())
{
$this->title = (isset($data['title'])) ? $data['title'] : null;
if (isset($data['is_active']) && $data['is_active'] != null) {
$this->is_active = $data['is_active'];
}
if (isset($data['content']) && $data['content'] != null) {
... | php | public function populate($data = array())
{
$this->title = (isset($data['title'])) ? $data['title'] : null;
if (isset($data['is_active']) && $data['is_active'] != null) {
$this->is_active = $data['is_active'];
}
if (isset($data['content']) && $data['content'] != null) {
... | [
"public",
"function",
"populate",
"(",
"$",
"data",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"title",
"=",
"(",
"isset",
"(",
"$",
"data",
"[",
"'title'",
"]",
")",
")",
"?",
"$",
"data",
"[",
"'title'",
"]",
":",
"null",
";",
"if",... | Populate from an array.
@param array $data | [
"Populate",
"from",
"an",
"array",
"."
] | train | https://github.com/gregorybesson/PlaygroundCms/blob/e929a283f2a6e82d4f248c930f7aa454ce20cbc3/src/Entity/Block.php#L253-L263 |
gyselroth/micro-container | src/Config.php | Config.get | public function get(string $name): array
{
if (isset($this->compiled[$name])) {
$config = $this->compiled[$name];
} else {
$this->compiled[$name] = $this->createServiceConfig($name);
$config = $this->compiled[$name];
}
if (!isset($config['use'])) ... | php | public function get(string $name): array
{
if (isset($this->compiled[$name])) {
$config = $this->compiled[$name];
} else {
$this->compiled[$name] = $this->createServiceConfig($name);
$config = $this->compiled[$name];
}
if (!isset($config['use'])) ... | [
"public",
"function",
"get",
"(",
"string",
"$",
"name",
")",
":",
"array",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"compiled",
"[",
"$",
"name",
"]",
")",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"compiled",
"[",
"$",
"name",
... | Get service configuration. | [
"Get",
"service",
"configuration",
"."
] | train | https://github.com/gyselroth/micro-container/blob/728cf35af9645648392c50752b4b555d491bac4e/src/Config.php#L65-L79 |
gyselroth/micro-container | src/Config.php | Config.getEnv | public function getEnv(string $param): string
{
if (preg_match_all('#\{ENV\(([A-Za-z0-9_]+)(?:(,?)([^}]*))\)\}#', $param, $matches)) {
if (4 !== count($matches)) {
return $param;
}
for ($i = 0; $i < count($matches[0]); ++$i) {
$param = $th... | php | public function getEnv(string $param): string
{
if (preg_match_all('#\{ENV\(([A-Za-z0-9_]+)(?:(,?)([^}]*))\)\}#', $param, $matches)) {
if (4 !== count($matches)) {
return $param;
}
for ($i = 0; $i < count($matches[0]); ++$i) {
$param = $th... | [
"public",
"function",
"getEnv",
"(",
"string",
"$",
"param",
")",
":",
"string",
"{",
"if",
"(",
"preg_match_all",
"(",
"'#\\{ENV\\(([A-Za-z0-9_]+)(?:(,?)([^}]*))\\)\\}#'",
",",
"$",
"param",
",",
"$",
"matches",
")",
")",
"{",
"if",
"(",
"4",
"!==",
"count"... | Parse env param. | [
"Parse",
"env",
"param",
"."
] | train | https://github.com/gyselroth/micro-container/blob/728cf35af9645648392c50752b4b555d491bac4e/src/Config.php#L84-L99 |
gyselroth/micro-container | src/Config.php | Config.parseEnv | protected function parseEnv(string $param, array $variables, int $key): string
{
$env = getenv($variables[1][$key]);
if (false === $env && !empty($variables[3][$key])) {
return str_replace($variables[0][$key], $variables[3][$key], $param);
}
if (false === $env) {
... | php | protected function parseEnv(string $param, array $variables, int $key): string
{
$env = getenv($variables[1][$key]);
if (false === $env && !empty($variables[3][$key])) {
return str_replace($variables[0][$key], $variables[3][$key], $param);
}
if (false === $env) {
... | [
"protected",
"function",
"parseEnv",
"(",
"string",
"$",
"param",
",",
"array",
"$",
"variables",
",",
"int",
"$",
"key",
")",
":",
"string",
"{",
"$",
"env",
"=",
"getenv",
"(",
"$",
"variables",
"[",
"1",
"]",
"[",
"$",
"key",
"]",
")",
";",
"i... | Parse env. | [
"Parse",
"env",
"."
] | train | https://github.com/gyselroth/micro-container/blob/728cf35af9645648392c50752b4b555d491bac4e/src/Config.php#L104-L115 |
gyselroth/micro-container | src/Config.php | Config.createServiceConfig | protected function createServiceConfig(string $name): array
{
$config = [];
if ($this->has($name)) {
$config = $this->config[$name];
}
$class = $name;
if (isset($config['use'])) {
if (!is_string($config['use'])) {
throw new Exception\... | php | protected function createServiceConfig(string $name): array
{
$config = [];
if ($this->has($name)) {
$config = $this->config[$name];
}
$class = $name;
if (isset($config['use'])) {
if (!is_string($config['use'])) {
throw new Exception\... | [
"protected",
"function",
"createServiceConfig",
"(",
"string",
"$",
"name",
")",
":",
"array",
"{",
"$",
"config",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"this",
"->",
"has",
"(",
"$",
"name",
")",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"c... | Create service config. | [
"Create",
"service",
"config",
"."
] | train | https://github.com/gyselroth/micro-container/blob/728cf35af9645648392c50752b4b555d491bac4e/src/Config.php#L120-L154 |
gyselroth/micro-container | src/Config.php | Config.mergeServiceConfig | protected function mergeServiceConfig(string $name, string $class, array $config): array
{
$config = array_merge($this->getServiceDefaults(), $config);
if (!class_exists($class) && !interface_exists($class)) {
return $config;
}
if (false === $config['merge']) {
... | php | protected function mergeServiceConfig(string $name, string $class, array $config): array
{
$config = array_merge($this->getServiceDefaults(), $config);
if (!class_exists($class) && !interface_exists($class)) {
return $config;
}
if (false === $config['merge']) {
... | [
"protected",
"function",
"mergeServiceConfig",
"(",
"string",
"$",
"name",
",",
"string",
"$",
"class",
",",
"array",
"$",
"config",
")",
":",
"array",
"{",
"$",
"config",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"getServiceDefaults",
"(",
")",
",",
"... | Find parent classes or interfaces and merge service configurations. | [
"Find",
"parent",
"classes",
"or",
"interfaces",
"and",
"merge",
"service",
"configurations",
"."
] | train | https://github.com/gyselroth/micro-container/blob/728cf35af9645648392c50752b4b555d491bac4e/src/Config.php#L174-L201 |
gyselroth/micro-container | src/Config.php | Config.getConfigTree | protected function getConfigTree(): array
{
$tree = [$this->getConfig()];
$parent = $this->container;
while ($parent = $parent->getParent()) {
$tree[] = $parent->getConfig()->getConfig();
}
return $tree;
} | php | protected function getConfigTree(): array
{
$tree = [$this->getConfig()];
$parent = $this->container;
while ($parent = $parent->getParent()) {
$tree[] = $parent->getConfig()->getConfig();
}
return $tree;
} | [
"protected",
"function",
"getConfigTree",
"(",
")",
":",
"array",
"{",
"$",
"tree",
"=",
"[",
"$",
"this",
"->",
"getConfig",
"(",
")",
"]",
";",
"$",
"parent",
"=",
"$",
"this",
"->",
"container",
";",
"while",
"(",
"$",
"parent",
"=",
"$",
"paren... | Get config tree. | [
"Get",
"config",
"tree",
"."
] | train | https://github.com/gyselroth/micro-container/blob/728cf35af9645648392c50752b4b555d491bac4e/src/Config.php#L206-L215 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.