id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
3,600 | coolms/common | src/Form/View/Helper/FormRow.php | FormRow.getStaticElementHelper | protected function getStaticElementHelper()
{
if ($this->staticElementHelper) {
return $this->staticElementHelper;
}
$renderer = $this->getView();
if (method_exists($this->view, 'plugin')) {
$this->staticElementHelper = $renderer->plugin($this->defaultStaticE... | php | protected function getStaticElementHelper()
{
if ($this->staticElementHelper) {
return $this->staticElementHelper;
}
$renderer = $this->getView();
if (method_exists($this->view, 'plugin')) {
$this->staticElementHelper = $renderer->plugin($this->defaultStaticE... | [
"protected",
"function",
"getStaticElementHelper",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"staticElementHelper",
")",
"{",
"return",
"$",
"this",
"->",
"staticElementHelper",
";",
"}",
"$",
"renderer",
"=",
"$",
"this",
"->",
"getView",
"(",
")",
";"... | Retrieve the FormStatic helper
@return FormStatic | [
"Retrieve",
"the",
"FormStatic",
"helper"
] | 3572993cdcdb2898cdde396a2f1de9864b193660 | https://github.com/coolms/common/blob/3572993cdcdb2898cdde396a2f1de9864b193660/src/Form/View/Helper/FormRow.php#L243-L260 |
3,601 | sellerlabs/nucleus | src/SellerLabs/Nucleus/View/Node.php | Node.renderAttribute | protected function renderAttribute($name, $value = null)
{
if ($value === null) {
return $name;
}
if (is_array($value)) {
$value = implode(' ', $value);
}
return vsprintf('%s="%s"', [
$name,
Html::escape((string) $value),
... | php | protected function renderAttribute($name, $value = null)
{
if ($value === null) {
return $name;
}
if (is_array($value)) {
$value = implode(' ', $value);
}
return vsprintf('%s="%s"', [
$name,
Html::escape((string) $value),
... | [
"protected",
"function",
"renderAttribute",
"(",
"$",
"name",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"value",
"===",
"null",
")",
"{",
"return",
"$",
"name",
";",
"}",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"$... | Render a single attribute in a node.
@param string $name
@param null|string $value
@return string | [
"Render",
"a",
"single",
"attribute",
"in",
"a",
"node",
"."
] | c05d9c23d424a6bd5ab2e29140805cc6e37e4623 | https://github.com/sellerlabs/nucleus/blob/c05d9c23d424a6bd5ab2e29140805cc6e37e4623/src/SellerLabs/Nucleus/View/Node.php#L118-L132 |
3,602 | sellerlabs/nucleus | src/SellerLabs/Nucleus/View/Node.php | Node.renderAttributes | protected function renderAttributes()
{
return ArrayMap::of($this->attributes)
->map(function ($value, $name) {
return $this->renderAttribute($name, $value);
})
->join(' ');
} | php | protected function renderAttributes()
{
return ArrayMap::of($this->attributes)
->map(function ($value, $name) {
return $this->renderAttribute($name, $value);
})
->join(' ');
} | [
"protected",
"function",
"renderAttributes",
"(",
")",
"{",
"return",
"ArrayMap",
"::",
"of",
"(",
"$",
"this",
"->",
"attributes",
")",
"->",
"map",
"(",
"function",
"(",
"$",
"value",
",",
"$",
"name",
")",
"{",
"return",
"$",
"this",
"->",
"renderAt... | Render the attributes part of the opening tag.
@return string | [
"Render",
"the",
"attributes",
"part",
"of",
"the",
"opening",
"tag",
"."
] | c05d9c23d424a6bd5ab2e29140805cc6e37e4623 | https://github.com/sellerlabs/nucleus/blob/c05d9c23d424a6bd5ab2e29140805cc6e37e4623/src/SellerLabs/Nucleus/View/Node.php#L139-L146 |
3,603 | sellerlabs/nucleus | src/SellerLabs/Nucleus/View/Node.php | Node.renderContent | protected function renderContent()
{
if (is_string($this->content)
|| $this->content instanceof SafeHtmlWrapper
|| $this->content instanceof SafeHtmlProducerInterface
) {
return Html::escape($this->content);
} elseif ($this->content instanceof RenderableIn... | php | protected function renderContent()
{
if (is_string($this->content)
|| $this->content instanceof SafeHtmlWrapper
|| $this->content instanceof SafeHtmlProducerInterface
) {
return Html::escape($this->content);
} elseif ($this->content instanceof RenderableIn... | [
"protected",
"function",
"renderContent",
"(",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"this",
"->",
"content",
")",
"||",
"$",
"this",
"->",
"content",
"instanceof",
"SafeHtmlWrapper",
"||",
"$",
"this",
"->",
"content",
"instanceof",
"SafeHtmlProducerInt... | Render the content of the tag.
@throws CoreException
@return string | [
"Render",
"the",
"content",
"of",
"the",
"tag",
"."
] | c05d9c23d424a6bd5ab2e29140805cc6e37e4623 | https://github.com/sellerlabs/nucleus/blob/c05d9c23d424a6bd5ab2e29140805cc6e37e4623/src/SellerLabs/Nucleus/View/Node.php#L154-L183 |
3,604 | sellerlabs/nucleus | src/SellerLabs/Nucleus/View/Node.php | Node.render | public function render()
{
$result = $this->spec->check($this->attributes);
if ($result->failed()) {
throw new InvalidAttributesException($result);
}
$attributes = $this->renderAttributes();
if (strlen($attributes)) {
$attributes = ' ' . $attributes;
... | php | public function render()
{
$result = $this->spec->check($this->attributes);
if ($result->failed()) {
throw new InvalidAttributesException($result);
}
$attributes = $this->renderAttributes();
if (strlen($attributes)) {
$attributes = ' ' . $attributes;
... | [
"public",
"function",
"render",
"(",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"spec",
"->",
"check",
"(",
"$",
"this",
"->",
"attributes",
")",
";",
"if",
"(",
"$",
"result",
"->",
"failed",
"(",
")",
")",
"{",
"throw",
"new",
"InvalidAttri... | Render the Node.
@throws CoreException
@throws InvalidAttributesException
@return string | [
"Render",
"the",
"Node",
"."
] | c05d9c23d424a6bd5ab2e29140805cc6e37e4623 | https://github.com/sellerlabs/nucleus/blob/c05d9c23d424a6bd5ab2e29140805cc6e37e4623/src/SellerLabs/Nucleus/View/Node.php#L192-L220 |
3,605 | loopsframework/base | src/Loops/Service/WebCore.php | WebCore.dispatch | public function dispatch($url, Request $request, Response $response) {
$output = $this->resolveOutput($url, $request->isAjax());
if(is_object($output)) {
if($output instanceof ElementInterface) {
$response->addHeader("X-Loops-ID", $output->getLoopsId());
}
... | php | public function dispatch($url, Request $request, Response $response) {
$output = $this->resolveOutput($url, $request->isAjax());
if(is_object($output)) {
if($output instanceof ElementInterface) {
$response->addHeader("X-Loops-ID", $output->getLoopsId());
}
... | [
"public",
"function",
"dispatch",
"(",
"$",
"url",
",",
"Request",
"$",
"request",
",",
"Response",
"$",
"response",
")",
"{",
"$",
"output",
"=",
"$",
"this",
"->",
"resolveOutput",
"(",
"$",
"url",
",",
"$",
"request",
"->",
"isAjax",
"(",
")",
")"... | Dispatches a web request to an url and returns the contents to display
To generate the output, other resources are used such as the request service.
After the page element is resolved (see resolvePage method for detail) its action method is called to determine if the requests could be handled.
Depending on the result... | [
"Dispatches",
"a",
"web",
"request",
"to",
"an",
"url",
"and",
"returns",
"the",
"contents",
"to",
"display"
] | 5a15172ed4e543d7d5ecd8bd65e31f26bab3d192 | https://github.com/loopsframework/base/blob/5a15172ed4e543d7d5ecd8bd65e31f26bab3d192/src/Loops/Service/WebCore.php#L93-L107 |
3,606 | loopsframework/base | src/Loops/Service/WebCore.php | WebCore.getParameterCount | public static function getParameterCount($pageclass) {
if(is_object($pageclass)) {
$pageclass = get_class($pageclass);
}
$count = array_count_values(explode("\\", $pageclass));
return array_key_exists("_", $count) ? $count["_"] : 0;
} | php | public static function getParameterCount($pageclass) {
if(is_object($pageclass)) {
$pageclass = get_class($pageclass);
}
$count = array_count_values(explode("\\", $pageclass));
return array_key_exists("_", $count) ? $count["_"] : 0;
} | [
"public",
"static",
"function",
"getParameterCount",
"(",
"$",
"pageclass",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"pageclass",
")",
")",
"{",
"$",
"pageclass",
"=",
"get_class",
"(",
"$",
"pageclass",
")",
";",
"}",
"$",
"count",
"=",
"array_count_... | Counts the number of the needed page parameter given the classname or an object
See method resolvePage for details
@param string $pageclass
@return integer The number of needed page parameter. | [
"Counts",
"the",
"number",
"of",
"the",
"needed",
"page",
"parameter",
"given",
"the",
"classname",
"or",
"an",
"object"
] | 5a15172ed4e543d7d5ecd8bd65e31f26bab3d192 | https://github.com/loopsframework/base/blob/5a15172ed4e543d7d5ecd8bd65e31f26bab3d192/src/Loops/Service/WebCore.php#L162-L168 |
3,607 | loopsframework/base | src/Loops/Service/WebCore.php | WebCore.display | private function display($element, Request $request, Response $response) {
$loops = $this->getLoops();
$renderer = $loops->getService("renderer");
$appearance = [];
if($request->isAjax()) {
$renderer->addExtraAppearance("ajax");
}
$renderer->addExtraAppeara... | php | private function display($element, Request $request, Response $response) {
$loops = $this->getLoops();
$renderer = $loops->getService("renderer");
$appearance = [];
if($request->isAjax()) {
$renderer->addExtraAppearance("ajax");
}
$renderer->addExtraAppeara... | [
"private",
"function",
"display",
"(",
"$",
"element",
",",
"Request",
"$",
"request",
",",
"Response",
"$",
"response",
")",
"{",
"$",
"loops",
"=",
"$",
"this",
"->",
"getLoops",
"(",
")",
";",
"$",
"renderer",
"=",
"$",
"loops",
"->",
"getService",
... | Renders an object with the renderer | [
"Renders",
"an",
"object",
"with",
"the",
"renderer"
] | 5a15172ed4e543d7d5ecd8bd65e31f26bab3d192 | https://github.com/loopsframework/base/blob/5a15172ed4e543d7d5ecd8bd65e31f26bab3d192/src/Loops/Service/WebCore.php#L173-L186 |
3,608 | loopsframework/base | src/Loops/Service/WebCore.php | WebCore.getPagePathFromClassname | public static function getPagePathFromClassname($classname, $page_parameter = [], Loops $loops = NULL) {
$count = count($page_parameter);
if(!$routes = self::getRoutes($loops ?: Loops::getCurrentLoops())) {
return FALSE;
}
$routes = array_filter($routes, function($value, $k... | php | public static function getPagePathFromClassname($classname, $page_parameter = [], Loops $loops = NULL) {
$count = count($page_parameter);
if(!$routes = self::getRoutes($loops ?: Loops::getCurrentLoops())) {
return FALSE;
}
$routes = array_filter($routes, function($value, $k... | [
"public",
"static",
"function",
"getPagePathFromClassname",
"(",
"$",
"classname",
",",
"$",
"page_parameter",
"=",
"[",
"]",
",",
"Loops",
"$",
"loops",
"=",
"NULL",
")",
"{",
"$",
"count",
"=",
"count",
"(",
"$",
"page_parameter",
")",
";",
"if",
"(",
... | Generates the page path for a page element
This function also replaces the page parameter placeholders with given arguments
@param string|object $classname The classname of the element or an object
@param array<string> $page_parameter The page parameter that will be filled into the placeholders
@param Loops Use this ... | [
"Generates",
"the",
"page",
"path",
"for",
"a",
"page",
"element"
] | 5a15172ed4e543d7d5ecd8bd65e31f26bab3d192 | https://github.com/loopsframework/base/blob/5a15172ed4e543d7d5ecd8bd65e31f26bab3d192/src/Loops/Service/WebCore.php#L197-L227 |
3,609 | loopsframework/base | src/Loops/Service/WebCore.php | WebCore.getRoutes | private static function getRoutes($loops) {
$cache = $loops->getService("cache");
$key = "Loops-WebCore-getRoutes";
if($cache->contains($key)) {
return $cache->fetch($key);
}
if(!$loops->hasService("application")) {
return FALSE;
}
$clas... | php | private static function getRoutes($loops) {
$cache = $loops->getService("cache");
$key = "Loops-WebCore-getRoutes";
if($cache->contains($key)) {
return $cache->fetch($key);
}
if(!$loops->hasService("application")) {
return FALSE;
}
$clas... | [
"private",
"static",
"function",
"getRoutes",
"(",
"$",
"loops",
")",
"{",
"$",
"cache",
"=",
"$",
"loops",
"->",
"getService",
"(",
"\"cache\"",
")",
";",
"$",
"key",
"=",
"\"Loops-WebCore-getRoutes\"",
";",
"if",
"(",
"$",
"cache",
"->",
"contains",
"(... | Generates an array with all available routes | [
"Generates",
"an",
"array",
"with",
"all",
"available",
"routes"
] | 5a15172ed4e543d7d5ecd8bd65e31f26bab3d192 | https://github.com/loopsframework/base/blob/5a15172ed4e543d7d5ecd8bd65e31f26bab3d192/src/Loops/Service/WebCore.php#L232-L286 |
3,610 | loopsframework/base | src/Loops/Service/WebCore.php | WebCore.resolvePage | private function resolvePage($url, $processing = []) {
$path = ltrim($url, "/");
$routes = self::getRoutes($this->getLoops());
foreach($routes as $route => $pageclass) {
$regexp = "/^".str_replace("\*", "([^\/]+)", preg_quote($route, "/"))."/";
if(!preg_match($regexp, $... | php | private function resolvePage($url, $processing = []) {
$path = ltrim($url, "/");
$routes = self::getRoutes($this->getLoops());
foreach($routes as $route => $pageclass) {
$regexp = "/^".str_replace("\*", "([^\/]+)", preg_quote($route, "/"))."/";
if(!preg_match($regexp, $... | [
"private",
"function",
"resolvePage",
"(",
"$",
"url",
",",
"$",
"processing",
"=",
"[",
"]",
")",
"{",
"$",
"path",
"=",
"ltrim",
"(",
"$",
"url",
",",
"\"/\"",
")",
";",
"$",
"routes",
"=",
"self",
"::",
"getRoutes",
"(",
"$",
"this",
"->",
"ge... | Find the page object that should be displayed based on the accessed url
This method will resolve the url to a page class. It will try to find and autoload
the class with the same name as the url (including namespaces) inside the "Pages" namespace.
The first letter of every part of the url is capitalized to honor the l... | [
"Find",
"the",
"page",
"object",
"that",
"should",
"be",
"displayed",
"based",
"on",
"the",
"accessed",
"url"
] | 5a15172ed4e543d7d5ecd8bd65e31f26bab3d192 | https://github.com/loopsframework/base/blob/5a15172ed4e543d7d5ecd8bd65e31f26bab3d192/src/Loops/Service/WebCore.php#L322-L373 |
3,611 | php-rest-server/core | src/Core/Helpers/UrlHelper.php | UrlHelper.dashToCamelCase | public static function dashToCamelCase($string)
{
$result = '';
$urlPart = explode('-', $string);
foreach ($urlPart as $word) {
$result .= ucfirst(strtolower($word));
}
return $result;
} | php | public static function dashToCamelCase($string)
{
$result = '';
$urlPart = explode('-', $string);
foreach ($urlPart as $word) {
$result .= ucfirst(strtolower($word));
}
return $result;
} | [
"public",
"static",
"function",
"dashToCamelCase",
"(",
"$",
"string",
")",
"{",
"$",
"result",
"=",
"''",
";",
"$",
"urlPart",
"=",
"explode",
"(",
"'-'",
",",
"$",
"string",
")",
";",
"foreach",
"(",
"$",
"urlPart",
"as",
"$",
"word",
")",
"{",
"... | Replace dashes to CamelCase string format
@param string $string
@return string | [
"Replace",
"dashes",
"to",
"CamelCase",
"string",
"format"
] | 4d1ee0d4b6bd7d170cf1ec924a8b743b5d486888 | https://github.com/php-rest-server/core/blob/4d1ee0d4b6bd7d170cf1ec924a8b743b5d486888/src/Core/Helpers/UrlHelper.php#L28-L36 |
3,612 | php-rest-server/core | src/Core/Helpers/UrlHelper.php | UrlHelper.routeParse | public static function routeParse($from, $to, $url)
{
// validation and parse route pattern
$result = preg_match('/^(\(([^\)]+)\)|[^\/]*)(.*)/', $from, $data);
if ($result !== 1) {
return false;
}
// prepare patter to test url and replacement
$pattern = ... | php | public static function routeParse($from, $to, $url)
{
// validation and parse route pattern
$result = preg_match('/^(\(([^\)]+)\)|[^\/]*)(.*)/', $from, $data);
if ($result !== 1) {
return false;
}
// prepare patter to test url and replacement
$pattern = ... | [
"public",
"static",
"function",
"routeParse",
"(",
"$",
"from",
",",
"$",
"to",
",",
"$",
"url",
")",
"{",
"// validation and parse route pattern",
"$",
"result",
"=",
"preg_match",
"(",
"'/^(\\(([^\\)]+)\\)|[^\\/]*)(.*)/'",
",",
"$",
"from",
",",
"$",
"data",
... | Parse route and return object RouteInfo with information about accepted
route or return false if route pattern does not math
@param string $from
@param string $to
@param string $url
@return bool|RouteInfo | [
"Parse",
"route",
"and",
"return",
"object",
"RouteInfo",
"with",
"information",
"about",
"accepted",
"route",
"or",
"return",
"false",
"if",
"route",
"pattern",
"does",
"not",
"math"
] | 4d1ee0d4b6bd7d170cf1ec924a8b743b5d486888 | https://github.com/php-rest-server/core/blob/4d1ee0d4b6bd7d170cf1ec924a8b743b5d486888/src/Core/Helpers/UrlHelper.php#L48-L75 |
3,613 | ischenko/yii2-jsloader | src/Behavior.php | Behavior.processBundles | public function processBundles()
{
$loader = $this->getLoader();
$view = $this->ensureView($this->owner);
foreach (array_keys($view->assetBundles) as $name) {
$loader->registerAssetBundle($name);
}
} | php | public function processBundles()
{
$loader = $this->getLoader();
$view = $this->ensureView($this->owner);
foreach (array_keys($view->assetBundles) as $name) {
$loader->registerAssetBundle($name);
}
} | [
"public",
"function",
"processBundles",
"(",
")",
"{",
"$",
"loader",
"=",
"$",
"this",
"->",
"getLoader",
"(",
")",
";",
"$",
"view",
"=",
"$",
"this",
"->",
"ensureView",
"(",
"$",
"this",
"->",
"owner",
")",
";",
"foreach",
"(",
"array_keys",
"(",... | Registers asset bundles in the JS loader | [
"Registers",
"asset",
"bundles",
"in",
"the",
"JS",
"loader"
] | 873242c4ab80eb160519d8ba0c4afb92aa89edfb | https://github.com/ischenko/yii2-jsloader/blob/873242c4ab80eb160519d8ba0c4afb92aa89edfb/src/Behavior.php#L55-L63 |
3,614 | face-orm/face | lib/Face/Sql/Reader/QueryArrayReader.php | QueryArrayReader.read | public function read(\PDOStatement $stmt)
{
$this->unfoundPrecedence=array();
$preparedReader = new PreparedOperations($this->FQuery);
while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
// loop over joined faces
foreach ($preparedReader->getPreparedFaces() as $baseP... | php | public function read(\PDOStatement $stmt)
{
$this->unfoundPrecedence=array();
$preparedReader = new PreparedOperations($this->FQuery);
while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
// loop over joined faces
foreach ($preparedReader->getPreparedFaces() as $baseP... | [
"public",
"function",
"read",
"(",
"\\",
"PDOStatement",
"$",
"stmt",
")",
"{",
"$",
"this",
"->",
"unfoundPrecedence",
"=",
"array",
"(",
")",
";",
"$",
"preparedReader",
"=",
"new",
"PreparedOperations",
"(",
"$",
"this",
"->",
"FQuery",
")",
";",
"whi... | parse the pdo statement of the fquery
@param \PDOStatement $stmt
@return \Face\Sql\Result\ResultSet | [
"parse",
"the",
"pdo",
"statement",
"of",
"the",
"fquery"
] | 85b412c66ff41d0fe73b7e7b69bc9a5ac5f7f428 | https://github.com/face-orm/face/blob/85b412c66ff41d0fe73b7e7b69bc9a5ac5f7f428/lib/Face/Sql/Reader/QueryArrayReader.php#L60-L119 |
3,615 | face-orm/face | lib/Face/Sql/Reader/QueryArrayReader.php | QueryArrayReader.createInstance | protected function createInstance(\Face\Core\EntityFace $face)
{
$className = $face->getClass();
$instance = new $className();
return $instance;
} | php | protected function createInstance(\Face\Core\EntityFace $face)
{
$className = $face->getClass();
$instance = new $className();
return $instance;
} | [
"protected",
"function",
"createInstance",
"(",
"\\",
"Face",
"\\",
"Core",
"\\",
"EntityFace",
"$",
"face",
")",
"{",
"$",
"className",
"=",
"$",
"face",
"->",
"getClass",
"(",
")",
";",
"$",
"instance",
"=",
"new",
"$",
"className",
"(",
")",
";",
... | Create an instance from an assoc array returned by sql
@param \Face\Core\EntityFace $face the face that describes the entity
@param array $array the array of data
@param string $basePath
@param array $faceList
@return object the new instance of the element | [
"Create",
"an",
"instance",
"from",
"an",
"assoc",
"array",
"returned",
"by",
"sql"
] | 85b412c66ff41d0fe73b7e7b69bc9a5ac5f7f428 | https://github.com/face-orm/face/blob/85b412c66ff41d0fe73b7e7b69bc9a5ac5f7f428/lib/Face/Sql/Reader/QueryArrayReader.php#L130-L136 |
3,616 | unyx/console | output/formatting/Style.php | Style.fromString | public static function fromString(string $string, array $properties = null) : ?Style
{
if (!preg_match_all('/([^:]+):([^;]+)(;|$)/', strtolower($string), $matches, PREG_SET_ORDER)) {
return null;
}
// H-okay, seems we got a match.
$style = new Style(null);
forea... | php | public static function fromString(string $string, array $properties = null) : ?Style
{
if (!preg_match_all('/([^:]+):([^;]+)(;|$)/', strtolower($string), $matches, PREG_SET_ORDER)) {
return null;
}
// H-okay, seems we got a match.
$style = new Style(null);
forea... | [
"public",
"static",
"function",
"fromString",
"(",
"string",
"$",
"string",
",",
"array",
"$",
"properties",
"=",
"null",
")",
":",
"?",
"Style",
"{",
"if",
"(",
"!",
"preg_match_all",
"(",
"'/([^:]+):([^;]+)(;|$)/'",
",",
"strtolower",
"(",
"$",
"string",
... | Factory which attempts to create a new Style based on an inline styling syntax.
@param string $string The string to parse.
@param array $properties An array containing at most 2 keys: 'foreground' and 'background',
denoting the names those properties will be sought for to in the string.
Defaults to:... | [
"Factory",
"which",
"attempts",
"to",
"create",
"a",
"new",
"Style",
"based",
"on",
"an",
"inline",
"styling",
"syntax",
"."
] | b4a76e08bbb5428b0349c0ec4259a914f81a2957 | https://github.com/unyx/console/blob/b4a76e08bbb5428b0349c0ec4259a914f81a2957/output/formatting/Style.php#L87-L112 |
3,617 | unyx/console | output/formatting/Style.php | Style.setColor | protected function setColor(string $type, ?string $color) : interfaces\Style
{
if (isset($color) && !isset(static::${$type.'s'}[$color])) {
throw new \InvalidArgumentException("The $type color [$color] is not recognized.");
}
$this->$type = $color;
return $this;
} | php | protected function setColor(string $type, ?string $color) : interfaces\Style
{
if (isset($color) && !isset(static::${$type.'s'}[$color])) {
throw new \InvalidArgumentException("The $type color [$color] is not recognized.");
}
$this->$type = $color;
return $this;
} | [
"protected",
"function",
"setColor",
"(",
"string",
"$",
"type",
",",
"?",
"string",
"$",
"color",
")",
":",
"interfaces",
"\\",
"Style",
"{",
"if",
"(",
"isset",
"(",
"$",
"color",
")",
"&&",
"!",
"isset",
"(",
"static",
"::",
"$",
"{",
"$",
"type... | Sets a specific type of color on this Style.
@param string $type The type of the color to set.
@param string $color The color to set.
@return $this | [
"Sets",
"a",
"specific",
"type",
"of",
"color",
"on",
"this",
"Style",
"."
] | b4a76e08bbb5428b0349c0ec4259a914f81a2957 | https://github.com/unyx/console/blob/b4a76e08bbb5428b0349c0ec4259a914f81a2957/output/formatting/Style.php#L209-L218 |
3,618 | mikeshiyan/iterate | src/Scenario/ConsoleProgressBarTrait.php | ConsoleProgressBarTrait.preRun | public function preRun(): void {
if ($output = $this->getOutput()) {
$max = 0;
$iterator = $this->getIterator();
if ($iterator instanceof \SplFileObject) {
$max = $iterator->getSize();
}
elseif ($iterator instanceof \Countable) {
$max = count($iterator);
}
... | php | public function preRun(): void {
if ($output = $this->getOutput()) {
$max = 0;
$iterator = $this->getIterator();
if ($iterator instanceof \SplFileObject) {
$max = $iterator->getSize();
}
elseif ($iterator instanceof \Countable) {
$max = count($iterator);
}
... | [
"public",
"function",
"preRun",
"(",
")",
":",
"void",
"{",
"if",
"(",
"$",
"output",
"=",
"$",
"this",
"->",
"getOutput",
"(",
")",
")",
"{",
"$",
"max",
"=",
"0",
";",
"$",
"iterator",
"=",
"$",
"this",
"->",
"getIterator",
"(",
")",
";",
"if... | Starts a new progress bar output in the pre-run phase.
@see \Shiyan\Iterate\Scenario\ScenarioInterface::preRun() | [
"Starts",
"a",
"new",
"progress",
"bar",
"output",
"in",
"the",
"pre",
"-",
"run",
"phase",
"."
] | 595fc2e23eead334b4f333621b2995bfe649f1f2 | https://github.com/mikeshiyan/iterate/blob/595fc2e23eead334b4f333621b2995bfe649f1f2/src/Scenario/ConsoleProgressBarTrait.php#L71-L91 |
3,619 | mikeshiyan/iterate | src/Scenario/ConsoleProgressBarTrait.php | ConsoleProgressBarTrait.postSearch | public function postSearch(): void {
if ($this->progress) {
$iterator = $this->getIterator();
if ($iterator instanceof \SplFileObject) {
// Get current byte offset, after the line was read.
$this->progress->setProgress($iterator->ftell());
}
elseif (is_int($key = $iterator->... | php | public function postSearch(): void {
if ($this->progress) {
$iterator = $this->getIterator();
if ($iterator instanceof \SplFileObject) {
// Get current byte offset, after the line was read.
$this->progress->setProgress($iterator->ftell());
}
elseif (is_int($key = $iterator->... | [
"public",
"function",
"postSearch",
"(",
")",
":",
"void",
"{",
"if",
"(",
"$",
"this",
"->",
"progress",
")",
"{",
"$",
"iterator",
"=",
"$",
"this",
"->",
"getIterator",
"(",
")",
";",
"if",
"(",
"$",
"iterator",
"instanceof",
"\\",
"SplFileObject",
... | Updates the current progress in the post-search phase.
@see \Shiyan\Iterate\Scenario\ScenarioInterface::postSearch() | [
"Updates",
"the",
"current",
"progress",
"in",
"the",
"post",
"-",
"search",
"phase",
"."
] | 595fc2e23eead334b4f333621b2995bfe649f1f2 | https://github.com/mikeshiyan/iterate/blob/595fc2e23eead334b4f333621b2995bfe649f1f2/src/Scenario/ConsoleProgressBarTrait.php#L98-L115 |
3,620 | mikeshiyan/iterate | src/Scenario/ConsoleProgressBarTrait.php | ConsoleProgressBarTrait.postRun | public function postRun(): void {
if ($this->progress) {
$this->progress->finish();
// Progress bar does not print a new-line at the end.
$this->getOutput()->writeln('');
}
} | php | public function postRun(): void {
if ($this->progress) {
$this->progress->finish();
// Progress bar does not print a new-line at the end.
$this->getOutput()->writeln('');
}
} | [
"public",
"function",
"postRun",
"(",
")",
":",
"void",
"{",
"if",
"(",
"$",
"this",
"->",
"progress",
")",
"{",
"$",
"this",
"->",
"progress",
"->",
"finish",
"(",
")",
";",
"// Progress bar does not print a new-line at the end.",
"$",
"this",
"->",
"getOut... | Finishes the progress output in the post-run phase.
@see \Shiyan\Iterate\Scenario\ScenarioInterface::postRun() | [
"Finishes",
"the",
"progress",
"output",
"in",
"the",
"post",
"-",
"run",
"phase",
"."
] | 595fc2e23eead334b4f333621b2995bfe649f1f2 | https://github.com/mikeshiyan/iterate/blob/595fc2e23eead334b4f333621b2995bfe649f1f2/src/Scenario/ConsoleProgressBarTrait.php#L122-L128 |
3,621 | mikeshiyan/iterate | src/Scenario/ConsoleProgressBarTrait.php | ConsoleProgressBarTrait.outputInProgress | protected function outputInProgress(string $line): void {
if ($this->progress) {
$this->progress->clear();
$this->getOutput()->writeln($line);
$this->progress->display();
}
} | php | protected function outputInProgress(string $line): void {
if ($this->progress) {
$this->progress->clear();
$this->getOutput()->writeln($line);
$this->progress->display();
}
} | [
"protected",
"function",
"outputInProgress",
"(",
"string",
"$",
"line",
")",
":",
"void",
"{",
"if",
"(",
"$",
"this",
"->",
"progress",
")",
"{",
"$",
"this",
"->",
"progress",
"->",
"clear",
"(",
")",
";",
"$",
"this",
"->",
"getOutput",
"(",
")",... | Outputs a line of text while a progress bar is running.
@param string $line
Text to output. | [
"Outputs",
"a",
"line",
"of",
"text",
"while",
"a",
"progress",
"bar",
"is",
"running",
"."
] | 595fc2e23eead334b4f333621b2995bfe649f1f2 | https://github.com/mikeshiyan/iterate/blob/595fc2e23eead334b4f333621b2995bfe649f1f2/src/Scenario/ConsoleProgressBarTrait.php#L136-L142 |
3,622 | zepi/turbo-base | Zepi/Core/AccessControl/src/Entity/AccessEntity.php | AccessEntity.getMetaData | public function getMetaData($key)
{
if (!isset($this->metaData[$key])) {
return false;
}
return $this->metaData[$key];
} | php | public function getMetaData($key)
{
if (!isset($this->metaData[$key])) {
return false;
}
return $this->metaData[$key];
} | [
"public",
"function",
"getMetaData",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"metaData",
"[",
"$",
"key",
"]",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"$",
"this",
"->",
"metaData",
"[",
"$",
"key... | Returns the meta data value for the given key
@access public
@param string $key
@return mixed | [
"Returns",
"the",
"meta",
"data",
"value",
"for",
"the",
"given",
"key"
] | 9a36d8c7649317f55f91b2adf386bd1f04ec02a3 | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Core/AccessControl/src/Entity/AccessEntity.php#L195-L202 |
3,623 | zepi/turbo-base | Zepi/Core/AccessControl/src/Entity/AccessEntity.php | AccessEntity.hasAccess | public function hasAccess($accessLevel)
{
foreach ($this->permissions as $permission) {
/**
* If the user has the \Globa\* access level he can
* do everything
*/
if ($permission == '\\Global\\*') {
return true;
}
... | php | public function hasAccess($accessLevel)
{
foreach ($this->permissions as $permission) {
/**
* If the user has the \Globa\* access level he can
* do everything
*/
if ($permission == '\\Global\\*') {
return true;
}
... | [
"public",
"function",
"hasAccess",
"(",
"$",
"accessLevel",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"permissions",
"as",
"$",
"permission",
")",
"{",
"/**\n * If the user has the \\Globa\\* access level he can\n * do everything\n */",
... | Returns true if the access entity has access to
the given permission access level
@access public
@param string $accessLevel
@return boolean | [
"Returns",
"true",
"if",
"the",
"access",
"entity",
"has",
"access",
"to",
"the",
"given",
"permission",
"access",
"level"
] | 9a36d8c7649317f55f91b2adf386bd1f04ec02a3 | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Core/AccessControl/src/Entity/AccessEntity.php#L257-L287 |
3,624 | gossi/trixionary | src/model/Base/SkillGroup.php | SkillGroup.setGroup | public function setGroup(ChildGroup $v = null)
{
// aggregate_column_relation behavior
if (null !== $this->aGroup && $v !== $this->aGroup) {
$this->oldGroupSkillCount = $this->aGroup;
}
if ($v === null) {
$this->setGroupId(NULL);
} else {
$... | php | public function setGroup(ChildGroup $v = null)
{
// aggregate_column_relation behavior
if (null !== $this->aGroup && $v !== $this->aGroup) {
$this->oldGroupSkillCount = $this->aGroup;
}
if ($v === null) {
$this->setGroupId(NULL);
} else {
$... | [
"public",
"function",
"setGroup",
"(",
"ChildGroup",
"$",
"v",
"=",
"null",
")",
"{",
"// aggregate_column_relation behavior",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"aGroup",
"&&",
"$",
"v",
"!==",
"$",
"this",
"->",
"aGroup",
")",
"{",
"$",
"this... | Declares an association between this object and a ChildGroup object.
@param ChildGroup $v
@return $this|\gossi\trixionary\model\SkillGroup The current object (for fluent API support)
@throws PropelException | [
"Declares",
"an",
"association",
"between",
"this",
"object",
"and",
"a",
"ChildGroup",
"object",
"."
] | 221a6c5322473d7d7f8e322958a3ee46d87da150 | https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/model/Base/SkillGroup.php#L1074-L1096 |
3,625 | gossi/trixionary | src/model/Base/SkillGroup.php | SkillGroup.getGroup | public function getGroup(ConnectionInterface $con = null)
{
if ($this->aGroup === null && ($this->group_id !== null)) {
$this->aGroup = ChildGroupQuery::create()->findPk($this->group_id, $con);
/* The following can be used additionally to
guarantee the related object ... | php | public function getGroup(ConnectionInterface $con = null)
{
if ($this->aGroup === null && ($this->group_id !== null)) {
$this->aGroup = ChildGroupQuery::create()->findPk($this->group_id, $con);
/* The following can be used additionally to
guarantee the related object ... | [
"public",
"function",
"getGroup",
"(",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"aGroup",
"===",
"null",
"&&",
"(",
"$",
"this",
"->",
"group_id",
"!==",
"null",
")",
")",
"{",
"$",
"this",
"->",
"aGroup... | Get the associated ChildGroup object
@param ConnectionInterface $con Optional Connection object.
@return ChildGroup The associated ChildGroup object.
@throws PropelException | [
"Get",
"the",
"associated",
"ChildGroup",
"object"
] | 221a6c5322473d7d7f8e322958a3ee46d87da150 | https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/model/Base/SkillGroup.php#L1106-L1120 |
3,626 | gossi/trixionary | src/model/Base/SkillGroup.php | SkillGroup.updateRelatedGroupSkillCount | protected function updateRelatedGroupSkillCount(ConnectionInterface $con)
{
if ($group = $this->getGroup()) {
$group->updateSkillCount($con);
}
if ($this->oldGroupSkillCount) {
$this->oldGroupSkillCount->updateSkillCount($con);
$this->oldGroupSkillCount = ... | php | protected function updateRelatedGroupSkillCount(ConnectionInterface $con)
{
if ($group = $this->getGroup()) {
$group->updateSkillCount($con);
}
if ($this->oldGroupSkillCount) {
$this->oldGroupSkillCount->updateSkillCount($con);
$this->oldGroupSkillCount = ... | [
"protected",
"function",
"updateRelatedGroupSkillCount",
"(",
"ConnectionInterface",
"$",
"con",
")",
"{",
"if",
"(",
"$",
"group",
"=",
"$",
"this",
"->",
"getGroup",
"(",
")",
")",
"{",
"$",
"group",
"->",
"updateSkillCount",
"(",
"$",
"con",
")",
";",
... | Update the aggregate column in the related Group object
@param ConnectionInterface $con A connection object | [
"Update",
"the",
"aggregate",
"column",
"in",
"the",
"related",
"Group",
"object"
] | 221a6c5322473d7d7f8e322958a3ee46d87da150 | https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/model/Base/SkillGroup.php#L1229-L1238 |
3,627 | ellipsephp/validation | src/Validator.php | Validator.withLabels | public function withLabels(array $labels): Validator
{
$translator = $this->translator->withLabels($labels);
return new Validator($this->rules, $this->parser, $translator);
} | php | public function withLabels(array $labels): Validator
{
$translator = $this->translator->withLabels($labels);
return new Validator($this->rules, $this->parser, $translator);
} | [
"public",
"function",
"withLabels",
"(",
"array",
"$",
"labels",
")",
":",
"Validator",
"{",
"$",
"translator",
"=",
"$",
"this",
"->",
"translator",
"->",
"withLabels",
"(",
"$",
"labels",
")",
";",
"return",
"new",
"Validator",
"(",
"$",
"this",
"->",
... | Return a new validator with the given list of labels added to the
translator.
@param array $labels
@return \Ellipse\Validation\Validator | [
"Return",
"a",
"new",
"validator",
"with",
"the",
"given",
"list",
"of",
"labels",
"added",
"to",
"the",
"translator",
"."
] | 5a7e11807099165ff6217bf8c38df4b21d99599d | https://github.com/ellipsephp/validation/blob/5a7e11807099165ff6217bf8c38df4b21d99599d/src/Validator.php#L50-L55 |
3,628 | ellipsephp/validation | src/Validator.php | Validator.withTemplates | public function withTemplates(array $templates): Validator
{
$translator = $this->translator->withTemplates($templates);
return new Validator($this->rules, $this->parser, $translator);
} | php | public function withTemplates(array $templates): Validator
{
$translator = $this->translator->withTemplates($templates);
return new Validator($this->rules, $this->parser, $translator);
} | [
"public",
"function",
"withTemplates",
"(",
"array",
"$",
"templates",
")",
":",
"Validator",
"{",
"$",
"translator",
"=",
"$",
"this",
"->",
"translator",
"->",
"withTemplates",
"(",
"$",
"templates",
")",
";",
"return",
"new",
"Validator",
"(",
"$",
"thi... | Return a new validator with the given list of templates added to the
translator.
@param array $templates
@return \Ellipse\Validation\Validator | [
"Return",
"a",
"new",
"validator",
"with",
"the",
"given",
"list",
"of",
"templates",
"added",
"to",
"the",
"translator",
"."
] | 5a7e11807099165ff6217bf8c38df4b21d99599d | https://github.com/ellipsephp/validation/blob/5a7e11807099165ff6217bf8c38df4b21d99599d/src/Validator.php#L64-L69 |
3,629 | ellipsephp/validation | src/Validator.php | Validator.validate | public function validate(array $input = []): ValidationResult
{
$results = [];
foreach ($this->rules as $key => $definition) {
$rules = $this->parser->parseRulesDefinition($definition);
$results[$key] = $rules->validate($key, $input);
}
return new Validat... | php | public function validate(array $input = []): ValidationResult
{
$results = [];
foreach ($this->rules as $key => $definition) {
$rules = $this->parser->parseRulesDefinition($definition);
$results[$key] = $rules->validate($key, $input);
}
return new Validat... | [
"public",
"function",
"validate",
"(",
"array",
"$",
"input",
"=",
"[",
"]",
")",
":",
"ValidationResult",
"{",
"$",
"results",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"rules",
"as",
"$",
"key",
"=>",
"$",
"definition",
")",
"{",
"$"... | Validate the given input against the rules.
@param array $input
@return \Ellipse\Validation\ValidationResult | [
"Validate",
"the",
"given",
"input",
"against",
"the",
"rules",
"."
] | 5a7e11807099165ff6217bf8c38df4b21d99599d | https://github.com/ellipsephp/validation/blob/5a7e11807099165ff6217bf8c38df4b21d99599d/src/Validator.php#L77-L90 |
3,630 | monolyth-php/formulaic | src/Validate/Required.php | Required.isRequired | public function isRequired() : Testable
{
$this->attributes['required'] = true;
return $this->addTest('required', function ($value) {
if (is_array($value)) {
return $value;
}
return strlen(trim($value));
});
} | php | public function isRequired() : Testable
{
$this->attributes['required'] = true;
return $this->addTest('required', function ($value) {
if (is_array($value)) {
return $value;
}
return strlen(trim($value));
});
} | [
"public",
"function",
"isRequired",
"(",
")",
":",
"Testable",
"{",
"$",
"this",
"->",
"attributes",
"[",
"'required'",
"]",
"=",
"true",
";",
"return",
"$",
"this",
"->",
"addTest",
"(",
"'required'",
",",
"function",
"(",
"$",
"value",
")",
"{",
"if"... | This is a required field.
@return self | [
"This",
"is",
"a",
"required",
"field",
"."
] | 4bf7853a0c29cc17957f1b26c79f633867742c14 | https://github.com/monolyth-php/formulaic/blob/4bf7853a0c29cc17957f1b26c79f633867742c14/src/Validate/Required.php#L14-L23 |
3,631 | as3io/modlr-api-jsonapiorg | src/Serializer.php | Serializer.serializeModel | protected function serializeModel(Model $model, AdapterInterface $adapter)
{
$metadata = $model->getMetadata();
$serialized = [
'type' => $model->getType(),
'id' => $model->getId(),
];
if ($this->depth > 0) {
// $this->includeResource($resource... | php | protected function serializeModel(Model $model, AdapterInterface $adapter)
{
$metadata = $model->getMetadata();
$serialized = [
'type' => $model->getType(),
'id' => $model->getId(),
];
if ($this->depth > 0) {
// $this->includeResource($resource... | [
"protected",
"function",
"serializeModel",
"(",
"Model",
"$",
"model",
",",
"AdapterInterface",
"$",
"adapter",
")",
"{",
"$",
"metadata",
"=",
"$",
"model",
"->",
"getMetadata",
"(",
")",
";",
"$",
"serialized",
"=",
"[",
"'type'",
"=>",
"$",
"model",
"... | Serializes the "interior" of a model.
This is the serialization that takes place outside of a "data" container.
Can be used for root model and relationship model serialization.
@param Model $model
@param AdapterInterface $adapter
@return array | [
"Serializes",
"the",
"interior",
"of",
"a",
"model",
".",
"This",
"is",
"the",
"serialization",
"that",
"takes",
"place",
"outside",
"of",
"a",
"data",
"container",
".",
"Can",
"be",
"used",
"for",
"root",
"model",
"and",
"relationship",
"model",
"serializat... | f53163c315a6a7be09e514a4c81af24aa665634b | https://github.com/as3io/modlr-api-jsonapiorg/blob/f53163c315a6a7be09e514a4c81af24aa665634b/src/Serializer.php#L135-L177 |
3,632 | as3io/modlr-api-jsonapiorg | src/Serializer.php | Serializer.serializeAttribute | protected function serializeAttribute($value, AttributeMetadata $attrMeta)
{
if ('date' === $attrMeta->dataType && $value instanceof \DateTime) {
$milliseconds = sprintf('%03d', round($value->format('u') / 1000, 0));
return gmdate(sprintf('Y-m-d\TH:i:s.%s\Z', $milliseconds), $value->... | php | protected function serializeAttribute($value, AttributeMetadata $attrMeta)
{
if ('date' === $attrMeta->dataType && $value instanceof \DateTime) {
$milliseconds = sprintf('%03d', round($value->format('u') / 1000, 0));
return gmdate(sprintf('Y-m-d\TH:i:s.%s\Z', $milliseconds), $value->... | [
"protected",
"function",
"serializeAttribute",
"(",
"$",
"value",
",",
"AttributeMetadata",
"$",
"attrMeta",
")",
"{",
"if",
"(",
"'date'",
"===",
"$",
"attrMeta",
"->",
"dataType",
"&&",
"$",
"value",
"instanceof",
"\\",
"DateTime",
")",
"{",
"$",
"millisec... | Serializes an attribute value.
@param mixed $value
@param AttributeMetadata $attrMeta
@return mixed | [
"Serializes",
"an",
"attribute",
"value",
"."
] | f53163c315a6a7be09e514a4c81af24aa665634b | https://github.com/as3io/modlr-api-jsonapiorg/blob/f53163c315a6a7be09e514a4c81af24aa665634b/src/Serializer.php#L186-L199 |
3,633 | as3io/modlr-api-jsonapiorg | src/Serializer.php | Serializer.serializeEmbed | protected function serializeEmbed($value, EmbeddedPropMetadata $embeddedPropMeta)
{
$embedMeta = $embeddedPropMeta->embedMeta;
if (true === $embeddedPropMeta->isOne()) {
return $this->serializeEmbedOne($embedMeta, $value);
}
return $this->serializeEmbedMany($embedMeta, $v... | php | protected function serializeEmbed($value, EmbeddedPropMetadata $embeddedPropMeta)
{
$embedMeta = $embeddedPropMeta->embedMeta;
if (true === $embeddedPropMeta->isOne()) {
return $this->serializeEmbedOne($embedMeta, $value);
}
return $this->serializeEmbedMany($embedMeta, $v... | [
"protected",
"function",
"serializeEmbed",
"(",
"$",
"value",
",",
"EmbeddedPropMetadata",
"$",
"embeddedPropMeta",
")",
"{",
"$",
"embedMeta",
"=",
"$",
"embeddedPropMeta",
"->",
"embedMeta",
";",
"if",
"(",
"true",
"===",
"$",
"embeddedPropMeta",
"->",
"isOne"... | Serializes an embed value.
@param Embed|EmbedCollection|null $value
@param EmbeddedPropMetadata $embeddedPropMeta
@return array|null | [
"Serializes",
"an",
"embed",
"value",
"."
] | f53163c315a6a7be09e514a4c81af24aa665634b | https://github.com/as3io/modlr-api-jsonapiorg/blob/f53163c315a6a7be09e514a4c81af24aa665634b/src/Serializer.php#L208-L215 |
3,634 | as3io/modlr-api-jsonapiorg | src/Serializer.php | Serializer.serializeEmbedOne | protected function serializeEmbedOne(EmbedMetadata $embedMeta, Embed $embed = null)
{
if (null === $embed) {
return;
}
$serialized = [];
foreach ($embedMeta->getAttributes() as $key => $attrMeta) {
$serialized[$key] = $this->serializeAttribute($embed->get($key... | php | protected function serializeEmbedOne(EmbedMetadata $embedMeta, Embed $embed = null)
{
if (null === $embed) {
return;
}
$serialized = [];
foreach ($embedMeta->getAttributes() as $key => $attrMeta) {
$serialized[$key] = $this->serializeAttribute($embed->get($key... | [
"protected",
"function",
"serializeEmbedOne",
"(",
"EmbedMetadata",
"$",
"embedMeta",
",",
"Embed",
"$",
"embed",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"embed",
")",
"{",
"return",
";",
"}",
"$",
"serialized",
"=",
"[",
"]",
";",
"forea... | Serializes an embed one value.
@param EmbedMetadata $embedMeta
@param Embed|null $embed
@return array|null | [
"Serializes",
"an",
"embed",
"one",
"value",
"."
] | f53163c315a6a7be09e514a4c81af24aa665634b | https://github.com/as3io/modlr-api-jsonapiorg/blob/f53163c315a6a7be09e514a4c81af24aa665634b/src/Serializer.php#L224-L238 |
3,635 | as3io/modlr-api-jsonapiorg | src/Serializer.php | Serializer.serializeEmbedMany | protected function serializeEmbedMany(EmbedMetadata $embedMeta, EmbedCollection $collection)
{
$serialized = [];
foreach ($collection as $embed) {
if (!$embed instanceof Embed) {
continue;
}
$serialized[] = $this->serializeEmbedOne($embedMeta, $emb... | php | protected function serializeEmbedMany(EmbedMetadata $embedMeta, EmbedCollection $collection)
{
$serialized = [];
foreach ($collection as $embed) {
if (!$embed instanceof Embed) {
continue;
}
$serialized[] = $this->serializeEmbedOne($embedMeta, $emb... | [
"protected",
"function",
"serializeEmbedMany",
"(",
"EmbedMetadata",
"$",
"embedMeta",
",",
"EmbedCollection",
"$",
"collection",
")",
"{",
"$",
"serialized",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"collection",
"as",
"$",
"embed",
")",
"{",
"if",
"(",
"... | Serializes an embed many value.
@param EmbedMetadata $embedMeta
@param EmbedCollection $embed
@return array | [
"Serializes",
"an",
"embed",
"many",
"value",
"."
] | f53163c315a6a7be09e514a4c81af24aa665634b | https://github.com/as3io/modlr-api-jsonapiorg/blob/f53163c315a6a7be09e514a4c81af24aa665634b/src/Serializer.php#L247-L257 |
3,636 | as3io/modlr-api-jsonapiorg | src/Serializer.php | Serializer.serializeRelationship | protected function serializeRelationship(Model $owner, $relationship = null, RelationshipMetadata $relMeta, AdapterInterface $adapter)
{
if ($relMeta->isOne()) {
if (is_array($relationship)) {
throw SerializerException::badRequest('Invalid relationship value.');
}
... | php | protected function serializeRelationship(Model $owner, $relationship = null, RelationshipMetadata $relMeta, AdapterInterface $adapter)
{
if ($relMeta->isOne()) {
if (is_array($relationship)) {
throw SerializerException::badRequest('Invalid relationship value.');
}
... | [
"protected",
"function",
"serializeRelationship",
"(",
"Model",
"$",
"owner",
",",
"$",
"relationship",
"=",
"null",
",",
"RelationshipMetadata",
"$",
"relMeta",
",",
"AdapterInterface",
"$",
"adapter",
")",
"{",
"if",
"(",
"$",
"relMeta",
"->",
"isOne",
"(",
... | Serializes a relationship value
@param Model $owner
@param Model|Model[]|null $relationship
@param RelationshipMetadata $relMeta
@param AdapterInterface $adapter
@return array | [
"Serializes",
"a",
"relationship",
"value"
] | f53163c315a6a7be09e514a4c81af24aa665634b | https://github.com/as3io/modlr-api-jsonapiorg/blob/f53163c315a6a7be09e514a4c81af24aa665634b/src/Serializer.php#L268-L287 |
3,637 | as3io/modlr-api-jsonapiorg | src/Serializer.php | Serializer.serializeHasMany | protected function serializeHasMany(Model $owner, array $models = null, AdapterInterface $adapter)
{
if (empty($models)) {
return $this->serialize(null, $adapter);
}
return $this->serializeArray($models, $adapter);
} | php | protected function serializeHasMany(Model $owner, array $models = null, AdapterInterface $adapter)
{
if (empty($models)) {
return $this->serialize(null, $adapter);
}
return $this->serializeArray($models, $adapter);
} | [
"protected",
"function",
"serializeHasMany",
"(",
"Model",
"$",
"owner",
",",
"array",
"$",
"models",
"=",
"null",
",",
"AdapterInterface",
"$",
"adapter",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"models",
")",
")",
"{",
"return",
"$",
"this",
"->",
"s... | Serializes a has-many relationship value
@param Model $owner
@param Model[]|null $models
@param AdapterInterface $adapter
@return array | [
"Serializes",
"a",
"has",
"-",
"many",
"relationship",
"value"
] | f53163c315a6a7be09e514a4c81af24aa665634b | https://github.com/as3io/modlr-api-jsonapiorg/blob/f53163c315a6a7be09e514a4c81af24aa665634b/src/Serializer.php#L297-L303 |
3,638 | as3io/modlr-api-jsonapiorg | src/Serializer.php | Serializer.serializeHasOne | protected function serializeHasOne(Model $owner, Model $model = null, AdapterInterface $adapter)
{
return $this->serialize($model, $adapter);
} | php | protected function serializeHasOne(Model $owner, Model $model = null, AdapterInterface $adapter)
{
return $this->serialize($model, $adapter);
} | [
"protected",
"function",
"serializeHasOne",
"(",
"Model",
"$",
"owner",
",",
"Model",
"$",
"model",
"=",
"null",
",",
"AdapterInterface",
"$",
"adapter",
")",
"{",
"return",
"$",
"this",
"->",
"serialize",
"(",
"$",
"model",
",",
"$",
"adapter",
")",
";"... | Serializes a has-one relationship value
@param Model $owner
@param Model|null $model
@param AdapterInterface $adapter
@return array | [
"Serializes",
"a",
"has",
"-",
"one",
"relationship",
"value"
] | f53163c315a6a7be09e514a4c81af24aa665634b | https://github.com/as3io/modlr-api-jsonapiorg/blob/f53163c315a6a7be09e514a4c81af24aa665634b/src/Serializer.php#L313-L316 |
3,639 | zugoripls/laravel-framework | src/Illuminate/Console/Scheduling/Event.php | Event.buildCommand | public function buildCommand()
{
if ($this->withoutOverlapping)
{
$command = '(touch '.$this->mutexPath().'; '.$this->command.'; rm '.$this->mutexPath().') > '.$this->output.' 2>&1 &';
}
else
{
$command = $this->command.' > '.$this->output.' 2>&1 &';
}
return $this->user ? 'sudo -u '.$this->user.... | php | public function buildCommand()
{
if ($this->withoutOverlapping)
{
$command = '(touch '.$this->mutexPath().'; '.$this->command.'; rm '.$this->mutexPath().') > '.$this->output.' 2>&1 &';
}
else
{
$command = $this->command.' > '.$this->output.' 2>&1 &';
}
return $this->user ? 'sudo -u '.$this->user.... | [
"public",
"function",
"buildCommand",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"withoutOverlapping",
")",
"{",
"$",
"command",
"=",
"'(touch '",
".",
"$",
"this",
"->",
"mutexPath",
"(",
")",
".",
"'; '",
".",
"$",
"this",
"->",
"command",
".",
"... | Build the comand string.
@return string | [
"Build",
"the",
"comand",
"string",
"."
] | 90fa2b0e7a9b7786a6f02a9f10aba6a21ac03655 | https://github.com/zugoripls/laravel-framework/blob/90fa2b0e7a9b7786a6f02a9f10aba6a21ac03655/src/Illuminate/Console/Scheduling/Event.php#L174-L187 |
3,640 | Ocelot-Framework/ocelot-mvc | src/Util/AntPathMatcher.php | AntPathMatcher.tokenizePath | protected function tokenizePath($path)
{
$parts = explode($this->pathSeparator, $path);
if ($this->trimTokens) {
for ($i = 0; $i < count($parts); $i++) {
$parts[$i] = trim($parts[$i]);
if ($parts[$i] === "") {
unset($parts[$i]);
... | php | protected function tokenizePath($path)
{
$parts = explode($this->pathSeparator, $path);
if ($this->trimTokens) {
for ($i = 0; $i < count($parts); $i++) {
$parts[$i] = trim($parts[$i]);
if ($parts[$i] === "") {
unset($parts[$i]);
... | [
"protected",
"function",
"tokenizePath",
"(",
"$",
"path",
")",
"{",
"$",
"parts",
"=",
"explode",
"(",
"$",
"this",
"->",
"pathSeparator",
",",
"$",
"path",
")",
";",
"if",
"(",
"$",
"this",
"->",
"trimTokens",
")",
"{",
"for",
"(",
"$",
"i",
"=",... | Tokenize the given path String into parts, based on this matcher's settings.
@param string $path the path to tokenize
@return string[] the tokenized path parts | [
"Tokenize",
"the",
"given",
"path",
"String",
"into",
"parts",
"based",
"on",
"this",
"matcher",
"s",
"settings",
"."
] | 42a08208c6cebb87b363a0479331bafb7ec257c6 | https://github.com/Ocelot-Framework/ocelot-mvc/blob/42a08208c6cebb87b363a0479331bafb7ec257c6/src/Util/AntPathMatcher.php#L323-L335 |
3,641 | Ocelot-Framework/ocelot-mvc | src/Util/AntPathMatcher.php | AntPathMatcher.matchStrings | protected function matchStrings($pattern, $str, &$uriTemplateVariables)
{
return $this->getStringMatcher($pattern)->matchStrings($str, $uriTemplateVariables);
} | php | protected function matchStrings($pattern, $str, &$uriTemplateVariables)
{
return $this->getStringMatcher($pattern)->matchStrings($str, $uriTemplateVariables);
} | [
"protected",
"function",
"matchStrings",
"(",
"$",
"pattern",
",",
"$",
"str",
",",
"&",
"$",
"uriTemplateVariables",
")",
"{",
"return",
"$",
"this",
"->",
"getStringMatcher",
"(",
"$",
"pattern",
")",
"->",
"matchStrings",
"(",
"$",
"str",
",",
"$",
"u... | Tests whether or not a string matches against a pattern.
@param string $pattern the pattern to match against (never {@code null})
@param string $str the String which must be matched against the pattern (never {@code null})
@param array $uriTemplateVariables the array in which to store uri... | [
"Tests",
"whether",
"or",
"not",
"a",
"string",
"matches",
"against",
"a",
"pattern",
"."
] | 42a08208c6cebb87b363a0479331bafb7ec257c6 | https://github.com/Ocelot-Framework/ocelot-mvc/blob/42a08208c6cebb87b363a0479331bafb7ec257c6/src/Util/AntPathMatcher.php#L345-L348 |
3,642 | Ocelot-Framework/ocelot-mvc | src/Util/AntPathMatcher.php | AntPathMatcher.concat | protected function concat($path1, $path2)
{
if (substr($path1, -1) == $this->pathSeparator || substr($path2, 0, 1) == $this->pathSeparator) {
return $path1 . $path2;
}
return $path1 . $this->pathSeparator . $path2;
} | php | protected function concat($path1, $path2)
{
if (substr($path1, -1) == $this->pathSeparator || substr($path2, 0, 1) == $this->pathSeparator) {
return $path1 . $path2;
}
return $path1 . $this->pathSeparator . $path2;
} | [
"protected",
"function",
"concat",
"(",
"$",
"path1",
",",
"$",
"path2",
")",
"{",
"if",
"(",
"substr",
"(",
"$",
"path1",
",",
"-",
"1",
")",
"==",
"$",
"this",
"->",
"pathSeparator",
"||",
"substr",
"(",
"$",
"path2",
",",
"0",
",",
"1",
")",
... | Concats two paths using the path separator
@param string $path1 The first path
@param string $path2 The second path
@return string | [
"Concats",
"two",
"paths",
"using",
"the",
"path",
"separator"
] | 42a08208c6cebb87b363a0479331bafb7ec257c6 | https://github.com/Ocelot-Framework/ocelot-mvc/blob/42a08208c6cebb87b363a0479331bafb7ec257c6/src/Util/AntPathMatcher.php#L515-L521 |
3,643 | szmnmichalowski/SzmNotification | src/Controller/Plugin/Notification.php | Notification.getAllCurrent | public function getAllCurrent()
{
$notifications = [];
$container = $this->getContainer();
foreach ($container as $namespace => $notification) {
$notifications[$namespace] = $this->getCurrent($namespace);
}
return $notifications;
} | php | public function getAllCurrent()
{
$notifications = [];
$container = $this->getContainer();
foreach ($container as $namespace => $notification) {
$notifications[$namespace] = $this->getCurrent($namespace);
}
return $notifications;
} | [
"public",
"function",
"getAllCurrent",
"(",
")",
"{",
"$",
"notifications",
"=",
"[",
"]",
";",
"$",
"container",
"=",
"$",
"this",
"->",
"getContainer",
"(",
")",
";",
"foreach",
"(",
"$",
"container",
"as",
"$",
"namespace",
"=>",
"$",
"notification",
... | Get all current notifications
@return array | [
"Get",
"all",
"current",
"notifications"
] | 0cc79dca9a928d5c9ab806de5465f5b879e5b30b | https://github.com/szmnmichalowski/SzmNotification/blob/0cc79dca9a928d5c9ab806de5465f5b879e5b30b/src/Controller/Plugin/Notification.php#L310-L320 |
3,644 | szmnmichalowski/SzmNotification | src/Controller/Plugin/Notification.php | Notification.getNotificationsFromContainer | protected function getNotificationsFromContainer()
{
if (!empty($this->notifications) || $this->isAdded) {
return;
}
$container = $this->getContainer();
$namespaces = [];
foreach ($container as $namespace => $notification) {
$this->notifications[$nam... | php | protected function getNotificationsFromContainer()
{
if (!empty($this->notifications) || $this->isAdded) {
return;
}
$container = $this->getContainer();
$namespaces = [];
foreach ($container as $namespace => $notification) {
$this->notifications[$nam... | [
"protected",
"function",
"getNotificationsFromContainer",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"notifications",
")",
"||",
"$",
"this",
"->",
"isAdded",
")",
"{",
"return",
";",
"}",
"$",
"container",
"=",
"$",
"this",
"->",
... | Clear notifications from container | [
"Clear",
"notifications",
"from",
"container"
] | 0cc79dca9a928d5c9ab806de5465f5b879e5b30b | https://github.com/szmnmichalowski/SzmNotification/blob/0cc79dca9a928d5c9ab806de5465f5b879e5b30b/src/Controller/Plugin/Notification.php#L453-L468 |
3,645 | szmnmichalowski/SzmNotification | src/Controller/Plugin/Notification.php | Notification.clearCurrent | public function clearCurrent($namespace = null)
{
$container = $this->getContainer();
if ($namespace) {
if (!$container->offsetExists($namespace)) {
return false;
}
unset($container->{$namespace});
return true;
}
fore... | php | public function clearCurrent($namespace = null)
{
$container = $this->getContainer();
if ($namespace) {
if (!$container->offsetExists($namespace)) {
return false;
}
unset($container->{$namespace});
return true;
}
fore... | [
"public",
"function",
"clearCurrent",
"(",
"$",
"namespace",
"=",
"null",
")",
"{",
"$",
"container",
"=",
"$",
"this",
"->",
"getContainer",
"(",
")",
";",
"if",
"(",
"$",
"namespace",
")",
"{",
"if",
"(",
"!",
"$",
"container",
"->",
"offsetExists",
... | Clear notifications from container if namespace is provided or clear all notifications
added during this request if namespace is not provided.
@param null $namespace
@return bool | [
"Clear",
"notifications",
"from",
"container",
"if",
"namespace",
"is",
"provided",
"or",
"clear",
"all",
"notifications",
"added",
"during",
"this",
"request",
"if",
"namespace",
"is",
"not",
"provided",
"."
] | 0cc79dca9a928d5c9ab806de5465f5b879e5b30b | https://github.com/szmnmichalowski/SzmNotification/blob/0cc79dca9a928d5c9ab806de5465f5b879e5b30b/src/Controller/Plugin/Notification.php#L490-L508 |
3,646 | szmnmichalowski/SzmNotification | src/Controller/Plugin/Notification.php | Notification.clear | public function clear($namespace = null)
{
$this->getNotificationsFromContainer();
if ($namespace) {
if (isset($this->notifications[$namespace])) {
unset($this->notifications[$namespace]);
return true;
}
return false;
}
... | php | public function clear($namespace = null)
{
$this->getNotificationsFromContainer();
if ($namespace) {
if (isset($this->notifications[$namespace])) {
unset($this->notifications[$namespace]);
return true;
}
return false;
}
... | [
"public",
"function",
"clear",
"(",
"$",
"namespace",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"getNotificationsFromContainer",
"(",
")",
";",
"if",
"(",
"$",
"namespace",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"notifications",
"[",
"$"... | Clear notifications from previous request by provided namespace or clear all
notifications if namespace is not provided
@param null $namespace
@return bool | [
"Clear",
"notifications",
"from",
"previous",
"request",
"by",
"provided",
"namespace",
"or",
"clear",
"all",
"notifications",
"if",
"namespace",
"is",
"not",
"provided"
] | 0cc79dca9a928d5c9ab806de5465f5b879e5b30b | https://github.com/szmnmichalowski/SzmNotification/blob/0cc79dca9a928d5c9ab806de5465f5b879e5b30b/src/Controller/Plugin/Notification.php#L517-L535 |
3,647 | veridu/idos-sdk-php | src/idOS/Endpoint/Profile/References.php | References.updateOne | public function updateOne(string $referenceName, string $value) : array {
return $this->sendPatch(
sprintf('/profiles/%s/references/%s', $this->userName, $referenceName),
[],
[
'value' => $value
]
);
} | php | public function updateOne(string $referenceName, string $value) : array {
return $this->sendPatch(
sprintf('/profiles/%s/references/%s', $this->userName, $referenceName),
[],
[
'value' => $value
]
);
} | [
"public",
"function",
"updateOne",
"(",
"string",
"$",
"referenceName",
",",
"string",
"$",
"value",
")",
":",
"array",
"{",
"return",
"$",
"this",
"->",
"sendPatch",
"(",
"sprintf",
"(",
"'/profiles/%s/references/%s'",
",",
"$",
"this",
"->",
"userName",
",... | Updates a reference given its slug.
@param bool $value
@return array Response | [
"Updates",
"a",
"reference",
"given",
"its",
"slug",
"."
] | e56757bed10404756f2f0485a4b7f55794192008 | https://github.com/veridu/idos-sdk-php/blob/e56757bed10404756f2f0485a4b7f55794192008/src/idOS/Endpoint/Profile/References.php#L68-L76 |
3,648 | YiMAproject/yimaLocalize | src/yimaLocalize/LocaliPlugins/DateTime/Calendar/Persian.php | Persian.calculateDate | public function calculateDate($gYear, $gMonth, $gDay)
{
return $this->getPoirotPersian()->calculateDate($gYear, $gMonth, $gDay);
} | php | public function calculateDate($gYear, $gMonth, $gDay)
{
return $this->getPoirotPersian()->calculateDate($gYear, $gMonth, $gDay);
} | [
"public",
"function",
"calculateDate",
"(",
"$",
"gYear",
",",
"$",
"gMonth",
",",
"$",
"gDay",
")",
"{",
"return",
"$",
"this",
"->",
"getPoirotPersian",
"(",
")",
"->",
"calculateDate",
"(",
"$",
"gYear",
",",
"$",
"gMonth",
",",
"$",
"gDay",
")",
... | Calculate date to calendar system
@param int $gYear Year in gregorian system
@param int $gMonth Month in gregorian system
@param int $gDay Day in gregorian system
@return CalendarInterval|false | [
"Calculate",
"date",
"to",
"calendar",
"system"
] | 1ea10bd0cedfdad5f45e945ac9833a128712e5e2 | https://github.com/YiMAproject/yimaLocalize/blob/1ea10bd0cedfdad5f45e945ac9833a128712e5e2/src/yimaLocalize/LocaliPlugins/DateTime/Calendar/Persian.php#L55-L58 |
3,649 | phossa2/libs | src/Phossa2/Session/Driver/CookieDriver.php | CookieDriver.syncCookies | protected function syncCookies()
{
foreach ($this->cookies as $name => $id) {
if (null === $id) {
setcookie($name, '', time() - 3600);
} else {
setcookie(
$name,
$id,
$this->ttl ? (time() + $t... | php | protected function syncCookies()
{
foreach ($this->cookies as $name => $id) {
if (null === $id) {
setcookie($name, '', time() - 3600);
} else {
setcookie(
$name,
$id,
$this->ttl ? (time() + $t... | [
"protected",
"function",
"syncCookies",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"cookies",
"as",
"$",
"name",
"=>",
"$",
"id",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"id",
")",
"{",
"setcookie",
"(",
"$",
"name",
",",
"''",
",",
"time... | Sync session cookies with the client
@access protected | [
"Sync",
"session",
"cookies",
"with",
"the",
"client"
] | 921e485c8cc29067f279da2cdd06f47a9bddd115 | https://github.com/phossa2/libs/blob/921e485c8cc29067f279da2cdd06f47a9bddd115/src/Phossa2/Session/Driver/CookieDriver.php#L118-L135 |
3,650 | gentlero/embeddables | src/Date.php | Date.getDaysInMonth | private function getDaysInMonth(Month $month, Year $year)
{
return (int)date('t', mktime(0, 0, 0, (string)$month, 1, (string)$year));
} | php | private function getDaysInMonth(Month $month, Year $year)
{
return (int)date('t', mktime(0, 0, 0, (string)$month, 1, (string)$year));
} | [
"private",
"function",
"getDaysInMonth",
"(",
"Month",
"$",
"month",
",",
"Year",
"$",
"year",
")",
"{",
"return",
"(",
"int",
")",
"date",
"(",
"'t'",
",",
"mktime",
"(",
"0",
",",
"0",
",",
"0",
",",
"(",
"string",
")",
"$",
"month",
",",
"1",
... | Get number of days in specified month.
@access private
@param Month $month
@param Year $year
@return int | [
"Get",
"number",
"of",
"days",
"in",
"specified",
"month",
"."
] | 69255fa45983106cda4467f502849e9d402408ab | https://github.com/gentlero/embeddables/blob/69255fa45983106cda4467f502849e9d402408ab/src/Date.php#L174-L177 |
3,651 | kevindierkx/elicit | src/ConnectionResolver.php | ConnectionResolver.connection | public function connection($name = null)
{
if (is_null($name)) {
$name = $this->getDefaultConnection();
}
if (! isset($this->connections[$name])) {
throw new InvalidArgumentException("Connection [{$name}] is not registered.");
}
return $this->connect... | php | public function connection($name = null)
{
if (is_null($name)) {
$name = $this->getDefaultConnection();
}
if (! isset($this->connections[$name])) {
throw new InvalidArgumentException("Connection [{$name}] is not registered.");
}
return $this->connect... | [
"public",
"function",
"connection",
"(",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"name",
")",
")",
"{",
"$",
"name",
"=",
"$",
"this",
"->",
"getDefaultConnection",
"(",
")",
";",
"}",
"if",
"(",
"!",
"isset",
"(",
"$"... | Get an API connection instance.
@param string $name
@return ConnectionInterface | [
"Get",
"an",
"API",
"connection",
"instance",
"."
] | c277942f5f5f63b175bc37e9d392faa946888f65 | https://github.com/kevindierkx/elicit/blob/c277942f5f5f63b175bc37e9d392faa946888f65/src/ConnectionResolver.php#L42-L53 |
3,652 | petrknap/php-enum | src/Enum.php | Enum.getMembers | public static function getMembers()
{
$className = static::class;
$members = &self::$members[$className];
if (empty($members)) {
new $className(null);
}
return $members;
} | php | public static function getMembers()
{
$className = static::class;
$members = &self::$members[$className];
if (empty($members)) {
new $className(null);
}
return $members;
} | [
"public",
"static",
"function",
"getMembers",
"(",
")",
"{",
"$",
"className",
"=",
"static",
"::",
"class",
";",
"$",
"members",
"=",
"&",
"self",
"::",
"$",
"members",
"[",
"$",
"className",
"]",
";",
"if",
"(",
"empty",
"(",
"$",
"members",
")",
... | Returns members of enum
NOTE: Can not be merged with non-static {@link members()} due to its inner logic
@return mixed[] [first_name => first_value, second_name => second_value,...] | [
"Returns",
"members",
"of",
"enum"
] | f82a50ea7ac6d70a9a325b12783cfbffd36dc175 | https://github.com/petrknap/php-enum/blob/f82a50ea7ac6d70a9a325b12783cfbffd36dc175/src/Enum.php#L112-L123 |
3,653 | alfredoem/ragnarok | app/Ragnarok/Soul/RagnarokCurl.php | RagnarokCurl.httpGetRequest | public function httpGetRequest($url)
{
// create curl resource
$curl = curl_init();
// set url
curl_setopt($curl, CURLOPT_URL, $url);
//return the transfer as a string
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
// $output contains the output string
... | php | public function httpGetRequest($url)
{
// create curl resource
$curl = curl_init();
// set url
curl_setopt($curl, CURLOPT_URL, $url);
//return the transfer as a string
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
// $output contains the output string
... | [
"public",
"function",
"httpGetRequest",
"(",
"$",
"url",
")",
"{",
"// create curl resource",
"$",
"curl",
"=",
"curl_init",
"(",
")",
";",
"// set url",
"curl_setopt",
"(",
"$",
"curl",
",",
"CURLOPT_URL",
",",
"$",
"url",
")",
";",
"//return the transfer as ... | Make a GET HTTP request
@param $url
@return \Alfredoem\Ragnarok\Soul\RagnarokCurlResponse | [
"Make",
"a",
"GET",
"HTTP",
"request"
] | e7de18cbe7a64e6ce480093d9d98d64078d35dff | https://github.com/alfredoem/ragnarok/blob/e7de18cbe7a64e6ce480093d9d98d64078d35dff/app/Ragnarok/Soul/RagnarokCurl.php#L22-L41 |
3,654 | alfredoem/ragnarok | app/Ragnarok/Soul/RagnarokCurl.php | RagnarokCurl.httpStatusConnection | public function httpStatusConnection($url)
{
if ( ! filter_var($url, FILTER_VALIDATE_URL)) {// check, if a valid url is provided
return false;
}
$handle = curl_init($url);
curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
curl_setopt($handle, CURLOPT_FOLLOWLOC... | php | public function httpStatusConnection($url)
{
if ( ! filter_var($url, FILTER_VALIDATE_URL)) {// check, if a valid url is provided
return false;
}
$handle = curl_init($url);
curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
curl_setopt($handle, CURLOPT_FOLLOWLOC... | [
"public",
"function",
"httpStatusConnection",
"(",
"$",
"url",
")",
"{",
"if",
"(",
"!",
"filter_var",
"(",
"$",
"url",
",",
"FILTER_VALIDATE_URL",
")",
")",
"{",
"// check, if a valid url is provided",
"return",
"false",
";",
"}",
"$",
"handle",
"=",
"curl_in... | Check the connection status
@param $url
@return bool | [
"Check",
"the",
"connection",
"status"
] | e7de18cbe7a64e6ce480093d9d98d64078d35dff | https://github.com/alfredoem/ragnarok/blob/e7de18cbe7a64e6ce480093d9d98d64078d35dff/app/Ragnarok/Soul/RagnarokCurl.php#L48-L62 |
3,655 | alfredoem/ragnarok | app/Ragnarok/Soul/RagnarokCurl.php | RagnarokCurl.httpPosRequest | public function httpPosRequest($url, $data)
{
$enc = EncryptAes::encrypt($data);
$dataEncrypt = 'data='.$enc;
$dataEncrypt = str_replace('+', '%2B', $dataEncrypt);
$curl = curl_init();
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_POST, count($data... | php | public function httpPosRequest($url, $data)
{
$enc = EncryptAes::encrypt($data);
$dataEncrypt = 'data='.$enc;
$dataEncrypt = str_replace('+', '%2B', $dataEncrypt);
$curl = curl_init();
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_POST, count($data... | [
"public",
"function",
"httpPosRequest",
"(",
"$",
"url",
",",
"$",
"data",
")",
"{",
"$",
"enc",
"=",
"EncryptAes",
"::",
"encrypt",
"(",
"$",
"data",
")",
";",
"$",
"dataEncrypt",
"=",
"'data='",
".",
"$",
"enc",
";",
"$",
"dataEncrypt",
"=",
"str_r... | Make a POST HTTP request
@param $url
@param $data
@return \Alfredoem\Ragnarok\Soul\RagnarokCurlResponse | [
"Make",
"a",
"POST",
"HTTP",
"request"
] | e7de18cbe7a64e6ce480093d9d98d64078d35dff | https://github.com/alfredoem/ragnarok/blob/e7de18cbe7a64e6ce480093d9d98d64078d35dff/app/Ragnarok/Soul/RagnarokCurl.php#L70-L91 |
3,656 | Flowpack/Flowpack.SingleSignOn.Server | Classes/Flowpack/SingleSignOn/Server/Controller/AccessTokenController.php | AccessTokenController.redeemAction | public function redeemAction($accessToken) {
if ($this->request->getHttpRequest()->getMethod() !== 'POST') {
$this->response->setStatus(405);
$this->response->setHeader('Allow', 'POST');
return;
}
$accessTokenObject = $this->accessTokenRepository->findByIdentifier($accessToken);
if (!$accessTokenObjec... | php | public function redeemAction($accessToken) {
if ($this->request->getHttpRequest()->getMethod() !== 'POST') {
$this->response->setStatus(405);
$this->response->setHeader('Allow', 'POST');
return;
}
$accessTokenObject = $this->accessTokenRepository->findByIdentifier($accessToken);
if (!$accessTokenObjec... | [
"public",
"function",
"redeemAction",
"(",
"$",
"accessToken",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"request",
"->",
"getHttpRequest",
"(",
")",
"->",
"getMethod",
"(",
")",
"!==",
"'POST'",
")",
"{",
"$",
"this",
"->",
"response",
"->",
"setStatus",
... | Redeem an access token and return global account data for the authenticated account
and a global session id.
POST token/{accessToken}/redeem?clientSessionId=abc
@param string $accessToken | [
"Redeem",
"an",
"access",
"token",
"and",
"return",
"global",
"account",
"data",
"for",
"the",
"authenticated",
"account",
"and",
"a",
"global",
"session",
"id",
"."
] | b1fa014f31d0d101a79cb95d5585b9973f35347d | https://github.com/Flowpack/Flowpack.SingleSignOn.Server/blob/b1fa014f31d0d101a79cb95d5585b9973f35347d/Classes/Flowpack/SingleSignOn/Server/Controller/AccessTokenController.php#L71-L115 |
3,657 | Puzzlout/FrameworkMvcLegacy | src/Dal/Modules/CommonDal.php | CommonDal.GetListOfTablesInDatabase | public function GetListOfTablesInDatabase() {
$dbConfig = new \Puzzlout\Framework\Dal\DbStatementConfig(null, \Puzzlout\Framework\Dal\DbExecutionType::SHOWTABLES, new \Puzzlout\Framework\Dal\DbQueryFilters());
$dbConfig->setQuery("SHOW TABLES;");
$this->addDbConfigItem($dbConfig);
return... | php | public function GetListOfTablesInDatabase() {
$dbConfig = new \Puzzlout\Framework\Dal\DbStatementConfig(null, \Puzzlout\Framework\Dal\DbExecutionType::SHOWTABLES, new \Puzzlout\Framework\Dal\DbQueryFilters());
$dbConfig->setQuery("SHOW TABLES;");
$this->addDbConfigItem($dbConfig);
return... | [
"public",
"function",
"GetListOfTablesInDatabase",
"(",
")",
"{",
"$",
"dbConfig",
"=",
"new",
"\\",
"Puzzlout",
"\\",
"Framework",
"\\",
"Dal",
"\\",
"DbStatementConfig",
"(",
"null",
",",
"\\",
"Puzzlout",
"\\",
"Framework",
"\\",
"Dal",
"\\",
"DbExecutionTy... | Gets the list of table names in a database.
@return array The list of table names. | [
"Gets",
"the",
"list",
"of",
"table",
"names",
"in",
"a",
"database",
"."
] | 14e0fc5b16978cbd209f552ee9c649f66a0dfc6e | https://github.com/Puzzlout/FrameworkMvcLegacy/blob/14e0fc5b16978cbd209f552ee9c649f66a0dfc6e/src/Dal/Modules/CommonDal.php#L23-L28 |
3,658 | Puzzlout/FrameworkMvcLegacy | src/Dal/Modules/CommonDal.php | CommonDal.GetTableColumnsMeta | public function GetTableColumnsMeta($tableName, $columnNames) {
$tableColumnsMetadata = array();
foreach ($columnNames as $columnName) {
$this->setDbConfigList(array());
$dbConfig = new \Puzzlout\Framework\Dal\DbStatementConfig(null, \Puzzlout\Framework\Dal\DbExecutionType::COLUM... | php | public function GetTableColumnsMeta($tableName, $columnNames) {
$tableColumnsMetadata = array();
foreach ($columnNames as $columnName) {
$this->setDbConfigList(array());
$dbConfig = new \Puzzlout\Framework\Dal\DbStatementConfig(null, \Puzzlout\Framework\Dal\DbExecutionType::COLUM... | [
"public",
"function",
"GetTableColumnsMeta",
"(",
"$",
"tableName",
",",
"$",
"columnNames",
")",
"{",
"$",
"tableColumnsMetadata",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"columnNames",
"as",
"$",
"columnName",
")",
"{",
"$",
"this",
"->",
"setD... | Gets the list of column metadata for a table.
@param type $tableName The table name.
@param type $columnNames The array of columns.
@return array The associative array of the metadata of the table columns. | [
"Gets",
"the",
"list",
"of",
"column",
"metadata",
"for",
"a",
"table",
"."
] | 14e0fc5b16978cbd209f552ee9c649f66a0dfc6e | https://github.com/Puzzlout/FrameworkMvcLegacy/blob/14e0fc5b16978cbd209f552ee9c649f66a0dfc6e/src/Dal/Modules/CommonDal.php#L37-L47 |
3,659 | Puzzlout/FrameworkMvcLegacy | src/Dal/Modules/CommonDal.php | CommonDal.GetTableColumnNames | public function GetTableColumnNames($tableName) {
$this->setDbConfigList(array());
$dbConfig = new \Puzzlout\Framework\Dal\DbStatementConfig(null, \Puzzlout\Framework\Dal\DbExecutionType::COLUMNNAMES, new \Puzzlout\Framework\Dal\DbQueryFilters());
$dbConfig->setQuery("DESCRIBE `$tableName`;");
... | php | public function GetTableColumnNames($tableName) {
$this->setDbConfigList(array());
$dbConfig = new \Puzzlout\Framework\Dal\DbStatementConfig(null, \Puzzlout\Framework\Dal\DbExecutionType::COLUMNNAMES, new \Puzzlout\Framework\Dal\DbQueryFilters());
$dbConfig->setQuery("DESCRIBE `$tableName`;");
... | [
"public",
"function",
"GetTableColumnNames",
"(",
"$",
"tableName",
")",
"{",
"$",
"this",
"->",
"setDbConfigList",
"(",
"array",
"(",
")",
")",
";",
"$",
"dbConfig",
"=",
"new",
"\\",
"Puzzlout",
"\\",
"Framework",
"\\",
"Dal",
"\\",
"DbStatementConfig",
... | Gets the column names for a table.
@param type $tableName The table name
@return array The list of column names for a table. | [
"Gets",
"the",
"column",
"names",
"for",
"a",
"table",
"."
] | 14e0fc5b16978cbd209f552ee9c649f66a0dfc6e | https://github.com/Puzzlout/FrameworkMvcLegacy/blob/14e0fc5b16978cbd209f552ee9c649f66a0dfc6e/src/Dal/Modules/CommonDal.php#L55-L61 |
3,660 | Briareos/mongodb-odm | lib/Doctrine/ODM/MongoDB/Persisters/DocumentPersister.php | DocumentPersister.prepareSortOrProjection | public function prepareSortOrProjection(array $fields)
{
$preparedFields = array();
foreach ($fields as $key => $value) {
$preparedFields[$this->prepareFieldName($key)] = $value;
}
return $preparedFields;
} | php | public function prepareSortOrProjection(array $fields)
{
$preparedFields = array();
foreach ($fields as $key => $value) {
$preparedFields[$this->prepareFieldName($key)] = $value;
}
return $preparedFields;
} | [
"public",
"function",
"prepareSortOrProjection",
"(",
"array",
"$",
"fields",
")",
"{",
"$",
"preparedFields",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"fields",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"preparedFields",
"[",
"$",
... | Prepare a sort or projection array by converting keys, which are PHP
property names, to MongoDB field names.
@param array $fields
@return array | [
"Prepare",
"a",
"sort",
"or",
"projection",
"array",
"by",
"converting",
"keys",
"which",
"are",
"PHP",
"property",
"names",
"to",
"MongoDB",
"field",
"names",
"."
] | 29e28bed9a265efd7d05473b0a909fb7c83f76e0 | https://github.com/Briareos/mongodb-odm/blob/29e28bed9a265efd7d05473b0a909fb7c83f76e0/lib/Doctrine/ODM/MongoDB/Persisters/DocumentPersister.php#L818-L827 |
3,661 | Briareos/mongodb-odm | lib/Doctrine/ODM/MongoDB/Persisters/DocumentPersister.php | DocumentPersister.addFilterToPreparedQuery | public function addFilterToPreparedQuery(array $preparedQuery)
{
/* If filter criteria exists for this class, prepare it and merge
* over the existing query.
*
* @todo Consider recursive merging in case the filter criteria and
* prepared query both contain top-level $and/... | php | public function addFilterToPreparedQuery(array $preparedQuery)
{
/* If filter criteria exists for this class, prepare it and merge
* over the existing query.
*
* @todo Consider recursive merging in case the filter criteria and
* prepared query both contain top-level $and/... | [
"public",
"function",
"addFilterToPreparedQuery",
"(",
"array",
"$",
"preparedQuery",
")",
"{",
"/* If filter criteria exists for this class, prepare it and merge\n * over the existing query.\n *\n * @todo Consider recursive merging in case the filter criteria and\n ... | Adds filter criteria to an already-prepared query.
This method should be used once for query criteria and not be used for
nested expressions. It should be called after
{@link DocumentPerister::addDiscriminatorToPreparedQuery()}.
@param array $preparedQuery
@return array | [
"Adds",
"filter",
"criteria",
"to",
"an",
"already",
"-",
"prepared",
"query",
"."
] | 29e28bed9a265efd7d05473b0a909fb7c83f76e0 | https://github.com/Briareos/mongodb-odm/blob/29e28bed9a265efd7d05473b0a909fb7c83f76e0/lib/Doctrine/ODM/MongoDB/Persisters/DocumentPersister.php#L875-L888 |
3,662 | Briareos/mongodb-odm | lib/Doctrine/ODM/MongoDB/Persisters/DocumentPersister.php | DocumentPersister.getClassDiscriminatorValues | private function getClassDiscriminatorValues(ClassMetadata $metadata)
{
$discriminatorValues = array($metadata->discriminatorValue);
foreach ($metadata->subClasses as $className) {
if ($key = array_search($className, $metadata->discriminatorMap)) {
$discriminatorValues[] ... | php | private function getClassDiscriminatorValues(ClassMetadata $metadata)
{
$discriminatorValues = array($metadata->discriminatorValue);
foreach ($metadata->subClasses as $className) {
if ($key = array_search($className, $metadata->discriminatorMap)) {
$discriminatorValues[] ... | [
"private",
"function",
"getClassDiscriminatorValues",
"(",
"ClassMetadata",
"$",
"metadata",
")",
"{",
"$",
"discriminatorValues",
"=",
"array",
"(",
"$",
"metadata",
"->",
"discriminatorValue",
")",
";",
"foreach",
"(",
"$",
"metadata",
"->",
"subClasses",
"as",
... | Gets the array of discriminator values for the given ClassMetadata
@param ClassMetadata $metadata
@return array | [
"Gets",
"the",
"array",
"of",
"discriminator",
"values",
"for",
"the",
"given",
"ClassMetadata"
] | 29e28bed9a265efd7d05473b0a909fb7c83f76e0 | https://github.com/Briareos/mongodb-odm/blob/29e28bed9a265efd7d05473b0a909fb7c83f76e0/lib/Doctrine/ODM/MongoDB/Persisters/DocumentPersister.php#L1207-L1216 |
3,663 | Briareos/mongodb-odm | lib/Doctrine/ODM/MongoDB/Persisters/DocumentPersister.php | DocumentPersister.guardMissingShardKey | private function guardMissingShardKey($document, $shardKeyField, $actualDocumentData)
{
$dcs = $this->uow->getDocumentChangeSet($document);
$isUpdate = $this->uow->isScheduledForUpdate($document);
$fieldMapping = $this->class->getFieldMappingByDbFieldName($shardKeyField);
$fieldName... | php | private function guardMissingShardKey($document, $shardKeyField, $actualDocumentData)
{
$dcs = $this->uow->getDocumentChangeSet($document);
$isUpdate = $this->uow->isScheduledForUpdate($document);
$fieldMapping = $this->class->getFieldMappingByDbFieldName($shardKeyField);
$fieldName... | [
"private",
"function",
"guardMissingShardKey",
"(",
"$",
"document",
",",
"$",
"shardKeyField",
",",
"$",
"actualDocumentData",
")",
"{",
"$",
"dcs",
"=",
"$",
"this",
"->",
"uow",
"->",
"getDocumentChangeSet",
"(",
"$",
"document",
")",
";",
"$",
"isUpdate"... | If the document is new, ignore shard key field value, otherwise throw an exception.
Also, shard key field should be presented in actual document data.
@param object $document
@param string $shardKeyField
@param array $actualDocumentData
@throws MongoDBException | [
"If",
"the",
"document",
"is",
"new",
"ignore",
"shard",
"key",
"field",
"value",
"otherwise",
"throw",
"an",
"exception",
".",
"Also",
"shard",
"key",
"field",
"should",
"be",
"presented",
"in",
"actual",
"document",
"data",
"."
] | 29e28bed9a265efd7d05473b0a909fb7c83f76e0 | https://github.com/Briareos/mongodb-odm/blob/29e28bed9a265efd7d05473b0a909fb7c83f76e0/lib/Doctrine/ODM/MongoDB/Persisters/DocumentPersister.php#L1228-L1243 |
3,664 | FrenzelGmbH/appcommon | nlpclassifier/EndOfSentence.php | EndOfSentence.classify | public function classify(array $classes, DocumentInterface $d) {
list($token,$before,$after) = $d->getDocumentData();
$dotcnt = count(explode('.',$token))-1;
$lastdot = substr($token,-1)=='.' OR substr($token,-1)=='?' OR substr($token,-1)=='!';
if (!$lastdot) // assume that al... | php | public function classify(array $classes, DocumentInterface $d) {
list($token,$before,$after) = $d->getDocumentData();
$dotcnt = count(explode('.',$token))-1;
$lastdot = substr($token,-1)=='.' OR substr($token,-1)=='?' OR substr($token,-1)=='!';
if (!$lastdot) // assume that al... | [
"public",
"function",
"classify",
"(",
"array",
"$",
"classes",
",",
"DocumentInterface",
"$",
"d",
")",
"{",
"list",
"(",
"$",
"token",
",",
"$",
"before",
",",
"$",
"after",
")",
"=",
"$",
"d",
"->",
"getDocumentData",
"(",
")",
";",
"$",
"dotcnt",... | Splits up a certain text into a sentence array
@param array $classes [description]
@param Document $d [description]
@return [type] [description] | [
"Splits",
"up",
"a",
"certain",
"text",
"into",
"a",
"sentence",
"array"
] | d6d137b4c92b53832ce4b2e517644ed9fb545b7a | https://github.com/FrenzelGmbH/appcommon/blob/d6d137b4c92b53832ce4b2e517644ed9fb545b7a/nlpclassifier/EndOfSentence.php#L16-L29 |
3,665 | emhar/SearchDoctrineBundle | Mapping/MappingException.php | MappingException.invalidMappingType | public static function invalidMappingType($itemClass, $attributeName, $type, $ownerName = null)
{
return new self('The mapping attribute "' . $attributeName
. (isset($ownerName) ? ' of "' . $ownerName . '"' : '')
. ' is not a valid "' . $type . '" in "' . $itemClass . '".'
);
} | php | public static function invalidMappingType($itemClass, $attributeName, $type, $ownerName = null)
{
return new self('The mapping attribute "' . $attributeName
. (isset($ownerName) ? ' of "' . $ownerName . '"' : '')
. ' is not a valid "' . $type . '" in "' . $itemClass . '".'
);
} | [
"public",
"static",
"function",
"invalidMappingType",
"(",
"$",
"itemClass",
",",
"$",
"attributeName",
",",
"$",
"type",
",",
"$",
"ownerName",
"=",
"null",
")",
"{",
"return",
"new",
"self",
"(",
"'The mapping attribute \"'",
".",
"$",
"attributeName",
".",
... | Return MappingException with invalid type mapping message
@param string $itemClass
@param string $attributeName
@param string $type
@param string $ownerName
@return MappingException | [
"Return",
"MappingException",
"with",
"invalid",
"type",
"mapping",
"message"
] | 0844cda4a6972dd71c04c0b38dba1ebf9b15c238 | https://github.com/emhar/SearchDoctrineBundle/blob/0844cda4a6972dd71c04c0b38dba1ebf9b15c238/Mapping/MappingException.php#L22-L28 |
3,666 | emhar/SearchDoctrineBundle | Mapping/MappingException.php | MappingException.requiredMapping | public static function requiredMapping($itemClass, $attributeName, $ownerName = null)
{
return new self('The mapping attribute "' . $attributeName . '"'
. (isset($ownerName) ? ' of "' . $ownerName . '"' : '')
. ' is required in "' . $itemClass . '".'
);
} | php | public static function requiredMapping($itemClass, $attributeName, $ownerName = null)
{
return new self('The mapping attribute "' . $attributeName . '"'
. (isset($ownerName) ? ' of "' . $ownerName . '"' : '')
. ' is required in "' . $itemClass . '".'
);
} | [
"public",
"static",
"function",
"requiredMapping",
"(",
"$",
"itemClass",
",",
"$",
"attributeName",
",",
"$",
"ownerName",
"=",
"null",
")",
"{",
"return",
"new",
"self",
"(",
"'The mapping attribute \"'",
".",
"$",
"attributeName",
".",
"'\"'",
".",
"(",
"... | Return MappingException with required mapping message
@param string $itemClass
@param string $attributeName
@param string $ownerName
@return MappingException | [
"Return",
"MappingException",
"with",
"required",
"mapping",
"message"
] | 0844cda4a6972dd71c04c0b38dba1ebf9b15c238 | https://github.com/emhar/SearchDoctrineBundle/blob/0844cda4a6972dd71c04c0b38dba1ebf9b15c238/Mapping/MappingException.php#L38-L44 |
3,667 | slickframework/filter | src/StaticFilter.php | StaticFilter.filter | public static function filter($alias, $value)
{
$filter = self::create($alias);
return $filter->filter($value);
} | php | public static function filter($alias, $value)
{
$filter = self::create($alias);
return $filter->filter($value);
} | [
"public",
"static",
"function",
"filter",
"(",
"$",
"alias",
",",
"$",
"value",
")",
"{",
"$",
"filter",
"=",
"self",
"::",
"create",
"(",
"$",
"alias",
")",
";",
"return",
"$",
"filter",
"->",
"filter",
"(",
"$",
"value",
")",
";",
"}"
] | Creates the filter in the alias or class name and applies it to the
provided value.
@param string $alias Filter alias or FQ class name
@param mixed $value Value to filter
@throws InvalidArgumentException If the class does not exists or if
class does not implements the FilterInterface.
@return mixed | [
"Creates",
"the",
"filter",
"in",
"the",
"alias",
"or",
"class",
"name",
"and",
"applies",
"it",
"to",
"the",
"provided",
"value",
"."
] | 535eaec933623e921b974af6470e92104572fe60 | https://github.com/slickframework/filter/blob/535eaec933623e921b974af6470e92104572fe60/src/StaticFilter.php#L45-L49 |
3,668 | slickframework/filter | src/StaticFilter.php | StaticFilter.getClass | protected static function getClass($alias)
{
if (array_key_exists($alias, self::$filters)) {
return self::$filters[$alias];
}
if (!class_exists($alias)) {
throw new InvalidArgumentException(
"Class {$alias} does not exists."
);
}
... | php | protected static function getClass($alias)
{
if (array_key_exists($alias, self::$filters)) {
return self::$filters[$alias];
}
if (!class_exists($alias)) {
throw new InvalidArgumentException(
"Class {$alias} does not exists."
);
}
... | [
"protected",
"static",
"function",
"getClass",
"(",
"$",
"alias",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"alias",
",",
"self",
"::",
"$",
"filters",
")",
")",
"{",
"return",
"self",
"::",
"$",
"filters",
"[",
"$",
"alias",
"]",
";",
"}",
... | Returns the class name for provided alias
@param string $alias The FQ class name or one of known filter alias
@return string
@throws InvalidArgumentException If the class does not exists. | [
"Returns",
"the",
"class",
"name",
"for",
"provided",
"alias"
] | 535eaec933623e921b974af6470e92104572fe60 | https://github.com/slickframework/filter/blob/535eaec933623e921b974af6470e92104572fe60/src/StaticFilter.php#L76-L88 |
3,669 | codebobbly/dvoconnector | Classes/Service/GenericApiService.php | GenericApiService.queryXml | protected function queryXml($apiUrl, $apiServiceFilter = null)
{
$useCache = self::$useCache;
if ($apiServiceFilter) {
$url = $apiUrl . $apiServiceFilter->getURLQuery();
} else {
$url = $apiUrl;
}
// no cache, so query from server
if (!$useCa... | php | protected function queryXml($apiUrl, $apiServiceFilter = null)
{
$useCache = self::$useCache;
if ($apiServiceFilter) {
$url = $apiUrl . $apiServiceFilter->getURLQuery();
} else {
$url = $apiUrl;
}
// no cache, so query from server
if (!$useCa... | [
"protected",
"function",
"queryXml",
"(",
"$",
"apiUrl",
",",
"$",
"apiServiceFilter",
"=",
"null",
")",
"{",
"$",
"useCache",
"=",
"self",
"::",
"$",
"useCache",
";",
"if",
"(",
"$",
"apiServiceFilter",
")",
"{",
"$",
"url",
"=",
"$",
"apiUrl",
".",
... | Queries XML data from server or cache
@param string API URL
@param \RGU\Dvoconnector\Service\ApiServiceFilter $apiServiceFilter
@return object \SimpleXMLElement | [
"Queries",
"XML",
"data",
"from",
"server",
"or",
"cache"
] | 9b63790d2fc9fd21bf415b4a5757678895b73bbc | https://github.com/codebobbly/dvoconnector/blob/9b63790d2fc9fd21bf415b4a5757678895b73bbc/Classes/Service/GenericApiService.php#L56-L113 |
3,670 | codebobbly/dvoconnector | Classes/Service/GenericApiService.php | GenericApiService.writeCache | protected function writeCache($key, &$data, $lifetime)
{
$this->cacheManager->set($key, $data, [], $lifetime);
} | php | protected function writeCache($key, &$data, $lifetime)
{
$this->cacheManager->set($key, $data, [], $lifetime);
} | [
"protected",
"function",
"writeCache",
"(",
"$",
"key",
",",
"&",
"$",
"data",
",",
"$",
"lifetime",
")",
"{",
"$",
"this",
"->",
"cacheManager",
"->",
"set",
"(",
"$",
"key",
",",
"$",
"data",
",",
"[",
"]",
",",
"$",
"lifetime",
")",
";",
"}"
] | Caches the HTTP response body into database
@param string $key A unique key for storing the data, e.g. request URI
@param string $data The data itself, e.g. XML data
@param int $lifetime How long the entry should be valid | [
"Caches",
"the",
"HTTP",
"response",
"body",
"into",
"database"
] | 9b63790d2fc9fd21bf415b4a5757678895b73bbc | https://github.com/codebobbly/dvoconnector/blob/9b63790d2fc9fd21bf415b4a5757678895b73bbc/Classes/Service/GenericApiService.php#L122-L125 |
3,671 | marando/phpSOFA | src/Marando/IAU/iauGd2gce.php | iauGd2gce.Gd2gce | public static function Gd2gce($a, $f, $elong, $phi, $height, array &$xyz) {
$sp;
$cp;
$w;
$d;
$ac;
$as;
$r;
/* Functions of geodetic latitude. */
$sp = sin($phi);
$cp = cos($phi);
$w = 1.0 - $f;
$w = $w * $w;
$d = $cp * $cp + $w * $sp * $sp;
if ($d <= 0.0)
... | php | public static function Gd2gce($a, $f, $elong, $phi, $height, array &$xyz) {
$sp;
$cp;
$w;
$d;
$ac;
$as;
$r;
/* Functions of geodetic latitude. */
$sp = sin($phi);
$cp = cos($phi);
$w = 1.0 - $f;
$w = $w * $w;
$d = $cp * $cp + $w * $sp * $sp;
if ($d <= 0.0)
... | [
"public",
"static",
"function",
"Gd2gce",
"(",
"$",
"a",
",",
"$",
"f",
",",
"$",
"elong",
",",
"$",
"phi",
",",
"$",
"height",
",",
"array",
"&",
"$",
"xyz",
")",
"{",
"$",
"sp",
";",
"$",
"cp",
";",
"$",
"w",
";",
"$",
"d",
";",
"$",
"a... | - - - - - - - - - -
i a u G d 2 g c e
- - - - - - - - - -
Transform geodetic coordinates to geocentric for a reference
ellipsoid of specified form.
This function is part of the International Astronomical Union's
SOFA (Standards of Fundamental Astronomy) software collection.
Status: support function.
Given:
a ... | [
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"i",
"a",
"u",
"G",
"d",
"2",
"g",
"c",
"e",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-"
] | 757fa49fe335ae1210eaa7735473fd4388b13f07 | https://github.com/marando/phpSOFA/blob/757fa49fe335ae1210eaa7735473fd4388b13f07/src/Marando/IAU/iauGd2gce.php#L71-L99 |
3,672 | devbr/pack-blog | Model/Base.php | Base.checkLink | function checkLink($link, $id)
{
$result = $this->db->query('SELECT link
FROM '.$this->articleTable.'
WHERE link = :link
AND id != :id',
[':link'=>$link,
... | php | function checkLink($link, $id)
{
$result = $this->db->query('SELECT link
FROM '.$this->articleTable.'
WHERE link = :link
AND id != :id',
[':link'=>$link,
... | [
"function",
"checkLink",
"(",
"$",
"link",
",",
"$",
"id",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"db",
"->",
"query",
"(",
"'SELECT link \n FROM '",
".",
"$",
"this",
"->",
"articleTable",
".",
"' \n ... | Check link and if ID is diferent
@param [type] $link [description]
@param [type] $id [description]
@return [type] [description] | [
"Check",
"link",
"and",
"if",
"ID",
"is",
"diferent"
] | 4693e36521ee3d08077f0db3e013afb99785cc9d | https://github.com/devbr/pack-blog/blob/4693e36521ee3d08077f0db3e013afb99785cc9d/Model/Base.php#L79-L99 |
3,673 | devbr/pack-blog | Model/Base.php | Base.getCategory | function getCategory($id)
{
$result = $this->db->query('SELECT * FROM category WHERE id = :id', [':id'=>(0+$id)]);
if (isset($result[0])) {
return ['name'=>$result[0]->get('name'),
'description'=>$result[0]->get('description')];
}
return false;
} | php | function getCategory($id)
{
$result = $this->db->query('SELECT * FROM category WHERE id = :id', [':id'=>(0+$id)]);
if (isset($result[0])) {
return ['name'=>$result[0]->get('name'),
'description'=>$result[0]->get('description')];
}
return false;
} | [
"function",
"getCategory",
"(",
"$",
"id",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"db",
"->",
"query",
"(",
"'SELECT * FROM category WHERE id = :id'",
",",
"[",
"':id'",
"=>",
"(",
"0",
"+",
"$",
"id",
")",
"]",
")",
";",
"if",
"(",
"isset"... | Get Category by id
@param integer $id Id for category
@return bool|array Array of the name and description or false | [
"Get",
"Category",
"by",
"id"
] | 4693e36521ee3d08077f0db3e013afb99785cc9d | https://github.com/devbr/pack-blog/blob/4693e36521ee3d08077f0db3e013afb99785cc9d/Model/Base.php#L124-L132 |
3,674 | devbr/pack-blog | Model/Base.php | Base.comList | private function comList($result)
{
foreach ($result as $res) {
$data[$res->get('id')]['title'] = $res->get('title');
$data[$res->get('id')]['resume'] = $res->get('resume');
$data[$res->get('id')]['author'] = $res->get('author');
$data[$res->get('id')]['autor'... | php | private function comList($result)
{
foreach ($result as $res) {
$data[$res->get('id')]['title'] = $res->get('title');
$data[$res->get('id')]['resume'] = $res->get('resume');
$data[$res->get('id')]['author'] = $res->get('author');
$data[$res->get('id')]['autor'... | [
"private",
"function",
"comList",
"(",
"$",
"result",
")",
"{",
"foreach",
"(",
"$",
"result",
"as",
"$",
"res",
")",
"{",
"$",
"data",
"[",
"$",
"res",
"->",
"get",
"(",
"'id'",
")",
"]",
"[",
"'title'",
"]",
"=",
"$",
"res",
"->",
"get",
"(",... | Private util function
@param array $result Array of the Row object
@return array result data | [
"Private",
"util",
"function"
] | 4693e36521ee3d08077f0db3e013afb99785cc9d | https://github.com/devbr/pack-blog/blob/4693e36521ee3d08077f0db3e013afb99785cc9d/Model/Base.php#L302-L330 |
3,675 | devbr/pack-blog | Model/Base.php | Base.listByCategory | public function listByCategory($cat = null)
{
$result = $this->db->query('SELECT id, title, resume, category, author, link
FROM '.$this->articleTable.'
WHERE category = :cat', [':cat'=>$cat]);
if (isset($result[0])) {
... | php | public function listByCategory($cat = null)
{
$result = $this->db->query('SELECT id, title, resume, category, author, link
FROM '.$this->articleTable.'
WHERE category = :cat', [':cat'=>$cat]);
if (isset($result[0])) {
... | [
"public",
"function",
"listByCategory",
"(",
"$",
"cat",
"=",
"null",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"db",
"->",
"query",
"(",
"'SELECT id, title, resume, category, author, link \n FROM '",
".",
"$",
"this",
"->"... | List ao article in this category
@param integer $cat category id
@return array|bool data result or false | [
"List",
"ao",
"article",
"in",
"this",
"category"
] | 4693e36521ee3d08077f0db3e013afb99785cc9d | https://github.com/devbr/pack-blog/blob/4693e36521ee3d08077f0db3e013afb99785cc9d/Model/Base.php#L360-L369 |
3,676 | bishopb/vanilla | applications/dashboard/controllers/class.statisticscontroller.php | StatisticsController.Index | public function Index() {
$this->Permission('Garden.Settings.Manage');
$this->AddSideMenu('dashboard/statistics');
//$this->AddJsFile('statistics.js');
$this->Title(T('Vanilla Statistics'));
$this->EnableSlicing($this);
if ($this->Form->IsPostBack()) {
$Flow = TRUE;
... | php | public function Index() {
$this->Permission('Garden.Settings.Manage');
$this->AddSideMenu('dashboard/statistics');
//$this->AddJsFile('statistics.js');
$this->Title(T('Vanilla Statistics'));
$this->EnableSlicing($this);
if ($this->Form->IsPostBack()) {
$Flow = TRUE;
... | [
"public",
"function",
"Index",
"(",
")",
"{",
"$",
"this",
"->",
"Permission",
"(",
"'Garden.Settings.Manage'",
")",
";",
"$",
"this",
"->",
"AddSideMenu",
"(",
"'dashboard/statistics'",
")",
";",
"//$this->AddJsFile('statistics.js');",
"$",
"this",
"->",
"Title",... | Statistics setup & configuration.
@since 2.0.17
@access public | [
"Statistics",
"setup",
"&",
"configuration",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/dashboard/controllers/class.statisticscontroller.php#L50-L105 |
3,677 | bishopb/vanilla | applications/dashboard/controllers/class.statisticscontroller.php | StatisticsController.Verify | public function Verify() {
$CredentialsValid = Gdn::Statistics()->ValidateCredentials();
$this->SetData('StatisticsVerified', $CredentialsValid);
$this->Render();
} | php | public function Verify() {
$CredentialsValid = Gdn::Statistics()->ValidateCredentials();
$this->SetData('StatisticsVerified', $CredentialsValid);
$this->Render();
} | [
"public",
"function",
"Verify",
"(",
")",
"{",
"$",
"CredentialsValid",
"=",
"Gdn",
"::",
"Statistics",
"(",
")",
"->",
"ValidateCredentials",
"(",
")",
";",
"$",
"this",
"->",
"SetData",
"(",
"'StatisticsVerified'",
",",
"$",
"CredentialsValid",
")",
";",
... | Verify connection credentials.
@since 2.0.17
@access public | [
"Verify",
"connection",
"credentials",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/dashboard/controllers/class.statisticscontroller.php#L113-L117 |
3,678 | binsoul/net-http-message-message | src/Collection/ParameterCollection.php | ParameterCollection.has | public function has(string $name): bool
{
$parts = explode('[', $name);
$lastKey = trim(array_pop($parts), ']');
$current = &$this->parameters;
foreach ($parts as $part) {
$target = trim($part, ']');
if (!is_array($current) || !array_key_exists($target, $curre... | php | public function has(string $name): bool
{
$parts = explode('[', $name);
$lastKey = trim(array_pop($parts), ']');
$current = &$this->parameters;
foreach ($parts as $part) {
$target = trim($part, ']');
if (!is_array($current) || !array_key_exists($target, $curre... | [
"public",
"function",
"has",
"(",
"string",
"$",
"name",
")",
":",
"bool",
"{",
"$",
"parts",
"=",
"explode",
"(",
"'['",
",",
"$",
"name",
")",
";",
"$",
"lastKey",
"=",
"trim",
"(",
"array_pop",
"(",
"$",
"parts",
")",
",",
"']'",
")",
";",
"... | Checks if a parameter exists.
@param string $name name of the parameter
@return bool | [
"Checks",
"if",
"a",
"parameter",
"exists",
"."
] | b367ecdfda28570f849fc7e0723125a951d915a7 | https://github.com/binsoul/net-http-message-message/blob/b367ecdfda28570f849fc7e0723125a951d915a7/src/Collection/ParameterCollection.php#L70-L89 |
3,679 | binsoul/net-http-message-message | src/Collection/ParameterCollection.php | ParameterCollection.get | public function get(string $name, $default = null)
{
$parts = explode('[', $name);
$lastKey = trim(array_pop($parts), ']');
$current = &$this->parameters;
foreach ($parts as $part) {
$target = trim($part, ']');
if (!is_array($current) || !array_key_exists($tar... | php | public function get(string $name, $default = null)
{
$parts = explode('[', $name);
$lastKey = trim(array_pop($parts), ']');
$current = &$this->parameters;
foreach ($parts as $part) {
$target = trim($part, ']');
if (!is_array($current) || !array_key_exists($tar... | [
"public",
"function",
"get",
"(",
"string",
"$",
"name",
",",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"parts",
"=",
"explode",
"(",
"'['",
",",
"$",
"name",
")",
";",
"$",
"lastKey",
"=",
"trim",
"(",
"array_pop",
"(",
"$",
"parts",
")",
",",... | Returns the value of a parameter.
@param string $name name of the parameter
@param mixed $default return value if the parameter doesn't exist
@return mixed | [
"Returns",
"the",
"value",
"of",
"a",
"parameter",
"."
] | b367ecdfda28570f849fc7e0723125a951d915a7 | https://github.com/binsoul/net-http-message-message/blob/b367ecdfda28570f849fc7e0723125a951d915a7/src/Collection/ParameterCollection.php#L99-L118 |
3,680 | digitalkaoz/issues | src/Tracker/SearchableTracker.php | SearchableTracker.requestProjects | protected function requestProjects($name, \Closure $finder, $nameKey)
{
$projects = [];
if ($this->repoParser->isConcrete($name)) {
$project = $this->getProject($name);
$projects[$project->getName()] = $project;
} else {
$repos = $fi... | php | protected function requestProjects($name, \Closure $finder, $nameKey)
{
$projects = [];
if ($this->repoParser->isConcrete($name)) {
$project = $this->getProject($name);
$projects[$project->getName()] = $project;
} else {
$repos = $fi... | [
"protected",
"function",
"requestProjects",
"(",
"$",
"name",
",",
"\\",
"Closure",
"$",
"finder",
",",
"$",
"nameKey",
")",
"{",
"$",
"projects",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"this",
"->",
"repoParser",
"->",
"isConcrete",
"(",
"$",
"name",
"... | searches for projects.
@param string $name
@param \Closure $finder
@param string $nameKey
@return Project[] | [
"searches",
"for",
"projects",
"."
] | c5ac5c907ec981669619780747a55251d65310d6 | https://github.com/digitalkaoz/issues/blob/c5ac5c907ec981669619780747a55251d65310d6/src/Tracker/SearchableTracker.php#L79-L106 |
3,681 | osflab/container | OsfContainer.php | OsfContainer.getViewHelper | public static function getViewHelper($appName = null, bool $layout = false)
{
if ($appName === false) {
$class = '\Osf\View\Helper';
$instance = 'osf';
} else {
$appName = $appName === null ? Router::getDefaultControllerName(true) : $appName;
$class = ... | php | public static function getViewHelper($appName = null, bool $layout = false)
{
if ($appName === false) {
$class = '\Osf\View\Helper';
$instance = 'osf';
} else {
$appName = $appName === null ? Router::getDefaultControllerName(true) : $appName;
$class = ... | [
"public",
"static",
"function",
"getViewHelper",
"(",
"$",
"appName",
"=",
"null",
",",
"bool",
"$",
"layout",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"appName",
"===",
"false",
")",
"{",
"$",
"class",
"=",
"'\\Osf\\View\\Helper'",
";",
"$",
"instance",
... | Get a view helpers object with a context
@param string|null|false $appName if null : common app. if false : Osf view helper
@param bool $layout
@return \Osf\View\Helper
@task [HELPERS] simplifier | [
"Get",
"a",
"view",
"helpers",
"object",
"with",
"a",
"context"
] | 415b374260ad377df00f8b3683b99f08bb4d25b6 | https://github.com/osflab/container/blob/415b374260ad377df00f8b3683b99f08bb4d25b6/OsfContainer.php#L99-L112 |
3,682 | osflab/container | OsfContainer.php | OsfContainer.getCrypt | public static function getCrypt($cryptKey = Crypt::DEFAULT_KEY, $mode = Crypt::MODE_ASCII): \Osf\Crypt\Crypt
{
return self::buildObject('\Osf\Crypt\Crypt', [$cryptKey, $mode]);
} | php | public static function getCrypt($cryptKey = Crypt::DEFAULT_KEY, $mode = Crypt::MODE_ASCII): \Osf\Crypt\Crypt
{
return self::buildObject('\Osf\Crypt\Crypt', [$cryptKey, $mode]);
} | [
"public",
"static",
"function",
"getCrypt",
"(",
"$",
"cryptKey",
"=",
"Crypt",
"::",
"DEFAULT_KEY",
",",
"$",
"mode",
"=",
"Crypt",
"::",
"MODE_ASCII",
")",
":",
"\\",
"Osf",
"\\",
"Crypt",
"\\",
"Crypt",
"{",
"return",
"self",
"::",
"buildObject",
"(",... | Get Osf Crypt object. Parameters are usefull ONLY for the first call
@param string $cryptKey
@param string $mode
@return \Osf\Crypt\Crypt | [
"Get",
"Osf",
"Crypt",
"object",
".",
"Parameters",
"are",
"usefull",
"ONLY",
"for",
"the",
"first",
"call"
] | 415b374260ad377df00f8b3683b99f08bb4d25b6 | https://github.com/osflab/container/blob/415b374260ad377df00f8b3683b99f08bb4d25b6/OsfContainer.php#L173-L176 |
3,683 | routegroup/native-media | src/Concerns/Thumbnail.php | Thumbnail.thumbnail | public function thumbnail($width, $height = null)
{
if ($this->type != 'image') {
throw new \LogicException("Tried to create thumbnail for not image file.", 500);
}
$thumbnail = new \Routegroup\Media\Helpers\Thumbnail($this);
$filename = $thumbnail->name($width, $height... | php | public function thumbnail($width, $height = null)
{
if ($this->type != 'image') {
throw new \LogicException("Tried to create thumbnail for not image file.", 500);
}
$thumbnail = new \Routegroup\Media\Helpers\Thumbnail($this);
$filename = $thumbnail->name($width, $height... | [
"public",
"function",
"thumbnail",
"(",
"$",
"width",
",",
"$",
"height",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"type",
"!=",
"'image'",
")",
"{",
"throw",
"new",
"\\",
"LogicException",
"(",
"\"Tried to create thumbnail for not image file.\"",
... | Gets thumbnail for given sizes.
@param integer $width
@param integer $height
@return string | [
"Gets",
"thumbnail",
"for",
"given",
"sizes",
"."
] | 5ea35c46c2ac1019e277ec4fe698f17581524631 | https://github.com/routegroup/native-media/blob/5ea35c46c2ac1019e277ec4fe698f17581524631/src/Concerns/Thumbnail.php#L28-L43 |
3,684 | franzip/serp-fetcher | src/Helpers/GenericValidator.php | GenericValidator.argsValidation | public static function argsValidation($cacheDir, $cacheTTL, $caching,
$cacheForever, $charset)
{
if (!self::validateDirName($cacheDir))
throw new \Franzip\SerpFetcher\Exceptions\InvalidArgumentException('Invalid SerpFetcher $cacheDir: please supply a val... | php | public static function argsValidation($cacheDir, $cacheTTL, $caching,
$cacheForever, $charset)
{
if (!self::validateDirName($cacheDir))
throw new \Franzip\SerpFetcher\Exceptions\InvalidArgumentException('Invalid SerpFetcher $cacheDir: please supply a val... | [
"public",
"static",
"function",
"argsValidation",
"(",
"$",
"cacheDir",
",",
"$",
"cacheTTL",
",",
"$",
"caching",
",",
"$",
"cacheForever",
",",
"$",
"charset",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"validateDirName",
"(",
"$",
"cacheDir",
")",
")",
... | Perform validation on SerpFetcher constructor arguments.
@param string $cacheDir
@param int $cacheTTL
@param bool $caching
@param bool $cacheForever
@param string $charset | [
"Perform",
"validation",
"on",
"SerpFetcher",
"constructor",
"arguments",
"."
] | 0554b682a8e4aec6e5d615866087b34e731e0d88 | https://github.com/franzip/serp-fetcher/blob/0554b682a8e4aec6e5d615866087b34e731e0d88/src/Helpers/GenericValidator.php#L30-L47 |
3,685 | gap-db/orm | GapOrm/Drivers/PdoDriver.php | PdoDriver.tableExists | public function tableExists($tableName)
{
if (is_null($this->dbh)) {
throw new NoConnectionException();
}
$mrSql = "SHOW TABLES LIKE :table_name";
$mrStmt = $this->dbh->prepare($mrSql);
// protect from injection attacks
$mrStmt->bindParam(":table_name",... | php | public function tableExists($tableName)
{
if (is_null($this->dbh)) {
throw new NoConnectionException();
}
$mrSql = "SHOW TABLES LIKE :table_name";
$mrStmt = $this->dbh->prepare($mrSql);
// protect from injection attacks
$mrStmt->bindParam(":table_name",... | [
"public",
"function",
"tableExists",
"(",
"$",
"tableName",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"dbh",
")",
")",
"{",
"throw",
"new",
"NoConnectionException",
"(",
")",
";",
"}",
"$",
"mrSql",
"=",
"\"SHOW TABLES LIKE :table_name\"",
";... | This function checks if the table exists in the passed PDO database connection
@param $tableName
@return boolean - true if table was found, false if not
@throws \GapOrm\Exceptions\NoConnectionException | [
"This",
"function",
"checks",
"if",
"the",
"table",
"exists",
"in",
"the",
"passed",
"PDO",
"database",
"connection"
] | bcd8e3d27b19b14814d3207489071c4a250a6ac5 | https://github.com/gap-db/orm/blob/bcd8e3d27b19b14814d3207489071c4a250a6ac5/GapOrm/Drivers/PdoDriver.php#L244-L267 |
3,686 | LasseHaslev/image-handler | src/Handlers/ImageHandler.php | ImageHandler.deleteCrops | public static function deleteCrops( $originalFilePath, $cropsFolder = null )
{
$self = static::create( $originalFilePath, $cropsFolder );
return $self->removeCrops();
} | php | public static function deleteCrops( $originalFilePath, $cropsFolder = null )
{
$self = static::create( $originalFilePath, $cropsFolder );
return $self->removeCrops();
} | [
"public",
"static",
"function",
"deleteCrops",
"(",
"$",
"originalFilePath",
",",
"$",
"cropsFolder",
"=",
"null",
")",
"{",
"$",
"self",
"=",
"static",
"::",
"create",
"(",
"$",
"originalFilePath",
",",
"$",
"cropsFolder",
")",
";",
"return",
"$",
"self",... | Quickly remove crops
@return $instance | [
"Quickly",
"remove",
"crops"
] | dfc4fc7417617169d2483d62e5d27d3dd6a12235 | https://github.com/LasseHaslev/image-handler/blob/dfc4fc7417617169d2483d62e5d27d3dd6a12235/src/Handlers/ImageHandler.php#L78-L82 |
3,687 | LasseHaslev/image-handler | src/Handlers/ImageHandler.php | ImageHandler.removeCrops | public function removeCrops()
{
// Get original file name
$justTheName = pathinfo($this->originalImagePath, PATHINFO_FILENAME);
// Get all the files to remove
$filesToRemove = glob( sprintf( '%s/%s-*', $this->cropsFolder, $justTheName ) );
// Delete the crops from list
... | php | public function removeCrops()
{
// Get original file name
$justTheName = pathinfo($this->originalImagePath, PATHINFO_FILENAME);
// Get all the files to remove
$filesToRemove = glob( sprintf( '%s/%s-*', $this->cropsFolder, $justTheName ) );
// Delete the crops from list
... | [
"public",
"function",
"removeCrops",
"(",
")",
"{",
"// Get original file name",
"$",
"justTheName",
"=",
"pathinfo",
"(",
"$",
"this",
"->",
"originalImagePath",
",",
"PATHINFO_FILENAME",
")",
";",
"// Get all the files to remove",
"$",
"filesToRemove",
"=",
"glob",
... | Reset all created crops for the image
@return $this | [
"Reset",
"all",
"created",
"crops",
"for",
"the",
"image"
] | dfc4fc7417617169d2483d62e5d27d3dd6a12235 | https://github.com/LasseHaslev/image-handler/blob/dfc4fc7417617169d2483d62e5d27d3dd6a12235/src/Handlers/ImageHandler.php#L89-L107 |
3,688 | inceddy/ieu_http | src/ieu/Http/Request.php | Request.server | public function server(string $key, $default = null)
{
return $this->server->has($key) ? $this->server->get($key) : $default;
} | php | public function server(string $key, $default = null)
{
return $this->server->has($key) ? $this->server->get($key) : $default;
} | [
"public",
"function",
"server",
"(",
"string",
"$",
"key",
",",
"$",
"default",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"server",
"->",
"has",
"(",
"$",
"key",
")",
"?",
"$",
"this",
"->",
"server",
"->",
"get",
"(",
"$",
"key",
")",
... | Shortcut to fetch a SERVER-parameter with optional default value
@param string $key
the key to look for
@param mixed $default
the value thar will be returned if the key is not set
@return mixed
the found or the default value | [
"Shortcut",
"to",
"fetch",
"a",
"SERVER",
"-",
"parameter",
"with",
"optional",
"default",
"value"
] | 4c9b097ee1e31ca45acfb79a855462d78b5c979c | https://github.com/inceddy/ieu_http/blob/4c9b097ee1e31ca45acfb79a855462d78b5c979c/src/ieu/Http/Request.php#L229-L232 |
3,689 | inceddy/ieu_http | src/ieu/Http/Request.php | Request.cookie | public function cookie(string $key, $default = null)
{
return $this->cookie->has($key) ? $this->cookie->get($key) : $default;
} | php | public function cookie(string $key, $default = null)
{
return $this->cookie->has($key) ? $this->cookie->get($key) : $default;
} | [
"public",
"function",
"cookie",
"(",
"string",
"$",
"key",
",",
"$",
"default",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"cookie",
"->",
"has",
"(",
"$",
"key",
")",
"?",
"$",
"this",
"->",
"cookie",
"->",
"get",
"(",
"$",
"key",
")",
... | Shortcut to fetch a COOKIE-parameter with optional default value
@param string $key the key to look for
@param mixed $default the value thar will be returned if the key is not set
@return mixed the found or the default value | [
"Shortcut",
"to",
"fetch",
"a",
"COOKIE",
"-",
"parameter",
"with",
"optional",
"default",
"value"
] | 4c9b097ee1e31ca45acfb79a855462d78b5c979c | https://github.com/inceddy/ieu_http/blob/4c9b097ee1e31ca45acfb79a855462d78b5c979c/src/ieu/Http/Request.php#L245-L248 |
3,690 | inceddy/ieu_http | src/ieu/Http/Request.php | Request.session | public function session(string $key, $default = null)
{
if (null === $this->session) {
throw new \Exception('No session object set. Use \'Request::setSession\'.');
}
return $this->session->has($key) ? $this->session->get($key) : $default;
} | php | public function session(string $key, $default = null)
{
if (null === $this->session) {
throw new \Exception('No session object set. Use \'Request::setSession\'.');
}
return $this->session->has($key) ? $this->session->get($key) : $default;
} | [
"public",
"function",
"session",
"(",
"string",
"$",
"key",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"session",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'No session object set. Use \\'Request::setSess... | Shortcut to fetch a SESSION-parameter with optional default value.
The session object must me manualy set and started!
@param string $key
the key to look for
@param mixed $default
the value thar will be returned if the key is not set
@return mixed
the found or the default value | [
"Shortcut",
"to",
"fetch",
"a",
"SESSION",
"-",
"parameter",
"with",
"optional",
"default",
"value",
".",
"The",
"session",
"object",
"must",
"me",
"manualy",
"set",
"and",
"started!"
] | 4c9b097ee1e31ca45acfb79a855462d78b5c979c | https://github.com/inceddy/ieu_http/blob/4c9b097ee1e31ca45acfb79a855462d78b5c979c/src/ieu/Http/Request.php#L264-L271 |
3,691 | inceddy/ieu_http | src/ieu/Http/Request.php | Request.header | public function header(string $key, $default = null)
{
return $this->header->has($key) ? $this->header->get($key) : $default;
} | php | public function header(string $key, $default = null)
{
return $this->header->has($key) ? $this->header->get($key) : $default;
} | [
"public",
"function",
"header",
"(",
"string",
"$",
"key",
",",
"$",
"default",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"header",
"->",
"has",
"(",
"$",
"key",
")",
"?",
"$",
"this",
"->",
"header",
"->",
"get",
"(",
"$",
"key",
")",
... | Shortcut to fetch a HEADER-parameter with optional default value.
@param string $key
the key to look for
@param mixed $default
the value thar will be returned if the key is not set
@return mixed
the found or the default value | [
"Shortcut",
"to",
"fetch",
"a",
"HEADER",
"-",
"parameter",
"with",
"optional",
"default",
"value",
"."
] | 4c9b097ee1e31ca45acfb79a855462d78b5c979c | https://github.com/inceddy/ieu_http/blob/4c9b097ee1e31ca45acfb79a855462d78b5c979c/src/ieu/Http/Request.php#L286-L289 |
3,692 | inceddy/ieu_http | src/ieu/Http/Request.php | Request.getMethod | public function getMethod() :? int
{
switch($this->server('REQUEST_METHOD')) {
case 'GET':
return self::HTTP_GET;
case 'POST':
return self::HTTP_POST;
case 'HEAD':
return self::HTTP_HEAD;
case 'PUT':
return self::HTTP_PUT;
case 'DELETE':
... | php | public function getMethod() :? int
{
switch($this->server('REQUEST_METHOD')) {
case 'GET':
return self::HTTP_GET;
case 'POST':
return self::HTTP_POST;
case 'HEAD':
return self::HTTP_HEAD;
case 'PUT':
return self::HTTP_PUT;
case 'DELETE':
... | [
"public",
"function",
"getMethod",
"(",
")",
":",
"?",
"int",
"{",
"switch",
"(",
"$",
"this",
"->",
"server",
"(",
"'REQUEST_METHOD'",
")",
")",
"{",
"case",
"'GET'",
":",
"return",
"self",
"::",
"HTTP_GET",
";",
"case",
"'POST'",
":",
"return",
"self... | Returns the bit-code of the request method or
null if the method is unknown.
@return int|null | [
"Returns",
"the",
"bit",
"-",
"code",
"of",
"the",
"request",
"method",
"or",
"null",
"if",
"the",
"method",
"is",
"unknown",
"."
] | 4c9b097ee1e31ca45acfb79a855462d78b5c979c | https://github.com/inceddy/ieu_http/blob/4c9b097ee1e31ca45acfb79a855462d78b5c979c/src/ieu/Http/Request.php#L318-L340 |
3,693 | inceddy/ieu_http | src/ieu/Http/Request.php | Request.protocolWithActiveSsl | protected function protocolWithActiveSsl($protocol) : bool
{
$protocol = strtolower((string)$protocol);
return in_array($protocol, ['on', '1', 'https', 'ssl'], true);
} | php | protected function protocolWithActiveSsl($protocol) : bool
{
$protocol = strtolower((string)$protocol);
return in_array($protocol, ['on', '1', 'https', 'ssl'], true);
} | [
"protected",
"function",
"protocolWithActiveSsl",
"(",
"$",
"protocol",
")",
":",
"bool",
"{",
"$",
"protocol",
"=",
"strtolower",
"(",
"(",
"string",
")",
"$",
"protocol",
")",
";",
"return",
"in_array",
"(",
"$",
"protocol",
",",
"[",
"'on'",
",",
"'1'... | Detects an active SSL protocol value.
@param string $protocol
@return boolean | [
"Detects",
"an",
"active",
"SSL",
"protocol",
"value",
"."
] | 4c9b097ee1e31ca45acfb79a855462d78b5c979c | https://github.com/inceddy/ieu_http/blob/4c9b097ee1e31ca45acfb79a855462d78b5c979c/src/ieu/Http/Request.php#L435-L439 |
3,694 | inceddy/ieu_http | src/ieu/Http/Request.php | Request.getPort | public function getPort() : string
{
// Check for proxy first
$port = self::server('HTTP_X_FORWARDED_PORT');
if ($port) {
return (string)$port;
}
$protocol = (string)self::server('HTTP_X_FORWARDED_PROTO');
if ($protocol === 'https') {
return '443';
... | php | public function getPort() : string
{
// Check for proxy first
$port = self::server('HTTP_X_FORWARDED_PORT');
if ($port) {
return (string)$port;
}
$protocol = (string)self::server('HTTP_X_FORWARDED_PROTO');
if ($protocol === 'https') {
return '443';
... | [
"public",
"function",
"getPort",
"(",
")",
":",
"string",
"{",
"// Check for proxy first\r",
"$",
"port",
"=",
"self",
"::",
"server",
"(",
"'HTTP_X_FORWARDED_PORT'",
")",
";",
"if",
"(",
"$",
"port",
")",
"{",
"return",
"(",
"string",
")",
"$",
"port",
... | Get the port of this request as string.
@return string | [
"Get",
"the",
"port",
"of",
"this",
"request",
"as",
"string",
"."
] | 4c9b097ee1e31ca45acfb79a855462d78b5c979c | https://github.com/inceddy/ieu_http/blob/4c9b097ee1e31ca45acfb79a855462d78b5c979c/src/ieu/Http/Request.php#L505-L519 |
3,695 | inceddy/ieu_http | src/ieu/Http/Request.php | Request.getUrl | public function getUrl() : Url
{
return Url::from(
$this->getHttpScheme() . '://' . $this->getHost() . $this->server('REQUEST_URI')
);
} | php | public function getUrl() : Url
{
return Url::from(
$this->getHttpScheme() . '://' . $this->getHost() . $this->server('REQUEST_URI')
);
} | [
"public",
"function",
"getUrl",
"(",
")",
":",
"Url",
"{",
"return",
"Url",
"::",
"from",
"(",
"$",
"this",
"->",
"getHttpScheme",
"(",
")",
".",
"'://'",
".",
"$",
"this",
"->",
"getHost",
"(",
")",
".",
"$",
"this",
"->",
"server",
"(",
"'REQUEST... | Gets a new `ieu\Http\Url` object based on the request URL
@throws InvalidArgumentException
If the request URL is invalid
@return ieu\Http\Url | [
"Gets",
"a",
"new",
"ieu",
"\\",
"Http",
"\\",
"Url",
"object",
"based",
"on",
"the",
"request",
"URL"
] | 4c9b097ee1e31ca45acfb79a855462d78b5c979c | https://github.com/inceddy/ieu_http/blob/4c9b097ee1e31ca45acfb79a855462d78b5c979c/src/ieu/Http/Request.php#L530-L535 |
3,696 | emhar/SearchDoctrineBundle | Query/Query.php | Query.getResults | public function getResults(EntityManager $em, Request $request, $page)
{
$query = $this->buildResultQuery($em, $request, $page);
return $query->getResult();
} | php | public function getResults(EntityManager $em, Request $request, $page)
{
$query = $this->buildResultQuery($em, $request, $page);
return $query->getResult();
} | [
"public",
"function",
"getResults",
"(",
"EntityManager",
"$",
"em",
",",
"Request",
"$",
"request",
",",
"$",
"page",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"buildResultQuery",
"(",
"$",
"em",
",",
"$",
"request",
",",
"$",
"page",
")",
";"... | Get results for request
@param EntityManager $em
@param Request $request
@param int $page
@return array | [
"Get",
"results",
"for",
"request"
] | 0844cda4a6972dd71c04c0b38dba1ebf9b15c238 | https://github.com/emhar/SearchDoctrineBundle/blob/0844cda4a6972dd71c04c0b38dba1ebf9b15c238/Query/Query.php#L102-L106 |
3,697 | emhar/SearchDoctrineBundle | Query/Query.php | Query.getCount | public function getCount(EntityManager $em, Request $request)
{
$stmt = $this->buildCountQuery($em, $request);
$stmt->execute();
return (int) $stmt->fetchColumn();
} | php | public function getCount(EntityManager $em, Request $request)
{
$stmt = $this->buildCountQuery($em, $request);
$stmt->execute();
return (int) $stmt->fetchColumn();
} | [
"public",
"function",
"getCount",
"(",
"EntityManager",
"$",
"em",
",",
"Request",
"$",
"request",
")",
"{",
"$",
"stmt",
"=",
"$",
"this",
"->",
"buildCountQuery",
"(",
"$",
"em",
",",
"$",
"request",
")",
";",
"$",
"stmt",
"->",
"execute",
"(",
")"... | Get result count for request
@param EntityManager $em
@param Request $request
@return int | [
"Get",
"result",
"count",
"for",
"request"
] | 0844cda4a6972dd71c04c0b38dba1ebf9b15c238 | https://github.com/emhar/SearchDoctrineBundle/blob/0844cda4a6972dd71c04c0b38dba1ebf9b15c238/Query/Query.php#L115-L120 |
3,698 | emhar/SearchDoctrineBundle | Query/Query.php | Query.buildResultQuery | protected function buildResultQuery(EntityManager $em, Request $request, $page)
{
$searchWords = preg_split('/[^[:alnum:]]+/', $request->getSearchText());
$offset = $request->getLimit() * ($page - 1);
$limit = $request->getLimit();
$selects = array();
foreach($this->databaseMapping as $key => $tableMapping)... | php | protected function buildResultQuery(EntityManager $em, Request $request, $page)
{
$searchWords = preg_split('/[^[:alnum:]]+/', $request->getSearchText());
$offset = $request->getLimit() * ($page - 1);
$limit = $request->getLimit();
$selects = array();
foreach($this->databaseMapping as $key => $tableMapping)... | [
"protected",
"function",
"buildResultQuery",
"(",
"EntityManager",
"$",
"em",
",",
"Request",
"$",
"request",
",",
"$",
"page",
")",
"{",
"$",
"searchWords",
"=",
"preg_split",
"(",
"'/[^[:alnum:]]+/'",
",",
"$",
"request",
"->",
"getSearchText",
"(",
")",
"... | Build result query
@param EntityManager $em
@param Request $request
@param int $page
@return \Doctrine\ORM\NativeQuery | [
"Build",
"result",
"query"
] | 0844cda4a6972dd71c04c0b38dba1ebf9b15c238 | https://github.com/emhar/SearchDoctrineBundle/blob/0844cda4a6972dd71c04c0b38dba1ebf9b15c238/Query/Query.php#L130-L168 |
3,699 | emhar/SearchDoctrineBundle | Query/Query.php | Query.buildCountQuery | protected function buildCountQuery(EntityManager $em, Request $request)
{
$searchWords = preg_split('/[^[:alnum:]]+/', $request->getSearchText());
$selects = array();
foreach($this->databaseMapping as $tableMapping)
{
$score = $this->buildScoreColumn($tableMapping['columns'], count($searchWords));
$joins... | php | protected function buildCountQuery(EntityManager $em, Request $request)
{
$searchWords = preg_split('/[^[:alnum:]]+/', $request->getSearchText());
$selects = array();
foreach($this->databaseMapping as $tableMapping)
{
$score = $this->buildScoreColumn($tableMapping['columns'], count($searchWords));
$joins... | [
"protected",
"function",
"buildCountQuery",
"(",
"EntityManager",
"$",
"em",
",",
"Request",
"$",
"request",
")",
"{",
"$",
"searchWords",
"=",
"preg_split",
"(",
"'/[^[:alnum:]]+/'",
",",
"$",
"request",
"->",
"getSearchText",
"(",
")",
")",
";",
"$",
"sele... | Build count query
@param \Doctrine\ORM\EntityManager $em
@param \Emhar\SearchDoctrineBundle\Request\Request $request
@return \Doctrine\DBAL\Statement; | [
"Build",
"count",
"query"
] | 0844cda4a6972dd71c04c0b38dba1ebf9b15c238 | https://github.com/emhar/SearchDoctrineBundle/blob/0844cda4a6972dd71c04c0b38dba1ebf9b15c238/Query/Query.php#L177-L199 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.