repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
DaemonAlchemist/atp-core | src/ATPCore/Lessc.php | lessc_parser.color | protected function color(&$out) {
if ($this->match('(#(?:[0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{3}))', $m)) {
if (strlen($m[1]) > 7) {
$out = array("string", "", array($m[1]));
} else {
$out = array("raw_color", $m[1]);
}
return true;
}
return false;
} | php | protected function color(&$out) {
if ($this->match('(#(?:[0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{3}))', $m)) {
if (strlen($m[1]) > 7) {
$out = array("string", "", array($m[1]));
} else {
$out = array("raw_color", $m[1]);
}
return true;
}
return false;
} | [
"protected",
"function",
"color",
"(",
"&",
"$",
"out",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"match",
"(",
"'(#(?:[0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{3}))'",
",",
"$",
"m",
")",
")",
"{",
"if",
"(",
"strlen",
"(",
"$",
"m",
"[",
"1",
"]",
")",
">",
... | a # color | [
"a",
"#",
"color"
] | train | https://github.com/DaemonAlchemist/atp-core/blob/47efa734b882c27aa2a59fbcba34653b4d2125c7/src/ATPCore/Lessc.php#L3001-L3012 |
DaemonAlchemist/atp-core | src/ATPCore/Lessc.php | lessc_parser.argumentDef | protected function argumentDef(&$args, &$isVararg) {
$s = $this->seek();
if (!$this->literal('(')) return false;
$values = array();
$delim = ",";
$method = "expressionList";
$isVararg = false;
while (true) {
if ($this->literal("...")) {
$isVararg = true;
break;
}
if ($this->$method($value)) {
if ($va... | php | protected function argumentDef(&$args, &$isVararg) {
$s = $this->seek();
if (!$this->literal('(')) return false;
$values = array();
$delim = ",";
$method = "expressionList";
$isVararg = false;
while (true) {
if ($this->literal("...")) {
$isVararg = true;
break;
}
if ($this->$method($value)) {
if ($va... | [
"protected",
"function",
"argumentDef",
"(",
"&",
"$",
"args",
",",
"&",
"$",
"isVararg",
")",
"{",
"$",
"s",
"=",
"$",
"this",
"->",
"seek",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"literal",
"(",
"'('",
")",
")",
"return",
"false",
... | delimiter. | [
"delimiter",
"."
] | train | https://github.com/DaemonAlchemist/atp-core/blob/47efa734b882c27aa2a59fbcba34653b4d2125c7/src/ATPCore/Lessc.php#L3019-L3115 |
DaemonAlchemist/atp-core | src/ATPCore/Lessc.php | lessc_parser.mixinTags | protected function mixinTags(&$tags) {
$tags = array();
while ($this->tag($tt, true)) {
$tags[] = $tt;
$this->literal(">");
}
if (count($tags) == 0) return false;
return true;
} | php | protected function mixinTags(&$tags) {
$tags = array();
while ($this->tag($tt, true)) {
$tags[] = $tt;
$this->literal(">");
}
if (count($tags) == 0) return false;
return true;
} | [
"protected",
"function",
"mixinTags",
"(",
"&",
"$",
"tags",
")",
"{",
"$",
"tags",
"=",
"array",
"(",
")",
";",
"while",
"(",
"$",
"this",
"->",
"tag",
"(",
"$",
"tt",
",",
"true",
")",
")",
"{",
"$",
"tags",
"[",
"]",
"=",
"$",
"tt",
";",
... | optionally separated by > (lazy, accepts extra >) | [
"optionally",
"separated",
"by",
">",
"(",
"lazy",
"accepts",
"extra",
">",
")"
] | train | https://github.com/DaemonAlchemist/atp-core/blob/47efa734b882c27aa2a59fbcba34653b4d2125c7/src/ATPCore/Lessc.php#L3132-L3142 |
DaemonAlchemist/atp-core | src/ATPCore/Lessc.php | lessc_parser.tagBracket | protected function tagBracket(&$parts, &$hasExpression) {
// speed shortcut
if (isset($this->buffer[$this->count]) && $this->buffer[$this->count] != "[") {
return false;
}
$s = $this->seek();
$hasInterpolation = false;
if ($this->literal("[", false)) {
$attrParts = array("[");
// keyword, string, operato... | php | protected function tagBracket(&$parts, &$hasExpression) {
// speed shortcut
if (isset($this->buffer[$this->count]) && $this->buffer[$this->count] != "[") {
return false;
}
$s = $this->seek();
$hasInterpolation = false;
if ($this->literal("[", false)) {
$attrParts = array("[");
// keyword, string, operato... | [
"protected",
"function",
"tagBracket",
"(",
"&",
"$",
"parts",
",",
"&",
"$",
"hasExpression",
")",
"{",
"// speed shortcut\r",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"buffer",
"[",
"$",
"this",
"->",
"count",
"]",
")",
"&&",
"$",
"this",
"->",
... | a bracketed value (contained within in a tag definition) | [
"a",
"bracketed",
"value",
"(",
"contained",
"within",
"in",
"a",
"tag",
"definition",
")"
] | train | https://github.com/DaemonAlchemist/atp-core/blob/47efa734b882c27aa2a59fbcba34653b4d2125c7/src/ATPCore/Lessc.php#L3145-L3212 |
DaemonAlchemist/atp-core | src/ATPCore/Lessc.php | lessc_parser.tag | protected function tag(&$tag, $simple = false) {
if ($simple)
$chars = '^@,:;{}\][>\(\) "\'';
else
$chars = '^@,;{}["\'';
$s = $this->seek();
$hasExpression = false;
$parts = array();
while ($this->tagBracket($parts, $hasExpression));
$oldWhite = $this->eatWhiteDefault;
$this->eatWhiteDefault = false;
... | php | protected function tag(&$tag, $simple = false) {
if ($simple)
$chars = '^@,:;{}\][>\(\) "\'';
else
$chars = '^@,;{}["\'';
$s = $this->seek();
$hasExpression = false;
$parts = array();
while ($this->tagBracket($parts, $hasExpression));
$oldWhite = $this->eatWhiteDefault;
$this->eatWhiteDefault = false;
... | [
"protected",
"function",
"tag",
"(",
"&",
"$",
"tag",
",",
"$",
"simple",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"simple",
")",
"$",
"chars",
"=",
"'^@,:;{}\\][>\\(\\) \"\\''",
";",
"else",
"$",
"chars",
"=",
"'^@,;{}[\"\\''",
";",
"$",
"s",
"=",
"$... | a space separated list of selectors | [
"a",
"space",
"separated",
"list",
"of",
"selectors"
] | train | https://github.com/DaemonAlchemist/atp-core/blob/47efa734b882c27aa2a59fbcba34653b4d2125c7/src/ATPCore/Lessc.php#L3215-L3276 |
DaemonAlchemist/atp-core | src/ATPCore/Lessc.php | lessc_parser.func | protected function func(&$func) {
$s = $this->seek();
if ($this->match('(%|[\w\-_][\w\-_:\.]+|[\w_])', $m) && $this->literal('(')) {
$fname = $m[1];
$sPreArgs = $this->seek();
$args = array();
while (true) {
$ss = $this->seek();
// this ugly nonsense is for ie filter properties
if ($this->keyword($name) ... | php | protected function func(&$func) {
$s = $this->seek();
if ($this->match('(%|[\w\-_][\w\-_:\.]+|[\w_])', $m) && $this->literal('(')) {
$fname = $m[1];
$sPreArgs = $this->seek();
$args = array();
while (true) {
$ss = $this->seek();
// this ugly nonsense is for ie filter properties
if ($this->keyword($name) ... | [
"protected",
"function",
"func",
"(",
"&",
"$",
"func",
")",
"{",
"$",
"s",
"=",
"$",
"this",
"->",
"seek",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"match",
"(",
"'(%|[\\w\\-_][\\w\\-_:\\.]+|[\\w_])'",
",",
"$",
"m",
")",
"&&",
"$",
"this",
"-... | a css function | [
"a",
"css",
"function"
] | train | https://github.com/DaemonAlchemist/atp-core/blob/47efa734b882c27aa2a59fbcba34653b4d2125c7/src/ATPCore/Lessc.php#L3279-L3319 |
DaemonAlchemist/atp-core | src/ATPCore/Lessc.php | lessc_parser.assign | protected function assign($name = null) {
if ($name) $this->currentProperty = $name;
return $this->literal(':') || $this->literal('=');
} | php | protected function assign($name = null) {
if ($name) $this->currentProperty = $name;
return $this->literal(':') || $this->literal('=');
} | [
"protected",
"function",
"assign",
"(",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"name",
")",
"$",
"this",
"->",
"currentProperty",
"=",
"$",
"name",
";",
"return",
"$",
"this",
"->",
"literal",
"(",
"':'",
")",
"||",
"$",
"this",
"->",
... | Consume an assignment operator
Can optionally take a name that will be set to the current property name | [
"Consume",
"an",
"assignment",
"operator",
"Can",
"optionally",
"take",
"a",
"name",
"that",
"will",
"be",
"set",
"to",
"the",
"current",
"property",
"name"
] | train | https://github.com/DaemonAlchemist/atp-core/blob/47efa734b882c27aa2a59fbcba34653b4d2125c7/src/ATPCore/Lessc.php#L3344-L3347 |
DaemonAlchemist/atp-core | src/ATPCore/Lessc.php | lessc_parser.literal | protected function literal($what, $eatWhitespace = null) {
if ($eatWhitespace === null) $eatWhitespace = $this->eatWhiteDefault;
// shortcut on single letter
if (!isset($what[1]) && isset($this->buffer[$this->count])) {
if ($this->buffer[$this->count] == $what) {
if (!$eatWhitespace) {
$this->count++;
return t... | php | protected function literal($what, $eatWhitespace = null) {
if ($eatWhitespace === null) $eatWhitespace = $this->eatWhiteDefault;
// shortcut on single letter
if (!isset($what[1]) && isset($this->buffer[$this->count])) {
if ($this->buffer[$this->count] == $what) {
if (!$eatWhitespace) {
$this->count++;
return t... | [
"protected",
"function",
"literal",
"(",
"$",
"what",
",",
"$",
"eatWhitespace",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"eatWhitespace",
"===",
"null",
")",
"$",
"eatWhitespace",
"=",
"$",
"this",
"->",
"eatWhiteDefault",
";",
"// shortcut on single letter\r",... | /* raw parsing functions | [
"/",
"*",
"raw",
"parsing",
"functions"
] | train | https://github.com/DaemonAlchemist/atp-core/blob/47efa734b882c27aa2a59fbcba34653b4d2125c7/src/ATPCore/Lessc.php#L3428-L3449 |
DaemonAlchemist/atp-core | src/ATPCore/Lessc.php | lessc_parser.to | protected function to($what, &$out, $until = false, $allowNewline = false) {
if (is_string($allowNewline)) {
$validChars = $allowNewline;
} else {
$validChars = $allowNewline ? "." : "[^\n]";
}
if (!$this->match('('.$validChars.'*?)'.\ATPCore\Lessc::preg_quote($what), $m, !$until)) return false;
if ($until) $thi... | php | protected function to($what, &$out, $until = false, $allowNewline = false) {
if (is_string($allowNewline)) {
$validChars = $allowNewline;
} else {
$validChars = $allowNewline ? "." : "[^\n]";
}
if (!$this->match('('.$validChars.'*?)'.\ATPCore\Lessc::preg_quote($what), $m, !$until)) return false;
if ($until) $thi... | [
"protected",
"function",
"to",
"(",
"$",
"what",
",",
"&",
"$",
"out",
",",
"$",
"until",
"=",
"false",
",",
"$",
"allowNewline",
"=",
"false",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"allowNewline",
")",
")",
"{",
"$",
"validChars",
"=",
"$",
... | $allowNewline, if string, will be used as valid char set | [
"$allowNewline",
"if",
"string",
"will",
"be",
"used",
"as",
"valid",
"char",
"set"
] | train | https://github.com/DaemonAlchemist/atp-core/blob/47efa734b882c27aa2a59fbcba34653b4d2125c7/src/ATPCore/Lessc.php#L3479-L3489 |
DaemonAlchemist/atp-core | src/ATPCore/Lessc.php | lessc_parser.append | protected function append($prop, $pos = null) {
if ($pos !== null) $prop[-1] = $pos;
$this->env->props[] = $prop;
} | php | protected function append($prop, $pos = null) {
if ($pos !== null) $prop[-1] = $pos;
$this->env->props[] = $prop;
} | [
"protected",
"function",
"append",
"(",
"$",
"prop",
",",
"$",
"pos",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"pos",
"!==",
"null",
")",
"$",
"prop",
"[",
"-",
"1",
"]",
"=",
"$",
"pos",
";",
"$",
"this",
"->",
"env",
"->",
"props",
"[",
"]",
... | append a property to the current block | [
"append",
"a",
"property",
"to",
"the",
"current",
"block"
] | train | https://github.com/DaemonAlchemist/atp-core/blob/47efa734b882c27aa2a59fbcba34653b4d2125c7/src/ATPCore/Lessc.php#L3584-L3587 |
DaemonAlchemist/atp-core | src/ATPCore/Lessc.php | lessc_parser.removeComments | protected function removeComments($text) {
$look = array(
'url(', '//', '/*', '"', "'"
);
$out = '';
$min = null;
while (true) {
// find the next item
foreach ($look as $token) {
$pos = strpos($text, $token);
if ($pos !== false) {
if (!isset($min) || $pos < $min[1]) $min = array($token, $pos);
}
}
if ... | php | protected function removeComments($text) {
$look = array(
'url(', '//', '/*', '"', "'"
);
$out = '';
$min = null;
while (true) {
// find the next item
foreach ($look as $token) {
$pos = strpos($text, $token);
if ($pos !== false) {
if (!isset($min) || $pos < $min[1]) $min = array($token, $pos);
}
}
if ... | [
"protected",
"function",
"removeComments",
"(",
"$",
"text",
")",
"{",
"$",
"look",
"=",
"array",
"(",
"'url('",
",",
"'//'",
",",
"'/*'",
",",
"'\"'",
",",
"\"'\"",
")",
";",
"$",
"out",
"=",
"''",
";",
"$",
"min",
"=",
"null",
";",
"while",
"("... | todo: make it work for all functions, not just url | [
"todo",
":",
"make",
"it",
"work",
"for",
"all",
"functions",
"not",
"just",
"url"
] | train | https://github.com/DaemonAlchemist/atp-core/blob/47efa734b882c27aa2a59fbcba34653b4d2125c7/src/ATPCore/Lessc.php#L3598-L3651 |
Codifico/phpspec-rest-view-extension | src/Matcher/RestViewMatcher.php | RestViewMatcher.matches | protected function matches($subject, array $arguments)
{
if (!$this->isRestViewObject($subject)) {
$this->exception = new FailureException(sprintf(
'Expected %s to be an instance of FOS\RestBundle\View\View',
$this->presenter->presentValue($subject)
))... | php | protected function matches($subject, array $arguments)
{
if (!$this->isRestViewObject($subject)) {
$this->exception = new FailureException(sprintf(
'Expected %s to be an instance of FOS\RestBundle\View\View',
$this->presenter->presentValue($subject)
))... | [
"protected",
"function",
"matches",
"(",
"$",
"subject",
",",
"array",
"$",
"arguments",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isRestViewObject",
"(",
"$",
"subject",
")",
")",
"{",
"$",
"this",
"->",
"exception",
"=",
"new",
"FailureException",
... | @param mixed $subject
@param array $arguments
@return boolean | [
"@param",
"mixed",
"$subject",
"@param",
"array",
"$arguments"
] | train | https://github.com/Codifico/phpspec-rest-view-extension/blob/2528f20e648f887a14ec94bafe486246d7deefb8/src/Matcher/RestViewMatcher.php#L45-L98 |
foxslider/cmg-plugin | admin/controllers/apix/SlideController.php | SlideController.actionGet | public function actionGet( $id, $cid, $fid ) {
// Find Model
$model = $this->modelService->getById( $cid );
// Update/Render if exist
if( isset( $model ) ) {
$file = $model->image;
$data = [
'mid' => $model->id, 'fid' => $file->id,
'name' => $file->name, 'extension' => $file->extension,
't... | php | public function actionGet( $id, $cid, $fid ) {
// Find Model
$model = $this->modelService->getById( $cid );
// Update/Render if exist
if( isset( $model ) ) {
$file = $model->image;
$data = [
'mid' => $model->id, 'fid' => $file->id,
'name' => $file->name, 'extension' => $file->extension,
't... | [
"public",
"function",
"actionGet",
"(",
"$",
"id",
",",
"$",
"cid",
",",
"$",
"fid",
")",
"{",
"// Find Model",
"$",
"model",
"=",
"$",
"this",
"->",
"modelService",
"->",
"getById",
"(",
"$",
"cid",
")",
";",
"// Update/Render if exist",
"if",
"(",
"i... | SlideController ----------------------- | [
"SlideController",
"-----------------------"
] | train | https://github.com/foxslider/cmg-plugin/blob/843f723ebb512ab833feff581beb9714df4e41bd/admin/controllers/apix/SlideController.php#L98-L128 |
shgysk8zer0/core_api | traits/xmlappend.php | XMLAppend.XMLAppend | protected function XMLAppend(\DOMNode &$parent = null, $content = null)
{
if (is_null($parent)) {
$parent = $this->root;
}
if (
is_string($content)
or is_numeric($content)
or (is_object($content) and method_exists($content, '__toString'))
) {
$parent->appendChild($this->createTextNode("$content"... | php | protected function XMLAppend(\DOMNode &$parent = null, $content = null)
{
if (is_null($parent)) {
$parent = $this->root;
}
if (
is_string($content)
or is_numeric($content)
or (is_object($content) and method_exists($content, '__toString'))
) {
$parent->appendChild($this->createTextNode("$content"... | [
"protected",
"function",
"XMLAppend",
"(",
"\\",
"DOMNode",
"&",
"$",
"parent",
"=",
"null",
",",
"$",
"content",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"parent",
")",
")",
"{",
"$",
"parent",
"=",
"$",
"this",
"->",
"root",
";",
... | Append any supported $content to $parent
@param DOMNode $parent Node to append to
@param mixed $content Content to append
@return self | [
"Append",
"any",
"supported",
"$content",
"to",
"$parent"
] | train | https://github.com/shgysk8zer0/core_api/blob/9e9b8baf761af874b95256ad2462e55fbb2b2e58/traits/xmlappend.php#L36-L94 |
nguyenanhung/image | src/ImageCache.php | ImageCache.setTmpPath | public function setTmpPath($tmpPath = '')
{
if (empty($tmpPath)) {
$tmpPath = __DIR__ . '/../storage/tmp/';
}
$this->tmpPath = $tmpPath;
return $this;
} | php | public function setTmpPath($tmpPath = '')
{
if (empty($tmpPath)) {
$tmpPath = __DIR__ . '/../storage/tmp/';
}
$this->tmpPath = $tmpPath;
return $this;
} | [
"public",
"function",
"setTmpPath",
"(",
"$",
"tmpPath",
"=",
"''",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"tmpPath",
")",
")",
"{",
"$",
"tmpPath",
"=",
"__DIR__",
".",
"'/../storage/tmp/'",
";",
"}",
"$",
"this",
"->",
"tmpPath",
"=",
"$",
"tmpPat... | Cấu hình thư mục lưu trữ file Cache Image
@author: 713uk13m <dev@nguyenanhung.com>
@time : 11/1/18 14:21
@param string $tmpPath Thư mục cần lưu trữ
@return $this | [
"Cấu",
"hình",
"thư",
"mục",
"lưu",
"trữ",
"file",
"Cache",
"Image"
] | train | https://github.com/nguyenanhung/image/blob/5d30dfa203c0411209b8985ab4a86a6be9a7b2d1/src/ImageCache.php#L64-L72 |
nguyenanhung/image | src/ImageCache.php | ImageCache.setDefaultImage | public function setDefaultImage($defaultImage = '')
{
if (empty($defaultImage)) {
$image = DataRepository::getData('config_image');
$defaultImage = $image['default_image'];
}
$this->defaultImage = $defaultImage;
return $this;
} | php | public function setDefaultImage($defaultImage = '')
{
if (empty($defaultImage)) {
$image = DataRepository::getData('config_image');
$defaultImage = $image['default_image'];
}
$this->defaultImage = $defaultImage;
return $this;
} | [
"public",
"function",
"setDefaultImage",
"(",
"$",
"defaultImage",
"=",
"''",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"defaultImage",
")",
")",
"{",
"$",
"image",
"=",
"DataRepository",
"::",
"getData",
"(",
"'config_image'",
")",
";",
"$",
"defaultImage",... | Cấu hình đường dẫn link ảnh mặc định
@author: 713uk13m <dev@nguyenanhung.com>
@time : 11/1/18 15:40
@param string $defaultImage Đường dẫn link ảnh mặc định
@return $this | [
"Cấu",
"hình",
"đường",
"dẫn",
"link",
"ảnh",
"mặc",
"định"
] | train | https://github.com/nguyenanhung/image/blob/5d30dfa203c0411209b8985ab4a86a6be9a7b2d1/src/ImageCache.php#L101-L110 |
nguyenanhung/image | src/ImageCache.php | ImageCache.saveImage | public function saveImage($url = '', $format = 'png')
{
$image = DataRepository::getData('config_image');
$defaultImage = $image['default_image'];
try {
Utils::debug('URL: ' . $url);
Utils::debug('Format: ' . $format);
try {
// Xác đ... | php | public function saveImage($url = '', $format = 'png')
{
$image = DataRepository::getData('config_image');
$defaultImage = $image['default_image'];
try {
Utils::debug('URL: ' . $url);
Utils::debug('Format: ' . $format);
try {
// Xác đ... | [
"public",
"function",
"saveImage",
"(",
"$",
"url",
"=",
"''",
",",
"$",
"format",
"=",
"'png'",
")",
"{",
"$",
"image",
"=",
"DataRepository",
"::",
"getData",
"(",
"'config_image'",
")",
";",
"$",
"defaultImage",
"=",
"$",
"image",
"[",
"'default_image... | Hàm cache Image và save về server
@author: 713uk13m <dev@nguyenanhung.com>
@time : 11/7/18 09:10
@param string $url Đường dẫn hoặc URL hình ảnh
@param string $format Format đầu ra
@return null|string Đường dẫn link tới hình ảnh được cache | [
"Hàm",
"cache",
"Image",
"và",
"save",
"về",
"server"
] | train | https://github.com/nguyenanhung/image/blob/5d30dfa203c0411209b8985ab4a86a6be9a7b2d1/src/ImageCache.php#L203-L265 |
pdyn/httpclient | HttpClientResponse.php | HttpClientResponse.instance_from_curl | public static function instance_from_curl($ch, $body) {
$transfer_info = curl_getinfo($ch);
$statuscode = (!empty($transfer_info['http_code'])) ? (int)$transfer_info['http_code'] : 404;
$errors = [];
$err = static::decode_error_code(curl_errno($ch));
if ($err !== 'SUCCESS') {
$errors[] = $err;
}
$mim... | php | public static function instance_from_curl($ch, $body) {
$transfer_info = curl_getinfo($ch);
$statuscode = (!empty($transfer_info['http_code'])) ? (int)$transfer_info['http_code'] : 404;
$errors = [];
$err = static::decode_error_code(curl_errno($ch));
if ($err !== 'SUCCESS') {
$errors[] = $err;
}
$mim... | [
"public",
"static",
"function",
"instance_from_curl",
"(",
"$",
"ch",
",",
"$",
"body",
")",
"{",
"$",
"transfer_info",
"=",
"curl_getinfo",
"(",
"$",
"ch",
")",
";",
"$",
"statuscode",
"=",
"(",
"!",
"empty",
"(",
"$",
"transfer_info",
"[",
"'http_code'... | Create an instance from a curl handle and body.
@param resource $ch An active curl handle.
@param string $body The returned body.
@return HttpClientResponse A response object. | [
"Create",
"an",
"instance",
"from",
"a",
"curl",
"handle",
"and",
"body",
"."
] | train | https://github.com/pdyn/httpclient/blob/9714796945db4908605be6f19c31ded1ee813c70/HttpClientResponse.php#L77-L90 |
pdyn/httpclient | HttpClientResponse.php | HttpClientResponse.get_debug_string | public function get_debug_string() {
return 'status: '.$this->statuscode.' body:'.htmlentities($this->body).' errors: '.print_r($this->errors, true);
} | php | public function get_debug_string() {
return 'status: '.$this->statuscode.' body:'.htmlentities($this->body).' errors: '.print_r($this->errors, true);
} | [
"public",
"function",
"get_debug_string",
"(",
")",
"{",
"return",
"'status: '",
".",
"$",
"this",
"->",
"statuscode",
".",
"' body:'",
".",
"htmlentities",
"(",
"$",
"this",
"->",
"body",
")",
".",
"' errors: '",
".",
"print_r",
"(",
"$",
"this",
"->",
... | Get a string with some basic information about the request. Usually put into the logs.
@return string A string containing debug information. | [
"Get",
"a",
"string",
"with",
"some",
"basic",
"information",
"about",
"the",
"request",
".",
"Usually",
"put",
"into",
"the",
"logs",
"."
] | train | https://github.com/pdyn/httpclient/blob/9714796945db4908605be6f19c31ded1ee813c70/HttpClientResponse.php#L106-L108 |
pdyn/httpclient | HttpClientResponse.php | HttpClientResponse.status_type | public function status_type() {
$status_code_type = (!empty($this->statuscode))
? (int)mb_substr($this->statuscode, 0, 1)
: 0;
if ($status_code_type === 1) {
$status_type = 'informational';
} elseif ($status_code_type === 2) {
$status_type = 'success';
} elseif ($status_code_type === 3) {
$statu... | php | public function status_type() {
$status_code_type = (!empty($this->statuscode))
? (int)mb_substr($this->statuscode, 0, 1)
: 0;
if ($status_code_type === 1) {
$status_type = 'informational';
} elseif ($status_code_type === 2) {
$status_type = 'success';
} elseif ($status_code_type === 3) {
$statu... | [
"public",
"function",
"status_type",
"(",
")",
"{",
"$",
"status_code_type",
"=",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"statuscode",
")",
")",
"?",
"(",
"int",
")",
"mb_substr",
"(",
"$",
"this",
"->",
"statuscode",
",",
"0",
",",
"1",
")",
"... | Get the status type.
@return string The status type. | [
"Get",
"the",
"status",
"type",
"."
] | train | https://github.com/pdyn/httpclient/blob/9714796945db4908605be6f19c31ded1ee813c70/HttpClientResponse.php#L115-L134 |
DavidePastore/paris-model-generator | src/DavidePastore/ParisModelGenerator/ParisGeneratorCommand.php | ParisGeneratorCommand.execute | protected function execute(InputInterface $input, OutputInterface $output)
{
$this->input = $input;
$this->output = $output;
$this->force = $input->getOption('force');
$helper = $this->getHelper('question');
$userQuestion = new Question('User (root): ', 'root');
$passwordQuestion = ... | php | protected function execute(InputInterface $input, OutputInterface $output)
{
$this->input = $input;
$this->output = $output;
$this->force = $input->getOption('force');
$helper = $this->getHelper('question');
$userQuestion = new Question('User (root): ', 'root');
$passwordQuestion = ... | [
"protected",
"function",
"execute",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"this",
"->",
"input",
"=",
"$",
"input",
";",
"$",
"this",
"->",
"output",
"=",
"$",
"output",
";",
"$",
"this",
"->",
"forc... | (non-PHPdoc)
@see \Symfony\Component\Console\Command\Command::execute() | [
"(",
"non",
"-",
"PHPdoc",
")"
] | train | https://github.com/DavidePastore/paris-model-generator/blob/cd056dd7a2218b1c56fa17dcc6311e01a2570030/src/DavidePastore/ParisModelGenerator/ParisGeneratorCommand.php#L74-L179 |
DavidePastore/paris-model-generator | src/DavidePastore/ParisModelGenerator/ParisGeneratorCommand.php | ParisGeneratorCommand.generateCode | private function generateCode($className, $primaryKey){
$tags = $this->config->getTags();
$class = new ClassGenerator();
$docblock = DocBlockGenerator::fromArray(array(
'shortDescription' => ucfirst($className) .' model class',
'longDescription' => 'This is a model class generated with DavidePastore\... | php | private function generateCode($className, $primaryKey){
$tags = $this->config->getTags();
$class = new ClassGenerator();
$docblock = DocBlockGenerator::fromArray(array(
'shortDescription' => ucfirst($className) .' model class',
'longDescription' => 'This is a model class generated with DavidePastore\... | [
"private",
"function",
"generateCode",
"(",
"$",
"className",
",",
"$",
"primaryKey",
")",
"{",
"$",
"tags",
"=",
"$",
"this",
"->",
"config",
"->",
"getTags",
"(",
")",
";",
"$",
"class",
"=",
"new",
"ClassGenerator",
"(",
")",
";",
"$",
"docblock",
... | Generate the code for the given className and primaryKey and write it in a file.
@param string $className The class name.
@param string $primaryKey The primary key. | [
"Generate",
"the",
"code",
"for",
"the",
"given",
"className",
"and",
"primaryKey",
"and",
"write",
"it",
"in",
"a",
"file",
"."
] | train | https://github.com/DavidePastore/paris-model-generator/blob/cd056dd7a2218b1c56fa17dcc6311e01a2570030/src/DavidePastore/ParisModelGenerator/ParisGeneratorCommand.php#L204-L282 |
canis-io/yii2-canis-composer | src/templates/advanced/app/models/User.php | User.systemUser | public static function systemUser()
{
$user = self::findOne([self::tableName().'.'.'email' => self::SYSTEM_EMAIL], false);
if (empty($user)) {
$superGroup = Group::find()->disableAccessCheck()->where(['system' => 'super_administrators'])->one();
if (!$superGroup) {
... | php | public static function systemUser()
{
$user = self::findOne([self::tableName().'.'.'email' => self::SYSTEM_EMAIL], false);
if (empty($user)) {
$superGroup = Group::find()->disableAccessCheck()->where(['system' => 'super_administrators'])->one();
if (!$superGroup) {
... | [
"public",
"static",
"function",
"systemUser",
"(",
")",
"{",
"$",
"user",
"=",
"self",
"::",
"findOne",
"(",
"[",
"self",
"::",
"tableName",
"(",
")",
".",
"'.'",
".",
"'email'",
"=>",
"self",
"::",
"SYSTEM_EMAIL",
"]",
",",
"false",
")",
";",
"if",
... | __method_systemUser_description__
@return __return_systemUser_type__ __return_systemUser_description__
@throws Exception __exception_Exception_description__ | [
"__method_systemUser_description__"
] | train | https://github.com/canis-io/yii2-canis-composer/blob/18f19859249c4905fbee8a7ba873025fb35a7c28/src/templates/advanced/app/models/User.php#L32-L57 |
ScaraMVC/Framework | src/Scara/Session/Cookie.php | Cookie.set | public function set($key, $value, $expire = 3600, $path = '/')
{
if ($expire == false) {
setcookie($key, serialize($value), false, $path);
} else {
setcookie($key, serialize($value), time() + $expire, $path);
}
} | php | public function set($key, $value, $expire = 3600, $path = '/')
{
if ($expire == false) {
setcookie($key, serialize($value), false, $path);
} else {
setcookie($key, serialize($value), time() + $expire, $path);
}
} | [
"public",
"function",
"set",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"expire",
"=",
"3600",
",",
"$",
"path",
"=",
"'/'",
")",
"{",
"if",
"(",
"$",
"expire",
"==",
"false",
")",
"{",
"setcookie",
"(",
"$",
"key",
",",
"serialize",
"(",
"$... | Adds to the session.
@param string $key - Key given to session
@param string $value - Value given to session's $key
@param mixed $expire - Sets expiration of cookie
@param stirng $path - The path the cookie should be set to
@return mixed | [
"Adds",
"to",
"the",
"session",
"."
] | train | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Session/Cookie.php#L32-L39 |
ScaraMVC/Framework | src/Scara/Session/Cookie.php | Cookie.delete | public function delete($key)
{
if ($this->has($key)) {
unset($_COOKIE[$key]);
setcookie($key, '', time() - 3600, '/');
}
} | php | public function delete($key)
{
if ($this->has($key)) {
unset($_COOKIE[$key]);
setcookie($key, '', time() - 3600, '/');
}
} | [
"public",
"function",
"delete",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"has",
"(",
"$",
"key",
")",
")",
"{",
"unset",
"(",
"$",
"_COOKIE",
"[",
"$",
"key",
"]",
")",
";",
"setcookie",
"(",
"$",
"key",
",",
"''",
",",
"time"... | {@inheritdoc} | [
"{"
] | train | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Session/Cookie.php#L52-L58 |
ScaraMVC/Framework | src/Scara/Session/Cookie.php | Cookie.flash | public function flash($key, $value = '')
{
if (!empty($value)) {
$this->set($key, $value, false);
} else {
if ($this->has($key)) {
$s = $this->get($key);
$this->delete($key);
return $s;
}
}
} | php | public function flash($key, $value = '')
{
if (!empty($value)) {
$this->set($key, $value, false);
} else {
if ($this->has($key)) {
$s = $this->get($key);
$this->delete($key);
return $s;
}
}
} | [
"public",
"function",
"flash",
"(",
"$",
"key",
",",
"$",
"value",
"=",
"''",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"value",
")",
")",
"{",
"$",
"this",
"->",
"set",
"(",
"$",
"key",
",",
"$",
"value",
",",
"false",
")",
";",
"}",
"e... | {@inheritdoc} | [
"{"
] | train | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Session/Cookie.php#L63-L75 |
wb-crowdfusion/crowdfusion | system/core/classes/nodedb/daos/NodeMetaDAO.php | NodeMetaDAO.incrementMeta | public function incrementMeta(NodeRef $nodeRef, $metaID, $value = 1)
{
$metaID = ltrim($metaID, '#');
$this->NodeEvents->fireNodeEvents(__FUNCTION__, '', $nodeRef, $metaID);
$db = $this->getConnectionForWrite($nodeRef);
$id = $this->getRecordIDFromNodeRef($nodeRef);
// det... | php | public function incrementMeta(NodeRef $nodeRef, $metaID, $value = 1)
{
$metaID = ltrim($metaID, '#');
$this->NodeEvents->fireNodeEvents(__FUNCTION__, '', $nodeRef, $metaID);
$db = $this->getConnectionForWrite($nodeRef);
$id = $this->getRecordIDFromNodeRef($nodeRef);
// det... | [
"public",
"function",
"incrementMeta",
"(",
"NodeRef",
"$",
"nodeRef",
",",
"$",
"metaID",
",",
"$",
"value",
"=",
"1",
")",
"{",
"$",
"metaID",
"=",
"ltrim",
"(",
"$",
"metaID",
",",
"'#'",
")",
";",
"$",
"this",
"->",
"NodeEvents",
"->",
"fireNodeE... | @param NodeRef $nodeRef
@param $metaID
@param int $value
@throws NodeException
@throws SQLException
@throws Exception | [
"@param",
"NodeRef",
"$nodeRef",
"@param",
"$metaID",
"@param",
"int",
"$value"
] | train | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/nodedb/daos/NodeMetaDAO.php#L526-L629 |
spryker/shopping-list-data-import | src/Spryker/Zed/ShoppingListDataImport/Business/ShoppingListDataImportStep/CompanyUserKeyToIdCompanyUserStep.php | CompanyUserKeyToIdCompanyUserStep.execute | public function execute(DataSetInterface $dataSet): void
{
$companyUserKey = $dataSet[ShoppingListCompanyUserDataSetInterface::COLUMN_COMPANY_USER_KEY];
if (!isset($this->idCompanyUserCache[$companyUserKey])) {
$companyUserQuery = new SpyCompanyUserQuery();
$idCompanyUser = $... | php | public function execute(DataSetInterface $dataSet): void
{
$companyUserKey = $dataSet[ShoppingListCompanyUserDataSetInterface::COLUMN_COMPANY_USER_KEY];
if (!isset($this->idCompanyUserCache[$companyUserKey])) {
$companyUserQuery = new SpyCompanyUserQuery();
$idCompanyUser = $... | [
"public",
"function",
"execute",
"(",
"DataSetInterface",
"$",
"dataSet",
")",
":",
"void",
"{",
"$",
"companyUserKey",
"=",
"$",
"dataSet",
"[",
"ShoppingListCompanyUserDataSetInterface",
"::",
"COLUMN_COMPANY_USER_KEY",
"]",
";",
"if",
"(",
"!",
"isset",
"(",
... | @param \Spryker\Zed\DataImport\Business\Model\DataSet\DataSetInterface $dataSet
@throws \Spryker\Zed\DataImport\Business\Exception\EntityNotFoundException
@return void | [
"@param",
"\\",
"Spryker",
"\\",
"Zed",
"\\",
"DataImport",
"\\",
"Business",
"\\",
"Model",
"\\",
"DataSet",
"\\",
"DataSetInterface",
"$dataSet"
] | train | https://github.com/spryker/shopping-list-data-import/blob/6313fc39e8ee79a08f7b97d81da7f4056c066674/src/Spryker/Zed/ShoppingListDataImport/Business/ShoppingListDataImportStep/CompanyUserKeyToIdCompanyUserStep.php#L31-L48 |
graze/data-node | src/NodeCollection.php | NodeCollection.apply | public function apply(callable $fn)
{
foreach ($this->items as &$item) {
$out = call_user_func($fn, $item);
if (isset($out) && ($out instanceof NodeInterface)) {
$item = $out;
}
}
return $this;
} | php | public function apply(callable $fn)
{
foreach ($this->items as &$item) {
$out = call_user_func($fn, $item);
if (isset($out) && ($out instanceof NodeInterface)) {
$item = $out;
}
}
return $this;
} | [
"public",
"function",
"apply",
"(",
"callable",
"$",
"fn",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"items",
"as",
"&",
"$",
"item",
")",
"{",
"$",
"out",
"=",
"call_user_func",
"(",
"$",
"fn",
",",
"$",
"item",
")",
";",
"if",
"(",
"isset",
... | @param callable $fn
@return $this | [
"@param",
"callable",
"$fn"
] | train | https://github.com/graze/data-node/blob/e604d8062b1e18046f23c6dc20341b368e88697e/src/NodeCollection.php#L46-L56 |
graze/data-node | src/NodeCollection.php | NodeCollection.first | public function first(callable $fn = null, $default = null)
{
if (is_null($fn)) {
return count($this->items) > 0 ? reset($this->items) : $default;
}
foreach ($this->getIterator() as $value) {
if (call_user_func($fn, $value)) {
return $value;
... | php | public function first(callable $fn = null, $default = null)
{
if (is_null($fn)) {
return count($this->items) > 0 ? reset($this->items) : $default;
}
foreach ($this->getIterator() as $value) {
if (call_user_func($fn, $value)) {
return $value;
... | [
"public",
"function",
"first",
"(",
"callable",
"$",
"fn",
"=",
"null",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"fn",
")",
")",
"{",
"return",
"count",
"(",
"$",
"this",
"->",
"items",
")",
">",
"0",
"?",
"re... | Retrieve the first element that matches the optional callback
@param callable|null $fn
@param mixed|null $default
@return mixed|null | [
"Retrieve",
"the",
"first",
"element",
"that",
"matches",
"the",
"optional",
"callback"
] | train | https://github.com/graze/data-node/blob/e604d8062b1e18046f23c6dc20341b368e88697e/src/NodeCollection.php#L92-L105 |
graze/data-node | src/NodeCollection.php | NodeCollection.last | public function last(callable $fn = null, $default = null)
{
if (is_null($fn)) {
return count($this->items) > 0 ? end($this->items) : $default;
}
foreach (array_reverse($this->items) as $value) {
if (call_user_func($fn, $value)) {
return $value;
... | php | public function last(callable $fn = null, $default = null)
{
if (is_null($fn)) {
return count($this->items) > 0 ? end($this->items) : $default;
}
foreach (array_reverse($this->items) as $value) {
if (call_user_func($fn, $value)) {
return $value;
... | [
"public",
"function",
"last",
"(",
"callable",
"$",
"fn",
"=",
"null",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"fn",
")",
")",
"{",
"return",
"count",
"(",
"$",
"this",
"->",
"items",
")",
">",
"0",
"?",
"end... | Receive the last element that matches the optional callback
@param callable|null $fn
@param mixed|null $default
@return mixed|null | [
"Receive",
"the",
"last",
"element",
"that",
"matches",
"the",
"optional",
"callback"
] | train | https://github.com/graze/data-node/blob/e604d8062b1e18046f23c6dc20341b368e88697e/src/NodeCollection.php#L115-L128 |
Kris-Kuiper/sFire-Framework | src/Validator/File/Rules/Minwidth.php | Minwidth.isValid | public function isValid() {
$params = $this -> getParameters();
$file = $this -> getFile();
if(false === isset($params[0])) {
return trigger_error(sprintf('Missing argument 1 for %s', __METHOD__), E_USER_ERROR);
}
if(false === ('-' . intval($params[0]) == '-' . $params[0])) {
return trig... | php | public function isValid() {
$params = $this -> getParameters();
$file = $this -> getFile();
if(false === isset($params[0])) {
return trigger_error(sprintf('Missing argument 1 for %s', __METHOD__), E_USER_ERROR);
}
if(false === ('-' . intval($params[0]) == '-' . $params[0])) {
return trig... | [
"public",
"function",
"isValid",
"(",
")",
"{",
"$",
"params",
"=",
"$",
"this",
"->",
"getParameters",
"(",
")",
";",
"$",
"file",
"=",
"$",
"this",
"->",
"getFile",
"(",
")",
";",
"if",
"(",
"false",
"===",
"isset",
"(",
"$",
"params",
"[",
"0"... | Check if rule passes
@return boolean | [
"Check",
"if",
"rule",
"passes"
] | train | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Validator/File/Rules/Minwidth.php#L33-L56 |
tdebatty/php-noorm | src/noorm/Persistent.php | Persistent.One | public static function One($id) {
$class = get_called_class();
if (! isset(self::$refs[$class][$id])) {
$file = self::File($id);
$obj = unserialize(file_get_contents($file));
self::$refs[$class][$id] = $obj;
}
return self::$refs[$class][$id];
} | php | public static function One($id) {
$class = get_called_class();
if (! isset(self::$refs[$class][$id])) {
$file = self::File($id);
$obj = unserialize(file_get_contents($file));
self::$refs[$class][$id] = $obj;
}
return self::$refs[$class][$id];
} | [
"public",
"static",
"function",
"One",
"(",
"$",
"id",
")",
"{",
"$",
"class",
"=",
"get_called_class",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"refs",
"[",
"$",
"class",
"]",
"[",
"$",
"id",
"]",
")",
")",
"{",
"$",
"... | Fetch one saved object by id
@param int $id
@return Persistent | [
"Fetch",
"one",
"saved",
"object",
"by",
"id"
] | train | https://github.com/tdebatty/php-noorm/blob/ba33e2f0efaed71693c3013e73315d3c019d7f05/src/noorm/Persistent.php#L59-L69 |
tdebatty/php-noorm | src/noorm/Persistent.php | Persistent.SetDirectory | public static function SetDirectory($dir) {
if (!is_dir($dir)) {
if (!@\mkdir($dir, 0700, TRUE)) {
throw new \InvalidArgumentException("dir $dir does not exist and could not be created");
}
}
self::$DIR = realpath($dir);
} | php | public static function SetDirectory($dir) {
if (!is_dir($dir)) {
if (!@\mkdir($dir, 0700, TRUE)) {
throw new \InvalidArgumentException("dir $dir does not exist and could not be created");
}
}
self::$DIR = realpath($dir);
} | [
"public",
"static",
"function",
"SetDirectory",
"(",
"$",
"dir",
")",
"{",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"dir",
")",
")",
"{",
"if",
"(",
"!",
"@",
"\\",
"mkdir",
"(",
"$",
"dir",
",",
"0700",
",",
"TRUE",
")",
")",
"{",
"throw",
"new",
... | Set directory where all persistent objects and relations will be saved.
@param String $dir
@throws \InvalidArgumentException | [
"Set",
"directory",
"where",
"all",
"persistent",
"objects",
"and",
"relations",
"will",
"be",
"saved",
"."
] | train | https://github.com/tdebatty/php-noorm/blob/ba33e2f0efaed71693c3013e73315d3c019d7f05/src/noorm/Persistent.php#L95-L103 |
tdebatty/php-noorm | src/noorm/Persistent.php | Persistent.Save | public function Save() {
if (!$this->Validate()) {
throw new \Exception("Validation failed");
}
$file = self::File($this->id);
if (!is_dir(dirname($file))) {
mkdir(dirname($file), 0755, true);
}
file_put_contents($file, serialize($this), LOCK_EX);
return $this;
} | php | public function Save() {
if (!$this->Validate()) {
throw new \Exception("Validation failed");
}
$file = self::File($this->id);
if (!is_dir(dirname($file))) {
mkdir(dirname($file), 0755, true);
}
file_put_contents($file, serialize($this), LOCK_EX);
return $this;
} | [
"public",
"function",
"Save",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"Validate",
"(",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"\"Validation failed\"",
")",
";",
"}",
"$",
"file",
"=",
"self",
"::",
"File",
"(",
"$",
"this"... | Save this object.
@return boolean true on success | [
"Save",
"this",
"object",
"."
] | train | https://github.com/tdebatty/php-noorm/blob/ba33e2f0efaed71693c3013e73315d3c019d7f05/src/noorm/Persistent.php#L187-L199 |
Topolis/Filter | src/Types/StripFilter.php | StripFilter.filter | public function filter($value) {
if($value === null && $this->options["preserve_null"] )
return null;
return strip_tags($value, $this->options["allowable_tags"]);
} | php | public function filter($value) {
if($value === null && $this->options["preserve_null"] )
return null;
return strip_tags($value, $this->options["allowable_tags"]);
} | [
"public",
"function",
"filter",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"===",
"null",
"&&",
"$",
"this",
"->",
"options",
"[",
"\"preserve_null\"",
"]",
")",
"return",
"null",
";",
"return",
"strip_tags",
"(",
"$",
"value",
",",
"$",
"... | execute the filter on a value
@param mixed $value
@return mixed | [
"execute",
"the",
"filter",
"on",
"a",
"value"
] | train | https://github.com/Topolis/Filter/blob/6208a6270490c39f028248dc99f21b3e816e388b/src/Types/StripFilter.php#L44-L50 |
Innmind/Compose | src/Definition/Service/Argument/Primitive.php | Primitive.resolve | public function resolve(
StreamInterface $built,
Services $services
): StreamInterface {
return $built->add($this->value);
} | php | public function resolve(
StreamInterface $built,
Services $services
): StreamInterface {
return $built->add($this->value);
} | [
"public",
"function",
"resolve",
"(",
"StreamInterface",
"$",
"built",
",",
"Services",
"$",
"services",
")",
":",
"StreamInterface",
"{",
"return",
"$",
"built",
"->",
"add",
"(",
"$",
"this",
"->",
"value",
")",
";",
"}"
] | {@inheritdoc} | [
"{"
] | train | https://github.com/Innmind/Compose/blob/1a833d7ba2f6248e9c472c00cd7aca041c1a2ba9/src/Definition/Service/Argument/Primitive.php#L35-L40 |
NukaCode/core | src/NukaCode/Core/View/Path.php | Path.getPrefixName | protected function getPrefixName($method)
{
$prefix = $this->route->getCurrentRoute()->getPrefix();
$prefix = str_replace('/', '.', $prefix);
$prefix = preg_replace('/\b\.' . $method . '\b/', '', $prefix);
$prefix = preg_replace('/\b' . $method . '\.\b/', '', $prefix);
retur... | php | protected function getPrefixName($method)
{
$prefix = $this->route->getCurrentRoute()->getPrefix();
$prefix = str_replace('/', '.', $prefix);
$prefix = preg_replace('/\b\.' . $method . '\b/', '', $prefix);
$prefix = preg_replace('/\b' . $method . '\.\b/', '', $prefix);
retur... | [
"protected",
"function",
"getPrefixName",
"(",
"$",
"method",
")",
"{",
"$",
"prefix",
"=",
"$",
"this",
"->",
"route",
"->",
"getCurrentRoute",
"(",
")",
"->",
"getPrefix",
"(",
")",
";",
"$",
"prefix",
"=",
"str_replace",
"(",
"'/'",
",",
"'.'",
",",... | @param string $method
@return string | [
"@param",
"string",
"$method"
] | train | https://github.com/NukaCode/core/blob/75b20903fb068a7df22cdec34ae729279fbaab3c/src/NukaCode/Core/View/Path.php#L111-L119 |
t3v/t3v_core | Classes/Utility/ExtensionUtility.php | ExtensionUtility.extensionIdentifier | public static function extensionIdentifier(string $extensionKey): string {
$extensionIdentifier = GeneralUtility::underscoredToUpperCamelCase($extensionKey);
$extensionIdentifier = mb_strtolower($extensionIdentifier);
return $extensionIdentifier;
} | php | public static function extensionIdentifier(string $extensionKey): string {
$extensionIdentifier = GeneralUtility::underscoredToUpperCamelCase($extensionKey);
$extensionIdentifier = mb_strtolower($extensionIdentifier);
return $extensionIdentifier;
} | [
"public",
"static",
"function",
"extensionIdentifier",
"(",
"string",
"$",
"extensionKey",
")",
":",
"string",
"{",
"$",
"extensionIdentifier",
"=",
"GeneralUtility",
"::",
"underscoredToUpperCamelCase",
"(",
"$",
"extensionKey",
")",
";",
"$",
"extensionIdentifier",
... | Gets an extension identifier from an extension key.
@param string $extensionKey The extension key
@return string The extension identifier | [
"Gets",
"an",
"extension",
"identifier",
"from",
"an",
"extension",
"key",
"."
] | train | https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/Utility/ExtensionUtility.php#L18-L23 |
t3v/t3v_core | Classes/Utility/ExtensionUtility.php | ExtensionUtility.extensionSignature | public static function extensionSignature(string $namespace, string $extensionKey, string $separator = '.'): string {
$namespace = GeneralUtility::underscoredToUpperCamelCase($namespace);
$extensionKey = GeneralUtility::underscoredToUpperCamelCase($extensionKey);
return "${namespace}${separator}${extens... | php | public static function extensionSignature(string $namespace, string $extensionKey, string $separator = '.'): string {
$namespace = GeneralUtility::underscoredToUpperCamelCase($namespace);
$extensionKey = GeneralUtility::underscoredToUpperCamelCase($extensionKey);
return "${namespace}${separator}${extens... | [
"public",
"static",
"function",
"extensionSignature",
"(",
"string",
"$",
"namespace",
",",
"string",
"$",
"extensionKey",
",",
"string",
"$",
"separator",
"=",
"'.'",
")",
":",
"string",
"{",
"$",
"namespace",
"=",
"GeneralUtility",
"::",
"underscoredToUpperCam... | Gets an extension signature from a namespace and extension key.
@param string $namespace The namespace
@param string $extensionKey The extension key
@param string $separator The optional separator, defaults to `.`
@return string The extension signature | [
"Gets",
"an",
"extension",
"signature",
"from",
"a",
"namespace",
"and",
"extension",
"key",
"."
] | train | https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/Utility/ExtensionUtility.php#L43-L48 |
t3v/t3v_core | Classes/Utility/ExtensionUtility.php | ExtensionUtility.getExtensionSignature | public static function getExtensionSignature(string $namespace, string $extensionKey, string $separator = '.'): string {
return self::extensionSignature($namespace, $extensionKey, $separator);
} | php | public static function getExtensionSignature(string $namespace, string $extensionKey, string $separator = '.'): string {
return self::extensionSignature($namespace, $extensionKey, $separator);
} | [
"public",
"static",
"function",
"getExtensionSignature",
"(",
"string",
"$",
"namespace",
",",
"string",
"$",
"extensionKey",
",",
"string",
"$",
"separator",
"=",
"'.'",
")",
":",
"string",
"{",
"return",
"self",
"::",
"extensionSignature",
"(",
"$",
"namespa... | Alias for the `extensionSignature` function.
@param string $namespace The namespace
@param string $extensionKey The extension key
@param string $separator The optional separator, defaults to `.`
@return string The extension signature | [
"Alias",
"for",
"the",
"extensionSignature",
"function",
"."
] | train | https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/Utility/ExtensionUtility.php#L58-L60 |
t3v/t3v_core | Classes/Utility/ExtensionUtility.php | ExtensionUtility.locallang | public static function locallang(string $extensionKey, string $fileName = 'locallang.xlf', string $prefix = 'LLL:EXT:', string $separator = ':'): string {
$languageFolder = self::languageFolder($extensionKey, $prefix);
return "${languageFolder}/${fileName}${separator}";
} | php | public static function locallang(string $extensionKey, string $fileName = 'locallang.xlf', string $prefix = 'LLL:EXT:', string $separator = ':'): string {
$languageFolder = self::languageFolder($extensionKey, $prefix);
return "${languageFolder}/${fileName}${separator}";
} | [
"public",
"static",
"function",
"locallang",
"(",
"string",
"$",
"extensionKey",
",",
"string",
"$",
"fileName",
"=",
"'locallang.xlf'",
",",
"string",
"$",
"prefix",
"=",
"'LLL:EXT:'",
",",
"string",
"$",
"separator",
"=",
"':'",
")",
":",
"string",
"{",
... | Gets the locallang file from an extension key.
@param string $extensionKey The extension key
@param string $prefix The optional file name of the locallang file, defaults to `locallang.xlf`
@param string $prefix The optional prefix, defaults to `LLL:EXT:`
@param string $separator The optional separator, defaults to `:`... | [
"Gets",
"the",
"locallang",
"file",
"from",
"an",
"extension",
"key",
"."
] | train | https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/Utility/ExtensionUtility.php#L71-L75 |
t3v/t3v_core | Classes/Utility/ExtensionUtility.php | ExtensionUtility.getLocallang | public static function getLocallang(string $extensionKey, string $fileName = 'locallang.xlf', string $prefix = 'LLL:EXT:', string $separator = ':'): string {
return self::locallang($extensionKey, $fileName, $prefix, $separator);
} | php | public static function getLocallang(string $extensionKey, string $fileName = 'locallang.xlf', string $prefix = 'LLL:EXT:', string $separator = ':'): string {
return self::locallang($extensionKey, $fileName, $prefix, $separator);
} | [
"public",
"static",
"function",
"getLocallang",
"(",
"string",
"$",
"extensionKey",
",",
"string",
"$",
"fileName",
"=",
"'locallang.xlf'",
",",
"string",
"$",
"prefix",
"=",
"'LLL:EXT:'",
",",
"string",
"$",
"separator",
"=",
"':'",
")",
":",
"string",
"{",... | Alias for the `locallang` function.
@param string $extensionKey The extension key
@param string $prefix The optional file name of the locallang file, defaults to `locallang.xlf`
@param string $prefix The optional prefix, defaults to `LLL:EXT:`
@param string $separator The optional separator, defaults to `:`
@return st... | [
"Alias",
"for",
"the",
"locallang",
"function",
"."
] | train | https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/Utility/ExtensionUtility.php#L86-L88 |
t3v/t3v_core | Classes/Utility/ExtensionUtility.php | ExtensionUtility.lll | public static function lll(string $extensionKey, string $fileName = 'locallang.xlf', string $prefix = 'LLL:EXT:', string $separator = ':'): string {
return self::locallang($extensionKey, $fileName, $prefix, $separator);
} | php | public static function lll(string $extensionKey, string $fileName = 'locallang.xlf', string $prefix = 'LLL:EXT:', string $separator = ':'): string {
return self::locallang($extensionKey, $fileName, $prefix, $separator);
} | [
"public",
"static",
"function",
"lll",
"(",
"string",
"$",
"extensionKey",
",",
"string",
"$",
"fileName",
"=",
"'locallang.xlf'",
",",
"string",
"$",
"prefix",
"=",
"'LLL:EXT:'",
",",
"string",
"$",
"separator",
"=",
"':'",
")",
":",
"string",
"{",
"retur... | Alias for the `locallang` function.
@param string $extensionKey The extension key
@param string $prefix The optional file name of the locallang file, defaults to `locallang.xlf`
@param string $prefix The optional prefix, defaults to `LLL:EXT:`
@param string $separator The optional separator, defaults to `:`
@return st... | [
"Alias",
"for",
"the",
"locallang",
"function",
"."
] | train | https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/Utility/ExtensionUtility.php#L99-L101 |
t3v/t3v_core | Classes/Utility/ExtensionUtility.php | ExtensionUtility.getConfigurationFolder | public static function getConfigurationFolder(string $extensionKey, string $prefix = 'FILE:EXT:'): string {
return self::configurationFolder($extensionKey, $prefix);
} | php | public static function getConfigurationFolder(string $extensionKey, string $prefix = 'FILE:EXT:'): string {
return self::configurationFolder($extensionKey, $prefix);
} | [
"public",
"static",
"function",
"getConfigurationFolder",
"(",
"string",
"$",
"extensionKey",
",",
"string",
"$",
"prefix",
"=",
"'FILE:EXT:'",
")",
":",
"string",
"{",
"return",
"self",
"::",
"configurationFolder",
"(",
"$",
"extensionKey",
",",
"$",
"prefix",
... | Alias for the `configurationFolder` function.
@param string $extensionKey The extension key
@param string $prefix The optional prefix, defaults to `FILE:EXT:`
@return string The configuration folder | [
"Alias",
"for",
"the",
"configurationFolder",
"function",
"."
] | train | https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/Utility/ExtensionUtility.php#L121-L123 |
t3v/t3v_core | Classes/Utility/ExtensionUtility.php | ExtensionUtility.flexFormsFolder | public static function flexFormsFolder(string $extensionKey, string $prefix = 'FILE:EXT:'): string {
$configurationFolder = self::configurationFolder($extensionKey, $prefix);
return "${configurationFolder}/FlexForms";
} | php | public static function flexFormsFolder(string $extensionKey, string $prefix = 'FILE:EXT:'): string {
$configurationFolder = self::configurationFolder($extensionKey, $prefix);
return "${configurationFolder}/FlexForms";
} | [
"public",
"static",
"function",
"flexFormsFolder",
"(",
"string",
"$",
"extensionKey",
",",
"string",
"$",
"prefix",
"=",
"'FILE:EXT:'",
")",
":",
"string",
"{",
"$",
"configurationFolder",
"=",
"self",
"::",
"configurationFolder",
"(",
"$",
"extensionKey",
",",... | Gets the FlexForms folder from an extension key.
@param string $extensionKey The extension key
@param string $prefix The optional prefix, defaults to `FILE:EXT:`
@return string The FlexForms folder | [
"Gets",
"the",
"FlexForms",
"folder",
"from",
"an",
"extension",
"key",
"."
] | train | https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/Utility/ExtensionUtility.php#L132-L136 |
t3v/t3v_core | Classes/Utility/ExtensionUtility.php | ExtensionUtility.getFlexFormsFolder | public static function getFlexFormsFolder(string $extensionKey, string $prefix = 'FILE:EXT:'): string {
return self::flexFormsFolder($extensionKey, $prefix);
} | php | public static function getFlexFormsFolder(string $extensionKey, string $prefix = 'FILE:EXT:'): string {
return self::flexFormsFolder($extensionKey, $prefix);
} | [
"public",
"static",
"function",
"getFlexFormsFolder",
"(",
"string",
"$",
"extensionKey",
",",
"string",
"$",
"prefix",
"=",
"'FILE:EXT:'",
")",
":",
"string",
"{",
"return",
"self",
"::",
"flexFormsFolder",
"(",
"$",
"extensionKey",
",",
"$",
"prefix",
")",
... | Alias for the `flexFormsFolder` function.
@param string $extensionKey The extension key
@param string $prefix The optional prefix, defaults to `FILE:EXT:`
@return string The FlexForms folder | [
"Alias",
"for",
"the",
"flexFormsFolder",
"function",
"."
] | train | https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/Utility/ExtensionUtility.php#L145-L147 |
t3v/t3v_core | Classes/Utility/ExtensionUtility.php | ExtensionUtility.getResourcesFolder | public static function getResourcesFolder(string $extensionKey, string $prefix = 'EXT:'): string {
return self::resourcesFolder($extensionKey, $prefix);
} | php | public static function getResourcesFolder(string $extensionKey, string $prefix = 'EXT:'): string {
return self::resourcesFolder($extensionKey, $prefix);
} | [
"public",
"static",
"function",
"getResourcesFolder",
"(",
"string",
"$",
"extensionKey",
",",
"string",
"$",
"prefix",
"=",
"'EXT:'",
")",
":",
"string",
"{",
"return",
"self",
"::",
"resourcesFolder",
"(",
"$",
"extensionKey",
",",
"$",
"prefix",
")",
";",... | Alias for the `resourcesFolder` function.
@param string $extensionKey The extension key
@param string $prefix The optional prefix, defaults to `EXT:`
@return string The resources folder | [
"Alias",
"for",
"the",
"resourcesFolder",
"function",
"."
] | train | https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/Utility/ExtensionUtility.php#L167-L169 |
t3v/t3v_core | Classes/Utility/ExtensionUtility.php | ExtensionUtility.privateFolder | public static function privateFolder(string $extensionKey, string $prefix = 'EXT:'): string {
$resourcesFolder = self::resourcesFolder($extensionKey, $prefix);
return "${resourcesFolder}/Private";
} | php | public static function privateFolder(string $extensionKey, string $prefix = 'EXT:'): string {
$resourcesFolder = self::resourcesFolder($extensionKey, $prefix);
return "${resourcesFolder}/Private";
} | [
"public",
"static",
"function",
"privateFolder",
"(",
"string",
"$",
"extensionKey",
",",
"string",
"$",
"prefix",
"=",
"'EXT:'",
")",
":",
"string",
"{",
"$",
"resourcesFolder",
"=",
"self",
"::",
"resourcesFolder",
"(",
"$",
"extensionKey",
",",
"$",
"pref... | Gets the private folder from an extension key.
@param string $extensionKey The extension key
@param string $prefix The optional prefix, defaults to `EXT:`
@return string The private folder | [
"Gets",
"the",
"private",
"folder",
"from",
"an",
"extension",
"key",
"."
] | train | https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/Utility/ExtensionUtility.php#L178-L182 |
t3v/t3v_core | Classes/Utility/ExtensionUtility.php | ExtensionUtility.getPrivateFolder | public static function getPrivateFolder(string $extensionKey, string $prefix = 'EXT:'): string {
return self::privateFolder($extensionKey, $prefix);
} | php | public static function getPrivateFolder(string $extensionKey, string $prefix = 'EXT:'): string {
return self::privateFolder($extensionKey, $prefix);
} | [
"public",
"static",
"function",
"getPrivateFolder",
"(",
"string",
"$",
"extensionKey",
",",
"string",
"$",
"prefix",
"=",
"'EXT:'",
")",
":",
"string",
"{",
"return",
"self",
"::",
"privateFolder",
"(",
"$",
"extensionKey",
",",
"$",
"prefix",
")",
";",
"... | Alias for the `privateFolder` function.
@param string $extensionKey The extension key
@param string $prefix The optional prefix, defaults to `EXT:`
@return string The private folder | [
"Alias",
"for",
"the",
"privateFolder",
"function",
"."
] | train | https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/Utility/ExtensionUtility.php#L191-L193 |
t3v/t3v_core | Classes/Utility/ExtensionUtility.php | ExtensionUtility.languageFolder | public static function languageFolder(string $extensionKey, string $prefix = 'EXT:'): string {
$privateFolder = self::privateFolder($extensionKey, $prefix);
return "${privateFolder}/Language";
} | php | public static function languageFolder(string $extensionKey, string $prefix = 'EXT:'): string {
$privateFolder = self::privateFolder($extensionKey, $prefix);
return "${privateFolder}/Language";
} | [
"public",
"static",
"function",
"languageFolder",
"(",
"string",
"$",
"extensionKey",
",",
"string",
"$",
"prefix",
"=",
"'EXT:'",
")",
":",
"string",
"{",
"$",
"privateFolder",
"=",
"self",
"::",
"privateFolder",
"(",
"$",
"extensionKey",
",",
"$",
"prefix"... | Gets the language folder from an extension key.
@param string $extensionKey The extension key
@param string $prefix The optional prefix, defaults to `EXT:`
@return string The language folder | [
"Gets",
"the",
"language",
"folder",
"from",
"an",
"extension",
"key",
"."
] | train | https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/Utility/ExtensionUtility.php#L202-L206 |
t3v/t3v_core | Classes/Utility/ExtensionUtility.php | ExtensionUtility.getLanguageFolder | public static function getLanguageFolder(string $extensionKey, string $prefix = 'EXT:'): string {
return self::languageFolder($extensionKey, $prefix);
} | php | public static function getLanguageFolder(string $extensionKey, string $prefix = 'EXT:'): string {
return self::languageFolder($extensionKey, $prefix);
} | [
"public",
"static",
"function",
"getLanguageFolder",
"(",
"string",
"$",
"extensionKey",
",",
"string",
"$",
"prefix",
"=",
"'EXT:'",
")",
":",
"string",
"{",
"return",
"self",
"::",
"languageFolder",
"(",
"$",
"extensionKey",
",",
"$",
"prefix",
")",
";",
... | Alias for the `languageFolder` function.
@param string $extensionKey The extension key
@param string $prefix The optional prefix, defaults to `EXT:`
@return string The language folder | [
"Alias",
"for",
"the",
"languageFolder",
"function",
"."
] | train | https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/Utility/ExtensionUtility.php#L215-L217 |
t3v/t3v_core | Classes/Utility/ExtensionUtility.php | ExtensionUtility.locallangFolder | public static function locallangFolder(string $extensionKey, string $prefix = 'LLL:EXT:'): string {
return self::languageFolder($extensionKey, $prefix);
} | php | public static function locallangFolder(string $extensionKey, string $prefix = 'LLL:EXT:'): string {
return self::languageFolder($extensionKey, $prefix);
} | [
"public",
"static",
"function",
"locallangFolder",
"(",
"string",
"$",
"extensionKey",
",",
"string",
"$",
"prefix",
"=",
"'LLL:EXT:'",
")",
":",
"string",
"{",
"return",
"self",
"::",
"languageFolder",
"(",
"$",
"extensionKey",
",",
"$",
"prefix",
")",
";",... | Gets the locallang folder from an extension key.
Alias for the `languageFolder` function with `LLL:EXT:` as prefix.
@param string $extensionKey The extension key
@param string $prefix The optional prefix, defaults to `LLL:EXT:`
@return string The locallang folder | [
"Gets",
"the",
"locallang",
"folder",
"from",
"an",
"extension",
"key",
"."
] | train | https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/Utility/ExtensionUtility.php#L228-L230 |
t3v/t3v_core | Classes/Utility/ExtensionUtility.php | ExtensionUtility.getLocallangFolder | public static function getLocallangFolder(string $extensionKey, string $prefix = 'LLL:EXT:'): string {
return self::locallangFolder($extensionKey, $prefix);
} | php | public static function getLocallangFolder(string $extensionKey, string $prefix = 'LLL:EXT:'): string {
return self::locallangFolder($extensionKey, $prefix);
} | [
"public",
"static",
"function",
"getLocallangFolder",
"(",
"string",
"$",
"extensionKey",
",",
"string",
"$",
"prefix",
"=",
"'LLL:EXT:'",
")",
":",
"string",
"{",
"return",
"self",
"::",
"locallangFolder",
"(",
"$",
"extensionKey",
",",
"$",
"prefix",
")",
... | Alias for the `locallangFolder` function.
@param string $extensionKey The extension key
@param string $prefix The optional prefix, defaults to `LLL:EXT:`
@return string The locallang folder | [
"Alias",
"for",
"the",
"locallangFolder",
"function",
"."
] | train | https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/Utility/ExtensionUtility.php#L239-L241 |
t3v/t3v_core | Classes/Utility/ExtensionUtility.php | ExtensionUtility.lllFolder | public static function lllFolder(string $extensionKey, string $prefix = 'LLL:EXT:'): string {
return self::locallangFolder($extensionKey, $prefix);
} | php | public static function lllFolder(string $extensionKey, string $prefix = 'LLL:EXT:'): string {
return self::locallangFolder($extensionKey, $prefix);
} | [
"public",
"static",
"function",
"lllFolder",
"(",
"string",
"$",
"extensionKey",
",",
"string",
"$",
"prefix",
"=",
"'LLL:EXT:'",
")",
":",
"string",
"{",
"return",
"self",
"::",
"locallangFolder",
"(",
"$",
"extensionKey",
",",
"$",
"prefix",
")",
";",
"}... | Alias for the `locallangFolder` function.
@param string $extensionKey The extension key
@param string $prefix The optional prefix, defaults to `LLL:EXT:`
@return string The locallang folder | [
"Alias",
"for",
"the",
"locallangFolder",
"function",
"."
] | train | https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/Utility/ExtensionUtility.php#L250-L252 |
t3v/t3v_core | Classes/Utility/ExtensionUtility.php | ExtensionUtility.publicFolder | public static function publicFolder(string $extensionKey, string $prefix = 'EXT:'): string {
$resourcesFolder = self::resourcesFolder($extensionKey, $prefix);
return "${resourcesFolder}/Public";
} | php | public static function publicFolder(string $extensionKey, string $prefix = 'EXT:'): string {
$resourcesFolder = self::resourcesFolder($extensionKey, $prefix);
return "${resourcesFolder}/Public";
} | [
"public",
"static",
"function",
"publicFolder",
"(",
"string",
"$",
"extensionKey",
",",
"string",
"$",
"prefix",
"=",
"'EXT:'",
")",
":",
"string",
"{",
"$",
"resourcesFolder",
"=",
"self",
"::",
"resourcesFolder",
"(",
"$",
"extensionKey",
",",
"$",
"prefi... | Gets the public folder from an extension key.
@param string $extensionKey The extension key
@param string $prefix The optional prefix, defaults to `EXT:`
@return string The public folder | [
"Gets",
"the",
"public",
"folder",
"from",
"an",
"extension",
"key",
"."
] | train | https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/Utility/ExtensionUtility.php#L261-L265 |
t3v/t3v_core | Classes/Utility/ExtensionUtility.php | ExtensionUtility.getPublicFolder | public static function getPublicFolder(string $extensionKey, string $prefix = 'EXT:'): string {
return self::publicFolder($extensionKey, $prefix);
} | php | public static function getPublicFolder(string $extensionKey, string $prefix = 'EXT:'): string {
return self::publicFolder($extensionKey, $prefix);
} | [
"public",
"static",
"function",
"getPublicFolder",
"(",
"string",
"$",
"extensionKey",
",",
"string",
"$",
"prefix",
"=",
"'EXT:'",
")",
":",
"string",
"{",
"return",
"self",
"::",
"publicFolder",
"(",
"$",
"extensionKey",
",",
"$",
"prefix",
")",
";",
"}"... | Alias for the `publicFolder` function.
@param string $extensionKey The extension key
@param string $prefix The optional prefix, defaults to `EXT:`
@return string The public folder | [
"Alias",
"for",
"the",
"publicFolder",
"function",
"."
] | train | https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/Utility/ExtensionUtility.php#L274-L276 |
t3v/t3v_core | Classes/Utility/ExtensionUtility.php | ExtensionUtility.assetsFolder | public static function assetsFolder(string $extensionKey, string $prefix = 'EXT:'): string {
$publicFolder = self::publicFolder($extensionKey, $prefix);
return "${publicFolder}/Assets";
} | php | public static function assetsFolder(string $extensionKey, string $prefix = 'EXT:'): string {
$publicFolder = self::publicFolder($extensionKey, $prefix);
return "${publicFolder}/Assets";
} | [
"public",
"static",
"function",
"assetsFolder",
"(",
"string",
"$",
"extensionKey",
",",
"string",
"$",
"prefix",
"=",
"'EXT:'",
")",
":",
"string",
"{",
"$",
"publicFolder",
"=",
"self",
"::",
"publicFolder",
"(",
"$",
"extensionKey",
",",
"$",
"prefix",
... | Gets the assets folder from an extension key.
@param string $extensionKey The extension key
@param string $prefix The optional prefix, defaults to `EXT:`
@return string The assets folder | [
"Gets",
"the",
"assets",
"folder",
"from",
"an",
"extension",
"key",
"."
] | train | https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/Utility/ExtensionUtility.php#L285-L289 |
t3v/t3v_core | Classes/Utility/ExtensionUtility.php | ExtensionUtility.getAssetsFolder | public static function getAssetsFolder(string $extensionKey, string $prefix = 'EXT:'): string {
return self::assetsFolder($extensionKey, $prefix);
} | php | public static function getAssetsFolder(string $extensionKey, string $prefix = 'EXT:'): string {
return self::assetsFolder($extensionKey, $prefix);
} | [
"public",
"static",
"function",
"getAssetsFolder",
"(",
"string",
"$",
"extensionKey",
",",
"string",
"$",
"prefix",
"=",
"'EXT:'",
")",
":",
"string",
"{",
"return",
"self",
"::",
"assetsFolder",
"(",
"$",
"extensionKey",
",",
"$",
"prefix",
")",
";",
"}"... | Alias for the `assetsFolder` function.
@param string $extensionKey The extension key
@param string $prefix The optional prefix, defaults to `EXT:`
@return string The assets folder | [
"Alias",
"for",
"the",
"assetsFolder",
"function",
"."
] | train | https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/Utility/ExtensionUtility.php#L298-L300 |
t3v/t3v_core | Classes/Utility/ExtensionUtility.php | ExtensionUtility.iconsFolder | public static function iconsFolder(string $extensionKey, string $prefix = 'EXT:'): string {
$publicFolder = self::publicFolder($extensionKey, $prefix);
return "${publicFolder}/Icons";
} | php | public static function iconsFolder(string $extensionKey, string $prefix = 'EXT:'): string {
$publicFolder = self::publicFolder($extensionKey, $prefix);
return "${publicFolder}/Icons";
} | [
"public",
"static",
"function",
"iconsFolder",
"(",
"string",
"$",
"extensionKey",
",",
"string",
"$",
"prefix",
"=",
"'EXT:'",
")",
":",
"string",
"{",
"$",
"publicFolder",
"=",
"self",
"::",
"publicFolder",
"(",
"$",
"extensionKey",
",",
"$",
"prefix",
"... | Gets the icons folder from an extension key.
@param string $extensionKey The extension key
@param string $prefix The optional prefix, defaults to `EXT:`
@return string The icons folder | [
"Gets",
"the",
"icons",
"folder",
"from",
"an",
"extension",
"key",
"."
] | train | https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/Utility/ExtensionUtility.php#L309-L313 |
t3v/t3v_core | Classes/Utility/ExtensionUtility.php | ExtensionUtility.getIconsFolder | public static function getIconsFolder(string $extensionKey, string $prefix = 'EXT:'): string {
return self::iconsFolder($extensionKey, $prefix);
} | php | public static function getIconsFolder(string $extensionKey, string $prefix = 'EXT:'): string {
return self::iconsFolder($extensionKey, $prefix);
} | [
"public",
"static",
"function",
"getIconsFolder",
"(",
"string",
"$",
"extensionKey",
",",
"string",
"$",
"prefix",
"=",
"'EXT:'",
")",
":",
"string",
"{",
"return",
"self",
"::",
"iconsFolder",
"(",
"$",
"extensionKey",
",",
"$",
"prefix",
")",
";",
"}"
] | Alias for the `iconsFolder` function.
@param string $extensionKey The extension key
@param string $prefix The optional prefix, defaults to `EXT:`
@return string The icons folder | [
"Alias",
"for",
"the",
"iconsFolder",
"function",
"."
] | train | https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/Utility/ExtensionUtility.php#L322-L324 |
t3v/t3v_core | Classes/Utility/ExtensionUtility.php | ExtensionUtility.placeholdersFolder | public static function placeholdersFolder(string $extensionKey, string $prefix = 'EXT:'): string {
$publicFolder = self::publicFolder($extensionKey, $prefix);
return "${publicFolder}/Placeholders";
} | php | public static function placeholdersFolder(string $extensionKey, string $prefix = 'EXT:'): string {
$publicFolder = self::publicFolder($extensionKey, $prefix);
return "${publicFolder}/Placeholders";
} | [
"public",
"static",
"function",
"placeholdersFolder",
"(",
"string",
"$",
"extensionKey",
",",
"string",
"$",
"prefix",
"=",
"'EXT:'",
")",
":",
"string",
"{",
"$",
"publicFolder",
"=",
"self",
"::",
"publicFolder",
"(",
"$",
"extensionKey",
",",
"$",
"prefi... | Gets the placeholders folder from an extension key.
@param string $extensionKey The extension key
@param string $prefix The optional prefix, defaults to `EXT:`
@return string The placeholders folder | [
"Gets",
"the",
"placeholders",
"folder",
"from",
"an",
"extension",
"key",
"."
] | train | https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/Utility/ExtensionUtility.php#L333-L337 |
t3v/t3v_core | Classes/Utility/ExtensionUtility.php | ExtensionUtility.getPlaceholdersFolder | public static function getPlaceholdersFolder(string $extensionKey, string $prefix = 'EXT:'): string {
return self::placeholdersFolder($extensionKey, $prefix);
} | php | public static function getPlaceholdersFolder(string $extensionKey, string $prefix = 'EXT:'): string {
return self::placeholdersFolder($extensionKey, $prefix);
} | [
"public",
"static",
"function",
"getPlaceholdersFolder",
"(",
"string",
"$",
"extensionKey",
",",
"string",
"$",
"prefix",
"=",
"'EXT:'",
")",
":",
"string",
"{",
"return",
"self",
"::",
"placeholdersFolder",
"(",
"$",
"extensionKey",
",",
"$",
"prefix",
")",
... | Alias for the `placeholdersFolder` function.
@param string $extensionKey The extension key
@param string $prefix The optional prefix, defaults to `EXT:`
@return string The placeholders folder | [
"Alias",
"for",
"the",
"placeholdersFolder",
"function",
"."
] | train | https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/Utility/ExtensionUtility.php#L346-L348 |
t3v/t3v_core | Classes/Utility/ExtensionUtility.php | ExtensionUtility.samplesFolder | public static function samplesFolder(string $extensionKey, string $prefix = 'EXT:'): string {
$publicFolder = self::publicFolder($extensionKey, $prefix);
return "${publicFolder}/Samples";
} | php | public static function samplesFolder(string $extensionKey, string $prefix = 'EXT:'): string {
$publicFolder = self::publicFolder($extensionKey, $prefix);
return "${publicFolder}/Samples";
} | [
"public",
"static",
"function",
"samplesFolder",
"(",
"string",
"$",
"extensionKey",
",",
"string",
"$",
"prefix",
"=",
"'EXT:'",
")",
":",
"string",
"{",
"$",
"publicFolder",
"=",
"self",
"::",
"publicFolder",
"(",
"$",
"extensionKey",
",",
"$",
"prefix",
... | Gets the samples folder from an extension key.
@param string $extensionKey The extension key
@param string $prefix The optional prefix, defaults to `EXT:`
@return string The samples folder | [
"Gets",
"the",
"samples",
"folder",
"from",
"an",
"extension",
"key",
"."
] | train | https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/Utility/ExtensionUtility.php#L357-L361 |
t3v/t3v_core | Classes/Utility/ExtensionUtility.php | ExtensionUtility.getSamplesFolder | public static function getSamplesFolder(string $extensionKey, string $prefix = 'EXT:'): string {
return self::samplesFolder($extensionKey, $prefix);
} | php | public static function getSamplesFolder(string $extensionKey, string $prefix = 'EXT:'): string {
return self::samplesFolder($extensionKey, $prefix);
} | [
"public",
"static",
"function",
"getSamplesFolder",
"(",
"string",
"$",
"extensionKey",
",",
"string",
"$",
"prefix",
"=",
"'EXT:'",
")",
":",
"string",
"{",
"return",
"self",
"::",
"samplesFolder",
"(",
"$",
"extensionKey",
",",
"$",
"prefix",
")",
";",
"... | Alias for the `samplesFolder` function.
@param string $extensionKey The extension key
@param string $prefix The optional prefix, defaults to `EXT:`
@return string The samples folder | [
"Alias",
"for",
"the",
"samplesFolder",
"function",
"."
] | train | https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/Utility/ExtensionUtility.php#L370-L372 |
sil-project/StockBundle | src/Domain/Entity/Location.php | Location.addChild | public function addChild(Location $location): void
{
if ($this->hasChild($location)) {
throw new InvalidArgumentException(
'The same Location cannot be added twice');
}
$location->setWarehouse(null);
$location->setParent($this);
$this->addTreeChi... | php | public function addChild(Location $location): void
{
if ($this->hasChild($location)) {
throw new InvalidArgumentException(
'The same Location cannot be added twice');
}
$location->setWarehouse(null);
$location->setParent($this);
$this->addTreeChi... | [
"public",
"function",
"addChild",
"(",
"Location",
"$",
"location",
")",
":",
"void",
"{",
"if",
"(",
"$",
"this",
"->",
"hasChild",
"(",
"$",
"location",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'The same Location cannot be added twice'"... | @param Location $location
@throws InvalidArgumentException | [
"@param",
"Location",
"$location"
] | train | https://github.com/sil-project/StockBundle/blob/c1af70e000d56cd53e8ad0dedaed9841bd2ea8a8/src/Domain/Entity/Location.php#L244-L255 |
sil-project/StockBundle | src/Domain/Entity/Location.php | Location.removeChild | public function removeChild(Location $location): void
{
if (!$this->hasChild($location)) {
throw new InvalidArgumentException(
'The Location is not a child and cannot be removed from there');
}
$location->setParent(null);
$this->getChildren()->removeElemen... | php | public function removeChild(Location $location): void
{
if (!$this->hasChild($location)) {
throw new InvalidArgumentException(
'The Location is not a child and cannot be removed from there');
}
$location->setParent(null);
$this->getChildren()->removeElemen... | [
"public",
"function",
"removeChild",
"(",
"Location",
"$",
"location",
")",
":",
"void",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasChild",
"(",
"$",
"location",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'The Location is not a child and... | @param Location $location
@throws InvalidArgumentException | [
"@param",
"Location",
"$location"
] | train | https://github.com/sil-project/StockBundle/blob/c1af70e000d56cd53e8ad0dedaed9841bd2ea8a8/src/Domain/Entity/Location.php#L262-L270 |
sil-project/StockBundle | src/Domain/Entity/Location.php | Location.hasStockUnit | public function hasStockUnit(StockUnit $unit): bool
{
if ($this->hasOwnedStockUnit($unit)) {
return true;
}
foreach ($this->getChildren() as $child) {
if ($child->hasStockUnit($unit)) {
return true;
}
}
return false;
} | php | public function hasStockUnit(StockUnit $unit): bool
{
if ($this->hasOwnedStockUnit($unit)) {
return true;
}
foreach ($this->getChildren() as $child) {
if ($child->hasStockUnit($unit)) {
return true;
}
}
return false;
} | [
"public",
"function",
"hasStockUnit",
"(",
"StockUnit",
"$",
"unit",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"this",
"->",
"hasOwnedStockUnit",
"(",
"$",
"unit",
")",
")",
"{",
"return",
"true",
";",
"}",
"foreach",
"(",
"$",
"this",
"->",
"getChildren"... | @param StockUnit $unit
@return bool | [
"@param",
"StockUnit",
"$unit"
] | train | https://github.com/sil-project/StockBundle/blob/c1af70e000d56cd53e8ad0dedaed9841bd2ea8a8/src/Domain/Entity/Location.php#L285-L298 |
sil-project/StockBundle | src/Domain/Entity/Location.php | Location.addStockUnit | public function addStockUnit(StockUnit $unit): void
{
if ($this->hasStockUnit($unit)) {
throw new InvalidArgumentException(
'The same StockUnit cannot be added twice');
}
$this->stockUnits->add($unit);
} | php | public function addStockUnit(StockUnit $unit): void
{
if ($this->hasStockUnit($unit)) {
throw new InvalidArgumentException(
'The same StockUnit cannot be added twice');
}
$this->stockUnits->add($unit);
} | [
"public",
"function",
"addStockUnit",
"(",
"StockUnit",
"$",
"unit",
")",
":",
"void",
"{",
"if",
"(",
"$",
"this",
"->",
"hasStockUnit",
"(",
"$",
"unit",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'The same StockUnit cannot be added twice... | @param StockUnit $unit
@throws InvalidArgumentException | [
"@param",
"StockUnit",
"$unit"
] | train | https://github.com/sil-project/StockBundle/blob/c1af70e000d56cd53e8ad0dedaed9841bd2ea8a8/src/Domain/Entity/Location.php#L315-L323 |
ciims/ciims-modules-dashboard | components/CiiDashboardController.php | CiiDashboardController.getAsset | public function getAsset($dist=false)
{
return Yii::app()->assetManager->publish(YiiBase::getPathOfAlias('application.modules.dashboard.assets'), true, -1, YII_DEBUG);
} | php | public function getAsset($dist=false)
{
return Yii::app()->assetManager->publish(YiiBase::getPathOfAlias('application.modules.dashboard.assets'), true, -1, YII_DEBUG);
} | [
"public",
"function",
"getAsset",
"(",
"$",
"dist",
"=",
"false",
")",
"{",
"return",
"Yii",
"::",
"app",
"(",
")",
"->",
"assetManager",
"->",
"publish",
"(",
"YiiBase",
"::",
"getPathOfAlias",
"(",
"'application.modules.dashboard.assets'",
")",
",",
"true",
... | Retrieve assetManager from anywhere without having to instatiate this code
@return CAssetManager | [
"Retrieve",
"assetManager",
"from",
"anywhere",
"without",
"having",
"to",
"instatiate",
"this",
"code"
] | train | https://github.com/ciims/ciims-modules-dashboard/blob/94b89239e9ee34ac3b9c398e8d1ba67a08c68c11/components/CiiDashboardController.php#L12-L15 |
ciims/ciims-modules-dashboard | components/CiiDashboardController.php | CiiDashboardController.beforeAction | public function beforeAction($action)
{
// Redirect to SSL if this is set in the dashboard
if (!Yii::app()->getRequest()->isSecureConnection && Cii::getConfig('forceSecureSSL', false))
$this->redirect('https://' . Yii::app()->getRequest()->serverName . Yii::app()->getRequest()->requestUri);
Yi... | php | public function beforeAction($action)
{
// Redirect to SSL if this is set in the dashboard
if (!Yii::app()->getRequest()->isSecureConnection && Cii::getConfig('forceSecureSSL', false))
$this->redirect('https://' . Yii::app()->getRequest()->serverName . Yii::app()->getRequest()->requestUri);
Yi... | [
"public",
"function",
"beforeAction",
"(",
"$",
"action",
")",
"{",
"// Redirect to SSL if this is set in the dashboard",
"if",
"(",
"!",
"Yii",
"::",
"app",
"(",
")",
"->",
"getRequest",
"(",
")",
"->",
"isSecureConnection",
"&&",
"Cii",
"::",
"getConfig",
"(",... | Before action method
@param CAction $action The aciton
@return boolean | [
"Before",
"action",
"method"
] | train | https://github.com/ciims/ciims-modules-dashboard/blob/94b89239e9ee34ac3b9c398e8d1ba67a08c68c11/components/CiiDashboardController.php#L22-L30 |
ciims/ciims-modules-dashboard | components/CiiDashboardController.php | CiiDashboardController.actionError | public function actionError()
{
if (Yii::app()->user->isGuest)
return $this->redirect($this->createUrl('/login?next=' . Yii::app()->request->requestUri));
if($error=Yii::app()->errorHandler->error)
{
if(Yii::app()->request->isAjaxRequest)
echo $error['... | php | public function actionError()
{
if (Yii::app()->user->isGuest)
return $this->redirect($this->createUrl('/login?next=' . Yii::app()->request->requestUri));
if($error=Yii::app()->errorHandler->error)
{
if(Yii::app()->request->isAjaxRequest)
echo $error['... | [
"public",
"function",
"actionError",
"(",
")",
"{",
"if",
"(",
"Yii",
"::",
"app",
"(",
")",
"->",
"user",
"->",
"isGuest",
")",
"return",
"$",
"this",
"->",
"redirect",
"(",
"$",
"this",
"->",
"createUrl",
"(",
"'/login?next='",
".",
"Yii",
"::",
"a... | Handles errors | [
"Handles",
"errors"
] | train | https://github.com/ciims/ciims-modules-dashboard/blob/94b89239e9ee34ac3b9c398e8d1ba67a08c68c11/components/CiiDashboardController.php#L55-L69 |
pluf/discount | src/Discount/Engine/SpecialPercent.php | Discount_Engine_SpecialPercent.getPrice | public function getPrice($price, $discount, $request)
{
if(!$this->isValid($discount, $request))
throw new Discount_Exception_InvalidDiscount();
$newPrice = $price - ($price * $discount->off_value / 100);
return $newPrice;
} | php | public function getPrice($price, $discount, $request)
{
if(!$this->isValid($discount, $request))
throw new Discount_Exception_InvalidDiscount();
$newPrice = $price - ($price * $discount->off_value / 100);
return $newPrice;
} | [
"public",
"function",
"getPrice",
"(",
"$",
"price",
",",
"$",
"discount",
",",
"$",
"request",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isValid",
"(",
"$",
"discount",
",",
"$",
"request",
")",
")",
"throw",
"new",
"Discount_Exception_InvalidDiscou... | Compute new price after use given discount.
@param int $price
@param Discount_Discount $discount
@param Pluf_HTTP_Request $request | [
"Compute",
"new",
"price",
"after",
"use",
"given",
"discount",
"."
] | train | https://github.com/pluf/discount/blob/b0006d6b25dd61241f51b5b098d7d546b470de26/src/Discount/Engine/SpecialPercent.php#L13-L19 |
pluf/discount | src/Discount/Engine/SpecialPercent.php | Discount_Engine_SpecialPercent.validate | public function validate($discount, $request)
{
// Check user
$currentUser = $request->user;
if ($currentUser->id !== $discount->get_user()->id) {
return Discount_Engine::VALIDATION_CODE_NOT_OWNED;
}
// Check expiration date
if ($discount->valid_day != NUL... | php | public function validate($discount, $request)
{
// Check user
$currentUser = $request->user;
if ($currentUser->id !== $discount->get_user()->id) {
return Discount_Engine::VALIDATION_CODE_NOT_OWNED;
}
// Check expiration date
if ($discount->valid_day != NUL... | [
"public",
"function",
"validate",
"(",
"$",
"discount",
",",
"$",
"request",
")",
"{",
"// Check user",
"$",
"currentUser",
"=",
"$",
"request",
"->",
"user",
";",
"if",
"(",
"$",
"currentUser",
"->",
"id",
"!==",
"$",
"discount",
"->",
"get_user",
"(",
... | Validate given discount and returns a code as result. Returned code should be as following:
<ul>
<li> 0: discount is valid. </li>
<li> 1: discount is used before.</li>
<li> 2: discount is expired.</li>
<li> 3: discount is not owned by current user.</li>
</ul>
@param Discount_Discount $discount
@param Pluf_Http_Reques... | [
"Validate",
"given",
"discount",
"and",
"returns",
"a",
"code",
"as",
"result",
".",
"Returned",
"code",
"should",
"be",
"as",
"following",
":"
] | train | https://github.com/pluf/discount/blob/b0006d6b25dd61241f51b5b098d7d546b470de26/src/Discount/Engine/SpecialPercent.php#L50-L71 |
cloudtek/dynamodm | lib/Cloudtek/DynamoDM/Tool/Console/Command/Command.php | Command.initialize | protected function initialize(InputInterface $input, OutputInterface $output)
{
$this->dm = $this->getHelper('documentManager')->getDocumentManager();
$this->cmf = $this->dm->getMetadataFactory();
$this->sm = $this->dm->getSchemaManager();
} | php | protected function initialize(InputInterface $input, OutputInterface $output)
{
$this->dm = $this->getHelper('documentManager')->getDocumentManager();
$this->cmf = $this->dm->getMetadataFactory();
$this->sm = $this->dm->getSchemaManager();
} | [
"protected",
"function",
"initialize",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"this",
"->",
"dm",
"=",
"$",
"this",
"->",
"getHelper",
"(",
"'documentManager'",
")",
"->",
"getDocumentManager",
"(",
")",
";... | {@inheritdoc} | [
"{"
] | train | https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/Tool/Console/Command/Command.php#L32-L37 |
qingbing/php-database | src/supports/Builder/FindBuilder.php | FindBuilder.count | public function count($params = [])
{
$this->setSelect('COUNT(*) AS ' . $this->quoteColumnName('total'))
->setLimit(-1);
$record = $this->getDb()
->createCommand()
->setText($this->buildSql())
->queryRow(array_merge($this->getParams(), $params))... | php | public function count($params = [])
{
$this->setSelect('COUNT(*) AS ' . $this->quoteColumnName('total'))
->setLimit(-1);
$record = $this->getDb()
->createCommand()
->setText($this->buildSql())
->queryRow(array_merge($this->getParams(), $params))... | [
"public",
"function",
"count",
"(",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"setSelect",
"(",
"'COUNT(*) AS '",
".",
"$",
"this",
"->",
"quoteColumnName",
"(",
"'total'",
")",
")",
"->",
"setLimit",
"(",
"-",
"1",
")",
";",
"$",
... | 查询影响的结果集行数,对于 select ,rowCount() 返回有可能为部分结果,这里用统计更好
@param array $params
@return int
@throws \Exception | [
"查询影响的结果集行数,对于",
"select",
",rowCount",
"()",
"返回有可能为部分结果,这里用统计更好"
] | train | https://github.com/qingbing/php-database/blob/cfd915c9d25dbe5d5cdd9b4c93eca5fd63cb7015/src/supports/Builder/FindBuilder.php#L31-L40 |
qingbing/php-database | src/supports/Builder/FindBuilder.php | FindBuilder.queryRow | public function queryRow($params = [])
{
$this->setLimit(1);
return $this->getDb()
->createCommand()
->setText($this->buildSql())
->queryRow(array_merge($this->getParams(), $params));
} | php | public function queryRow($params = [])
{
$this->setLimit(1);
return $this->getDb()
->createCommand()
->setText($this->buildSql())
->queryRow(array_merge($this->getParams(), $params));
} | [
"public",
"function",
"queryRow",
"(",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"setLimit",
"(",
"1",
")",
";",
"return",
"$",
"this",
"->",
"getDb",
"(",
")",
"->",
"createCommand",
"(",
")",
"->",
"setText",
"(",
"$",
"this",
... | 查询第一条结果集
@param array $params
@return array
@throws \Exception | [
"查询第一条结果集"
] | train | https://github.com/qingbing/php-database/blob/cfd915c9d25dbe5d5cdd9b4c93eca5fd63cb7015/src/supports/Builder/FindBuilder.php#L48-L55 |
qingbing/php-database | src/supports/Builder/FindBuilder.php | FindBuilder.buildSql | protected function buildSql()
{
$query = $this->getQuery();
// DISTINCT
if (isset($query['distinct']) && !empty($query['distinct'])) {
$sql = 'SELECT DISTINCT';
} else {
$sql = 'SELECT';
}
// SELECT
if (isset($query['select'])... | php | protected function buildSql()
{
$query = $this->getQuery();
// DISTINCT
if (isset($query['distinct']) && !empty($query['distinct'])) {
$sql = 'SELECT DISTINCT';
} else {
$sql = 'SELECT';
}
// SELECT
if (isset($query['select'])... | [
"protected",
"function",
"buildSql",
"(",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"getQuery",
"(",
")",
";",
"// DISTINCT\r",
"if",
"(",
"isset",
"(",
"$",
"query",
"[",
"'distinct'",
"]",
")",
"&&",
"!",
"empty",
"(",
"$",
"query",
"[",
"'... | 根据 query 选项创建SQL
@return string
@throws Exception | [
"根据",
"query",
"选项创建SQL"
] | train | https://github.com/qingbing/php-database/blob/cfd915c9d25dbe5d5cdd9b4c93eca5fd63cb7015/src/supports/Builder/FindBuilder.php#L76-L125 |
irfantoor/engine | src/Http/Headers.php | Headers.createFromEnvironment | public static function createFromEnvironment($env = [])
{
if (!($env instanceof Environment)) {
$env = new Environment($env);
}
// Headers from environment
$data = [];
foreach($env as $k=>$v) {
$k = strtoupper($k);
if (strpos($k, 'HTTP_') ... | php | public static function createFromEnvironment($env = [])
{
if (!($env instanceof Environment)) {
$env = new Environment($env);
}
// Headers from environment
$data = [];
foreach($env as $k=>$v) {
$k = strtoupper($k);
if (strpos($k, 'HTTP_') ... | [
"public",
"static",
"function",
"createFromEnvironment",
"(",
"$",
"env",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"env",
"instanceof",
"Environment",
")",
")",
"{",
"$",
"env",
"=",
"new",
"Environment",
"(",
"$",
"env",
")",
";",
"}",
"... | Create Headers from Enviroment class or an array of $_SERVER
@param Environment|array $env
@return Headers Collection | [
"Create",
"Headers",
"from",
"Enviroment",
"class",
"or",
"an",
"array",
"of",
"$_SERVER"
] | train | https://github.com/irfantoor/engine/blob/4d2d221add749f75100d0b4ffe1488cdbf7af5d3/src/Http/Headers.php#L31-L59 |
irfantoor/engine | src/Http/Headers.php | Headers.setItem | public function setItem($id, $value = null)
{
if (!is_array($value)) {
$value = [$value];
}
parent::setItem(strtolower($id), ['id' => $id, 'value' => $value]);
} | php | public function setItem($id, $value = null)
{
if (!is_array($value)) {
$value = [$value];
}
parent::setItem(strtolower($id), ['id' => $id, 'value' => $value]);
} | [
"public",
"function",
"setItem",
"(",
"$",
"id",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"$",
"value",
"=",
"[",
"$",
"value",
"]",
";",
"}",
"parent",
"::",
"setItem",
"(",
"strto... | # used by set($id, $value) | [
"#",
"used",
"by",
"set",
"(",
"$id",
"$value",
")"
] | train | https://github.com/irfantoor/engine/blob/4d2d221add749f75100d0b4ffe1488cdbf7af5d3/src/Http/Headers.php#L67-L74 |
SysControllers/Admin | src/app/Http/Controllers/Admin/FormularioContactoController.php | FormularioContactoController.index | public function index(Request $request)
{
$mensajes = $this->contactoMensajeRepo->findMessageAndPaginate($request);
return view('admin.formularios.contacto.list', compact('mensajes'));
} | php | public function index(Request $request)
{
$mensajes = $this->contactoMensajeRepo->findMessageAndPaginate($request);
return view('admin.formularios.contacto.list', compact('mensajes'));
} | [
"public",
"function",
"index",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"mensajes",
"=",
"$",
"this",
"->",
"contactoMensajeRepo",
"->",
"findMessageAndPaginate",
"(",
"$",
"request",
")",
";",
"return",
"view",
"(",
"'admin.formularios.contacto.list'",
",... | Show the form for editing the specified adminconfig.
@param Request $request
@return Response
@internal param int $id | [
"Show",
"the",
"form",
"for",
"editing",
"the",
"specified",
"adminconfig",
"."
] | train | https://github.com/SysControllers/Admin/blob/8f1df46aca422b87f2f522fbba610dcfa0c5f7f3/src/app/Http/Controllers/Admin/FormularioContactoController.php#L26-L31 |
itkg/core | src/Itkg/Core/KernelAbstract.php | KernelAbstract.loadConfig | protected function loadConfig()
{
$this->container['app']->getConfig()->load($this->getConfigFiles());
$this->dispatchEvent(KernelEvents::CONFIG_LOADED, new KernelEvent($this->container));
} | php | protected function loadConfig()
{
$this->container['app']->getConfig()->load($this->getConfigFiles());
$this->dispatchEvent(KernelEvents::CONFIG_LOADED, new KernelEvent($this->container));
} | [
"protected",
"function",
"loadConfig",
"(",
")",
"{",
"$",
"this",
"->",
"container",
"[",
"'app'",
"]",
"->",
"getConfig",
"(",
")",
"->",
"load",
"(",
"$",
"this",
"->",
"getConfigFiles",
"(",
")",
")",
";",
"$",
"this",
"->",
"dispatchEvent",
"(",
... | Load Config from config files
@return $this | [
"Load",
"Config",
"from",
"config",
"files"
] | train | https://github.com/itkg/core/blob/e5e4efb05feb4d23b0df41f2b21fd095103e593b/src/Itkg/Core/KernelAbstract.php#L75-L80 |
itkg/core | src/Itkg/Core/KernelAbstract.php | KernelAbstract.handle | public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
{
if ($type == HttpKernelInterface::SUB_REQUEST) {
$request->query->add(
array_merge(
$_POST,
$_GET,
$request->query->a... | php | public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
{
if ($type == HttpKernelInterface::SUB_REQUEST) {
$request->query->add(
array_merge(
$_POST,
$_GET,
$request->query->a... | [
"public",
"function",
"handle",
"(",
"Request",
"$",
"request",
",",
"$",
"type",
"=",
"HttpKernelInterface",
"::",
"MASTER_REQUEST",
",",
"$",
"catch",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"type",
"==",
"HttpKernelInterface",
"::",
"SUB_REQUEST",
")",
"... | {@inheritdoc}
@api | [
"{",
"@inheritdoc",
"}"
] | train | https://github.com/itkg/core/blob/e5e4efb05feb4d23b0df41f2b21fd095103e593b/src/Itkg/Core/KernelAbstract.php#L122-L137 |
rollerworks/search-doctrine-orm | DoctrineOrmFactory.php | DoctrineOrmFactory.createConditionGenerator | public function createConditionGenerator($query, SearchCondition $searchCondition)
{
if ($query instanceof NativeQuery) {
return new NativeQueryConditionGenerator($query, $searchCondition);
}
if ($query instanceof Query || $query instanceof QueryBuilder) {
return new... | php | public function createConditionGenerator($query, SearchCondition $searchCondition)
{
if ($query instanceof NativeQuery) {
return new NativeQueryConditionGenerator($query, $searchCondition);
}
if ($query instanceof Query || $query instanceof QueryBuilder) {
return new... | [
"public",
"function",
"createConditionGenerator",
"(",
"$",
"query",
",",
"SearchCondition",
"$",
"searchCondition",
")",
"{",
"if",
"(",
"$",
"query",
"instanceof",
"NativeQuery",
")",
"{",
"return",
"new",
"NativeQueryConditionGenerator",
"(",
"$",
"query",
",",... | Creates a new ConditionGenerator for the SearchCondition.
Conversions are applied using the 'doctrine_dbal_conversion' option (when present).
@param NativeQuery|Query|QueryBuilder $query Doctrine ORM (Native)Query object
@param SearchCondition $searchCondition SearchCondition object
@return ... | [
"Creates",
"a",
"new",
"ConditionGenerator",
"for",
"the",
"SearchCondition",
"."
] | train | https://github.com/rollerworks/search-doctrine-orm/blob/d4d7e9cfc6591d34e9d00f084c35f109f971ac4f/DoctrineOrmFactory.php#L52-L65 |
rollerworks/search-doctrine-orm | DoctrineOrmFactory.php | DoctrineOrmFactory.createCachedConditionGenerator | public function createCachedConditionGenerator($conditionGenerator, $ttl = null): ConditionGenerator
{
if (null === $this->cacheDriver) {
return $conditionGenerator;
}
if ($conditionGenerator instanceof DqlConditionGenerator) {
return new CachedDqlConditionGenerator(... | php | public function createCachedConditionGenerator($conditionGenerator, $ttl = null): ConditionGenerator
{
if (null === $this->cacheDriver) {
return $conditionGenerator;
}
if ($conditionGenerator instanceof DqlConditionGenerator) {
return new CachedDqlConditionGenerator(... | [
"public",
"function",
"createCachedConditionGenerator",
"(",
"$",
"conditionGenerator",
",",
"$",
"ttl",
"=",
"null",
")",
":",
"ConditionGenerator",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"cacheDriver",
")",
"{",
"return",
"$",
"conditionGenerator",
... | Creates a new CachedConditionGenerator instance for the ConditionGenerator.
@param DqlConditionGenerator|NativeQueryConditionGenerator $conditionGenerator
@param int|\DateInterval|null $ttl Optional. The TTL value of this item. If no value is sent and
the driver supports TTL... | [
"Creates",
"a",
"new",
"CachedConditionGenerator",
"instance",
"for",
"the",
"ConditionGenerator",
"."
] | train | https://github.com/rollerworks/search-doctrine-orm/blob/d4d7e9cfc6591d34e9d00f084c35f109f971ac4f/DoctrineOrmFactory.php#L75-L90 |
dmj/PicaRecord | src/HAB/Pica/Record/Helper.php | Helper.mapMethod | public static function mapMethod (array $sequence, $method, array $arguments = array())
{
if (empty($arguments)) {
$f = function ($element) use ($method) {
return $element->$method();
};
} else {
$f = function ($element) use ($method, $arguments) {... | php | public static function mapMethod (array $sequence, $method, array $arguments = array())
{
if (empty($arguments)) {
$f = function ($element) use ($method) {
return $element->$method();
};
} else {
$f = function ($element) use ($method, $arguments) {... | [
"public",
"static",
"function",
"mapMethod",
"(",
"array",
"$",
"sequence",
",",
"$",
"method",
",",
"array",
"$",
"arguments",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"arguments",
")",
")",
"{",
"$",
"f",
"=",
"function",
"... | Return an array of the results of calling a method for each element of a
sequence.
@param array $sequence Sequence of objects
@param string $method Name of the method
@param array $arguments Optional array of method arguments
@return array Result of calling method on each element of sequence | [
"Return",
"an",
"array",
"of",
"the",
"results",
"of",
"calling",
"a",
"method",
"for",
"each",
"element",
"of",
"a",
"sequence",
"."
] | train | https://github.com/dmj/PicaRecord/blob/bd5577b9a4333aa6156398b94cc870a9377061b8/src/HAB/Pica/Record/Helper.php#L56-L68 |
dmj/PicaRecord | src/HAB/Pica/Record/Helper.php | Helper.some | public static function some (array $sequence, $predicate)
{
foreach ($sequence as $element) {
if (call_user_func($predicate, $element)) {
return true;
}
}
return false;
} | php | public static function some (array $sequence, $predicate)
{
foreach ($sequence as $element) {
if (call_user_func($predicate, $element)) {
return true;
}
}
return false;
} | [
"public",
"static",
"function",
"some",
"(",
"array",
"$",
"sequence",
",",
"$",
"predicate",
")",
"{",
"foreach",
"(",
"$",
"sequence",
"as",
"$",
"element",
")",
"{",
"if",
"(",
"call_user_func",
"(",
"$",
"predicate",
",",
"$",
"element",
")",
")",
... | Return TRUE if at leat one element of sequence matches predicate.
@todo Make FALSE and TRUE self-evaluating, maybe
@param array $sequence Sequence
@param callback $predicate Predicate
@return boolean TRUE if at least one element matches predicate | [
"Return",
"TRUE",
"if",
"at",
"leat",
"one",
"element",
"of",
"sequence",
"matches",
"predicate",
"."
] | train | https://github.com/dmj/PicaRecord/blob/bd5577b9a4333aa6156398b94cc870a9377061b8/src/HAB/Pica/Record/Helper.php#L90-L98 |
dmj/PicaRecord | src/HAB/Pica/Record/Helper.php | Helper.every | public static function every (array $sequence, $predicate)
{
foreach ($sequence as $element) {
if (!call_user_func($predicate, $element)) {
return false;
}
}
return true;
} | php | public static function every (array $sequence, $predicate)
{
foreach ($sequence as $element) {
if (!call_user_func($predicate, $element)) {
return false;
}
}
return true;
} | [
"public",
"static",
"function",
"every",
"(",
"array",
"$",
"sequence",
",",
"$",
"predicate",
")",
"{",
"foreach",
"(",
"$",
"sequence",
"as",
"$",
"element",
")",
"{",
"if",
"(",
"!",
"call_user_func",
"(",
"$",
"predicate",
",",
"$",
"element",
")",... | Return TRUE if every element of sequence fullfills predicate.
@todo Make FALSE and TRUE self-evaluating, maybe
@param array $sequence Sequence
@param callback $predicate Predicate
@return boolean TRUE if every element fullfills predicate | [
"Return",
"TRUE",
"if",
"every",
"element",
"of",
"sequence",
"fullfills",
"predicate",
"."
] | train | https://github.com/dmj/PicaRecord/blob/bd5577b9a4333aa6156398b94cc870a9377061b8/src/HAB/Pica/Record/Helper.php#L109-L117 |
dmj/PicaRecord | src/HAB/Pica/Record/Helper.php | Helper.flatten | public static function flatten (array $sequence)
{
$flat = array();
array_walk_recursive($sequence, function ($element) use (&$flat) { $flat []= $element; });
return $flat;
} | php | public static function flatten (array $sequence)
{
$flat = array();
array_walk_recursive($sequence, function ($element) use (&$flat) { $flat []= $element; });
return $flat;
} | [
"public",
"static",
"function",
"flatten",
"(",
"array",
"$",
"sequence",
")",
"{",
"$",
"flat",
"=",
"array",
"(",
")",
";",
"array_walk_recursive",
"(",
"$",
"sequence",
",",
"function",
"(",
"$",
"element",
")",
"use",
"(",
"&",
"$",
"flat",
")",
... | Flatten sequence.
@param array $sequence Sequence
@return array Flattend sequence | [
"Flatten",
"sequence",
"."
] | train | https://github.com/dmj/PicaRecord/blob/bd5577b9a4333aa6156398b94cc870a9377061b8/src/HAB/Pica/Record/Helper.php#L125-L130 |
g4code/di | src/Container.php | Container.reg | private static function reg($callable)
{
$id = debug_backtrace()[2]['function'];
if (! self::getInstance()->offsetExists($id)) {
self::getInstance()->offsetSet($id, $callable);
}
return self::getInstance()->offsetGet($id);
} | php | private static function reg($callable)
{
$id = debug_backtrace()[2]['function'];
if (! self::getInstance()->offsetExists($id)) {
self::getInstance()->offsetSet($id, $callable);
}
return self::getInstance()->offsetGet($id);
} | [
"private",
"static",
"function",
"reg",
"(",
"$",
"callable",
")",
"{",
"$",
"id",
"=",
"debug_backtrace",
"(",
")",
"[",
"2",
"]",
"[",
"'function'",
"]",
";",
"if",
"(",
"!",
"self",
"::",
"getInstance",
"(",
")",
"->",
"offsetExists",
"(",
"$",
... | Pimple facade
@param Callable $callable
@return mixed | [
"Pimple",
"facade"
] | train | https://github.com/g4code/di/blob/85e34d37178c8d4726f4a9620d3e975bb9bb9f54/src/Container.php#L66-L73 |
zodream/database | src/Command.php | Command.addPrefix | public function addPrefix($table) {
if (strpos($table, '`') !== false) {
return $table;
}
preg_match('/([\w_\.]+)( (as )?[\w_]+)?/i', $table, $match);
$table = count($match) == 2 ? $table : $match[1];
$alias = '';
if (count($match) > 2) {
$alias = ... | php | public function addPrefix($table) {
if (strpos($table, '`') !== false) {
return $table;
}
preg_match('/([\w_\.]+)( (as )?[\w_]+)?/i', $table, $match);
$table = count($match) == 2 ? $table : $match[1];
$alias = '';
if (count($match) > 2) {
$alias = ... | [
"public",
"function",
"addPrefix",
"(",
"$",
"table",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"table",
",",
"'`'",
")",
"!==",
"false",
")",
"{",
"return",
"$",
"table",
";",
"}",
"preg_match",
"(",
"'/([\\w_\\.]+)( (as )?[\\w_]+)?/i'",
",",
"$",
"table... | ADD TABLE PREFIX
@param string $table
@return string
@throws \Exception | [
"ADD",
"TABLE",
"PREFIX"
] | train | https://github.com/zodream/database/blob/03712219c057799d07350a3a2650c55bcc92c28e/src/Command.php#L63-L86 |
zodream/database | src/Command.php | Command.openCache | public function openCache($expire = 3600) {
$this->allowCache = $expire !== false;
$this->cacheLife = $expire;
return $this;
} | php | public function openCache($expire = 3600) {
$this->allowCache = $expire !== false;
$this->cacheLife = $expire;
return $this;
} | [
"public",
"function",
"openCache",
"(",
"$",
"expire",
"=",
"3600",
")",
"{",
"$",
"this",
"->",
"allowCache",
"=",
"$",
"expire",
"!==",
"false",
";",
"$",
"this",
"->",
"cacheLife",
"=",
"$",
"expire",
";",
"return",
"$",
"this",
";",
"}"
] | 开启缓存
@param int $expire
@return $this | [
"开启缓存"
] | train | https://github.com/zodream/database/blob/03712219c057799d07350a3a2650c55bcc92c28e/src/Command.php#L138-L142 |
zodream/database | src/Command.php | Command.select | public function select($sql, $parameters = array()) {
DB::addQueryLog($sql, $parameters);
return $this->getArray($sql, $parameters);
} | php | public function select($sql, $parameters = array()) {
DB::addQueryLog($sql, $parameters);
return $this->getArray($sql, $parameters);
} | [
"public",
"function",
"select",
"(",
"$",
"sql",
",",
"$",
"parameters",
"=",
"array",
"(",
")",
")",
"{",
"DB",
"::",
"addQueryLog",
"(",
"$",
"sql",
",",
"$",
"parameters",
")",
";",
"return",
"$",
"this",
"->",
"getArray",
"(",
"$",
"sql",
",",
... | 查询
@param string $sql
@param array $parameters
@return mixed
@throws \Exception | [
"查询"
] | train | https://github.com/zodream/database/blob/03712219c057799d07350a3a2650c55bcc92c28e/src/Command.php#L174-L177 |
zodream/database | src/Command.php | Command.insert | public function insert($sql, $parameters = array()) {
DB::addQueryLog($sql, $parameters);
return $this->getEngine()->insert($sql, $parameters);
} | php | public function insert($sql, $parameters = array()) {
DB::addQueryLog($sql, $parameters);
return $this->getEngine()->insert($sql, $parameters);
} | [
"public",
"function",
"insert",
"(",
"$",
"sql",
",",
"$",
"parameters",
"=",
"array",
"(",
")",
")",
"{",
"DB",
"::",
"addQueryLog",
"(",
"$",
"sql",
",",
"$",
"parameters",
")",
";",
"return",
"$",
"this",
"->",
"getEngine",
"(",
")",
"->",
"inse... | 插入
@param $sql
@param array $parameters
@return int
@throws \Exception | [
"插入"
] | train | https://github.com/zodream/database/blob/03712219c057799d07350a3a2650c55bcc92c28e/src/Command.php#L206-L209 |
zodream/database | src/Command.php | Command.insertOrReplace | public function insertOrReplace($columns, $tags, $parameters = array()) {
if (!empty($columns) && strpos($columns, '(') === false) {
$columns = '('.$columns.')';
}
$tags = trim($tags);
if (strpos($tags, '(') !== 0) {
$tags = '('.$tags.')';
}
return... | php | public function insertOrReplace($columns, $tags, $parameters = array()) {
if (!empty($columns) && strpos($columns, '(') === false) {
$columns = '('.$columns.')';
}
$tags = trim($tags);
if (strpos($tags, '(') !== 0) {
$tags = '('.$tags.')';
}
return... | [
"public",
"function",
"insertOrReplace",
"(",
"$",
"columns",
",",
"$",
"tags",
",",
"$",
"parameters",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"columns",
")",
"&&",
"strpos",
"(",
"$",
"columns",
",",
"'('",
")",
"==="... | 在执行REPLACE后,系统返回了所影响的行数,如果返回1,说明在表中并没有重复的记录,如果返回2,说明有一条重复记录,系统自动先调用了 DELETE删除这条记录,然后再记录用INSERT来insert这条记录。如果返回的值大于2,那说明有多个唯一索引,有多条记录被删除和insert。
@param string $columns
@param string $tags
@param array $parameters
@return int
@throws \Exception | [
"在执行REPLACE后,系统返回了所影响的行数,如果返回1,说明在表中并没有重复的记录,如果返回2,说明有一条重复记录,系统自动先调用了",
"DELETE删除这条记录,然后再记录用INSERT来insert这条记录。如果返回的值大于2,那说明有多个唯一索引,有多条记录被删除和insert。"
] | train | https://github.com/zodream/database/blob/03712219c057799d07350a3a2650c55bcc92c28e/src/Command.php#L239-L248 |
zodream/database | src/Command.php | Command.update | public function update($sql, $parameters = array()) {
DB::addQueryLog($sql, $parameters);
return $this->getEngine()->update($sql, $parameters);
} | php | public function update($sql, $parameters = array()) {
DB::addQueryLog($sql, $parameters);
return $this->getEngine()->update($sql, $parameters);
} | [
"public",
"function",
"update",
"(",
"$",
"sql",
",",
"$",
"parameters",
"=",
"array",
"(",
")",
")",
"{",
"DB",
"::",
"addQueryLog",
"(",
"$",
"sql",
",",
"$",
"parameters",
")",
";",
"return",
"$",
"this",
"->",
"getEngine",
"(",
")",
"->",
"upda... | 更新, 如果数据相同会返回0
@param $sql
@param array $parameters
@return int
@throws \Exception | [
"更新",
"如果数据相同会返回0"
] | train | https://github.com/zodream/database/blob/03712219c057799d07350a3a2650c55bcc92c28e/src/Command.php#L257-L260 |
zodream/database | src/Command.php | Command.delete | public function delete($sql = null, $parameters = array()) {
DB::addQueryLog($sql, $parameters);
return $this->getEngine()->delete($sql, $parameters);
} | php | public function delete($sql = null, $parameters = array()) {
DB::addQueryLog($sql, $parameters);
return $this->getEngine()->delete($sql, $parameters);
} | [
"public",
"function",
"delete",
"(",
"$",
"sql",
"=",
"null",
",",
"$",
"parameters",
"=",
"array",
"(",
")",
")",
"{",
"DB",
"::",
"addQueryLog",
"(",
"$",
"sql",
",",
"$",
"parameters",
")",
";",
"return",
"$",
"this",
"->",
"getEngine",
"(",
")"... | 删除
@param null $sql
@param array $parameters
@return int
@throws \Exception | [
"删除"
] | train | https://github.com/zodream/database/blob/03712219c057799d07350a3a2650c55bcc92c28e/src/Command.php#L269-L272 |
t3v/t3v_core | Classes/ViewHelpers/ArrayViewHelper.php | ArrayViewHelper.render | public function render(array $array, string $key) {
$result = null;
if (is_array($array) && $key) {
if (array_key_exists($key, $array)) {
$result = $array[$key];
}
}
return $result;
} | php | public function render(array $array, string $key) {
$result = null;
if (is_array($array) && $key) {
if (array_key_exists($key, $array)) {
$result = $array[$key];
}
}
return $result;
} | [
"public",
"function",
"render",
"(",
"array",
"$",
"array",
",",
"string",
"$",
"key",
")",
"{",
"$",
"result",
"=",
"null",
";",
"if",
"(",
"is_array",
"(",
"$",
"array",
")",
"&&",
"$",
"key",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
... | The view helper render function.
@param array $array The array
@param string $key The key
@return object|null The value for the key or null if the key does not exist | [
"The",
"view",
"helper",
"render",
"function",
"."
] | train | https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/ViewHelpers/ArrayViewHelper.php#L19-L29 |
SteeinRu/steein-sdk-php | src/Steein/SDK/Core/Http/Clients/SteeinCurlHttpClient.php | SteeinCurlHttpClient.openConnection | public function openConnection($url, $method, $body, array $headers, $timeOut)
{
$options = [
CURLOPT_CUSTOMREQUEST => $method,
CURLOPT_HTTPHEADER => $this->compileRequestHeaders($headers),
CURLOPT_URL => $url,
CURLOPT_CONNECTTIMEOUT => 10,
CURLOPT... | php | public function openConnection($url, $method, $body, array $headers, $timeOut)
{
$options = [
CURLOPT_CUSTOMREQUEST => $method,
CURLOPT_HTTPHEADER => $this->compileRequestHeaders($headers),
CURLOPT_URL => $url,
CURLOPT_CONNECTTIMEOUT => 10,
CURLOPT... | [
"public",
"function",
"openConnection",
"(",
"$",
"url",
",",
"$",
"method",
",",
"$",
"body",
",",
"array",
"$",
"headers",
",",
"$",
"timeOut",
")",
"{",
"$",
"options",
"=",
"[",
"CURLOPT_CUSTOMREQUEST",
"=>",
"$",
"method",
",",
"CURLOPT_HTTPHEADER",
... | Opens a new curl connection.
@param string $url The endpoint to send the request to.
@param string $method The request method.
@param string $body The body of the request.
@param array $headers The request headers.
@param int $timeOut The timeout in seconds for the request. | [
"Opens",
"a",
"new",
"curl",
"connection",
"."
] | train | https://github.com/SteeinRu/steein-sdk-php/blob/27113624a6582d27bb55d7c9724e8306739ef167/src/Steein/SDK/Core/Http/Clients/SteeinCurlHttpClient.php#L96-L122 |
SteeinRu/steein-sdk-php | src/Steein/SDK/Core/Http/Clients/SteeinCurlHttpClient.php | SteeinCurlHttpClient.extractResponseHeadersAndBody | public function extractResponseHeadersAndBody()
{
$parts = explode("\r\n\r\n", $this->rawResponse);
$rawBody = array_pop($parts);
$rawHeaders = implode("\r\n\r\n", $parts);
return [trim($rawHeaders), trim($rawBody)];
} | php | public function extractResponseHeadersAndBody()
{
$parts = explode("\r\n\r\n", $this->rawResponse);
$rawBody = array_pop($parts);
$rawHeaders = implode("\r\n\r\n", $parts);
return [trim($rawHeaders), trim($rawBody)];
} | [
"public",
"function",
"extractResponseHeadersAndBody",
"(",
")",
"{",
"$",
"parts",
"=",
"explode",
"(",
"\"\\r\\n\\r\\n\"",
",",
"$",
"this",
"->",
"rawResponse",
")",
";",
"$",
"rawBody",
"=",
"array_pop",
"(",
"$",
"parts",
")",
";",
"$",
"rawHeaders",
... | Extracts the headers and the body into a two-part array
@return array | [
"Extracts",
"the",
"headers",
"and",
"the",
"body",
"into",
"a",
"two",
"-",
"part",
"array"
] | train | https://github.com/SteeinRu/steein-sdk-php/blob/27113624a6582d27bb55d7c9724e8306739ef167/src/Steein/SDK/Core/Http/Clients/SteeinCurlHttpClient.php#L163-L170 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.