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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
235,400 | leedave/html | src/Html5.php | Html5.button | public static function button(
string $label,
string $type = "submit",
string $onclick = null,
array $attributes = []
) : string
{
$buttonPreAttributes = [
"type" => $type,
];
if ($onclick) {
$buttonPreAttributes["onclic... | php | public static function button(
string $label,
string $type = "submit",
string $onclick = null,
array $attributes = []
) : string
{
$buttonPreAttributes = [
"type" => $type,
];
if ($onclick) {
$buttonPreAttributes["onclic... | [
"public",
"static",
"function",
"button",
"(",
"string",
"$",
"label",
",",
"string",
"$",
"type",
"=",
"\"submit\"",
",",
"string",
"$",
"onclick",
"=",
"null",
",",
"array",
"$",
"attributes",
"=",
"[",
"]",
")",
":",
"string",
"{",
"$",
"buttonPreAt... | Create a Button Tag
@param string $label Button Content
@param string $type type attribute
@param string $onclick onclick attribute
@param array $attributes further attributes
@return string HTML Code | [
"Create",
"a",
"Button",
"Tag"
] | f0780b37c34defbbd92d29f4e1a41ce875b4d300 | https://github.com/leedave/html/blob/f0780b37c34defbbd92d29f4e1a41ce875b4d300/src/Html5.php#L207-L224 |
235,401 | leedave/html | src/Html5.php | Html5.input | public static function input(
string $name,
string $type = "text",
string $value = null,
array $attributes = []
) : string
{
$preAttributesInput = [
"name" => $name,
"type" => $type,
];
if (!is_null($value)) {
$preAt... | php | public static function input(
string $name,
string $type = "text",
string $value = null,
array $attributes = []
) : string
{
$preAttributesInput = [
"name" => $name,
"type" => $type,
];
if (!is_null($value)) {
$preAt... | [
"public",
"static",
"function",
"input",
"(",
"string",
"$",
"name",
",",
"string",
"$",
"type",
"=",
"\"text\"",
",",
"string",
"$",
"value",
"=",
"null",
",",
"array",
"$",
"attributes",
"=",
"[",
"]",
")",
":",
"string",
"{",
"$",
"preAttributesInpu... | Create an input tag
@param string $name name attribute (always needed)
@param string $type type attribute (always needed)
@param string $value pre set value
@param array $attributes further attributes
@return string HTML Code | [
"Create",
"an",
"input",
"tag"
] | f0780b37c34defbbd92d29f4e1a41ce875b4d300 | https://github.com/leedave/html/blob/f0780b37c34defbbd92d29f4e1a41ce875b4d300/src/Html5.php#L770-L786 |
235,402 | leedave/html | src/Html5.php | Html5.label | public static function label(
string $label,
string $for,
array $attributes = []
) : string
{
$preAttributesLabel = [
"for" => $for,
];
$attributesLabel = array_merge($preAttributesLabel, $attributes);
return self::tag("label", $label, $attri... | php | public static function label(
string $label,
string $for,
array $attributes = []
) : string
{
$preAttributesLabel = [
"for" => $for,
];
$attributesLabel = array_merge($preAttributesLabel, $attributes);
return self::tag("label", $label, $attri... | [
"public",
"static",
"function",
"label",
"(",
"string",
"$",
"label",
",",
"string",
"$",
"for",
",",
"array",
"$",
"attributes",
"=",
"[",
"]",
")",
":",
"string",
"{",
"$",
"preAttributesLabel",
"=",
"[",
"\"for\"",
"=>",
"$",
"for",
",",
"]",
";",... | Creates label Tag
@param string $label content of tag
@param string $for for attribute (always needed)
@param array $attributes further attributes
@return string HTML Code | [
"Creates",
"label",
"Tag"
] | f0780b37c34defbbd92d29f4e1a41ce875b4d300 | https://github.com/leedave/html/blob/f0780b37c34defbbd92d29f4e1a41ce875b4d300/src/Html5.php#L824-L835 |
235,403 | leedave/html | src/Html5.php | Html5.span | public static function span(
string $content = null,
array $attributes = []
) : string
{
return self::tag("span", $content, $attributes);
} | php | public static function span(
string $content = null,
array $attributes = []
) : string
{
return self::tag("span", $content, $attributes);
} | [
"public",
"static",
"function",
"span",
"(",
"string",
"$",
"content",
"=",
"null",
",",
"array",
"$",
"attributes",
"=",
"[",
"]",
")",
":",
"string",
"{",
"return",
"self",
"::",
"tag",
"(",
"\"span\"",
",",
"$",
"content",
",",
"$",
"attributes",
... | Create span tag
@param string $content content
@param array $attributes further attributes
@return HTML Code | [
"Create",
"span",
"tag"
] | f0780b37c34defbbd92d29f4e1a41ce875b4d300 | https://github.com/leedave/html/blob/f0780b37c34defbbd92d29f4e1a41ce875b4d300/src/Html5.php#L1283-L1289 |
235,404 | leedave/html | src/Html5.php | Html5.table | public static function table(
string $content = null,
array $attributes = []
) : string
{
return self::tag("table", $content, $attributes);
} | php | public static function table(
string $content = null,
array $attributes = []
) : string
{
return self::tag("table", $content, $attributes);
} | [
"public",
"static",
"function",
"table",
"(",
"string",
"$",
"content",
"=",
"null",
",",
"array",
"$",
"attributes",
"=",
"[",
"]",
")",
":",
"string",
"{",
"return",
"self",
"::",
"tag",
"(",
"\"table\"",
",",
"$",
"content",
",",
"$",
"attributes",
... | Create table tag
@param string $content content
@param array $attributes attributes
@return string HTML Code | [
"Create",
"table",
"tag"
] | f0780b37c34defbbd92d29f4e1a41ce875b4d300 | https://github.com/leedave/html/blob/f0780b37c34defbbd92d29f4e1a41ce875b4d300/src/Html5.php#L1368-L1374 |
235,405 | leedave/html | src/Html5.php | Html5.tbody | public static function tbody(
string $content = null,
array $attributes = []
) : string
{
return self::tag("tbody", $content, $attributes);
} | php | public static function tbody(
string $content = null,
array $attributes = []
) : string
{
return self::tag("tbody", $content, $attributes);
} | [
"public",
"static",
"function",
"tbody",
"(",
"string",
"$",
"content",
"=",
"null",
",",
"array",
"$",
"attributes",
"=",
"[",
"]",
")",
":",
"string",
"{",
"return",
"self",
"::",
"tag",
"(",
"\"tbody\"",
",",
"$",
"content",
",",
"$",
"attributes",
... | create tbody tag
@param string $content content
@param array $attributes further attributes
@return HTML Code | [
"create",
"tbody",
"tag"
] | f0780b37c34defbbd92d29f4e1a41ce875b4d300 | https://github.com/leedave/html/blob/f0780b37c34defbbd92d29f4e1a41ce875b4d300/src/Html5.php#L1383-L1389 |
235,406 | leedave/html | src/Html5.php | Html5.td | public static function td(
string $content = null,
array $attributes = []
) : string
{
return self::tag("td", $content, $attributes);
} | php | public static function td(
string $content = null,
array $attributes = []
) : string
{
return self::tag("td", $content, $attributes);
} | [
"public",
"static",
"function",
"td",
"(",
"string",
"$",
"content",
"=",
"null",
",",
"array",
"$",
"attributes",
"=",
"[",
"]",
")",
":",
"string",
"{",
"return",
"self",
"::",
"tag",
"(",
"\"td\"",
",",
"$",
"content",
",",
"$",
"attributes",
")",... | create td tag
@param string $content content
@param array $attributes further attributes
@return HTML Code | [
"create",
"td",
"tag"
] | f0780b37c34defbbd92d29f4e1a41ce875b4d300 | https://github.com/leedave/html/blob/f0780b37c34defbbd92d29f4e1a41ce875b4d300/src/Html5.php#L1398-L1404 |
235,407 | leedave/html | src/Html5.php | Html5.th | public static function th(
string $content = null,
array $attributes = []
) : string
{
return self::tag("th", $content, $attributes);
} | php | public static function th(
string $content = null,
array $attributes = []
) : string
{
return self::tag("th", $content, $attributes);
} | [
"public",
"static",
"function",
"th",
"(",
"string",
"$",
"content",
"=",
"null",
",",
"array",
"$",
"attributes",
"=",
"[",
"]",
")",
":",
"string",
"{",
"return",
"self",
"::",
"tag",
"(",
"\"th\"",
",",
"$",
"content",
",",
"$",
"attributes",
")",... | Create th tag
@param string $content content
@param array $attributes further attributes
@return HTML Code | [
"Create",
"th",
"tag"
] | f0780b37c34defbbd92d29f4e1a41ce875b4d300 | https://github.com/leedave/html/blob/f0780b37c34defbbd92d29f4e1a41ce875b4d300/src/Html5.php#L1441-L1447 |
235,408 | leedave/html | src/Html5.php | Html5.thead | public static function thead(
string $content = null,
array $attributes = []
) : string
{
return self::tag("thead", $content, $attributes);
} | php | public static function thead(
string $content = null,
array $attributes = []
) : string
{
return self::tag("thead", $content, $attributes);
} | [
"public",
"static",
"function",
"thead",
"(",
"string",
"$",
"content",
"=",
"null",
",",
"array",
"$",
"attributes",
"=",
"[",
"]",
")",
":",
"string",
"{",
"return",
"self",
"::",
"tag",
"(",
"\"thead\"",
",",
"$",
"content",
",",
"$",
"attributes",
... | Create thead tag
@param string $content content
@param array $attributes further attributes
@return HTML Code | [
"Create",
"thead",
"tag"
] | f0780b37c34defbbd92d29f4e1a41ce875b4d300 | https://github.com/leedave/html/blob/f0780b37c34defbbd92d29f4e1a41ce875b4d300/src/Html5.php#L1456-L1462 |
235,409 | leedave/html | src/Html5.php | Html5.tr | public static function tr(
string $content = null,
array $attributes = []
) : string
{
return self::tag("tr", $content, $attributes);
} | php | public static function tr(
string $content = null,
array $attributes = []
) : string
{
return self::tag("tr", $content, $attributes);
} | [
"public",
"static",
"function",
"tr",
"(",
"string",
"$",
"content",
"=",
"null",
",",
"array",
"$",
"attributes",
"=",
"[",
"]",
")",
":",
"string",
"{",
"return",
"self",
"::",
"tag",
"(",
"\"tr\"",
",",
"$",
"content",
",",
"$",
"attributes",
")",... | Create tr tag
@param string $content content
@param array $attributes further attributes
@return HTML Code | [
"Create",
"tr",
"tag"
] | f0780b37c34defbbd92d29f4e1a41ce875b4d300 | https://github.com/leedave/html/blob/f0780b37c34defbbd92d29f4e1a41ce875b4d300/src/Html5.php#L1497-L1503 |
235,410 | leedave/html | src/Html5.php | Html5.ul | public static function ul(
string $content = null,
array $attributes = []
) : string
{
return self::tag("ul", $content, $attributes);
} | php | public static function ul(
string $content = null,
array $attributes = []
) : string
{
return self::tag("ul", $content, $attributes);
} | [
"public",
"static",
"function",
"ul",
"(",
"string",
"$",
"content",
"=",
"null",
",",
"array",
"$",
"attributes",
"=",
"[",
"]",
")",
":",
"string",
"{",
"return",
"self",
"::",
"tag",
"(",
"\"ul\"",
",",
"$",
"content",
",",
"$",
"attributes",
")",... | Render unordered list tag
@param string $content
@param array $attributes
@return string | [
"Render",
"unordered",
"list",
"tag"
] | f0780b37c34defbbd92d29f4e1a41ce875b4d300 | https://github.com/leedave/html/blob/f0780b37c34defbbd92d29f4e1a41ce875b4d300/src/Html5.php#L1539-L1545 |
235,411 | leedave/html | src/Html5.php | Html5.ol | public static function ol(
string $content = null,
array $attributes = []
) : string
{
return self::tag("ol", $content, $attributes);
} | php | public static function ol(
string $content = null,
array $attributes = []
) : string
{
return self::tag("ol", $content, $attributes);
} | [
"public",
"static",
"function",
"ol",
"(",
"string",
"$",
"content",
"=",
"null",
",",
"array",
"$",
"attributes",
"=",
"[",
"]",
")",
":",
"string",
"{",
"return",
"self",
"::",
"tag",
"(",
"\"ol\"",
",",
"$",
"content",
",",
"$",
"attributes",
")",... | Render Ordered List
@param string $content
@param array $attributes
@return string | [
"Render",
"Ordered",
"List"
] | f0780b37c34defbbd92d29f4e1a41ce875b4d300 | https://github.com/leedave/html/blob/f0780b37c34defbbd92d29f4e1a41ce875b4d300/src/Html5.php#L1581-L1587 |
235,412 | leedave/html | src/Html5.php | Html5.li | public static function li(
string $content = null,
array $attributes = []
) : string
{
return self::tag("li", $content, $attributes);
} | php | public static function li(
string $content = null,
array $attributes = []
) : string
{
return self::tag("li", $content, $attributes);
} | [
"public",
"static",
"function",
"li",
"(",
"string",
"$",
"content",
"=",
"null",
",",
"array",
"$",
"attributes",
"=",
"[",
"]",
")",
":",
"string",
"{",
"return",
"self",
"::",
"tag",
"(",
"\"li\"",
",",
"$",
"content",
",",
"$",
"attributes",
")",... | Render List Item Tag
@param string $content
@param array $attributes
@return string | [
"Render",
"List",
"Item",
"Tag"
] | f0780b37c34defbbd92d29f4e1a41ce875b4d300 | https://github.com/leedave/html/blob/f0780b37c34defbbd92d29f4e1a41ce875b4d300/src/Html5.php#L1595-L1601 |
235,413 | leedave/html | src/Html5.php | Html5.renderTable | public static function renderTable(
array $head = [],
array $body = [],
array $attributes = []
) : string
{
$strHead = "";
$strBody = "";
foreach ($head as $thRow) {
$strHead .= self::renderTableHeaderRow($thRow);
}
if ($str... | php | public static function renderTable(
array $head = [],
array $body = [],
array $attributes = []
) : string
{
$strHead = "";
$strBody = "";
foreach ($head as $thRow) {
$strHead .= self::renderTableHeaderRow($thRow);
}
if ($str... | [
"public",
"static",
"function",
"renderTable",
"(",
"array",
"$",
"head",
"=",
"[",
"]",
",",
"array",
"$",
"body",
"=",
"[",
"]",
",",
"array",
"$",
"attributes",
"=",
"[",
"]",
")",
":",
"string",
"{",
"$",
"strHead",
"=",
"\"\"",
";",
"$",
"st... | Put all elements together to form a standard table
@param array $head two dimensional rows and cells (no keys)
@param array $body two dimensional rows and cells (no keys)
@param array $attributes
@return string Compiled HTML Table | [
"Put",
"all",
"elements",
"together",
"to",
"form",
"a",
"standard",
"table"
] | f0780b37c34defbbd92d29f4e1a41ce875b4d300 | https://github.com/leedave/html/blob/f0780b37c34defbbd92d29f4e1a41ce875b4d300/src/Html5.php#L1656-L1680 |
235,414 | AnonymPHP/Anonym-Library | src/Anonym/Application/RegisterProviders.php | RegisterProviders.register | public function register()
{
$app = $this->app;
foreach ($app->getProviders() as $provider) {
$provider = new $provider($app);
if (!$provider instanceof ServiceProvider) {
throw new ProviderException(sprintf('Your %s proiver must be a instance of ServicePr... | php | public function register()
{
$app = $this->app;
foreach ($app->getProviders() as $provider) {
$provider = new $provider($app);
if (!$provider instanceof ServiceProvider) {
throw new ProviderException(sprintf('Your %s proiver must be a instance of ServicePr... | [
"public",
"function",
"register",
"(",
")",
"{",
"$",
"app",
"=",
"$",
"this",
"->",
"app",
";",
"foreach",
"(",
"$",
"app",
"->",
"getProviders",
"(",
")",
"as",
"$",
"provider",
")",
"{",
"$",
"provider",
"=",
"new",
"$",
"provider",
"(",
"$",
... | register the providers
@throws ProviderException | [
"register",
"the",
"providers"
] | c967ad804f84e8fb204593a0959cda2fed5ae075 | https://github.com/AnonymPHP/Anonym-Library/blob/c967ad804f84e8fb204593a0959cda2fed5ae075/src/Anonym/Application/RegisterProviders.php#L43-L61 |
235,415 | razielsd/webdriverlib | WebDriver/WebDriver/Driver.php | WebDriver_Driver.parseResponse | protected function parseResponse($rawResponse, $infoList, $command)
{
$httpStatusCode = isset($infoList['http_code']) ? $infoList['http_code'] : 0;
$messageList = [
"HTTP Response Status Code: {$httpStatusCode}",
WebDriver_Exception_Protocol::getCommandDescription($command)
... | php | protected function parseResponse($rawResponse, $infoList, $command)
{
$httpStatusCode = isset($infoList['http_code']) ? $infoList['http_code'] : 0;
$messageList = [
"HTTP Response Status Code: {$httpStatusCode}",
WebDriver_Exception_Protocol::getCommandDescription($command)
... | [
"protected",
"function",
"parseResponse",
"(",
"$",
"rawResponse",
",",
"$",
"infoList",
",",
"$",
"command",
")",
"{",
"$",
"httpStatusCode",
"=",
"isset",
"(",
"$",
"infoList",
"[",
"'http_code'",
"]",
")",
"?",
"$",
"infoList",
"[",
"'http_code'",
"]",
... | Returns parsed response.
@param string $rawResponse
@param array $infoList
@param WebDriver_Command $command
@throws WebDriver_Exception
@throws WebDriver_NoSeleniumException
@return array | [
"Returns",
"parsed",
"response",
"."
] | e498afc36a8cdeab5b6ca95016420557baf32f36 | https://github.com/razielsd/webdriverlib/blob/e498afc36a8cdeab5b6ca95016420557baf32f36/WebDriver/WebDriver/Driver.php#L249-L285 |
235,416 | ShortCirquit/LinkoScopeApi | ComLinkoScope.php | ComLinkoScope.updateFromPostCache | private function updateFromPostCache(Comment $comment, $c)
{
if ($comment->postId == null)
{
return;
}
if ($this->postCache == null || $this->postCache['ID'] != $comment->postId)
{
$this->postCache = $this->adminApi->getPost($comment->postId);
... | php | private function updateFromPostCache(Comment $comment, $c)
{
if ($comment->postId == null)
{
return;
}
if ($this->postCache == null || $this->postCache['ID'] != $comment->postId)
{
$this->postCache = $this->adminApi->getPost($comment->postId);
... | [
"private",
"function",
"updateFromPostCache",
"(",
"Comment",
"$",
"comment",
",",
"$",
"c",
")",
"{",
"if",
"(",
"$",
"comment",
"->",
"postId",
"==",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"postCache",
"==",
"null",
"||... | fetch associated post if it hasn't been fetched before, or if the incorrect post is cached. | [
"fetch",
"associated",
"post",
"if",
"it",
"hasn",
"t",
"been",
"fetched",
"before",
"or",
"if",
"the",
"incorrect",
"post",
"is",
"cached",
"."
] | a25f2233a67eeb916cddb6ff80ba3297e4597d13 | https://github.com/ShortCirquit/LinkoScopeApi/blob/a25f2233a67eeb916cddb6ff80ba3297e4597d13/ComLinkoScope.php#L342-L356 |
235,417 | osflab/view | Helper/Tags/Link.php | Link.appendStylesheet | public function appendStylesheet($href, $media = null, array $attributes = [], $priority = false)
{
static $counter = 0;
$attributes['rel'] = 'stylesheet';
$attributes['href'] = $href;
//$attributes['type'] = 'text/css';
$media && $attributes['media'] = $media;
... | php | public function appendStylesheet($href, $media = null, array $attributes = [], $priority = false)
{
static $counter = 0;
$attributes['rel'] = 'stylesheet';
$attributes['href'] = $href;
//$attributes['type'] = 'text/css';
$media && $attributes['media'] = $media;
... | [
"public",
"function",
"appendStylesheet",
"(",
"$",
"href",
",",
"$",
"media",
"=",
"null",
",",
"array",
"$",
"attributes",
"=",
"[",
"]",
",",
"$",
"priority",
"=",
"false",
")",
"{",
"static",
"$",
"counter",
"=",
"0",
";",
"$",
"attributes",
"[",... | Link to a CSS stylesheet
@param string $href
@param string $media
@param array $attributes
@return \Osf\View\Helper\HeadLink | [
"Link",
"to",
"a",
"CSS",
"stylesheet"
] | e06601013e8ec86dc2055e000e58dffd963c78e2 | https://github.com/osflab/view/blob/e06601013e8ec86dc2055e000e58dffd963c78e2/Helper/Tags/Link.php#L34-L45 |
235,418 | studyportals/SQL | src/MySQLResultSet.php | MySQLResultSet.next | public function next(){
if(next($this->_fetched) instanceof SQLResultRow){
return current($this->_fetched);
}
else{
try{
$mySQLResultRow = new MySQLResultRow($this->_result);
}
catch(SQLResultRowException $e){
return false;
}
// Clear fetch buffer in case of an unbuffered result-se... | php | public function next(){
if(next($this->_fetched) instanceof SQLResultRow){
return current($this->_fetched);
}
else{
try{
$mySQLResultRow = new MySQLResultRow($this->_result);
}
catch(SQLResultRowException $e){
return false;
}
// Clear fetch buffer in case of an unbuffered result-se... | [
"public",
"function",
"next",
"(",
")",
"{",
"if",
"(",
"next",
"(",
"$",
"this",
"->",
"_fetched",
")",
"instanceof",
"SQLResultRow",
")",
"{",
"return",
"current",
"(",
"$",
"this",
"->",
"_fetched",
")",
";",
"}",
"else",
"{",
"try",
"{",
"$",
"... | Read next result-row from the result-set.
@return SQLResultRow|false | [
"Read",
"next",
"result",
"-",
"row",
"from",
"the",
"result",
"-",
"set",
"."
] | 4f038ced9a3738c1d4ad562f93547812931d9ed4 | https://github.com/studyportals/SQL/blob/4f038ced9a3738c1d4ad562f93547812931d9ed4/src/MySQLResultSet.php#L61-L89 |
235,419 | joegreen88/zf1-components-base | src/Zend/Loader.php | Zend_Loader.standardiseFile | public static function standardiseFile($file)
{
$fileName = ltrim($file, '\\');
$file = '';
$namespace = '';
if ($lastNsPos = strripos($fileName, '\\')) {
$namespace = substr($fileName, 0, $lastNsPos);
$fileName = substr($fileName, $lastNsPos + 1);
... | php | public static function standardiseFile($file)
{
$fileName = ltrim($file, '\\');
$file = '';
$namespace = '';
if ($lastNsPos = strripos($fileName, '\\')) {
$namespace = substr($fileName, 0, $lastNsPos);
$fileName = substr($fileName, $lastNsPos + 1);
... | [
"public",
"static",
"function",
"standardiseFile",
"(",
"$",
"file",
")",
"{",
"$",
"fileName",
"=",
"ltrim",
"(",
"$",
"file",
",",
"'\\\\'",
")",
";",
"$",
"file",
"=",
"''",
";",
"$",
"namespace",
"=",
"''",
";",
"if",
"(",
"$",
"lastNsPos",
"="... | Standardise the filename.
Convert the supplied filename into the namespace-aware standard,
based on the Framework Interop Group reference implementation:
http://groups.google.com/group/php-standards/web/psr-0-final-proposal
The filename must be formatted as "$file.php".
@param string $file - The file name to be load... | [
"Standardise",
"the",
"filename",
"."
] | d4591a2234c2db3094b54c08bcdc4303f7bf4819 | https://github.com/joegreen88/zf1-components-base/blob/d4591a2234c2db3094b54c08bcdc4303f7bf4819/src/Zend/Loader.php#L338-L350 |
235,420 | milkyway-multimedia/ss-zen-forms | src/Extensions/Form.php | Form.saveToSession | function saveToSession($data, $name = '') {
if(!$name) $name = $this->owner->FormName();
\Session::set("FormInfo.{$name}.data", $data);
} | php | function saveToSession($data, $name = '') {
if(!$name) $name = $this->owner->FormName();
\Session::set("FormInfo.{$name}.data", $data);
} | [
"function",
"saveToSession",
"(",
"$",
"data",
",",
"$",
"name",
"=",
"''",
")",
"{",
"if",
"(",
"!",
"$",
"name",
")",
"$",
"name",
"=",
"$",
"this",
"->",
"owner",
"->",
"FormName",
"(",
")",
";",
"\\",
"Session",
"::",
"set",
"(",
"\"FormInfo.... | save form data to session | [
"save",
"form",
"data",
"to",
"session"
] | 24098390d88fff016a6e6299fd2fda50f11be064 | https://github.com/milkyway-multimedia/ss-zen-forms/blob/24098390d88fff016a6e6299fd2fda50f11be064/src/Extensions/Form.php#L22-L26 |
235,421 | milkyway-multimedia/ss-zen-forms | src/Extensions/Form.php | Form.loadFromSession | function loadFromSession($name = '') {
if(!$name) $name = $this->owner->FormName();
$formSession = \Session::get("FormInfo.{$name}.data");
if($formSession) $this->owner->loadDataFrom($formSession);
} | php | function loadFromSession($name = '') {
if(!$name) $name = $this->owner->FormName();
$formSession = \Session::get("FormInfo.{$name}.data");
if($formSession) $this->owner->loadDataFrom($formSession);
} | [
"function",
"loadFromSession",
"(",
"$",
"name",
"=",
"''",
")",
"{",
"if",
"(",
"!",
"$",
"name",
")",
"$",
"name",
"=",
"$",
"this",
"->",
"owner",
"->",
"FormName",
"(",
")",
";",
"$",
"formSession",
"=",
"\\",
"Session",
"::",
"get",
"(",
"\"... | load form data from session | [
"load",
"form",
"data",
"from",
"session"
] | 24098390d88fff016a6e6299fd2fda50f11be064 | https://github.com/milkyway-multimedia/ss-zen-forms/blob/24098390d88fff016a6e6299fd2fda50f11be064/src/Extensions/Form.php#L31-L36 |
235,422 | milkyway-multimedia/ss-zen-forms | src/Extensions/Form.php | Form.clearSessionData | function clearSessionData($name = '', $clearErrors = true){
if(!$name) $name = $this->owner->FormName();
\Session::clear("FormInfo.{$name}.data");
if($clearErrors) \Session::clear("FormInfo.{$name}.errors");
} | php | function clearSessionData($name = '', $clearErrors = true){
if(!$name) $name = $this->owner->FormName();
\Session::clear("FormInfo.{$name}.data");
if($clearErrors) \Session::clear("FormInfo.{$name}.errors");
} | [
"function",
"clearSessionData",
"(",
"$",
"name",
"=",
"''",
",",
"$",
"clearErrors",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"$",
"name",
")",
"$",
"name",
"=",
"$",
"this",
"->",
"owner",
"->",
"FormName",
"(",
")",
";",
"\\",
"Session",
"::",
"... | clear current form data session | [
"clear",
"current",
"form",
"data",
"session"
] | 24098390d88fff016a6e6299fd2fda50f11be064 | https://github.com/milkyway-multimedia/ss-zen-forms/blob/24098390d88fff016a6e6299fd2fda50f11be064/src/Extensions/Form.php#L41-L45 |
235,423 | railsphp/framework | src/Rails/ActiveRecord/Base/Methods/ModelSchemaMethodsTrait.php | ModelSchemaMethodsTrait.tableName | public static function tableName()
{
if (static::TABLE_NAME) {
return static::TABLE_NAME;
} else {
$cn = str_replace('\\', '_', get_called_class());
$inf = self::services()->get('inflector');
$tableName = $inf->underscore($inf->pluralize(... | php | public static function tableName()
{
if (static::TABLE_NAME) {
return static::TABLE_NAME;
} else {
$cn = str_replace('\\', '_', get_called_class());
$inf = self::services()->get('inflector');
$tableName = $inf->underscore($inf->pluralize(... | [
"public",
"static",
"function",
"tableName",
"(",
")",
"{",
"if",
"(",
"static",
"::",
"TABLE_NAME",
")",
"{",
"return",
"static",
"::",
"TABLE_NAME",
";",
"}",
"else",
"{",
"$",
"cn",
"=",
"str_replace",
"(",
"'\\\\'",
",",
"'_'",
",",
"get_called_class... | Returns the value of the TABLE_NAME constant if not empty,
otherwise it figures out the name of the table out of the
name of the model class.
@return string | [
"Returns",
"the",
"value",
"of",
"the",
"TABLE_NAME",
"constant",
"if",
"not",
"empty",
"otherwise",
"it",
"figures",
"out",
"the",
"name",
"of",
"the",
"table",
"out",
"of",
"the",
"name",
"of",
"the",
"model",
"class",
"."
] | 2ac9d3e493035dcc68f3c3812423327127327cd5 | https://github.com/railsphp/framework/blob/2ac9d3e493035dcc68f3c3812423327127327cd5/src/Rails/ActiveRecord/Base/Methods/ModelSchemaMethodsTrait.php#L34-L46 |
235,424 | jfortunato/fortune | src/Configuration/Configuration.php | Configuration.resourceConfigurationFor | public function resourceConfigurationFor($resourceName)
{
foreach ($this->resourceConfigurations as $config) {
if ($config->getResource() === $resourceName) {
return $config;
}
}
return null;
} | php | public function resourceConfigurationFor($resourceName)
{
foreach ($this->resourceConfigurations as $config) {
if ($config->getResource() === $resourceName) {
return $config;
}
}
return null;
} | [
"public",
"function",
"resourceConfigurationFor",
"(",
"$",
"resourceName",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"resourceConfigurations",
"as",
"$",
"config",
")",
"{",
"if",
"(",
"$",
"config",
"->",
"getResource",
"(",
")",
"===",
"$",
"resourceNa... | Get ResourceConfiguration from resource name.
@param mixed $resourceName
@return ResourceConfiguration|null | [
"Get",
"ResourceConfiguration",
"from",
"resource",
"name",
"."
] | 3bbf66a85304070562e54a66c99145f58f32877e | https://github.com/jfortunato/fortune/blob/3bbf66a85304070562e54a66c99145f58f32877e/src/Configuration/Configuration.php#L104-L113 |
235,425 | PentagonalProject/SlimService | src/Sanitizer.php | Sanitizer.fixDirectorySeparator | public static function fixDirectorySeparator(string $path, $useCleanPrefix = false) : string
{
/**
* Trimming path string
*/
if (($path = trim($path)) == '') {
return $path;
}
$path = preg_replace('`(\/|\\\)+`', DIRECTORY_SEPARATOR, $path);
if (... | php | public static function fixDirectorySeparator(string $path, $useCleanPrefix = false) : string
{
/**
* Trimming path string
*/
if (($path = trim($path)) == '') {
return $path;
}
$path = preg_replace('`(\/|\\\)+`', DIRECTORY_SEPARATOR, $path);
if (... | [
"public",
"static",
"function",
"fixDirectorySeparator",
"(",
"string",
"$",
"path",
",",
"$",
"useCleanPrefix",
"=",
"false",
")",
":",
"string",
"{",
"/**\n * Trimming path string\n */",
"if",
"(",
"(",
"$",
"path",
"=",
"trim",
"(",
"$",
"path... | Fix Path Separator
@param string $path
@param bool $useCleanPrefix
@return string | [
"Fix",
"Path",
"Separator"
] | 65df2ad530e28b6d72aad5394a0872760aad44cb | https://github.com/PentagonalProject/SlimService/blob/65df2ad530e28b6d72aad5394a0872760aad44cb/src/Sanitizer.php#L43-L58 |
235,426 | PentagonalProject/SlimService | src/Sanitizer.php | Sanitizer.normalizePath | public static function normalizePath($path) : string
{
$path = self::fixDirectorySeparator($path);
$path = preg_replace('|(?<=.)/+|', DIRECTORY_SEPARATOR, $path);
if (':' === substr($path, 1, 1)) {
$path = ucfirst($path);
}
if (Validator::isAbsolutePath($path) &&... | php | public static function normalizePath($path) : string
{
$path = self::fixDirectorySeparator($path);
$path = preg_replace('|(?<=.)/+|', DIRECTORY_SEPARATOR, $path);
if (':' === substr($path, 1, 1)) {
$path = ucfirst($path);
}
if (Validator::isAbsolutePath($path) &&... | [
"public",
"static",
"function",
"normalizePath",
"(",
"$",
"path",
")",
":",
"string",
"{",
"$",
"path",
"=",
"self",
"::",
"fixDirectorySeparator",
"(",
"$",
"path",
")",
";",
"$",
"path",
"=",
"preg_replace",
"(",
"'|(?<=.)/+|'",
",",
"DIRECTORY_SEPARATOR"... | Normalize a filesystem path.
@param string $path Path to normalize.
@return string Normalized path. | [
"Normalize",
"a",
"filesystem",
"path",
"."
] | 65df2ad530e28b6d72aad5394a0872760aad44cb | https://github.com/PentagonalProject/SlimService/blob/65df2ad530e28b6d72aad5394a0872760aad44cb/src/Sanitizer.php#L66-L92 |
235,427 | PentagonalProject/SlimService | src/Sanitizer.php | Sanitizer.multiByteEntities | public static function multiByteEntities($mixed, $entity = false)
{
static $hasIconV;
static $limit;
if (!isset($hasIconV)) {
// safe resource check
$hasIconV = function_exists('iconv');
}
if (!isset($limit)) {
$limit = @ini_get('pcre.back... | php | public static function multiByteEntities($mixed, $entity = false)
{
static $hasIconV;
static $limit;
if (!isset($hasIconV)) {
// safe resource check
$hasIconV = function_exists('iconv');
}
if (!isset($limit)) {
$limit = @ini_get('pcre.back... | [
"public",
"static",
"function",
"multiByteEntities",
"(",
"$",
"mixed",
",",
"$",
"entity",
"=",
"false",
")",
"{",
"static",
"$",
"hasIconV",
";",
"static",
"$",
"limit",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"hasIconV",
")",
")",
"{",
"// safe reso... | Entities the Multi bytes deep string
@param mixed $mixed the string to detect multi bytes
@param bool $entity true if want to entity the output
@return mixed | [
"Entities",
"the",
"Multi",
"bytes",
"deep",
"string"
] | 65df2ad530e28b6d72aad5394a0872760aad44cb | https://github.com/PentagonalProject/SlimService/blob/65df2ad530e28b6d72aad5394a0872760aad44cb/src/Sanitizer.php#L102-L157 |
235,428 | PentagonalProject/SlimService | src/Sanitizer.php | Sanitizer.maybeUnSerialize | public static function maybeUnSerialize($original)
{
if (! is_string($original) || trim($original) == '') {
return $original;
}
/**
* Check if serialized
* check with trim
*/
if (self::isSerialized($original)) {
/**
* u... | php | public static function maybeUnSerialize($original)
{
if (! is_string($original) || trim($original) == '') {
return $original;
}
/**
* Check if serialized
* check with trim
*/
if (self::isSerialized($original)) {
/**
* u... | [
"public",
"static",
"function",
"maybeUnSerialize",
"(",
"$",
"original",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"original",
")",
"||",
"trim",
"(",
"$",
"original",
")",
"==",
"''",
")",
"{",
"return",
"$",
"original",
";",
"}",
"/**\n ... | Un-serialize value only if it was serialized.
@param string $original Maybe un-serialized original, if is needed.
@return mixed Un-serialized data can be any type. | [
"Un",
"-",
"serialize",
"value",
"only",
"if",
"it",
"was",
"serialized",
"."
] | 65df2ad530e28b6d72aad5394a0872760aad44cb | https://github.com/PentagonalProject/SlimService/blob/65df2ad530e28b6d72aad5394a0872760aad44cb/src/Sanitizer.php#L241-L260 |
235,429 | gielfeldt/shutdownhandler | src/ShutdownHandler.php | ShutdownHandler.run | public function run()
{
if ($this->unRegister() && empty(static::$keys[$this->getKey()])) {
call_user_func_array($this->callback, $this->arguments);
}
} | php | public function run()
{
if ($this->unRegister() && empty(static::$keys[$this->getKey()])) {
call_user_func_array($this->callback, $this->arguments);
}
} | [
"public",
"function",
"run",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"unRegister",
"(",
")",
"&&",
"empty",
"(",
"static",
"::",
"$",
"keys",
"[",
"$",
"this",
"->",
"getKey",
"(",
")",
"]",
")",
")",
"{",
"call_user_func_array",
"(",
"$",
"... | Run the shutdown handler. | [
"Run",
"the",
"shutdown",
"handler",
"."
] | a31bf9a93ce1fe77110a5374ac07cce77dda7bda | https://github.com/gielfeldt/shutdownhandler/blob/a31bf9a93ce1fe77110a5374ac07cce77dda7bda/src/ShutdownHandler.php#L99-L104 |
235,430 | gielfeldt/shutdownhandler | src/ShutdownHandler.php | ShutdownHandler.unRegister | public function unRegister()
{
if (isset(static::$handlers[$this->handlerId])) {
if (!is_null($this->getKey())) {
static::$keys[$this->getKey()]--;
}
unset(static::$handlers[$this->handlerId]);
return true;
}
return false;
} | php | public function unRegister()
{
if (isset(static::$handlers[$this->handlerId])) {
if (!is_null($this->getKey())) {
static::$keys[$this->getKey()]--;
}
unset(static::$handlers[$this->handlerId]);
return true;
}
return false;
} | [
"public",
"function",
"unRegister",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"static",
"::",
"$",
"handlers",
"[",
"$",
"this",
"->",
"handlerId",
"]",
")",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
"->",
"getKey",
"(",
")",
")",
")",... | Unregister handler.
@return boolean
true if handler was unregistered (i.e. not already unregistered). | [
"Unregister",
"handler",
"."
] | a31bf9a93ce1fe77110a5374ac07cce77dda7bda | https://github.com/gielfeldt/shutdownhandler/blob/a31bf9a93ce1fe77110a5374ac07cce77dda7bda/src/ShutdownHandler.php#L144-L154 |
235,431 | gielfeldt/shutdownhandler | src/ShutdownHandler.php | ShutdownHandler.reRegister | public function reRegister($key = null)
{
// Set the key, and register the handler.
$this->setKey($key);
static::$handlers[$this->handlerId] = $this;
} | php | public function reRegister($key = null)
{
// Set the key, and register the handler.
$this->setKey($key);
static::$handlers[$this->handlerId] = $this;
} | [
"public",
"function",
"reRegister",
"(",
"$",
"key",
"=",
"null",
")",
"{",
"// Set the key, and register the handler.",
"$",
"this",
"->",
"setKey",
"(",
"$",
"key",
")",
";",
"static",
"::",
"$",
"handlers",
"[",
"$",
"this",
"->",
"handlerId",
"]",
"=",... | Reregister handler.
@param string $key
(Optional) The key of the handler. | [
"Reregister",
"handler",
"."
] | a31bf9a93ce1fe77110a5374ac07cce77dda7bda | https://github.com/gielfeldt/shutdownhandler/blob/a31bf9a93ce1fe77110a5374ac07cce77dda7bda/src/ShutdownHandler.php#L183-L188 |
235,432 | gielfeldt/shutdownhandler | src/ShutdownHandler.php | ShutdownHandler.setKey | protected function setKey($key)
{
// If a handler switches key, we need to decrement the counter for the old
// key, and increment the counter for the new key.
$this->removeKey();
// Set the new key, and increment the counter appropriately.
$this->key = $key;
if (iss... | php | protected function setKey($key)
{
// If a handler switches key, we need to decrement the counter for the old
// key, and increment the counter for the new key.
$this->removeKey();
// Set the new key, and increment the counter appropriately.
$this->key = $key;
if (iss... | [
"protected",
"function",
"setKey",
"(",
"$",
"key",
")",
"{",
"// If a handler switches key, we need to decrement the counter for the old",
"// key, and increment the counter for the new key.",
"$",
"this",
"->",
"removeKey",
"(",
")",
";",
"// Set the new key, and increment the co... | Set key for final nested destructor.
@param string $key
Name of key. | [
"Set",
"key",
"for",
"final",
"nested",
"destructor",
"."
] | a31bf9a93ce1fe77110a5374ac07cce77dda7bda | https://github.com/gielfeldt/shutdownhandler/blob/a31bf9a93ce1fe77110a5374ac07cce77dda7bda/src/ShutdownHandler.php#L222-L233 |
235,433 | teeebor/decoy-framework | base/ErrorController.php | ErrorController._Bootstrap | public function _Bootstrap()
{
$this->forward()->setResponse(new HtmlResponse());
$this->forward()->getCurrentRoute()->setDefault(new Route(array('action'=>'_error')));
} | php | public function _Bootstrap()
{
$this->forward()->setResponse(new HtmlResponse());
$this->forward()->getCurrentRoute()->setDefault(new Route(array('action'=>'_error')));
} | [
"public",
"function",
"_Bootstrap",
"(",
")",
"{",
"$",
"this",
"->",
"forward",
"(",
")",
"->",
"setResponse",
"(",
"new",
"HtmlResponse",
"(",
")",
")",
";",
"$",
"this",
"->",
"forward",
"(",
")",
"->",
"getCurrentRoute",
"(",
")",
"->",
"setDefault... | Bootstrapping the class | [
"Bootstrapping",
"the",
"class"
] | 3881ae63a7d13088efda5afd3932c1af1fc18b23 | https://github.com/teeebor/decoy-framework/blob/3881ae63a7d13088efda5afd3932c1af1fc18b23/base/ErrorController.php#L27-L31 |
235,434 | teeebor/decoy-framework | base/ErrorController.php | ErrorController._error | public function _error(){
$model = new ViewModel('application/error');
$model->addVariable('error_type','error');
$model->addVariable('error',ErrorController::$errors);
return $model;
} | php | public function _error(){
$model = new ViewModel('application/error');
$model->addVariable('error_type','error');
$model->addVariable('error',ErrorController::$errors);
return $model;
} | [
"public",
"function",
"_error",
"(",
")",
"{",
"$",
"model",
"=",
"new",
"ViewModel",
"(",
"'application/error'",
")",
";",
"$",
"model",
"->",
"addVariable",
"(",
"'error_type'",
",",
"'error'",
")",
";",
"$",
"model",
"->",
"addVariable",
"(",
"'error'",... | If there was an error, this method will display it | [
"If",
"there",
"was",
"an",
"error",
"this",
"method",
"will",
"display",
"it"
] | 3881ae63a7d13088efda5afd3932c1af1fc18b23 | https://github.com/teeebor/decoy-framework/blob/3881ae63a7d13088efda5afd3932c1af1fc18b23/base/ErrorController.php#L35-L40 |
235,435 | Opifer/ContentBundle | Controller/Api/ContentController.php | ContentController.idsAction | public function idsAction($ids)
{
$items = $this->get('opifer.content.content_manager')
->getRepository()
->findByIds($ids);
$contents = $this->get('jms_serializer')->serialize($items, 'json', SerializationContext::create()->setGroups(['list'])->enableMaxDepthChecks());
... | php | public function idsAction($ids)
{
$items = $this->get('opifer.content.content_manager')
->getRepository()
->findByIds($ids);
$contents = $this->get('jms_serializer')->serialize($items, 'json', SerializationContext::create()->setGroups(['list'])->enableMaxDepthChecks());
... | [
"public",
"function",
"idsAction",
"(",
"$",
"ids",
")",
"{",
"$",
"items",
"=",
"$",
"this",
"->",
"get",
"(",
"'opifer.content.content_manager'",
")",
"->",
"getRepository",
"(",
")",
"->",
"findByIds",
"(",
"$",
"ids",
")",
";",
"$",
"contents",
"=",
... | Get a content items by a list of ids
@param string $ids
@return JsonResponse | [
"Get",
"a",
"content",
"items",
"by",
"a",
"list",
"of",
"ids"
] | df44ef36b81a839ce87ea9a92f7728618111541f | https://github.com/Opifer/ContentBundle/blob/df44ef36b81a839ce87ea9a92f7728618111541f/Controller/Api/ContentController.php#L45-L59 |
235,436 | Kylob/Sitemap | src/Component.php | Component.add | public static function add($category, $content, array $save = array())
{
$page = Page::html();
if ($page->url['format'] != 'html') {
return;
}
$page->filter('response', function ($page, $response) use ($category, $content, $save) {
if (empty($page->url['query'... | php | public static function add($category, $content, array $save = array())
{
$page = Page::html();
if ($page->url['format'] != 'html') {
return;
}
$page->filter('response', function ($page, $response) use ($category, $content, $save) {
if (empty($page->url['query'... | [
"public",
"static",
"function",
"add",
"(",
"$",
"category",
",",
"$",
"content",
",",
"array",
"$",
"save",
"=",
"array",
"(",
")",
")",
"{",
"$",
"page",
"=",
"Page",
"::",
"html",
"(",
")",
";",
"if",
"(",
"$",
"page",
"->",
"url",
"[",
"'fo... | Include the current page in the sitemap if it is an HTML page, and has no query string. Made static to save you the hassle of opening and closing the database.
Use this method when you want to "set it, and forget it". When adding (and updating) **$content** dynamically, then some of your links may be a bit outdated ... | [
"Include",
"the",
"current",
"page",
"in",
"the",
"sitemap",
"if",
"it",
"is",
"an",
"HTML",
"page",
"and",
"has",
"no",
"query",
"string",
".",
"Made",
"static",
"to",
"save",
"you",
"the",
"hassle",
"of",
"opening",
"and",
"closing",
"the",
"database",... | 19b31b6e8cc44497ac1101a00a32ec9711b86d43 | https://github.com/Kylob/Sitemap/blob/19b31b6e8cc44497ac1101a00a32ec9711b86d43/src/Component.php#L233-L253 |
235,437 | Kylob/Sitemap | src/Component.php | Component.where | private function where($category, $and = '')
{
if (!empty($category)) {
$sql = array();
foreach ((array) $category as $like) {
$sql[] = "c.category LIKE '{$like}%'";
}
$category = 'AND '.implode(' OR ', $sql);
}
return trim('IN... | php | private function where($category, $and = '')
{
if (!empty($category)) {
$sql = array();
foreach ((array) $category as $like) {
$sql[] = "c.category LIKE '{$like}%'";
}
$category = 'AND '.implode(' OR ', $sql);
}
return trim('IN... | [
"private",
"function",
"where",
"(",
"$",
"category",
",",
"$",
"and",
"=",
"''",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"category",
")",
")",
"{",
"$",
"sql",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"(",
"array",
")",
"$",
"category... | Adds the category and additional parameters to a query string.
@param string $category
@param string $and
@return string | [
"Adds",
"the",
"category",
"and",
"additional",
"parameters",
"to",
"a",
"query",
"string",
"."
] | 19b31b6e8cc44497ac1101a00a32ec9711b86d43 | https://github.com/Kylob/Sitemap/blob/19b31b6e8cc44497ac1101a00a32ec9711b86d43/src/Component.php#L461-L472 |
235,438 | Kylob/Sitemap | src/Component.php | Component.id | private function id($category)
{
if (is_null($this->ids)) {
$this->ids = array();
$categories = $this->db->all('SELECT category, id FROM categories', '', 'assoc');
foreach ($categories as $row) {
$this->ids[$row['category']] = $row['id'];
}
... | php | private function id($category)
{
if (is_null($this->ids)) {
$this->ids = array();
$categories = $this->db->all('SELECT category, id FROM categories', '', 'assoc');
foreach ($categories as $row) {
$this->ids[$row['category']] = $row['id'];
}
... | [
"private",
"function",
"id",
"(",
"$",
"category",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"ids",
")",
")",
"{",
"$",
"this",
"->",
"ids",
"=",
"array",
"(",
")",
";",
"$",
"categories",
"=",
"$",
"this",
"->",
"db",
"->",
"all"... | Converts a category string into it's id.
@param string $category
@return int | [
"Converts",
"a",
"category",
"string",
"into",
"it",
"s",
"id",
"."
] | 19b31b6e8cc44497ac1101a00a32ec9711b86d43 | https://github.com/Kylob/Sitemap/blob/19b31b6e8cc44497ac1101a00a32ec9711b86d43/src/Component.php#L481-L503 |
235,439 | subcosm-probe/primitives | src/Traits/Uri/MarshalTrait.php | MarshalTrait.marshalScheme | protected function marshalScheme($scheme): ? string
{
if ( null === $scheme ) {
return null;
}
if ( ! is_string($scheme) ) {
throw new UriException(
'Scheme must be a string'
);
}
return strtolower($scheme);
} | php | protected function marshalScheme($scheme): ? string
{
if ( null === $scheme ) {
return null;
}
if ( ! is_string($scheme) ) {
throw new UriException(
'Scheme must be a string'
);
}
return strtolower($scheme);
} | [
"protected",
"function",
"marshalScheme",
"(",
"$",
"scheme",
")",
":",
"?",
"string",
"{",
"if",
"(",
"null",
"===",
"$",
"scheme",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"!",
"is_string",
"(",
"$",
"scheme",
")",
")",
"{",
"throw",
"new... | marshals the scheme.
@param $scheme
@return null|string
@throws UriException | [
"marshals",
"the",
"scheme",
"."
] | 3b21293e88e9c08185237ff9ac707e4be6031776 | https://github.com/subcosm-probe/primitives/blob/3b21293e88e9c08185237ff9ac707e4be6031776/src/Traits/Uri/MarshalTrait.php#L28-L41 |
235,440 | subcosm-probe/primitives | src/Traits/Uri/MarshalTrait.php | MarshalTrait.marshalPort | protected function marshalPort($port): ? int
{
if ( null === $port ) {
return null;
}
$port = (int) $port;
if ( 0 > $port || 65535 < $port ) {
throw new UriException(
sprintf('Invalid port: %s, value must be between 0 and 65535', $port)
... | php | protected function marshalPort($port): ? int
{
if ( null === $port ) {
return null;
}
$port = (int) $port;
if ( 0 > $port || 65535 < $port ) {
throw new UriException(
sprintf('Invalid port: %s, value must be between 0 and 65535', $port)
... | [
"protected",
"function",
"marshalPort",
"(",
"$",
"port",
")",
":",
"?",
"int",
"{",
"if",
"(",
"null",
"===",
"$",
"port",
")",
"{",
"return",
"null",
";",
"}",
"$",
"port",
"=",
"(",
"int",
")",
"$",
"port",
";",
"if",
"(",
"0",
">",
"$",
"... | marshals the port.
@param $port
@return int|null
@throws UriException | [
"marshals",
"the",
"port",
"."
] | 3b21293e88e9c08185237ff9ac707e4be6031776 | https://github.com/subcosm-probe/primitives/blob/3b21293e88e9c08185237ff9ac707e4be6031776/src/Traits/Uri/MarshalTrait.php#L68-L83 |
235,441 | subcosm-probe/primitives | src/Traits/Uri/MarshalTrait.php | MarshalTrait.marshalPath | protected function marshalPath($path): string
{
if ( null === $path ) {
$path = '/';
}
if ( ! is_string($path) ) {
throw new UriException(
'Path must be a string or null'
);
}
return preg_replace_callback(
'/(?... | php | protected function marshalPath($path): string
{
if ( null === $path ) {
$path = '/';
}
if ( ! is_string($path) ) {
throw new UriException(
'Path must be a string or null'
);
}
return preg_replace_callback(
'/(?... | [
"protected",
"function",
"marshalPath",
"(",
"$",
"path",
")",
":",
"string",
"{",
"if",
"(",
"null",
"===",
"$",
"path",
")",
"{",
"$",
"path",
"=",
"'/'",
";",
"}",
"if",
"(",
"!",
"is_string",
"(",
"$",
"path",
")",
")",
"{",
"throw",
"new",
... | marshals the path.
@param $path
@return string
@throws UriException | [
"marshals",
"the",
"path",
"."
] | 3b21293e88e9c08185237ff9ac707e4be6031776 | https://github.com/subcosm-probe/primitives/blob/3b21293e88e9c08185237ff9ac707e4be6031776/src/Traits/Uri/MarshalTrait.php#L92-L111 |
235,442 | subcosm-probe/primitives | src/Traits/Uri/MarshalTrait.php | MarshalTrait.marshalQueryAndFragment | protected function marshalQueryAndFragment($string): string
{
if ( ! is_string($string) ) {
throw new UriException(
'Query and Fragment must be a string or null'
);
}
return preg_replace_callback(
'/(?:[^'.self::$unreservedCharacters.self:... | php | protected function marshalQueryAndFragment($string): string
{
if ( ! is_string($string) ) {
throw new UriException(
'Query and Fragment must be a string or null'
);
}
return preg_replace_callback(
'/(?:[^'.self::$unreservedCharacters.self:... | [
"protected",
"function",
"marshalQueryAndFragment",
"(",
"$",
"string",
")",
":",
"string",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"string",
")",
")",
"{",
"throw",
"new",
"UriException",
"(",
"'Query and Fragment must be a string or null'",
")",
";",
"}",
... | marshals the query and fragment.
@param $string
@return string
@throws UriException | [
"marshals",
"the",
"query",
"and",
"fragment",
"."
] | 3b21293e88e9c08185237ff9ac707e4be6031776 | https://github.com/subcosm-probe/primitives/blob/3b21293e88e9c08185237ff9ac707e4be6031776/src/Traits/Uri/MarshalTrait.php#L120-L135 |
235,443 | gorriecoe/silverstripe-dbstringextras | src/DBStringExtras.php | DBStringExtras.StrReplace | public function StrReplace($search = ' ', $replace = '')
{
$owner = $this->owner;
$owner->value = str_replace(
$search,
$replace,
$owner->value
);
return $owner;
} | php | public function StrReplace($search = ' ', $replace = '')
{
$owner = $this->owner;
$owner->value = str_replace(
$search,
$replace,
$owner->value
);
return $owner;
} | [
"public",
"function",
"StrReplace",
"(",
"$",
"search",
"=",
"' '",
",",
"$",
"replace",
"=",
"''",
")",
"{",
"$",
"owner",
"=",
"$",
"this",
"->",
"owner",
";",
"$",
"owner",
"->",
"value",
"=",
"str_replace",
"(",
"$",
"search",
",",
"$",
"replac... | Replace all occurrences of the search string with the replacement string.
@return string | [
"Replace",
"all",
"occurrences",
"of",
"the",
"search",
"string",
"with",
"the",
"replacement",
"string",
"."
] | e1a68adc6af95e8b887c1624c9144e10dc87b40c | https://github.com/gorriecoe/silverstripe-dbstringextras/blob/e1a68adc6af95e8b887c1624c9144e10dc87b40c/src/DBStringExtras.php#L31-L40 |
235,444 | gorriecoe/silverstripe-dbstringextras | src/DBStringExtras.php | DBStringExtras.Nice | public function Nice()
{
$owner = $this->owner;
$value = preg_replace('/([a-z)([A-Z0-9]])/', '$1 $2', $owner->value);
$value = preg_replace('/([a-zA-Z])-([a-zA-Z0-9])/', '$1 $2', $value);
$value = str_replace('_', ' ', $value);
$owner->value = trim($value);
return $ow... | php | public function Nice()
{
$owner = $this->owner;
$value = preg_replace('/([a-z)([A-Z0-9]])/', '$1 $2', $owner->value);
$value = preg_replace('/([a-zA-Z])-([a-zA-Z0-9])/', '$1 $2', $value);
$value = str_replace('_', ' ', $value);
$owner->value = trim($value);
return $ow... | [
"public",
"function",
"Nice",
"(",
")",
"{",
"$",
"owner",
"=",
"$",
"this",
"->",
"owner",
";",
"$",
"value",
"=",
"preg_replace",
"(",
"'/([a-z)([A-Z0-9]])/'",
",",
"'$1 $2'",
",",
"$",
"owner",
"->",
"value",
")",
";",
"$",
"value",
"=",
"preg_repla... | Converts this camel case and hyphenated string to a space separated string.
@return string | [
"Converts",
"this",
"camel",
"case",
"and",
"hyphenated",
"string",
"to",
"a",
"space",
"separated",
"string",
"."
] | e1a68adc6af95e8b887c1624c9144e10dc87b40c | https://github.com/gorriecoe/silverstripe-dbstringextras/blob/e1a68adc6af95e8b887c1624c9144e10dc87b40c/src/DBStringExtras.php#L46-L54 |
235,445 | gorriecoe/silverstripe-dbstringextras | src/DBStringExtras.php | DBStringExtras.Hyphenate | public function Hyphenate()
{
$value = preg_replace('/([A-Z])/', '-$1', $this->owner->value);
$value = trim($value);
return Convert::raw2url($value);
} | php | public function Hyphenate()
{
$value = preg_replace('/([A-Z])/', '-$1', $this->owner->value);
$value = trim($value);
return Convert::raw2url($value);
} | [
"public",
"function",
"Hyphenate",
"(",
")",
"{",
"$",
"value",
"=",
"preg_replace",
"(",
"'/([A-Z])/'",
",",
"'-$1'",
",",
"$",
"this",
"->",
"owner",
"->",
"value",
")",
";",
"$",
"value",
"=",
"trim",
"(",
"$",
"value",
")",
";",
"return",
"Conver... | Converts this camel case string to a hyphenated, kebab or spinal case string. | [
"Converts",
"this",
"camel",
"case",
"string",
"to",
"a",
"hyphenated",
"kebab",
"or",
"spinal",
"case",
"string",
"."
] | e1a68adc6af95e8b887c1624c9144e10dc87b40c | https://github.com/gorriecoe/silverstripe-dbstringextras/blob/e1a68adc6af95e8b887c1624c9144e10dc87b40c/src/DBStringExtras.php#L59-L64 |
235,446 | gorriecoe/silverstripe-dbstringextras | src/DBStringExtras.php | DBStringExtras.RemoveSpaces | public function RemoveSpaces()
{
$owner = $this->owner;
$owner->value = str_replace(
[' ', ' '],
'',
$owner->value
);
return $owner;
} | php | public function RemoveSpaces()
{
$owner = $this->owner;
$owner->value = str_replace(
[' ', ' '],
'',
$owner->value
);
return $owner;
} | [
"public",
"function",
"RemoveSpaces",
"(",
")",
"{",
"$",
"owner",
"=",
"$",
"this",
"->",
"owner",
";",
"$",
"owner",
"->",
"value",
"=",
"str_replace",
"(",
"[",
"' '",
",",
"' '",
"]",
",",
"''",
",",
"$",
"owner",
"->",
"value",
")",
";",
... | Removes spaces from this string.
@return string | [
"Removes",
"spaces",
"from",
"this",
"string",
"."
] | e1a68adc6af95e8b887c1624c9144e10dc87b40c | https://github.com/gorriecoe/silverstripe-dbstringextras/blob/e1a68adc6af95e8b887c1624c9144e10dc87b40c/src/DBStringExtras.php#L70-L79 |
235,447 | razielsd/webdriverlib | WebDriver/WebDriver/Object/Timeout.php | WebDriver_Object_Timeout.implicitWait | public function implicitWait($timeout)
{
$timeoutNormalize = intval(ceil($timeout / 100));
if ($this->cache[self::WAIT_IMPLICIT] === $timeoutNormalize) {
return null;
}
$this->cache[self::WAIT_IMPLICIT] = $timeout;
$param = ['ms' => intval($timeout)];
$com... | php | public function implicitWait($timeout)
{
$timeoutNormalize = intval(ceil($timeout / 100));
if ($this->cache[self::WAIT_IMPLICIT] === $timeoutNormalize) {
return null;
}
$this->cache[self::WAIT_IMPLICIT] = $timeout;
$param = ['ms' => intval($timeout)];
$com... | [
"public",
"function",
"implicitWait",
"(",
"$",
"timeout",
")",
"{",
"$",
"timeoutNormalize",
"=",
"intval",
"(",
"ceil",
"(",
"$",
"timeout",
"/",
"100",
")",
")",
";",
"if",
"(",
"$",
"this",
"->",
"cache",
"[",
"self",
"::",
"WAIT_IMPLICIT",
"]",
... | Set the amount of time the driver should wait when searching for elements.
@param $timeout - The amount of time to wait, in milliseconds. This value has a lower bound of 0.
@return mixed | [
"Set",
"the",
"amount",
"of",
"time",
"the",
"driver",
"should",
"wait",
"when",
"searching",
"for",
"elements",
"."
] | e498afc36a8cdeab5b6ca95016420557baf32f36 | https://github.com/razielsd/webdriverlib/blob/e498afc36a8cdeab5b6ca95016420557baf32f36/WebDriver/WebDriver/Object/Timeout.php#L42-L52 |
235,448 | dlabas/DlcUseCase | src/DlcUseCase/Service/UseCase.php | UseCase.createUseCaseDiagramm | public function createUseCaseDiagramm()
{
$nodes = $this->findAll();
$diagrammService = $this->getDiagrammService();
return $diagrammService->createDiagrammFromNodes($nodes, UseCaseDiagramm::TYPE_USE_CASE);
} | php | public function createUseCaseDiagramm()
{
$nodes = $this->findAll();
$diagrammService = $this->getDiagrammService();
return $diagrammService->createDiagrammFromNodes($nodes, UseCaseDiagramm::TYPE_USE_CASE);
} | [
"public",
"function",
"createUseCaseDiagramm",
"(",
")",
"{",
"$",
"nodes",
"=",
"$",
"this",
"->",
"findAll",
"(",
")",
";",
"$",
"diagrammService",
"=",
"$",
"this",
"->",
"getDiagrammService",
"(",
")",
";",
"return",
"$",
"diagrammService",
"->",
"crea... | Creates an use case diagramm from all entities
@return UseCaseDiagramm | [
"Creates",
"an",
"use",
"case",
"diagramm",
"from",
"all",
"entities"
] | 6a15aa7628594c343c334dabf0253ce2ae5d7f0b | https://github.com/dlabas/DlcUseCase/blob/6a15aa7628594c343c334dabf0253ce2ae5d7f0b/src/DlcUseCase/Service/UseCase.php#L93-L100 |
235,449 | dlabas/DlcUseCase | src/DlcUseCase/Service/UseCase.php | UseCase.createUseCaseDiagrammFor | public function createUseCaseDiagrammFor($entity)
{
if (is_int($entity)) {
$entity = $this->getById($entity);
} elseif (!$entity instanceof UseCaseEntity) {
throw new \InvalidArgumentException('Unkown entity data type "' . gettype($entity) . '"');
}
$diagramm... | php | public function createUseCaseDiagrammFor($entity)
{
if (is_int($entity)) {
$entity = $this->getById($entity);
} elseif (!$entity instanceof UseCaseEntity) {
throw new \InvalidArgumentException('Unkown entity data type "' . gettype($entity) . '"');
}
$diagramm... | [
"public",
"function",
"createUseCaseDiagrammFor",
"(",
"$",
"entity",
")",
"{",
"if",
"(",
"is_int",
"(",
"$",
"entity",
")",
")",
"{",
"$",
"entity",
"=",
"$",
"this",
"->",
"getById",
"(",
"$",
"entity",
")",
";",
"}",
"elseif",
"(",
"!",
"$",
"e... | Creates an use case diagramm from an single entity
@param int|\DlcUseCase\Entity\UseCase $entity
@return UseCaseDiagramm | [
"Creates",
"an",
"use",
"case",
"diagramm",
"from",
"an",
"single",
"entity"
] | 6a15aa7628594c343c334dabf0253ce2ae5d7f0b | https://github.com/dlabas/DlcUseCase/blob/6a15aa7628594c343c334dabf0253ce2ae5d7f0b/src/DlcUseCase/Service/UseCase.php#L108-L119 |
235,450 | jayaregalinada/chikka | src/Sender.php | Sender.sendAsync | public function sendAsync($mobileNumber, $message, $messageId = null)
{
$this->requestForm = new SenderForm($mobileNumber, $message, $messageId);
return $this->client->requestAsync('POST', '', ['form_params' => $this->requestForm->get()]);
} | php | public function sendAsync($mobileNumber, $message, $messageId = null)
{
$this->requestForm = new SenderForm($mobileNumber, $message, $messageId);
return $this->client->requestAsync('POST', '', ['form_params' => $this->requestForm->get()]);
} | [
"public",
"function",
"sendAsync",
"(",
"$",
"mobileNumber",
",",
"$",
"message",
",",
"$",
"messageId",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"requestForm",
"=",
"new",
"SenderForm",
"(",
"$",
"mobileNumber",
",",
"$",
"message",
",",
"$",
"messageI... | Send a message and return a promise.
@param string $mobileNumber
@param string $message
@param string $messageId
@return \GuzzleHttp\Promise\Promise | [
"Send",
"a",
"message",
"and",
"return",
"a",
"promise",
"."
] | eefd52c6a7c0e22fe82cef00c52874865456dddf | https://github.com/jayaregalinada/chikka/blob/eefd52c6a7c0e22fe82cef00c52874865456dddf/src/Sender.php#L61-L66 |
235,451 | jayaregalinada/chikka | src/Sender.php | Sender.send | public function send($mobileNumber, $message, $messageId = null)
{
return $this->sendAsync($mobileNumber, $message, $messageId)
->then(
function (ResponseInterface $response) {
return new SentResponse($response, $this->requestForm);
},
function ($e... | php | public function send($mobileNumber, $message, $messageId = null)
{
return $this->sendAsync($mobileNumber, $message, $messageId)
->then(
function (ResponseInterface $response) {
return new SentResponse($response, $this->requestForm);
},
function ($e... | [
"public",
"function",
"send",
"(",
"$",
"mobileNumber",
",",
"$",
"message",
",",
"$",
"messageId",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"sendAsync",
"(",
"$",
"mobileNumber",
",",
"$",
"message",
",",
"$",
"messageId",
")",
"->",
"then"... | Send a message immediately.
@param string $mobileNumber
@param string $message
@param string $messageId
@throws inherits \Jag\Chikka\Exceptions\Exception
@return \Jag\Chikka\Responses\SentResponse | [
"Send",
"a",
"message",
"immediately",
"."
] | eefd52c6a7c0e22fe82cef00c52874865456dddf | https://github.com/jayaregalinada/chikka/blob/eefd52c6a7c0e22fe82cef00c52874865456dddf/src/Sender.php#L79-L90 |
235,452 | vutran/wpmvc-core | src/Models/Post.php | Post.queryPosts | public static function queryPosts($args)
{
$query = new WP_Query($args);
// Set default return to false
$posts = false;
// Iterate and build the array of instances instances
if ($query->have_posts()) {
global $post;
// Create the array
$pos... | php | public static function queryPosts($args)
{
$query = new WP_Query($args);
// Set default return to false
$posts = false;
// Iterate and build the array of instances instances
if ($query->have_posts()) {
global $post;
// Create the array
$pos... | [
"public",
"static",
"function",
"queryPosts",
"(",
"$",
"args",
")",
"{",
"$",
"query",
"=",
"new",
"WP_Query",
"(",
"$",
"args",
")",
";",
"// Set default return to false",
"$",
"posts",
"=",
"false",
";",
"// Iterate and build the array of instances instances",
... | Query for posts and returns an array of the model
@access public
@static
@return array|bool | [
"Query",
"for",
"posts",
"and",
"returns",
"an",
"array",
"of",
"the",
"model"
] | 4081be36116ae8e79abfd182d783d28d0fb42219 | https://github.com/vutran/wpmvc-core/blob/4081be36116ae8e79abfd182d783d28d0fb42219/src/Models/Post.php#L70-L87 |
235,453 | vutran/wpmvc-core | src/Models/Post.php | Post.create | public static function create($post)
{
// If numeric, create the post
if (is_numeric($post)) {
// Retrieve the transient
$transientKey = sprintf('WPMVC\Models\Post(%d)', $post);
$storedData = WP::getTransient($transientKey);
// If the transient doesn't... | php | public static function create($post)
{
// If numeric, create the post
if (is_numeric($post)) {
// Retrieve the transient
$transientKey = sprintf('WPMVC\Models\Post(%d)', $post);
$storedData = WP::getTransient($transientKey);
// If the transient doesn't... | [
"public",
"static",
"function",
"create",
"(",
"$",
"post",
")",
"{",
"// If numeric, create the post",
"if",
"(",
"is_numeric",
"(",
"$",
"post",
")",
")",
"{",
"// Retrieve the transient",
"$",
"transientKey",
"=",
"sprintf",
"(",
"'WPMVC\\Models\\Post(%d)'",
",... | Creates a new instance by the post ID
@access public
@param array|int|WP_Post $postId
@return static | [
"Creates",
"a",
"new",
"instance",
"by",
"the",
"post",
"ID"
] | 4081be36116ae8e79abfd182d783d28d0fb42219 | https://github.com/vutran/wpmvc-core/blob/4081be36116ae8e79abfd182d783d28d0fb42219/src/Models/Post.php#L109-L130 |
235,454 | vutran/wpmvc-core | src/Models/Post.php | Post.loadMetaData | protected function loadMetaData()
{
// Retrieve the transient
$transientKey = sprintf('WPMVC\Models\Post(%d)::loadMetaData', $this->id());
$metaData = WP::getTransient($transientKey);
// If it doesn't exist
if (!$metaData) {
$keys = WP::getPostCustom($this->id());... | php | protected function loadMetaData()
{
// Retrieve the transient
$transientKey = sprintf('WPMVC\Models\Post(%d)::loadMetaData', $this->id());
$metaData = WP::getTransient($transientKey);
// If it doesn't exist
if (!$metaData) {
$keys = WP::getPostCustom($this->id());... | [
"protected",
"function",
"loadMetaData",
"(",
")",
"{",
"// Retrieve the transient",
"$",
"transientKey",
"=",
"sprintf",
"(",
"'WPMVC\\Models\\Post(%d)::loadMetaData'",
",",
"$",
"this",
"->",
"id",
"(",
")",
")",
";",
"$",
"metaData",
"=",
"WP",
"::",
"getTran... | Loads the post's meta data
@access protected
@return void | [
"Loads",
"the",
"post",
"s",
"meta",
"data"
] | 4081be36116ae8e79abfd182d783d28d0fb42219 | https://github.com/vutran/wpmvc-core/blob/4081be36116ae8e79abfd182d783d28d0fb42219/src/Models/Post.php#L157-L179 |
235,455 | vutran/wpmvc-core | src/Models/Post.php | Post.hasMeta | public function hasMeta($option)
{
return (isset($this->metaData[$option])) ? $this->metaData[$option] : false;
} | php | public function hasMeta($option)
{
return (isset($this->metaData[$option])) ? $this->metaData[$option] : false;
} | [
"public",
"function",
"hasMeta",
"(",
"$",
"option",
")",
"{",
"return",
"(",
"isset",
"(",
"$",
"this",
"->",
"metaData",
"[",
"$",
"option",
"]",
")",
")",
"?",
"$",
"this",
"->",
"metaData",
"[",
"$",
"option",
"]",
":",
"false",
";",
"}"
] | Checks if the post has a meta key
@access public
@return bool | [
"Checks",
"if",
"the",
"post",
"has",
"a",
"meta",
"key"
] | 4081be36116ae8e79abfd182d783d28d0fb42219 | https://github.com/vutran/wpmvc-core/blob/4081be36116ae8e79abfd182d783d28d0fb42219/src/Models/Post.php#L210-L213 |
235,456 | vutran/wpmvc-core | src/Models/Post.php | Post.content | public function content($moreLinkText = null, $stripTeaser = false)
{
global $post;
// Store current post into temp variable
$_p = $post;
$post = $this->post;
setup_postdata($post);
$content = get_the_content($moreLinkText, $stripTeaser);
// Apply filter
... | php | public function content($moreLinkText = null, $stripTeaser = false)
{
global $post;
// Store current post into temp variable
$_p = $post;
$post = $this->post;
setup_postdata($post);
$content = get_the_content($moreLinkText, $stripTeaser);
// Apply filter
... | [
"public",
"function",
"content",
"(",
"$",
"moreLinkText",
"=",
"null",
",",
"$",
"stripTeaser",
"=",
"false",
")",
"{",
"global",
"$",
"post",
";",
"// Store current post into temp variable",
"$",
"_p",
"=",
"$",
"post",
";",
"$",
"post",
"=",
"$",
"this"... | Retrieve the post's content
Note: Temporarily sets the global $post object to the event post and resets it
@access public
@link http://codex.wordpress.org/Function_Reference/get_the_title
@global WP_Post $post
@param string $moreLinkText (default: null)
@param string $stripTeaser boolean (default: false)
@return stri... | [
"Retrieve",
"the",
"post",
"s",
"content"
] | 4081be36116ae8e79abfd182d783d28d0fb42219 | https://github.com/vutran/wpmvc-core/blob/4081be36116ae8e79abfd182d783d28d0fb42219/src/Models/Post.php#L290-L307 |
235,457 | vutran/wpmvc-core | src/Models/Post.php | Post.excerpt | public function excerpt($wordCount = 20, $delimiter = '...')
{
global $post;
// Store current post into temp variable
$_p = $post;
$post = $this->post;
setup_postdata($post);
// Do the magic!
$limit = $wordCount + 1;
$full_excerpt = get_the_excerpt();
... | php | public function excerpt($wordCount = 20, $delimiter = '...')
{
global $post;
// Store current post into temp variable
$_p = $post;
$post = $this->post;
setup_postdata($post);
// Do the magic!
$limit = $wordCount + 1;
$full_excerpt = get_the_excerpt();
... | [
"public",
"function",
"excerpt",
"(",
"$",
"wordCount",
"=",
"20",
",",
"$",
"delimiter",
"=",
"'...'",
")",
"{",
"global",
"$",
"post",
";",
"// Store current post into temp variable",
"$",
"_p",
"=",
"$",
"post",
";",
"$",
"post",
"=",
"$",
"this",
"->... | Retrieve the post's excerpt
Note: Temporarily sets the global $post object to the event post and resets it
@access public
@link http://codex.wordpress.org/Function_Reference/get_the_excerpt
@global WP_Post $post
@param int $wordCount (default: 20)
@param string $delimiter (default: '...')
@return string | [
"Retrieve",
"the",
"post",
"s",
"excerpt"
] | 4081be36116ae8e79abfd182d783d28d0fb42219 | https://github.com/vutran/wpmvc-core/blob/4081be36116ae8e79abfd182d783d28d0fb42219/src/Models/Post.php#L321-L345 |
235,458 | vutran/wpmvc-core | src/Models/Post.php | Post.getTerms | public function getTerms($taxonomy)
{
// If terms isn't set
if (!$this->terms) {
// Retrieve the transient value
$transientKey = sprintf('WPMVC\Models\Post::getTerms(%s)', $this->id(), $taxonomy);
$terms = WP::getTransient($transientKey);
// If the ter... | php | public function getTerms($taxonomy)
{
// If terms isn't set
if (!$this->terms) {
// Retrieve the transient value
$transientKey = sprintf('WPMVC\Models\Post::getTerms(%s)', $this->id(), $taxonomy);
$terms = WP::getTransient($transientKey);
// If the ter... | [
"public",
"function",
"getTerms",
"(",
"$",
"taxonomy",
")",
"{",
"// If terms isn't set",
"if",
"(",
"!",
"$",
"this",
"->",
"terms",
")",
"{",
"// Retrieve the transient value",
"$",
"transientKey",
"=",
"sprintf",
"(",
"'WPMVC\\Models\\Post::getTerms(%s)'",
",",
... | Retrieves the taxonomy terms for the post
@access public
@return object | [
"Retrieves",
"the",
"taxonomy",
"terms",
"for",
"the",
"post"
] | 4081be36116ae8e79abfd182d783d28d0fb42219 | https://github.com/vutran/wpmvc-core/blob/4081be36116ae8e79abfd182d783d28d0fb42219/src/Models/Post.php#L387-L410 |
235,459 | vutran/wpmvc-core | src/Models/Post.php | Post.thumbnail | public function thumbnail($size = 'full')
{
$thumb = wp_get_attachment_image_src(get_post_thumbnail_id($this->id()), $size);
return isset($thumb[0]) ? $thumb[0] : '';
} | php | public function thumbnail($size = 'full')
{
$thumb = wp_get_attachment_image_src(get_post_thumbnail_id($this->id()), $size);
return isset($thumb[0]) ? $thumb[0] : '';
} | [
"public",
"function",
"thumbnail",
"(",
"$",
"size",
"=",
"'full'",
")",
"{",
"$",
"thumb",
"=",
"wp_get_attachment_image_src",
"(",
"get_post_thumbnail_id",
"(",
"$",
"this",
"->",
"id",
"(",
")",
")",
",",
"$",
"size",
")",
";",
"return",
"isset",
"(",... | Retrieve the post's thumbnail
@access public
@global object $post
@param string $size (default: "full")
@return string | [
"Retrieve",
"the",
"post",
"s",
"thumbnail"
] | 4081be36116ae8e79abfd182d783d28d0fb42219 | https://github.com/vutran/wpmvc-core/blob/4081be36116ae8e79abfd182d783d28d0fb42219/src/Models/Post.php#L453-L457 |
235,460 | vutran/wpmvc-core | src/Models/Post.php | Post.loadAdjacentPost | protected function loadAdjacentPost($direction = null)
{
$loadPrev = $loadNext = false;
switch ($direction) {
case 'prev':
$loadPrev = true;
break;
case 'next':
$loadNext = true;
break;
default:
... | php | protected function loadAdjacentPost($direction = null)
{
$loadPrev = $loadNext = false;
switch ($direction) {
case 'prev':
$loadPrev = true;
break;
case 'next':
$loadNext = true;
break;
default:
... | [
"protected",
"function",
"loadAdjacentPost",
"(",
"$",
"direction",
"=",
"null",
")",
"{",
"$",
"loadPrev",
"=",
"$",
"loadNext",
"=",
"false",
";",
"switch",
"(",
"$",
"direction",
")",
"{",
"case",
"'prev'",
":",
"$",
"loadPrev",
"=",
"true",
";",
"b... | Loads the adjacent posts
@access public
@param string $direction (default: null)
@return void | [
"Loads",
"the",
"adjacent",
"posts"
] | 4081be36116ae8e79abfd182d783d28d0fb42219 | https://github.com/vutran/wpmvc-core/blob/4081be36116ae8e79abfd182d783d28d0fb42219/src/Models/Post.php#L561-L581 |
235,461 | fabsgc/framework | Core/General/Resolver.php | Resolver.resolveStatic | protected static function resolveStatic($type, $data) {
$request = Request::instance();
$config = Config::instance();
if ($type == RESOLVE_ROUTE || $type == RESOLVE_LANG) {
if (preg_match('#^((\.)([a-zA-Z0-9_-]+)(\.)(.+))#', $data, $matches)) {
$src = $matches[3];
... | php | protected static function resolveStatic($type, $data) {
$request = Request::instance();
$config = Config::instance();
if ($type == RESOLVE_ROUTE || $type == RESOLVE_LANG) {
if (preg_match('#^((\.)([a-zA-Z0-9_-]+)(\.)(.+))#', $data, $matches)) {
$src = $matches[3];
... | [
"protected",
"static",
"function",
"resolveStatic",
"(",
"$",
"type",
",",
"$",
"data",
")",
"{",
"$",
"request",
"=",
"Request",
"::",
"instance",
"(",
")",
";",
"$",
"config",
"=",
"Config",
"::",
"instance",
"(",
")",
";",
"if",
"(",
"$",
"type",
... | when you want to use a lang, route, image, template, this method is used to resolve the right path
the method use the instance of \Gcs\Framework\Core\Config\Config
@access public
@param $type string : type of the config
@param $data string : ".gcs.lang" ".gcs/template/" "template"
@throws MissingConfigException
@return... | [
"when",
"you",
"want",
"to",
"use",
"a",
"lang",
"route",
"image",
"template",
"this",
"method",
"is",
"used",
"to",
"resolve",
"the",
"right",
"path",
"the",
"method",
"use",
"the",
"instance",
"of",
"\\",
"Gcs",
"\\",
"Framework",
"\\",
"Core",
"\\",
... | 45e58182aba6a3c6381970a1fd3c17662cff2168 | https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/General/Resolver.php#L68-L108 |
235,462 | phlexible/phlexible | src/Phlexible/Bundle/TeaserBundle/Controller/RenderController.php | RenderController.htmlAction | public function htmlAction(Request $request, $teaserId)
{
$requestStack = $this->get('request_stack');
$masterRequest = $requestStack->getMasterRequest();
if ($request->get('preview') || $request->get('_preview')) {
$request->attributes->set('_preview', true);
} elseif (... | php | public function htmlAction(Request $request, $teaserId)
{
$requestStack = $this->get('request_stack');
$masterRequest = $requestStack->getMasterRequest();
if ($request->get('preview') || $request->get('_preview')) {
$request->attributes->set('_preview', true);
} elseif (... | [
"public",
"function",
"htmlAction",
"(",
"Request",
"$",
"request",
",",
"$",
"teaserId",
")",
"{",
"$",
"requestStack",
"=",
"$",
"this",
"->",
"get",
"(",
"'request_stack'",
")",
";",
"$",
"masterRequest",
"=",
"$",
"requestStack",
"->",
"getMasterRequest"... | Render action.
@param Request $request
@param int $teaserId
@return Response
@Route("/{_locale}/{teaserId}", name="teaser_render") | [
"Render",
"action",
"."
] | 132f24924c9bb0dbb6c1ea84db0a463f97fa3893 | https://github.com/phlexible/phlexible/blob/132f24924c9bb0dbb6c1ea84db0a463f97fa3893/src/Phlexible/Bundle/TeaserBundle/Controller/RenderController.php#L36-L65 |
235,463 | yani-/zip-factory | lib/ArchiverPclZip.php | ArchiverPclZip.addFromString | public function addFromString($localname , $contents)
{
return $this->pclZip->add(
array(
array(
PCLZIP_ATT_FILE_NAME => $localname,
PCLZIP_ATT_FILE_CONTENT => $contents,
)
)
);
} | php | public function addFromString($localname , $contents)
{
return $this->pclZip->add(
array(
array(
PCLZIP_ATT_FILE_NAME => $localname,
PCLZIP_ATT_FILE_CONTENT => $contents,
)
)
);
} | [
"public",
"function",
"addFromString",
"(",
"$",
"localname",
",",
"$",
"contents",
")",
"{",
"return",
"$",
"this",
"->",
"pclZip",
"->",
"add",
"(",
"array",
"(",
"array",
"(",
"PCLZIP_ATT_FILE_NAME",
"=>",
"$",
"localname",
",",
"PCLZIP_ATT_FILE_CONTENT",
... | Add a file to a ZIP archive using its contents
@param string $localname The name of the entry to create.
@param string $contents The contents to use to create the entry. It is used in a binary safe mode.
@return boolean | [
"Add",
"a",
"file",
"to",
"a",
"ZIP",
"archive",
"using",
"its",
"contents"
] | bbf202f9c183d5885aa5cce905fc50782eea10b9 | https://github.com/yani-/zip-factory/blob/bbf202f9c183d5885aa5cce905fc50782eea10b9/lib/ArchiverPclZip.php#L128-L138 |
235,464 | tekton-php/support | src/Manifest/FileFormat.php | FileFormat.write | public function write(string $uri, $data)
{
// Create directory recursively if it doesn't exist
if ( ! file_exists(dirname($uri))) {
mkdir(dirname($uri), 0755, true);
}
// Write file to target directory
if ( ! file_put_contents($uri, $data)) {
throw n... | php | public function write(string $uri, $data)
{
// Create directory recursively if it doesn't exist
if ( ! file_exists(dirname($uri))) {
mkdir(dirname($uri), 0755, true);
}
// Write file to target directory
if ( ! file_put_contents($uri, $data)) {
throw n... | [
"public",
"function",
"write",
"(",
"string",
"$",
"uri",
",",
"$",
"data",
")",
"{",
"// Create directory recursively if it doesn't exist",
"if",
"(",
"!",
"file_exists",
"(",
"dirname",
"(",
"$",
"uri",
")",
")",
")",
"{",
"mkdir",
"(",
"dirname",
"(",
"... | Write the data to the storage engine
@param string $uri The URI handle
@param mixed $data The data in whatever format encode outputted
@return boolean Whether it was a successful write or not | [
"Write",
"the",
"data",
"to",
"the",
"storage",
"engine"
] | 615b9f19ab66ebc2aa49aaccff12b1fc3b9266b5 | https://github.com/tekton-php/support/blob/615b9f19ab66ebc2aa49aaccff12b1fc3b9266b5/src/Manifest/FileFormat.php#L34-L47 |
235,465 | easy-system/es-system | src/Components/Components.php | Components.register | public function register($class)
{
if ($this->initialized) {
throw new RuntimeException(
'The components have already been initialized.'
);
}
if (! class_exists($class)) {
throw new RuntimeException(sprintf(
'The component "... | php | public function register($class)
{
if ($this->initialized) {
throw new RuntimeException(
'The components have already been initialized.'
);
}
if (! class_exists($class)) {
throw new RuntimeException(sprintf(
'The component "... | [
"public",
"function",
"register",
"(",
"$",
"class",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"initialized",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"'The components have already been initialized.'",
")",
";",
"}",
"if",
"(",
"!",
"class_exists",
"("... | Register the component.
@param string $class The class of component
@throws \InvalidArgumentException If the specified class not implements
the Es\Component\ComponentInterface
@throws \RuntimeException
- If If the components have already been initialized
- If the specified class of component does not exists
@return... | [
"Register",
"the",
"component",
"."
] | 750632b7a57f8c65d98c61cd0c29d2da3a9a04cc | https://github.com/easy-system/es-system/blob/750632b7a57f8c65d98c61cd0c29d2da3a9a04cc/src/Components/Components.php#L51-L76 |
235,466 | easy-system/es-system | src/Components/Components.php | Components.init | public function init(
ServicesInterface $services,
ListenersInterface $listeners,
EventsInterface $events,
ConfigInterface $config
) {
if ($this->initialized) {
throw new RuntimeException(
'The components have already been initialized.'
... | php | public function init(
ServicesInterface $services,
ListenersInterface $listeners,
EventsInterface $events,
ConfigInterface $config
) {
if ($this->initialized) {
throw new RuntimeException(
'The components have already been initialized.'
... | [
"public",
"function",
"init",
"(",
"ServicesInterface",
"$",
"services",
",",
"ListenersInterface",
"$",
"listeners",
",",
"EventsInterface",
"$",
"events",
",",
"ConfigInterface",
"$",
"config",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"initialized",
")",
"{",... | Initializes components.
@param \Es\Services\ServicesInterface $services The services
@param \Es\Events\ListenersInterface $listeners The listeners
@param \Es\Events\EventsInterface $events The events
@param \Es\System\ConfigInterface $config The system configuration
@throws \RuntimeException If the co... | [
"Initializes",
"components",
"."
] | 750632b7a57f8c65d98c61cd0c29d2da3a9a04cc | https://github.com/easy-system/es-system/blob/750632b7a57f8c65d98c61cd0c29d2da3a9a04cc/src/Components/Components.php#L133-L162 |
235,467 | ironedgesoftware/file-utils | src/File/Factory.php | Factory.createInstance | public function createInstance($file, $type = null, array $options = array())
{
if (!is_file($file) && $type === null) {
throw new \InvalidArgumentException(
'You must enter a $type if the file does not exist yet.'
);
}
$type = pathinfo($file, PATHINF... | php | public function createInstance($file, $type = null, array $options = array())
{
if (!is_file($file) && $type === null) {
throw new \InvalidArgumentException(
'You must enter a $type if the file does not exist yet.'
);
}
$type = pathinfo($file, PATHINF... | [
"public",
"function",
"createInstance",
"(",
"$",
"file",
",",
"$",
"type",
"=",
"null",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"is_file",
"(",
"$",
"file",
")",
"&&",
"$",
"type",
"===",
"null",
")",
"{",... | Creates an instance of a file.
@param string $file - File.
@param null|string $type - Type.
@param array $options - Options.
@throws UnsupportedFileTypeException - If the file type cannot be handled.
@return \IronEdge\Component\FileUtils\File\Base | [
"Creates",
"an",
"instance",
"of",
"a",
"file",
"."
] | d9f79d6f23db0e5ccb147b4d1fdbccbb70bd5beb | https://github.com/ironedgesoftware/file-utils/blob/d9f79d6f23db0e5ccb147b4d1fdbccbb70bd5beb/src/File/Factory.php#L36-L60 |
235,468 | MarcusFulbright/represent | src/Represent/Factory/PaginationFactory.php | PaginationFactory.makePagerFromArray | protected function makePagerFromArray($data, $page = 1, $limit = 10)
{
$adapter = new ArrayAdapter($data);
$pager = new Pagerfanta($adapter);
$pager->setMaxPerPage($limit);
$pager->setCurrentPage($page);
return $pager;
} | php | protected function makePagerFromArray($data, $page = 1, $limit = 10)
{
$adapter = new ArrayAdapter($data);
$pager = new Pagerfanta($adapter);
$pager->setMaxPerPage($limit);
$pager->setCurrentPage($page);
return $pager;
} | [
"protected",
"function",
"makePagerFromArray",
"(",
"$",
"data",
",",
"$",
"page",
"=",
"1",
",",
"$",
"limit",
"=",
"10",
")",
"{",
"$",
"adapter",
"=",
"new",
"ArrayAdapter",
"(",
"$",
"data",
")",
";",
"$",
"pager",
"=",
"new",
"Pagerfanta",
"(",
... | Creates a pager from an array
@param $data
@param int $page
@param int $limit
@return Pagerfanta | [
"Creates",
"a",
"pager",
"from",
"an",
"array"
] | f7b624f473a3247a29f05c4a694d04bba4038e59 | https://github.com/MarcusFulbright/represent/blob/f7b624f473a3247a29f05c4a694d04bba4038e59/src/Represent/Factory/PaginationFactory.php#L35-L43 |
235,469 | MarcusFulbright/represent | src/Represent/Factory/PaginationFactory.php | PaginationFactory.paginate | public function paginate(array $data, $page, $limit , $url, $params = array())
{
$pager = $this->makePagerFromArray($data, $page, $limit);
return $this->factory->createCollectionFromPager($pager, $url, $params);
} | php | public function paginate(array $data, $page, $limit , $url, $params = array())
{
$pager = $this->makePagerFromArray($data, $page, $limit);
return $this->factory->createCollectionFromPager($pager, $url, $params);
} | [
"public",
"function",
"paginate",
"(",
"array",
"$",
"data",
",",
"$",
"page",
",",
"$",
"limit",
",",
"$",
"url",
",",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"$",
"pager",
"=",
"$",
"this",
"->",
"makePagerFromArray",
"(",
"$",
"data",
... | Handles creating a pager and turning it into a collection representation
@param $data
@param $page
@param $limit
@param $url
@param array $params
@return PaginatedCollection | [
"Handles",
"creating",
"a",
"pager",
"and",
"turning",
"it",
"into",
"a",
"collection",
"representation"
] | f7b624f473a3247a29f05c4a694d04bba4038e59 | https://github.com/MarcusFulbright/represent/blob/f7b624f473a3247a29f05c4a694d04bba4038e59/src/Represent/Factory/PaginationFactory.php#L55-L60 |
235,470 | fabsgc/framework | Core/Lang/Langs.php | Langs.getLangClient | public function getLangClient() {
if (!array_key_exists('HTTP_ACCEPT_LANGUAGE', $_SERVER) || !$_SERVER['HTTP_ACCEPT_LANGUAGE']) {
return Config::config()['user']['output']['lang'];
}
else {
$langcode = (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) ? $_SERVER['HTTP_ACCEPT_LAN... | php | public function getLangClient() {
if (!array_key_exists('HTTP_ACCEPT_LANGUAGE', $_SERVER) || !$_SERVER['HTTP_ACCEPT_LANGUAGE']) {
return Config::config()['user']['output']['lang'];
}
else {
$langcode = (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) ? $_SERVER['HTTP_ACCEPT_LAN... | [
"public",
"function",
"getLangClient",
"(",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"'HTTP_ACCEPT_LANGUAGE'",
",",
"$",
"_SERVER",
")",
"||",
"!",
"$",
"_SERVER",
"[",
"'HTTP_ACCEPT_LANGUAGE'",
"]",
")",
"{",
"return",
"Config",
"::",
"config",
"(... | get the client language
@access public
@return string
@since 3.0
@package Gcs\Framework\Core\Lang | [
"get",
"the",
"client",
"language"
] | 45e58182aba6a3c6381970a1fd3c17662cff2168 | https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Lang/Langs.php#L36-L48 |
235,471 | cmdweb/cache | Cache/Cache.php | Cache.delete | public function delete($key){
$file = $this->generateFileLocation($key);
if(file_exists($file))
unlink($file);
} | php | public function delete($key){
$file = $this->generateFileLocation($key);
if(file_exists($file))
unlink($file);
} | [
"public",
"function",
"delete",
"(",
"$",
"key",
")",
"{",
"$",
"file",
"=",
"$",
"this",
"->",
"generateFileLocation",
"(",
"$",
"key",
")",
";",
"if",
"(",
"file_exists",
"(",
"$",
"file",
")",
")",
"unlink",
"(",
"$",
"file",
")",
";",
"}"
] | Limpa um cache | [
"Limpa",
"um",
"cache"
] | b1ca4249596bffe93d23b46ba298785d17fa1e10 | https://github.com/cmdweb/cache/blob/b1ca4249596bffe93d23b46ba298785d17fa1e10/Cache/Cache.php#L99-L104 |
235,472 | cmdweb/cache | Cache/Cache.php | Cache.set | public function set($key, $content, $time = null) {
$time = strtotime(!is_null($time) ? $time : self::$time);
$content = serialize(array(
'expires' => $time,
'content' => $content));
return $this->createCacheFile($key, $content);
} | php | public function set($key, $content, $time = null) {
$time = strtotime(!is_null($time) ? $time : self::$time);
$content = serialize(array(
'expires' => $time,
'content' => $content));
return $this->createCacheFile($key, $content);
} | [
"public",
"function",
"set",
"(",
"$",
"key",
",",
"$",
"content",
",",
"$",
"time",
"=",
"null",
")",
"{",
"$",
"time",
"=",
"strtotime",
"(",
"!",
"is_null",
"(",
"$",
"time",
")",
"?",
"$",
"time",
":",
"self",
"::",
"$",
"time",
")",
";",
... | Salva um valor no cache
@uses Cache::createCacheFile() para criar o arquivo com o cache
@param string $key Uma chave para identificar o valor cacheado
@param mixed $content Conteúdo/variável a ser salvo(a) no cache
@param string $time Quanto tempo até o cache expirar (opcional)
@return boolean Se o cache foi salvo | [
"Salva",
"um",
"valor",
"no",
"cache"
] | b1ca4249596bffe93d23b46ba298785d17fa1e10 | https://github.com/cmdweb/cache/blob/b1ca4249596bffe93d23b46ba298785d17fa1e10/Cache/Cache.php#L117-L125 |
235,473 | cmdweb/cache | Cache/Cache.php | Cache.get | public function get($key) {
$filename = $this->generateFileLocation($key);
if (file_exists($filename) && is_readable($filename)) {
$cache = unserialize(file_get_contents($filename));
if ($cache['expires'] > time()) {
return $cache['content'];
} else {
... | php | public function get($key) {
$filename = $this->generateFileLocation($key);
if (file_exists($filename) && is_readable($filename)) {
$cache = unserialize(file_get_contents($filename));
if ($cache['expires'] > time()) {
return $cache['content'];
} else {
... | [
"public",
"function",
"get",
"(",
"$",
"key",
")",
"{",
"$",
"filename",
"=",
"$",
"this",
"->",
"generateFileLocation",
"(",
"$",
"key",
")",
";",
"if",
"(",
"file_exists",
"(",
"$",
"filename",
")",
"&&",
"is_readable",
"(",
"$",
"filename",
")",
"... | Salva um valor do cache
@uses Cache::generateFileLocation() para gerar o local do arquivo de cache
@param string $key Uma chave para identificar o valor cacheado
@return mixed Se o cache foi encontrado retorna o seu valor, caso contrário retorna NULL | [
"Salva",
"um",
"valor",
"do",
"cache"
] | b1ca4249596bffe93d23b46ba298785d17fa1e10 | https://github.com/cmdweb/cache/blob/b1ca4249596bffe93d23b46ba298785d17fa1e10/Cache/Cache.php#L137-L148 |
235,474 | pablodip/PablodipModuleBundle | Field/Guesser/FieldGuesserFactory.php | FieldGuesserFactory.addFieldGuessers | public function addFieldGuessers(array $fieldGuessers)
{
foreach ($fieldGuessers as $name => $fieldGuesser) {
$this->add($name, $fieldGuesser);
}
} | php | public function addFieldGuessers(array $fieldGuessers)
{
foreach ($fieldGuessers as $name => $fieldGuesser) {
$this->add($name, $fieldGuesser);
}
} | [
"public",
"function",
"addFieldGuessers",
"(",
"array",
"$",
"fieldGuessers",
")",
"{",
"foreach",
"(",
"$",
"fieldGuessers",
"as",
"$",
"name",
"=>",
"$",
"fieldGuesser",
")",
"{",
"$",
"this",
"->",
"add",
"(",
"$",
"name",
",",
"$",
"fieldGuesser",
")... | Adds an array of field guessers.
@param array $fieldGuessers An array of field guessers. | [
"Adds",
"an",
"array",
"of",
"field",
"guessers",
"."
] | 6d26df909fa4c57b8b3337d58f8cbecd7781c6ef | https://github.com/pablodip/PablodipModuleBundle/blob/6d26df909fa4c57b8b3337d58f8cbecd7781c6ef/Field/Guesser/FieldGuesserFactory.php#L50-L55 |
235,475 | pablodip/PablodipModuleBundle | Field/Guesser/FieldGuesserFactory.php | FieldGuesserFactory.get | public function get($name)
{
if (!$this->has($name)) {
throw new \InvalidArgumentException(sprintf('The field guesser "%s" does not exist.', $name));
}
return $this->fieldGuessers[$name];
} | php | public function get($name)
{
if (!$this->has($name)) {
throw new \InvalidArgumentException(sprintf('The field guesser "%s" does not exist.', $name));
}
return $this->fieldGuessers[$name];
} | [
"public",
"function",
"get",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"has",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'The field guesser \"%s\" does not exist.'",
",",
"$... | Returns a field guesser by name.
@param string $name The name.
@return FieldGuesserInterface The field guesser.
@throws \InvalidArgumentException If the field guesser does not exist. | [
"Returns",
"a",
"field",
"guesser",
"by",
"name",
"."
] | 6d26df909fa4c57b8b3337d58f8cbecd7781c6ef | https://github.com/pablodip/PablodipModuleBundle/blob/6d26df909fa4c57b8b3337d58f8cbecd7781c6ef/Field/Guesser/FieldGuesserFactory.php#L78-L85 |
235,476 | dlapps/consul-php-envvar | src/Builder/ConsulEnvManagerBuilder.php | ConsulEnvManagerBuilder.build | public function build(): ConsulEnvManager
{
$kv = (new ServiceFactory([
'base_uri' => $this->consulServer
]))->get('kv');
$manager = new ConsulEnvManager(
$kv,
$this->overwriteEvenIfDefined
);
$this->clear();
return $manager;
... | php | public function build(): ConsulEnvManager
{
$kv = (new ServiceFactory([
'base_uri' => $this->consulServer
]))->get('kv');
$manager = new ConsulEnvManager(
$kv,
$this->overwriteEvenIfDefined
);
$this->clear();
return $manager;
... | [
"public",
"function",
"build",
"(",
")",
":",
"ConsulEnvManager",
"{",
"$",
"kv",
"=",
"(",
"new",
"ServiceFactory",
"(",
"[",
"'base_uri'",
"=>",
"$",
"this",
"->",
"consulServer",
"]",
")",
")",
"->",
"get",
"(",
"'kv'",
")",
";",
"$",
"manager",
"... | Build the manager with the properties that have been defined.
@return ConsulEnvManager | [
"Build",
"the",
"manager",
"with",
"the",
"properties",
"that",
"have",
"been",
"defined",
"."
] | e5da3a3e56536c1108c32c1148cda0b589ad7773 | https://github.com/dlapps/consul-php-envvar/blob/e5da3a3e56536c1108c32c1148cda0b589ad7773/src/Builder/ConsulEnvManagerBuilder.php#L33-L47 |
235,477 | jmpantoja/planb-utils | src/Beautifier/Parser/ParserFactory.php | ParserFactory.factory | public static function factory(?Enviroment $environment = null): Parser
{
$environment = $environment ?? Enviroment::getFromSapi(PHP_SAPI);
return self::evaluate($environment)->isInstanceOf(Parser::class)->getValue();
} | php | public static function factory(?Enviroment $environment = null): Parser
{
$environment = $environment ?? Enviroment::getFromSapi(PHP_SAPI);
return self::evaluate($environment)->isInstanceOf(Parser::class)->getValue();
} | [
"public",
"static",
"function",
"factory",
"(",
"?",
"Enviroment",
"$",
"environment",
"=",
"null",
")",
":",
"Parser",
"{",
"$",
"environment",
"=",
"$",
"environment",
"??",
"Enviroment",
"::",
"getFromSapi",
"(",
"PHP_SAPI",
")",
";",
"return",
"self",
... | Devuelve el parser asociado a un nombre
@param null|\PlanB\Beautifier\Enviroment $environment
@return \PlanB\Beautifier\Parser\Parser | [
"Devuelve",
"el",
"parser",
"asociado",
"a",
"un",
"nombre"
] | d17fbced4a285275928f8428ee56e269eb851690 | https://github.com/jmpantoja/planb-utils/blob/d17fbced4a285275928f8428ee56e269eb851690/src/Beautifier/Parser/ParserFactory.php#L37-L42 |
235,478 | jmpantoja/planb-utils | src/Beautifier/Parser/ParserFactory.php | ParserFactory.makeHtml | public function makeHtml(Enviroment $enviroment): ?Parser
{
if (!$enviroment->isHtml()) {
return null;
}
return Parser::make()
->addDecorator(PaddingDecorator::make())
->addDecorator(LineWidthDecorator::make())
->addDecorator(HtmlTagDecorator... | php | public function makeHtml(Enviroment $enviroment): ?Parser
{
if (!$enviroment->isHtml()) {
return null;
}
return Parser::make()
->addDecorator(PaddingDecorator::make())
->addDecorator(LineWidthDecorator::make())
->addDecorator(HtmlTagDecorator... | [
"public",
"function",
"makeHtml",
"(",
"Enviroment",
"$",
"enviroment",
")",
":",
"?",
"Parser",
"{",
"if",
"(",
"!",
"$",
"enviroment",
"->",
"isHtml",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"Parser",
"::",
"make",
"(",
")",
"->",... | Crea un objeto Html Parser
@param \PlanB\Beautifier\Enviroment $enviroment
@return null| \PlanB\Beautifier\Parser\Parser | [
"Crea",
"un",
"objeto",
"Html",
"Parser"
] | d17fbced4a285275928f8428ee56e269eb851690 | https://github.com/jmpantoja/planb-utils/blob/d17fbced4a285275928f8428ee56e269eb851690/src/Beautifier/Parser/ParserFactory.php#L62-L74 |
235,479 | jmpantoja/planb-utils | src/Beautifier/Parser/ParserFactory.php | ParserFactory.makeConsole | public function makeConsole(Enviroment $enviroment): ?Parser
{
if (!$enviroment->isConsole()) {
return null;
}
return Parser::make()
->addDecorator(PaddingDecorator::make())
->addDecorator(LineWidthDecorator::make())
->addDecorator(ConsoleTagD... | php | public function makeConsole(Enviroment $enviroment): ?Parser
{
if (!$enviroment->isConsole()) {
return null;
}
return Parser::make()
->addDecorator(PaddingDecorator::make())
->addDecorator(LineWidthDecorator::make())
->addDecorator(ConsoleTagD... | [
"public",
"function",
"makeConsole",
"(",
"Enviroment",
"$",
"enviroment",
")",
":",
"?",
"Parser",
"{",
"if",
"(",
"!",
"$",
"enviroment",
"->",
"isConsole",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"Parser",
"::",
"make",
"(",
")",
... | Crea un objeto Console Parser
@param \PlanB\Beautifier\Enviroment $enviroment
@return null|\PlanB\Beautifier\Parser\Parser | [
"Crea",
"un",
"objeto",
"Console",
"Parser"
] | d17fbced4a285275928f8428ee56e269eb851690 | https://github.com/jmpantoja/planb-utils/blob/d17fbced4a285275928f8428ee56e269eb851690/src/Beautifier/Parser/ParserFactory.php#L83-L94 |
235,480 | ExSituMarketing/EXS-LanderTrackingHouseBundle | Service/TrackingParameterExtracter.php | TrackingParameterExtracter.setup | public function setup(array $extracters)
{
foreach ($extracters as $extracter) {
if (
(false === ($extracter['reference'] instanceof TrackingParameterQueryExtracterInterface))
&& (false === ($extracter['reference'] instanceof TrackingParameterCookieExtracterInterf... | php | public function setup(array $extracters)
{
foreach ($extracters as $extracter) {
if (
(false === ($extracter['reference'] instanceof TrackingParameterQueryExtracterInterface))
&& (false === ($extracter['reference'] instanceof TrackingParameterCookieExtracterInterf... | [
"public",
"function",
"setup",
"(",
"array",
"$",
"extracters",
")",
"{",
"foreach",
"(",
"$",
"extracters",
"as",
"$",
"extracter",
")",
"{",
"if",
"(",
"(",
"false",
"===",
"(",
"$",
"extracter",
"[",
"'reference'",
"]",
"instanceof",
"TrackingParameterQ... | Set all formatters available.
@param array $extracters
@throws InvalidConfigurationException | [
"Set",
"all",
"formatters",
"available",
"."
] | 404ce51ec1ee0bf5e669eb1f4cd04746e244f61a | https://github.com/ExSituMarketing/EXS-LanderTrackingHouseBundle/blob/404ce51ec1ee0bf5e669eb1f4cd04746e244f61a/Service/TrackingParameterExtracter.php#L39-L55 |
235,481 | ExSituMarketing/EXS-LanderTrackingHouseBundle | Service/TrackingParameterExtracter.php | TrackingParameterExtracter.extract | public function extract(Request $request)
{
$trackingParameters = new ParameterBag();
/** Get value from cookies. */
foreach ($this->extracters as $extracter) {
if ($extracter instanceof TrackingParameterCookieExtracterInterface) {
$trackingParameters->add($extra... | php | public function extract(Request $request)
{
$trackingParameters = new ParameterBag();
/** Get value from cookies. */
foreach ($this->extracters as $extracter) {
if ($extracter instanceof TrackingParameterCookieExtracterInterface) {
$trackingParameters->add($extra... | [
"public",
"function",
"extract",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"trackingParameters",
"=",
"new",
"ParameterBag",
"(",
")",
";",
"/** Get value from cookies. */",
"foreach",
"(",
"$",
"this",
"->",
"extracters",
"as",
"$",
"extracter",
")",
"{"... | Extract tracking parameters from query or from cookies.
@param Request $request
@return ParameterBag | [
"Extract",
"tracking",
"parameters",
"from",
"query",
"or",
"from",
"cookies",
"."
] | 404ce51ec1ee0bf5e669eb1f4cd04746e244f61a | https://github.com/ExSituMarketing/EXS-LanderTrackingHouseBundle/blob/404ce51ec1ee0bf5e669eb1f4cd04746e244f61a/Service/TrackingParameterExtracter.php#L64-L83 |
235,482 | ruxon/framework | src/Sms/BaseSmsSms.class.php | BaseSmsSms.status | public function status($id)
{
$url = self::HOST . self::STATUS;
$params = $this->get_default_params();
$params['id'] = $id;
$result = $this->request($url, $params);
return $result;
} | php | public function status($id)
{
$url = self::HOST . self::STATUS;
$params = $this->get_default_params();
$params['id'] = $id;
$result = $this->request($url, $params);
return $result;
} | [
"public",
"function",
"status",
"(",
"$",
"id",
")",
"{",
"$",
"url",
"=",
"self",
"::",
"HOST",
".",
"self",
"::",
"STATUS",
";",
"$",
"params",
"=",
"$",
"this",
"->",
"get_default_params",
"(",
")",
";",
"$",
"params",
"[",
"'id'",
"]",
"=",
"... | Check message status
@param type $id
@return type | [
"Check",
"message",
"status"
] | d6c9a48df41c8564ee1b0455cd09fbe789e6b086 | https://github.com/ruxon/framework/blob/d6c9a48df41c8564ee1b0455cd09fbe789e6b086/src/Sms/BaseSmsSms.class.php#L83-L92 |
235,483 | ruxon/framework | src/Sms/BaseSmsSms.class.php | BaseSmsSms.balance | public function balance()
{
$url = self::HOST . self::BALANCE;
$params = $this->get_default_params();
$result = $this->request($url, $params);
$result = explode("\n", $result);
return array(
'code' => $result[0],
'balance' => $result[1]
);
... | php | public function balance()
{
$url = self::HOST . self::BALANCE;
$params = $this->get_default_params();
$result = $this->request($url, $params);
$result = explode("\n", $result);
return array(
'code' => $result[0],
'balance' => $result[1]
);
... | [
"public",
"function",
"balance",
"(",
")",
"{",
"$",
"url",
"=",
"self",
"::",
"HOST",
".",
"self",
"::",
"BALANCE",
";",
"$",
"params",
"=",
"$",
"this",
"->",
"get_default_params",
"(",
")",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"request",
... | Check user balance
@return array | [
"Check",
"user",
"balance"
] | d6c9a48df41c8564ee1b0455cd09fbe789e6b086 | https://github.com/ruxon/framework/blob/d6c9a48df41c8564ee1b0455cd09fbe789e6b086/src/Sms/BaseSmsSms.class.php#L98-L110 |
235,484 | ruxon/framework | src/Sms/BaseSmsSms.class.php | BaseSmsSms.limit | public function limit()
{
$url = self::HOST . self::LIMIT;
$params = $this->get_default_params();
$result = $this->request($url, $params);
$result = explode("\n", $result);
return array(
'code' => $result[0],
'total' => $result[1],
'curr... | php | public function limit()
{
$url = self::HOST . self::LIMIT;
$params = $this->get_default_params();
$result = $this->request($url, $params);
$result = explode("\n", $result);
return array(
'code' => $result[0],
'total' => $result[1],
'curr... | [
"public",
"function",
"limit",
"(",
")",
"{",
"$",
"url",
"=",
"self",
"::",
"HOST",
".",
"self",
"::",
"LIMIT",
";",
"$",
"params",
"=",
"$",
"this",
"->",
"get_default_params",
"(",
")",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"request",
"(",... | Check day limit
@return array | [
"Check",
"day",
"limit"
] | d6c9a48df41c8564ee1b0455cd09fbe789e6b086 | https://github.com/ruxon/framework/blob/d6c9a48df41c8564ee1b0455cd09fbe789e6b086/src/Sms/BaseSmsSms.class.php#L117-L130 |
235,485 | ruxon/framework | src/Sms/BaseSmsSms.class.php | BaseSmsSms.cost | public function cost($to, $text)
{
$url = self::HOST . self::COST;
$this->id = null;
$params = $this->get_default_params();
$params['to'] = $to;
$params['text'] = $text;
$result = $this->request($url, $params);
$result = explode("\n", $result);
ret... | php | public function cost($to, $text)
{
$url = self::HOST . self::COST;
$this->id = null;
$params = $this->get_default_params();
$params['to'] = $to;
$params['text'] = $text;
$result = $this->request($url, $params);
$result = explode("\n", $result);
ret... | [
"public",
"function",
"cost",
"(",
"$",
"to",
",",
"$",
"text",
")",
"{",
"$",
"url",
"=",
"self",
"::",
"HOST",
".",
"self",
"::",
"COST",
";",
"$",
"this",
"->",
"id",
"=",
"null",
";",
"$",
"params",
"=",
"$",
"this",
"->",
"get_default_params... | Get message cost
@param type $to
@param type $text
@return type | [
"Get",
"message",
"cost"
] | d6c9a48df41c8564ee1b0455cd09fbe789e6b086 | https://github.com/ruxon/framework/blob/d6c9a48df41c8564ee1b0455cd09fbe789e6b086/src/Sms/BaseSmsSms.class.php#L139-L156 |
235,486 | ruxon/framework | src/Sms/BaseSmsSms.class.php | BaseSmsSms.senders | public function senders()
{
$url = self::HOST . self::SENDERS;
$params = $this->get_default_params();
$result = $this->request($url, $params);
$result = explode("\n", rtrim($result));
$response = array(
'code' => $result[0],
'senders' => $result
... | php | public function senders()
{
$url = self::HOST . self::SENDERS;
$params = $this->get_default_params();
$result = $this->request($url, $params);
$result = explode("\n", rtrim($result));
$response = array(
'code' => $result[0],
'senders' => $result
... | [
"public",
"function",
"senders",
"(",
")",
"{",
"$",
"url",
"=",
"self",
"::",
"HOST",
".",
"self",
"::",
"SENDERS",
";",
"$",
"params",
"=",
"$",
"this",
"->",
"get_default_params",
"(",
")",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"request",
... | Get my senders list
@return array | [
"Get",
"my",
"senders",
"list"
] | d6c9a48df41c8564ee1b0455cd09fbe789e6b086 | https://github.com/ruxon/framework/blob/d6c9a48df41c8564ee1b0455cd09fbe789e6b086/src/Sms/BaseSmsSms.class.php#L163-L178 |
235,487 | ruxon/framework | src/Sms/BaseSmsSms.class.php | BaseSmsSms.check | public function check()
{
$url = self::HOST . self::CHECK;
$params = $this->get_default_params();
$result = $this->request($url, $params);
return $result;
} | php | public function check()
{
$url = self::HOST . self::CHECK;
$params = $this->get_default_params();
$result = $this->request($url, $params);
return $result;
} | [
"public",
"function",
"check",
"(",
")",
"{",
"$",
"url",
"=",
"self",
"::",
"HOST",
".",
"self",
"::",
"CHECK",
";",
"$",
"params",
"=",
"$",
"this",
"->",
"get_default_params",
"(",
")",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"request",
"(",... | Check user auth
@return type | [
"Check",
"user",
"auth"
] | d6c9a48df41c8564ee1b0455cd09fbe789e6b086 | https://github.com/ruxon/framework/blob/d6c9a48df41c8564ee1b0455cd09fbe789e6b086/src/Sms/BaseSmsSms.class.php#L185-L192 |
235,488 | frostnode/frostnode-cms | modules/Page/Http/Controllers/PageController.php | PageController.trashed | public function trashed(Request $request)
{
// Set roles that have access
$request->user()->authorizeRoles(['admin', 'editor']);
$pages = Page::onlyTrashed()
->orderBy('updated_at', 'desc')
->orderBy('created_at', 'desc')
->with('pagetype')
->... | php | public function trashed(Request $request)
{
// Set roles that have access
$request->user()->authorizeRoles(['admin', 'editor']);
$pages = Page::onlyTrashed()
->orderBy('updated_at', 'desc')
->orderBy('created_at', 'desc')
->with('pagetype')
->... | [
"public",
"function",
"trashed",
"(",
"Request",
"$",
"request",
")",
"{",
"// Set roles that have access",
"$",
"request",
"->",
"user",
"(",
")",
"->",
"authorizeRoles",
"(",
"[",
"'admin'",
",",
"'editor'",
"]",
")",
";",
"$",
"pages",
"=",
"Page",
"::"... | Display a listing of trashed resources.
@param Request $request
@return Response
@todo: This should be merged into index method | [
"Display",
"a",
"listing",
"of",
"trashed",
"resources",
"."
] | 486db24bb8ebd73dcc1ef71f79509817d23fbf45 | https://github.com/frostnode/frostnode-cms/blob/486db24bb8ebd73dcc1ef71f79509817d23fbf45/modules/Page/Http/Controllers/PageController.php#L85-L97 |
235,489 | frostnode/frostnode-cms | modules/Page/Http/Controllers/PageController.php | PageController.select | public function select(Request $request)
{
// Set roles that have access
$request->user()->authorizeRoles(['admin', 'editor']);
// Get all pagetypes
$pagetypes = PageType::all();
return view('page::pages.select', ['pagetypes' => $pagetypes]);
} | php | public function select(Request $request)
{
// Set roles that have access
$request->user()->authorizeRoles(['admin', 'editor']);
// Get all pagetypes
$pagetypes = PageType::all();
return view('page::pages.select', ['pagetypes' => $pagetypes]);
} | [
"public",
"function",
"select",
"(",
"Request",
"$",
"request",
")",
"{",
"// Set roles that have access",
"$",
"request",
"->",
"user",
"(",
")",
"->",
"authorizeRoles",
"(",
"[",
"'admin'",
",",
"'editor'",
"]",
")",
";",
"// Get all pagetypes",
"$",
"pagety... | Show the form for selecting a new resource.
@param Request $request
@return Response | [
"Show",
"the",
"form",
"for",
"selecting",
"a",
"new",
"resource",
"."
] | 486db24bb8ebd73dcc1ef71f79509817d23fbf45 | https://github.com/frostnode/frostnode-cms/blob/486db24bb8ebd73dcc1ef71f79509817d23fbf45/modules/Page/Http/Controllers/PageController.php#L104-L112 |
235,490 | frostnode/frostnode-cms | modules/Page/Http/Controllers/PageController.php | PageController.delete | public function delete(Request $request, $page)
{
// Set roles that have access
$request->user()->authorizeRoles(['admin', 'editor']);
$page = Page::withTrashed()->findOrFail($page);
return view('page::pages.delete', ['page' => $page]);
} | php | public function delete(Request $request, $page)
{
// Set roles that have access
$request->user()->authorizeRoles(['admin', 'editor']);
$page = Page::withTrashed()->findOrFail($page);
return view('page::pages.delete', ['page' => $page]);
} | [
"public",
"function",
"delete",
"(",
"Request",
"$",
"request",
",",
"$",
"page",
")",
"{",
"// Set roles that have access",
"$",
"request",
"->",
"user",
"(",
")",
"->",
"authorizeRoles",
"(",
"[",
"'admin'",
",",
"'editor'",
"]",
")",
";",
"$",
"page",
... | Display a delete page.
@param Request $request
@param $page
@return View | [
"Display",
"a",
"delete",
"page",
"."
] | 486db24bb8ebd73dcc1ef71f79509817d23fbf45 | https://github.com/frostnode/frostnode-cms/blob/486db24bb8ebd73dcc1ef71f79509817d23fbf45/modules/Page/Http/Controllers/PageController.php#L310-L317 |
235,491 | xobotyi/dotarray | src/A.php | A.splitPath | public static function splitPath(string $path, bool $safe = null): array
{
if ($path === '') {
return [];
}
$safe = ($safe === null ? self::$safeSeparationMode : $safe);
if ($safe) {
$segments = preg_split('~\\\\' . self::$separator . '(*SKIP)(*F)|\.~s', $pa... | php | public static function splitPath(string $path, bool $safe = null): array
{
if ($path === '') {
return [];
}
$safe = ($safe === null ? self::$safeSeparationMode : $safe);
if ($safe) {
$segments = preg_split('~\\\\' . self::$separator . '(*SKIP)(*F)|\.~s', $pa... | [
"public",
"static",
"function",
"splitPath",
"(",
"string",
"$",
"path",
",",
"bool",
"$",
"safe",
"=",
"null",
")",
":",
"array",
"{",
"if",
"(",
"$",
"path",
"===",
"''",
")",
"{",
"return",
"[",
"]",
";",
"}",
"$",
"safe",
"=",
"(",
"$",
"sa... | Split given string to it's segments according to dot notation.
Empty segments will be ignored.
Supports escaping.
@param string $path
@param bool $safe
@return array | [
"Split",
"given",
"string",
"to",
"it",
"s",
"segments",
"according",
"to",
"dot",
"notation",
".",
"Empty",
"segments",
"will",
"be",
"ignored",
".",
"Supports",
"escaping",
"."
] | 5781c1e2752fa6be7bb88b575b901a00788bfe70 | https://github.com/xobotyi/dotarray/blob/5781c1e2752fa6be7bb88b575b901a00788bfe70/src/A.php#L191-L218 |
235,492 | xobotyi/dotarray | src/A.php | A.set | public static function set(array $array, ...$args): array
{
if (empty($args)) {
throw new \ArgumentCountError('Too few arguments to function xobotyi\A::set(), 1 passed, at least 2 expected');
}
if (is_string($args[0]) || is_numeric($args[0])) {
if (!isset($args[1]) &... | php | public static function set(array $array, ...$args): array
{
if (empty($args)) {
throw new \ArgumentCountError('Too few arguments to function xobotyi\A::set(), 1 passed, at least 2 expected');
}
if (is_string($args[0]) || is_numeric($args[0])) {
if (!isset($args[1]) &... | [
"public",
"static",
"function",
"set",
"(",
"array",
"$",
"array",
",",
"...",
"$",
"args",
")",
":",
"array",
"{",
"if",
"(",
"empty",
"(",
"$",
"args",
")",
")",
"{",
"throw",
"new",
"\\",
"ArgumentCountError",
"(",
"'Too few arguments to function xoboty... | Set the value passed with 3'rd argument on the path passed with 2'nd argument.
If 2'nd argument is array, it's keys will be used as paths and items as values.
Empty paths will be processed as non-existent.
@param array $array
@param array ...$args
@return array
@throws \ArgumentCountError
@throws \TypeError | [
"Set",
"the",
"value",
"passed",
"with",
"3",
"rd",
"argument",
"on",
"the",
"path",
"passed",
"with",
"2",
"nd",
"argument",
".",
"If",
"2",
"nd",
"argument",
"is",
"array",
"it",
"s",
"keys",
"will",
"be",
"used",
"as",
"paths",
"and",
"items",
"as... | 5781c1e2752fa6be7bb88b575b901a00788bfe70 | https://github.com/xobotyi/dotarray/blob/5781c1e2752fa6be7bb88b575b901a00788bfe70/src/A.php#L419-L462 |
235,493 | leedave/resource-mysql | src/Tools/Update.php | Update.updateDb | public function updateDb()
{
$this->createUpdateTableIfNotExists();
$this->getProcessedFiles();
$path = leedch_resourceMysqlUpdateFolder;
$files = $this->findNewFiles($path);
$this->processNewFiles($files);
} | php | public function updateDb()
{
$this->createUpdateTableIfNotExists();
$this->getProcessedFiles();
$path = leedch_resourceMysqlUpdateFolder;
$files = $this->findNewFiles($path);
$this->processNewFiles($files);
} | [
"public",
"function",
"updateDb",
"(",
")",
"{",
"$",
"this",
"->",
"createUpdateTableIfNotExists",
"(",
")",
";",
"$",
"this",
"->",
"getProcessedFiles",
"(",
")",
";",
"$",
"path",
"=",
"leedch_resourceMysqlUpdateFolder",
";",
"$",
"files",
"=",
"$",
"this... | This method is triggered in Bash to process DB Update Files | [
"This",
"method",
"is",
"triggered",
"in",
"Bash",
"to",
"process",
"DB",
"Update",
"Files"
] | 68305dac50b1b956f08f41267d0b2912850d8232 | https://github.com/leedave/resource-mysql/blob/68305dac50b1b956f08f41267d0b2912850d8232/src/Tools/Update.php#L32-L41 |
235,494 | leedave/resource-mysql | src/Tools/Update.php | Update.processNewFiles | protected function processNewFiles(array $files)
{
foreach ($files as $file) {
if (!file_exists($file)) {
//This is bad
throw new Exception('Cant find File: '.$file);
}
include $file;
if (!isset($arrUpdate)) {
... | php | protected function processNewFiles(array $files)
{
foreach ($files as $file) {
if (!file_exists($file)) {
//This is bad
throw new Exception('Cant find File: '.$file);
}
include $file;
if (!isset($arrUpdate)) {
... | [
"protected",
"function",
"processNewFiles",
"(",
"array",
"$",
"files",
")",
"{",
"foreach",
"(",
"$",
"files",
"as",
"$",
"file",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"file",
")",
")",
"{",
"//This is bad",
"throw",
"new",
"Exception",
"... | Reads the Update Files and triggers the Update
@param array $files
@throws Exception | [
"Reads",
"the",
"Update",
"Files",
"and",
"triggers",
"the",
"Update"
] | 68305dac50b1b956f08f41267d0b2912850d8232 | https://github.com/leedave/resource-mysql/blob/68305dac50b1b956f08f41267d0b2912850d8232/src/Tools/Update.php#L59-L81 |
235,495 | leedave/resource-mysql | src/Tools/Update.php | Update.addFileToProcessedList | protected function addFileToProcessedList(string $filePath)
{
$arrFile = explode(DIRECTORY_SEPARATOR, $filePath);
$fileName = array_pop($arrFile);
$folder = implode(DIRECTORY_SEPARATOR, $arrFile).DIRECTORY_SEPARATOR;
$tmp = new Update();
$tmp->name = $fileName;
... | php | protected function addFileToProcessedList(string $filePath)
{
$arrFile = explode(DIRECTORY_SEPARATOR, $filePath);
$fileName = array_pop($arrFile);
$folder = implode(DIRECTORY_SEPARATOR, $arrFile).DIRECTORY_SEPARATOR;
$tmp = new Update();
$tmp->name = $fileName;
... | [
"protected",
"function",
"addFileToProcessedList",
"(",
"string",
"$",
"filePath",
")",
"{",
"$",
"arrFile",
"=",
"explode",
"(",
"DIRECTORY_SEPARATOR",
",",
"$",
"filePath",
")",
";",
"$",
"fileName",
"=",
"array_pop",
"(",
"$",
"arrFile",
")",
";",
"$",
... | Puts the Filename into the update table
@param string $filePath | [
"Puts",
"the",
"Filename",
"into",
"the",
"update",
"table"
] | 68305dac50b1b956f08f41267d0b2912850d8232 | https://github.com/leedave/resource-mysql/blob/68305dac50b1b956f08f41267d0b2912850d8232/src/Tools/Update.php#L87-L101 |
235,496 | leedave/resource-mysql | src/Tools/Update.php | Update.getProcessedFiles | protected function getProcessedFiles()
{
$sql = "SELECT * FROM `".$this->tableName."` ORDER BY `id` ASC;";
try {
$arrResult = $this->getAllRows();
} catch (PDOException $ex) {
echo $ex->getMessage().PHP_EOL;
return;
}
foreach ($arr... | php | protected function getProcessedFiles()
{
$sql = "SELECT * FROM `".$this->tableName."` ORDER BY `id` ASC;";
try {
$arrResult = $this->getAllRows();
} catch (PDOException $ex) {
echo $ex->getMessage().PHP_EOL;
return;
}
foreach ($arr... | [
"protected",
"function",
"getProcessedFiles",
"(",
")",
"{",
"$",
"sql",
"=",
"\"SELECT * FROM `\"",
".",
"$",
"this",
"->",
"tableName",
".",
"\"` ORDER BY `id` ASC;\"",
";",
"try",
"{",
"$",
"arrResult",
"=",
"$",
"this",
"->",
"getAllRows",
"(",
")",
";",... | Get List of processed files, catches exception if db_update does not exist
@return void | [
"Get",
"List",
"of",
"processed",
"files",
"catches",
"exception",
"if",
"db_update",
"does",
"not",
"exist"
] | 68305dac50b1b956f08f41267d0b2912850d8232 | https://github.com/leedave/resource-mysql/blob/68305dac50b1b956f08f41267d0b2912850d8232/src/Tools/Update.php#L121-L134 |
235,497 | leedave/resource-mysql | src/Tools/Update.php | Update.findNewFiles | protected function findNewFiles(string $path) : array
{
$arrReturn = [];
$arrFolders = scandir($path);
$arrSkip = [
'.',
'..',
];
foreach ($arrFolders as $file) {
//No Folder Defaults
if (in_array($file, $arrSkip)) {
... | php | protected function findNewFiles(string $path) : array
{
$arrReturn = [];
$arrFolders = scandir($path);
$arrSkip = [
'.',
'..',
];
foreach ($arrFolders as $file) {
//No Folder Defaults
if (in_array($file, $arrSkip)) {
... | [
"protected",
"function",
"findNewFiles",
"(",
"string",
"$",
"path",
")",
":",
"array",
"{",
"$",
"arrReturn",
"=",
"[",
"]",
";",
"$",
"arrFolders",
"=",
"scandir",
"(",
"$",
"path",
")",
";",
"$",
"arrSkip",
"=",
"[",
"'.'",
",",
"'..'",
",",
"]"... | Creates an array of Update Files that were not yet processed
@param string $path
@return array | [
"Creates",
"an",
"array",
"of",
"Update",
"Files",
"that",
"were",
"not",
"yet",
"processed"
] | 68305dac50b1b956f08f41267d0b2912850d8232 | https://github.com/leedave/resource-mysql/blob/68305dac50b1b956f08f41267d0b2912850d8232/src/Tools/Update.php#L141-L171 |
235,498 | liftkit/document | src/Document/Html.php | Html.addHeader | public function addHeader ($string, $prepend = false)
{
if ($prepend) {
$this->prependHeader($string);
} else {
$this->headers[] = $string;
}
} | php | public function addHeader ($string, $prepend = false)
{
if ($prepend) {
$this->prependHeader($string);
} else {
$this->headers[] = $string;
}
} | [
"public",
"function",
"addHeader",
"(",
"$",
"string",
",",
"$",
"prepend",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"prepend",
")",
"{",
"$",
"this",
"->",
"prependHeader",
"(",
"$",
"string",
")",
";",
"}",
"else",
"{",
"$",
"this",
"->",
"headers... | addHeader function.
@access public
@param string $string
@return void | [
"addHeader",
"function",
"."
] | 1f6d409c780e42f1c1d177e70039b039e28e2c53 | https://github.com/liftkit/document/blob/1f6d409c780e42f1c1d177e70039b039e28e2c53/src/Document/Html.php#L53-L60 |
235,499 | liftkit/document | src/Document/Html.php | Html.addMeta | public function addMeta ($name, $content, $attributes = array())
{
$html = '<meta name="' . $this->sanitize($name) . '" content="' . $this->sanitize($content) . '"';
foreach ($attributes as $key => $value) {
$html .= ' ' . $this->sanitize($key) . '="' . $this->sanitize($value) . '"';
}
$html .= ' />... | php | public function addMeta ($name, $content, $attributes = array())
{
$html = '<meta name="' . $this->sanitize($name) . '" content="' . $this->sanitize($content) . '"';
foreach ($attributes as $key => $value) {
$html .= ' ' . $this->sanitize($key) . '="' . $this->sanitize($value) . '"';
}
$html .= ' />... | [
"public",
"function",
"addMeta",
"(",
"$",
"name",
",",
"$",
"content",
",",
"$",
"attributes",
"=",
"array",
"(",
")",
")",
"{",
"$",
"html",
"=",
"'<meta name=\"'",
".",
"$",
"this",
"->",
"sanitize",
"(",
"$",
"name",
")",
".",
"'\" content=\"'",
... | addMeta function.
Add meta tags to head.
@access public
@param string $name
@param string $content
@param array $attributes (default: array())
@return void | [
"addMeta",
"function",
"."
] | 1f6d409c780e42f1c1d177e70039b039e28e2c53 | https://github.com/liftkit/document/blob/1f6d409c780e42f1c1d177e70039b039e28e2c53/src/Document/Html.php#L93-L104 |
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.