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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
6,200 | jakecleary/ultrapress-library | src/Ultra/Mutator/Mutator.php | Mutator.images | public function images()
{
foreach($this->data as $post)
{
$post->images = Post::images($post->ID);
}
return $this;
} | php | public function images()
{
foreach($this->data as $post)
{
$post->images = Post::images($post->ID);
}
return $this;
} | [
"public",
"function",
"images",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"data",
"as",
"$",
"post",
")",
"{",
"$",
"post",
"->",
"images",
"=",
"Post",
"::",
"images",
"(",
"$",
"post",
"->",
"ID",
")",
";",
"}",
"return",
"$",
"this",
... | Include the featured image URLs in the post object.
@return Ultra\Mutator\Mutator The mutated data object | [
"Include",
"the",
"featured",
"image",
"URLs",
"in",
"the",
"post",
"object",
"."
] | 84ca5d1dae8eb16de8c886787575ea41f9332ae2 | https://github.com/jakecleary/ultrapress-library/blob/84ca5d1dae8eb16de8c886787575ea41f9332ae2/src/Ultra/Mutator/Mutator.php#L136-L144 |
6,201 | jakecleary/ultrapress-library | src/Ultra/Mutator/Mutator.php | Mutator.permalink | public function permalink()
{
foreach($this->data as $post)
{
$post->permalink = get_permalink($post->ID);
}
return $this;
} | php | public function permalink()
{
foreach($this->data as $post)
{
$post->permalink = get_permalink($post->ID);
}
return $this;
} | [
"public",
"function",
"permalink",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"data",
"as",
"$",
"post",
")",
"{",
"$",
"post",
"->",
"permalink",
"=",
"get_permalink",
"(",
"$",
"post",
"->",
"ID",
")",
";",
"}",
"return",
"$",
"this",
";",... | Include the permalink in the post object.
@return Ultra\Mutator\Mutator The mutated data object | [
"Include",
"the",
"permalink",
"in",
"the",
"post",
"object",
"."
] | 84ca5d1dae8eb16de8c886787575ea41f9332ae2 | https://github.com/jakecleary/ultrapress-library/blob/84ca5d1dae8eb16de8c886787575ea41f9332ae2/src/Ultra/Mutator/Mutator.php#L151-L159 |
6,202 | jakecleary/ultrapress-library | src/Ultra/Mutator/Mutator.php | Mutator.field | public function field($name)
{
foreach($this->data as $post)
{
$fieldType = get_field_object($name, $post->ID)['type'];
if(in_array($fieldType, ['text']))
{
$post->$name = get_field($name, $post->ID);
}
elseif(in_array($fie... | php | public function field($name)
{
foreach($this->data as $post)
{
$fieldType = get_field_object($name, $post->ID)['type'];
if(in_array($fieldType, ['text']))
{
$post->$name = get_field($name, $post->ID);
}
elseif(in_array($fie... | [
"public",
"function",
"field",
"(",
"$",
"name",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"data",
"as",
"$",
"post",
")",
"{",
"$",
"fieldType",
"=",
"get_field_object",
"(",
"$",
"name",
",",
"$",
"post",
"->",
"ID",
")",
"[",
"'type'",
"]",
... | Get the contents of an ACF field.
@param string $name The field name
@return mixed The field's data | [
"Get",
"the",
"contents",
"of",
"an",
"ACF",
"field",
"."
] | 84ca5d1dae8eb16de8c886787575ea41f9332ae2 | https://github.com/jakecleary/ultrapress-library/blob/84ca5d1dae8eb16de8c886787575ea41f9332ae2/src/Ultra/Mutator/Mutator.php#L167-L184 |
6,203 | jakecleary/ultrapress-library | src/Ultra/Mutator/Mutator.php | Mutator.removeNamespace | public function removeNamespace($post, $namespaces)
{
foreach($post as $key => $value)
{
$splitKey = explode('_', $key);
if(in_array($splitKey[0], $namespaces))
{
unset($post->$key);
$newKey = implode(array_slice($splitKey, 1), '_... | php | public function removeNamespace($post, $namespaces)
{
foreach($post as $key => $value)
{
$splitKey = explode('_', $key);
if(in_array($splitKey[0], $namespaces))
{
unset($post->$key);
$newKey = implode(array_slice($splitKey, 1), '_... | [
"public",
"function",
"removeNamespace",
"(",
"$",
"post",
",",
"$",
"namespaces",
")",
"{",
"foreach",
"(",
"$",
"post",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"splitKey",
"=",
"explode",
"(",
"'_'",
",",
"$",
"key",
")",
";",
"if",
... | Strip out a namespace from a data set.
@param object $post WP_Post object to modify
@param string $namespace The namespace to remove
@return Ultra\Mutator\Mutator The mutated data object | [
"Strip",
"out",
"a",
"namespace",
"from",
"a",
"data",
"set",
"."
] | 84ca5d1dae8eb16de8c886787575ea41f9332ae2 | https://github.com/jakecleary/ultrapress-library/blob/84ca5d1dae8eb16de8c886787575ea41f9332ae2/src/Ultra/Mutator/Mutator.php#L193-L210 |
6,204 | tux-rampage/rampage-php | library/rampage/core/Application.php | Application.handleFinalException | public static function handleFinalException(\Exception $exception)
{
if (PHP_SAPI == 'cli') {
echo $exception; exit(1);
}
@header('Status: 500 Internal Error');
@header('HTTP/1.1 500 Internal Error');
while (ob_get_level() > 0) {
ob_end_clean();
... | php | public static function handleFinalException(\Exception $exception)
{
if (PHP_SAPI == 'cli') {
echo $exception; exit(1);
}
@header('Status: 500 Internal Error');
@header('HTTP/1.1 500 Internal Error');
while (ob_get_level() > 0) {
ob_end_clean();
... | [
"public",
"static",
"function",
"handleFinalException",
"(",
"\\",
"Exception",
"$",
"exception",
")",
"{",
"if",
"(",
"PHP_SAPI",
"==",
"'cli'",
")",
"{",
"echo",
"$",
"exception",
";",
"exit",
"(",
"1",
")",
";",
"}",
"@",
"header",
"(",
"'Status: 500 ... | Handle final exception
@param \Exception $exception | [
"Handle",
"final",
"exception"
] | 1c679b04a6d477e2f8fdb86135e1d9f0c128b1cf | https://github.com/tux-rampage/rampage-php/blob/1c679b04a6d477e2f8fdb86135e1d9f0c128b1cf/library/rampage/core/Application.php#L135-L164 |
6,205 | tux-rampage/rampage-php | library/rampage/core/Application.php | Application.errorToException | public static function errorToException($errno, $errstr, $errfile, $errline)
{
$exclude = E_STRICT | E_NOTICE | E_USER_NOTICE;
if (((error_reporting() & $errno) != $errno) || (($exclude & $errno) == $errno)) {
return false;
}
$constants = get_defined_constants(true);
... | php | public static function errorToException($errno, $errstr, $errfile, $errline)
{
$exclude = E_STRICT | E_NOTICE | E_USER_NOTICE;
if (((error_reporting() & $errno) != $errno) || (($exclude & $errno) == $errno)) {
return false;
}
$constants = get_defined_constants(true);
... | [
"public",
"static",
"function",
"errorToException",
"(",
"$",
"errno",
",",
"$",
"errstr",
",",
"$",
"errfile",
",",
"$",
"errline",
")",
"{",
"$",
"exclude",
"=",
"E_STRICT",
"|",
"E_NOTICE",
"|",
"E_USER_NOTICE",
";",
"if",
"(",
"(",
"(",
"error_report... | Convert php errors to exceptions
@throws \RuntimeException | [
"Convert",
"php",
"errors",
"to",
"exceptions"
] | 1c679b04a6d477e2f8fdb86135e1d9f0c128b1cf | https://github.com/tux-rampage/rampage-php/blob/1c679b04a6d477e2f8fdb86135e1d9f0c128b1cf/library/rampage/core/Application.php#L171-L197 |
6,206 | zerospam/sdk-framework | src/Utils/Reflection/ReflectionUtil.php | ReflectionUtil.objToSnakeArray | public static function objToSnakeArray($object, $blackList = [])
{
if (!is_object($object)) {
throw new \InvalidArgumentException('Not an object');
}
return array_reduce(
self::getAllProperties($object, $blackList),
function (
array $resul... | php | public static function objToSnakeArray($object, $blackList = [])
{
if (!is_object($object)) {
throw new \InvalidArgumentException('Not an object');
}
return array_reduce(
self::getAllProperties($object, $blackList),
function (
array $resul... | [
"public",
"static",
"function",
"objToSnakeArray",
"(",
"$",
"object",
",",
"$",
"blackList",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"object",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Not an object'",... | Take an object and return an array using all it's properties.
Don't set the null one
@param $object *
@param array $blackList array containing name of properties to not serialize
@throws \ReflectionException
@return array | [
"Take",
"an",
"object",
"and",
"return",
"an",
"array",
"using",
"all",
"it",
"s",
"properties",
"."
] | 6780b81584619cb177d5d5e14fd7e87a9d8e48fd | https://github.com/zerospam/sdk-framework/blob/6780b81584619cb177d5d5e14fd7e87a9d8e48fd/src/Utils/Reflection/ReflectionUtil.php#L43-L84 |
6,207 | zerospam/sdk-framework | src/Utils/Reflection/ReflectionUtil.php | ReflectionUtil.transformValue | private static function transformValue($value)
{
if (is_null($value)) {
return $value;
}
if ($value instanceof PrimalValued) {
$value = $value->toPrimitive();
} elseif ($value instanceof Arrayable) {
$value = $value->toArray();
if (emp... | php | private static function transformValue($value)
{
if (is_null($value)) {
return $value;
}
if ($value instanceof PrimalValued) {
$value = $value->toPrimitive();
} elseif ($value instanceof Arrayable) {
$value = $value->toArray();
if (emp... | [
"private",
"static",
"function",
"transformValue",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"value",
")",
")",
"{",
"return",
"$",
"value",
";",
"}",
"if",
"(",
"$",
"value",
"instanceof",
"PrimalValued",
")",
"{",
"$",
"value",
"... | Transform the value.
@param mixed $value
@return array|float|int|null|string | [
"Transform",
"the",
"value",
"."
] | 6780b81584619cb177d5d5e14fd7e87a9d8e48fd | https://github.com/zerospam/sdk-framework/blob/6780b81584619cb177d5d5e14fd7e87a9d8e48fd/src/Utils/Reflection/ReflectionUtil.php#L93-L117 |
6,208 | zerospam/sdk-framework | src/Utils/Reflection/ReflectionUtil.php | ReflectionUtil.getAllProperties | public static function getAllProperties($class, $blacklist = [])
{
$classReflection = new \ReflectionClass($class);
$properties = $classReflection->getProperties();
if ($parentClass = $classReflection->getParentClass()) {
$parentProps = self::getAllProperties($parentClass->getN... | php | public static function getAllProperties($class, $blacklist = [])
{
$classReflection = new \ReflectionClass($class);
$properties = $classReflection->getProperties();
if ($parentClass = $classReflection->getParentClass()) {
$parentProps = self::getAllProperties($parentClass->getN... | [
"public",
"static",
"function",
"getAllProperties",
"(",
"$",
"class",
",",
"$",
"blacklist",
"=",
"[",
"]",
")",
"{",
"$",
"classReflection",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"class",
")",
";",
"$",
"properties",
"=",
"$",
"classReflection",... | Get all the properties not blacklisted.
@param $class
@param array $blacklist
@throws \ReflectionException
@return array|\ReflectionProperty[] | [
"Get",
"all",
"the",
"properties",
"not",
"blacklisted",
"."
] | 6780b81584619cb177d5d5e14fd7e87a9d8e48fd | https://github.com/zerospam/sdk-framework/blob/6780b81584619cb177d5d5e14fd7e87a9d8e48fd/src/Utils/Reflection/ReflectionUtil.php#L129-L151 |
6,209 | zerospam/sdk-framework | src/Utils/Reflection/ReflectionUtil.php | ReflectionUtil.populateResponseData | public static function populateResponseData(IResponse $response, &$dataObject): void
{
foreach (array_keys($response->data()) as $key) {
$method = 'set';
$method .= ucfirst(Str::camel($key));
if (!method_exists($dataObject, $method)) {
continue;
... | php | public static function populateResponseData(IResponse $response, &$dataObject): void
{
foreach (array_keys($response->data()) as $key) {
$method = 'set';
$method .= ucfirst(Str::camel($key));
if (!method_exists($dataObject, $method)) {
continue;
... | [
"public",
"static",
"function",
"populateResponseData",
"(",
"IResponse",
"$",
"response",
",",
"&",
"$",
"dataObject",
")",
":",
"void",
"{",
"foreach",
"(",
"array_keys",
"(",
"$",
"response",
"->",
"data",
"(",
")",
")",
"as",
"$",
"key",
")",
"{",
... | Populate the response data into a dataObject that have the corresponding setters.
@param IResponse $response
@param $dataObject | [
"Populate",
"the",
"response",
"data",
"into",
"a",
"dataObject",
"that",
"have",
"the",
"corresponding",
"setters",
"."
] | 6780b81584619cb177d5d5e14fd7e87a9d8e48fd | https://github.com/zerospam/sdk-framework/blob/6780b81584619cb177d5d5e14fd7e87a9d8e48fd/src/Utils/Reflection/ReflectionUtil.php#L159-L170 |
6,210 | puresolcom/polyether | src/Post/Post.php | Post.registerDefaultPostTypes | private function registerDefaultPostTypes()
{
$this->registerPostType('post', [
'labels' => ['name' => 'Posts', 'singular' => 'Post',],
'hierarchical' => false,
'show_ui' => true,
'icon' => 'fa fa-pencil',
'menu_position' => ... | php | private function registerDefaultPostTypes()
{
$this->registerPostType('post', [
'labels' => ['name' => 'Posts', 'singular' => 'Post',],
'hierarchical' => false,
'show_ui' => true,
'icon' => 'fa fa-pencil',
'menu_position' => ... | [
"private",
"function",
"registerDefaultPostTypes",
"(",
")",
"{",
"$",
"this",
"->",
"registerPostType",
"(",
"'post'",
",",
"[",
"'labels'",
"=>",
"[",
"'name'",
"=>",
"'Posts'",
",",
"'singular'",
"=>",
"'Post'",
",",
"]",
",",
"'hierarchical'",
"=>",
"fal... | Registering initial post types
@return void; | [
"Registering",
"initial",
"post",
"types"
] | 22a7649d0dc99b0418c41f4f708e53e430bdc491 | https://github.com/puresolcom/polyether/blob/22a7649d0dc99b0418c41f4f708e53e430bdc491/src/Post/Post.php#L53-L72 |
6,211 | puresolcom/polyether | src/Post/Post.php | Post.registerPostType | public function registerPostType($post_type, $args = array())
{
if ($this->postTypeObjectExists($post_type)) {
return new EtherError('Post type with the same name already exists');
}
// Args prefixed with an underscore are reserved for internal use.
$defaults = [
... | php | public function registerPostType($post_type, $args = array())
{
if ($this->postTypeObjectExists($post_type)) {
return new EtherError('Post type with the same name already exists');
}
// Args prefixed with an underscore are reserved for internal use.
$defaults = [
... | [
"public",
"function",
"registerPostType",
"(",
"$",
"post_type",
",",
"$",
"args",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"postTypeObjectExists",
"(",
"$",
"post_type",
")",
")",
"{",
"return",
"new",
"EtherError",
"(",
"'Post ty... | Register A Post Type
@param string $post_type
@param array $args
@return void|EtherError | [
"Register",
"A",
"Post",
"Type"
] | 22a7649d0dc99b0418c41f4f708e53e430bdc491 | https://github.com/puresolcom/polyether/blob/22a7649d0dc99b0418c41f4f708e53e430bdc491/src/Post/Post.php#L87-L138 |
6,212 | puresolcom/polyether | src/Post/Post.php | Post.getPostTypeObject | public function getPostTypeObject($post_type)
{
if ( ! isset($this->postTypes[ $post_type ])) {
return false;
}
return $this->postTypes[ $post_type ];
} | php | public function getPostTypeObject($post_type)
{
if ( ! isset($this->postTypes[ $post_type ])) {
return false;
}
return $this->postTypes[ $post_type ];
} | [
"public",
"function",
"getPostTypeObject",
"(",
"$",
"post_type",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"postTypes",
"[",
"$",
"post_type",
"]",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"$",
"this",
"->",
"postTypes",
... | Returns the registered post type object
@param string $post_type
@return false|\stdClass | [
"Returns",
"the",
"registered",
"post",
"type",
"object"
] | 22a7649d0dc99b0418c41f4f708e53e430bdc491 | https://github.com/puresolcom/polyether/blob/22a7649d0dc99b0418c41f4f708e53e430bdc491/src/Post/Post.php#L159-L166 |
6,213 | puresolcom/polyether | src/Post/Post.php | Post.create | public function create($postArr)
{
$userId = null;
if (Auth::check()) {
$userId = Auth::user()->id;
}
$default = [
'post_author' => $userId,
'post_content' => '',
'post_title' => '',
'post_excerpt' => '',
... | php | public function create($postArr)
{
$userId = null;
if (Auth::check()) {
$userId = Auth::user()->id;
}
$default = [
'post_author' => $userId,
'post_content' => '',
'post_title' => '',
'post_excerpt' => '',
... | [
"public",
"function",
"create",
"(",
"$",
"postArr",
")",
"{",
"$",
"userId",
"=",
"null",
";",
"if",
"(",
"Auth",
"::",
"check",
"(",
")",
")",
"{",
"$",
"userId",
"=",
"Auth",
"::",
"user",
"(",
")",
"->",
"id",
";",
"}",
"$",
"default",
"=",... | Inserts a new post and return the post id
@param array $postArr
@return integer|EtherError|null | [
"Inserts",
"a",
"new",
"post",
"and",
"return",
"the",
"post",
"id"
] | 22a7649d0dc99b0418c41f4f708e53e430bdc491 | https://github.com/puresolcom/polyether/blob/22a7649d0dc99b0418c41f4f708e53e430bdc491/src/Post/Post.php#L183-L222 |
6,214 | puresolcom/polyether | src/Post/Post.php | Post.find | public function find($postId, $columns = ['*'])
{
$cache_key = (is_array($columns) && $columns[ 0 ] == '*') ? 'post_' . $postId : 'post_' . md5($postId . http_build_query($columns));
// See if we've the post cached earlier in this request and return it if it's available
if (Cache::tags(['po... | php | public function find($postId, $columns = ['*'])
{
$cache_key = (is_array($columns) && $columns[ 0 ] == '*') ? 'post_' . $postId : 'post_' . md5($postId . http_build_query($columns));
// See if we've the post cached earlier in this request and return it if it's available
if (Cache::tags(['po... | [
"public",
"function",
"find",
"(",
"$",
"postId",
",",
"$",
"columns",
"=",
"[",
"'*'",
"]",
")",
"{",
"$",
"cache_key",
"=",
"(",
"is_array",
"(",
"$",
"columns",
")",
"&&",
"$",
"columns",
"[",
"0",
"]",
"==",
"'*'",
")",
"?",
"'post_'",
".",
... | Find a post object by id
@param integer $postId
@return \Illuminate\Support\Collection||null | [
"Find",
"a",
"post",
"object",
"by",
"id"
] | 22a7649d0dc99b0418c41f4f708e53e430bdc491 | https://github.com/puresolcom/polyether/blob/22a7649d0dc99b0418c41f4f708e53e430bdc491/src/Post/Post.php#L260-L280 |
6,215 | vworldat/SimpleContentBundle | Menu/SimpleContentMenuItem.php | SimpleContentMenuItem.fetchTitle | protected function fetchTitle()
{
try
{
$this->fetchOption('title', true);
}
catch (OptionRequiredException $e)
{
// no title was set manually
if (null !== $this->simpleContentPage)
{
$this->title = $this->simple... | php | protected function fetchTitle()
{
try
{
$this->fetchOption('title', true);
}
catch (OptionRequiredException $e)
{
// no title was set manually
if (null !== $this->simpleContentPage)
{
$this->title = $this->simple... | [
"protected",
"function",
"fetchTitle",
"(",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"fetchOption",
"(",
"'title'",
",",
"true",
")",
";",
"}",
"catch",
"(",
"OptionRequiredException",
"$",
"e",
")",
"{",
"// no title was set manually",
"if",
"(",
"null",
... | Fetch the item's "title" option.
@return MenuItem | [
"Fetch",
"the",
"item",
"s",
"title",
"option",
"."
] | cca691609c9e7850969f27dac524865342042c68 | https://github.com/vworldat/SimpleContentBundle/blob/cca691609c9e7850969f27dac524865342042c68/Menu/SimpleContentMenuItem.php#L80-L100 |
6,216 | fortifi/sdk | api/FortifiApi.php | FortifiApi.enableNesting | public function enableNesting($shortNesting = false)
{
$this->_disableNesting = false;
$this->_shortNesting = $shortNesting;
return $this;
} | php | public function enableNesting($shortNesting = false)
{
$this->_disableNesting = false;
$this->_shortNesting = $shortNesting;
return $this;
} | [
"public",
"function",
"enableNesting",
"(",
"$",
"shortNesting",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"_disableNesting",
"=",
"false",
";",
"$",
"this",
"->",
"_shortNesting",
"=",
"$",
"shortNesting",
";",
"return",
"$",
"this",
";",
"}"
] | Automatically load relationships
@param bool $shortNesting - Return Limited DataNodes (id,fid,displayName)
@return $this | [
"Automatically",
"load",
"relationships"
] | 4d0471c72c7954271c692d32265fd42f698392e4 | https://github.com/fortifi/sdk/blob/4d0471c72c7954271c692d32265fd42f698392e4/api/FortifiApi.php#L206-L211 |
6,217 | gintonicweb/users | src/Model/Table/UsersTable.php | UsersTable.searchConfiguration | public function searchConfiguration()
{
$search = new Manager($this);
$search->like('username', [
'before' => true,
'after' => true,
'field' => [$this->aliasField('username')]
]);
return $search;
} | php | public function searchConfiguration()
{
$search = new Manager($this);
$search->like('username', [
'before' => true,
'after' => true,
'field' => [$this->aliasField('username')]
]);
return $search;
} | [
"public",
"function",
"searchConfiguration",
"(",
")",
"{",
"$",
"search",
"=",
"new",
"Manager",
"(",
"$",
"this",
")",
";",
"$",
"search",
"->",
"like",
"(",
"'username'",
",",
"[",
"'before'",
"=>",
"true",
",",
"'after'",
"=>",
"true",
",",
"'field... | Allows to search users by partial username
@return \Search\Manager | [
"Allows",
"to",
"search",
"users",
"by",
"partial",
"username"
] | 822b5f640969020ff8165d8d376680ef33d1f9ac | https://github.com/gintonicweb/users/blob/822b5f640969020ff8165d8d376680ef33d1f9ac/src/Model/Table/UsersTable.php#L90-L99 |
6,218 | gintonicweb/users | src/Model/Table/UsersTable.php | UsersTable.findAuth | public function findAuth($query, $options)
{
foreach ($options['columns'] as $column) {
$query = $query->orWhere([$column => $options['username']]);
}
return $query;
} | php | public function findAuth($query, $options)
{
foreach ($options['columns'] as $column) {
$query = $query->orWhere([$column => $options['username']]);
}
return $query;
} | [
"public",
"function",
"findAuth",
"(",
"$",
"query",
",",
"$",
"options",
")",
"{",
"foreach",
"(",
"$",
"options",
"[",
"'columns'",
"]",
"as",
"$",
"column",
")",
"{",
"$",
"query",
"=",
"$",
"query",
"->",
"orWhere",
"(",
"[",
"$",
"column",
"=>... | Multi-column authenticate
@param \Cake\ORM\Query $query The query to find with
@param array $options The options to find with
@return \Cake\ORM\Query The query builder | [
"Multi",
"-",
"column",
"authenticate"
] | 822b5f640969020ff8165d8d376680ef33d1f9ac | https://github.com/gintonicweb/users/blob/822b5f640969020ff8165d8d376680ef33d1f9ac/src/Model/Table/UsersTable.php#L108-L114 |
6,219 | gintonicweb/users | src/Model/Table/UsersTable.php | UsersTable.findToken | public function findToken($query, $options)
{
return $this->find()->matching('Tokens', function ($q) use ($options) {
return $q->where(['Tokens.token' => $options['token']]);
});
} | php | public function findToken($query, $options)
{
return $this->find()->matching('Tokens', function ($q) use ($options) {
return $q->where(['Tokens.token' => $options['token']]);
});
} | [
"public",
"function",
"findToken",
"(",
"$",
"query",
",",
"$",
"options",
")",
"{",
"return",
"$",
"this",
"->",
"find",
"(",
")",
"->",
"matching",
"(",
"'Tokens'",
",",
"function",
"(",
"$",
"q",
")",
"use",
"(",
"$",
"options",
")",
"{",
"retur... | Find user based on token
@param \Cake\ORM\Query $query The query to find with
@param array $options The options to find with
@return \Cake\ORM\Query The query builder | [
"Find",
"user",
"based",
"on",
"token"
] | 822b5f640969020ff8165d8d376680ef33d1f9ac | https://github.com/gintonicweb/users/blob/822b5f640969020ff8165d8d376680ef33d1f9ac/src/Model/Table/UsersTable.php#L123-L128 |
6,220 | synapsestudios/synapse-base | src/Synapse/OAuth2/ServerServiceProvider.php | ServerServiceProvider.setFirewalls | protected function setFirewalls(Application $app)
{
$app->extend('security.firewalls', function ($firewalls, $app) {
$logout = new RequestMatcher('^/oauth/logout', null, ['POST']);
$oAuth = new RequestMatcher('^/oauth');
$breedFirewalls = [
'oauth-logout... | php | protected function setFirewalls(Application $app)
{
$app->extend('security.firewalls', function ($firewalls, $app) {
$logout = new RequestMatcher('^/oauth/logout', null, ['POST']);
$oAuth = new RequestMatcher('^/oauth');
$breedFirewalls = [
'oauth-logout... | [
"protected",
"function",
"setFirewalls",
"(",
"Application",
"$",
"app",
")",
"{",
"$",
"app",
"->",
"extend",
"(",
"'security.firewalls'",
",",
"function",
"(",
"$",
"firewalls",
",",
"$",
"app",
")",
"{",
"$",
"logout",
"=",
"new",
"RequestMatcher",
"(",... | Set OAuth related firewalls
@param Application $app | [
"Set",
"OAuth",
"related",
"firewalls"
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/OAuth2/ServerServiceProvider.php#L122-L141 |
6,221 | ojhaujjwal/UserRbac | src/Identity/IdentityRoleProvider.php | IdentityRoleProvider.getIdentityRoles | public function getIdentityRoles(UserInterface $user = null)
{
if ($user === null) {
$user = $this->getDefaultIdentity();
if (!$user) {
return (array) $this->getModuleOptions()->getDefaultGuestRole();
}
}
$resultSet = $this->getUserRoleLin... | php | public function getIdentityRoles(UserInterface $user = null)
{
if ($user === null) {
$user = $this->getDefaultIdentity();
if (!$user) {
return (array) $this->getModuleOptions()->getDefaultGuestRole();
}
}
$resultSet = $this->getUserRoleLin... | [
"public",
"function",
"getIdentityRoles",
"(",
"UserInterface",
"$",
"user",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"user",
"===",
"null",
")",
"{",
"$",
"user",
"=",
"$",
"this",
"->",
"getDefaultIdentity",
"(",
")",
";",
"if",
"(",
"!",
"$",
"user"... | Get the list of roles of a user
@return string[] | [
"Get",
"the",
"list",
"of",
"roles",
"of",
"a",
"user"
] | ebe1cdbcbc9956af5a3a90d9c4c0fc7c8cd4c5fe | https://github.com/ojhaujjwal/UserRbac/blob/ebe1cdbcbc9956af5a3a90d9c4c0fc7c8cd4c5fe/src/Identity/IdentityRoleProvider.php#L104-L126 |
6,222 | emaphp/eMapper | lib/eMapper/ORM/Dynamic/Statement.php | Statement.saveStatement | protected function saveStatement($query, ClassProfile $entity, $asList = true) {
//fetched columns depend on the entity used
//setting a result map avoids getting imcomplete results
$config = array_merge(['map.result' => $this->entity, 'map.type' => $asList ? $this->buildListExpression($entity) : $this->buildExpr... | php | protected function saveStatement($query, ClassProfile $entity, $asList = true) {
//fetched columns depend on the entity used
//setting a result map avoids getting imcomplete results
$config = array_merge(['map.result' => $this->entity, 'map.type' => $asList ? $this->buildListExpression($entity) : $this->buildExpr... | [
"protected",
"function",
"saveStatement",
"(",
"$",
"query",
",",
"ClassProfile",
"$",
"entity",
",",
"$",
"asList",
"=",
"true",
")",
"{",
"//fetched columns depend on the entity used",
"//setting a result map avoids getting imcomplete results",
"$",
"config",
"=",
"arra... | Stores a new Statement instance with the given configuration
@param string $query
@param \eMapper\Reflection\ClassProfile $entity
@param string $asList | [
"Stores",
"a",
"new",
"Statement",
"instance",
"with",
"the",
"given",
"configuration"
] | df7100e601d2a1363d07028a786b6ceb22271829 | https://github.com/emaphp/eMapper/blob/df7100e601d2a1363d07028a786b6ceb22271829/lib/eMapper/ORM/Dynamic/Statement.php#L83-L88 |
6,223 | slickframework/mvc | src/Controller.php | Controller.register | public function register(
ServerRequestInterface $request, ResponseInterface $response
) {
$this->request = $request;
$this->response = $response;
return $this;
} | php | public function register(
ServerRequestInterface $request, ResponseInterface $response
) {
$this->request = $request;
$this->response = $response;
return $this;
} | [
"public",
"function",
"register",
"(",
"ServerRequestInterface",
"$",
"request",
",",
"ResponseInterface",
"$",
"response",
")",
"{",
"$",
"this",
"->",
"request",
"=",
"$",
"request",
";",
"$",
"this",
"->",
"response",
"=",
"$",
"response",
";",
"return",
... | Registers the current HTTP request and response
@param ServerRequestInterface $request
@param ResponseInterface $response
@return Controller|$this|self|ControllerInterface | [
"Registers",
"the",
"current",
"HTTP",
"request",
"and",
"response"
] | 91a6c512f8aaa5a7fb9c1a96f8012d2274dc30ab | https://github.com/slickframework/mvc/blob/91a6c512f8aaa5a7fb9c1a96f8012d2274dc30ab/src/Controller.php#L56-L62 |
6,224 | slickframework/mvc | src/Controller.php | Controller.set | public function set($key, $value = null)
{
if (is_string($key)) {
return $this->registerVar($key, $value);
}
foreach ($key as $name => $value) {
$this->registerVar($name, $value);
}
return $this;
} | php | public function set($key, $value = null)
{
if (is_string($key)) {
return $this->registerVar($key, $value);
}
foreach ($key as $name => $value) {
$this->registerVar($name, $value);
}
return $this;
} | [
"public",
"function",
"set",
"(",
"$",
"key",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"key",
")",
")",
"{",
"return",
"$",
"this",
"->",
"registerVar",
"(",
"$",
"key",
",",
"$",
"value",
")",
";",
"}",
"fore... | Sets a value to be used by render
The key argument can be an associative array with values to be set
or a string naming the passed value. If an array is given then the
value will be ignored.
Those values must be set in the request attributes so they can be used
latter by any other middle ware in the stack.
@param st... | [
"Sets",
"a",
"value",
"to",
"be",
"used",
"by",
"render"
] | 91a6c512f8aaa5a7fb9c1a96f8012d2274dc30ab | https://github.com/slickframework/mvc/blob/91a6c512f8aaa5a7fb9c1a96f8012d2274dc30ab/src/Controller.php#L99-L109 |
6,225 | slickframework/mvc | src/Controller.php | Controller.disableRendering | public function disableRendering($disable = true)
{
$this->request = $this->request->withAttribute('render', !$disable);
return $this;
} | php | public function disableRendering($disable = true)
{
$this->request = $this->request->withAttribute('render', !$disable);
return $this;
} | [
"public",
"function",
"disableRendering",
"(",
"$",
"disable",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"request",
"=",
"$",
"this",
"->",
"request",
"->",
"withAttribute",
"(",
"'render'",
",",
"!",
"$",
"disable",
")",
";",
"return",
"$",
"this",
";... | Enables or disables rendering
@param bool $disable
@return ControllerInterface|self|$this | [
"Enables",
"or",
"disables",
"rendering"
] | 91a6c512f8aaa5a7fb9c1a96f8012d2274dc30ab | https://github.com/slickframework/mvc/blob/91a6c512f8aaa5a7fb9c1a96f8012d2274dc30ab/src/Controller.php#L127-L131 |
6,226 | slickframework/mvc | src/Controller.php | Controller.getRouteAttributes | public function getRouteAttributes($name = null, $default = null)
{
/** @var Route $route */
$route = $this->request->getAttribute('route', false);
$attributes = $route
? $route->attributes
: [];
if (null == $name) {
return $attributes;
... | php | public function getRouteAttributes($name = null, $default = null)
{
/** @var Route $route */
$route = $this->request->getAttribute('route', false);
$attributes = $route
? $route->attributes
: [];
if (null == $name) {
return $attributes;
... | [
"public",
"function",
"getRouteAttributes",
"(",
"$",
"name",
"=",
"null",
",",
"$",
"default",
"=",
"null",
")",
"{",
"/** @var Route $route */",
"$",
"route",
"=",
"$",
"this",
"->",
"request",
"->",
"getAttribute",
"(",
"'route'",
",",
"false",
")",
";"... | Get the routed request attributes
@param null|string $name
@param mixed $default
@return mixed | [
"Get",
"the",
"routed",
"request",
"attributes"
] | 91a6c512f8aaa5a7fb9c1a96f8012d2274dc30ab | https://github.com/slickframework/mvc/blob/91a6c512f8aaa5a7fb9c1a96f8012d2274dc30ab/src/Controller.php#L169-L184 |
6,227 | logikostech/core | src/Application/Bootstrap.php | Bootstrap.getEventsManager | public function getEventsManager() {
if (!is_object(parent::getEventsManager())) {
$em = $this->getUserOption('eventsManager');
if (!is_object($em)) {
$em = new EventsManager();
}
$em->enablePriorities(true);
$this->setEventsManager($em);
}
return parent::getEventsManag... | php | public function getEventsManager() {
if (!is_object(parent::getEventsManager())) {
$em = $this->getUserOption('eventsManager');
if (!is_object($em)) {
$em = new EventsManager();
}
$em->enablePriorities(true);
$this->setEventsManager($em);
}
return parent::getEventsManag... | [
"public",
"function",
"getEventsManager",
"(",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"parent",
"::",
"getEventsManager",
"(",
")",
")",
")",
"{",
"$",
"em",
"=",
"$",
"this",
"->",
"getUserOption",
"(",
"'eventsManager'",
")",
";",
"if",
"(",
"!"... | Returns the internal event manager
@return \Phalcon\Events\ManagerInterface | [
"Returns",
"the",
"internal",
"event",
"manager"
] | b41e298af220219bd663b1b910b24df19bbca516 | https://github.com/logikostech/core/blob/b41e298af220219bd663b1b910b24df19bbca516/src/Application/Bootstrap.php#L284-L294 |
6,228 | sebastianmonzel/webfiles-framework-php | source/core/datastore/types/mail/MImapDatastore.php | MImapDatastore.getNextWebfileForTimestamp | public function getNextWebfileForTimestamp($time)
{
$webfiles = $this->getWebfilesAsStream()->getWebfiles();
ksort($webfiles);
foreach ($webfiles as $key => $value) {
if ($key > $time) {
return $value;
}
}
return null;
... | php | public function getNextWebfileForTimestamp($time)
{
$webfiles = $this->getWebfilesAsStream()->getWebfiles();
ksort($webfiles);
foreach ($webfiles as $key => $value) {
if ($key > $time) {
return $value;
}
}
return null;
... | [
"public",
"function",
"getNextWebfileForTimestamp",
"(",
"$",
"time",
")",
"{",
"$",
"webfiles",
"=",
"$",
"this",
"->",
"getWebfilesAsStream",
"(",
")",
"->",
"getWebfiles",
"(",
")",
";",
"ksort",
"(",
"$",
"webfiles",
")",
";",
"foreach",
"(",
"$",
"w... | According to the given timestamp the next matching webfile will be searched and returned.
@param int $time
@return MWebfile | [
"According",
"to",
"the",
"given",
"timestamp",
"the",
"next",
"matching",
"webfile",
"will",
"be",
"searched",
"and",
"returned",
"."
] | 5ac1fc99e8e9946080e3ba877b2320cd6a3e5b5d | https://github.com/sebastianmonzel/webfiles-framework-php/blob/5ac1fc99e8e9946080e3ba877b2320cd6a3e5b5d/source/core/datastore/types/mail/MImapDatastore.php#L61-L73 |
6,229 | subugoe/typo3-pazpar2 | Classes/ViewHelpers/ResultViewHelper.php | ResultViewHelper.render | public function render()
{
$result = $this->arguments['result'];
$this->conf = $this->arguments['conf'];
$domImplementation = new \DOMImplementation();
$this->doc = $domImplementation->createDocument();
$li = $this->doc->createElement('li');
$this->doc->appendChild(... | php | public function render()
{
$result = $this->arguments['result'];
$this->conf = $this->arguments['conf'];
$domImplementation = new \DOMImplementation();
$this->doc = $domImplementation->createDocument();
$li = $this->doc->createElement('li');
$this->doc->appendChild(... | [
"public",
"function",
"render",
"(",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"arguments",
"[",
"'result'",
"]",
";",
"$",
"this",
"->",
"conf",
"=",
"$",
"this",
"->",
"arguments",
"[",
"'conf'",
"]",
";",
"$",
"domImplementation",
"=",
"new... | Main function called by Fluid.
@return string | [
"Main",
"function",
"called",
"by",
"Fluid",
"."
] | 3da8c483e24228d92dbb9fff034f0ff50ac937ef | https://github.com/subugoe/typo3-pazpar2/blob/3da8c483e24228d92dbb9fff034f0ff50ac937ef/Classes/ViewHelpers/ResultViewHelper.php#L83-L133 |
6,230 | subugoe/typo3-pazpar2 | Classes/ViewHelpers/ResultViewHelper.php | ResultViewHelper.appendInfoToContainer | protected function appendInfoToContainer($info, $container)
{
if ($info && $container) {
if (is_array($info) == false) {
$container->appendChild($info);
} else {
foreach ($info as $infoItem) {
$container->appendChild($infoItem);
... | php | protected function appendInfoToContainer($info, $container)
{
if ($info && $container) {
if (is_array($info) == false) {
$container->appendChild($info);
} else {
foreach ($info as $infoItem) {
$container->appendChild($infoItem);
... | [
"protected",
"function",
"appendInfoToContainer",
"(",
"$",
"info",
",",
"$",
"container",
")",
"{",
"if",
"(",
"$",
"info",
"&&",
"$",
"container",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"info",
")",
"==",
"false",
")",
"{",
"$",
"container",
"-... | Convenince method to append an item to another one, even if undefineds and arrays are involved.
@param $info - the DOM element(s) to insert
@param \DOMElement $container - the DOM element to insert info to | [
"Convenince",
"method",
"to",
"append",
"an",
"item",
"to",
"another",
"one",
"even",
"if",
"undefineds",
"and",
"arrays",
"are",
"involved",
"."
] | 3da8c483e24228d92dbb9fff034f0ff50ac937ef | https://github.com/subugoe/typo3-pazpar2/blob/3da8c483e24228d92dbb9fff034f0ff50ac937ef/Classes/ViewHelpers/ResultViewHelper.php#L140-L151 |
6,231 | subugoe/typo3-pazpar2 | Classes/ViewHelpers/ResultViewHelper.php | ResultViewHelper.appendMarkupForFieldToContainer | protected function appendMarkupForFieldToContainer($fieldName, $result, $container, $prepend = '', $append = '')
{
$span = null;
$fieldContent = $result['md-' . $fieldName][0]['values'][0];
if ($fieldContent && $container) {
$span = $this->doc->createElement('span');
... | php | protected function appendMarkupForFieldToContainer($fieldName, $result, $container, $prepend = '', $append = '')
{
$span = null;
$fieldContent = $result['md-' . $fieldName][0]['values'][0];
if ($fieldContent && $container) {
$span = $this->doc->createElement('span');
... | [
"protected",
"function",
"appendMarkupForFieldToContainer",
"(",
"$",
"fieldName",
",",
"$",
"result",
",",
"$",
"container",
",",
"$",
"prepend",
"=",
"''",
",",
"$",
"append",
"=",
"''",
")",
"{",
"$",
"span",
"=",
"null",
";",
"$",
"fieldContent",
"="... | Creates span DOM element and content for a field name; Appends it to the given container.
@param string $fieldName
@param string $result result array to look the fieldName up in
@param \DOMElement $container
@param string $prepend
@param string $append
@return \DOMElement | [
"Creates",
"span",
"DOM",
"element",
"and",
"content",
"for",
"a",
"field",
"name",
";",
"Appends",
"it",
"to",
"the",
"given",
"container",
"."
] | 3da8c483e24228d92dbb9fff034f0ff50ac937ef | https://github.com/subugoe/typo3-pazpar2/blob/3da8c483e24228d92dbb9fff034f0ff50ac937ef/Classes/ViewHelpers/ResultViewHelper.php#L185-L207 |
6,232 | subugoe/typo3-pazpar2 | Classes/ViewHelpers/ResultViewHelper.php | ResultViewHelper.titleInfo | protected function titleInfo($result)
{
$titleCompleteElement = $this->doc->createElement('span');
$titleCompleteElement->setAttribute('class', 'pz2-title-complete');
$titleMainElement = $this->doc->createElement('span');
$titleCompleteElement->appendChild($titleMainElement);
... | php | protected function titleInfo($result)
{
$titleCompleteElement = $this->doc->createElement('span');
$titleCompleteElement->setAttribute('class', 'pz2-title-complete');
$titleMainElement = $this->doc->createElement('span');
$titleCompleteElement->appendChild($titleMainElement);
... | [
"protected",
"function",
"titleInfo",
"(",
"$",
"result",
")",
"{",
"$",
"titleCompleteElement",
"=",
"$",
"this",
"->",
"doc",
"->",
"createElement",
"(",
"'span'",
")",
";",
"$",
"titleCompleteElement",
"->",
"setAttribute",
"(",
"'class'",
",",
"'pz2-title-... | Returns DOM SPAN element with markup for the current hit's title.
@param array $result
@return \DOMElement | [
"Returns",
"DOM",
"SPAN",
"element",
"with",
"markup",
"for",
"the",
"current",
"hit",
"s",
"title",
"."
] | 3da8c483e24228d92dbb9fff034f0ff50ac937ef | https://github.com/subugoe/typo3-pazpar2/blob/3da8c483e24228d92dbb9fff034f0ff50ac937ef/Classes/ViewHelpers/ResultViewHelper.php#L214-L231 |
6,233 | subugoe/typo3-pazpar2 | Classes/ViewHelpers/ResultViewHelper.php | ResultViewHelper.authorInfo | protected function authorInfo($result)
{
$outputElement = null;
if ($result['md-title-responsibility'][0]['values']) {
$outputText = implode('; ', $result['md-title-responsibility'][0]['values']);
if (!$outputText && $result['md-author']) {
$authors = [];
... | php | protected function authorInfo($result)
{
$outputElement = null;
if ($result['md-title-responsibility'][0]['values']) {
$outputText = implode('; ', $result['md-title-responsibility'][0]['values']);
if (!$outputText && $result['md-author']) {
$authors = [];
... | [
"protected",
"function",
"authorInfo",
"(",
"$",
"result",
")",
"{",
"$",
"outputElement",
"=",
"null",
";",
"if",
"(",
"$",
"result",
"[",
"'md-title-responsibility'",
"]",
"[",
"0",
"]",
"[",
"'values'",
"]",
")",
"{",
"$",
"outputText",
"=",
"implode"... | Returns DOM SPAN element with markup for the current hit's author information.
The pre-formatted title-responsibility field is preferred and a list of author
names is used as a fallback.
@param array $result
@return \DOMElement | [
"Returns",
"DOM",
"SPAN",
"element",
"with",
"markup",
"for",
"the",
"current",
"hit",
"s",
"author",
"information",
".",
"The",
"pre",
"-",
"formatted",
"title",
"-",
"responsibility",
"field",
"is",
"preferred",
"and",
"a",
"list",
"of",
"author",
"names",... | 3da8c483e24228d92dbb9fff034f0ff50ac937ef | https://github.com/subugoe/typo3-pazpar2/blob/3da8c483e24228d92dbb9fff034f0ff50ac937ef/Classes/ViewHelpers/ResultViewHelper.php#L240-L269 |
6,234 | subugoe/typo3-pazpar2 | Classes/ViewHelpers/ResultViewHelper.php | ResultViewHelper.markupInfoItems | protected function markupInfoItems($infoItems)
{
$result = null;
if (count($infoItems) == 1) {
$result = $infoItems[0];
} else {
$result = $this->doc->createElement('ul');
foreach ($infoItems as $item) {
$li = $this->doc->createElement('li... | php | protected function markupInfoItems($infoItems)
{
$result = null;
if (count($infoItems) == 1) {
$result = $infoItems[0];
} else {
$result = $this->doc->createElement('ul');
foreach ($infoItems as $item) {
$li = $this->doc->createElement('li... | [
"protected",
"function",
"markupInfoItems",
"(",
"$",
"infoItems",
")",
"{",
"$",
"result",
"=",
"null",
";",
"if",
"(",
"count",
"(",
"$",
"infoItems",
")",
"==",
"1",
")",
"{",
"$",
"result",
"=",
"$",
"infoItems",
"[",
"0",
"]",
";",
"}",
"else"... | Returns marked up version of the DOM items passed, putting them into a list if necessary.
@param array $elements (DOM Elements)
@return array | [
"Returns",
"marked",
"up",
"version",
"of",
"the",
"DOM",
"items",
"passed",
"putting",
"them",
"into",
"a",
"list",
"if",
"necessary",
"."
] | 3da8c483e24228d92dbb9fff034f0ff50ac937ef | https://github.com/subugoe/typo3-pazpar2/blob/3da8c483e24228d92dbb9fff034f0ff50ac937ef/Classes/ViewHelpers/ResultViewHelper.php#L549-L565 |
6,235 | subugoe/typo3-pazpar2 | Classes/ViewHelpers/ResultViewHelper.php | ResultViewHelper.locationDetails | protected function locationDetails($result)
{
$locationDetails = [];
foreach ($result['location'] as $locationAll) {
$location = $locationAll['ch'];
$detailsData = $this->doc->createElement('dd');
if ($location['md-medium'][0]['values'][0] != 'article') {
... | php | protected function locationDetails($result)
{
$locationDetails = [];
foreach ($result['location'] as $locationAll) {
$location = $locationAll['ch'];
$detailsData = $this->doc->createElement('dd');
if ($location['md-medium'][0]['values'][0] != 'article') {
... | [
"protected",
"function",
"locationDetails",
"(",
"$",
"result",
")",
"{",
"$",
"locationDetails",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"result",
"[",
"'location'",
"]",
"as",
"$",
"locationAll",
")",
"{",
"$",
"location",
"=",
"$",
"locationAll",
"["... | Returns markup for each location of the item found from the current data.
@param array $result
@return array of DOM elements | [
"Returns",
"markup",
"for",
"each",
"location",
"of",
"the",
"item",
"found",
"from",
"the",
"current",
"data",
"."
] | 3da8c483e24228d92dbb9fff034f0ff50ac937ef | https://github.com/subugoe/typo3-pazpar2/blob/3da8c483e24228d92dbb9fff034f0ff50ac937ef/Classes/ViewHelpers/ResultViewHelper.php#L572-L603 |
6,236 | subugoe/typo3-pazpar2 | Classes/ViewHelpers/ResultViewHelper.php | ResultViewHelper.cleanURLList | protected function cleanURLList($location, $result)
{
$URLs = $location['md-electronic-url'];
if ($URLs) {
// Figure out which URLs are duplicates and collect indexes of those to remove.
$indexesToRemove = [];
foreach ($URLs as $URLIndex => &$URLInfo) {
... | php | protected function cleanURLList($location, $result)
{
$URLs = $location['md-electronic-url'];
if ($URLs) {
// Figure out which URLs are duplicates and collect indexes of those to remove.
$indexesToRemove = [];
foreach ($URLs as $URLIndex => &$URLInfo) {
... | [
"protected",
"function",
"cleanURLList",
"(",
"$",
"location",
",",
"$",
"result",
")",
"{",
"$",
"URLs",
"=",
"$",
"location",
"[",
"'md-electronic-url'",
"]",
";",
"if",
"(",
"$",
"URLs",
")",
"{",
"// Figure out which URLs are duplicates and collect indexes of ... | Returns a cleaned and sorted list of the URLs in the md-electronic-url fields.
@param array $location
@param array $result the result containing $location
@return array subarray of $location without duplicates and sorted | [
"Returns",
"a",
"cleaned",
"and",
"sorted",
"list",
"of",
"the",
"URLs",
"in",
"the",
"md",
"-",
"electronic",
"-",
"url",
"fields",
"."
] | 3da8c483e24228d92dbb9fff034f0ff50ac937ef | https://github.com/subugoe/typo3-pazpar2/blob/3da8c483e24228d92dbb9fff034f0ff50ac937ef/Classes/ViewHelpers/ResultViewHelper.php#L693-L742 |
6,237 | subugoe/typo3-pazpar2 | Classes/ViewHelpers/ResultViewHelper.php | ResultViewHelper.electronicURLs | protected function electronicURLs($location, $result)
{
$electronicURLs = $this->cleanURLList($location, $result);
$URLsContainer = null;
if ($electronicURLs && count($electronicURLs) != 0) {
$URLsContainer = $this->doc->createElement('span');
foreach ($electronicUR... | php | protected function electronicURLs($location, $result)
{
$electronicURLs = $this->cleanURLList($location, $result);
$URLsContainer = null;
if ($electronicURLs && count($electronicURLs) != 0) {
$URLsContainer = $this->doc->createElement('span');
foreach ($electronicUR... | [
"protected",
"function",
"electronicURLs",
"(",
"$",
"location",
",",
"$",
"result",
")",
"{",
"$",
"electronicURLs",
"=",
"$",
"this",
"->",
"cleanURLList",
"(",
"$",
"location",
",",
"$",
"result",
")",
";",
"$",
"URLsContainer",
"=",
"null",
";",
"if"... | Create markup for URLs in current location data.
@param array $location
@param array $result the result containing $location
@return \DOMElement | [
"Create",
"markup",
"for",
"URLs",
"in",
"current",
"location",
"data",
"."
] | 3da8c483e24228d92dbb9fff034f0ff50ac937ef | https://github.com/subugoe/typo3-pazpar2/blob/3da8c483e24228d92dbb9fff034f0ff50ac937ef/Classes/ViewHelpers/ResultViewHelper.php#L750-L800 |
6,238 | subugoe/typo3-pazpar2 | Classes/ViewHelpers/ResultViewHelper.php | ResultViewHelper.catalogueLink | protected function catalogueLink($locationAll)
{
$linkElement = null;
$URL = $locationAll['ch']['md-catalogue-url'][0]['values'][0];
$targetName = $locationAll['attrs']['name'];
if ($URL && $targetName) {
$linkElement = $this->doc->createElement('a');
$linkEl... | php | protected function catalogueLink($locationAll)
{
$linkElement = null;
$URL = $locationAll['ch']['md-catalogue-url'][0]['values'][0];
$targetName = $locationAll['attrs']['name'];
if ($URL && $targetName) {
$linkElement = $this->doc->createElement('a');
$linkEl... | [
"protected",
"function",
"catalogueLink",
"(",
"$",
"locationAll",
")",
"{",
"$",
"linkElement",
"=",
"null",
";",
"$",
"URL",
"=",
"$",
"locationAll",
"[",
"'ch'",
"]",
"[",
"'md-catalogue-url'",
"]",
"[",
"0",
"]",
"[",
"'values'",
"]",
"[",
"0",
"]"... | Returns a link for the current record that points to the catalogue page for that item.
@param array $locationAll
@return \DOMElement | [
"Returns",
"a",
"link",
"for",
"the",
"current",
"record",
"that",
"points",
"to",
"the",
"catalogue",
"page",
"for",
"that",
"item",
"."
] | 3da8c483e24228d92dbb9fff034f0ff50ac937ef | https://github.com/subugoe/typo3-pazpar2/blob/3da8c483e24228d92dbb9fff034f0ff50ac937ef/Classes/ViewHelpers/ResultViewHelper.php#L835-L859 |
6,239 | subugoe/typo3-pazpar2 | Classes/ViewHelpers/ResultViewHelper.php | ResultViewHelper.exportLinks | protected function exportLinks($result)
{
$extraLinkList = $this->doc->createElement('ul');
$labelFormat = LocalizationUtility::translate('download-label-format-simple', 'Pazpar2');
if (count($result['location']) > 1) {
$labelFormat = LocalizationUtility::translate('download-labe... | php | protected function exportLinks($result)
{
$extraLinkList = $this->doc->createElement('ul');
$labelFormat = LocalizationUtility::translate('download-label-format-simple', 'Pazpar2');
if (count($result['location']) > 1) {
$labelFormat = LocalizationUtility::translate('download-labe... | [
"protected",
"function",
"exportLinks",
"(",
"$",
"result",
")",
"{",
"$",
"extraLinkList",
"=",
"$",
"this",
"->",
"doc",
"->",
"createElement",
"(",
"'ul'",
")",
";",
"$",
"labelFormat",
"=",
"LocalizationUtility",
"::",
"translate",
"(",
"'download-label-fo... | Returns markup for links to each active export format.
@param array $result
@return \DOMElement | [
"Returns",
"markup",
"for",
"links",
"to",
"each",
"active",
"export",
"format",
"."
] | 3da8c483e24228d92dbb9fff034f0ff50ac937ef | https://github.com/subugoe/typo3-pazpar2/blob/3da8c483e24228d92dbb9fff034f0ff50ac937ef/Classes/ViewHelpers/ResultViewHelper.php#L999-L1025 |
6,240 | subugoe/typo3-pazpar2 | Classes/ViewHelpers/ResultViewHelper.php | ResultViewHelper.appendExportItemsTo | protected function appendExportItemsTo($locations, $labelFormat, $container)
{
foreach ($this->conf['exportFormats'] as $name => $active) {
if ($active) {
$container->appendChild($this->exportItem($locations, $name, $labelFormat));
}
}
} | php | protected function appendExportItemsTo($locations, $labelFormat, $container)
{
foreach ($this->conf['exportFormats'] as $name => $active) {
if ($active) {
$container->appendChild($this->exportItem($locations, $name, $labelFormat));
}
}
} | [
"protected",
"function",
"appendExportItemsTo",
"(",
"$",
"locations",
",",
"$",
"labelFormat",
",",
"$",
"container",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"conf",
"[",
"'exportFormats'",
"]",
"as",
"$",
"name",
"=>",
"$",
"active",
")",
"{",
"if... | Appends list items with an export form for each exportFormat to the container.
@param array $locations
@param string $labelFormat
@param \DOMElement $container | [
"Appends",
"list",
"items",
"with",
"an",
"export",
"form",
"for",
"each",
"exportFormat",
"to",
"the",
"container",
"."
] | 3da8c483e24228d92dbb9fff034f0ff50ac937ef | https://github.com/subugoe/typo3-pazpar2/blob/3da8c483e24228d92dbb9fff034f0ff50ac937ef/Classes/ViewHelpers/ResultViewHelper.php#L1034-L1041 |
6,241 | subugoe/typo3-pazpar2 | Classes/ViewHelpers/ResultViewHelper.php | ResultViewHelper.exportItem | protected function exportItem($locations, $exportFormat, $labelFormat)
{
$form = $this->dataConversionForm($locations, $exportFormat, $labelFormat);
$item = null;
if ($form) {
$item = $this->doc->createElement('li');
$item->appendChild($form);
}
retur... | php | protected function exportItem($locations, $exportFormat, $labelFormat)
{
$form = $this->dataConversionForm($locations, $exportFormat, $labelFormat);
$item = null;
if ($form) {
$item = $this->doc->createElement('li');
$item->appendChild($form);
}
retur... | [
"protected",
"function",
"exportItem",
"(",
"$",
"locations",
",",
"$",
"exportFormat",
",",
"$",
"labelFormat",
")",
"{",
"$",
"form",
"=",
"$",
"this",
"->",
"dataConversionForm",
"(",
"$",
"locations",
",",
"$",
"exportFormat",
",",
"$",
"labelFormat",
... | Returns a list item containing the form for export data conversion.
The parameters are passed to dataConversionForm.
@param array $locations
@param string $exportFormat
@param string $labelFormat
@return \DOMElement | [
"Returns",
"a",
"list",
"item",
"containing",
"the",
"form",
"for",
"export",
"data",
"conversion",
".",
"The",
"parameters",
"are",
"passed",
"to",
"dataConversionForm",
"."
] | 3da8c483e24228d92dbb9fff034f0ff50ac937ef | https://github.com/subugoe/typo3-pazpar2/blob/3da8c483e24228d92dbb9fff034f0ff50ac937ef/Classes/ViewHelpers/ResultViewHelper.php#L1052-L1062 |
6,242 | subugoe/typo3-pazpar2 | Classes/ViewHelpers/ResultViewHelper.php | ResultViewHelper.dataConversionForm | protected function dataConversionForm($locations, $exportFormat, $labelFormat)
{
$recordXML = $this->XMLForLocations($locations);
$XMLString = $recordXML->saveXML();
$form = null;
if ($XMLString) {
$form = $this->doc->createElement('form');
$form->setAttribut... | php | protected function dataConversionForm($locations, $exportFormat, $labelFormat)
{
$recordXML = $this->XMLForLocations($locations);
$XMLString = $recordXML->saveXML();
$form = null;
if ($XMLString) {
$form = $this->doc->createElement('form');
$form->setAttribut... | [
"protected",
"function",
"dataConversionForm",
"(",
"$",
"locations",
",",
"$",
"exportFormat",
",",
"$",
"labelFormat",
")",
"{",
"$",
"recordXML",
"=",
"$",
"this",
"->",
"XMLForLocations",
"(",
"$",
"locations",
")",
";",
"$",
"XMLString",
"=",
"$",
"re... | Returns form Element containing the record information to initiate data conversion.
@param array $locations
@param string $exportFormat
@param string $labelFormat
@return \DOMElement | [
"Returns",
"form",
"Element",
"containing",
"the",
"record",
"information",
"to",
"initiate",
"data",
"conversion",
"."
] | 3da8c483e24228d92dbb9fff034f0ff50ac937ef | https://github.com/subugoe/typo3-pazpar2/blob/3da8c483e24228d92dbb9fff034f0ff50ac937ef/Classes/ViewHelpers/ResultViewHelper.php#L1071-L1108 |
6,243 | subugoe/typo3-pazpar2 | Classes/ViewHelpers/ResultViewHelper.php | ResultViewHelper.XMLForLocations | protected function XMLForLocations($locations)
{
$XML = new \DOMDocument();
$locationsElement = $XML->createElement('locations');
$XML->appendChild($locationsElement);
foreach ($locations as $location) {
$locationElement = $XML->createElement('location');
$lo... | php | protected function XMLForLocations($locations)
{
$XML = new \DOMDocument();
$locationsElement = $XML->createElement('locations');
$XML->appendChild($locationsElement);
foreach ($locations as $location) {
$locationElement = $XML->createElement('location');
$lo... | [
"protected",
"function",
"XMLForLocations",
"(",
"$",
"locations",
")",
"{",
"$",
"XML",
"=",
"new",
"\\",
"DOMDocument",
"(",
")",
";",
"$",
"locationsElement",
"=",
"$",
"XML",
"->",
"createElement",
"(",
"'locations'",
")",
";",
"$",
"XML",
"->",
"app... | Returns XML representing the passed locations.
@param array $locations
@return \DOMDocument | [
"Returns",
"XML",
"representing",
"the",
"passed",
"locations",
"."
] | 3da8c483e24228d92dbb9fff034f0ff50ac937ef | https://github.com/subugoe/typo3-pazpar2/blob/3da8c483e24228d92dbb9fff034f0ff50ac937ef/Classes/ViewHelpers/ResultViewHelper.php#L1115-L1152 |
6,244 | slickframework/configuration | src/Driver/Environment.php | Environment.transformKey | private function transformKey($key)
{
$regEx = '/(?#! splitCamelCase Rev:20140412)
# Split camelCase "words". Two global alternatives. Either g1of2:
(?<=[a-z]) # Position is after a lowercase,
(?=[A-Z]) # and before an uppercase letter.
| (?<=[A... | php | private function transformKey($key)
{
$regEx = '/(?#! splitCamelCase Rev:20140412)
# Split camelCase "words". Two global alternatives. Either g1of2:
(?<=[a-z]) # Position is after a lowercase,
(?=[A-Z]) # and before an uppercase letter.
| (?<=[A... | [
"private",
"function",
"transformKey",
"(",
"$",
"key",
")",
"{",
"$",
"regEx",
"=",
"'/(?#! splitCamelCase Rev:20140412)\n # Split camelCase \"words\". Two global alternatives. Either g1of2:\n (?<=[a-z]) # Position is after a lowercase,\n (?=[A-Z]) ... | Transforms the provided key to a environment variable name
@param string $key
@return string | [
"Transforms",
"the",
"provided",
"key",
"to",
"a",
"environment",
"variable",
"name"
] | 9aa1edbddd007b4af4032a2b383c39f4db47d87e | https://github.com/slickframework/configuration/blob/9aa1edbddd007b4af4032a2b383c39f4db47d87e/src/Driver/Environment.php#L50-L66 |
6,245 | xloit/xloit-bridge-zend-validator | src/File/FileTrait.php | FileTrait.isFileEmpty | protected function isFileEmpty($value, $file = null)
{
$source = null;
$filename = null;
if (is_string($value) && is_array($file)) {
// Legacy Zend\Transfer API support
$filename = $file['name'];
$source = $file['tmp_name'];
} elseif (is_array... | php | protected function isFileEmpty($value, $file = null)
{
$source = null;
$filename = null;
if (is_string($value) && is_array($file)) {
// Legacy Zend\Transfer API support
$filename = $file['name'];
$source = $file['tmp_name'];
} elseif (is_array... | [
"protected",
"function",
"isFileEmpty",
"(",
"$",
"value",
",",
"$",
"file",
"=",
"null",
")",
"{",
"$",
"source",
"=",
"null",
";",
"$",
"filename",
"=",
"null",
";",
"if",
"(",
"is_string",
"(",
"$",
"value",
")",
"&&",
"is_array",
"(",
"$",
"fil... | Indicates whether the file is defined.
@param string|array $value Real file to check.
@param array $file File data from {@link \Zend\File\Transfer\Transfer} (optional).
@return bool | [
"Indicates",
"whether",
"the",
"file",
"is",
"defined",
"."
] | 2e789986e6551f157d4e07cf4c27d027dd070324 | https://github.com/xloit/xloit-bridge-zend-validator/blob/2e789986e6551f157d4e07cf4c27d027dd070324/src/File/FileTrait.php#L66-L92 |
6,246 | bytepark/lib-migration | src/Repository/Database.php | Database.replace | public function replace(UnitOfWork $replacement)
{
parent::replace($replacement);
$this->connection->execute(
sprintf("DELETE FROM %s WHERE unique_id = ?", $this->tableName),
array (
$replacement->getUniqueId(),
)
);
unset($this->p... | php | public function replace(UnitOfWork $replacement)
{
parent::replace($replacement);
$this->connection->execute(
sprintf("DELETE FROM %s WHERE unique_id = ?", $this->tableName),
array (
$replacement->getUniqueId(),
)
);
unset($this->p... | [
"public",
"function",
"replace",
"(",
"UnitOfWork",
"$",
"replacement",
")",
"{",
"parent",
"::",
"replace",
"(",
"$",
"replacement",
")",
";",
"$",
"this",
"->",
"connection",
"->",
"execute",
"(",
"sprintf",
"(",
"\"DELETE FROM %s WHERE unique_id = ?\"",
",",
... | Next to replacing the unit internally, the entry has to be also removed
in the database
@param UnitOfWork $replacement
@throws \Bytepark\Component\Migration\Exception\UnitNotPresentException
@return void | [
"Next",
"to",
"replacing",
"the",
"unit",
"internally",
"the",
"entry",
"has",
"to",
"be",
"also",
"removed",
"in",
"the",
"database"
] | 14d75f6978e257f456493c673175ca5d07b28c84 | https://github.com/bytepark/lib-migration/blob/14d75f6978e257f456493c673175ca5d07b28c84/src/Repository/Database.php#L106-L117 |
6,247 | bytepark/lib-migration | src/Repository/Database.php | Database.buildMigrations | private function buildMigrations()
{
$unitDataArray = $this->loadUnitDataIteratorFromDatabase();
foreach ($unitDataArray as $unitData) {
$unitOfWork = UnitOfWorkFactory::BuildFromFlatArray($unitData);
$this->presentUidsOnConstruction[$unitOfWork->getUniqueId()] = true;
... | php | private function buildMigrations()
{
$unitDataArray = $this->loadUnitDataIteratorFromDatabase();
foreach ($unitDataArray as $unitData) {
$unitOfWork = UnitOfWorkFactory::BuildFromFlatArray($unitData);
$this->presentUidsOnConstruction[$unitOfWork->getUniqueId()] = true;
... | [
"private",
"function",
"buildMigrations",
"(",
")",
"{",
"$",
"unitDataArray",
"=",
"$",
"this",
"->",
"loadUnitDataIteratorFromDatabase",
"(",
")",
";",
"foreach",
"(",
"$",
"unitDataArray",
"as",
"$",
"unitData",
")",
"{",
"$",
"unitOfWork",
"=",
"UnitOfWork... | Builds the migrations from the database
@return void | [
"Builds",
"the",
"migrations",
"from",
"the",
"database"
] | 14d75f6978e257f456493c673175ca5d07b28c84 | https://github.com/bytepark/lib-migration/blob/14d75f6978e257f456493c673175ca5d07b28c84/src/Repository/Database.php#L140-L148 |
6,248 | bytepark/lib-migration | src/Repository/Database.php | Database.loadUnitDataIteratorFromDatabase | private function loadUnitDataIteratorFromDatabase()
{
$result = $this->connection->query(
sprintf("SELECT * FROM %s ORDER BY unique_id ASC", $this->tableName)
);
return new \ArrayIterator($result);
} | php | private function loadUnitDataIteratorFromDatabase()
{
$result = $this->connection->query(
sprintf("SELECT * FROM %s ORDER BY unique_id ASC", $this->tableName)
);
return new \ArrayIterator($result);
} | [
"private",
"function",
"loadUnitDataIteratorFromDatabase",
"(",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"connection",
"->",
"query",
"(",
"sprintf",
"(",
"\"SELECT * FROM %s ORDER BY unique_id ASC\"",
",",
"$",
"this",
"->",
"tableName",
")",
")",
";",
... | Loads the UnitsOfWork from the database as Iterator
@return \ArrayIterator | [
"Loads",
"the",
"UnitsOfWork",
"from",
"the",
"database",
"as",
"Iterator"
] | 14d75f6978e257f456493c673175ca5d07b28c84 | https://github.com/bytepark/lib-migration/blob/14d75f6978e257f456493c673175ca5d07b28c84/src/Repository/Database.php#L155-L162 |
6,249 | marando/phpSOFA | src/Marando/IAU/iauSp00.php | iauSp00.Sp00 | public static function Sp00($date1, $date2) {
$t;
$sp;
/* Interval between fundamental epoch J2000.0 and current date (JC). */
$t = (($date1 - DJ00) + $date2) / DJC;
/* Approximate s'. */
$sp = -47e-6 * $t * DAS2R;
return $sp;
} | php | public static function Sp00($date1, $date2) {
$t;
$sp;
/* Interval between fundamental epoch J2000.0 and current date (JC). */
$t = (($date1 - DJ00) + $date2) / DJC;
/* Approximate s'. */
$sp = -47e-6 * $t * DAS2R;
return $sp;
} | [
"public",
"static",
"function",
"Sp00",
"(",
"$",
"date1",
",",
"$",
"date2",
")",
"{",
"$",
"t",
";",
"$",
"sp",
";",
"/* Interval between fundamental epoch J2000.0 and current date (JC). */",
"$",
"t",
"=",
"(",
"(",
"$",
"date1",
"-",
"DJ00",
")",
"+",
... | - - - - - - - -
i a u S p 0 0
- - - - - - - -
The TIO locator s', positioning the Terrestrial Intermediate Origin
on the equator of the Celestial Intermediate Pole.
This function is part of the International Astronomical Union's
SOFA (Standards Of Fundamental Astronomy) software collection.
Status: canonical model.... | [
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"i",
"a",
"u",
"S",
"p",
"0",
"0",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-"
] | 757fa49fe335ae1210eaa7735473fd4388b13f07 | https://github.com/marando/phpSOFA/blob/757fa49fe335ae1210eaa7735473fd4388b13f07/src/Marando/IAU/iauSp00.php#L64-L75 |
6,250 | unimatrix/cake | src/Lib/Lexicon.php | Lexicon.match | public static function match($keyword, $text = '', &$matches = false) {
return (bool)preg_match(sprintf(self::$re, self::regex($keyword)), $text, $matches, PREG_OFFSET_CAPTURE);
} | php | public static function match($keyword, $text = '', &$matches = false) {
return (bool)preg_match(sprintf(self::$re, self::regex($keyword)), $text, $matches, PREG_OFFSET_CAPTURE);
} | [
"public",
"static",
"function",
"match",
"(",
"$",
"keyword",
",",
"$",
"text",
"=",
"''",
",",
"&",
"$",
"matches",
"=",
"false",
")",
"{",
"return",
"(",
"bool",
")",
"preg_match",
"(",
"sprintf",
"(",
"self",
"::",
"$",
"re",
",",
"self",
"::",
... | Match romanian regex
@param string $keyword
@param string $text
@param array matches
@return bool | [
"Match",
"romanian",
"regex"
] | 23003aba497822bd473fdbf60514052dda1874fc | https://github.com/unimatrix/cake/blob/23003aba497822bd473fdbf60514052dda1874fc/src/Lib/Lexicon.php#L25-L27 |
6,251 | unimatrix/cake | src/Lib/Lexicon.php | Lexicon.cuttext | public static function cuttext($value, $length = 200, $ellipsis = '...') {
if(!is_array($value)) {
$string = $value;
$match_to = $value{0};
} else list($string, $match_to) = $value;
self::match($match_to, $string, $matches);
$match_start = isset($matches[0]) && i... | php | public static function cuttext($value, $length = 200, $ellipsis = '...') {
if(!is_array($value)) {
$string = $value;
$match_to = $value{0};
} else list($string, $match_to) = $value;
self::match($match_to, $string, $matches);
$match_start = isset($matches[0]) && i... | [
"public",
"static",
"function",
"cuttext",
"(",
"$",
"value",
",",
"$",
"length",
"=",
"200",
",",
"$",
"ellipsis",
"=",
"'...'",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"$",
"string",
"=",
"$",
"value",
";",
"$",
... | Cut text left middle right
@param string or array $value
@param integer $length
@param string $ellipsis | [
"Cut",
"text",
"left",
"middle",
"right"
] | 23003aba497822bd473fdbf60514052dda1874fc | https://github.com/unimatrix/cake/blob/23003aba497822bd473fdbf60514052dda1874fc/src/Lib/Lexicon.php#L66-L100 |
6,252 | kiler129/CherryHttp | src/_legacyCode/Server.php | Server.bind | public function bind($ip = '0.0.0.0', $port = 8080, $ssl = false)
{
$this->addNode(new HttpListenerNode($this, $ip, $port, $ssl, $this->logger));
} | php | public function bind($ip = '0.0.0.0', $port = 8080, $ssl = false)
{
$this->addNode(new HttpListenerNode($this, $ip, $port, $ssl, $this->logger));
} | [
"public",
"function",
"bind",
"(",
"$",
"ip",
"=",
"'0.0.0.0'",
",",
"$",
"port",
"=",
"8080",
",",
"$",
"ssl",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"addNode",
"(",
"new",
"HttpListenerNode",
"(",
"$",
"this",
",",
"$",
"ip",
",",
"$",
"por... | Creates listener using default HttpListenerNode class
@param string $ip
@param int $port
@param bool $ssl
@throws ServerException
@see ListenerNode | [
"Creates",
"listener",
"using",
"default",
"HttpListenerNode",
"class"
] | 05927f26183cbd6fd5ccb0853befecdea279308d | https://github.com/kiler129/CherryHttp/blob/05927f26183cbd6fd5ccb0853befecdea279308d/src/_legacyCode/Server.php#L58-L61 |
6,253 | kiler129/CherryHttp | src/_legacyCode/Server.php | Server.upgradeClient | private function upgradeClient(ClientUpgradeException $upgrade)
{
$oldClient = $upgrade->getOldClient();
if (!isset($oldClient->socket, $this->nodes[(int)$oldClient->socket])) {
$this->logger->emergency("Client $oldClient not found during upgrade");
throw new ServerException... | php | private function upgradeClient(ClientUpgradeException $upgrade)
{
$oldClient = $upgrade->getOldClient();
if (!isset($oldClient->socket, $this->nodes[(int)$oldClient->socket])) {
$this->logger->emergency("Client $oldClient not found during upgrade");
throw new ServerException... | [
"private",
"function",
"upgradeClient",
"(",
"ClientUpgradeException",
"$",
"upgrade",
")",
"{",
"$",
"oldClient",
"=",
"$",
"upgrade",
"->",
"getOldClient",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"oldClient",
"->",
"socket",
",",
"$",
"this",
... | Upgrades client protocol.
It's done by replacing whole client class in nodes table.
@param ClientUpgradeException $upgrade
@throws ServerException Old client cannot be found on server (it's serious error) | [
"Upgrades",
"client",
"protocol",
".",
"It",
"s",
"done",
"by",
"replacing",
"whole",
"client",
"class",
"in",
"nodes",
"table",
"."
] | 05927f26183cbd6fd5ccb0853befecdea279308d | https://github.com/kiler129/CherryHttp/blob/05927f26183cbd6fd5ccb0853befecdea279308d/src/_legacyCode/Server.php#L344-L354 |
6,254 | digit-soft/re-action-clients-pool | src/PoolClientTrait.php | PoolClientTrait.getClientId | public function getClientId()
{
if (!isset($this->_poolClientId)) {
while (!isset($id) || !$this->isPoolClientIdUnique($id)) {
$id = static::generatePoolClientId();
}
$this->_poolClientId = $id;
}
return $this->_poolClientId;
} | php | public function getClientId()
{
if (!isset($this->_poolClientId)) {
while (!isset($id) || !$this->isPoolClientIdUnique($id)) {
$id = static::generatePoolClientId();
}
$this->_poolClientId = $id;
}
return $this->_poolClientId;
} | [
"public",
"function",
"getClientId",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_poolClientId",
")",
")",
"{",
"while",
"(",
"!",
"isset",
"(",
"$",
"id",
")",
"||",
"!",
"$",
"this",
"->",
"isPoolClientIdUnique",
"(",
"$",
"i... | Get client unique ID
@return string | [
"Get",
"client",
"unique",
"ID"
] | f1ac06550320ab0456df16b3e1e3f49da1aa4b98 | https://github.com/digit-soft/re-action-clients-pool/blob/f1ac06550320ab0456df16b3e1e3f49da1aa4b98/src/PoolClientTrait.php#L33-L42 |
6,255 | digit-soft/re-action-clients-pool | src/PoolClientTrait.php | PoolClientTrait.changeState | protected function changeState($state)
{
$currState = $this->_poolClientState;
//Save previous state
if (isset($currState) && $currState !== PoolClientInterface::CLIENT_POOL_STATE_LOCKED) {
$this->_poolClientStatePrev = $currState;
}
$this->_poolClientState = $sta... | php | protected function changeState($state)
{
$currState = $this->_poolClientState;
//Save previous state
if (isset($currState) && $currState !== PoolClientInterface::CLIENT_POOL_STATE_LOCKED) {
$this->_poolClientStatePrev = $currState;
}
$this->_poolClientState = $sta... | [
"protected",
"function",
"changeState",
"(",
"$",
"state",
")",
"{",
"$",
"currState",
"=",
"$",
"this",
"->",
"_poolClientState",
";",
"//Save previous state",
"if",
"(",
"isset",
"(",
"$",
"currState",
")",
"&&",
"$",
"currState",
"!==",
"PoolClientInterface... | Change client state helper
@param int $state | [
"Change",
"client",
"state",
"helper"
] | f1ac06550320ab0456df16b3e1e3f49da1aa4b98 | https://github.com/digit-soft/re-action-clients-pool/blob/f1ac06550320ab0456df16b3e1e3f49da1aa4b98/src/PoolClientTrait.php#L90-L99 |
6,256 | digit-soft/re-action-clients-pool | src/PoolClientTrait.php | PoolClientTrait.changeQueueCount | protected function changeQueueCount($queueCounter)
{
if ($queueCounter < 0) {
$queueCounter = 0;
}
$this->_poolClientQueueCounter = $queueCounter;
//Automatically change client state to `ClientInterface::CLIENT_POOL_STATE_READY` on empty queue
if ($this->_poolClie... | php | protected function changeQueueCount($queueCounter)
{
if ($queueCounter < 0) {
$queueCounter = 0;
}
$this->_poolClientQueueCounter = $queueCounter;
//Automatically change client state to `ClientInterface::CLIENT_POOL_STATE_READY` on empty queue
if ($this->_poolClie... | [
"protected",
"function",
"changeQueueCount",
"(",
"$",
"queueCounter",
")",
"{",
"if",
"(",
"$",
"queueCounter",
"<",
"0",
")",
"{",
"$",
"queueCounter",
"=",
"0",
";",
"}",
"$",
"this",
"->",
"_poolClientQueueCounter",
"=",
"$",
"queueCounter",
";",
"//Au... | Change client queue counter helper
@param int $queueCounter | [
"Change",
"client",
"queue",
"counter",
"helper"
] | f1ac06550320ab0456df16b3e1e3f49da1aa4b98 | https://github.com/digit-soft/re-action-clients-pool/blob/f1ac06550320ab0456df16b3e1e3f49da1aa4b98/src/PoolClientTrait.php#L114-L127 |
6,257 | digit-soft/re-action-clients-pool | src/PoolClientTrait.php | PoolClientTrait.generatePoolClientId | private static function generatePoolClientId()
{
$now = ceil(microtime(true) * 10000);
if (class_exists('Reaction', false)) {
$rand = \Reaction::$app->security->generateRandomString(8);
} else {
$rand = static::randomStr();
}
return static::getClientId... | php | private static function generatePoolClientId()
{
$now = ceil(microtime(true) * 10000);
if (class_exists('Reaction', false)) {
$rand = \Reaction::$app->security->generateRandomString(8);
} else {
$rand = static::randomStr();
}
return static::getClientId... | [
"private",
"static",
"function",
"generatePoolClientId",
"(",
")",
"{",
"$",
"now",
"=",
"ceil",
"(",
"microtime",
"(",
"true",
")",
"*",
"10000",
")",
";",
"if",
"(",
"class_exists",
"(",
"'Reaction'",
",",
"false",
")",
")",
"{",
"$",
"rand",
"=",
... | Generate random client ID
@return string | [
"Generate",
"random",
"client",
"ID"
] | f1ac06550320ab0456df16b3e1e3f49da1aa4b98 | https://github.com/digit-soft/re-action-clients-pool/blob/f1ac06550320ab0456df16b3e1e3f49da1aa4b98/src/PoolClientTrait.php#L190-L199 |
6,258 | blast-project/UtilsBundle | src/Entity/CustomFilter.php | CustomFilter.setRouteParameters | public function setRouteParameters($routeParameters)
{
if (!is_string($routeParameters)) {
$this->routeParameters = json_encode($routeParameters);
} else {
$this->routeParameters = $routeParameters;
}
return $this;
} | php | public function setRouteParameters($routeParameters)
{
if (!is_string($routeParameters)) {
$this->routeParameters = json_encode($routeParameters);
} else {
$this->routeParameters = $routeParameters;
}
return $this;
} | [
"public",
"function",
"setRouteParameters",
"(",
"$",
"routeParameters",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"routeParameters",
")",
")",
"{",
"$",
"this",
"->",
"routeParameters",
"=",
"json_encode",
"(",
"$",
"routeParameters",
")",
";",
"}",
... | Set routeParameters.
@param string|mixed $routeParameters
@return CustomFilter | [
"Set",
"routeParameters",
"."
] | 89eaecd717ad8737dbbab778d75e639f18bd26f8 | https://github.com/blast-project/UtilsBundle/blob/89eaecd717ad8737dbbab778d75e639f18bd26f8/src/Entity/CustomFilter.php#L101-L110 |
6,259 | blast-project/UtilsBundle | src/Entity/CustomFilter.php | CustomFilter.setFilterParameters | public function setFilterParameters($filterParameters)
{
if (!is_string($filterParameters)) {
$this->filterParameters = json_encode($filterParameters);
} else {
$this->filterParameters = $filterParameters;
}
return $this;
} | php | public function setFilterParameters($filterParameters)
{
if (!is_string($filterParameters)) {
$this->filterParameters = json_encode($filterParameters);
} else {
$this->filterParameters = $filterParameters;
}
return $this;
} | [
"public",
"function",
"setFilterParameters",
"(",
"$",
"filterParameters",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"filterParameters",
")",
")",
"{",
"$",
"this",
"->",
"filterParameters",
"=",
"json_encode",
"(",
"$",
"filterParameters",
")",
";",
... | Set filterParameters.
@param string|mixed $filterParameters
@return CustomFilter | [
"Set",
"filterParameters",
"."
] | 89eaecd717ad8737dbbab778d75e639f18bd26f8 | https://github.com/blast-project/UtilsBundle/blob/89eaecd717ad8737dbbab778d75e639f18bd26f8/src/Entity/CustomFilter.php#L129-L138 |
6,260 | jaeger-app/date-time | src/Traits/DateTime.php | DateTime.getDt | public function getDt()
{
if (is_null($this->dt)) {
$this->dt = new Carbon();
$this->dt->setTimezone($this->getTz());
}
return $this->dt;
} | php | public function getDt()
{
if (is_null($this->dt)) {
$this->dt = new Carbon();
$this->dt->setTimezone($this->getTz());
}
return $this->dt;
} | [
"public",
"function",
"getDt",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"dt",
")",
")",
"{",
"$",
"this",
"->",
"dt",
"=",
"new",
"Carbon",
"(",
")",
";",
"$",
"this",
"->",
"dt",
"->",
"setTimezone",
"(",
"$",
"this",
"->",... | Returns an instance of our DateTime object
@return \Carbon\Carbon | [
"Returns",
"an",
"instance",
"of",
"our",
"DateTime",
"object"
] | 36ccfc21f7bc9457b735098b6805e98db71fef68 | https://github.com/jaeger-app/date-time/blob/36ccfc21f7bc9457b735098b6805e98db71fef68/src/Traits/DateTime.php#L62-L70 |
6,261 | jaeger-app/date-time | src/Traits/DateTime.php | DateTime.convertTimestamp | public function convertTimestamp($date, $format)
{
if (! is_numeric($date)) {
$date = strtotime($date);
}
return $this->getDt()
->createFromTimestamp($date, $this->getTz())
->format($format);
} | php | public function convertTimestamp($date, $format)
{
if (! is_numeric($date)) {
$date = strtotime($date);
}
return $this->getDt()
->createFromTimestamp($date, $this->getTz())
->format($format);
} | [
"public",
"function",
"convertTimestamp",
"(",
"$",
"date",
",",
"$",
"format",
")",
"{",
"if",
"(",
"!",
"is_numeric",
"(",
"$",
"date",
")",
")",
"{",
"$",
"date",
"=",
"strtotime",
"(",
"$",
"date",
")",
";",
"}",
"return",
"$",
"this",
"->",
... | Converts a timestamp from one format to another
@param mixed $date
@param string $format | [
"Converts",
"a",
"timestamp",
"from",
"one",
"format",
"to",
"another"
] | 36ccfc21f7bc9457b735098b6805e98db71fef68 | https://github.com/jaeger-app/date-time/blob/36ccfc21f7bc9457b735098b6805e98db71fef68/src/Traits/DateTime.php#L100-L109 |
6,262 | easy-system/es-cache | src/Adapter/FileCache.php | FileCache.withNameSpace | public function withNameSpace($namespace)
{
$namespace = (string) $namespace;
if (! isset(static::$namespaces[$namespace])) {
$new = clone $this;
$new->setNamespace($namespace);
$new->setEnabled($this->enabled);
static::$namespaces[$namespace] = $new;... | php | public function withNameSpace($namespace)
{
$namespace = (string) $namespace;
if (! isset(static::$namespaces[$namespace])) {
$new = clone $this;
$new->setNamespace($namespace);
$new->setEnabled($this->enabled);
static::$namespaces[$namespace] = $new;... | [
"public",
"function",
"withNameSpace",
"(",
"$",
"namespace",
")",
"{",
"$",
"namespace",
"=",
"(",
"string",
")",
"$",
"namespace",
";",
"if",
"(",
"!",
"isset",
"(",
"static",
"::",
"$",
"namespaces",
"[",
"$",
"namespace",
"]",
")",
")",
"{",
"$",... | Returns the instance with specified namespace.
@param string $namespace The namespace
@return self The new instance with specified namespace | [
"Returns",
"the",
"instance",
"with",
"specified",
"namespace",
"."
] | 94ceacd8ac21b673ad2f2f222bc08696603ff2c6 | https://github.com/easy-system/es-cache/blob/94ceacd8ac21b673ad2f2f222bc08696603ff2c6/src/Adapter/FileCache.php#L101-L113 |
6,263 | easy-system/es-cache | src/Adapter/FileCache.php | FileCache.setEnabled | public function setEnabled($state = true)
{
$this->enabled = (bool) $state;
if ($this->enabled) {
try {
$this->createNamespace();
} catch (Exception $ex) {
throw new RuntimeException(sprintf(
'Failed to enable the cache ada... | php | public function setEnabled($state = true)
{
$this->enabled = (bool) $state;
if ($this->enabled) {
try {
$this->createNamespace();
} catch (Exception $ex) {
throw new RuntimeException(sprintf(
'Failed to enable the cache ada... | [
"public",
"function",
"setEnabled",
"(",
"$",
"state",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"enabled",
"=",
"(",
"bool",
")",
"$",
"state",
";",
"if",
"(",
"$",
"this",
"->",
"enabled",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"createNamespace... | Sets the state of adapter to "enabled state" or to "disabled state".
@param bool $state Optional; true by default. The adapter state
@throws \RuntimeException If failed to enable the cache adapter
@return self | [
"Sets",
"the",
"state",
"of",
"adapter",
"to",
"enabled",
"state",
"or",
"to",
"disabled",
"state",
"."
] | 94ceacd8ac21b673ad2f2f222bc08696603ff2c6 | https://github.com/easy-system/es-cache/blob/94ceacd8ac21b673ad2f2f222bc08696603ff2c6/src/Adapter/FileCache.php#L124-L142 |
6,264 | easy-system/es-cache | src/Adapter/FileCache.php | FileCache.get | public function get($key)
{
if (! $this->enabled) {
return;
}
$file = $this->getPath($key);
if (! file_exists($file)) {
return false;
}
set_error_handler(function () {
throw new Exception('An error occurred.');
}, E_WARNING... | php | public function get($key)
{
if (! $this->enabled) {
return;
}
$file = $this->getPath($key);
if (! file_exists($file)) {
return false;
}
set_error_handler(function () {
throw new Exception('An error occurred.');
}, E_WARNING... | [
"public",
"function",
"get",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"enabled",
")",
"{",
"return",
";",
"}",
"$",
"file",
"=",
"$",
"this",
"->",
"getPath",
"(",
"$",
"key",
")",
";",
"if",
"(",
"!",
"file_exists",
"(",
... | Gets a stored variable from the cache.
@param string $key The variable name
@return mixed Returns null if adapter is disabled, stored data on success,
false otherwise | [
"Gets",
"a",
"stored",
"variable",
"from",
"the",
"cache",
"."
] | 94ceacd8ac21b673ad2f2f222bc08696603ff2c6 | https://github.com/easy-system/es-cache/blob/94ceacd8ac21b673ad2f2f222bc08696603ff2c6/src/Adapter/FileCache.php#L235-L263 |
6,265 | easy-system/es-cache | src/Adapter/FileCache.php | FileCache.remove | public function remove($key)
{
if (! $this->enabled) {
return;
}
$file = $this->getPath($key);
if (! file_exists($file)) {
return true;
}
set_error_handler(function () {
throw new Exception('An error occurred.');
}, E_WARNI... | php | public function remove($key)
{
if (! $this->enabled) {
return;
}
$file = $this->getPath($key);
if (! file_exists($file)) {
return true;
}
set_error_handler(function () {
throw new Exception('An error occurred.');
}, E_WARNI... | [
"public",
"function",
"remove",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"enabled",
")",
"{",
"return",
";",
"}",
"$",
"file",
"=",
"$",
"this",
"->",
"getPath",
"(",
"$",
"key",
")",
";",
"if",
"(",
"!",
"file_exists",
"("... | Removes a stored variable from the cache.
@param string $key The variable name
@return null|bool Returns null if adapter is disabled, true on success,
false otherwise | [
"Removes",
"a",
"stored",
"variable",
"from",
"the",
"cache",
"."
] | 94ceacd8ac21b673ad2f2f222bc08696603ff2c6 | https://github.com/easy-system/es-cache/blob/94ceacd8ac21b673ad2f2f222bc08696603ff2c6/src/Adapter/FileCache.php#L273-L297 |
6,266 | easy-system/es-cache | src/Adapter/FileCache.php | FileCache.clearNamespace | public function clearNamespace()
{
if (! $this->enabled) {
return;
}
$error = false;
set_error_handler(function () use (&$error) {
$error = true;
}, E_WARNING);
foreach (glob($this->getPath() . '/*.dat') as $file) {
unlink($file);... | php | public function clearNamespace()
{
if (! $this->enabled) {
return;
}
$error = false;
set_error_handler(function () use (&$error) {
$error = true;
}, E_WARNING);
foreach (glob($this->getPath() . '/*.dat') as $file) {
unlink($file);... | [
"public",
"function",
"clearNamespace",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"enabled",
")",
"{",
"return",
";",
"}",
"$",
"error",
"=",
"false",
";",
"set_error_handler",
"(",
"function",
"(",
")",
"use",
"(",
"&",
"$",
"error",
")",
... | Cleans the namespace.
Remove any previously stored for the current namespace.
@return null|bool Returns null if adapter is disabled, true on success,
false otherwise | [
"Cleans",
"the",
"namespace",
".",
"Remove",
"any",
"previously",
"stored",
"for",
"the",
"current",
"namespace",
"."
] | 94ceacd8ac21b673ad2f2f222bc08696603ff2c6 | https://github.com/easy-system/es-cache/blob/94ceacd8ac21b673ad2f2f222bc08696603ff2c6/src/Adapter/FileCache.php#L306-L323 |
6,267 | easy-system/es-cache | src/Adapter/FileCache.php | FileCache.clearExpired | public function clearExpired()
{
if (! $this->enabled) {
return;
}
$error = false;
set_error_handler(function () use (&$error) {
$error = true;
}, E_WARNING);
foreach (glob($this->getPath() . '/*.dat') as $file) {
if (filemtime($fi... | php | public function clearExpired()
{
if (! $this->enabled) {
return;
}
$error = false;
set_error_handler(function () use (&$error) {
$error = true;
}, E_WARNING);
foreach (glob($this->getPath() . '/*.dat') as $file) {
if (filemtime($fi... | [
"public",
"function",
"clearExpired",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"enabled",
")",
"{",
"return",
";",
"}",
"$",
"error",
"=",
"false",
";",
"set_error_handler",
"(",
"function",
"(",
")",
"use",
"(",
"&",
"$",
"error",
")",
"{... | Cleans all expired variables.
It is recommended not to use this method directly.
This method is called from the destructor if necessary.
@return null|bool Returns null if adapter is disabled, true on success,
false otherwise | [
"Cleans",
"all",
"expired",
"variables",
"."
] | 94ceacd8ac21b673ad2f2f222bc08696603ff2c6 | https://github.com/easy-system/es-cache/blob/94ceacd8ac21b673ad2f2f222bc08696603ff2c6/src/Adapter/FileCache.php#L334-L352 |
6,268 | easy-system/es-cache | src/Adapter/FileCache.php | FileCache.getPath | protected function getPath($variableName = '')
{
$hash = function ($name) {
return hash($this->hashingAlgorithm, $name);
};
$path = $this->basedir . PHP_DS . $hash($this->namespace);
if ($variableName) {
$path .= PHP_DS . $hash($variableName) . '.dat';
... | php | protected function getPath($variableName = '')
{
$hash = function ($name) {
return hash($this->hashingAlgorithm, $name);
};
$path = $this->basedir . PHP_DS . $hash($this->namespace);
if ($variableName) {
$path .= PHP_DS . $hash($variableName) . '.dat';
... | [
"protected",
"function",
"getPath",
"(",
"$",
"variableName",
"=",
"''",
")",
"{",
"$",
"hash",
"=",
"function",
"(",
"$",
"name",
")",
"{",
"return",
"hash",
"(",
"$",
"this",
"->",
"hashingAlgorithm",
",",
"$",
"name",
")",
";",
"}",
";",
"$",
"p... | Gets the path to the file appropriate variable or path to namespace directory.
@param string $variableName Optional; the name of variable
@return string If the variable name received, returns the path to
appropriate file, otherwise returns the path to
directory of namespace | [
"Gets",
"the",
"path",
"to",
"the",
"file",
"appropriate",
"variable",
"or",
"path",
"to",
"namespace",
"directory",
"."
] | 94ceacd8ac21b673ad2f2f222bc08696603ff2c6 | https://github.com/easy-system/es-cache/blob/94ceacd8ac21b673ad2f2f222bc08696603ff2c6/src/Adapter/FileCache.php#L363-L376 |
6,269 | easy-system/es-cache | src/Adapter/FileCache.php | FileCache.setDirPermissions | protected function setDirPermissions($permissions)
{
$permissions = (int) $permissions;
if (! (0b100000000 & $permissions)) {
throw new InvalidArgumentException(sprintf(
'Invalid permissions "%s" for directories. '
. 'Directories will not available for re... | php | protected function setDirPermissions($permissions)
{
$permissions = (int) $permissions;
if (! (0b100000000 & $permissions)) {
throw new InvalidArgumentException(sprintf(
'Invalid permissions "%s" for directories. '
. 'Directories will not available for re... | [
"protected",
"function",
"setDirPermissions",
"(",
"$",
"permissions",
")",
"{",
"$",
"permissions",
"=",
"(",
"int",
")",
"$",
"permissions",
";",
"if",
"(",
"!",
"(",
"0b100000000",
"&",
"$",
"permissions",
")",
")",
"{",
"throw",
"new",
"InvalidArgument... | Sets permissions for directories.
@param int $permissions The directory permissions
@throws \InvalidArgumentException If the permissions do not allow write
to directory or read from directory | [
"Sets",
"permissions",
"for",
"directories",
"."
] | 94ceacd8ac21b673ad2f2f222bc08696603ff2c6 | https://github.com/easy-system/es-cache/blob/94ceacd8ac21b673ad2f2f222bc08696603ff2c6/src/Adapter/FileCache.php#L409-L435 |
6,270 | easy-system/es-cache | src/Adapter/FileCache.php | FileCache.setFilePermissions | protected function setFilePermissions($permissions)
{
$permissions = (int) $permissions;
if (! (0b100000000 & $permissions)) {
throw new InvalidArgumentException(sprintf(
'Invalid permissions "%s" for files. '
. 'Files will not available for reading.',
... | php | protected function setFilePermissions($permissions)
{
$permissions = (int) $permissions;
if (! (0b100000000 & $permissions)) {
throw new InvalidArgumentException(sprintf(
'Invalid permissions "%s" for files. '
. 'Files will not available for reading.',
... | [
"protected",
"function",
"setFilePermissions",
"(",
"$",
"permissions",
")",
"{",
"$",
"permissions",
"=",
"(",
"int",
")",
"$",
"permissions",
";",
"if",
"(",
"!",
"(",
"0b100000000",
"&",
"$",
"permissions",
")",
")",
"{",
"throw",
"new",
"InvalidArgumen... | Sets permissions for files.
@param int $permissions The file permissions
@throws \InvalidArgumentException If the permissions do not allow write
to file or read from file | [
"Sets",
"permissions",
"for",
"files",
"."
] | 94ceacd8ac21b673ad2f2f222bc08696603ff2c6 | https://github.com/easy-system/es-cache/blob/94ceacd8ac21b673ad2f2f222bc08696603ff2c6/src/Adapter/FileCache.php#L445-L464 |
6,271 | easy-system/es-cache | src/Adapter/FileCache.php | FileCache.createNamespace | protected function createNamespace()
{
$dir = $this->getPath();
if (! file_exists($dir) || ! is_dir($dir)) {
set_error_handler(function () {
throw new Exception('An error occurred.');
}, E_WARNING);
try {
mkdir($dir, $this->dirPermi... | php | protected function createNamespace()
{
$dir = $this->getPath();
if (! file_exists($dir) || ! is_dir($dir)) {
set_error_handler(function () {
throw new Exception('An error occurred.');
}, E_WARNING);
try {
mkdir($dir, $this->dirPermi... | [
"protected",
"function",
"createNamespace",
"(",
")",
"{",
"$",
"dir",
"=",
"$",
"this",
"->",
"getPath",
"(",
")",
";",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"dir",
")",
"||",
"!",
"is_dir",
"(",
"$",
"dir",
")",
")",
"{",
"set_error_handler",
... | Creates directory for current namespace if not exists.
@throws RuntimeException
- If unable to create the directory for specified namespace.
- If the directory for specified namespace exists, but not writable.
- If the directory for specified namespace exists, but not readable. | [
"Creates",
"directory",
"for",
"current",
"namespace",
"if",
"not",
"exists",
"."
] | 94ceacd8ac21b673ad2f2f222bc08696603ff2c6 | https://github.com/easy-system/es-cache/blob/94ceacd8ac21b673ad2f2f222bc08696603ff2c6/src/Adapter/FileCache.php#L475-L502 |
6,272 | linnella/core | src/Form/Field/Select.php | Select.load | public function load($field, $sourceUrl, $idField = 'id', $textField = 'text')
{
if (Str::contains($field, '.')) {
$field = $this->formatName($field);
$class = str_replace(['[', ']'], '_', $field);
} else {
$class = $field;
}
$script = <<<EOT
$(d... | php | public function load($field, $sourceUrl, $idField = 'id', $textField = 'text')
{
if (Str::contains($field, '.')) {
$field = $this->formatName($field);
$class = str_replace(['[', ']'], '_', $field);
} else {
$class = $field;
}
$script = <<<EOT
$(d... | [
"public",
"function",
"load",
"(",
"$",
"field",
",",
"$",
"sourceUrl",
",",
"$",
"idField",
"=",
"'id'",
",",
"$",
"textField",
"=",
"'text'",
")",
"{",
"if",
"(",
"Str",
"::",
"contains",
"(",
"$",
"field",
",",
"'.'",
")",
")",
"{",
"$",
"fiel... | Load options for other select on change.
@param string $field
@param string $sourceUrl
@param string $idField
@param string $textField
@return $this | [
"Load",
"options",
"for",
"other",
"select",
"on",
"change",
"."
] | 381a49feddf2cbfab0ae4d0548b6c0a10da6f9fa | https://github.com/linnella/core/blob/381a49feddf2cbfab0ae4d0548b6c0a10da6f9fa/src/Form/Field/Select.php#L81-L110 |
6,273 | mszewcz/php-light-framework | src/Session/Integrity.php | Integrity.getLooseIP | private static function getLooseIP(): string
{
return md5(
static::$tokenUseLooseIP && isset($_SERVER['REMOTE_ADDR'])
? \long2ip(\ip2long($_SERVER['REMOTE_ADDR']) & \ip2long('255.255.0.0'))
: ''
);
} | php | private static function getLooseIP(): string
{
return md5(
static::$tokenUseLooseIP && isset($_SERVER['REMOTE_ADDR'])
? \long2ip(\ip2long($_SERVER['REMOTE_ADDR']) & \ip2long('255.255.0.0'))
: ''
);
} | [
"private",
"static",
"function",
"getLooseIP",
"(",
")",
":",
"string",
"{",
"return",
"md5",
"(",
"static",
"::",
"$",
"tokenUseLooseIP",
"&&",
"isset",
"(",
"$",
"_SERVER",
"[",
"'REMOTE_ADDR'",
"]",
")",
"?",
"\\",
"long2ip",
"(",
"\\",
"ip2long",
"("... | Returns user's loose IP
@return string | [
"Returns",
"user",
"s",
"loose",
"IP"
] | 4d3b46781c387202c2dfbdb8760151b3ae8ef49c | https://github.com/mszewcz/php-light-framework/blob/4d3b46781c387202c2dfbdb8760151b3ae8ef49c/src/Session/Integrity.php#L60-L67 |
6,274 | mszewcz/php-light-framework | src/Session/Integrity.php | Integrity.buildToken | private static function buildToken(): string
{
return \md5(
\sprintf(
'MF_SESSION_INTEGRITY_TOKEN:%s%s%s%s%s%s',
static::getLooseIP(),
static::getHttpUserAgent(),
static::getHttpAccept(),
static::getHttpAcceptEncodin... | php | private static function buildToken(): string
{
return \md5(
\sprintf(
'MF_SESSION_INTEGRITY_TOKEN:%s%s%s%s%s%s',
static::getLooseIP(),
static::getHttpUserAgent(),
static::getHttpAccept(),
static::getHttpAcceptEncodin... | [
"private",
"static",
"function",
"buildToken",
"(",
")",
":",
"string",
"{",
"return",
"\\",
"md5",
"(",
"\\",
"sprintf",
"(",
"'MF_SESSION_INTEGRITY_TOKEN:%s%s%s%s%s%s'",
",",
"static",
"::",
"getLooseIP",
"(",
")",
",",
"static",
"::",
"getHttpUserAgent",
"(",... | Returns session integrity token based on session configuration
@return string | [
"Returns",
"session",
"integrity",
"token",
"based",
"on",
"session",
"configuration"
] | 4d3b46781c387202c2dfbdb8760151b3ae8ef49c | https://github.com/mszewcz/php-light-framework/blob/4d3b46781c387202c2dfbdb8760151b3ae8ef49c/src/Session/Integrity.php#L144-L157 |
6,275 | mszewcz/php-light-framework | src/Session/Integrity.php | Integrity.setToken | public static function setToken(string $variableName = '_MF_SESSION_INTEGRITY_TOKEN_'): bool
{
static::init();
$variableName = (string)$variableName;
$vHandler = Variables::getInstance();
$vHandler->session->set($variableName, static::buildToken());
return true;
} | php | public static function setToken(string $variableName = '_MF_SESSION_INTEGRITY_TOKEN_'): bool
{
static::init();
$variableName = (string)$variableName;
$vHandler = Variables::getInstance();
$vHandler->session->set($variableName, static::buildToken());
return true;
} | [
"public",
"static",
"function",
"setToken",
"(",
"string",
"$",
"variableName",
"=",
"'_MF_SESSION_INTEGRITY_TOKEN_'",
")",
":",
"bool",
"{",
"static",
"::",
"init",
"(",
")",
";",
"$",
"variableName",
"=",
"(",
"string",
")",
"$",
"variableName",
";",
"$",
... | Sets session integrity token according to session configuration
@param string $variableName
@return bool | [
"Sets",
"session",
"integrity",
"token",
"according",
"to",
"session",
"configuration"
] | 4d3b46781c387202c2dfbdb8760151b3ae8ef49c | https://github.com/mszewcz/php-light-framework/blob/4d3b46781c387202c2dfbdb8760151b3ae8ef49c/src/Session/Integrity.php#L165-L172 |
6,276 | mszewcz/php-light-framework | src/Session/Integrity.php | Integrity.check | public static function check(string $variableName = '_MF_SESSION_INTEGRITY_TOKEN_'): bool
{
static::init();
$variableName = (string)$variableName;
$vHandler = Variables::getInstance();
$userToken = $vHandler->session->get($variableName, $vHandler::TYPE_STRING);
$httpReferer =... | php | public static function check(string $variableName = '_MF_SESSION_INTEGRITY_TOKEN_'): bool
{
static::init();
$variableName = (string)$variableName;
$vHandler = Variables::getInstance();
$userToken = $vHandler->session->get($variableName, $vHandler::TYPE_STRING);
$httpReferer =... | [
"public",
"static",
"function",
"check",
"(",
"string",
"$",
"variableName",
"=",
"'_MF_SESSION_INTEGRITY_TOKEN_'",
")",
":",
"bool",
"{",
"static",
"::",
"init",
"(",
")",
";",
"$",
"variableName",
"=",
"(",
"string",
")",
"$",
"variableName",
";",
"$",
"... | Checks session integrity according to session configuration
@param string $variableName
@return bool | [
"Checks",
"session",
"integrity",
"according",
"to",
"session",
"configuration"
] | 4d3b46781c387202c2dfbdb8760151b3ae8ef49c | https://github.com/mszewcz/php-light-framework/blob/4d3b46781c387202c2dfbdb8760151b3ae8ef49c/src/Session/Integrity.php#L180-L190 |
6,277 | anklimsk/cakephp-basic-functions | Vendor/langcode-conv/zendframework/zend-stdlib/src/Message.php | Message.setMetadata | public function setMetadata($spec, $value = null)
{
if (is_scalar($spec)) {
$this->metadata[$spec] = $value;
return $this;
}
if (!is_array($spec) && !$spec instanceof Traversable) {
throw new Exception\InvalidArgumentException(sprintf(
'Exp... | php | public function setMetadata($spec, $value = null)
{
if (is_scalar($spec)) {
$this->metadata[$spec] = $value;
return $this;
}
if (!is_array($spec) && !$spec instanceof Traversable) {
throw new Exception\InvalidArgumentException(sprintf(
'Exp... | [
"public",
"function",
"setMetadata",
"(",
"$",
"spec",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"is_scalar",
"(",
"$",
"spec",
")",
")",
"{",
"$",
"this",
"->",
"metadata",
"[",
"$",
"spec",
"]",
"=",
"$",
"value",
";",
"return",
"$",... | Set message metadata
Non-destructive setting of message metadata; always adds to the metadata, never overwrites
the entire metadata container.
@param string|int|array|Traversable $spec
@param mixed $value
@throws Exception\InvalidArgumentException
@return Message | [
"Set",
"message",
"metadata"
] | 7554e8b0b420fd3155593af7bf76b7ccbdc8701e | https://github.com/anklimsk/cakephp-basic-functions/blob/7554e8b0b420fd3155593af7bf76b7ccbdc8701e/Vendor/langcode-conv/zendframework/zend-stdlib/src/Message.php#L37-L53 |
6,278 | anklimsk/cakephp-basic-functions | Vendor/langcode-conv/zendframework/zend-stdlib/src/Message.php | Message.getMetadata | public function getMetadata($key = null, $default = null)
{
if (null === $key) {
return $this->metadata;
}
if (!is_scalar($key)) {
throw new Exception\InvalidArgumentException('Non-scalar argument provided for key');
}
if (array_key_exists($key, $thi... | php | public function getMetadata($key = null, $default = null)
{
if (null === $key) {
return $this->metadata;
}
if (!is_scalar($key)) {
throw new Exception\InvalidArgumentException('Non-scalar argument provided for key');
}
if (array_key_exists($key, $thi... | [
"public",
"function",
"getMetadata",
"(",
"$",
"key",
"=",
"null",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"key",
")",
"{",
"return",
"$",
"this",
"->",
"metadata",
";",
"}",
"if",
"(",
"!",
"is_scalar",
"(",
"$... | Retrieve all metadata or a single metadatum as specified by key
@param null|string|int $key
@param null|mixed $default
@throws Exception\InvalidArgumentException
@return mixed | [
"Retrieve",
"all",
"metadata",
"or",
"a",
"single",
"metadatum",
"as",
"specified",
"by",
"key"
] | 7554e8b0b420fd3155593af7bf76b7ccbdc8701e | https://github.com/anklimsk/cakephp-basic-functions/blob/7554e8b0b420fd3155593af7bf76b7ccbdc8701e/Vendor/langcode-conv/zendframework/zend-stdlib/src/Message.php#L63-L78 |
6,279 | native5/native5-sdk-services-php | src/Native5/Services/Users/DefaultUserManager.php | DefaultUserManager.saveUser | public function saveUser(\Native5\Services\Users\User $user, $updates)
{
$logger = $GLOBALS['logger'];
$path = 'users/'.$user->getId();
$request = $this->_remoteServer->put($path, array(), json_encode($updates));
try {
$response = $request->send();
return $... | php | public function saveUser(\Native5\Services\Users\User $user, $updates)
{
$logger = $GLOBALS['logger'];
$path = 'users/'.$user->getId();
$request = $this->_remoteServer->put($path, array(), json_encode($updates));
try {
$response = $request->send();
return $... | [
"public",
"function",
"saveUser",
"(",
"\\",
"Native5",
"\\",
"Services",
"\\",
"Users",
"\\",
"User",
"$",
"user",
",",
"$",
"updates",
")",
"{",
"$",
"logger",
"=",
"$",
"GLOBALS",
"[",
"'logger'",
"]",
";",
"$",
"path",
"=",
"'users/'",
".",
"$",
... | Updates user details
@param mixed $user
@access public
@return void | [
"Updates",
"user",
"details"
] | 037bb45b5adaab40a3fe6e0a721268b483f15a94 | https://github.com/native5/native5-sdk-services-php/blob/037bb45b5adaab40a3fe6e0a721268b483f15a94/src/Native5/Services/Users/DefaultUserManager.php#L91-L103 |
6,280 | native5/native5-sdk-services-php | src/Native5/Services/Users/DefaultUserManager.php | DefaultUserManager.verifyToken | public function verifyToken($email, $token)
{
$path = 'users/verify_token';
$request = $this->_remoteServer->get($path);
$request->getQuery()->set('email', $email);
$request->getQuery()->set('token', $token);
$response = $request->send();
return $response->getBody('t... | php | public function verifyToken($email, $token)
{
$path = 'users/verify_token';
$request = $this->_remoteServer->get($path);
$request->getQuery()->set('email', $email);
$request->getQuery()->set('token', $token);
$response = $request->send();
return $response->getBody('t... | [
"public",
"function",
"verifyToken",
"(",
"$",
"email",
",",
"$",
"token",
")",
"{",
"$",
"path",
"=",
"'users/verify_token'",
";",
"$",
"request",
"=",
"$",
"this",
"->",
"_remoteServer",
"->",
"get",
"(",
"$",
"path",
")",
";",
"$",
"request",
"->",
... | Verifies token given the user id & the token.
@param mixed $email User e-mail
@param mixed $token API token
@access public
@return void | [
"Verifies",
"token",
"given",
"the",
"user",
"id",
"&",
"the",
"token",
"."
] | 037bb45b5adaab40a3fe6e0a721268b483f15a94 | https://github.com/native5/native5-sdk-services-php/blob/037bb45b5adaab40a3fe6e0a721268b483f15a94/src/Native5/Services/Users/DefaultUserManager.php#L196-L205 |
6,281 | native5/native5-sdk-services-php | src/Native5/Services/Users/DefaultUserManager.php | DefaultUserManager.createUser | public function createUser(\Native5\Services\Users\User $user) {
global $logger;
$path = 'users/create';
$request = $this->_remoteServer->post($path)
->setPostField('username', $user->getUsername())
->setPostField('password', $user->getPassword())
->setPos... | php | public function createUser(\Native5\Services\Users\User $user) {
global $logger;
$path = 'users/create';
$request = $this->_remoteServer->post($path)
->setPostField('username', $user->getUsername())
->setPostField('password', $user->getPassword())
->setPos... | [
"public",
"function",
"createUser",
"(",
"\\",
"Native5",
"\\",
"Services",
"\\",
"Users",
"\\",
"User",
"$",
"user",
")",
"{",
"global",
"$",
"logger",
";",
"$",
"path",
"=",
"'users/create'",
";",
"$",
"request",
"=",
"$",
"this",
"->",
"_remoteServer"... | createUser Create User for an application
@param mixed $username Login username
@param mixed $password Login password
@param mixed $name User name
@param array $roles Optional user roles as an array
@param array $aliases Optional user aliases as an associative array
@access public
@return boolean ... | [
"createUser",
"Create",
"User",
"for",
"an",
"application"
] | 037bb45b5adaab40a3fe6e0a721268b483f15a94 | https://github.com/native5/native5-sdk-services-php/blob/037bb45b5adaab40a3fe6e0a721268b483f15a94/src/Native5/Services/Users/DefaultUserManager.php#L218-L235 |
6,282 | native5/native5-sdk-services-php | src/Native5/Services/Users/DefaultUserManager.php | DefaultUserManager.getAllUsers | public function getAllUsers($count=1000, $offset=0, $searchToken=null) {
global $logger;
$path = 'users';
$request = $this->_remoteServer->get($path);
if(!empty($searchToken)) {
$request->getQuery()->set('searchToken', $searchToken);
}
$request->getQuery()-... | php | public function getAllUsers($count=1000, $offset=0, $searchToken=null) {
global $logger;
$path = 'users';
$request = $this->_remoteServer->get($path);
if(!empty($searchToken)) {
$request->getQuery()->set('searchToken', $searchToken);
}
$request->getQuery()-... | [
"public",
"function",
"getAllUsers",
"(",
"$",
"count",
"=",
"1000",
",",
"$",
"offset",
"=",
"0",
",",
"$",
"searchToken",
"=",
"null",
")",
"{",
"global",
"$",
"logger",
";",
"$",
"path",
"=",
"'users'",
";",
"$",
"request",
"=",
"$",
"this",
"->... | getAllUsers List all users for an application
@access public
@return array array of user associative arrays | [
"getAllUsers",
"List",
"all",
"users",
"for",
"an",
"application"
] | 037bb45b5adaab40a3fe6e0a721268b483f15a94 | https://github.com/native5/native5-sdk-services-php/blob/037bb45b5adaab40a3fe6e0a721268b483f15a94/src/Native5/Services/Users/DefaultUserManager.php#L243-L260 |
6,283 | easy-system/es-view | src/View.php | View.getLayout | public function getLayout()
{
if (! $this->layout) {
$layout = new ViewModel();
$layout->setTemplate('layout/layout');
$this->layout = $layout;
}
return $this->layout;
} | php | public function getLayout()
{
if (! $this->layout) {
$layout = new ViewModel();
$layout->setTemplate('layout/layout');
$this->layout = $layout;
}
return $this->layout;
} | [
"public",
"function",
"getLayout",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"layout",
")",
"{",
"$",
"layout",
"=",
"new",
"ViewModel",
"(",
")",
";",
"$",
"layout",
"->",
"setTemplate",
"(",
"'layout/layout'",
")",
";",
"$",
"this",
"->",
... | Gets the layout.
@return \Es\Mvc\ViewModelInterface The layout | [
"Gets",
"the",
"layout",
"."
] | 8a29efcef8cd59640c98f5440379a93d0f504212 | https://github.com/easy-system/es-view/blob/8a29efcef8cd59640c98f5440379a93d0f504212/src/View.php#L53-L62 |
6,284 | easy-system/es-view | src/View.php | View.getEvents | public function getEvents()
{
if (! $this->events) {
$services = $this->getServices();
$events = $services->get('Events');
$this->setEvents($events);
}
return $this->events;
} | php | public function getEvents()
{
if (! $this->events) {
$services = $this->getServices();
$events = $services->get('Events');
$this->setEvents($events);
}
return $this->events;
} | [
"public",
"function",
"getEvents",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"events",
")",
"{",
"$",
"services",
"=",
"$",
"this",
"->",
"getServices",
"(",
")",
";",
"$",
"events",
"=",
"$",
"services",
"->",
"get",
"(",
"'Events'",
")",
... | Gets the events.
@return \Es\Events\EventsInterface The events | [
"Gets",
"the",
"events",
"."
] | 8a29efcef8cd59640c98f5440379a93d0f504212 | https://github.com/easy-system/es-view/blob/8a29efcef8cd59640c98f5440379a93d0f504212/src/View.php#L79-L88 |
6,285 | easy-system/es-view | src/View.php | View.render | public function render(ViewModelInterface $model)
{
foreach ($model as $child) {
$groupId = $child->getGroupId();
if (empty($groupId)) {
continue;
}
$result = $this->render($child);
$oldResult = $model->getVariable($groupId, '');... | php | public function render(ViewModelInterface $model)
{
foreach ($model as $child) {
$groupId = $child->getGroupId();
if (empty($groupId)) {
continue;
}
$result = $this->render($child);
$oldResult = $model->getVariable($groupId, '');... | [
"public",
"function",
"render",
"(",
"ViewModelInterface",
"$",
"model",
")",
"{",
"foreach",
"(",
"$",
"model",
"as",
"$",
"child",
")",
"{",
"$",
"groupId",
"=",
"$",
"child",
"->",
"getGroupId",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"groupI... | Renders the view model.
@param \Es\Mvc\ViewModelInterface $model The view model
@return mixed The result of rendering | [
"Renders",
"the",
"view",
"model",
"."
] | 8a29efcef8cd59640c98f5440379a93d0f504212 | https://github.com/easy-system/es-view/blob/8a29efcef8cd59640c98f5440379a93d0f504212/src/View.php#L97-L114 |
6,286 | theluckyteam/php-jira | src/jira/Util/IssueLinkHelper.php | IssueLinkHelper.getLinkName | public static function getLinkName($issueLink)
{
$linkName = null;
if (isset($issueLink['outwardIssue'])) {
if (isset($issueLink['outwardIssue']['key'], $issueLink['type']['outward'])) {
$linkName = $issueLink['type']['outward'];
}
} elseif (isset($is... | php | public static function getLinkName($issueLink)
{
$linkName = null;
if (isset($issueLink['outwardIssue'])) {
if (isset($issueLink['outwardIssue']['key'], $issueLink['type']['outward'])) {
$linkName = $issueLink['type']['outward'];
}
} elseif (isset($is... | [
"public",
"static",
"function",
"getLinkName",
"(",
"$",
"issueLink",
")",
"{",
"$",
"linkName",
"=",
"null",
";",
"if",
"(",
"isset",
"(",
"$",
"issueLink",
"[",
"'outwardIssue'",
"]",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"issueLink",
"[",
"... | Returns name of link from Issue link
@param array $issueLink An array of Issue link
@return string Name of link | [
"Returns",
"name",
"of",
"link",
"from",
"Issue",
"link"
] | 5a50ab4fc57dd77239f1b7e9c87738318c258c38 | https://github.com/theluckyteam/php-jira/blob/5a50ab4fc57dd77239f1b7e9c87738318c258c38/src/jira/Util/IssueLinkHelper.php#L18-L33 |
6,287 | theluckyteam/php-jira | src/jira/Util/IssueLinkHelper.php | IssueLinkHelper.getLinkedIssueKey | public static function getLinkedIssueKey($issueLink)
{
$linkedIssueKey = null;
if (isset($issueLink['outwardIssue'])) {
if (isset($issueLink['outwardIssue']['key'], $issueLink['type']['outward'])) {
$linkedIssueKey = $issueLink['outwardIssue']['key'];
}
... | php | public static function getLinkedIssueKey($issueLink)
{
$linkedIssueKey = null;
if (isset($issueLink['outwardIssue'])) {
if (isset($issueLink['outwardIssue']['key'], $issueLink['type']['outward'])) {
$linkedIssueKey = $issueLink['outwardIssue']['key'];
}
... | [
"public",
"static",
"function",
"getLinkedIssueKey",
"(",
"$",
"issueLink",
")",
"{",
"$",
"linkedIssueKey",
"=",
"null",
";",
"if",
"(",
"isset",
"(",
"$",
"issueLink",
"[",
"'outwardIssue'",
"]",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"issueLink"... | Returns key of linked Issue from Issue link
@param array $issueLink An array of Issue link
@return string Key of linked Issue | [
"Returns",
"key",
"of",
"linked",
"Issue",
"from",
"Issue",
"link"
] | 5a50ab4fc57dd77239f1b7e9c87738318c258c38 | https://github.com/theluckyteam/php-jira/blob/5a50ab4fc57dd77239f1b7e9c87738318c258c38/src/jira/Util/IssueLinkHelper.php#L42-L57 |
6,288 | Label305/Auja-PHP | src/Label305/Auja/Menu/Resource.php | Resource.addItem | public function addItem(MenuItem $item) {
if($item instanceof ResourceMenuItem){
throw new \InvalidArgumentException('ResourceMenuItem passed to Resource::addItem(MenuItem). You cannot nest ResourceMenuItems.');
}
$this->items[] = $item;
return $this;
} | php | public function addItem(MenuItem $item) {
if($item instanceof ResourceMenuItem){
throw new \InvalidArgumentException('ResourceMenuItem passed to Resource::addItem(MenuItem). You cannot nest ResourceMenuItems.');
}
$this->items[] = $item;
return $this;
} | [
"public",
"function",
"addItem",
"(",
"MenuItem",
"$",
"item",
")",
"{",
"if",
"(",
"$",
"item",
"instanceof",
"ResourceMenuItem",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'ResourceMenuItem passed to Resource::addItem(MenuItem). You cannot nest Re... | Adds a `MenuItem`, which contains a database entry.
@param MenuItem $item The item to add. Must not be a `ResourceMenuItem`.
@return $this | [
"Adds",
"a",
"MenuItem",
"which",
"contains",
"a",
"database",
"entry",
"."
] | 64712af949c4b80e6ca19ed1936e6b37f8965a4c | https://github.com/Label305/Auja-PHP/blob/64712af949c4b80e6ca19ed1936e6b37f8965a4c/src/Label305/Auja/Menu/Resource.php#L65-L73 |
6,289 | Label305/Auja-PHP | src/Label305/Auja/Menu/Resource.php | Resource.aujaSerialize | public function aujaSerialize() {
$result = array();
$result['type'] = $this->getType();
$result[$this->getType()] = $this->basicSerialize();
if ($this->nextPageUrl != null || $this->totalPageUrl != null) {
$result['paging'] = array();
if ($this->nextPageUrl != ... | php | public function aujaSerialize() {
$result = array();
$result['type'] = $this->getType();
$result[$this->getType()] = $this->basicSerialize();
if ($this->nextPageUrl != null || $this->totalPageUrl != null) {
$result['paging'] = array();
if ($this->nextPageUrl != ... | [
"public",
"function",
"aujaSerialize",
"(",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"$",
"result",
"[",
"'type'",
"]",
"=",
"$",
"this",
"->",
"getType",
"(",
")",
";",
"$",
"result",
"[",
"$",
"this",
"->",
"getType",
"(",
")",
"]"... | Overridden to add an extra `paging` section to the result.
@return array The ready-to-use `array`. | [
"Overridden",
"to",
"add",
"an",
"extra",
"paging",
"section",
"to",
"the",
"result",
"."
] | 64712af949c4b80e6ca19ed1936e6b37f8965a4c | https://github.com/Label305/Auja-PHP/blob/64712af949c4b80e6ca19ed1936e6b37f8965a4c/src/Label305/Auja/Menu/Resource.php#L132-L149 |
6,290 | bugotech/http | src/Wizard/WizardTrait.php | WizardTrait.flow | protected function flow($step)
{
// Carregar id do flow
$flow = router()->current()->parameter('flow');
if (is_null($flow)) {
error('Flow not information');
}
// Carregar model
$this->model = call_user_func_array([$this->modelName, 'find'], [$flow]);
... | php | protected function flow($step)
{
// Carregar id do flow
$flow = router()->current()->parameter('flow');
if (is_null($flow)) {
error('Flow not information');
}
// Carregar model
$this->model = call_user_func_array([$this->modelName, 'find'], [$flow]);
... | [
"protected",
"function",
"flow",
"(",
"$",
"step",
")",
"{",
"// Carregar id do flow",
"$",
"flow",
"=",
"router",
"(",
")",
"->",
"current",
"(",
")",
"->",
"parameter",
"(",
"'flow'",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"flow",
")",
")",
"{",... | Define com step atual e retornal o objeto.
@param string $step
@return Step | [
"Define",
"com",
"step",
"atual",
"e",
"retornal",
"o",
"objeto",
"."
] | 68c2e8a28eaa2e53f98a55d2f2ec0e33c83fd486 | https://github.com/bugotech/http/blob/68c2e8a28eaa2e53f98a55d2f2ec0e33c83fd486/src/Wizard/WizardTrait.php#L50-L73 |
6,291 | bugotech/http | src/Wizard/WizardTrait.php | WizardTrait.createFlow | public function createFlow()
{
$model = app($this->modelName);
$model->save();
$step = $model->steps->firstId();
return redirect()->route(sprintf('%s.get', $this->prefixRoute), ['flow' => $model->_id, 'step' => $step]);
} | php | public function createFlow()
{
$model = app($this->modelName);
$model->save();
$step = $model->steps->firstId();
return redirect()->route(sprintf('%s.get', $this->prefixRoute), ['flow' => $model->_id, 'step' => $step]);
} | [
"public",
"function",
"createFlow",
"(",
")",
"{",
"$",
"model",
"=",
"app",
"(",
"$",
"this",
"->",
"modelName",
")",
";",
"$",
"model",
"->",
"save",
"(",
")",
";",
"$",
"step",
"=",
"$",
"model",
"->",
"steps",
"->",
"firstId",
"(",
")",
";",
... | Cria novo flow.
@return \Illuminate\Http\RedirectResponse | [
"Cria",
"novo",
"flow",
"."
] | 68c2e8a28eaa2e53f98a55d2f2ec0e33c83fd486 | https://github.com/bugotech/http/blob/68c2e8a28eaa2e53f98a55d2f2ec0e33c83fd486/src/Wizard/WizardTrait.php#L79-L87 |
6,292 | bugotech/http | src/Wizard/WizardTrait.php | WizardTrait.getSteps | public function getSteps()
{
// Carregar step do conexto e atual
$step = $this->flow(router()->current()->parameter('step'));
// Carregar view
$view_id = sprintf('%s.%s', $this->prefixViewName, $step->key);
if (! view()->exists($view_id)) {
error('View of step "%... | php | public function getSteps()
{
// Carregar step do conexto e atual
$step = $this->flow(router()->current()->parameter('step'));
// Carregar view
$view_id = sprintf('%s.%s', $this->prefixViewName, $step->key);
if (! view()->exists($view_id)) {
error('View of step "%... | [
"public",
"function",
"getSteps",
"(",
")",
"{",
"// Carregar step do conexto e atual",
"$",
"step",
"=",
"$",
"this",
"->",
"flow",
"(",
"router",
"(",
")",
"->",
"current",
"(",
")",
"->",
"parameter",
"(",
"'step'",
")",
")",
";",
"// Carregar view",
"$... | Retorna a view do step.
@return \Illuminate\Contracts\View\Factory|\Illuminate\View\View | [
"Retorna",
"a",
"view",
"do",
"step",
"."
] | 68c2e8a28eaa2e53f98a55d2f2ec0e33c83fd486 | https://github.com/bugotech/http/blob/68c2e8a28eaa2e53f98a55d2f2ec0e33c83fd486/src/Wizard/WizardTrait.php#L93-L115 |
6,293 | bugotech/http | src/Wizard/WizardTrait.php | WizardTrait.stepUrl | protected function stepUrl(Step $step, $method = 'get')
{
$id = sprintf('%s.%s', $this->prefixRoute, $method);
return route($id, ['step' => $step->key]);
} | php | protected function stepUrl(Step $step, $method = 'get')
{
$id = sprintf('%s.%s', $this->prefixRoute, $method);
return route($id, ['step' => $step->key]);
} | [
"protected",
"function",
"stepUrl",
"(",
"Step",
"$",
"step",
",",
"$",
"method",
"=",
"'get'",
")",
"{",
"$",
"id",
"=",
"sprintf",
"(",
"'%s.%s'",
",",
"$",
"this",
"->",
"prefixRoute",
",",
"$",
"method",
")",
";",
"return",
"route",
"(",
"$",
"... | Retorna url do step.
@param Step $step
@param string $method
@return string | [
"Retorna",
"url",
"do",
"step",
"."
] | 68c2e8a28eaa2e53f98a55d2f2ec0e33c83fd486 | https://github.com/bugotech/http/blob/68c2e8a28eaa2e53f98a55d2f2ec0e33c83fd486/src/Wizard/WizardTrait.php#L182-L187 |
6,294 | bugotech/http | src/Wizard/WizardTrait.php | WizardTrait.routesRegister | public static function routesRegister(Router $router, $prefixPart, $routePrefix)
{
$class = get_called_class();
// Get - Create flow
$part = sprintf('%s', $prefixPart);
$uses = sprintf('\%s@createFlow', $class);
$as = sprintf('%s.create', $routePrefix);
$router->get(... | php | public static function routesRegister(Router $router, $prefixPart, $routePrefix)
{
$class = get_called_class();
// Get - Create flow
$part = sprintf('%s', $prefixPart);
$uses = sprintf('\%s@createFlow', $class);
$as = sprintf('%s.create', $routePrefix);
$router->get(... | [
"public",
"static",
"function",
"routesRegister",
"(",
"Router",
"$",
"router",
",",
"$",
"prefixPart",
",",
"$",
"routePrefix",
")",
"{",
"$",
"class",
"=",
"get_called_class",
"(",
")",
";",
"// Get - Create flow",
"$",
"part",
"=",
"sprintf",
"(",
"'%s'",... | Register routes of flow.
@param Router $router
@param $prefixPart
@param $routePrefix | [
"Register",
"routes",
"of",
"flow",
"."
] | 68c2e8a28eaa2e53f98a55d2f2ec0e33c83fd486 | https://github.com/bugotech/http/blob/68c2e8a28eaa2e53f98a55d2f2ec0e33c83fd486/src/Wizard/WizardTrait.php#L207-L228 |
6,295 | jarrus90/yii2-multilang | Components/MultilangRequest.php | MultilangRequest.resolve | public function resolve() {
$resolve = parent::resolve();
$languages = Language::getDb()->cache(function ($db) {
return Language::find()->where(['is_active' => true])->asArray()->all();
});
Yii::$app->params['languages'] = ArrayHelper::map($languages, 'code', 'code');
... | php | public function resolve() {
$resolve = parent::resolve();
$languages = Language::getDb()->cache(function ($db) {
return Language::find()->where(['is_active' => true])->asArray()->all();
});
Yii::$app->params['languages'] = ArrayHelper::map($languages, 'code', 'code');
... | [
"public",
"function",
"resolve",
"(",
")",
"{",
"$",
"resolve",
"=",
"parent",
"::",
"resolve",
"(",
")",
";",
"$",
"languages",
"=",
"Language",
"::",
"getDb",
"(",
")",
"->",
"cache",
"(",
"function",
"(",
"$",
"db",
")",
"{",
"return",
"Language",... | Resolve
Resolves the current request into a route and the associated parameters.
Sets default application language
@return array the first element is the route, and the second is the associated parameters.
@throws \yii\web\NotFoundHttpException if the request cannot be resolved. | [
"Resolve",
"Resolves",
"the",
"current",
"request",
"into",
"a",
"route",
"and",
"the",
"associated",
"parameters",
".",
"Sets",
"default",
"application",
"language"
] | 611e7b5fcc36ef79a0400cdede2bf54d17eccfce | https://github.com/jarrus90/yii2-multilang/blob/611e7b5fcc36ef79a0400cdede2bf54d17eccfce/Components/MultilangRequest.php#L32-L40 |
6,296 | jarrus90/yii2-multilang | Components/MultilangRequest.php | MultilangRequest.getCurrentLang | protected function getCurrentLang(){
if(!Yii::$app->user->isGuest && !empty(Yii::$app->user->identity->lang)) {
$lang = Yii::$app->user->identity->lang;
} else if(Yii::$app->session->get('lang')) {
$lang = Yii::$app->session->get('lang');
} else {
$lang = Yii:... | php | protected function getCurrentLang(){
if(!Yii::$app->user->isGuest && !empty(Yii::$app->user->identity->lang)) {
$lang = Yii::$app->user->identity->lang;
} else if(Yii::$app->session->get('lang')) {
$lang = Yii::$app->session->get('lang');
} else {
$lang = Yii:... | [
"protected",
"function",
"getCurrentLang",
"(",
")",
"{",
"if",
"(",
"!",
"Yii",
"::",
"$",
"app",
"->",
"user",
"->",
"isGuest",
"&&",
"!",
"empty",
"(",
"Yii",
"::",
"$",
"app",
"->",
"user",
"->",
"identity",
"->",
"lang",
")",
")",
"{",
"$",
... | Get current language
If user is logged in gets its language
Otherwise from session
Otherwise from request
@return string | [
"Get",
"current",
"language",
"If",
"user",
"is",
"logged",
"in",
"gets",
"its",
"language",
"Otherwise",
"from",
"session",
"Otherwise",
"from",
"request"
] | 611e7b5fcc36ef79a0400cdede2bf54d17eccfce | https://github.com/jarrus90/yii2-multilang/blob/611e7b5fcc36ef79a0400cdede2bf54d17eccfce/Components/MultilangRequest.php#L49-L59 |
6,297 | teeebor/decoy-framework | Application.php | Application.toRoute | public function toRoute($route)
{
if ($this->caller != null)
$this->disableRender[] = $this->caller->identifier;
$r = $this->router->getRoute($route);
if ($r != null) {
$this->currentRoute = $r;
try {
$this->execute();
} catch (\Exception $e) {
Logger::Log('log/error.txt', $e->getMessage());
... | php | public function toRoute($route)
{
if ($this->caller != null)
$this->disableRender[] = $this->caller->identifier;
$r = $this->router->getRoute($route);
if ($r != null) {
$this->currentRoute = $r;
try {
$this->execute();
} catch (\Exception $e) {
Logger::Log('log/error.txt', $e->getMessage());
... | [
"public",
"function",
"toRoute",
"(",
"$",
"route",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"caller",
"!=",
"null",
")",
"$",
"this",
"->",
"disableRender",
"[",
"]",
"=",
"$",
"this",
"->",
"caller",
"->",
"identifier",
";",
"$",
"r",
"=",
"$",
... | Redirecting the execution route.
This will not change the URL.
All the not fully executed instance will finish.
If you dont't want that, return after this method was called.
@param string $route | [
"Redirecting",
"the",
"execution",
"route",
".",
"This",
"will",
"not",
"change",
"the",
"URL",
".",
"All",
"the",
"not",
"fully",
"executed",
"instance",
"will",
"finish",
".",
"If",
"you",
"dont",
"t",
"want",
"that",
"return",
"after",
"this",
"method",... | 3881ae63a7d13088efda5afd3932c1af1fc18b23 | https://github.com/teeebor/decoy-framework/blob/3881ae63a7d13088efda5afd3932c1af1fc18b23/Application.php#L205-L221 |
6,298 | teeebor/decoy-framework | Application.php | Application.execute | private function execute()
{
if ($this->currentRoute == null) {
$this->router->getRoute('error_page')->setAction('_notFound');
$this->toRoute('error_page');
return;
}
$controllerName = $this->currentRoute->getController();
if ($controllerName == '') {
if ($this->currentRoute->getParams() != null &&... | php | private function execute()
{
if ($this->currentRoute == null) {
$this->router->getRoute('error_page')->setAction('_notFound');
$this->toRoute('error_page');
return;
}
$controllerName = $this->currentRoute->getController();
if ($controllerName == '') {
if ($this->currentRoute->getParams() != null &&... | [
"private",
"function",
"execute",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"currentRoute",
"==",
"null",
")",
"{",
"$",
"this",
"->",
"router",
"->",
"getRoute",
"(",
"'error_page'",
")",
"->",
"setAction",
"(",
"'_notFound'",
")",
";",
"$",
"this"... | Executing the current route | [
"Executing",
"the",
"current",
"route"
] | 3881ae63a7d13088efda5afd3932c1af1fc18b23 | https://github.com/teeebor/decoy-framework/blob/3881ae63a7d13088efda5afd3932c1af1fc18b23/Application.php#L244-L270 |
6,299 | teeebor/decoy-framework | Application.php | Application.parseRequestBody | private function parseRequestBody()
{
$content_type = $this->getRequestHeader()->getContentType();
if (strpos($content_type, 'application/json') !== false) {
$this->requestBody = new JsonBody();
} elseif (strpos($content_type, 'application/x-www-form-urlencoded') !== false) {
$this->requestBody = new FormB... | php | private function parseRequestBody()
{
$content_type = $this->getRequestHeader()->getContentType();
if (strpos($content_type, 'application/json') !== false) {
$this->requestBody = new JsonBody();
} elseif (strpos($content_type, 'application/x-www-form-urlencoded') !== false) {
$this->requestBody = new FormB... | [
"private",
"function",
"parseRequestBody",
"(",
")",
"{",
"$",
"content_type",
"=",
"$",
"this",
"->",
"getRequestHeader",
"(",
")",
"->",
"getContentType",
"(",
")",
";",
"if",
"(",
"strpos",
"(",
"$",
"content_type",
",",
"'application/json'",
")",
"!==",
... | Setting up the request body parser | [
"Setting",
"up",
"the",
"request",
"body",
"parser"
] | 3881ae63a7d13088efda5afd3932c1af1fc18b23 | https://github.com/teeebor/decoy-framework/blob/3881ae63a7d13088efda5afd3932c1af1fc18b23/Application.php#L302-L316 |
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.