id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
7,700 | GrupaZero/core | src/Gzero/Core/ViewModels/UserViewModel.php | UserViewModel.displayName | public function displayName()
{
if (isset($this->data['name']) && config('gzero.use_users_nicks')) {
return $this->data['name'];
}
if (isset($this->data['first_name']) || isset($this->data['last_name'])) {
return $this->data['first_name'] . ' ' . $this->data['last_na... | php | public function displayName()
{
if (isset($this->data['name']) && config('gzero.use_users_nicks')) {
return $this->data['name'];
}
if (isset($this->data['first_name']) || isset($this->data['last_name'])) {
return $this->data['first_name'] . ' ' . $this->data['last_na... | [
"public",
"function",
"displayName",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"data",
"[",
"'name'",
"]",
")",
"&&",
"config",
"(",
"'gzero.use_users_nicks'",
")",
")",
"{",
"return",
"$",
"this",
"->",
"data",
"[",
"'name'",
"]",
"... | Get display name nick or first and last name
@return string | [
"Get",
"display",
"name",
"nick",
"or",
"first",
"and",
"last",
"name"
] | 093e515234fa0385b259ba4d8bc7832174a44eab | https://github.com/GrupaZero/core/blob/093e515234fa0385b259ba4d8bc7832174a44eab/src/Gzero/Core/ViewModels/UserViewModel.php#L117-L128 |
7,701 | osflab/test | Runner.php | Runner.assert | protected static function assert($condition, string $errorMessage = '', bool $exitOnError = false): bool
{
self::$totalCount++;
self::$count++;
if (!$condition) {
$trace = debug_backtrace();
$errorPrefix = (isset($trace[1]['class']) ? ($trace[1]['class']
... | php | protected static function assert($condition, string $errorMessage = '', bool $exitOnError = false): bool
{
self::$totalCount++;
self::$count++;
if (!$condition) {
$trace = debug_backtrace();
$errorPrefix = (isset($trace[1]['class']) ? ($trace[1]['class']
... | [
"protected",
"static",
"function",
"assert",
"(",
"$",
"condition",
",",
"string",
"$",
"errorMessage",
"=",
"''",
",",
"bool",
"$",
"exitOnError",
"=",
"false",
")",
":",
"bool",
"{",
"self",
"::",
"$",
"totalCount",
"++",
";",
"self",
"::",
"$",
"cou... | Simple assert of the test application
@param boolean $condition
@param string $errorMessage
@param boolean $exitOnError
@return boolean | [
"Simple",
"assert",
"of",
"the",
"test",
"application"
] | dca824d071aa7f84195b366ec9cf86ee7a1ec087 | https://github.com/osflab/test/blob/dca824d071aa7f84195b366ec9cf86ee7a1ec087/Runner.php#L38-L56 |
7,702 | osflab/test | Runner.php | Runner.assertFalseException | protected static function assertFalseException(\Exception $e): bool
{
$msg = 'EXCEPTION: ' . $e->getMessage();
$msg .= "\n " . $e->getFile() . ' (' . $e->getLine() . ')';
self::assert(false, $msg);
} | php | protected static function assertFalseException(\Exception $e): bool
{
$msg = 'EXCEPTION: ' . $e->getMessage();
$msg .= "\n " . $e->getFile() . ' (' . $e->getLine() . ')';
self::assert(false, $msg);
} | [
"protected",
"static",
"function",
"assertFalseException",
"(",
"\\",
"Exception",
"$",
"e",
")",
":",
"bool",
"{",
"$",
"msg",
"=",
"'EXCEPTION: '",
".",
"$",
"e",
"->",
"getMessage",
"(",
")",
";",
"$",
"msg",
".=",
"\"\\n \"",
".",
"$",
"e",
"->"... | Assert false and display exception
@param Exception $e | [
"Assert",
"false",
"and",
"display",
"exception"
] | dca824d071aa7f84195b366ec9cf86ee7a1ec087 | https://github.com/osflab/test/blob/dca824d071aa7f84195b366ec9cf86ee7a1ec087/Runner.php#L88-L93 |
7,703 | osflab/test | Runner.php | Runner.addError | private static function addError($message): void
{
if (self::$result === false) {
self::$result = array();
}
self::$result[] = $message;
} | php | private static function addError($message): void
{
if (self::$result === false) {
self::$result = array();
}
self::$result[] = $message;
} | [
"private",
"static",
"function",
"addError",
"(",
"$",
"message",
")",
":",
"void",
"{",
"if",
"(",
"self",
"::",
"$",
"result",
"===",
"false",
")",
"{",
"self",
"::",
"$",
"result",
"=",
"array",
"(",
")",
";",
"}",
"self",
"::",
"$",
"result",
... | Add an error in the table
@param string $message | [
"Add",
"an",
"error",
"in",
"the",
"table"
] | dca824d071aa7f84195b366ec9cf86ee7a1ec087 | https://github.com/osflab/test/blob/dca824d071aa7f84195b366ec9cf86ee7a1ec087/Runner.php#L125-L131 |
7,704 | osflab/test | Runner.php | Runner.runDirectory | public static function runDirectory(
string $path,
string $testSuffix = '/Test',
?string $filter = null,
?string $exclude = '/vendor/'): bool
{
foreach (new \RecursiveIteratorIterator(
new \RecursiveDirectoryIterator($path,
\RecursiveDirector... | php | public static function runDirectory(
string $path,
string $testSuffix = '/Test',
?string $filter = null,
?string $exclude = '/vendor/'): bool
{
foreach (new \RecursiveIteratorIterator(
new \RecursiveDirectoryIterator($path,
\RecursiveDirector... | [
"public",
"static",
"function",
"runDirectory",
"(",
"string",
"$",
"path",
",",
"string",
"$",
"testSuffix",
"=",
"'/Test'",
",",
"?",
"string",
"$",
"filter",
"=",
"null",
",",
"?",
"string",
"$",
"exclude",
"=",
"'/vendor/'",
")",
":",
"bool",
"{",
... | Run recursively a testsuite in a directory.
@param string $path
@return boolean | [
"Run",
"recursively",
"a",
"testsuite",
"in",
"a",
"directory",
"."
] | dca824d071aa7f84195b366ec9cf86ee7a1ec087 | https://github.com/osflab/test/blob/dca824d071aa7f84195b366ec9cf86ee7a1ec087/Runner.php#L148-L179 |
7,705 | osflab/test | Runner.php | Runner.runClass | private static function runClass(string $className, ?string $filter): bool
{
echo Console::beginActionMessage($className);
flush();
if (!is_null($filter) && !preg_match($filter, $className)) {
echo Console::endActionSkip();
flush();
return false;
}... | php | private static function runClass(string $className, ?string $filter): bool
{
echo Console::beginActionMessage($className);
flush();
if (!is_null($filter) && !preg_match($filter, $className)) {
echo Console::endActionSkip();
flush();
return false;
}... | [
"private",
"static",
"function",
"runClass",
"(",
"string",
"$",
"className",
",",
"?",
"string",
"$",
"filter",
")",
":",
"bool",
"{",
"echo",
"Console",
"::",
"beginActionMessage",
"(",
"$",
"className",
")",
";",
"flush",
"(",
")",
";",
"if",
"(",
"... | Run a single test class
@param string $className
@param string|null $filter
@return bool | [
"Run",
"a",
"single",
"test",
"class"
] | dca824d071aa7f84195b366ec9cf86ee7a1ec087 | https://github.com/osflab/test/blob/dca824d071aa7f84195b366ec9cf86ee7a1ec087/Runner.php#L187-L220 |
7,706 | mvccore/ext-form | src/MvcCore/Ext/Form/Session.php | Session.& | public function & ClearSession () {
/** @var $this \MvcCore\Ext\Forms\IForm */
$this->values = [];
$this->errors = [];
$session = & $this->getSession();
$session->values = [];
$session->csrf = [];
$session->errors = [];
return $this;
} | php | public function & ClearSession () {
/** @var $this \MvcCore\Ext\Forms\IForm */
$this->values = [];
$this->errors = [];
$session = & $this->getSession();
$session->values = [];
$session->csrf = [];
$session->errors = [];
return $this;
} | [
"public",
"function",
"&",
"ClearSession",
"(",
")",
"{",
"/** @var $this \\MvcCore\\Ext\\Forms\\IForm */",
"$",
"this",
"->",
"values",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"errors",
"=",
"[",
"]",
";",
"$",
"session",
"=",
"&",
"$",
"this",
"->",
"ge... | Clear form values to empty array and clear form values in form session namespace,
clear form errors to empty array and clear form errors in form session namespace and
clear form CSRF tokens clear CRSF tokens in form session namespace.
@return \MvcCore\Ext\Form|\MvcCore\Ext\Forms\IForm | [
"Clear",
"form",
"values",
"to",
"empty",
"array",
"and",
"clear",
"form",
"values",
"in",
"form",
"session",
"namespace",
"clear",
"form",
"errors",
"to",
"empty",
"array",
"and",
"clear",
"form",
"errors",
"in",
"form",
"session",
"namespace",
"and",
"clea... | 8d81a3c7326236702f37dc4b9d968907b3230b9f | https://github.com/mvccore/ext-form/blob/8d81a3c7326236702f37dc4b9d968907b3230b9f/src/MvcCore/Ext/Form/Session.php#L28-L37 |
7,707 | mvccore/ext-form | src/MvcCore/Ext/Form/Session.php | Session.& | public function & SaveSession () {
/** @var $this \MvcCore\Ext\Forms\IForm */
$session = & $this->getSession();
$session->errors = $this->errors;
$session->values = $this->values;
return $this;
} | php | public function & SaveSession () {
/** @var $this \MvcCore\Ext\Forms\IForm */
$session = & $this->getSession();
$session->errors = $this->errors;
$session->values = $this->values;
return $this;
} | [
"public",
"function",
"&",
"SaveSession",
"(",
")",
"{",
"/** @var $this \\MvcCore\\Ext\\Forms\\IForm */",
"$",
"session",
"=",
"&",
"$",
"this",
"->",
"getSession",
"(",
")",
";",
"$",
"session",
"->",
"errors",
"=",
"$",
"this",
"->",
"errors",
";",
"$",
... | Store form values, form errors and form CSRF tokens
in it's own form session namespace.
@return \MvcCore\Ext\Form|\MvcCore\Ext\Forms\IForm | [
"Store",
"form",
"values",
"form",
"errors",
"and",
"form",
"CSRF",
"tokens",
"in",
"it",
"s",
"own",
"form",
"session",
"namespace",
"."
] | 8d81a3c7326236702f37dc4b9d968907b3230b9f | https://github.com/mvccore/ext-form/blob/8d81a3c7326236702f37dc4b9d968907b3230b9f/src/MvcCore/Ext/Form/Session.php#L44-L50 |
7,708 | mvccore/ext-form | src/MvcCore/Ext/Form/Session.php | Session.& | protected function & getSession () {
if (isset(self::$allFormsSessions[$this->id])) {
$sessionNamespace = & self::$allFormsSessions[$this->id];
} else {
$sessionClass = self::$sessionClass;
$toolClass = self::$toolClass;
$formIdPc = $this->id;
if (strpos($formIdPc, '-') !== FALSE)
$formIdPc = $to... | php | protected function & getSession () {
if (isset(self::$allFormsSessions[$this->id])) {
$sessionNamespace = & self::$allFormsSessions[$this->id];
} else {
$sessionClass = self::$sessionClass;
$toolClass = self::$toolClass;
$formIdPc = $this->id;
if (strpos($formIdPc, '-') !== FALSE)
$formIdPc = $to... | [
"protected",
"function",
"&",
"getSession",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"self",
"::",
"$",
"allFormsSessions",
"[",
"$",
"this",
"->",
"id",
"]",
")",
")",
"{",
"$",
"sessionNamespace",
"=",
"&",
"self",
"::",
"$",
"allFormsSessions",
"[",
... | Get session namespace reference with configured expiration
and predefined fields `values`, `csrf` and `errors` as arrays.
@return \MvcCore\ISession | [
"Get",
"session",
"namespace",
"reference",
"with",
"configured",
"expiration",
"and",
"predefined",
"fields",
"values",
"csrf",
"and",
"errors",
"as",
"arrays",
"."
] | 8d81a3c7326236702f37dc4b9d968907b3230b9f | https://github.com/mvccore/ext-form/blob/8d81a3c7326236702f37dc4b9d968907b3230b9f/src/MvcCore/Ext/Form/Session.php#L57-L82 |
7,709 | joomlatools/joomlatools-platform-categories | plugins/finder/categories/categories.php | PlgFinderCategories.onFinderDelete | public function onFinderDelete($context, $table)
{
if ($context == 'com_categories.category')
{
$id = $table->id;
}
elseif ($context == 'com_finder.index')
{
$id = $table->link_id;
}
else
{
return true;
}
// Remove item from the index.
return $this->remove($id);
} | php | public function onFinderDelete($context, $table)
{
if ($context == 'com_categories.category')
{
$id = $table->id;
}
elseif ($context == 'com_finder.index')
{
$id = $table->link_id;
}
else
{
return true;
}
// Remove item from the index.
return $this->remove($id);
} | [
"public",
"function",
"onFinderDelete",
"(",
"$",
"context",
",",
"$",
"table",
")",
"{",
"if",
"(",
"$",
"context",
"==",
"'com_categories.category'",
")",
"{",
"$",
"id",
"=",
"$",
"table",
"->",
"id",
";",
"}",
"elseif",
"(",
"$",
"context",
"==",
... | Method to remove the link information for items that have been deleted.
@param string $context The context of the action being performed.
@param JTable $table A JTable object containing the record to be deleted
@return boolean True on success.
@since 2.5
@throws Exception on database error. | [
"Method",
"to",
"remove",
"the",
"link",
"information",
"for",
"items",
"that",
"have",
"been",
"deleted",
"."
] | 9fe50b6c4ebe6ebfcf98e50067922fcf4a76d350 | https://github.com/joomlatools/joomlatools-platform-categories/blob/9fe50b6c4ebe6ebfcf98e50067922fcf4a76d350/plugins/finder/categories/categories.php#L90-L107 |
7,710 | joomlatools/joomlatools-platform-categories | plugins/finder/categories/categories.php | PlgFinderCategories.onFinderAfterSave | public function onFinderAfterSave($context, $row, $isNew)
{
// We only want to handle categories here.
if ($context == 'com_categories.category')
{
// Check if the access levels are different.
if (!$isNew && $this->old_access != $row->access)
{
// Process the change.
$this->itemAccessChange($row... | php | public function onFinderAfterSave($context, $row, $isNew)
{
// We only want to handle categories here.
if ($context == 'com_categories.category')
{
// Check if the access levels are different.
if (!$isNew && $this->old_access != $row->access)
{
// Process the change.
$this->itemAccessChange($row... | [
"public",
"function",
"onFinderAfterSave",
"(",
"$",
"context",
",",
"$",
"row",
",",
"$",
"isNew",
")",
"{",
"// We only want to handle categories here.",
"if",
"(",
"$",
"context",
"==",
"'com_categories.category'",
")",
"{",
"// Check if the access levels are differe... | Smart Search after save content method.
Reindexes the link information for a category that has been saved.
It also makes adjustments if the access level of the category has changed.
@param string $context The context of the category passed to the plugin.
@param JTable $row A JTable object.
@param boole... | [
"Smart",
"Search",
"after",
"save",
"content",
"method",
".",
"Reindexes",
"the",
"link",
"information",
"for",
"a",
"category",
"that",
"has",
"been",
"saved",
".",
"It",
"also",
"makes",
"adjustments",
"if",
"the",
"access",
"level",
"of",
"the",
"category... | 9fe50b6c4ebe6ebfcf98e50067922fcf4a76d350 | https://github.com/joomlatools/joomlatools-platform-categories/blob/9fe50b6c4ebe6ebfcf98e50067922fcf4a76d350/plugins/finder/categories/categories.php#L123-L146 |
7,711 | joomlatools/joomlatools-platform-categories | plugins/finder/categories/categories.php | PlgFinderCategories.onFinderBeforeSave | public function onFinderBeforeSave($context, $row, $isNew)
{
// We only want to handle categories here.
if ($context == 'com_categories.category')
{
// Query the database for the old access level and the parent if the item isn't new.
if (!$isNew)
{
$this->checkItemAccess($row);
$this->checkCateg... | php | public function onFinderBeforeSave($context, $row, $isNew)
{
// We only want to handle categories here.
if ($context == 'com_categories.category')
{
// Query the database for the old access level and the parent if the item isn't new.
if (!$isNew)
{
$this->checkItemAccess($row);
$this->checkCateg... | [
"public",
"function",
"onFinderBeforeSave",
"(",
"$",
"context",
",",
"$",
"row",
",",
"$",
"isNew",
")",
"{",
"// We only want to handle categories here.",
"if",
"(",
"$",
"context",
"==",
"'com_categories.category'",
")",
"{",
"// Query the database for the old access... | Smart Search before content save method.
This event is fired before the data is actually saved.
@param string $context The context of the category passed to the plugin.
@param JTable $row A JTable object.
@param boolean $isNew True if the category is just about to be created.
@return boolean Tru... | [
"Smart",
"Search",
"before",
"content",
"save",
"method",
".",
"This",
"event",
"is",
"fired",
"before",
"the",
"data",
"is",
"actually",
"saved",
"."
] | 9fe50b6c4ebe6ebfcf98e50067922fcf4a76d350 | https://github.com/joomlatools/joomlatools-platform-categories/blob/9fe50b6c4ebe6ebfcf98e50067922fcf4a76d350/plugins/finder/categories/categories.php#L161-L175 |
7,712 | joomlatools/joomlatools-platform-categories | plugins/finder/categories/categories.php | PlgFinderCategories.onFinderChangeState | public function onFinderChangeState($context, $pks, $value)
{
// We only want to handle categories here.
if ($context == 'com_categories.category')
{
/*
* The category published state is tied to the parent category
* published state so we need to look up all published states
* before we change any... | php | public function onFinderChangeState($context, $pks, $value)
{
// We only want to handle categories here.
if ($context == 'com_categories.category')
{
/*
* The category published state is tied to the parent category
* published state so we need to look up all published states
* before we change any... | [
"public",
"function",
"onFinderChangeState",
"(",
"$",
"context",
",",
"$",
"pks",
",",
"$",
"value",
")",
"{",
"// We only want to handle categories here.",
"if",
"(",
"$",
"context",
"==",
"'com_categories.category'",
")",
"{",
"/*\n\t\t\t * The category published sta... | Method to update the link information for items that have been changed
from outside the edit screen. This is fired when the item is published,
unpublished, archived, or unarchived from the list view.
@param string $context The context for the category passed to the plugin.
@param array $pks An array of ... | [
"Method",
"to",
"update",
"the",
"link",
"information",
"for",
"items",
"that",
"have",
"been",
"changed",
"from",
"outside",
"the",
"edit",
"screen",
".",
"This",
"is",
"fired",
"when",
"the",
"item",
"is",
"published",
"unpublished",
"archived",
"or",
"una... | 9fe50b6c4ebe6ebfcf98e50067922fcf4a76d350 | https://github.com/joomlatools/joomlatools-platform-categories/blob/9fe50b6c4ebe6ebfcf98e50067922fcf4a76d350/plugins/finder/categories/categories.php#L190-L231 |
7,713 | joomlatools/joomlatools-platform-categories | plugins/finder/categories/categories.php | PlgFinderCategories.index | protected function index(FinderIndexerResult $item, $format = 'html')
{
// Check if the extension is enabled.
if (JComponentHelper::isEnabled($this->extension) == false)
{
return;
}
$item->setLanguage();
// Need to import component route helpers dynamically, hence the reason it's handled here.
$path... | php | protected function index(FinderIndexerResult $item, $format = 'html')
{
// Check if the extension is enabled.
if (JComponentHelper::isEnabled($this->extension) == false)
{
return;
}
$item->setLanguage();
// Need to import component route helpers dynamically, hence the reason it's handled here.
$path... | [
"protected",
"function",
"index",
"(",
"FinderIndexerResult",
"$",
"item",
",",
"$",
"format",
"=",
"'html'",
")",
"{",
"// Check if the extension is enabled.",
"if",
"(",
"JComponentHelper",
"::",
"isEnabled",
"(",
"$",
"this",
"->",
"extension",
")",
"==",
"fa... | Method to index an item. The item must be a FinderIndexerResult object.
@param FinderIndexerResult $item The item to index as an FinderIndexerResult object.
@param string $format The item format. Not used.
@return void
@since 2.5
@throws Exception on database error. | [
"Method",
"to",
"index",
"an",
"item",
".",
"The",
"item",
"must",
"be",
"a",
"FinderIndexerResult",
"object",
"."
] | 9fe50b6c4ebe6ebfcf98e50067922fcf4a76d350 | https://github.com/joomlatools/joomlatools-platform-categories/blob/9fe50b6c4ebe6ebfcf98e50067922fcf4a76d350/plugins/finder/categories/categories.php#L244-L332 |
7,714 | joomlatools/joomlatools-platform-categories | plugins/finder/categories/categories.php | PlgFinderCategories.getListQuery | protected function getListQuery($query = null)
{
$db = JFactory::getDbo();
// Check if we can use the supplied SQL query.
$query = $query instanceof JDatabaseQuery ? $query : $db->getQuery(true)
->select('a.id, a.title, a.alias, a.description AS summary, a.extension')
->select('a.created_user_id AS create... | php | protected function getListQuery($query = null)
{
$db = JFactory::getDbo();
// Check if we can use the supplied SQL query.
$query = $query instanceof JDatabaseQuery ? $query : $db->getQuery(true)
->select('a.id, a.title, a.alias, a.description AS summary, a.extension')
->select('a.created_user_id AS create... | [
"protected",
"function",
"getListQuery",
"(",
"$",
"query",
"=",
"null",
")",
"{",
"$",
"db",
"=",
"JFactory",
"::",
"getDbo",
"(",
")",
";",
"// Check if we can use the supplied SQL query.",
"$",
"query",
"=",
"$",
"query",
"instanceof",
"JDatabaseQuery",
"?",
... | Method to get the SQL query used to retrieve the list of content items.
@param mixed $query A JDatabaseQuery object or null.
@return JDatabaseQuery A database object.
@since 2.5 | [
"Method",
"to",
"get",
"the",
"SQL",
"query",
"used",
"to",
"retrieve",
"the",
"list",
"of",
"content",
"items",
"."
] | 9fe50b6c4ebe6ebfcf98e50067922fcf4a76d350 | https://github.com/joomlatools/joomlatools-platform-categories/blob/9fe50b6c4ebe6ebfcf98e50067922fcf4a76d350/plugins/finder/categories/categories.php#L358-L382 |
7,715 | joomlatools/joomlatools-platform-categories | plugins/finder/categories/categories.php | PlgFinderCategories.getStateQuery | protected function getStateQuery()
{
$query = $this->db->getQuery(true)
->select($this->db->quoteName('a.id'))
->select($this->db->quoteName('a.parent_id'))
->select('a.' . $this->state_field . ' AS state, c.published AS cat_state')
->select('a.access, c.access AS cat_access')
->from($this->db->quoteN... | php | protected function getStateQuery()
{
$query = $this->db->getQuery(true)
->select($this->db->quoteName('a.id'))
->select($this->db->quoteName('a.parent_id'))
->select('a.' . $this->state_field . ' AS state, c.published AS cat_state')
->select('a.access, c.access AS cat_access')
->from($this->db->quoteN... | [
"protected",
"function",
"getStateQuery",
"(",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"db",
"->",
"getQuery",
"(",
"true",
")",
"->",
"select",
"(",
"$",
"this",
"->",
"db",
"->",
"quoteName",
"(",
"'a.id'",
")",
")",
"->",
"select",
"(",
... | Method to get a SQL query to load the published and access states for
a category and its parents.
@return JDatabaseQuery A database object.
@since 2.5 | [
"Method",
"to",
"get",
"a",
"SQL",
"query",
"to",
"load",
"the",
"published",
"and",
"access",
"states",
"for",
"a",
"category",
"and",
"its",
"parents",
"."
] | 9fe50b6c4ebe6ebfcf98e50067922fcf4a76d350 | https://github.com/joomlatools/joomlatools-platform-categories/blob/9fe50b6c4ebe6ebfcf98e50067922fcf4a76d350/plugins/finder/categories/categories.php#L392-L403 |
7,716 | iriber/cose | src/main/php/Cose/utils/ClassLoader.php | ClassLoader.classExists | public static function classExists($className)
{
if (class_exists($className, false) || interface_exists($className, false)) {
return true;
}
foreach (spl_autoload_functions() as $loader) {
if (is_array($loader)) { // array(???, ???)
if (is_ob... | php | public static function classExists($className)
{
if (class_exists($className, false) || interface_exists($className, false)) {
return true;
}
foreach (spl_autoload_functions() as $loader) {
if (is_array($loader)) { // array(???, ???)
if (is_ob... | [
"public",
"static",
"function",
"classExists",
"(",
"$",
"className",
")",
"{",
"if",
"(",
"class_exists",
"(",
"$",
"className",
",",
"false",
")",
"||",
"interface_exists",
"(",
"$",
"className",
",",
"false",
")",
")",
"{",
"return",
"true",
";",
"}",... | Checks whether a class with a given name exists. A class "exists" if it is either
already defined in the current request or if there is an autoloader on the SPL
autoload stack that is a) responsible for the class in question and b) is able to
load a class file in which the class definition resides.
If the class is not... | [
"Checks",
"whether",
"a",
"class",
"with",
"a",
"given",
"name",
"exists",
".",
"A",
"class",
"exists",
"if",
"it",
"is",
"either",
"already",
"defined",
"in",
"the",
"current",
"request",
"or",
"if",
"there",
"is",
"an",
"autoloader",
"on",
"the",
"SPL"... | 291ea274a86017bac173fdc7bfcd4fb13419679e | https://github.com/iriber/cose/blob/291ea274a86017bac173fdc7bfcd4fb13419679e/src/main/php/Cose/utils/ClassLoader.php#L189-L218 |
7,717 | Rehyved/php-utilities | src/Rehyved/Utilities/Mapper/ObjectMapper.php | ObjectMapper.mapObjectToArray | public function mapObjectToArray($object, string $prefix = "")
{
if (!is_object($object)) {
return $object;
}
if (get_class($object) === \stdClass::class) {
return (array)$object;
}
$objectClass = new \ReflectionClass($object);
$objectPropert... | php | public function mapObjectToArray($object, string $prefix = "")
{
if (!is_object($object)) {
return $object;
}
if (get_class($object) === \stdClass::class) {
return (array)$object;
}
$objectClass = new \ReflectionClass($object);
$objectPropert... | [
"public",
"function",
"mapObjectToArray",
"(",
"$",
"object",
",",
"string",
"$",
"prefix",
"=",
"\"\"",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"object",
")",
")",
"{",
"return",
"$",
"object",
";",
"}",
"if",
"(",
"get_class",
"(",
"$",
... | Maps the provided object to an array or returns the provided object if it was of a built-in primitive type
By using the 'arrayOf' annotation in the object's class for properties of type array the mapper will map these to
arrays recursively.
@param mixed $object The object to map to an array
@param string $prefix with... | [
"Maps",
"the",
"provided",
"object",
"to",
"an",
"array",
"or",
"returns",
"the",
"provided",
"object",
"if",
"it",
"was",
"of",
"a",
"built",
"-",
"in",
"primitive",
"type"
] | fae3754576eab4cf33ad99c5143aa1f972c325bd | https://github.com/Rehyved/php-utilities/blob/fae3754576eab4cf33ad99c5143aa1f972c325bd/src/Rehyved/Utilities/Mapper/ObjectMapper.php#L287-L331 |
7,718 | LaBlog/LaBlog | src/Lablog/Lablog/Post/JsonPostConfig.php | JsonPostConfig.strip | public function strip($postContent, $wrap)
{
$pattern = '/'.$wrap.'(.*?)'.$wrap.'/s';
$match = preg_match($pattern, $postContent, $matches);
if ($match) {
$post['config'] = $matches[1];
$post['content'] = str_replace($matches[0], '', $postContent);
return... | php | public function strip($postContent, $wrap)
{
$pattern = '/'.$wrap.'(.*?)'.$wrap.'/s';
$match = preg_match($pattern, $postContent, $matches);
if ($match) {
$post['config'] = $matches[1];
$post['content'] = str_replace($matches[0], '', $postContent);
return... | [
"public",
"function",
"strip",
"(",
"$",
"postContent",
",",
"$",
"wrap",
")",
"{",
"$",
"pattern",
"=",
"'/'",
".",
"$",
"wrap",
".",
"'(.*?)'",
".",
"$",
"wrap",
".",
"'/s'",
";",
"$",
"match",
"=",
"preg_match",
"(",
"$",
"pattern",
",",
"$",
... | Strip the config from the post and return the config and content
in an array.
@param string $postContent
@param string $wrap
@return array | [
"Strip",
"the",
"config",
"from",
"the",
"post",
"and",
"return",
"the",
"config",
"and",
"content",
"in",
"an",
"array",
"."
] | d23f7848bd9a3993cbb5913d967626e9914a009c | https://github.com/LaBlog/LaBlog/blob/d23f7848bd9a3993cbb5913d967626e9914a009c/src/Lablog/Lablog/Post/JsonPostConfig.php#L19-L31 |
7,719 | pletfix/core | src/Services/CommandFactory.php | CommandFactory.listCommands | private function listCommands(array &$list, $path, $namespace)
{
$classes = [];
list_classes($classes, $path, $namespace);
foreach ($classes as $class) {
/** @var CommandContract $command */
$command = new $class;
$name = $command->name();
$des... | php | private function listCommands(array &$list, $path, $namespace)
{
$classes = [];
list_classes($classes, $path, $namespace);
foreach ($classes as $class) {
/** @var CommandContract $command */
$command = new $class;
$name = $command->name();
$des... | [
"private",
"function",
"listCommands",
"(",
"array",
"&",
"$",
"list",
",",
"$",
"path",
",",
"$",
"namespace",
")",
"{",
"$",
"classes",
"=",
"[",
"]",
";",
"list_classes",
"(",
"$",
"classes",
",",
"$",
"path",
",",
"$",
"namespace",
")",
";",
"f... | Read available commands recursive from given path.
@param array &$list Receives the command information
@param string $path
@param string $namespace | [
"Read",
"available",
"commands",
"recursive",
"from",
"given",
"path",
"."
] | 974945500f278eb6c1779832e08bbfca1007a7b3 | https://github.com/pletfix/core/blob/974945500f278eb6c1779832e08bbfca1007a7b3/src/Services/CommandFactory.php#L87-L98 |
7,720 | pletfix/core | src/Services/CommandFactory.php | CommandFactory.createCommandList | private function createCommandList()
{
$list = [];
// read all core commands
$this->listCommands($list, __DIR__ . '/../Commands', 'Core\Commands');
// merge all plugin commands (plugin overrides the core)
if (file_exists($this->pluginManifestOfCommands)) {
/** @... | php | private function createCommandList()
{
$list = [];
// read all core commands
$this->listCommands($list, __DIR__ . '/../Commands', 'Core\Commands');
// merge all plugin commands (plugin overrides the core)
if (file_exists($this->pluginManifestOfCommands)) {
/** @... | [
"private",
"function",
"createCommandList",
"(",
")",
"{",
"$",
"list",
"=",
"[",
"]",
";",
"// read all core commands",
"$",
"this",
"->",
"listCommands",
"(",
"$",
"list",
",",
"__DIR__",
".",
"'/../Commands'",
",",
"'Core\\Commands'",
")",
";",
"// merge al... | Create a new command list.
@return array | [
"Create",
"a",
"new",
"command",
"list",
"."
] | 974945500f278eb6c1779832e08bbfca1007a7b3 | https://github.com/pletfix/core/blob/974945500f278eb6c1779832e08bbfca1007a7b3/src/Services/CommandFactory.php#L105-L125 |
7,721 | pletfix/core | src/Services/CommandFactory.php | CommandFactory.isCacheUpToDate | private function isCacheUpToDate()
{
if (!file_exists($this->cachedFile)) {
return false;
}
$cacheTime = filemtime($this->cachedFile);
$mTime = $this->modificationTime();
return $cacheTime == $mTime;
} | php | private function isCacheUpToDate()
{
if (!file_exists($this->cachedFile)) {
return false;
}
$cacheTime = filemtime($this->cachedFile);
$mTime = $this->modificationTime();
return $cacheTime == $mTime;
} | [
"private",
"function",
"isCacheUpToDate",
"(",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"this",
"->",
"cachedFile",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"cacheTime",
"=",
"filemtime",
"(",
"$",
"this",
"->",
"cachedFile",
")",
";"... | Determine if the cached file is up to date with the command folder.
@return bool | [
"Determine",
"if",
"the",
"cached",
"file",
"is",
"up",
"to",
"date",
"with",
"the",
"command",
"folder",
"."
] | 974945500f278eb6c1779832e08bbfca1007a7b3 | https://github.com/pletfix/core/blob/974945500f278eb6c1779832e08bbfca1007a7b3/src/Services/CommandFactory.php#L132-L142 |
7,722 | pletfix/core | src/Services/CommandFactory.php | CommandFactory.saveCommandListToCache | private function saveCommandListToCache($list)
{
if (!is_dir($cacheDir = dirname($this->cachedFile))) {
if (!make_dir($cacheDir, 0775)) {
throw new RuntimeException(sprintf('Command factory was not able to create directory "%s"', $cacheDir)); // @codeCoverageIgnore
}
... | php | private function saveCommandListToCache($list)
{
if (!is_dir($cacheDir = dirname($this->cachedFile))) {
if (!make_dir($cacheDir, 0775)) {
throw new RuntimeException(sprintf('Command factory was not able to create directory "%s"', $cacheDir)); // @codeCoverageIgnore
}
... | [
"private",
"function",
"saveCommandListToCache",
"(",
"$",
"list",
")",
"{",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"cacheDir",
"=",
"dirname",
"(",
"$",
"this",
"->",
"cachedFile",
")",
")",
")",
"{",
"if",
"(",
"!",
"make_dir",
"(",
"$",
"cacheDir",
"... | Save the command list to the cache.
@param array $list | [
"Save",
"the",
"command",
"list",
"to",
"the",
"cache",
"."
] | 974945500f278eb6c1779832e08bbfca1007a7b3 | https://github.com/pletfix/core/blob/974945500f278eb6c1779832e08bbfca1007a7b3/src/Services/CommandFactory.php#L160-L183 |
7,723 | pletfix/core | src/Services/CommandFactory.php | CommandFactory.modificationTime | private function modificationTime()
{
return max(
file_exists($this->pluginManifestOfCommands) ? filemtime($this->pluginManifestOfCommands) : 0,
filemtime(__DIR__ . '/../Commands'),
file_exists(app_path('Commands')) ? filemtime(app_path('Commands')) : 0
);
} | php | private function modificationTime()
{
return max(
file_exists($this->pluginManifestOfCommands) ? filemtime($this->pluginManifestOfCommands) : 0,
filemtime(__DIR__ . '/../Commands'),
file_exists(app_path('Commands')) ? filemtime(app_path('Commands')) : 0
);
} | [
"private",
"function",
"modificationTime",
"(",
")",
"{",
"return",
"max",
"(",
"file_exists",
"(",
"$",
"this",
"->",
"pluginManifestOfCommands",
")",
"?",
"filemtime",
"(",
"$",
"this",
"->",
"pluginManifestOfCommands",
")",
":",
"0",
",",
"filemtime",
"(",
... | Gets the modification time.
@return int | [
"Gets",
"the",
"modification",
"time",
"."
] | 974945500f278eb6c1779832e08bbfca1007a7b3 | https://github.com/pletfix/core/blob/974945500f278eb6c1779832e08bbfca1007a7b3/src/Services/CommandFactory.php#L190-L197 |
7,724 | coolms/common | src/Form/MessagesTrait.php | MessagesTrait.getMessages | public function getMessages($elementName = null)
{
if (null === $elementName) {
$messages = $this->messages;
foreach ($this->iterator as $name => $element) {
$messageSet = $element->getMessages();
if (!is_array($messageSet) &&
!$mes... | php | public function getMessages($elementName = null)
{
if (null === $elementName) {
$messages = $this->messages;
foreach ($this->iterator as $name => $element) {
$messageSet = $element->getMessages();
if (!is_array($messageSet) &&
!$mes... | [
"public",
"function",
"getMessages",
"(",
"$",
"elementName",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"elementName",
")",
"{",
"$",
"messages",
"=",
"$",
"this",
"->",
"messages",
";",
"foreach",
"(",
"$",
"this",
"->",
"iterator",
"as",
... | Get validation error messages, if any
Returns a hash of element names/messages for all elements failing
validation, or, if $elementName is provided, messages for that element
only.
@param null|string $elementName
@return array|Traversable
@throws Exception\InvalidArgumentException | [
"Get",
"validation",
"error",
"messages",
"if",
"any"
] | 3572993cdcdb2898cdde396a2f1de9864b193660 | https://github.com/coolms/common/blob/3572993cdcdb2898cdde396a2f1de9864b193660/src/Form/MessagesTrait.php#L67-L96 |
7,725 | orkestra/orkestra-common | lib/Orkestra/Common/Type/DateTime.php | DateTime.createFromFormat | public static function createFromFormat($format, $time, $timezone = null)
{
if (null === $timezone) {
$timezone = self::getServerTimezone();
}
if (null === $timezone) {
// This is necessary due to how native DateTime handles passing null for a timezone (it doesnt)
... | php | public static function createFromFormat($format, $time, $timezone = null)
{
if (null === $timezone) {
$timezone = self::getServerTimezone();
}
if (null === $timezone) {
// This is necessary due to how native DateTime handles passing null for a timezone (it doesnt)
... | [
"public",
"static",
"function",
"createFromFormat",
"(",
"$",
"format",
",",
"$",
"time",
",",
"$",
"timezone",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"timezone",
")",
"{",
"$",
"timezone",
"=",
"self",
"::",
"getServerTimezone",
"(",
")... | Create From Format
@param string $format
@param string $time
@param \DateTimeZone|null $timezone
@throws \Orkestra\Common\Exception\TypeException
@return \Orkestra\Common\Type\DateTime | [
"Create",
"From",
"Format"
] | 620d62d41cd1d95365294e5bb0ae203a744b71cb | https://github.com/orkestra/orkestra-common/blob/620d62d41cd1d95365294e5bb0ae203a744b71cb/lib/Orkestra/Common/Type/DateTime.php#L47-L70 |
7,726 | codebobbly/dvoconnector | Classes/Service/AssociationsApiService.php | AssociationsApiService.getEventsFromRootAssociations | public function getEventsFromRootAssociations($apiServiceFilterContext = null)
{
$result = [];
foreach ($this->getRootAssociationIDs() as $key => $rootAssociationID) {
try {
$result[] = $this->getChildAssociationsFromAssociation($rootAssociationID, $apiServiceFilterConte... | php | public function getEventsFromRootAssociations($apiServiceFilterContext = null)
{
$result = [];
foreach ($this->getRootAssociationIDs() as $key => $rootAssociationID) {
try {
$result[] = $this->getChildAssociationsFromAssociation($rootAssociationID, $apiServiceFilterConte... | [
"public",
"function",
"getEventsFromRootAssociations",
"(",
"$",
"apiServiceFilterContext",
"=",
"null",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"getRootAssociationIDs",
"(",
")",
"as",
"$",
"key",
"=>",
"$",
"rootAsso... | return a list of events from the root associations
@param \RGU\Dvoconnector\Service\ApiServiceFilterContext $apiServiceFilterContext
@return \SimpleXMLElement XML data | [
"return",
"a",
"list",
"of",
"events",
"from",
"the",
"root",
"associations"
] | 9b63790d2fc9fd21bf415b4a5757678895b73bbc | https://github.com/codebobbly/dvoconnector/blob/9b63790d2fc9fd21bf415b4a5757678895b73bbc/Classes/Service/AssociationsApiService.php#L145-L160 |
7,727 | codebobbly/dvoconnector | Classes/Service/AssociationsApiService.php | AssociationsApiService.getAnnouncementsFromRootAssociations | public function getAnnouncementsFromRootAssociations($apiServiceFilterContext = null)
{
$result = [];
foreach ($this->getRootAssociationIDs() as $key => $rootAssociationID) {
try {
$result[] = $this->getAnnouncementsFromAssociation($rootAssociationID, $apiServiceFilterCo... | php | public function getAnnouncementsFromRootAssociations($apiServiceFilterContext = null)
{
$result = [];
foreach ($this->getRootAssociationIDs() as $key => $rootAssociationID) {
try {
$result[] = $this->getAnnouncementsFromAssociation($rootAssociationID, $apiServiceFilterCo... | [
"public",
"function",
"getAnnouncementsFromRootAssociations",
"(",
"$",
"apiServiceFilterContext",
"=",
"null",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"getRootAssociationIDs",
"(",
")",
"as",
"$",
"key",
"=>",
"$",
"r... | return a list of announcements from the root associations
@param \RGU\Dvoconnector\Service\ApiServiceFilterContext $apiServiceFilterContext
@return array XML data | [
"return",
"a",
"list",
"of",
"announcements",
"from",
"the",
"root",
"associations"
] | 9b63790d2fc9fd21bf415b4a5757678895b73bbc | https://github.com/codebobbly/dvoconnector/blob/9b63790d2fc9fd21bf415b4a5757678895b73bbc/Classes/Service/AssociationsApiService.php#L219-L234 |
7,728 | codebobbly/dvoconnector | Classes/Service/AssociationsApiService.php | AssociationsApiService.getAnnouncementsFromAssociation | public function getAnnouncementsFromAssociation($aid, $apiServiceFilterContext = null)
{
$apiServiceFilterContext = $this->checkApiServiceFilterContext($apiServiceFilterContext, $aid);
$url = $this->getBaseApiUrl() . '/associations/' . $aid . '/announcements';
$params = null;
$xml... | php | public function getAnnouncementsFromAssociation($aid, $apiServiceFilterContext = null)
{
$apiServiceFilterContext = $this->checkApiServiceFilterContext($apiServiceFilterContext, $aid);
$url = $this->getBaseApiUrl() . '/associations/' . $aid . '/announcements';
$params = null;
$xml... | [
"public",
"function",
"getAnnouncementsFromAssociation",
"(",
"$",
"aid",
",",
"$",
"apiServiceFilterContext",
"=",
"null",
")",
"{",
"$",
"apiServiceFilterContext",
"=",
"$",
"this",
"->",
"checkApiServiceFilterContext",
"(",
"$",
"apiServiceFilterContext",
",",
"$",... | return a list of announcements from a association
@param string association id
@param \RGU\Dvoconnector\Service\ApiServiceFilterContext $apiServiceFilterContext
@return \SimpleXMLElement XML data | [
"return",
"a",
"list",
"of",
"announcements",
"from",
"a",
"association"
] | 9b63790d2fc9fd21bf415b4a5757678895b73bbc | https://github.com/codebobbly/dvoconnector/blob/9b63790d2fc9fd21bf415b4a5757678895b73bbc/Classes/Service/AssociationsApiService.php#L244-L257 |
7,729 | codebobbly/dvoconnector | Classes/Service/AssociationsApiService.php | AssociationsApiService.getFunctionariesFromAssociation | public function getFunctionariesFromAssociation($aid, $apiServiceFilterContext = null)
{
$apiServiceFilterContext = $this->checkApiServiceFilterContext($apiServiceFilterContext, $aid);
$url = $this->getBaseApiUrl() . '/associations/' . $aid . '/functionaries';
$params = null;
$xml... | php | public function getFunctionariesFromAssociation($aid, $apiServiceFilterContext = null)
{
$apiServiceFilterContext = $this->checkApiServiceFilterContext($apiServiceFilterContext, $aid);
$url = $this->getBaseApiUrl() . '/associations/' . $aid . '/functionaries';
$params = null;
$xml... | [
"public",
"function",
"getFunctionariesFromAssociation",
"(",
"$",
"aid",
",",
"$",
"apiServiceFilterContext",
"=",
"null",
")",
"{",
"$",
"apiServiceFilterContext",
"=",
"$",
"this",
"->",
"checkApiServiceFilterContext",
"(",
"$",
"apiServiceFilterContext",
",",
"$",... | return a list of functionaries from a association
@param string association id
@param \RGU\Dvoconnector\Service\ApiServiceFilterContext $apiServiceFilterContext
@return \SimpleXMLElement XML data | [
"return",
"a",
"list",
"of",
"functionaries",
"from",
"a",
"association"
] | 9b63790d2fc9fd21bf415b4a5757678895b73bbc | https://github.com/codebobbly/dvoconnector/blob/9b63790d2fc9fd21bf415b4a5757678895b73bbc/Classes/Service/AssociationsApiService.php#L317-L343 |
7,730 | codebobbly/dvoconnector | Classes/Service/AssociationsApiService.php | AssociationsApiService.getFunctionariesFromRootAssociations | public function getFunctionariesFromRootAssociations($apiServiceFilterContext = null)
{
$result = [];
foreach ($this->getRootAssociationIDs() as $key => $rootAssociationID) {
try {
$result[] = $this->getFunctionariesFromAssociation($rootAssociationID, $apiServiceFilterCo... | php | public function getFunctionariesFromRootAssociations($apiServiceFilterContext = null)
{
$result = [];
foreach ($this->getRootAssociationIDs() as $key => $rootAssociationID) {
try {
$result[] = $this->getFunctionariesFromAssociation($rootAssociationID, $apiServiceFilterCo... | [
"public",
"function",
"getFunctionariesFromRootAssociations",
"(",
"$",
"apiServiceFilterContext",
"=",
"null",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"getRootAssociationIDs",
"(",
")",
"as",
"$",
"key",
"=>",
"$",
"r... | return a list of functionaries from the root associations
@param \RGU\Dvoconnector\Service\ApiServiceFilterContext $apiServiceFilterContext
@return \SimpleXMLElement XML data | [
"return",
"a",
"list",
"of",
"functionaries",
"from",
"the",
"root",
"associations"
] | 9b63790d2fc9fd21bf415b4a5757678895b73bbc | https://github.com/codebobbly/dvoconnector/blob/9b63790d2fc9fd21bf415b4a5757678895b73bbc/Classes/Service/AssociationsApiService.php#L352-L367 |
7,731 | codebobbly/dvoconnector | Classes/Service/AssociationsApiService.php | AssociationsApiService.getFunctionaryFromAssociation | public function getFunctionaryFromAssociation($aid, $fid, $apiServiceFilterContext = null)
{
$apiServiceFilterContext = $this->checkApiServiceFilterContext($apiServiceFilterContext, $aid);
$url = $this->getBaseApiUrl() . '/associations/' . $aid . '/functionaries/' . $fid . '';
$params = nu... | php | public function getFunctionaryFromAssociation($aid, $fid, $apiServiceFilterContext = null)
{
$apiServiceFilterContext = $this->checkApiServiceFilterContext($apiServiceFilterContext, $aid);
$url = $this->getBaseApiUrl() . '/associations/' . $aid . '/functionaries/' . $fid . '';
$params = nu... | [
"public",
"function",
"getFunctionaryFromAssociation",
"(",
"$",
"aid",
",",
"$",
"fid",
",",
"$",
"apiServiceFilterContext",
"=",
"null",
")",
"{",
"$",
"apiServiceFilterContext",
"=",
"$",
"this",
"->",
"checkApiServiceFilterContext",
"(",
"$",
"apiServiceFilterCo... | return a functionary from a association
@param string association id
@param string functionary id
@param \RGU\Dvoconnector\Service\ApiServiceFilterContext $apiServiceFilterContext
@return \SimpleXMLElement XML data | [
"return",
"a",
"functionary",
"from",
"a",
"association"
] | 9b63790d2fc9fd21bf415b4a5757678895b73bbc | https://github.com/codebobbly/dvoconnector/blob/9b63790d2fc9fd21bf415b4a5757678895b73bbc/Classes/Service/AssociationsApiService.php#L378-L391 |
7,732 | codebobbly/dvoconnector | Classes/Service/AssociationsApiService.php | AssociationsApiService.checkApiServiceFilterContext | protected function checkApiServiceFilterContext($apiServiceFilterContext = null, $aID = null)
{
if (is_null($apiServiceFilterContext)) {
$resultApiServiceFilterContext = new \RGU\Dvoconnector\Domain\Filter\GenericFilterContext();
} else {
$resultApiServiceFilterContext = clon... | php | protected function checkApiServiceFilterContext($apiServiceFilterContext = null, $aID = null)
{
if (is_null($apiServiceFilterContext)) {
$resultApiServiceFilterContext = new \RGU\Dvoconnector\Domain\Filter\GenericFilterContext();
} else {
$resultApiServiceFilterContext = clon... | [
"protected",
"function",
"checkApiServiceFilterContext",
"(",
"$",
"apiServiceFilterContext",
"=",
"null",
",",
"$",
"aID",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"apiServiceFilterContext",
")",
")",
"{",
"$",
"resultApiServiceFilterContext",
"=",
... | check that the filter has a inside association value
@param \RGU\Dvoconnector\Service\ApiServiceFilterContext $apiServiceFilterContext
@param string $aID association ID
@return \RGU\Dvoconnector\Service\ApiServiceFilterContext | [
"check",
"that",
"the",
"filter",
"has",
"a",
"inside",
"association",
"value"
] | 9b63790d2fc9fd21bf415b4a5757678895b73bbc | https://github.com/codebobbly/dvoconnector/blob/9b63790d2fc9fd21bf415b4a5757678895b73bbc/Classes/Service/AssociationsApiService.php#L427-L440 |
7,733 | mtils/ems-signal | src/Signal/NamedEvent/FireTrait.php | FireTrait.fireIfNamed | public function fireIfNamed($event, $payload=[], $halt=false)
{
if(!$event){
return;
}
return $this->fire($event, $payload, $halt);
} | php | public function fireIfNamed($event, $payload=[], $halt=false)
{
if(!$event){
return;
}
return $this->fire($event, $payload, $halt);
} | [
"public",
"function",
"fireIfNamed",
"(",
"$",
"event",
",",
"$",
"payload",
"=",
"[",
"]",
",",
"$",
"halt",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"event",
")",
"{",
"return",
";",
"}",
"return",
"$",
"this",
"->",
"fire",
"(",
"$",
"ev... | Fire an event if a name was passed
@param string $event The event name
@param array $payload The event parameters
@param bool $halt Stop propagation on trueish return values
@return mixed
@see self::fire() | [
"Fire",
"an",
"event",
"if",
"a",
"name",
"was",
"passed"
] | 3246eea699dce1a6d6f758bcfc89b20320f6becc | https://github.com/mtils/ems-signal/blob/3246eea699dce1a6d6f758bcfc89b20320f6becc/src/Signal/NamedEvent/FireTrait.php#L40-L46 |
7,734 | mtils/ems-signal | src/Signal/NamedEvent/FireTrait.php | FireTrait.fireOnce | public function fireOnce($event, $payload=[], $halt=false)
{
if(isset($this->firedEvents[$event])){
return;
}
return $this->fire($event, $payload, $halt);
} | php | public function fireOnce($event, $payload=[], $halt=false)
{
if(isset($this->firedEvents[$event])){
return;
}
return $this->fire($event, $payload, $halt);
} | [
"public",
"function",
"fireOnce",
"(",
"$",
"event",
",",
"$",
"payload",
"=",
"[",
"]",
",",
"$",
"halt",
"=",
"false",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"firedEvents",
"[",
"$",
"event",
"]",
")",
")",
"{",
"return",
";",
... | Fire an event once. The next event with this name will be ignored
@param string $event The event name
@param array $payload The event parameters
@param bool $halt Stop propagation on trueish return values
@return mixed
@see self::fire() | [
"Fire",
"an",
"event",
"once",
".",
"The",
"next",
"event",
"with",
"this",
"name",
"will",
"be",
"ignored"
] | 3246eea699dce1a6d6f758bcfc89b20320f6becc | https://github.com/mtils/ems-signal/blob/3246eea699dce1a6d6f758bcfc89b20320f6becc/src/Signal/NamedEvent/FireTrait.php#L57-L63 |
7,735 | mtils/ems-signal | src/Signal/NamedEvent/FireTrait.php | FireTrait.fireOnceIfNamed | public function fireOnceIfNamed($event, $payload=[], $halt=false)
{
if(!$event){
return;
}
return $this->fireOnce($event, $payload, $halt);
} | php | public function fireOnceIfNamed($event, $payload=[], $halt=false)
{
if(!$event){
return;
}
return $this->fireOnce($event, $payload, $halt);
} | [
"public",
"function",
"fireOnceIfNamed",
"(",
"$",
"event",
",",
"$",
"payload",
"=",
"[",
"]",
",",
"$",
"halt",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"event",
")",
"{",
"return",
";",
"}",
"return",
"$",
"this",
"->",
"fireOnce",
"(",
"$... | Fire an event once if named
@param string $event The event name
@param array $payload The event parameters
@param bool $halt Stop propagation on trueish return values
@return mixed
@see self::fire() | [
"Fire",
"an",
"event",
"once",
"if",
"named"
] | 3246eea699dce1a6d6f758bcfc89b20320f6becc | https://github.com/mtils/ems-signal/blob/3246eea699dce1a6d6f758bcfc89b20320f6becc/src/Signal/NamedEvent/FireTrait.php#L74-L80 |
7,736 | jivoo/http | src/ActionRequest.php | ActionRequest.accepts | public function accepts($type = null)
{
if (!isset($type)) {
return $this->attributes['accepts'];
}
return in_array($type, $this->attributes['accepts']);
} | php | public function accepts($type = null)
{
if (!isset($type)) {
return $this->attributes['accepts'];
}
return in_array($type, $this->attributes['accepts']);
} | [
"public",
"function",
"accepts",
"(",
"$",
"type",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"type",
")",
")",
"{",
"return",
"$",
"this",
"->",
"attributes",
"[",
"'accepts'",
"]",
";",
"}",
"return",
"in_array",
"(",
"$",
"type",
... | Whether or not the client accepts the specified type. If the type is
omitted then a list of acceptable types is returned.
@param string $type MIME type.
@return bool|string[] True if client accepts provided type, false otherwise.
List of accepted MIME types if type parameter omitted. | [
"Whether",
"or",
"not",
"the",
"client",
"accepts",
"the",
"specified",
"type",
".",
"If",
"the",
"type",
"is",
"omitted",
"then",
"a",
"list",
"of",
"acceptable",
"types",
"is",
"returned",
"."
] | 3c1d8dba66978bc91fc2b324dd941e5da3b253bc | https://github.com/jivoo/http/blob/3c1d8dba66978bc91fc2b324dd941e5da3b253bc/src/ActionRequest.php#L117-L123 |
7,737 | jivoo/http | src/ActionRequest.php | ActionRequest.acceptsEncoding | public function acceptsEncoding($encoding = null)
{
if (!isset($encoding)) {
return $this->attributes['encodings'];
}
return in_array($encoding, $this->attributes['encodings']);
} | php | public function acceptsEncoding($encoding = null)
{
if (!isset($encoding)) {
return $this->attributes['encodings'];
}
return in_array($encoding, $this->attributes['encodings']);
} | [
"public",
"function",
"acceptsEncoding",
"(",
"$",
"encoding",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"encoding",
")",
")",
"{",
"return",
"$",
"this",
"->",
"attributes",
"[",
"'encodings'",
"]",
";",
"}",
"return",
"in_array",
"(",... | Whether or not the client accepts the specified encoding. If the type is
omitted then a list of acceptable encodings is returned.
@param string $encoding Encoding.
@return bool|string[] True if client accepts provided encoding, false otherwise.
List of accepted encodings if type parameter omitted. | [
"Whether",
"or",
"not",
"the",
"client",
"accepts",
"the",
"specified",
"encoding",
".",
"If",
"the",
"type",
"is",
"omitted",
"then",
"a",
"list",
"of",
"acceptable",
"encodings",
"is",
"returned",
"."
] | 3c1d8dba66978bc91fc2b324dd941e5da3b253bc | https://github.com/jivoo/http/blob/3c1d8dba66978bc91fc2b324dd941e5da3b253bc/src/ActionRequest.php#L133-L139 |
7,738 | jivoo/http | src/ActionRequest.php | ActionRequest.pathToString | public function pathToString($path, $rewrite = false)
{
if (is_string($path)) {
return $path;
}
$str = $this->basePath;
if ($str == '/') {
$str = '';
}
if (! ($this->rewrite or $rewrite)) {
$str .= '/' . $this->scriptName;
}... | php | public function pathToString($path, $rewrite = false)
{
if (is_string($path)) {
return $path;
}
$str = $this->basePath;
if ($str == '/') {
$str = '';
}
if (! ($this->rewrite or $rewrite)) {
$str .= '/' . $this->scriptName;
}... | [
"public",
"function",
"pathToString",
"(",
"$",
"path",
",",
"$",
"rewrite",
"=",
"false",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"path",
")",
")",
"{",
"return",
"$",
"path",
";",
"}",
"$",
"str",
"=",
"$",
"this",
"->",
"basePath",
";",
"i... | Convert path array to a string.
@param string|string[] $path Path array or absolute url.
@param bool $rewrite Whether to force removal of script name from path.
@return string Path string. | [
"Convert",
"path",
"array",
"to",
"a",
"string",
"."
] | 3c1d8dba66978bc91fc2b324dd941e5da3b253bc | https://github.com/jivoo/http/blob/3c1d8dba66978bc91fc2b324dd941e5da3b253bc/src/ActionRequest.php#L210-L228 |
7,739 | jivoo/http | src/ActionRequest.php | ActionRequest.findPath | public static function findPath(\Psr\Http\Message\ServerRequestInterface $request)
{
$server = $request->getServerParams();
$path = $request->getUri()->getPath();
if (isset($server['SCRIPT_NAME'])) {
$basePath = dirname($server['SCRIPT_NAME']);
if ($basePath != '/') {... | php | public static function findPath(\Psr\Http\Message\ServerRequestInterface $request)
{
$server = $request->getServerParams();
$path = $request->getUri()->getPath();
if (isset($server['SCRIPT_NAME'])) {
$basePath = dirname($server['SCRIPT_NAME']);
if ($basePath != '/') {... | [
"public",
"static",
"function",
"findPath",
"(",
"\\",
"Psr",
"\\",
"Http",
"\\",
"Message",
"\\",
"ServerRequestInterface",
"$",
"request",
")",
"{",
"$",
"server",
"=",
"$",
"request",
"->",
"getServerParams",
"(",
")",
";",
"$",
"path",
"=",
"$",
"req... | Find the path array for a request.
@param \Psr\Http\Message\ServerRequestInterface $request
@return string[] | [
"Find",
"the",
"path",
"array",
"for",
"a",
"request",
"."
] | 3c1d8dba66978bc91fc2b324dd941e5da3b253bc | https://github.com/jivoo/http/blob/3c1d8dba66978bc91fc2b324dd941e5da3b253bc/src/ActionRequest.php#L236-L256 |
7,740 | phlexible/phlexible | src/Phlexible/Bundle/ElementtypeBundle/Doctrine/ViabilityManager.php | ViabilityManager.updateViability | public function updateViability(Elementtype $elementtype, array $parentIds)
{
$viabilityRepository = $this->entityManager->getRepository('PhlexibleElementtypeBundle:ElementtypeApply');
$viabilities = $viabilityRepository->findBy(['elementtypeId' => $elementtype->getId()]);
foreach ($viabil... | php | public function updateViability(Elementtype $elementtype, array $parentIds)
{
$viabilityRepository = $this->entityManager->getRepository('PhlexibleElementtypeBundle:ElementtypeApply');
$viabilities = $viabilityRepository->findBy(['elementtypeId' => $elementtype->getId()]);
foreach ($viabil... | [
"public",
"function",
"updateViability",
"(",
"Elementtype",
"$",
"elementtype",
",",
"array",
"$",
"parentIds",
")",
"{",
"$",
"viabilityRepository",
"=",
"$",
"this",
"->",
"entityManager",
"->",
"getRepository",
"(",
"'PhlexibleElementtypeBundle:ElementtypeApply'",
... | Update viability.
@param Elementtype $elementtype
@param array $parentIds
@return $this | [
"Update",
"viability",
"."
] | 132f24924c9bb0dbb6c1ea84db0a463f97fa3893 | https://github.com/phlexible/phlexible/blob/132f24924c9bb0dbb6c1ea84db0a463f97fa3893/src/Phlexible/Bundle/ElementtypeBundle/Doctrine/ViabilityManager.php#L71-L98 |
7,741 | wasabi-cms/cms | src/Event/RouteListener.php | RouteListener.decoratePublishedQuery | public function decoratePublishedQuery(Event $event)
{
$query = $event->subject();
// Join the PagesTable
$query
->select(['Pages.id'])
->join([
'Pages' => [
'table' => 'cms_pages',
'type' => 'LEFT',
... | php | public function decoratePublishedQuery(Event $event)
{
$query = $event->subject();
// Join the PagesTable
$query
->select(['Pages.id'])
->join([
'Pages' => [
'table' => 'cms_pages',
'type' => 'LEFT',
... | [
"public",
"function",
"decoratePublishedQuery",
"(",
"Event",
"$",
"event",
")",
"{",
"$",
"query",
"=",
"$",
"event",
"->",
"subject",
"(",
")",
";",
"// Join the PagesTable",
"$",
"query",
"->",
"select",
"(",
"[",
"'Pages.id'",
"]",
")",
"->",
"join",
... | Decorate the given query by joining the PagesTable.
@param Event $event
@return void | [
"Decorate",
"the",
"given",
"query",
"by",
"joining",
"the",
"PagesTable",
"."
] | 2787b6422ea1d719cf49951b3253fd0ac31d22ca | https://github.com/wasabi-cms/cms/blob/2787b6422ea1d719cf49951b3253fd0ac31d22ca/src/Event/RouteListener.php#L97-L115 |
7,742 | zicht/z-plugin-log | log/Plugin.php | Plugin.slackify | private function slackify($data)
{
$fields = array();
foreach ($data as $key => $value) {
$obj = new \stdClass();
$obj->title = $key;
$obj->value = $value;
$obj->short = true;
$fields[] = $obj;
}
return array('text' => sp... | php | private function slackify($data)
{
$fields = array();
foreach ($data as $key => $value) {
$obj = new \stdClass();
$obj->title = $key;
$obj->value = $value;
$obj->short = true;
$fields[] = $obj;
}
return array('text' => sp... | [
"private",
"function",
"slackify",
"(",
"$",
"data",
")",
"{",
"$",
"fields",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"data",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"obj",
"=",
"new",
"\\",
"stdClass",
"(",
")",
";",
"$"... | Format the data in slack format
@param $data
@return string | [
"Format",
"the",
"data",
"in",
"slack",
"format"
] | 4d738990500e5318e3e13f020b99e2f576f61728 | https://github.com/zicht/z-plugin-log/blob/4d738990500e5318e3e13f020b99e2f576f61728/log/Plugin.php#L117-L131 |
7,743 | Jinxes/layton | Layton/Services/DependentService.php | DependentService.call | public function call($subject, $inherentParams = [])
{
$reflectionFunction = new ReflectionFunction($subject);
$reflectionParameters = $this->getReflectionParameters(
$reflectionFunction,
count($inherentParams)
);
$dependentInstances = [];
foreach($re... | php | public function call($subject, $inherentParams = [])
{
$reflectionFunction = new ReflectionFunction($subject);
$reflectionParameters = $this->getReflectionParameters(
$reflectionFunction,
count($inherentParams)
);
$dependentInstances = [];
foreach($re... | [
"public",
"function",
"call",
"(",
"$",
"subject",
",",
"$",
"inherentParams",
"=",
"[",
"]",
")",
"{",
"$",
"reflectionFunction",
"=",
"new",
"ReflectionFunction",
"(",
"$",
"subject",
")",
";",
"$",
"reflectionParameters",
"=",
"$",
"this",
"->",
"getRef... | reverse a function and save singleton
@param callback $subject
@param array $inherentParams
@return mixed | [
"reverse",
"a",
"function",
"and",
"save",
"singleton"
] | 27b8eab2c59b9887eb93e40a533eb77cc5690584 | https://github.com/Jinxes/layton/blob/27b8eab2c59b9887eb93e40a533eb77cc5690584/Layton/Services/DependentService.php#L48-L64 |
7,744 | Jinxes/layton | Layton/Services/DependentService.php | DependentService.getReflectionParameters | protected function getReflectionParameters($reflection, $inherentNumber)
{
$reflectionParameters = $reflection->getParameters();
return array_slice($reflectionParameters, 0, count($reflectionParameters) - $inherentNumber);
} | php | protected function getReflectionParameters($reflection, $inherentNumber)
{
$reflectionParameters = $reflection->getParameters();
return array_slice($reflectionParameters, 0, count($reflectionParameters) - $inherentNumber);
} | [
"protected",
"function",
"getReflectionParameters",
"(",
"$",
"reflection",
",",
"$",
"inherentNumber",
")",
"{",
"$",
"reflectionParameters",
"=",
"$",
"reflection",
"->",
"getParameters",
"(",
")",
";",
"return",
"array_slice",
"(",
"$",
"reflectionParameters",
... | get instances of params from Reflection
@param \Reflector $reflection
@param num $inherentNumber
@return ReflectionParameter[] | [
"get",
"instances",
"of",
"params",
"from",
"Reflection"
] | 27b8eab2c59b9887eb93e40a533eb77cc5690584 | https://github.com/Jinxes/layton/blob/27b8eab2c59b9887eb93e40a533eb77cc5690584/Layton/Services/DependentService.php#L97-L101 |
7,745 | Jinxes/layton | Layton/Services/DependentService.php | DependentService.getParams | public function getParams($reflectionClass, $method, $inherentNumber = 0)
{
$instances = [];
if (!$reflectionClass->hasMethod($method)) {
return $instances;
}
$reflection = $reflectionClass->getMethod($method);
$reflectionParameters = $this->getReflectionParamete... | php | public function getParams($reflectionClass, $method, $inherentNumber = 0)
{
$instances = [];
if (!$reflectionClass->hasMethod($method)) {
return $instances;
}
$reflection = $reflectionClass->getMethod($method);
$reflectionParameters = $this->getReflectionParamete... | [
"public",
"function",
"getParams",
"(",
"$",
"reflectionClass",
",",
"$",
"method",
",",
"$",
"inherentNumber",
"=",
"0",
")",
"{",
"$",
"instances",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"$",
"reflectionClass",
"->",
"hasMethod",
"(",
"$",
"method",
")"... | instantiation param list of method and save
@param ReflectionClass $refClass
@param string $method
@param int inherentNumber
@return array | [
"instantiation",
"param",
"list",
"of",
"method",
"and",
"save"
] | 27b8eab2c59b9887eb93e40a533eb77cc5690584 | https://github.com/Jinxes/layton/blob/27b8eab2c59b9887eb93e40a533eb77cc5690584/Layton/Services/DependentService.php#L112-L126 |
7,746 | rybakdigital/fapi | Component/Routing/Matcher.php | Matcher.match | public function match(RouteCollection $collection, Request $request)
{
// Save collection and Request
$this->collection = $collection;
$this->request = $request;
// Get candidates and ask Voter to decide which candidate mathes best
return $this->voter->vote($this->get... | php | public function match(RouteCollection $collection, Request $request)
{
// Save collection and Request
$this->collection = $collection;
$this->request = $request;
// Get candidates and ask Voter to decide which candidate mathes best
return $this->voter->vote($this->get... | [
"public",
"function",
"match",
"(",
"RouteCollection",
"$",
"collection",
",",
"Request",
"$",
"request",
")",
"{",
"// Save collection and Request",
"$",
"this",
"->",
"collection",
"=",
"$",
"collection",
";",
"$",
"this",
"->",
"request",
"=",
"$",
"request... | Matches current Request to Route | [
"Matches",
"current",
"Request",
"to",
"Route"
] | 739dfa0fc0b17ab8e8ac8f8e86484f7e62b21027 | https://github.com/rybakdigital/fapi/blob/739dfa0fc0b17ab8e8ac8f8e86484f7e62b21027/Component/Routing/Matcher.php#L50-L58 |
7,747 | rybakdigital/fapi | Component/Routing/Matcher.php | Matcher.getCandidates | public function getCandidates()
{
$candidates = array();
foreach ($this->collection->all() as $name => $route) {
$specs = array();
preg_match_all('/\{\w+\}/', $route->getPath(), $matches);
if (isset($matches[0])) {
$specs = $matches[0];
... | php | public function getCandidates()
{
$candidates = array();
foreach ($this->collection->all() as $name => $route) {
$specs = array();
preg_match_all('/\{\w+\}/', $route->getPath(), $matches);
if (isset($matches[0])) {
$specs = $matches[0];
... | [
"public",
"function",
"getCandidates",
"(",
")",
"{",
"$",
"candidates",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"collection",
"->",
"all",
"(",
")",
"as",
"$",
"name",
"=>",
"$",
"route",
")",
"{",
"$",
"specs",
"=",
"array... | Gets list of candidate Route objects for request
@return array List of Route objects | [
"Gets",
"list",
"of",
"candidate",
"Route",
"objects",
"for",
"request"
] | 739dfa0fc0b17ab8e8ac8f8e86484f7e62b21027 | https://github.com/rybakdigital/fapi/blob/739dfa0fc0b17ab8e8ac8f8e86484f7e62b21027/Component/Routing/Matcher.php#L65-L106 |
7,748 | unimatrix/cake | src/Lib/Paranoia.php | Paranoia.base64encode | public static function base64encode($input) {
return strtr(base64_encode($input), key(self::$urlSafe), current(self::$urlSafe));
} | php | public static function base64encode($input) {
return strtr(base64_encode($input), key(self::$urlSafe), current(self::$urlSafe));
} | [
"public",
"static",
"function",
"base64encode",
"(",
"$",
"input",
")",
"{",
"return",
"strtr",
"(",
"base64_encode",
"(",
"$",
"input",
")",
",",
"key",
"(",
"self",
"::",
"$",
"urlSafe",
")",
",",
"current",
"(",
"self",
"::",
"$",
"urlSafe",
")",
... | Perform a URL safe base64 encode
@param string $input
@return string | [
"Perform",
"a",
"URL",
"safe",
"base64",
"encode"
] | 23003aba497822bd473fdbf60514052dda1874fc | https://github.com/unimatrix/cake/blob/23003aba497822bd473fdbf60514052dda1874fc/src/Lib/Paranoia.php#L121-L123 |
7,749 | unimatrix/cake | src/Lib/Paranoia.php | Paranoia.base64decode | public static function base64decode($input) {
return base64_decode(str_pad(strtr($input, current(self::$urlSafe), key(self::$urlSafe)), strlen($input) % 4, '=', STR_PAD_RIGHT));
} | php | public static function base64decode($input) {
return base64_decode(str_pad(strtr($input, current(self::$urlSafe), key(self::$urlSafe)), strlen($input) % 4, '=', STR_PAD_RIGHT));
} | [
"public",
"static",
"function",
"base64decode",
"(",
"$",
"input",
")",
"{",
"return",
"base64_decode",
"(",
"str_pad",
"(",
"strtr",
"(",
"$",
"input",
",",
"current",
"(",
"self",
"::",
"$",
"urlSafe",
")",
",",
"key",
"(",
"self",
"::",
"$",
"urlSaf... | Perform a URL safe base 64 decode
@param string $input
@return string | [
"Perform",
"a",
"URL",
"safe",
"base",
"64",
"decode"
] | 23003aba497822bd473fdbf60514052dda1874fc | https://github.com/unimatrix/cake/blob/23003aba497822bd473fdbf60514052dda1874fc/src/Lib/Paranoia.php#L130-L132 |
7,750 | unimatrix/cake | src/Lib/Paranoia.php | Paranoia.xor | private static function xor($input, $secret = null) {
// perform xor
$inputSize = strlen($input);
$secretSize = strlen($secret);
for($y = 0, $x = 0; $y < $inputSize; $y++, $x++) {
if($x >= $secretSize)
$x = 0;
$input[$y] = $input[$y] ^ $secret[$x]... | php | private static function xor($input, $secret = null) {
// perform xor
$inputSize = strlen($input);
$secretSize = strlen($secret);
for($y = 0, $x = 0; $y < $inputSize; $y++, $x++) {
if($x >= $secretSize)
$x = 0;
$input[$y] = $input[$y] ^ $secret[$x]... | [
"private",
"static",
"function",
"xor",
"(",
"$",
"input",
",",
"$",
"secret",
"=",
"null",
")",
"{",
"// perform xor",
"$",
"inputSize",
"=",
"strlen",
"(",
"$",
"input",
")",
";",
"$",
"secretSize",
"=",
"strlen",
"(",
"$",
"secret",
")",
";",
"for... | Perform the XOR
@param string $input
@param string $secret Paranoia secret
@return string | [
"Perform",
"the",
"XOR"
] | 23003aba497822bd473fdbf60514052dda1874fc | https://github.com/unimatrix/cake/blob/23003aba497822bd473fdbf60514052dda1874fc/src/Lib/Paranoia.php#L140-L153 |
7,751 | vpg/titon.common | src/Titon/Common/Config.php | Config.add | public static function add($key, $value) {
$data = (array) static::get($key, []);
$data[] = $value;
static::set($key, $data);
} | php | public static function add($key, $value) {
$data = (array) static::get($key, []);
$data[] = $value;
static::set($key, $data);
} | [
"public",
"static",
"function",
"add",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"$",
"data",
"=",
"(",
"array",
")",
"static",
"::",
"get",
"(",
"$",
"key",
",",
"[",
"]",
")",
";",
"$",
"data",
"[",
"]",
"=",
"$",
"value",
";",
"static"... | Add a value to a key. If the value is not an array, make it one.
@param string $key
@param mixed $value | [
"Add",
"a",
"value",
"to",
"a",
"key",
".",
"If",
"the",
"value",
"is",
"not",
"an",
"array",
"make",
"it",
"one",
"."
] | 41fe62bd5134bf76db3ff9caa16f280d9d534ef9 | https://github.com/vpg/titon.common/blob/41fe62bd5134bf76db3ff9caa16f280d9d534ef9/src/Titon/Common/Config.php#L35-L40 |
7,752 | vpg/titon.common | src/Titon/Common/Config.php | Config.get | public static function get($key, $default = null) {
$value = Hash::get(static::$_config, $key);
if ($value === null) {
return $default;
}
return $value;
} | php | public static function get($key, $default = null) {
$value = Hash::get(static::$_config, $key);
if ($value === null) {
return $default;
}
return $value;
} | [
"public",
"static",
"function",
"get",
"(",
"$",
"key",
",",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"value",
"=",
"Hash",
"::",
"get",
"(",
"static",
"::",
"$",
"_config",
",",
"$",
"key",
")",
";",
"if",
"(",
"$",
"value",
"===",
"null",
... | Grab a value from the current configuration.
@param string $key
@param mixed $default
@return mixed | [
"Grab",
"a",
"value",
"from",
"the",
"current",
"configuration",
"."
] | 41fe62bd5134bf76db3ff9caa16f280d9d534ef9 | https://github.com/vpg/titon.common/blob/41fe62bd5134bf76db3ff9caa16f280d9d534ef9/src/Titon/Common/Config.php#L67-L75 |
7,753 | coolms/doctrine | src/Mapping/Relation/Mapping/Event/Adapter/ORM.php | ORM.relationToArray | private function relationToArray(RelationOverride $relation)
{
if ($relation->type && !is_numeric($relation->type)) {
$relation->type = constant(ClassMetadata::class . '::' . $relation->type);
}
return array_filter([
'type' => $relation->type,
'targetEnti... | php | private function relationToArray(RelationOverride $relation)
{
if ($relation->type && !is_numeric($relation->type)) {
$relation->type = constant(ClassMetadata::class . '::' . $relation->type);
}
return array_filter([
'type' => $relation->type,
'targetEnti... | [
"private",
"function",
"relationToArray",
"(",
"RelationOverride",
"$",
"relation",
")",
"{",
"if",
"(",
"$",
"relation",
"->",
"type",
"&&",
"!",
"is_numeric",
"(",
"$",
"relation",
"->",
"type",
")",
")",
"{",
"$",
"relation",
"->",
"type",
"=",
"const... | Parse the given RelationOverride as array
@param RelationOverride $relation
@return array | [
"Parse",
"the",
"given",
"RelationOverride",
"as",
"array"
] | d7d233594b37cd0c3abc37a46e4e4b965767c3b4 | https://github.com/coolms/doctrine/blob/d7d233594b37cd0c3abc37a46e4e4b965767c3b4/src/Mapping/Relation/Mapping/Event/Adapter/ORM.php#L182-L198 |
7,754 | coolms/doctrine | src/Mapping/Relation/Mapping/Event/Adapter/ORM.php | ORM.joinColumnToArray | private function joinColumnToArray(JoinColumn $joinColumn)
{
return [
'name' => $joinColumn->name,
'unique' => $joinColumn->unique,
'nullable' => $joinColumn->nullable,
'onDelete' => $joinColumn->onDelete,
'columnDefinition' => $joinColumn->columnD... | php | private function joinColumnToArray(JoinColumn $joinColumn)
{
return [
'name' => $joinColumn->name,
'unique' => $joinColumn->unique,
'nullable' => $joinColumn->nullable,
'onDelete' => $joinColumn->onDelete,
'columnDefinition' => $joinColumn->columnD... | [
"private",
"function",
"joinColumnToArray",
"(",
"JoinColumn",
"$",
"joinColumn",
")",
"{",
"return",
"[",
"'name'",
"=>",
"$",
"joinColumn",
"->",
"name",
",",
"'unique'",
"=>",
"$",
"joinColumn",
"->",
"unique",
",",
"'nullable'",
"=>",
"$",
"joinColumn",
... | Parse the given JoinColumn as array
@param JoinColumn $joinColumn
@return array | [
"Parse",
"the",
"given",
"JoinColumn",
"as",
"array"
] | d7d233594b37cd0c3abc37a46e4e4b965767c3b4 | https://github.com/coolms/doctrine/blob/d7d233594b37cd0c3abc37a46e4e4b965767c3b4/src/Mapping/Relation/Mapping/Event/Adapter/ORM.php#L206-L216 |
7,755 | Opifer/FormBundle | Model/FormManager.php | FormManager.create | public function create()
{
$class = $this->getClass();
$form = new $class();
$schema = $this->schemaManager->create();
$schema->setObjectClass($this->postManager->getClass());
$form->setSchema($schema);
return $form;
} | php | public function create()
{
$class = $this->getClass();
$form = new $class();
$schema = $this->schemaManager->create();
$schema->setObjectClass($this->postManager->getClass());
$form->setSchema($schema);
return $form;
} | [
"public",
"function",
"create",
"(",
")",
"{",
"$",
"class",
"=",
"$",
"this",
"->",
"getClass",
"(",
")",
";",
"$",
"form",
"=",
"new",
"$",
"class",
"(",
")",
";",
"$",
"schema",
"=",
"$",
"this",
"->",
"schemaManager",
"->",
"create",
"(",
")"... | Create a new form instance.
@return Form | [
"Create",
"a",
"new",
"form",
"instance",
"."
] | cac3bc2e64de8297e18d90addb114694bd3ba756 | https://github.com/Opifer/FormBundle/blob/cac3bc2e64de8297e18d90addb114694bd3ba756/Model/FormManager.php#L56-L67 |
7,756 | kevindierkx/elicit | src/Query/Grammars/AbstractGrammar.php | AbstractGrammar.hasReplacedParameter | public function hasReplacedParameter(array $parameter)
{
foreach ($this->replacedParameters as $replacedParameter) {
if ($replacedParameter['column'] === $parameter['column'] &&
$replacedParameter['value'] === $parameter['value']
) {
return true;
... | php | public function hasReplacedParameter(array $parameter)
{
foreach ($this->replacedParameters as $replacedParameter) {
if ($replacedParameter['column'] === $parameter['column'] &&
$replacedParameter['value'] === $parameter['value']
) {
return true;
... | [
"public",
"function",
"hasReplacedParameter",
"(",
"array",
"$",
"parameter",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"replacedParameters",
"as",
"$",
"replacedParameter",
")",
"{",
"if",
"(",
"$",
"replacedParameter",
"[",
"'column'",
"]",
"===",
"$",
... | Validate the existence of a replaced parameter.
@param array $parameter
@return boolean | [
"Validate",
"the",
"existence",
"of",
"a",
"replaced",
"parameter",
"."
] | c277942f5f5f63b175bc37e9d392faa946888f65 | https://github.com/kevindierkx/elicit/blob/c277942f5f5f63b175bc37e9d392faa946888f65/src/Query/Grammars/AbstractGrammar.php#L80-L91 |
7,757 | mazarini/tools-bundle | src/DependencyInjection/Configuration.php | Configuration.build | protected function build(ArrayNodeDefinition $rootNode): void
{
$rootNode
->children()
->integerNode('max_items')->defaultValue(20)->info('How much for max items')->end()
;
} | php | protected function build(ArrayNodeDefinition $rootNode): void
{
$rootNode
->children()
->integerNode('max_items')->defaultValue(20)->info('How much for max items')->end()
;
} | [
"protected",
"function",
"build",
"(",
"ArrayNodeDefinition",
"$",
"rootNode",
")",
":",
"void",
"{",
"$",
"rootNode",
"->",
"children",
"(",
")",
"->",
"integerNode",
"(",
"'max_items'",
")",
"->",
"defaultValue",
"(",
"20",
")",
"->",
"info",
"(",
"'How ... | Build the config tree.
@param ArrayNodeDefinition $rootNode | [
"Build",
"the",
"config",
"tree",
"."
] | 60a4a45de85d7b5a6b7e84fe636a5c22f376c4d1 | https://github.com/mazarini/tools-bundle/blob/60a4a45de85d7b5a6b7e84fe636a5c22f376c4d1/src/DependencyInjection/Configuration.php#L34-L40 |
7,758 | interactivesolutions/honeycomb-menu | src/app/http/controllers/menu/GroupsController.php | GroupsController.options | public function options()
{
if( request()->has('language') ) {
return HCMenuGroups::select("id", "name")
->where('language_code', request()->input('language'))
->orderBy('sequence')
->take(50)
->get();
}
return [];
... | php | public function options()
{
if( request()->has('language') ) {
return HCMenuGroups::select("id", "name")
->where('language_code', request()->input('language'))
->orderBy('sequence')
->take(50)
->get();
}
return [];
... | [
"public",
"function",
"options",
"(",
")",
"{",
"if",
"(",
"request",
"(",
")",
"->",
"has",
"(",
"'language'",
")",
")",
"{",
"return",
"HCMenuGroups",
"::",
"select",
"(",
"\"id\"",
",",
"\"name\"",
")",
"->",
"where",
"(",
"'language_code'",
",",
"r... | Search for users
@return mixed | [
"Search",
"for",
"users"
] | 9ba3a6581f9929fc4526b6f238991808b437657a | https://github.com/interactivesolutions/honeycomb-menu/blob/9ba3a6581f9929fc4526b6f238991808b437657a/src/app/http/controllers/menu/GroupsController.php#L255-L266 |
7,759 | diatem-net/jin-webapp | src/WebApp/Context/View.php | View.executeAndReturnContent | public function executeAndReturnContent()
{
ob_start();
Output::$controller = WebApp::$page->controller;
include $this->file;
$content = ob_get_contents();
ob_clean();
return $content;
} | php | public function executeAndReturnContent()
{
ob_start();
Output::$controller = WebApp::$page->controller;
include $this->file;
$content = ob_get_contents();
ob_clean();
return $content;
} | [
"public",
"function",
"executeAndReturnContent",
"(",
")",
"{",
"ob_start",
"(",
")",
";",
"Output",
"::",
"$",
"controller",
"=",
"WebApp",
"::",
"$",
"page",
"->",
"controller",
";",
"include",
"$",
"this",
"->",
"file",
";",
"$",
"content",
"=",
"ob_g... | Return the view content
@return string | [
"Return",
"the",
"view",
"content"
] | 43e85f780c3841a536e3a5d41929523e5aacd272 | https://github.com/diatem-net/jin-webapp/blob/43e85f780c3841a536e3a5d41929523e5aacd272/src/WebApp/Context/View.php#L47-L56 |
7,760 | getconnect/connect-php | src/Event.php | Event.validate | private function validate() {
$errors = [];
foreach ($this->eventDetails as $key => $value) {
if (strpos($key, 'tp_') !== false) {
$errors[$key] = 'Property names cannot start with the reserved prefix \'tp_\'';
}
if (strpos($key, '.') !== false) {
... | php | private function validate() {
$errors = [];
foreach ($this->eventDetails as $key => $value) {
if (strpos($key, 'tp_') !== false) {
$errors[$key] = 'Property names cannot start with the reserved prefix \'tp_\'';
}
if (strpos($key, '.') !== false) {
... | [
"private",
"function",
"validate",
"(",
")",
"{",
"$",
"errors",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"eventDetails",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"key",
",",
"'tp_'",
")",
"!=="... | Checks if an event is valid for Connect.
@throws InvalidPropertyNameException if the event contains invalid properties. | [
"Checks",
"if",
"an",
"event",
"is",
"valid",
"for",
"Connect",
"."
] | cbce3daae58eca16450df811ac6f1280fc1ef6b1 | https://github.com/getconnect/connect-php/blob/cbce3daae58eca16450df811ac6f1280fc1ef6b1/src/Event.php#L35-L53 |
7,761 | getconnect/connect-php | src/Event.php | Event.process | private function process(&$details) {
foreach ($details as &$value) {
if (is_array($value)) {
$this->process($value);
continue;
}
if ($value instanceof \DateTime) {
$value = $value->format(\DateTime::ISO8601);
co... | php | private function process(&$details) {
foreach ($details as &$value) {
if (is_array($value)) {
$this->process($value);
continue;
}
if ($value instanceof \DateTime) {
$value = $value->format(\DateTime::ISO8601);
co... | [
"private",
"function",
"process",
"(",
"&",
"$",
"details",
")",
"{",
"foreach",
"(",
"$",
"details",
"as",
"&",
"$",
"value",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"$",
"this",
"->",
"process",
"(",
"$",
"value",
")"... | Recursively converts any nested DateTime instances to ISO8601 strings
in preparation for serialization. Note, mutates the supplied array.
@param array Properties to convert. | [
"Recursively",
"converts",
"any",
"nested",
"DateTime",
"instances",
"to",
"ISO8601",
"strings",
"in",
"preparation",
"for",
"serialization",
".",
"Note",
"mutates",
"the",
"supplied",
"array",
"."
] | cbce3daae58eca16450df811ac6f1280fc1ef6b1 | https://github.com/getconnect/connect-php/blob/cbce3daae58eca16450df811ac6f1280fc1ef6b1/src/Event.php#L60-L71 |
7,762 | jianfengye/hades | src/Hades/Log/Logger.php | Logger.gc | public static function gc($name)
{
$files = glob(self::$folder . "/{$name}_*.log");
foreach ($files as $filename) {
$date = str_replace(self::$folder . "/{$name}_" , "", $filename);
$date = str_replace(".log", "", $date);
if (time() - strtotime($date) > self::$rot... | php | public static function gc($name)
{
$files = glob(self::$folder . "/{$name}_*.log");
foreach ($files as $filename) {
$date = str_replace(self::$folder . "/{$name}_" , "", $filename);
$date = str_replace(".log", "", $date);
if (time() - strtotime($date) > self::$rot... | [
"public",
"static",
"function",
"gc",
"(",
"$",
"name",
")",
"{",
"$",
"files",
"=",
"glob",
"(",
"self",
"::",
"$",
"folder",
".",
"\"/{$name}_*.log\"",
")",
";",
"foreach",
"(",
"$",
"files",
"as",
"$",
"filename",
")",
"{",
"$",
"date",
"=",
"st... | gc the roate files | [
"gc",
"the",
"roate",
"files"
] | a0690d96dada070b4cf4b9ff63ab3aa024c34a67 | https://github.com/jianfengye/hades/blob/a0690d96dada070b4cf4b9ff63ab3aa024c34a67/src/Hades/Log/Logger.php#L58-L68 |
7,763 | helsingborg-stad/search-statistics | source/php/SearchLogger.php | SearchLogger.log | public function log()
{
global $wp_query;
if (!$wp_query->is_search() || max(1, get_query_var('paged')) > 1) {
return;
}
global $wpdb;
$query = get_search_query();
$hits = $wp_query->found_posts;
$siteId = null;
$loggedIn = is_user_logge... | php | public function log()
{
global $wp_query;
if (!$wp_query->is_search() || max(1, get_query_var('paged')) > 1) {
return;
}
global $wpdb;
$query = get_search_query();
$hits = $wp_query->found_posts;
$siteId = null;
$loggedIn = is_user_logge... | [
"public",
"function",
"log",
"(",
")",
"{",
"global",
"$",
"wp_query",
";",
"if",
"(",
"!",
"$",
"wp_query",
"->",
"is_search",
"(",
")",
"||",
"max",
"(",
"1",
",",
"get_query_var",
"(",
"'paged'",
")",
")",
">",
"1",
")",
"{",
"return",
";",
"}... | Log search query to the database
@return void | [
"Log",
"search",
"query",
"to",
"the",
"database"
] | 8ce0a6942a892fb0bbe67440c2527d282a3144d5 | https://github.com/helsingborg-stad/search-statistics/blob/8ce0a6942a892fb0bbe67440c2527d282a3144d5/source/php/SearchLogger.php#L16-L65 |
7,764 | slickframework/orm | src/Orm.php | Orm.setEmitter | public function setEmitter($entityClass, EmitterInterface $emitter)
{
$this->emitters->set($entityClass, $emitter);
return $this;
} | php | public function setEmitter($entityClass, EmitterInterface $emitter)
{
$this->emitters->set($entityClass, $emitter);
return $this;
} | [
"public",
"function",
"setEmitter",
"(",
"$",
"entityClass",
",",
"EmitterInterface",
"$",
"emitter",
")",
"{",
"$",
"this",
"->",
"emitters",
"->",
"set",
"(",
"$",
"entityClass",
",",
"$",
"emitter",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Sets the emitter for provided class name
@param string $entityClass
@param EmitterInterface $emitter
@return $this|self|Orm | [
"Sets",
"the",
"emitter",
"for",
"provided",
"class",
"name"
] | c5c782f5e3a46cdc6c934eda4411cb9edc48f969 | https://github.com/slickframework/orm/blob/c5c782f5e3a46cdc6c934eda4411cb9edc48f969/src/Orm.php#L140-L144 |
7,765 | slickframework/orm | src/Orm.php | Orm.getRepositoryFor | public function getRepositoryFor($entityClass)
{
if (!is_subclass_of($entityClass, EntityInterface::class)) {
throw new InvalidArgumentException(
'Cannot create ORM repository for a class that does not '.
'implement EntityInterface.'
);
}
... | php | public function getRepositoryFor($entityClass)
{
if (!is_subclass_of($entityClass, EntityInterface::class)) {
throw new InvalidArgumentException(
'Cannot create ORM repository for a class that does not '.
'implement EntityInterface.'
);
}
... | [
"public",
"function",
"getRepositoryFor",
"(",
"$",
"entityClass",
")",
"{",
"if",
"(",
"!",
"is_subclass_of",
"(",
"$",
"entityClass",
",",
"EntityInterface",
"::",
"class",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'Cannot create ORM repos... | Gets repository for provided entity class name
@param string $entityClass FQ entity class name
@return EntityRepository
@throws InvalidArgumentException If provide class name is not
from a class that implements the EntityInterface interface. | [
"Gets",
"repository",
"for",
"provided",
"entity",
"class",
"name"
] | c5c782f5e3a46cdc6c934eda4411cb9edc48f969 | https://github.com/slickframework/orm/blob/c5c782f5e3a46cdc6c934eda4411cb9edc48f969/src/Orm.php#L203-L215 |
7,766 | slickframework/orm | src/Orm.php | Orm.getMapperFor | public function getMapperFor($entity)
{
return $this->mappers->containsKey($entity)
? $this->mappers->get($entity)
: $this->createMapper($entity);
} | php | public function getMapperFor($entity)
{
return $this->mappers->containsKey($entity)
? $this->mappers->get($entity)
: $this->createMapper($entity);
} | [
"public",
"function",
"getMapperFor",
"(",
"$",
"entity",
")",
"{",
"return",
"$",
"this",
"->",
"mappers",
"->",
"containsKey",
"(",
"$",
"entity",
")",
"?",
"$",
"this",
"->",
"mappers",
"->",
"get",
"(",
"$",
"entity",
")",
":",
"$",
"this",
"->",... | Retrieves the mapper for provided entity
If mapper does not exists it will be created and stored in the
mapper map.
@param string $entity
@return EntityMapper | [
"Retrieves",
"the",
"mapper",
"for",
"provided",
"entity"
] | c5c782f5e3a46cdc6c934eda4411cb9edc48f969 | https://github.com/slickframework/orm/blob/c5c782f5e3a46cdc6c934eda4411cb9edc48f969/src/Orm.php#L226-L231 |
7,767 | slickframework/orm | src/Orm.php | Orm.getEmitterFor | public function getEmitterFor($entity)
{
$emitter = $this->emitters->containsKey($entity)
? $this->emitters->get($entity)
: $this->createEmitter($entity);
return $emitter;
} | php | public function getEmitterFor($entity)
{
$emitter = $this->emitters->containsKey($entity)
? $this->emitters->get($entity)
: $this->createEmitter($entity);
return $emitter;
} | [
"public",
"function",
"getEmitterFor",
"(",
"$",
"entity",
")",
"{",
"$",
"emitter",
"=",
"$",
"this",
"->",
"emitters",
"->",
"containsKey",
"(",
"$",
"entity",
")",
"?",
"$",
"this",
"->",
"emitters",
"->",
"get",
"(",
"$",
"entity",
")",
":",
"$",... | Gets the event emitter for provided entity
@param string $entity
@return Emitter | [
"Gets",
"the",
"event",
"emitter",
"for",
"provided",
"entity"
] | c5c782f5e3a46cdc6c934eda4411cb9edc48f969 | https://github.com/slickframework/orm/blob/c5c782f5e3a46cdc6c934eda4411cb9edc48f969/src/Orm.php#L240-L246 |
7,768 | slickframework/orm | src/Orm.php | Orm.setAdapter | public function setAdapter($alias, AdapterInterface $adapter)
{
$this->adapters->set($alias, $adapter);
return $this;
} | php | public function setAdapter($alias, AdapterInterface $adapter)
{
$this->adapters->set($alias, $adapter);
return $this;
} | [
"public",
"function",
"setAdapter",
"(",
"$",
"alias",
",",
"AdapterInterface",
"$",
"adapter",
")",
"{",
"$",
"this",
"->",
"adapters",
"->",
"set",
"(",
"$",
"alias",
",",
"$",
"adapter",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Sets an adapter mapped with alias name
@param string $alias
@param AdapterInterface $adapter
@return $this|Orm|self | [
"Sets",
"an",
"adapter",
"mapped",
"with",
"alias",
"name"
] | c5c782f5e3a46cdc6c934eda4411cb9edc48f969 | https://github.com/slickframework/orm/blob/c5c782f5e3a46cdc6c934eda4411cb9edc48f969/src/Orm.php#L267-L271 |
7,769 | slickframework/orm | src/Orm.php | Orm.createRepository | private function createRepository($entityClass)
{
$repository = new EntityRepository();
$repository->setAdapter(
$this->adapters->get($this->getAdapterAlias($entityClass))
)
->setEntityMapper($this->getMapperFor($entityClass))
->setEntityDescriptor(
... | php | private function createRepository($entityClass)
{
$repository = new EntityRepository();
$repository->setAdapter(
$this->adapters->get($this->getAdapterAlias($entityClass))
)
->setEntityMapper($this->getMapperFor($entityClass))
->setEntityDescriptor(
... | [
"private",
"function",
"createRepository",
"(",
"$",
"entityClass",
")",
"{",
"$",
"repository",
"=",
"new",
"EntityRepository",
"(",
")",
";",
"$",
"repository",
"->",
"setAdapter",
"(",
"$",
"this",
"->",
"adapters",
"->",
"get",
"(",
"$",
"this",
"->",
... | Creates a repository for provided entity class name
@param string $entityClass
@return EntityRepository | [
"Creates",
"a",
"repository",
"for",
"provided",
"entity",
"class",
"name"
] | c5c782f5e3a46cdc6c934eda4411cb9edc48f969 | https://github.com/slickframework/orm/blob/c5c782f5e3a46cdc6c934eda4411cb9edc48f969/src/Orm.php#L279-L292 |
7,770 | slickframework/orm | src/Orm.php | Orm.createMapper | private function createMapper($entity)
{
$mapper = new EntityMapper();
$mapper->setAdapter(
$this->adapters->get(
$this->getAdapterAlias($entity)
)
)
->setEntityClassName($entity);
$this->mappers->set($entity, $mapper);
retu... | php | private function createMapper($entity)
{
$mapper = new EntityMapper();
$mapper->setAdapter(
$this->adapters->get(
$this->getAdapterAlias($entity)
)
)
->setEntityClassName($entity);
$this->mappers->set($entity, $mapper);
retu... | [
"private",
"function",
"createMapper",
"(",
"$",
"entity",
")",
"{",
"$",
"mapper",
"=",
"new",
"EntityMapper",
"(",
")",
";",
"$",
"mapper",
"->",
"setAdapter",
"(",
"$",
"this",
"->",
"adapters",
"->",
"get",
"(",
"$",
"this",
"->",
"getAdapterAlias",
... | Creates entity map for provided entity
@param string $entity
@return EntityMapper | [
"Creates",
"entity",
"map",
"for",
"provided",
"entity"
] | c5c782f5e3a46cdc6c934eda4411cb9edc48f969 | https://github.com/slickframework/orm/blob/c5c782f5e3a46cdc6c934eda4411cb9edc48f969/src/Orm.php#L300-L311 |
7,771 | slickframework/orm | src/Orm.php | Orm.createEmitter | private function createEmitter($entity)
{
$emitter = new Emitter();
$this->emitters->set($entity, $emitter);
return $emitter;
} | php | private function createEmitter($entity)
{
$emitter = new Emitter();
$this->emitters->set($entity, $emitter);
return $emitter;
} | [
"private",
"function",
"createEmitter",
"(",
"$",
"entity",
")",
"{",
"$",
"emitter",
"=",
"new",
"Emitter",
"(",
")",
";",
"$",
"this",
"->",
"emitters",
"->",
"set",
"(",
"$",
"entity",
",",
"$",
"emitter",
")",
";",
"return",
"$",
"emitter",
";",
... | Creates an emitter for provided entity class name
@param string $entity
@return Emitter | [
"Creates",
"an",
"emitter",
"for",
"provided",
"entity",
"class",
"name"
] | c5c782f5e3a46cdc6c934eda4411cb9edc48f969 | https://github.com/slickframework/orm/blob/c5c782f5e3a46cdc6c934eda4411cb9edc48f969/src/Orm.php#L319-L324 |
7,772 | slickframework/orm | src/Orm.php | Orm.getAdapterAlias | private function getAdapterAlias($entity)
{
$descriptor = EntityDescriptorRegistry::getInstance()
->getDescriptorFor($entity);
return $descriptor->getAdapterAlias()
? $descriptor->getAdapterAlias()
: 'default';
} | php | private function getAdapterAlias($entity)
{
$descriptor = EntityDescriptorRegistry::getInstance()
->getDescriptorFor($entity);
return $descriptor->getAdapterAlias()
? $descriptor->getAdapterAlias()
: 'default';
} | [
"private",
"function",
"getAdapterAlias",
"(",
"$",
"entity",
")",
"{",
"$",
"descriptor",
"=",
"EntityDescriptorRegistry",
"::",
"getInstance",
"(",
")",
"->",
"getDescriptorFor",
"(",
"$",
"entity",
")",
";",
"return",
"$",
"descriptor",
"->",
"getAdapterAlias... | Gets the adapter alias for current working entity
@param string $entity
@return string | [
"Gets",
"the",
"adapter",
"alias",
"for",
"current",
"working",
"entity"
] | c5c782f5e3a46cdc6c934eda4411cb9edc48f969 | https://github.com/slickframework/orm/blob/c5c782f5e3a46cdc6c934eda4411cb9edc48f969/src/Orm.php#L333-L340 |
7,773 | 10usb/css-lib | src/parsers/RuleSet.php | RuleSet.parseSelector | public static function parseSelector($text){
$text = preg_replace('/(\>|\+|~)\s+/is', '$1', $text);
$selector = null;
foreach(preg_split('/\s+/', $text, -1, PREG_SPLIT_NO_EMPTY) as $part){
if(!preg_match('/^([\>\+~]?)([^ >\+~]+)$/is', $part, $matches)) throw new \Exception("Invalid selector part '$part'"... | php | public static function parseSelector($text){
$text = preg_replace('/(\>|\+|~)\s+/is', '$1', $text);
$selector = null;
foreach(preg_split('/\s+/', $text, -1, PREG_SPLIT_NO_EMPTY) as $part){
if(!preg_match('/^([\>\+~]?)([^ >\+~]+)$/is', $part, $matches)) throw new \Exception("Invalid selector part '$part'"... | [
"public",
"static",
"function",
"parseSelector",
"(",
"$",
"text",
")",
"{",
"$",
"text",
"=",
"preg_replace",
"(",
"'/(\\>|\\+|~)\\s+/is'",
",",
"'$1'",
",",
"$",
"text",
")",
";",
"$",
"selector",
"=",
"null",
";",
"foreach",
"(",
"preg_split",
"(",
"'... | Parses a selector
@param string $text
@return \csslib\Selector | [
"Parses",
"a",
"selector"
] | 6370b1404bae3eecb44c214ed4eaaf33113858dd | https://github.com/10usb/css-lib/blob/6370b1404bae3eecb44c214ed4eaaf33113858dd/src/parsers/RuleSet.php#L51-L80 |
7,774 | ntentan/utils | src/validator/Validation.php | Validation.evaluateResult | protected function evaluateResult($field, $result, $message)
{
$this->messages = [];
if ($result) {
return true;
} else {
if (is_array($field['name'])) {
foreach ($field['name'] as $name) {
$this->messages[$name][] = $field['options... | php | protected function evaluateResult($field, $result, $message)
{
$this->messages = [];
if ($result) {
return true;
} else {
if (is_array($field['name'])) {
foreach ($field['name'] as $name) {
$this->messages[$name][] = $field['options... | [
"protected",
"function",
"evaluateResult",
"(",
"$",
"field",
",",
"$",
"result",
",",
"$",
"message",
")",
"{",
"$",
"this",
"->",
"messages",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"result",
")",
"{",
"return",
"true",
";",
"}",
"else",
"{",
"if",
... | Utility function that evaluates the result of a validation test and prepares validation messages.
Receives a boolean from the validation function and a message to be displayed when the value is false. It also
receives the options array so it could override the standard message that the validation code generates.
@para... | [
"Utility",
"function",
"that",
"evaluates",
"the",
"result",
"of",
"a",
"validation",
"test",
"and",
"prepares",
"validation",
"messages",
".",
"Receives",
"a",
"boolean",
"from",
"the",
"validation",
"function",
"and",
"a",
"message",
"to",
"be",
"displayed",
... | 151f3582ee6007ea77a38d2b6c590289331e19a1 | https://github.com/ntentan/utils/blob/151f3582ee6007ea77a38d2b6c590289331e19a1/src/validator/Validation.php#L36-L51 |
7,775 | ntentan/utils | src/validator/Validation.php | Validation.getFieldValue | protected function getFieldValue($field, $data)
{
$value = null;
if (isset($data[$field['name']])) {
$value = $data[$field['name']];
}
return $value;
} | php | protected function getFieldValue($field, $data)
{
$value = null;
if (isset($data[$field['name']])) {
$value = $data[$field['name']];
}
return $value;
} | [
"protected",
"function",
"getFieldValue",
"(",
"$",
"field",
",",
"$",
"data",
")",
"{",
"$",
"value",
"=",
"null",
";",
"if",
"(",
"isset",
"(",
"$",
"data",
"[",
"$",
"field",
"[",
"'name'",
"]",
"]",
")",
")",
"{",
"$",
"value",
"=",
"$",
"d... | Extracts the value of the field description from the data passed.
@param array $field
@param array $data
@return mixed | [
"Extracts",
"the",
"value",
"of",
"the",
"field",
"description",
"from",
"the",
"data",
"passed",
"."
] | 151f3582ee6007ea77a38d2b6c590289331e19a1 | https://github.com/ntentan/utils/blob/151f3582ee6007ea77a38d2b6c590289331e19a1/src/validator/Validation.php#L60-L67 |
7,776 | xcitestudios/php-network | src/Server/Configuration/ServerConfiguration.php | ServerConfiguration.setPort | public function setPort($port)
{
if (!is_int($port) || $port < 0 || $port > 65535) {
throw new InvalidArgumentException(
sprintf('%s only accepts a port between 0 and 65535 inclusive', __FUNCTION__)
);
}
$this->port = $port;
return $this;
... | php | public function setPort($port)
{
if (!is_int($port) || $port < 0 || $port > 65535) {
throw new InvalidArgumentException(
sprintf('%s only accepts a port between 0 and 65535 inclusive', __FUNCTION__)
);
}
$this->port = $port;
return $this;
... | [
"public",
"function",
"setPort",
"(",
"$",
"port",
")",
"{",
"if",
"(",
"!",
"is_int",
"(",
"$",
"port",
")",
"||",
"$",
"port",
"<",
"0",
"||",
"$",
"port",
">",
"65535",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"... | Set the port to connect to.
@param int $port
@return static
@throws InvalidArgumentException | [
"Set",
"the",
"port",
"to",
"connect",
"to",
"."
] | 4278b7bd5b5cf64ceb08005f6bce18be79b76cd3 | https://github.com/xcitestudios/php-network/blob/4278b7bd5b5cf64ceb08005f6bce18be79b76cd3/src/Server/Configuration/ServerConfiguration.php#L75-L86 |
7,777 | xcitestudios/php-network | src/Server/Configuration/ServerConfiguration.php | ServerConfiguration.setSSL | public function setSSL($isEnabled)
{
if (!is_bool($isEnabled)) {
throw new InvalidArgumentException(
sprintf('%s only accepts a boolean', __FUNCTION__)
);
}
$this->ssl = (bool)$isEnabled;
return $this;
} | php | public function setSSL($isEnabled)
{
if (!is_bool($isEnabled)) {
throw new InvalidArgumentException(
sprintf('%s only accepts a boolean', __FUNCTION__)
);
}
$this->ssl = (bool)$isEnabled;
return $this;
} | [
"public",
"function",
"setSSL",
"(",
"$",
"isEnabled",
")",
"{",
"if",
"(",
"!",
"is_bool",
"(",
"$",
"isEnabled",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'%s only accepts a boolean'",
",",
"__FUNCTION__",
")",
")",
"... | Set if SSL should be used for the connection.
@param bool $isEnabled
@return static
@throws InvalidArgumentException | [
"Set",
"if",
"SSL",
"should",
"be",
"used",
"for",
"the",
"connection",
"."
] | 4278b7bd5b5cf64ceb08005f6bce18be79b76cd3 | https://github.com/xcitestudios/php-network/blob/4278b7bd5b5cf64ceb08005f6bce18be79b76cd3/src/Server/Configuration/ServerConfiguration.php#L105-L116 |
7,778 | xcitestudios/php-network | src/Server/Configuration/ServerConfiguration.php | ServerConfiguration.setTLS | public function setTLS($isEnabled)
{
if (!is_bool($isEnabled)) {
throw new InvalidArgumentException(
sprintf('%s only accepts a boolean', __FUNCTION__)
);
}
$this->tls = (bool)$isEnabled;
return $this;
} | php | public function setTLS($isEnabled)
{
if (!is_bool($isEnabled)) {
throw new InvalidArgumentException(
sprintf('%s only accepts a boolean', __FUNCTION__)
);
}
$this->tls = (bool)$isEnabled;
return $this;
} | [
"public",
"function",
"setTLS",
"(",
"$",
"isEnabled",
")",
"{",
"if",
"(",
"!",
"is_bool",
"(",
"$",
"isEnabled",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'%s only accepts a boolean'",
",",
"__FUNCTION__",
")",
")",
"... | Set if TLS should be used for the connection.
@param bool $isEnabled
@return static
@throws InvalidArgumentException | [
"Set",
"if",
"TLS",
"should",
"be",
"used",
"for",
"the",
"connection",
"."
] | 4278b7bd5b5cf64ceb08005f6bce18be79b76cd3 | https://github.com/xcitestudios/php-network/blob/4278b7bd5b5cf64ceb08005f6bce18be79b76cd3/src/Server/Configuration/ServerConfiguration.php#L135-L146 |
7,779 | nonetallt/jinitialize-core | src/Procedure/ProcedureValidator.php | ProcedureValidator.checkPermissions | private function checkPermissions($style)
{
$warnings = [];
foreach($this->procedure->getCommands() as $command) {
/* Skip evalutating commands that do not recommend root */
if(! $command->hasPublicMethod('recommendsRoot')) continue;
if($command->recommendsRoot... | php | private function checkPermissions($style)
{
$warnings = [];
foreach($this->procedure->getCommands() as $command) {
/* Skip evalutating commands that do not recommend root */
if(! $command->hasPublicMethod('recommendsRoot')) continue;
if($command->recommendsRoot... | [
"private",
"function",
"checkPermissions",
"(",
"$",
"style",
")",
"{",
"$",
"warnings",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"procedure",
"->",
"getCommands",
"(",
")",
"as",
"$",
"command",
")",
"{",
"/* Skip evalutating commands that do ... | Warn user if procedure should be ran as root and is being ran by some other user | [
"Warn",
"user",
"if",
"procedure",
"should",
"be",
"ran",
"as",
"root",
"and",
"is",
"being",
"ran",
"by",
"some",
"other",
"user"
] | 284fbd72b7c1d6f5f8f265dfe2589c0d99b6a88f | https://github.com/nonetallt/jinitialize-core/blob/284fbd72b7c1d6f5f8f265dfe2589c0d99b6a88f/src/Procedure/ProcedureValidator.php#L104-L126 |
7,780 | Dhii/normalization-helper-base | src/NormalizeIterableCapableTrait.php | NormalizeIterableCapableTrait._normalizeIterable | protected function _normalizeIterable($iterable)
{
if (
is_array($iterable) ||
$iterable instanceof Traversable ||
$iterable instanceof stdClass
) {
return $iterable;
}
throw $this->_createInvalidArgumentException(
... | php | protected function _normalizeIterable($iterable)
{
if (
is_array($iterable) ||
$iterable instanceof Traversable ||
$iterable instanceof stdClass
) {
return $iterable;
}
throw $this->_createInvalidArgumentException(
... | [
"protected",
"function",
"_normalizeIterable",
"(",
"$",
"iterable",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"iterable",
")",
"||",
"$",
"iterable",
"instanceof",
"Traversable",
"||",
"$",
"iterable",
"instanceof",
"stdClass",
")",
"{",
"return",
"$",
"it... | Normalizes an iterable.
Makes sure that the return value can be iterated over.
@since [*next-version*]
@param mixed $iterable The iterable to normalize.
@throws InvalidArgumentException If the iterable could not be normalized.
@return array|Traversable|stdClass The normalized iterable. | [
"Normalizes",
"an",
"iterable",
"."
] | 1b64f0ea6b3e32f9478f854f6049500795b51da7 | https://github.com/Dhii/normalization-helper-base/blob/1b64f0ea6b3e32f9478f854f6049500795b51da7/src/NormalizeIterableCapableTrait.php#L31-L47 |
7,781 | Thuata/ComponentBundle | Display/Menu/Action.php | Action.addParameter | public function addParameter(string $name, $value)
{
if (!is_scalar($value)) {
throw new InvalidParameterTypeException(__CLASS__, __METHOD__, 1, 'scalar', gettype($value));
}
$this->parameters->set($name, $value);
return $this;
} | php | public function addParameter(string $name, $value)
{
if (!is_scalar($value)) {
throw new InvalidParameterTypeException(__CLASS__, __METHOD__, 1, 'scalar', gettype($value));
}
$this->parameters->set($name, $value);
return $this;
} | [
"public",
"function",
"addParameter",
"(",
"string",
"$",
"name",
",",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"is_scalar",
"(",
"$",
"value",
")",
")",
"{",
"throw",
"new",
"InvalidParameterTypeException",
"(",
"__CLASS__",
",",
"__METHOD__",
",",
"1",
... | Adds a parameter
@param string $name
@param mixed $value
@return $this
@throws \Thuata\ComponentBundle\Exception\InvalidParameterTypeException | [
"Adds",
"a",
"parameter"
] | 1001aaf585d177daa4b2fef4989c530ff5963df0 | https://github.com/Thuata/ComponentBundle/blob/1001aaf585d177daa4b2fef4989c530ff5963df0/Display/Menu/Action.php#L64-L73 |
7,782 | marando/phpSOFA | src/Marando/IAU/iauTdbtcb.php | iauTdbtcb.Tdbtcb | public static function Tdbtcb($tdb1, $tdb2, &$tcb1, &$tcb2) {
/* 1977 Jan 1 00:00:32.184 TT, as two-part JD */
$t77td = DJM0 + DJM77;
$t77tf = TTMTAI / DAYSEC;
/* TDB (days) at TAI 1977 Jan 1.0 */
$tdb0 = TDB0 / DAYSEC;
/* TDB to TCB rate */
$elbb = ELB / (1.0 - ELB);
$d;
$f;
... | php | public static function Tdbtcb($tdb1, $tdb2, &$tcb1, &$tcb2) {
/* 1977 Jan 1 00:00:32.184 TT, as two-part JD */
$t77td = DJM0 + DJM77;
$t77tf = TTMTAI / DAYSEC;
/* TDB (days) at TAI 1977 Jan 1.0 */
$tdb0 = TDB0 / DAYSEC;
/* TDB to TCB rate */
$elbb = ELB / (1.0 - ELB);
$d;
$f;
... | [
"public",
"static",
"function",
"Tdbtcb",
"(",
"$",
"tdb1",
",",
"$",
"tdb2",
",",
"&",
"$",
"tcb1",
",",
"&",
"$",
"tcb2",
")",
"{",
"/* 1977 Jan 1 00:00:32.184 TT, as two-part JD */",
"$",
"t77td",
"=",
"DJM0",
"+",
"DJM77",
";",
"$",
"t77tf",
"=",
"TT... | - - - - - - - - - -
i a u T d b t c b
- - - - - - - - - -
Time scale transformation: Barycentric Dynamical Time, TDB, to
Barycentric Coordinate Time, TCB.
This function is part of the International Astronomical Union's
SOFA (Standards of Fundamental Astronomy) software collection.
Status: canonical.
Given:
tdb1,t... | [
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"i",
"a",
"u",
"T",
"d",
"b",
"t",
"c",
"b",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-"
] | 757fa49fe335ae1210eaa7735473fd4388b13f07 | https://github.com/marando/phpSOFA/blob/757fa49fe335ae1210eaa7735473fd4388b13f07/src/Marando/IAU/iauTdbtcb.php#L64-L94 |
7,783 | marando/phpSOFA | src/Marando/IAU/iauDtf2d.php | iauDtf2d.Dtf2d | public static function Dtf2d($scale, $iy, $im, $id, $ihr, $imn, $sec, &$d1,
&$d2) {
$js;
$iy2;
$im2;
$id2;
$dj;
$w;
$day;
$seclim;
$dat0;
$dat12;
$dat24;
$dleap;
$time;
/* Today's Julian Day Number. */
$js = IAU::Cal2jd($iy, $im, $id, $dj, $w);
... | php | public static function Dtf2d($scale, $iy, $im, $id, $ihr, $imn, $sec, &$d1,
&$d2) {
$js;
$iy2;
$im2;
$id2;
$dj;
$w;
$day;
$seclim;
$dat0;
$dat12;
$dat24;
$dleap;
$time;
/* Today's Julian Day Number. */
$js = IAU::Cal2jd($iy, $im, $id, $dj, $w);
... | [
"public",
"static",
"function",
"Dtf2d",
"(",
"$",
"scale",
",",
"$",
"iy",
",",
"$",
"im",
",",
"$",
"id",
",",
"$",
"ihr",
",",
"$",
"imn",
",",
"$",
"sec",
",",
"&",
"$",
"d1",
",",
"&",
"$",
"d2",
")",
"{",
"$",
"js",
";",
"$",
"iy2",... | - - - - - - - - -
i a u D t f 2 d
- - - - - - - - -
Encode date and time fields into 2-part Julian Date (or in the case
of UTC a quasi-JD form that includes special provision for leap
seconds).
This function is part of the International Astronomical Union's
SOFA (Standards of Fundamental Astronomy) software collectio... | [
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"i",
"a",
"u",
"D",
"t",
"f",
"2",
"d",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-"
] | 757fa49fe335ae1210eaa7735473fd4388b13f07 | https://github.com/marando/phpSOFA/blob/757fa49fe335ae1210eaa7735473fd4388b13f07/src/Marando/IAU/iauDtf2d.php#L90-L180 |
7,784 | liverbool/dos-resource-bundle | EventListener/AjaxRedirect.php | AjaxRedirect.setJsonRedirection | public function setJsonRedirection(FilterResponseEvent $event)
{
if (!$event->isMasterRequest()) {
return;
}
$request = $event->getRequest();
// no handle with ajax (except turbolinks)
if ($event->getResponse() instanceof RedirectResponse && $request->isXmlHttpR... | php | public function setJsonRedirection(FilterResponseEvent $event)
{
if (!$event->isMasterRequest()) {
return;
}
$request = $event->getRequest();
// no handle with ajax (except turbolinks)
if ($event->getResponse() instanceof RedirectResponse && $request->isXmlHttpR... | [
"public",
"function",
"setJsonRedirection",
"(",
"FilterResponseEvent",
"$",
"event",
")",
"{",
"if",
"(",
"!",
"$",
"event",
"->",
"isMasterRequest",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"request",
"=",
"$",
"event",
"->",
"getRequest",
"(",
")"... | Set 204 status and return location redirect for ajax redirect.
@param FilterResponseEvent $event | [
"Set",
"204",
"status",
"and",
"return",
"location",
"redirect",
"for",
"ajax",
"redirect",
"."
] | c8607a46c2cea80cc138994be74f4dea3c197abc | https://github.com/liverbool/dos-resource-bundle/blob/c8607a46c2cea80cc138994be74f4dea3c197abc/EventListener/AjaxRedirect.php#L17-L46 |
7,785 | jetcms/models | src/User.php | User.hasRole | public function hasRole($name)
{
foreach ($this->roles as $role)
{
if ($role->name == $name) return true;
}
return false;
} | php | public function hasRole($name)
{
foreach ($this->roles as $role)
{
if ($role->name == $name) return true;
}
return false;
} | [
"public",
"function",
"hasRole",
"(",
"$",
"name",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"roles",
"as",
"$",
"role",
")",
"{",
"if",
"(",
"$",
"role",
"->",
"name",
"==",
"$",
"name",
")",
"return",
"true",
";",
"}",
"return",
"false",
";"... | Does the user have a particular role?
@param $name
@return bool | [
"Does",
"the",
"user",
"have",
"a",
"particular",
"role?"
] | 0528101caeea121361d21b8b82ac75485853018f | https://github.com/jetcms/models/blob/0528101caeea121361d21b8b82ac75485853018f/src/User.php#L59-L66 |
7,786 | weipaitang/config | src/SwooleTableHandler.php | SwooleTableHandler.createSwooleTable | public function createSwooleTable()
{
$configTable = new SwooleTable(2048);
$configTable->column('value', SwooleTable::TYPE_STRING, 1024);
$configTable->create();
$this->table = $configTable;
} | php | public function createSwooleTable()
{
$configTable = new SwooleTable(2048);
$configTable->column('value', SwooleTable::TYPE_STRING, 1024);
$configTable->create();
$this->table = $configTable;
} | [
"public",
"function",
"createSwooleTable",
"(",
")",
"{",
"$",
"configTable",
"=",
"new",
"SwooleTable",
"(",
"2048",
")",
";",
"$",
"configTable",
"->",
"column",
"(",
"'value'",
",",
"SwooleTable",
"::",
"TYPE_STRING",
",",
"1024",
")",
";",
"$",
"config... | create swoole table | [
"create",
"swoole",
"table"
] | 8282ff5a79133135df7c0ee43c57a8a2163e3509 | https://github.com/weipaitang/config/blob/8282ff5a79133135df7c0ee43c57a8a2163e3509/src/SwooleTableHandler.php#L41-L48 |
7,787 | Silvestra/Silvestra | src/Silvestra/Component/Media/Image/ImageUploader.php | ImageUploader.createImage | public function createImage(UploadedFile $uploadedImage)
{
$image = $this->imageManager->create();
$filename = $this->getUniqueFilename($uploadedImage);
$image->setFilename($filename);
$image->setMimeType($uploadedImage->getClientMimeType());
$image->setOrderNr(1);
$... | php | public function createImage(UploadedFile $uploadedImage)
{
$image = $this->imageManager->create();
$filename = $this->getUniqueFilename($uploadedImage);
$image->setFilename($filename);
$image->setMimeType($uploadedImage->getClientMimeType());
$image->setOrderNr(1);
$... | [
"public",
"function",
"createImage",
"(",
"UploadedFile",
"$",
"uploadedImage",
")",
"{",
"$",
"image",
"=",
"$",
"this",
"->",
"imageManager",
"->",
"create",
"(",
")",
";",
"$",
"filename",
"=",
"$",
"this",
"->",
"getUniqueFilename",
"(",
"$",
"uploaded... | Create image.
@param UploadedFile $uploadedImage
@return ImageInterface | [
"Create",
"image",
"."
] | b7367601b01495ae3c492b42042f804dee13ab06 | https://github.com/Silvestra/Silvestra/blob/b7367601b01495ae3c492b42042f804dee13ab06/src/Silvestra/Component/Media/Image/ImageUploader.php#L65-L85 |
7,788 | agalbourdin/agl-core | src/Mysql/Query/Update.php | Update.commit | public function commit()
{
try {
$toUpdate = array_merge($this->getFieldsToUpdate(), $this->getFieldsToDelete());
if (! empty($toUpdate)) {
$idField = $this->_item->getIdField();
$query = "
UPDATE
`" . $th... | php | public function commit()
{
try {
$toUpdate = array_merge($this->getFieldsToUpdate(), $this->getFieldsToDelete());
if (! empty($toUpdate)) {
$idField = $this->_item->getIdField();
$query = "
UPDATE
`" . $th... | [
"public",
"function",
"commit",
"(",
")",
"{",
"try",
"{",
"$",
"toUpdate",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"getFieldsToUpdate",
"(",
")",
",",
"$",
"this",
"->",
"getFieldsToDelete",
"(",
")",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",... | Commit the update to MySQL and check the query result.
@return int Number of affected rows | [
"Commit",
"the",
"update",
"to",
"MySQL",
"and",
"check",
"the",
"query",
"result",
"."
] | 1db556f9a49488aa9fab6887fefb7141a79ad97d | https://github.com/agalbourdin/agl-core/blob/1db556f9a49488aa9fab6887fefb7141a79ad97d/src/Mysql/Query/Update.php#L49-L87 |
7,789 | mariusbalcytis/oauth-commerce-lib-base | src/Maba/OAuthCommerceClient/Command.php | Command.build | protected function build()
{
if ($this->beforeExecute) {
call_user_func($this->beforeExecute, $this);
}
if ($this->bodyEntity !== null) {
if ($this->pendingRequest instanceof EntityEnclosingRequestInterface) {
$this->pendingRequest->setBody(
... | php | protected function build()
{
if ($this->beforeExecute) {
call_user_func($this->beforeExecute, $this);
}
if ($this->bodyEntity !== null) {
if ($this->pendingRequest instanceof EntityEnclosingRequestInterface) {
$this->pendingRequest->setBody(
... | [
"protected",
"function",
"build",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"beforeExecute",
")",
"{",
"call_user_func",
"(",
"$",
"this",
"->",
"beforeExecute",
",",
"$",
"this",
")",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"bodyEntity",
"!==",
"... | Create the request object that will carry out the command | [
"Create",
"the",
"request",
"object",
"that",
"will",
"carry",
"out",
"the",
"command"
] | 996fc2ba0933a5a11384d537d32073c014ef4819 | https://github.com/mariusbalcytis/oauth-commerce-lib-base/blob/996fc2ba0933a5a11384d537d32073c014ef4819/src/Maba/OAuthCommerceClient/Command.php#L212-L233 |
7,790 | phlexible/phlexible | src/Phlexible/Bundle/GuiBundle/Response/ResultResponse.php | ResultResponse.setResult | public function setResult($result = self::RESULT_SUCCESS,
$message = null,
array $data = [],
array $additional = [])
{
$this->headers->set('X-Phlexible-Response', 'result');
$values = [
'success' =... | php | public function setResult($result = self::RESULT_SUCCESS,
$message = null,
array $data = [],
array $additional = [])
{
$this->headers->set('X-Phlexible-Response', 'result');
$values = [
'success' =... | [
"public",
"function",
"setResult",
"(",
"$",
"result",
"=",
"self",
"::",
"RESULT_SUCCESS",
",",
"$",
"message",
"=",
"null",
",",
"array",
"$",
"data",
"=",
"[",
"]",
",",
"array",
"$",
"additional",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"he... | Generate a standard result.
@param bool $result True for success, false for failure
@param array $message (Optional) Message
@param array $data (Optional) Data
@param array $additional (Optional) Additional values | [
"Generate",
"a",
"standard",
"result",
"."
] | 132f24924c9bb0dbb6c1ea84db0a463f97fa3893 | https://github.com/phlexible/phlexible/blob/132f24924c9bb0dbb6c1ea84db0a463f97fa3893/src/Phlexible/Bundle/GuiBundle/Response/ResultResponse.php#L53-L73 |
7,791 | bariew/yii2-notice-cms-module | components/MainBehavior.php | MainBehavior.refresh | public function refresh()
{
$behaviors = $this->owner->behaviors();
$settings = $behaviors[$this->getName()];
foreach ($settings as $attribute=>$value) {
if (in_array($attribute, array('class'))) {
continue;
}
$this->$attribute = $value;
... | php | public function refresh()
{
$behaviors = $this->owner->behaviors();
$settings = $behaviors[$this->getName()];
foreach ($settings as $attribute=>$value) {
if (in_array($attribute, array('class'))) {
continue;
}
$this->$attribute = $value;
... | [
"public",
"function",
"refresh",
"(",
")",
"{",
"$",
"behaviors",
"=",
"$",
"this",
"->",
"owner",
"->",
"behaviors",
"(",
")",
";",
"$",
"settings",
"=",
"$",
"behaviors",
"[",
"$",
"this",
"->",
"getName",
"(",
")",
"]",
";",
"foreach",
"(",
"$",... | refreshes its attributes from owner behavior method data
@return \ActiveRecordBehavior this | [
"refreshes",
"its",
"attributes",
"from",
"owner",
"behavior",
"method",
"data"
] | 1dc9798b3ed2c511937e9d3e44867412c9f5a7b6 | https://github.com/bariew/yii2-notice-cms-module/blob/1dc9798b3ed2c511937e9d3e44867412c9f5a7b6/components/MainBehavior.php#L43-L54 |
7,792 | silencedis/phpunit-mock-helper | src/MockHelper.php | MockHelper.mockObject | public function mockObject($objectClassName, ...$configurations)
{
foreach ($configurations as &$configuration) {
$this->prepareMockConfig($configuration);
}
$config = call_user_func_array('array_replace_recursive', $configurations);
$willReturn = $this->pullOutArrayVal... | php | public function mockObject($objectClassName, ...$configurations)
{
foreach ($configurations as &$configuration) {
$this->prepareMockConfig($configuration);
}
$config = call_user_func_array('array_replace_recursive', $configurations);
$willReturn = $this->pullOutArrayVal... | [
"public",
"function",
"mockObject",
"(",
"$",
"objectClassName",
",",
"...",
"$",
"configurations",
")",
"{",
"foreach",
"(",
"$",
"configurations",
"as",
"&",
"$",
"configuration",
")",
"{",
"$",
"this",
"->",
"prepareMockConfig",
"(",
"$",
"configuration",
... | General method for mocking objects
@param string $objectClassName
@param array[] $configurations A variable number of configurations for creating of mock.
You can use this feature, for example, to gather a several configurations from different sources
and then just pass them to the `mockObject` method instead of mergi... | [
"General",
"method",
"for",
"mocking",
"objects"
] | f0b2b1be37acd5695919882b92b294a1ece0c543 | https://github.com/silencedis/phpunit-mock-helper/blob/f0b2b1be37acd5695919882b92b294a1ece0c543/src/MockHelper.php#L99-L145 |
7,793 | silencedis/phpunit-mock-helper | src/MockHelper.php | MockHelper.prepareMockConfig | protected function prepareMockConfig(array &$config = [])
{
if (!isset($config['willReturn'])) {
$config['willReturn'] = [];
}
if (!empty($config['methods']) && is_array($config['methods'])) {
$methodNames = [];
foreach ($config['methods'] as $key => $val... | php | protected function prepareMockConfig(array &$config = [])
{
if (!isset($config['willReturn'])) {
$config['willReturn'] = [];
}
if (!empty($config['methods']) && is_array($config['methods'])) {
$methodNames = [];
foreach ($config['methods'] as $key => $val... | [
"protected",
"function",
"prepareMockConfig",
"(",
"array",
"&",
"$",
"config",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"config",
"[",
"'willReturn'",
"]",
")",
")",
"{",
"$",
"config",
"[",
"'willReturn'",
"]",
"=",
"[",
"]",
"... | Index keys of the item "setMethods" using its values
@param array $config | [
"Index",
"keys",
"of",
"the",
"item",
"setMethods",
"using",
"its",
"values"
] | f0b2b1be37acd5695919882b92b294a1ece0c543 | https://github.com/silencedis/phpunit-mock-helper/blob/f0b2b1be37acd5695919882b92b294a1ece0c543/src/MockHelper.php#L152-L181 |
7,794 | silencedis/phpunit-mock-helper | src/MockHelper.php | MockHelper.getMockMethod | protected function getMockMethod($mockType)
{
if (!isset($this->mockTypesToMethodsMap[$mockType])) {
throw new InvalidMockTypeException();
}
return $this->mockTypesToMethodsMap[$mockType];
} | php | protected function getMockMethod($mockType)
{
if (!isset($this->mockTypesToMethodsMap[$mockType])) {
throw new InvalidMockTypeException();
}
return $this->mockTypesToMethodsMap[$mockType];
} | [
"protected",
"function",
"getMockMethod",
"(",
"$",
"mockType",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"mockTypesToMethodsMap",
"[",
"$",
"mockType",
"]",
")",
")",
"{",
"throw",
"new",
"InvalidMockTypeException",
"(",
")",
";",
"}",
... | Returns a name of method for getting an instance of mock.
@param string $mockType A mock type.
@return string
@throws InvalidMockTypeException | [
"Returns",
"a",
"name",
"of",
"method",
"for",
"getting",
"an",
"instance",
"of",
"mock",
"."
] | f0b2b1be37acd5695919882b92b294a1ece0c543 | https://github.com/silencedis/phpunit-mock-helper/blob/f0b2b1be37acd5695919882b92b294a1ece0c543/src/MockHelper.php#L191-L198 |
7,795 | silencedis/phpunit-mock-helper | src/MockHelper.php | MockHelper.pullOutArrayValue | private function pullOutArrayValue(array &$array, string $key, $defaultValue = null)
{
if (!array_key_exists($key, $array)) {
return $defaultValue;
}
$value = $array[$key];
unset($array[$key]);
return $value;
} | php | private function pullOutArrayValue(array &$array, string $key, $defaultValue = null)
{
if (!array_key_exists($key, $array)) {
return $defaultValue;
}
$value = $array[$key];
unset($array[$key]);
return $value;
} | [
"private",
"function",
"pullOutArrayValue",
"(",
"array",
"&",
"$",
"array",
",",
"string",
"$",
"key",
",",
"$",
"defaultValue",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"key",
",",
"$",
"array",
")",
")",
"{",
"return",
... | Returns an array item value and removes it from the array.
@param array $array An array from which the value is pulled out.
@param string $key A key of the array.
@param mixed $defaultValue A default value which will be returned if the specified key doesn't exist in the array.
@return mixed | [
"Returns",
"an",
"array",
"item",
"value",
"and",
"removes",
"it",
"from",
"the",
"array",
"."
] | f0b2b1be37acd5695919882b92b294a1ece0c543 | https://github.com/silencedis/phpunit-mock-helper/blob/f0b2b1be37acd5695919882b92b294a1ece0c543/src/MockHelper.php#L230-L240 |
7,796 | dlabas/DlcCategory | src/DlcCategory/Service/Category.php | Category.getAllCategoryTreesAsArray | public function getAllCategoryTreesAsArray()
{
$rootIds = $this->getAllRootIds();
$trees = array();
foreach ($rootIds as $rootId) {
$trees[$rootId] = $this->getCategoryTreeAsArray($rootId);
}
return $trees;
} | php | public function getAllCategoryTreesAsArray()
{
$rootIds = $this->getAllRootIds();
$trees = array();
foreach ($rootIds as $rootId) {
$trees[$rootId] = $this->getCategoryTreeAsArray($rootId);
}
return $trees;
} | [
"public",
"function",
"getAllCategoryTreesAsArray",
"(",
")",
"{",
"$",
"rootIds",
"=",
"$",
"this",
"->",
"getAllRootIds",
"(",
")",
";",
"$",
"trees",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"rootIds",
"as",
"$",
"rootId",
")",
"{",
"$",
... | Returns an array of all category trees
@return array | [
"Returns",
"an",
"array",
"of",
"all",
"category",
"trees"
] | cd4dbcae8c1c6a373f96fb0ad15ccebad383f256 | https://github.com/dlabas/DlcCategory/blob/cd4dbcae8c1c6a373f96fb0ad15ccebad383f256/src/DlcCategory/Service/Category.php#L217-L227 |
7,797 | dlabas/DlcCategory | src/DlcCategory/Service/Category.php | Category.deleteCategory | public function deleteCategory($id)
{
$this->validateId($id);
$category = $this->getMapper()->find($id);
if (null === $category) {
throw new \InvalidArgumentException('No category found for id "' . $id . '"');
}
$node = $this->getNestedSetManager()->wrapNode($c... | php | public function deleteCategory($id)
{
$this->validateId($id);
$category = $this->getMapper()->find($id);
if (null === $category) {
throw new \InvalidArgumentException('No category found for id "' . $id . '"');
}
$node = $this->getNestedSetManager()->wrapNode($c... | [
"public",
"function",
"deleteCategory",
"(",
"$",
"id",
")",
"{",
"$",
"this",
"->",
"validateId",
"(",
"$",
"id",
")",
";",
"$",
"category",
"=",
"$",
"this",
"->",
"getMapper",
"(",
")",
"->",
"find",
"(",
"$",
"id",
")",
";",
"if",
"(",
"null"... | Deletes a category node
@param int $id
@return \DlcCategory\Service\Category | [
"Deletes",
"a",
"category",
"node"
] | cd4dbcae8c1c6a373f96fb0ad15ccebad383f256 | https://github.com/dlabas/DlcCategory/blob/cd4dbcae8c1c6a373f96fb0ad15ccebad383f256/src/DlcCategory/Service/Category.php#L407-L421 |
7,798 | ekyna/Characteristics | Schema/Group.php | Group.addDefinition | public function addDefinition(Definition $definition)
{
if ($this->hasDefinition($definition)) {
throw new \InvalidArgumentException(sprintf('Definition "%s" allready exists.', $definition->getName()));
}
$this->definitions[$definition->getName()] = $definition;
return ... | php | public function addDefinition(Definition $definition)
{
if ($this->hasDefinition($definition)) {
throw new \InvalidArgumentException(sprintf('Definition "%s" allready exists.', $definition->getName()));
}
$this->definitions[$definition->getName()] = $definition;
return ... | [
"public",
"function",
"addDefinition",
"(",
"Definition",
"$",
"definition",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasDefinition",
"(",
"$",
"definition",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'Definition \"%... | Adds a definition.
@param Definition $definition
@throws \InvalidArgumentException
@return Group | [
"Adds",
"a",
"definition",
"."
] | 118a349fd98a7c28721d3cbaba67ce79d1cffada | https://github.com/ekyna/Characteristics/blob/118a349fd98a7c28721d3cbaba67ce79d1cffada/Schema/Group.php#L108-L117 |
7,799 | ekyna/Characteristics | Schema/Group.php | Group.getDefinitionByName | public function getDefinitionByName($name)
{
if (!array_key_exists($name, $this->definitions)) {
throw new \InvalidArgumentException(sprintf('Can\'t find "%s" Definition.', $name));
}
return $this->definitions[$name];
} | php | public function getDefinitionByName($name)
{
if (!array_key_exists($name, $this->definitions)) {
throw new \InvalidArgumentException(sprintf('Can\'t find "%s" Definition.', $name));
}
return $this->definitions[$name];
} | [
"public",
"function",
"getDefinitionByName",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"definitions",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'Ca... | Returns a definition by name.
@param $name
@throws \InvalidArgumentException
@return Definition | [
"Returns",
"a",
"definition",
"by",
"name",
"."
] | 118a349fd98a7c28721d3cbaba67ce79d1cffada | https://github.com/ekyna/Characteristics/blob/118a349fd98a7c28721d3cbaba67ce79d1cffada/Schema/Group.php#L128-L135 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.