repository_name
stringlengths
5
67
func_path_in_repository
stringlengths
4
234
func_name
stringlengths
0
314
whole_func_string
stringlengths
52
3.87M
language
stringclasses
6 values
func_code_string
stringlengths
52
3.87M
func_code_tokens
listlengths
15
672k
func_documentation_string
stringlengths
1
47.2k
func_documentation_tokens
listlengths
1
3.92k
split_name
stringclasses
1 value
func_code_url
stringlengths
85
339
fubhy/graphql-php
src/Executor/Executor.php
Executor.collectFields
protected static function collectFields(ExecutionContext $context, ObjectType $type, SelectionSet $set, $fields, $visited) { $count = count($set->get('selections')); for ($i = 0; $i < $count; $i++) { $selection = $set->get('selections')[$i]; switch ($selection::KIND) { ...
php
protected static function collectFields(ExecutionContext $context, ObjectType $type, SelectionSet $set, $fields, $visited) { $count = count($set->get('selections')); for ($i = 0; $i < $count; $i++) { $selection = $set->get('selections')[$i]; switch ($selection::KIND) { ...
[ "protected", "static", "function", "collectFields", "(", "ExecutionContext", "$", "context", ",", "ObjectType", "$", "type", ",", "SelectionSet", "$", "set", ",", "$", "fields", ",", "$", "visited", ")", "{", "$", "count", "=", "count", "(", "$", "set", ...
Given a selectionSet, adds all of the fields in that selection to the passed in map of fields, and returns it at the end. @param ExecutionContext $context @param ObjectType $type @param SelectionSet $set @param $fields @param $visited @return \ArrayObject
[ "Given", "a", "selectionSet", "adds", "all", "of", "the", "fields", "in", "that", "selection", "to", "the", "passed", "in", "map", "of", "fields", "and", "returns", "it", "at", "the", "end", "." ]
train
https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Executor/Executor.php#L214-L267
fubhy/graphql-php
src/Executor/Executor.php
Executor.shouldIncludeNode
protected static function shouldIncludeNode(ExecutionContext $exeContext, $directives) { $skip = Directive::skipDirective(); $include = Directive::includeDirective(); foreach ($directives as $directive) { if ($directive->get('name')->get('value') === $skip->getName()) { ...
php
protected static function shouldIncludeNode(ExecutionContext $exeContext, $directives) { $skip = Directive::skipDirective(); $include = Directive::includeDirective(); foreach ($directives as $directive) { if ($directive->get('name')->get('value') === $skip->getName()) { ...
[ "protected", "static", "function", "shouldIncludeNode", "(", "ExecutionContext", "$", "exeContext", ",", "$", "directives", ")", "{", "$", "skip", "=", "Directive", "::", "skipDirective", "(", ")", ";", "$", "include", "=", "Directive", "::", "includeDirective",...
Determines if a field should be included based on @if and @unless directives.
[ "Determines", "if", "a", "field", "should", "be", "included", "based", "on" ]
train
https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Executor/Executor.php#L272-L290
fubhy/graphql-php
src/Executor/Executor.php
Executor.doesFragmentConditionMatch
protected static function doesFragmentConditionMatch(ExecutionContext $context, $fragment, ObjectType $type) { $typeCondition = $fragment->get('typeCondition'); if (!$typeCondition) { return TRUE; } $conditionalType = TypeInfo::typeFromAST($context->schema, $typeConditio...
php
protected static function doesFragmentConditionMatch(ExecutionContext $context, $fragment, ObjectType $type) { $typeCondition = $fragment->get('typeCondition'); if (!$typeCondition) { return TRUE; } $conditionalType = TypeInfo::typeFromAST($context->schema, $typeConditio...
[ "protected", "static", "function", "doesFragmentConditionMatch", "(", "ExecutionContext", "$", "context", ",", "$", "fragment", ",", "ObjectType", "$", "type", ")", "{", "$", "typeCondition", "=", "$", "fragment", "->", "get", "(", "'typeCondition'", ")", ";", ...
Determines if a fragment is applicable to the given type. @param ExecutionContext $context @param $fragment @param ObjectType $type @return bool
[ "Determines", "if", "a", "fragment", "is", "applicable", "to", "the", "given", "type", "." ]
train
https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Executor/Executor.php#L301-L318
fubhy/graphql-php
src/Executor/Executor.php
Executor.getFieldEntryKey
protected static function getFieldEntryKey(Field $node) { return $node->get('alias') ? $node->get('alias')->get('value') : $node->get('name')->get('value'); }
php
protected static function getFieldEntryKey(Field $node) { return $node->get('alias') ? $node->get('alias')->get('value') : $node->get('name')->get('value'); }
[ "protected", "static", "function", "getFieldEntryKey", "(", "Field", "$", "node", ")", "{", "return", "$", "node", "->", "get", "(", "'alias'", ")", "?", "$", "node", "->", "get", "(", "'alias'", ")", "->", "get", "(", "'value'", ")", ":", "$", "node...
Implements the logic to compute the key of a given field's entry @param Field $node @return string
[ "Implements", "the", "logic", "to", "compute", "the", "key", "of", "a", "given", "field", "s", "entry" ]
train
https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Executor/Executor.php#L327-L330
fubhy/graphql-php
src/Executor/Executor.php
Executor.resolveField
protected static function resolveField(ExecutionContext $context, ObjectType $parent, $source, $asts) { $definition = self::getFieldDefinition($context->schema, $parent, $asts[0]); if (!$definition) { return self::$UNDEFINED; } // If the field type is non-nullable, then ...
php
protected static function resolveField(ExecutionContext $context, ObjectType $parent, $source, $asts) { $definition = self::getFieldDefinition($context->schema, $parent, $asts[0]); if (!$definition) { return self::$UNDEFINED; } // If the field type is non-nullable, then ...
[ "protected", "static", "function", "resolveField", "(", "ExecutionContext", "$", "context", ",", "ObjectType", "$", "parent", ",", "$", "source", ",", "$", "asts", ")", "{", "$", "definition", "=", "self", "::", "getFieldDefinition", "(", "$", "context", "->...
A wrapper function for resolving the field, that catches the error and adds it to the context's global if the error is not rethrowable. @param ExecutionContext $context @param ObjectType $parent @param $source @param $asts @return array|mixed|null|string @throws \Exception
[ "A", "wrapper", "function", "for", "resolving", "the", "field", "that", "catches", "the", "error", "and", "adds", "it", "to", "the", "context", "s", "global", "if", "the", "error", "is", "not", "rethrowable", "." ]
train
https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Executor/Executor.php#L345-L367
fubhy/graphql-php
src/Executor/Executor.php
Executor.resolveFieldOrError
protected static function resolveFieldOrError(ExecutionContext $context, ObjectType $parent, $source, $asts, FieldDefinition $definition) { $ast = $asts[0]; $type = $definition->getType(); $resolver = $definition->getResolveCallback() ?: [__CLASS__, 'defaultResolveFn']; $data = $defi...
php
protected static function resolveFieldOrError(ExecutionContext $context, ObjectType $parent, $source, $asts, FieldDefinition $definition) { $ast = $asts[0]; $type = $definition->getType(); $resolver = $definition->getResolveCallback() ?: [__CLASS__, 'defaultResolveFn']; $data = $defi...
[ "protected", "static", "function", "resolveFieldOrError", "(", "ExecutionContext", "$", "context", ",", "ObjectType", "$", "parent", ",", "$", "source", ",", "$", "asts", ",", "FieldDefinition", "$", "definition", ")", "{", "$", "ast", "=", "$", "asts", "[",...
Resolves the field on the given source object. In particular, this figures out the object that the field returns using the resolve function, then calls completeField to coerce scalars or execute the sub selection set for objects. @param ExecutionContext $context @param ObjectType $parent @param $source @param $asts @...
[ "Resolves", "the", "field", "on", "the", "given", "source", "object", "." ]
train
https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Executor/Executor.php#L386-L402
fubhy/graphql-php
src/Executor/Executor.php
Executor.completeField
protected static function completeField(ExecutionContext $context, TypeInterface $type, $asts, &$result) { // If field type is NonNullModifier, complete for inner type, and throw field error // if result is null. if ($type instanceof NonNullModifier) { $completed = self::complete...
php
protected static function completeField(ExecutionContext $context, TypeInterface $type, $asts, &$result) { // If field type is NonNullModifier, complete for inner type, and throw field error // if result is null. if ($type instanceof NonNullModifier) { $completed = self::complete...
[ "protected", "static", "function", "completeField", "(", "ExecutionContext", "$", "context", ",", "TypeInterface", "$", "type", ",", "$", "asts", ",", "&", "$", "result", ")", "{", "// If field type is NonNullModifier, complete for inner type, and throw field error", "// ...
Implements the instructions for completeValue as defined in the "Field entries" section of the spec. If the field type is Non-Null, then this recursively completes the value for the inner type. It throws a field error if that completion returns null, as per the "Nullability" section of the spec. If the field type is ...
[ "Implements", "the", "instructions", "for", "completeValue", "as", "defined", "in", "the", "Field", "entries", "section", "of", "the", "spec", "." ]
train
https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Executor/Executor.php#L430-L496
fubhy/graphql-php
src/Executor/Executor.php
Executor.defaultResolveFn
public static function defaultResolveFn($source, $args, $root, $ast) { $property = NULL; $key = $ast->get('name')->get('value'); if ((is_array($source) || $source instanceof \ArrayAccess) && isset($source[$key])) { $property = $source[$key]; } else if (is_object(...
php
public static function defaultResolveFn($source, $args, $root, $ast) { $property = NULL; $key = $ast->get('name')->get('value'); if ((is_array($source) || $source instanceof \ArrayAccess) && isset($source[$key])) { $property = $source[$key]; } else if (is_object(...
[ "public", "static", "function", "defaultResolveFn", "(", "$", "source", ",", "$", "args", ",", "$", "root", ",", "$", "ast", ")", "{", "$", "property", "=", "NULL", ";", "$", "key", "=", "$", "ast", "->", "get", "(", "'name'", ")", "->", "get", "...
If a resolve function is not given, then a default resolve behavior is used which takes the property of the source object of the same name as the field and returns it as the result, or if it's a function, returns the result of calling that function. @param $source @param $args @param $root @param $ast @return mixed|n...
[ "If", "a", "resolve", "function", "is", "not", "given", "then", "a", "default", "resolve", "behavior", "is", "used", "which", "takes", "the", "property", "of", "the", "source", "object", "of", "the", "same", "name", "as", "the", "field", "and", "returns", ...
train
https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Executor/Executor.php#L511-L526
fubhy/graphql-php
src/Executor/Executor.php
Executor.getFieldDefinition
protected static function getFieldDefinition(Schema $schema, ObjectType $parent, Field $ast) { $name = $ast->get('name')->get('value'); $schemaMeta = Introspection::schemaMetaFieldDefinition(); $typeMeta = Introspection::typeMetaFieldDefinition(); $typeNameMeta = Introspection::typeN...
php
protected static function getFieldDefinition(Schema $schema, ObjectType $parent, Field $ast) { $name = $ast->get('name')->get('value'); $schemaMeta = Introspection::schemaMetaFieldDefinition(); $typeMeta = Introspection::typeMetaFieldDefinition(); $typeNameMeta = Introspection::typeN...
[ "protected", "static", "function", "getFieldDefinition", "(", "Schema", "$", "schema", ",", "ObjectType", "$", "parent", ",", "Field", "$", "ast", ")", "{", "$", "name", "=", "$", "ast", "->", "get", "(", "'name'", ")", "->", "get", "(", "'value'", ")"...
This method looks up the field on the given type defintion. It has special casing for the two introspection fields, __schema and __typename. __typename is special because it can always be queried as a field, even in situations where no other fields are allowed, like on a Union. __schema could get automatically added to...
[ "This", "method", "looks", "up", "the", "field", "on", "the", "given", "type", "defintion", ".", "It", "has", "special", "casing", "for", "the", "two", "introspection", "fields", "__schema", "and", "__typename", ".", "__typename", "is", "special", "because", ...
train
https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Executor/Executor.php#L543-L560
jinexus-framework/jinexus-mvc
src/View/AbstractView.php
AbstractView.basePath
public function basePath($file = '') { $basePath = dirname($_SERVER['PHP_SELF']); if ($basePath != '/') { $basePath .= '/'; } if (! empty($file)) { $basePath.= ltrim($file, '/'); } return $basePath; }
php
public function basePath($file = '') { $basePath = dirname($_SERVER['PHP_SELF']); if ($basePath != '/') { $basePath .= '/'; } if (! empty($file)) { $basePath.= ltrim($file, '/'); } return $basePath; }
[ "public", "function", "basePath", "(", "$", "file", "=", "''", ")", "{", "$", "basePath", "=", "dirname", "(", "$", "_SERVER", "[", "'PHP_SELF'", "]", ")", ";", "if", "(", "$", "basePath", "!=", "'/'", ")", "{", "$", "basePath", ".=", "'/'", ";", ...
Base Path @param string $file @return string
[ "Base", "Path" ]
train
https://github.com/jinexus-framework/jinexus-mvc/blob/63937fecea4bc927b1ac9669fee5cf50278d28d3/src/View/AbstractView.php#L89-L101
jinexus-framework/jinexus-mvc
src/View/AbstractView.php
AbstractView.baseUrl
public function baseUrl($uri = '') { return sprintf( "%s://%s%s%s%s", isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https' : 'http', $_SERVER['SERVER_NAME'], ($_SERVER['SERVER_PORT'] == 80) ?: ':' . $_SERVER['SERVER_PORT'], $_SERVER['RE...
php
public function baseUrl($uri = '') { return sprintf( "%s://%s%s%s%s", isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https' : 'http', $_SERVER['SERVER_NAME'], ($_SERVER['SERVER_PORT'] == 80) ?: ':' . $_SERVER['SERVER_PORT'], $_SERVER['RE...
[ "public", "function", "baseUrl", "(", "$", "uri", "=", "''", ")", "{", "return", "sprintf", "(", "\"%s://%s%s%s%s\"", ",", "isset", "(", "$", "_SERVER", "[", "'HTTPS'", "]", ")", "&&", "$", "_SERVER", "[", "'HTTPS'", "]", "!=", "'off'", "?", "'https'",...
Base URL @param string $uri @return string
[ "Base", "URL" ]
train
https://github.com/jinexus-framework/jinexus-mvc/blob/63937fecea4bc927b1ac9669fee5cf50278d28d3/src/View/AbstractView.php#L109-L119
jinexus-framework/jinexus-mvc
src/View/AbstractView.php
AbstractView.content
public function content() { if ($this->app->getMatchRoute()) { $actionName = strtolower(preg_replace('/(?<=\d)(?=[A-Za-z])|(?<=[A-Za-z])(?=\d)|(?<=[a-z])(?=[A-Z])/', '-', $this->app->getActionName())); $fileArray = [ strtolower($this->app->getModuleName()), ...
php
public function content() { if ($this->app->getMatchRoute()) { $actionName = strtolower(preg_replace('/(?<=\d)(?=[A-Za-z])|(?<=[A-Za-z])(?=\d)|(?<=[a-z])(?=[A-Z])/', '-', $this->app->getActionName())); $fileArray = [ strtolower($this->app->getModuleName()), ...
[ "public", "function", "content", "(", ")", "{", "if", "(", "$", "this", "->", "app", "->", "getMatchRoute", "(", ")", ")", "{", "$", "actionName", "=", "strtolower", "(", "preg_replace", "(", "'/(?<=\\d)(?=[A-Za-z])|(?<=[A-Za-z])(?=\\d)|(?<=[a-z])(?=[A-Z])/'", ","...
Render content @throws Exception
[ "Render", "content" ]
train
https://github.com/jinexus-framework/jinexus-mvc/blob/63937fecea4bc927b1ac9669fee5cf50278d28d3/src/View/AbstractView.php#L126-L144
jinexus-framework/jinexus-mvc
src/View/AbstractView.php
AbstractView.htmlEncode
public function htmlEncode($data) { switch (gettype($data)) { case 'array': foreach ($data as $key => $value) { $data[$key] = $this->htmlEncode($value); } break; case 'object': $data = clone $data; ...
php
public function htmlEncode($data) { switch (gettype($data)) { case 'array': foreach ($data as $key => $value) { $data[$key] = $this->htmlEncode($value); } break; case 'object': $data = clone $data; ...
[ "public", "function", "htmlEncode", "(", "$", "data", ")", "{", "switch", "(", "gettype", "(", "$", "data", ")", ")", "{", "case", "'array'", ":", "foreach", "(", "$", "data", "as", "$", "key", "=>", "$", "value", ")", "{", "$", "data", "[", "$",...
Recursively make a value safe for HTML @param mixed $data @return mixed
[ "Recursively", "make", "a", "value", "safe", "for", "HTML" ]
train
https://github.com/jinexus-framework/jinexus-mvc/blob/63937fecea4bc927b1ac9669fee5cf50278d28d3/src/View/AbstractView.php#L152-L177
jinexus-framework/jinexus-mvc
src/View/AbstractView.php
AbstractView.htmlDecode
public function htmlDecode($data) { switch (gettype($data)) { case 'array': foreach ($data as $key => $value) { $data[$key] = $this->htmlDecode($value); } break; case 'object': $data = clone $data; ...
php
public function htmlDecode($data) { switch (gettype($data)) { case 'array': foreach ($data as $key => $value) { $data[$key] = $this->htmlDecode($value); } break; case 'object': $data = clone $data; ...
[ "public", "function", "htmlDecode", "(", "$", "data", ")", "{", "switch", "(", "gettype", "(", "$", "data", ")", ")", "{", "case", "'array'", ":", "foreach", "(", "$", "data", "as", "$", "key", "=>", "$", "value", ")", "{", "$", "data", "[", "$",...
Recursively decode an HTML encoded value @param mixed $data @return mixed
[ "Recursively", "decode", "an", "HTML", "encoded", "value" ]
train
https://github.com/jinexus-framework/jinexus-mvc/blob/63937fecea4bc927b1ac9669fee5cf50278d28d3/src/View/AbstractView.php#L185-L210
jinexus-framework/jinexus-mvc
src/View/AbstractView.php
AbstractView.get
public function get($variable, $htmlEncode = true) { $value = null; if ( isset($this->variables[$variable]) ) { $value = $this->variables[$variable][$htmlEncode ? 'safe' : 'unsafe']; } return $value; }
php
public function get($variable, $htmlEncode = true) { $value = null; if ( isset($this->variables[$variable]) ) { $value = $this->variables[$variable][$htmlEncode ? 'safe' : 'unsafe']; } return $value; }
[ "public", "function", "get", "(", "$", "variable", ",", "$", "htmlEncode", "=", "true", ")", "{", "$", "value", "=", "null", ";", "if", "(", "isset", "(", "$", "this", "->", "variables", "[", "$", "variable", "]", ")", ")", "{", "$", "value", "="...
Get a view variable @param string $variable @param bool $htmlEncode @return mixed|null
[ "Get", "a", "view", "variable" ]
train
https://github.com/jinexus-framework/jinexus-mvc/blob/63937fecea4bc927b1ac9669fee5cf50278d28d3/src/View/AbstractView.php#L219-L228
jinexus-framework/jinexus-mvc
src/View/AbstractView.php
AbstractView.set
public function set($variable, $value = null) { $this->variables[$variable] = array( 'safe' => $this->htmlEncode($value), 'unsafe' => $value ); return $this; }
php
public function set($variable, $value = null) { $this->variables[$variable] = array( 'safe' => $this->htmlEncode($value), 'unsafe' => $value ); return $this; }
[ "public", "function", "set", "(", "$", "variable", ",", "$", "value", "=", "null", ")", "{", "$", "this", "->", "variables", "[", "$", "variable", "]", "=", "array", "(", "'safe'", "=>", "$", "this", "->", "htmlEncode", "(", "$", "value", ")", ",",...
Set a view variable @param string $variable @param mixed $value @return \JiNexus\Mvc\View\ViewInterface
[ "Set", "a", "view", "variable" ]
train
https://github.com/jinexus-framework/jinexus-mvc/blob/63937fecea4bc927b1ac9669fee5cf50278d28d3/src/View/AbstractView.php#L247-L255
jinexus-framework/jinexus-mvc
src/View/AbstractView.php
AbstractView.setVariables
public function setVariables($variables = []) { foreach ($variables as $variable => $value) { $this->set($variable, $value); } }
php
public function setVariables($variables = []) { foreach ($variables as $variable => $value) { $this->set($variable, $value); } }
[ "public", "function", "setVariables", "(", "$", "variables", "=", "[", "]", ")", "{", "foreach", "(", "$", "variables", "as", "$", "variable", "=>", "$", "value", ")", "{", "$", "this", "->", "set", "(", "$", "variable", ",", "$", "value", ")", ";"...
Set all variables @param array $variables
[ "Set", "all", "variables" ]
train
https://github.com/jinexus-framework/jinexus-mvc/blob/63937fecea4bc927b1ac9669fee5cf50278d28d3/src/View/AbstractView.php#L262-L267
jinexus-framework/jinexus-mvc
src/View/AbstractView.php
AbstractView.render
public function render($file = '') { $viewManager = $this->config->get('view_manager'); if ($viewManager['template_path_stack']) { $file = $viewManager['template_path_stack'] . '/' . $file; } $fileInfo = pathinfo($file); if (! isset($fileInfo['extension']) || $f...
php
public function render($file = '') { $viewManager = $this->config->get('view_manager'); if ($viewManager['template_path_stack']) { $file = $viewManager['template_path_stack'] . '/' . $file; } $fileInfo = pathinfo($file); if (! isset($fileInfo['extension']) || $f...
[ "public", "function", "render", "(", "$", "file", "=", "''", ")", "{", "$", "viewManager", "=", "$", "this", "->", "config", "->", "get", "(", "'view_manager'", ")", ";", "if", "(", "$", "viewManager", "[", "'template_path_stack'", "]", ")", "{", "$", ...
Render a file @param string $file @throws Exception
[ "Render", "a", "file" ]
train
https://github.com/jinexus-framework/jinexus-mvc/blob/63937fecea4bc927b1ac9669fee5cf50278d28d3/src/View/AbstractView.php#L275-L299
controlabs/routify
src/Routify/RouteGroup.php
RouteGroup.path
public function path() { $clean = function($v) { return str_replace('/', '', $v); }; return join( '/', array_map($clean, $this->groups) ); }
php
public function path() { $clean = function($v) { return str_replace('/', '', $v); }; return join( '/', array_map($clean, $this->groups) ); }
[ "public", "function", "path", "(", ")", "{", "$", "clean", "=", "function", "(", "$", "v", ")", "{", "return", "str_replace", "(", "'/'", ",", "''", ",", "$", "v", ")", ";", "}", ";", "return", "join", "(", "'/'", ",", "array_map", "(", "$", "c...
Returns a complete path @return string
[ "Returns", "a", "complete", "path" ]
train
https://github.com/controlabs/routify/blob/a4e92000fc61ddc7f297984ef9924b6d9df508a4/src/Routify/RouteGroup.php#L41-L51
webforge-labs/psc-cms
lib/Psc/DependencyManager.php
DependencyManager.enqueue
public function enqueue($alias) { if (in_array($alias, $this->ignored)) return $this; if (!array_key_exists($alias, $this->files)) { $e = new DependencyException('Alias: '.$alias.' nicht gefunden. Wurde diese Datei mit register() geladen?'); $e->dependency = $alias; throw $e; } ...
php
public function enqueue($alias) { if (in_array($alias, $this->ignored)) return $this; if (!array_key_exists($alias, $this->files)) { $e = new DependencyException('Alias: '.$alias.' nicht gefunden. Wurde diese Datei mit register() geladen?'); $e->dependency = $alias; throw $e; } ...
[ "public", "function", "enqueue", "(", "$", "alias", ")", "{", "if", "(", "in_array", "(", "$", "alias", ",", "$", "this", "->", "ignored", ")", ")", "return", "$", "this", ";", "if", "(", "!", "array_key_exists", "(", "$", "alias", ",", "$", "this"...
Lädt eine Datei @param string $alias wie bei register() angegeben
[ "Lädt", "eine", "Datei" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/DependencyManager.php#L43-L66
webforge-labs/psc-cms
lib/Psc/DependencyManager.php
DependencyManager.register
public function register($file, $alias = NULL, Array $dependencies = array()) { if (!isset($alias)) $alias = $this->getAliasFromFile($file); $this->files[$alias] = array('name'=>$file, 'dependencies'=>$dependencies, 'sort'=>$this->sort ...
php
public function register($file, $alias = NULL, Array $dependencies = array()) { if (!isset($alias)) $alias = $this->getAliasFromFile($file); $this->files[$alias] = array('name'=>$file, 'dependencies'=>$dependencies, 'sort'=>$this->sort ...
[ "public", "function", "register", "(", "$", "file", ",", "$", "alias", "=", "NULL", ",", "Array", "$", "dependencies", "=", "array", "(", ")", ")", "{", "if", "(", "!", "isset", "(", "$", "alias", ")", ")", "$", "alias", "=", "$", "this", "->", ...
Registriert eine Datei (unter einem Alias) diese Datei kann dann mit enqueue() geladen werden @param string $file @param string $alias @param array $dependencies ein Array mit Aliases von dem diese Datei abhängt (die mitgeladen werden, wenn diese Datei mit enqueue() geladen wird)
[ "Registriert", "eine", "Datei", "(", "unter", "einem", "Alias", ")" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/DependencyManager.php#L91-L101
webforge-labs/psc-cms
lib/Psc/DependencyManager.php
DependencyManager.unregister
public function unregister($alias) { // unregister unset($this->files[$alias]); // aus queued entfernen $key = array_search($alias, $this->enqueued); if ($key !== FALSE) { unset($this->enqueued[$key]); } return $this; }
php
public function unregister($alias) { // unregister unset($this->files[$alias]); // aus queued entfernen $key = array_search($alias, $this->enqueued); if ($key !== FALSE) { unset($this->enqueued[$key]); } return $this; }
[ "public", "function", "unregister", "(", "$", "alias", ")", "{", "// unregister", "unset", "(", "$", "this", "->", "files", "[", "$", "alias", "]", ")", ";", "// aus queued entfernen", "$", "key", "=", "array_search", "(", "$", "alias", ",", "$", "this",...
Entfernt eine registrierte Datei @param string $alias wie bei register() angegeben
[ "Entfernt", "eine", "registrierte", "Datei" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/DependencyManager.php#L108-L118
webforge-labs/psc-cms
lib/Psc/DependencyManager.php
DependencyException.setInfo
public function setInfo($string) { $this->info = $string; $this->message = sprintf($this->newMessage, $this->item, $this->info, $this->dependency); }
php
public function setInfo($string) { $this->info = $string; $this->message = sprintf($this->newMessage, $this->item, $this->info, $this->dependency); }
[ "public", "function", "setInfo", "(", "$", "string", ")", "{", "$", "this", "->", "info", "=", "$", "string", ";", "$", "this", "->", "message", "=", "sprintf", "(", "$", "this", "->", "newMessage", ",", "$", "this", "->", "item", ",", "$", "this",...
Die Information welche Abhängigkeiten das $item zu welchen Libraries hat
[ "Die", "Information", "welche", "Abhängigkeiten", "das", "$item", "zu", "welchen", "Libraries", "hat" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/DependencyManager.php#L169-L173
christianblos/markdown2html
src/Theme/Theme.php
Theme.createNavItems
protected function createNavItems(array $treeItems, NavItem $parent = null) { /** @var NavItem[] $navItems */ $navItems = []; foreach ($treeItems as $treeItem) { if ($treeItem->isAsset) { continue; } $nav = $this->createNavItem($treeItem,...
php
protected function createNavItems(array $treeItems, NavItem $parent = null) { /** @var NavItem[] $navItems */ $navItems = []; foreach ($treeItems as $treeItem) { if ($treeItem->isAsset) { continue; } $nav = $this->createNavItem($treeItem,...
[ "protected", "function", "createNavItems", "(", "array", "$", "treeItems", ",", "NavItem", "$", "parent", "=", "null", ")", "{", "/** @var NavItem[] $navItems */", "$", "navItems", "=", "[", "]", ";", "foreach", "(", "$", "treeItems", "as", "$", "treeItem", ...
@param TreeItem[] $treeItems @param NavItem $parent @return NavItem[]
[ "@param", "TreeItem", "[]", "$treeItems", "@param", "NavItem", "$parent" ]
train
https://github.com/christianblos/markdown2html/blob/2ae1177d71fe313c802962dbb9226b5a90bbc65a/src/Theme/Theme.php#L158-L179
christianblos/markdown2html
src/Theme/Theme.php
Theme.createNavItem
protected function createNavItem(TreeItem $treeItem, NavItem $parent = null) { // don't create navi entry for index page if ($parent === null && basename($treeItem->src) === 'index.md') { return null; } $nav = new NavItem(); $nav->id = $treeItem->getI...
php
protected function createNavItem(TreeItem $treeItem, NavItem $parent = null) { // don't create navi entry for index page if ($parent === null && basename($treeItem->src) === 'index.md') { return null; } $nav = new NavItem(); $nav->id = $treeItem->getI...
[ "protected", "function", "createNavItem", "(", "TreeItem", "$", "treeItem", ",", "NavItem", "$", "parent", "=", "null", ")", "{", "// don't create navi entry for index page", "if", "(", "$", "parent", "===", "null", "&&", "basename", "(", "$", "treeItem", "->", ...
@param TreeItem $treeItem @param NavItem $parent @return NavItem
[ "@param", "TreeItem", "$treeItem", "@param", "NavItem", "$parent" ]
train
https://github.com/christianblos/markdown2html/blob/2ae1177d71fe313c802962dbb9226b5a90bbc65a/src/Theme/Theme.php#L187-L210
christianblos/markdown2html
src/Theme/Theme.php
Theme.getPreviousNavItemOf
protected function getPreviousNavItemOf(NavItem $current) { $siblings = $current->parent ? $current->parent->children : $this->navItems; $last = $current->parent; foreach ($siblings as $sibling) { if ($sibling->id === $current->id) { return $last; ...
php
protected function getPreviousNavItemOf(NavItem $current) { $siblings = $current->parent ? $current->parent->children : $this->navItems; $last = $current->parent; foreach ($siblings as $sibling) { if ($sibling->id === $current->id) { return $last; ...
[ "protected", "function", "getPreviousNavItemOf", "(", "NavItem", "$", "current", ")", "{", "$", "siblings", "=", "$", "current", "->", "parent", "?", "$", "current", "->", "parent", "->", "children", ":", "$", "this", "->", "navItems", ";", "$", "last", ...
@param NavItem $current @return NavItem|null
[ "@param", "NavItem", "$current" ]
train
https://github.com/christianblos/markdown2html/blob/2ae1177d71fe313c802962dbb9226b5a90bbc65a/src/Theme/Theme.php#L217-L231
christianblos/markdown2html
src/Theme/Theme.php
Theme.getNextNavItemOf
public function getNextNavItemOf(NavItem $current) { $siblings = $current->parent ? $current->parent->children : $this->navItems; $found = false; foreach ($siblings as $sibling) { if ($found) { return $sibling; } if ($sibling->id === $...
php
public function getNextNavItemOf(NavItem $current) { $siblings = $current->parent ? $current->parent->children : $this->navItems; $found = false; foreach ($siblings as $sibling) { if ($found) { return $sibling; } if ($sibling->id === $...
[ "public", "function", "getNextNavItemOf", "(", "NavItem", "$", "current", ")", "{", "$", "siblings", "=", "$", "current", "->", "parent", "?", "$", "current", "->", "parent", "->", "children", ":", "$", "this", "->", "navItems", ";", "$", "found", "=", ...
@param NavItem $current @return NavItem|null
[ "@param", "NavItem", "$current" ]
train
https://github.com/christianblos/markdown2html/blob/2ae1177d71fe313c802962dbb9226b5a90bbc65a/src/Theme/Theme.php#L238-L254
ClanCats/Core
src/bundles/UI/Form.php
Form.start
public static function start( $key, $attr = array() ) { $attributes = array(); // force the form role $attributes['role'] = 'form'; if ( !is_null( $key ) ) { static::$id_prefix = $attributes['id'] = static::form_id( 'form', $key ); } $attributes = array_merge( $attributes, $attr ); return '<for...
php
public static function start( $key, $attr = array() ) { $attributes = array(); // force the form role $attributes['role'] = 'form'; if ( !is_null( $key ) ) { static::$id_prefix = $attributes['id'] = static::form_id( 'form', $key ); } $attributes = array_merge( $attributes, $attr ); return '<for...
[ "public", "static", "function", "start", "(", "$", "key", ",", "$", "attr", "=", "array", "(", ")", ")", "{", "$", "attributes", "=", "array", "(", ")", ";", "// force the form role", "$", "attributes", "[", "'role'", "]", "=", "'form'", ";", "if", "...
Open a new form This will set the current form to this one @param string $key @param array $attr @return string
[ "Open", "a", "new", "form", "This", "will", "set", "the", "current", "form", "to", "this", "one" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/UI/Form.php#L64-L79
ClanCats/Core
src/bundles/UI/Form.php
Form.capture
public static function capture( $callback = null, $key = null, $attr = null ) { // we got some dynamics in the parameters here so in case // of this shift stuff if ( is_callable( $attr ) && !is_callable( $callback ) ) { $new_attr = $key; $key = $callback; $callback = $attr; $attr = $new_attr; }...
php
public static function capture( $callback = null, $key = null, $attr = null ) { // we got some dynamics in the parameters here so in case // of this shift stuff if ( is_callable( $attr ) && !is_callable( $callback ) ) { $new_attr = $key; $key = $callback; $callback = $attr; $attr = $new_attr; }...
[ "public", "static", "function", "capture", "(", "$", "callback", "=", "null", ",", "$", "key", "=", "null", ",", "$", "attr", "=", "null", ")", "{", "// we got some dynamics in the parameters here so in case", "// of this shift stuff", "if", "(", "is_callable", "(...
Create a new from instance @param callback $callback @param string $key The form key used for identification. @param array $attr The form dom attributes. @return UI\Form
[ "Create", "a", "new", "from", "instance" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/UI/Form.php#L101-L127
ClanCats/Core
src/bundles/UI/Form.php
Form.build_id
public static function build_id( $type, $name ) { if ( !is_null( static::$id_prefix ) ) { return static::$id_prefix.'-'.static::form_id( $type, $name ); } return static::form_id( $type, $name ); }
php
public static function build_id( $type, $name ) { if ( !is_null( static::$id_prefix ) ) { return static::$id_prefix.'-'.static::form_id( $type, $name ); } return static::form_id( $type, $name ); }
[ "public", "static", "function", "build_id", "(", "$", "type", ",", "$", "name", ")", "{", "if", "(", "!", "is_null", "(", "static", "::", "$", "id_prefix", ")", ")", "{", "return", "static", "::", "$", "id_prefix", ".", "'-'", ".", "static", "::", ...
Format an id by configartion with the current form prefix @param string $type element, form etc.. @param strgin $name @return string
[ "Format", "an", "id", "by", "configartion", "with", "the", "current", "form", "prefix" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/UI/Form.php#L148-L155
ClanCats/Core
src/bundles/UI/Form.php
Form.make_input
public static function make_input( $id, $key, $value = null, $type = 'text', $attr = array() ) { $element = HTML::tag( 'input', array_merge( array( 'id' => $id, 'name' => $key, 'type' => $type ), $attr )); if ( !is_null( $value ) ) { $element->value( _e( $value ) ); } if ( !static::$buil...
php
public static function make_input( $id, $key, $value = null, $type = 'text', $attr = array() ) { $element = HTML::tag( 'input', array_merge( array( 'id' => $id, 'name' => $key, 'type' => $type ), $attr )); if ( !is_null( $value ) ) { $element->value( _e( $value ) ); } if ( !static::$buil...
[ "public", "static", "function", "make_input", "(", "$", "id", ",", "$", "key", ",", "$", "value", "=", "null", ",", "$", "type", "=", "'text'", ",", "$", "attr", "=", "array", "(", ")", ")", "{", "$", "element", "=", "HTML", "::", "tag", "(", "...
make an input @param string $id The id that has been generated for us. @param string $key This is the name @param string $type @param array $attr
[ "make", "an", "input" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/UI/Form.php#L204-L223
ClanCats/Core
src/bundles/UI/Form.php
Form.make_label
public static function make_label( $id, $key, $text = null, $attr = array() ) { if ( is_null( $text ) ) { $text = $key; } $element = HTML::tag( 'label', $text, array_merge( array( 'id' => $id, 'for' => static::build_id( 'input', $key ) ), $attr )); if ( !static::$builder_enabled ) { re...
php
public static function make_label( $id, $key, $text = null, $attr = array() ) { if ( is_null( $text ) ) { $text = $key; } $element = HTML::tag( 'label', $text, array_merge( array( 'id' => $id, 'for' => static::build_id( 'input', $key ) ), $attr )); if ( !static::$builder_enabled ) { re...
[ "public", "static", "function", "make_label", "(", "$", "id", ",", "$", "key", ",", "$", "text", "=", "null", ",", "$", "attr", "=", "array", "(", ")", ")", "{", "if", "(", "is_null", "(", "$", "text", ")", ")", "{", "$", "text", "=", "$", "k...
make a label @param string $id The id that has been generated for us. @param string $key This is the name @param string $text @param array $attr
[ "make", "a", "label" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/UI/Form.php#L233-L251
ClanCats/Core
src/bundles/UI/Form.php
Form.make_checkbox
public static function make_checkbox( $id, $key, $text = '', $active = false, $attr = array() ) { $element = HTML::tag( 'input', array_merge( array( 'id' => $id, 'name' => $key, 'type' => 'checkbox' ), $attr )); $element->checked( (bool) $active ); $element = HTML::tag( 'label', $element->render...
php
public static function make_checkbox( $id, $key, $text = '', $active = false, $attr = array() ) { $element = HTML::tag( 'input', array_merge( array( 'id' => $id, 'name' => $key, 'type' => 'checkbox' ), $attr )); $element->checked( (bool) $active ); $element = HTML::tag( 'label', $element->render...
[ "public", "static", "function", "make_checkbox", "(", "$", "id", ",", "$", "key", ",", "$", "text", "=", "''", ",", "$", "active", "=", "false", ",", "$", "attr", "=", "array", "(", ")", ")", "{", "$", "element", "=", "HTML", "::", "tag", "(", ...
make a checkbox @param string $id The id that has been generated for us. @param string $key This is the name @param string $text @param bool $active Is the checkbox cheked @param array $attr @return string
[ "make", "a", "checkbox" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/UI/Form.php#L263-L281
ClanCats/Core
src/bundles/UI/Form.php
Form.make_textarea
public static function make_textarea( $id, $key, $value = '', $attr = array() ) { $element = HTML::tag( 'textarea', _e( $value ), array_merge( array( 'id' => $id, 'name' => $key, ), $attr )); if ( !static::$builder_enabled ) { return $element; } return Builder::handle( 'form_textarea', $elem...
php
public static function make_textarea( $id, $key, $value = '', $attr = array() ) { $element = HTML::tag( 'textarea', _e( $value ), array_merge( array( 'id' => $id, 'name' => $key, ), $attr )); if ( !static::$builder_enabled ) { return $element; } return Builder::handle( 'form_textarea', $elem...
[ "public", "static", "function", "make_textarea", "(", "$", "id", ",", "$", "key", ",", "$", "value", "=", "''", ",", "$", "attr", "=", "array", "(", ")", ")", "{", "$", "element", "=", "HTML", "::", "tag", "(", "'textarea'", ",", "_e", "(", "$", ...
generate a textarea @param string $id The id that has been generated for us. @param string $key This is the name @param string $value @param array $attr @return string
[ "generate", "a", "textarea" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/UI/Form.php#L292-L305
ClanCats/Core
src/bundles/UI/Form.php
Form.make_select
public static function make_select( $id, $name, array $options, $selected = array(), $size = 1 ) { if ( !is_array( $selected ) ) { $selected = array( $selected ); } $buffer = ""; foreach( $options as $key => $option ) { if ( ! ( $option instanceof HTML ) ) { $option = HTML::tag( 'option',...
php
public static function make_select( $id, $name, array $options, $selected = array(), $size = 1 ) { if ( !is_array( $selected ) ) { $selected = array( $selected ); } $buffer = ""; foreach( $options as $key => $option ) { if ( ! ( $option instanceof HTML ) ) { $option = HTML::tag( 'option',...
[ "public", "static", "function", "make_select", "(", "$", "id", ",", "$", "name", ",", "array", "$", "options", ",", "$", "selected", "=", "array", "(", ")", ",", "$", "size", "=", "1", ")", "{", "if", "(", "!", "is_array", "(", "$", "selected", "...
generate an select Form::select( 'gender', array( 'F', 'M' ), 0 ); Form::select( 'gender', array( '1' => 'A', '2' => 'B' ), array( 1,2 ), 2 ); @param string $id The id that has been generated for us. @param string $name This is the name @param array $options @param array $selected @param int $size @return s...
[ "generate", "an", "select" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/UI/Form.php#L334-L371
iocaste/microservice-foundation
src/Command/Command.php
Command.logOutput
protected function logOutput($output, $type = 'info', $context = [], $toConsole = true, $toLog = true) { if ($toConsole) { $this->{$type}(' ' . $output); } $type = ($type === 'line') ? 'info' : $type; if ($toLog) { app('log')->$type($output, $context); ...
php
protected function logOutput($output, $type = 'info', $context = [], $toConsole = true, $toLog = true) { if ($toConsole) { $this->{$type}(' ' . $output); } $type = ($type === 'line') ? 'info' : $type; if ($toLog) { app('log')->$type($output, $context); ...
[ "protected", "function", "logOutput", "(", "$", "output", ",", "$", "type", "=", "'info'", ",", "$", "context", "=", "[", "]", ",", "$", "toConsole", "=", "true", ",", "$", "toLog", "=", "true", ")", "{", "if", "(", "$", "toConsole", ")", "{", "$...
@param $output @param string $type @param array $context @param bool $toConsole @param bool $toLog @return void
[ "@param", "$output", "@param", "string", "$type", "@param", "array", "$context", "@param", "bool", "$toConsole", "@param", "bool", "$toLog" ]
train
https://github.com/iocaste/microservice-foundation/blob/274a154de4299e8a57314bab972e09f6d8cdae9e/src/Command/Command.php#L21-L32
boekkooi/tactician-amqp
src/Middleware/RemoteResponseMiddleware.php
RemoteResponseMiddleware.execute
public function execute($command, callable $next) { // Check that the command expects a response if (!$command instanceof Command || empty($command->getEnvelope()->getReplyTo())) { return $next($command); } // Execute command $result = $next($command); /...
php
public function execute($command, callable $next) { // Check that the command expects a response if (!$command instanceof Command || empty($command->getEnvelope()->getReplyTo())) { return $next($command); } // Execute command $result = $next($command); /...
[ "public", "function", "execute", "(", "$", "command", ",", "callable", "$", "next", ")", "{", "// Check that the command expects a response", "if", "(", "!", "$", "command", "instanceof", "Command", "||", "empty", "(", "$", "command", "->", "getEnvelope", "(", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/boekkooi/tactician-amqp/blob/55cbb8b9e20aab7891e6a6090b248377c599360e/src/Middleware/RemoteResponseMiddleware.php#L28-L46
flipboxstudio/orm-manager
src/Flipbox/OrmManager/BothRelations/OneToOne.php
OneToOne.buildRelations
public function buildRelations() { $this->command->buildMethod($this->model, 'hasOne', $this->toModel, $this->options); $this->command->buildMethod($this->toModel, 'belongsTo', $this->model, $this->options); }
php
public function buildRelations() { $this->command->buildMethod($this->model, 'hasOne', $this->toModel, $this->options); $this->command->buildMethod($this->toModel, 'belongsTo', $this->model, $this->options); }
[ "public", "function", "buildRelations", "(", ")", "{", "$", "this", "->", "command", "->", "buildMethod", "(", "$", "this", "->", "model", ",", "'hasOne'", ",", "$", "this", "->", "toModel", ",", "$", "this", "->", "options", ")", ";", "$", "this", "...
build relations between models @return void
[ "build", "relations", "between", "models" ]
train
https://github.com/flipboxstudio/orm-manager/blob/4288426517f53d05177b8729c4ba94c5beca9a98/src/Flipbox/OrmManager/BothRelations/OneToOne.php#L98-L102
rayrutjes/domain-foundation
src/Persistence/Pdo/EventStore/PdoReadRecordEventStream.php
PdoReadRecordEventStream.translateRecordIntoEventMessage
private function translateRecordIntoEventMessage(array $record) { $identifier = new MessageIdentifier($record['event_id']); $payload = $this->eventSerializer->deserializePayload( $record['event_payload'], Contract::createFromClassName($record['event_payload_type']) )...
php
private function translateRecordIntoEventMessage(array $record) { $identifier = new MessageIdentifier($record['event_id']); $payload = $this->eventSerializer->deserializePayload( $record['event_payload'], Contract::createFromClassName($record['event_payload_type']) )...
[ "private", "function", "translateRecordIntoEventMessage", "(", "array", "$", "record", ")", "{", "$", "identifier", "=", "new", "MessageIdentifier", "(", "$", "record", "[", "'event_id'", "]", ")", ";", "$", "payload", "=", "$", "this", "->", "eventSerializer"...
@param array $record @return Event
[ "@param", "array", "$record" ]
train
https://github.com/rayrutjes/domain-foundation/blob/2bce7cd6a6612f718e70e3176589c1abf39d1a3e/src/Persistence/Pdo/EventStore/PdoReadRecordEventStream.php#L74-L93
neos/doctools
Classes/Command/ReferenceCommandController.php
ReferenceCommandController.renderCollectionCommand
public function renderCollectionCommand($collection) { if (!isset($this->settings['collections'][$collection])) { $this->outputLine('Collection "%s" is not configured', [$collection]); $this->quit(1); } if (!isset($this->settings['collections'][$collection]['reference...
php
public function renderCollectionCommand($collection) { if (!isset($this->settings['collections'][$collection])) { $this->outputLine('Collection "%s" is not configured', [$collection]); $this->quit(1); } if (!isset($this->settings['collections'][$collection]['reference...
[ "public", "function", "renderCollectionCommand", "(", "$", "collection", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "settings", "[", "'collections'", "]", "[", "$", "collection", "]", ")", ")", "{", "$", "this", "->", "outputLine", "(", ...
Renders a configured collection of reference documentation from source code. @param string $collection to render (typically the name of a package). @return void @throws \Neos\Flow\Mvc\Exception\StopActionException @throws \Neos\FluidAdaptor\Exception @throws \Neos\Flow\Reflection\Exception\ClassLoadingForReflectionFai...
[ "Renders", "a", "configured", "collection", "of", "reference", "documentation", "from", "source", "code", "." ]
train
https://github.com/neos/doctools/blob/726981245a8d59319ee594a582f80a30256df98b/Classes/Command/ReferenceCommandController.php#L71-L83
neos/doctools
Classes/Command/ReferenceCommandController.php
ReferenceCommandController.renderReference
protected function renderReference($reference) { if (!isset($this->settings['references'][$reference])) { $this->outputLine('Reference "%s" is not configured', [$reference]); $this->quit(1); } $referenceConfiguration = $this->settings['references'][$reference]; ...
php
protected function renderReference($reference) { if (!isset($this->settings['references'][$reference])) { $this->outputLine('Reference "%s" is not configured', [$reference]); $this->quit(1); } $referenceConfiguration = $this->settings['references'][$reference]; ...
[ "protected", "function", "renderReference", "(", "$", "reference", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "settings", "[", "'references'", "]", "[", "$", "reference", "]", ")", ")", "{", "$", "this", "->", "outputLine", "(", "'Refer...
Render a reference to reStructuredText. @param string $reference @return void @throws \Neos\Flow\Mvc\Exception\StopActionException @throws \Neos\FluidAdaptor\Exception @throws \Neos\Flow\Reflection\Exception\ClassLoadingForReflectionFailedException
[ "Render", "a", "reference", "to", "reStructuredText", "." ]
train
https://github.com/neos/doctools/blob/726981245a8d59319ee594a582f80a30256df98b/Classes/Command/ReferenceCommandController.php#L111-L141
accgit/single-web
src/Single/Single.php
Single.flashMessage
public function flashMessage($message) { $sessions = $this->getSessions()->getSessionSection('flash.message'); $sessions->message = $message; $sessions->setExpiration('5 second'); return $sessions->message; }
php
public function flashMessage($message) { $sessions = $this->getSessions()->getSessionSection('flash.message'); $sessions->message = $message; $sessions->setExpiration('5 second'); return $sessions->message; }
[ "public", "function", "flashMessage", "(", "$", "message", ")", "{", "$", "sessions", "=", "$", "this", "->", "getSessions", "(", ")", "->", "getSessionSection", "(", "'flash.message'", ")", ";", "$", "sessions", "->", "message", "=", "$", "message", ";", ...
Create flash message. @param string $message @return string
[ "Create", "flash", "message", "." ]
train
https://github.com/accgit/single-web/blob/5d0dce3313df9e22ab60749bcf01f1753de8c143/src/Single/Single.php#L49-L55
askupasoftware/amarkal
UI/Components/Slider/controller.php
Slider.validate
public function validate( $value, &$error ) { $error = 'Invalid slider range for '.$this->get_name(); if( 'range' == $this->type ) { return is_numeric($value[0]) && is_numeric($value[1]) && ( intval($value[0]) <= intval($value[1]) ); } else { r...
php
public function validate( $value, &$error ) { $error = 'Invalid slider range for '.$this->get_name(); if( 'range' == $this->type ) { return is_numeric($value[0]) && is_numeric($value[1]) && ( intval($value[0]) <= intval($value[1]) ); } else { r...
[ "public", "function", "validate", "(", "$", "value", ",", "&", "$", "error", ")", "{", "$", "error", "=", "'Invalid slider range for '", ".", "$", "this", "->", "get_name", "(", ")", ";", "if", "(", "'range'", "==", "$", "this", "->", "type", ")", "{...
{@inheritdoc}
[ "{" ]
train
https://github.com/askupasoftware/amarkal/blob/fe8283e2d6847ef697abec832da7ee741a85058c/UI/Components/Slider/controller.php#L106-L117
kattsoftware/phassets
src/Phassets/Factory.php
Factory.buildLogger
public function buildLogger($class, Configurator $configurator) { if (!class_exists($class) || !is_subclass_of($class, Logger::class)) { $class = "\\Phassets\\Loggers\\$class"; } if (class_exists($class) && is_subclass_of($class, Logger::class)) { return new $class($...
php
public function buildLogger($class, Configurator $configurator) { if (!class_exists($class) || !is_subclass_of($class, Logger::class)) { $class = "\\Phassets\\Loggers\\$class"; } if (class_exists($class) && is_subclass_of($class, Logger::class)) { return new $class($...
[ "public", "function", "buildLogger", "(", "$", "class", ",", "Configurator", "$", "configurator", ")", "{", "if", "(", "!", "class_exists", "(", "$", "class", ")", "||", "!", "is_subclass_of", "(", "$", "class", ",", "Logger", "::", "class", ")", ")", ...
Creates a Logger instance. @param string $class Fully qualified class name of a Logger class @param Configurator $configurator Currently used Configurator of Phassets @return bool|Logger Created instance of the provided Logger; false on failure
[ "Creates", "a", "Logger", "instance", "." ]
train
https://github.com/kattsoftware/phassets/blob/cc982cf1941eb5776287d64f027218bd4835ed2b/src/Phassets/Factory.php#L50-L61
kattsoftware/phassets
src/Phassets/Factory.php
Factory.buildCacheAdapter
public function buildCacheAdapter($class, Configurator $configurator) { if (!class_exists($class) || !is_subclass_of($class, CacheAdapter::class)) { $class = "\\Phassets\\CacheAdapters\\$class"; } if (class_exists($class) && is_subclass_of($class, CacheAdapter::class)) { ...
php
public function buildCacheAdapter($class, Configurator $configurator) { if (!class_exists($class) || !is_subclass_of($class, CacheAdapter::class)) { $class = "\\Phassets\\CacheAdapters\\$class"; } if (class_exists($class) && is_subclass_of($class, CacheAdapter::class)) { ...
[ "public", "function", "buildCacheAdapter", "(", "$", "class", ",", "Configurator", "$", "configurator", ")", "{", "if", "(", "!", "class_exists", "(", "$", "class", ")", "||", "!", "is_subclass_of", "(", "$", "class", ",", "CacheAdapter", "::", "class", ")...
Creates a CacheAdapter instance. @param string $class Fully qualified class name of a CacheAdapter class @param Configurator $configurator Currently used Configurator of Phassets @return bool|CacheAdapter Created instance of the provided CacheAdapter; false on failure
[ "Creates", "a", "CacheAdapter", "instance", "." ]
train
https://github.com/kattsoftware/phassets/blob/cc982cf1941eb5776287d64f027218bd4835ed2b/src/Phassets/Factory.php#L71-L82
kattsoftware/phassets
src/Phassets/Factory.php
Factory.buildDeployer
public function buildDeployer($class, Configurator $configurator, CacheAdapter $cacheAdapter) { if (!class_exists($class) || !is_subclass_of($class, Deployer::class)) { $class = "\\Phassets\\Deployers\\$class"; } if (class_exists($class) && is_subclass_of($class, Deployer::class...
php
public function buildDeployer($class, Configurator $configurator, CacheAdapter $cacheAdapter) { if (!class_exists($class) || !is_subclass_of($class, Deployer::class)) { $class = "\\Phassets\\Deployers\\$class"; } if (class_exists($class) && is_subclass_of($class, Deployer::class...
[ "public", "function", "buildDeployer", "(", "$", "class", ",", "Configurator", "$", "configurator", ",", "CacheAdapter", "$", "cacheAdapter", ")", "{", "if", "(", "!", "class_exists", "(", "$", "class", ")", "||", "!", "is_subclass_of", "(", "$", "class", ...
Creates a Deployer instance. @param string $class Fully qualified class name of a Deployer class @param Configurator $configurator Currently used Configurator of Phassets @param CacheAdapter $cacheAdapter Currently used CacheAdapter of Phassets @return Deployer|bool Created instance of the provided Deployer; false on...
[ "Creates", "a", "Deployer", "instance", "." ]
train
https://github.com/kattsoftware/phassets/blob/cc982cf1941eb5776287d64f027218bd4835ed2b/src/Phassets/Factory.php#L104-L115
kattsoftware/phassets
src/Phassets/Factory.php
Factory.buildFilter
public function buildFilter($class, Configurator $configurator) { if (!class_exists($class) || !is_subclass_of($class, Filter::class)) { $class = "\\Phassets\\Filters\\$class"; } if (class_exists($class) && is_subclass_of($class, Filter::class)) { return new $class($...
php
public function buildFilter($class, Configurator $configurator) { if (!class_exists($class) || !is_subclass_of($class, Filter::class)) { $class = "\\Phassets\\Filters\\$class"; } if (class_exists($class) && is_subclass_of($class, Filter::class)) { return new $class($...
[ "public", "function", "buildFilter", "(", "$", "class", ",", "Configurator", "$", "configurator", ")", "{", "if", "(", "!", "class_exists", "(", "$", "class", ")", "||", "!", "is_subclass_of", "(", "$", "class", ",", "Filter", "::", "class", ")", ")", ...
Creates a Filter instance. @param string $class Fully qualified class name of a Filter class @param Configurator $configurator Currently used Configurator of Phassets @return Filter|bool Created instance of the provided Filter; false on failure
[ "Creates", "a", "Filter", "instance", "." ]
train
https://github.com/kattsoftware/phassets/blob/cc982cf1941eb5776287d64f027218bd4835ed2b/src/Phassets/Factory.php#L125-L136
kattsoftware/phassets
src/Phassets/Factory.php
Factory.buildAssetsMerger
public function buildAssetsMerger($class, Configurator $configurator) { if (!class_exists($class) || !is_subclass_of($class, AssetsMerger::class)) { $class = "\\Phassets\\AssetsMergers\\$class"; } if (class_exists($class) && is_subclass_of($class, AssetsMerger::class)) { ...
php
public function buildAssetsMerger($class, Configurator $configurator) { if (!class_exists($class) || !is_subclass_of($class, AssetsMerger::class)) { $class = "\\Phassets\\AssetsMergers\\$class"; } if (class_exists($class) && is_subclass_of($class, AssetsMerger::class)) { ...
[ "public", "function", "buildAssetsMerger", "(", "$", "class", ",", "Configurator", "$", "configurator", ")", "{", "if", "(", "!", "class_exists", "(", "$", "class", ")", "||", "!", "is_subclass_of", "(", "$", "class", ",", "AssetsMerger", "::", "class", ")...
Creates an AssetsMerger instance. @param string $class Fully qualified class name of a AssetsMerger class @param Configurator $configurator Currently used Configurator of Phassets @return bool|AssetsMerger Created instance of the provided AssetsMerger; false on failure
[ "Creates", "an", "AssetsMerger", "instance", "." ]
train
https://github.com/kattsoftware/phassets/blob/cc982cf1941eb5776287d64f027218bd4835ed2b/src/Phassets/Factory.php#L166-L177
digitalkaoz/versioneye-php
src/Output/Products.php
Products.show
public function show(OutputInterface $output, array $response) { $this->printList($output, ['Name', 'Description', 'Source', 'Archive', 'Key', 'Type', 'License', 'Version', 'Group', 'Updated At'], ['name', 'description', 'links', 'archives', 'prod_key', 'prod_type', 'license_info', '...
php
public function show(OutputInterface $output, array $response) { $this->printList($output, ['Name', 'Description', 'Source', 'Archive', 'Key', 'Type', 'License', 'Version', 'Group', 'Updated At'], ['name', 'description', 'links', 'archives', 'prod_key', 'prod_type', 'license_info', '...
[ "public", "function", "show", "(", "OutputInterface", "$", "output", ",", "array", "$", "response", ")", "{", "$", "this", "->", "printList", "(", "$", "output", ",", "[", "'Name'", ",", "'Description'", ",", "'Source'", ",", "'Archive'", ",", "'Key'", "...
output for the show API. @param OutputInterface $output @param array $response
[ "output", "for", "the", "show", "API", "." ]
train
https://github.com/digitalkaoz/versioneye-php/blob/7b8eb9cdc83e01138dda0e709c07e3beb6aad136/src/Output/Products.php#L42-L68
digitalkaoz/versioneye-php
src/Output/Products.php
Products.versions
public function versions(OutputInterface $output, array $response) { $this->printList($output, ['Name', 'Language', 'Key', 'Type', 'Version'], ['name', 'language', 'prod_key', 'prod_type', 'version'], $response ); $this->printTable($output, ['...
php
public function versions(OutputInterface $output, array $response) { $this->printList($output, ['Name', 'Language', 'Key', 'Type', 'Version'], ['name', 'language', 'prod_key', 'prod_type', 'version'], $response ); $this->printTable($output, ['...
[ "public", "function", "versions", "(", "OutputInterface", "$", "output", ",", "array", "$", "response", ")", "{", "$", "this", "->", "printList", "(", "$", "output", ",", "[", "'Name'", ",", "'Language'", ",", "'Key'", ",", "'Type'", ",", "'Version'", "]...
output for the versions API. @param OutputInterface $output @param array $response
[ "output", "for", "the", "versions", "API", "." ]
train
https://github.com/digitalkaoz/versioneye-php/blob/7b8eb9cdc83e01138dda0e709c07e3beb6aad136/src/Output/Products.php#L109-L129
CakeCMS/Core
src/View/Helper/LessHelper.php
LessHelper.initialize
public function initialize(array $config) { $corePath = Plugin::path('Core') . Configure::read('App.webroot') . '/' . Configure::read('App.lessBaseUrl'); $cachePath = WWW_ROOT . Configure::read('App.cssBaseUrl') . Configure::read('App.cacheDir'); $this ->setConfig('root_path', ...
php
public function initialize(array $config) { $corePath = Plugin::path('Core') . Configure::read('App.webroot') . '/' . Configure::read('App.lessBaseUrl'); $cachePath = WWW_ROOT . Configure::read('App.cssBaseUrl') . Configure::read('App.cacheDir'); $this ->setConfig('root_path', ...
[ "public", "function", "initialize", "(", "array", "$", "config", ")", "{", "$", "corePath", "=", "Plugin", "::", "path", "(", "'Core'", ")", ".", "Configure", "::", "read", "(", "'App.webroot'", ")", ".", "'/'", ".", "Configure", "::", "read", "(", "'A...
Constructor hook method. @param array $config
[ "Constructor", "hook", "method", "." ]
train
https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/LessHelper.php#L50-L63
CakeCMS/Core
src/View/Helper/LessHelper.php
LessHelper.process
public function process($source, $force = true) { list ($webRoot, $source) = $this->_findWebRoot($source); $lessFile = FS::clean($webRoot . Configure::read('App.lessBaseUrl') . $source, '/'); $this->_setForce($force); $less = new Less($this->_config); if (!FS::isFile($lessF...
php
public function process($source, $force = true) { list ($webRoot, $source) = $this->_findWebRoot($source); $lessFile = FS::clean($webRoot . Configure::read('App.lessBaseUrl') . $source, '/'); $this->_setForce($force); $less = new Less($this->_config); if (!FS::isFile($lessF...
[ "public", "function", "process", "(", "$", "source", ",", "$", "force", "=", "true", ")", "{", "list", "(", "$", "webRoot", ",", "$", "source", ")", "=", "$", "this", "->", "_findWebRoot", "(", "$", "source", ")", ";", "$", "lessFile", "=", "FS", ...
Process less file. @param string $source @param bool $force @return string|null @throws \JBZoo\Less\Exception
[ "Process", "less", "file", "." ]
train
https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/LessHelper.php#L73-L99
CakeCMS/Core
src/View/Helper/LessHelper.php
LessHelper._compress
protected function _compress($code, $cacheId) { $code = (string) $code; // remove comments $code = preg_replace('#/\*[^*]*\*+([^/][^*]*\*+)*/#ius', '', $code); $code = str_replace( ["\r\n", "\r", "\n", "\t", ' ', ' ', ' {', '{ ', ' }', '; ', ';;', ';;;', ';;;;', ';}...
php
protected function _compress($code, $cacheId) { $code = (string) $code; // remove comments $code = preg_replace('#/\*[^*]*\*+([^/][^*]*\*+)*/#ius', '', $code); $code = str_replace( ["\r\n", "\r", "\n", "\t", ' ', ' ', ' {', '{ ', ' }', '; ', ';;', ';;;', ';;;;', ';}...
[ "protected", "function", "_compress", "(", "$", "code", ",", "$", "cacheId", ")", "{", "$", "code", "=", "(", "string", ")", "$", "code", ";", "// remove comments", "$", "code", "=", "preg_replace", "(", "'#/\\*[^*]*\\*+([^/][^*]*\\*+)*/#ius'", ",", "''", ",...
CSS compressing. @param string $code @param string $cacheId @return string
[ "CSS", "compressing", "." ]
train
https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/LessHelper.php#L108-L129
CakeCMS/Core
src/View/Helper/LessHelper.php
LessHelper._findWebRoot
protected function _findWebRoot($source) { $webRootDir = Configure::read('App.webroot'); $webRoot = APP_ROOT . DS . $webRootDir . DS; list ($plugin, $source) = $this->_View->pluginSplit($source); if ($plugin !== null && Plugin::loaded($plugin)) { $webRoot = Plugin::pa...
php
protected function _findWebRoot($source) { $webRootDir = Configure::read('App.webroot'); $webRoot = APP_ROOT . DS . $webRootDir . DS; list ($plugin, $source) = $this->_View->pluginSplit($source); if ($plugin !== null && Plugin::loaded($plugin)) { $webRoot = Plugin::pa...
[ "protected", "function", "_findWebRoot", "(", "$", "source", ")", "{", "$", "webRootDir", "=", "Configure", "::", "read", "(", "'App.webroot'", ")", ";", "$", "webRoot", "=", "APP_ROOT", ".", "DS", ".", "$", "webRootDir", ".", "DS", ";", "list", "(", "...
Find source webroot dir. @param string $source @return array
[ "Find", "source", "webroot", "dir", "." ]
train
https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/LessHelper.php#L137-L148
CakeCMS/Core
src/View/Helper/LessHelper.php
LessHelper._getPlgAssetUrl
protected function _getPlgAssetUrl($path) { $isPlugin = false; $plgPaths = Configure::read('App.paths.plugins'); foreach ($plgPaths as $plgPath) { $plgPath = ltrim(FS::clean($plgPath, '/'), '/'); if (preg_match('(' . quotemeta($plgPath) . ')', $path)) { ...
php
protected function _getPlgAssetUrl($path) { $isPlugin = false; $plgPaths = Configure::read('App.paths.plugins'); foreach ($plgPaths as $plgPath) { $plgPath = ltrim(FS::clean($plgPath, '/'), '/'); if (preg_match('(' . quotemeta($plgPath) . ')', $path)) { ...
[ "protected", "function", "_getPlgAssetUrl", "(", "$", "path", ")", "{", "$", "isPlugin", "=", "false", ";", "$", "plgPaths", "=", "Configure", "::", "read", "(", "'App.paths.plugins'", ")", ";", "foreach", "(", "$", "plgPaths", "as", "$", "plgPath", ")", ...
Get plugin asset url. @param string $path @return array
[ "Get", "plugin", "asset", "url", "." ]
train
https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/LessHelper.php#L167-L188
CakeCMS/Core
src/View/Helper/LessHelper.php
LessHelper._normalizeContent
protected function _normalizeContent($path, $fileHead) { $css = file_get_contents($path); if (!$this->_configRead('debug')) { $css = $this->_compress($css, $fileHead); } else { list ($first, $second) = explode(PHP_EOL, $css, 2); if (preg_match('(\/* cachei...
php
protected function _normalizeContent($path, $fileHead) { $css = file_get_contents($path); if (!$this->_configRead('debug')) { $css = $this->_compress($css, $fileHead); } else { list ($first, $second) = explode(PHP_EOL, $css, 2); if (preg_match('(\/* cachei...
[ "protected", "function", "_normalizeContent", "(", "$", "path", ",", "$", "fileHead", ")", "{", "$", "css", "=", "file_get_contents", "(", "$", "path", ")", ";", "if", "(", "!", "$", "this", "->", "_configRead", "(", "'debug'", ")", ")", "{", "$", "c...
Normalize style file. @param string $path @param string $fileHead @return mixed
[ "Normalize", "style", "file", "." ]
train
https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/LessHelper.php#L197-L212
CakeCMS/Core
src/View/Helper/LessHelper.php
LessHelper._normalizePlgAssetUrl
protected function _normalizePlgAssetUrl($path) { $details = explode('/', $path, 3); $pluginName = Inflector::camelize(trim($details[0], '/')); if (Plugin::loaded($pluginName)) { unset($details[0]); $source = $pluginName . '.' . ltrim(implode('/', $details), '/'); ...
php
protected function _normalizePlgAssetUrl($path) { $details = explode('/', $path, 3); $pluginName = Inflector::camelize(trim($details[0], '/')); if (Plugin::loaded($pluginName)) { unset($details[0]); $source = $pluginName . '.' . ltrim(implode('/', $details), '/'); ...
[ "protected", "function", "_normalizePlgAssetUrl", "(", "$", "path", ")", "{", "$", "details", "=", "explode", "(", "'/'", ",", "$", "path", ",", "3", ")", ";", "$", "pluginName", "=", "Inflector", "::", "camelize", "(", "trim", "(", "$", "details", "["...
Normalize plugin asset url. @param string $path @return string
[ "Normalize", "plugin", "asset", "url", "." ]
train
https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/LessHelper.php#L220-L232
CakeCMS/Core
src/View/Helper/LessHelper.php
LessHelper._replaceUrlCallback
protected function _replaceUrlCallback(array $match) { $assetPath = str_replace(Router::fullBaseUrl(), '', $match[2]); $assetPath = trim(FS::clean($assetPath, '/'), '/'); $appDir = trim(FS::clean(APP_ROOT, '/'), '/'); list ($isPlugin, $assetPath) = $this->_getPlgAssetUrl($assetPa...
php
protected function _replaceUrlCallback(array $match) { $assetPath = str_replace(Router::fullBaseUrl(), '', $match[2]); $assetPath = trim(FS::clean($assetPath, '/'), '/'); $appDir = trim(FS::clean(APP_ROOT, '/'), '/'); list ($isPlugin, $assetPath) = $this->_getPlgAssetUrl($assetPa...
[ "protected", "function", "_replaceUrlCallback", "(", "array", "$", "match", ")", "{", "$", "assetPath", "=", "str_replace", "(", "Router", "::", "fullBaseUrl", "(", ")", ",", "''", ",", "$", "match", "[", "2", "]", ")", ";", "$", "assetPath", "=", "tri...
Replace url callback. @param array $match @return string
[ "Replace", "url", "callback", "." ]
train
https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/LessHelper.php#L252-L272
CakeCMS/Core
src/View/Helper/LessHelper.php
LessHelper._write
protected function _write($path, $content) { $File = new File($path); $File->write($content); $File->exists(); }
php
protected function _write($path, $content) { $File = new File($path); $File->write($content); $File->exists(); }
[ "protected", "function", "_write", "(", "$", "path", ",", "$", "content", ")", "{", "$", "File", "=", "new", "File", "(", "$", "path", ")", ";", "$", "File", "->", "write", "(", "$", "content", ")", ";", "$", "File", "->", "exists", "(", ")", "...
Write content in to the file. @param string $path @param string $content @return void
[ "Write", "content", "in", "to", "the", "file", "." ]
train
https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/LessHelper.php#L294-L299
inc2734/wp-share-buttons
src/App/Contract/Shortcode/Button.php
Button._get_requester
protected function _get_requester() { $this_class = get_class( $this ); $this_class = explode( '\\', $this_class ); $this_class = array_pop( $this_class ); $requester_class = '\Inc2734\WP_Share_Buttons\App\Model\Requester\\' . $this_class; if ( ! class_exists( $requester_class ) ) { return; } return ...
php
protected function _get_requester() { $this_class = get_class( $this ); $this_class = explode( '\\', $this_class ); $this_class = array_pop( $this_class ); $requester_class = '\Inc2734\WP_Share_Buttons\App\Model\Requester\\' . $this_class; if ( ! class_exists( $requester_class ) ) { return; } return ...
[ "protected", "function", "_get_requester", "(", ")", "{", "$", "this_class", "=", "get_class", "(", "$", "this", ")", ";", "$", "this_class", "=", "explode", "(", "'\\\\'", ",", "$", "this_class", ")", ";", "$", "this_class", "=", "array_pop", "(", "$", ...
Return Requester class name @return string
[ "Return", "Requester", "class", "name" ]
train
https://github.com/inc2734/wp-share-buttons/blob/cd032893ca083a343f5871e855cce68f4ede3a17/src/App/Contract/Shortcode/Button.php#L43-L54
inc2734/wp-share-buttons
src/App/Contract/Shortcode/Button.php
Button.render
protected function render( $filepath, $vars ) { $filepath = __DIR__ . '/../../../view/' . $filepath . '.php'; if ( file_exists( $filepath ) ) { ob_start(); // @todo Using getter method // @codingStandardsIgnoreStart extract( $vars ); // @codingStandardsIgnoreEnd include( $filepath ); return ob_...
php
protected function render( $filepath, $vars ) { $filepath = __DIR__ . '/../../../view/' . $filepath . '.php'; if ( file_exists( $filepath ) ) { ob_start(); // @todo Using getter method // @codingStandardsIgnoreStart extract( $vars ); // @codingStandardsIgnoreEnd include( $filepath ); return ob_...
[ "protected", "function", "render", "(", "$", "filepath", ",", "$", "vars", ")", "{", "$", "filepath", "=", "__DIR__", ".", "'/../../../view/'", ".", "$", "filepath", ".", "'.php'", ";", "if", "(", "file_exists", "(", "$", "filepath", ")", ")", "{", "ob...
Load shortcode @param string $filepath @param array $vars @return string
[ "Load", "shortcode" ]
train
https://github.com/inc2734/wp-share-buttons/blob/cd032893ca083a343f5871e855cce68f4ede3a17/src/App/Contract/Shortcode/Button.php#L63-L74
yuncms/framework
src/notifications/models/DatabaseNotification.php
DatabaseNotification.getContent
public function getContent() { $params = $this->data->toArray(); $p = []; foreach ($params as $name => $value) { $p['{' . $name . '}'] = $value; } return strtr($this->template, $p); }
php
public function getContent() { $params = $this->data->toArray(); $p = []; foreach ($params as $name => $value) { $p['{' . $name . '}'] = $value; } return strtr($this->template, $p); }
[ "public", "function", "getContent", "(", ")", "{", "$", "params", "=", "$", "this", "->", "data", "->", "toArray", "(", ")", ";", "$", "p", "=", "[", "]", ";", "foreach", "(", "$", "params", "as", "$", "name", "=>", "$", "value", ")", "{", "$",...
获取详细内容 @return string
[ "获取详细内容" ]
train
https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/notifications/models/DatabaseNotification.php#L92-L100
factorio-item-browser/export-data
src/Registry/AbstractRegistry.php
AbstractRegistry.saveContent
protected function saveContent(string $hash, string $content): void { $this->adapter->save($this->namespace, $hash, $content); $this->cache[$hash] = $content; }
php
protected function saveContent(string $hash, string $content): void { $this->adapter->save($this->namespace, $hash, $content); $this->cache[$hash] = $content; }
[ "protected", "function", "saveContent", "(", "string", "$", "hash", ",", "string", "$", "content", ")", ":", "void", "{", "$", "this", "->", "adapter", "->", "save", "(", "$", "this", "->", "namespace", ",", "$", "hash", ",", "$", "content", ")", ";"...
Saves the specified content into the registry. @param string $hash @param string $content
[ "Saves", "the", "specified", "content", "into", "the", "registry", "." ]
train
https://github.com/factorio-item-browser/export-data/blob/1413b2eed0fbfed0521457ac7ef0d668ac30c212/src/Registry/AbstractRegistry.php#L51-L55
factorio-item-browser/export-data
src/Registry/AbstractRegistry.php
AbstractRegistry.loadContent
protected function loadContent(string $hash): ?string { if (!array_key_exists($hash, $this->cache)) { $content = $this->adapter->load($this->namespace, $hash); $this->cache[$hash] = is_string($content) ? $content : null; } return $this->cache[$hash]; }
php
protected function loadContent(string $hash): ?string { if (!array_key_exists($hash, $this->cache)) { $content = $this->adapter->load($this->namespace, $hash); $this->cache[$hash] = is_string($content) ? $content : null; } return $this->cache[$hash]; }
[ "protected", "function", "loadContent", "(", "string", "$", "hash", ")", ":", "?", "string", "{", "if", "(", "!", "array_key_exists", "(", "$", "hash", ",", "$", "this", "->", "cache", ")", ")", "{", "$", "content", "=", "$", "this", "->", "adapter",...
Loads the content with the specified hash from the registry. @param string $hash @return string|null
[ "Loads", "the", "content", "with", "the", "specified", "hash", "from", "the", "registry", "." ]
train
https://github.com/factorio-item-browser/export-data/blob/1413b2eed0fbfed0521457ac7ef0d668ac30c212/src/Registry/AbstractRegistry.php#L62-L69
factorio-item-browser/export-data
src/Registry/AbstractRegistry.php
AbstractRegistry.deleteContent
protected function deleteContent(string $hash): void { $this->adapter->delete($this->namespace, $hash); unset($this->cache[$hash]); }
php
protected function deleteContent(string $hash): void { $this->adapter->delete($this->namespace, $hash); unset($this->cache[$hash]); }
[ "protected", "function", "deleteContent", "(", "string", "$", "hash", ")", ":", "void", "{", "$", "this", "->", "adapter", "->", "delete", "(", "$", "this", "->", "namespace", ",", "$", "hash", ")", ";", "unset", "(", "$", "this", "->", "cache", "[",...
Deletes the content with the specified hash from the registry. @param string $hash
[ "Deletes", "the", "content", "with", "the", "specified", "hash", "from", "the", "registry", "." ]
train
https://github.com/factorio-item-browser/export-data/blob/1413b2eed0fbfed0521457ac7ef0d668ac30c212/src/Registry/AbstractRegistry.php#L75-L79
factorio-item-browser/export-data
src/Registry/AbstractRegistry.php
AbstractRegistry.decodeContent
protected function decodeContent(string $content): array { $result = json_decode($content, true); return is_array($result) ? $result : []; }
php
protected function decodeContent(string $content): array { $result = json_decode($content, true); return is_array($result) ? $result : []; }
[ "protected", "function", "decodeContent", "(", "string", "$", "content", ")", ":", "array", "{", "$", "result", "=", "json_decode", "(", "$", "content", ",", "true", ")", ";", "return", "is_array", "(", "$", "result", ")", "?", "$", "result", ":", "[",...
Decodes the specified JSON content. @param string $content @return array
[ "Decodes", "the", "specified", "JSON", "content", "." ]
train
https://github.com/factorio-item-browser/export-data/blob/1413b2eed0fbfed0521457ac7ef0d668ac30c212/src/Registry/AbstractRegistry.php#L96-L100
Ocramius/OcraDiCompiler
src/OcraDiCompiler/Definition/ClassListCompilerDefinition.php
ClassListCompilerDefinition.addClassToProcess
public function addClassToProcess($className) { if (!class_exists($className)) { return false; } $this->classesToProcess[(string) $className] = true; return true; }
php
public function addClassToProcess($className) { if (!class_exists($className)) { return false; } $this->classesToProcess[(string) $className] = true; return true; }
[ "public", "function", "addClassToProcess", "(", "$", "className", ")", "{", "if", "(", "!", "class_exists", "(", "$", "className", ")", ")", "{", "return", "false", ";", "}", "$", "this", "->", "classesToProcess", "[", "(", "string", ")", "$", "className...
Adds a class to the list of classes to be processed @param string $className @return bool true if the class was added, false if the class does not exist
[ "Adds", "a", "class", "to", "the", "list", "of", "classes", "to", "be", "processed" ]
train
https://github.com/Ocramius/OcraDiCompiler/blob/667f4b24771f27fb9c8d6c38ffaf72d9cd55ca4a/src/OcraDiCompiler/Definition/ClassListCompilerDefinition.php#L54-L62
amostajo/wordpress-plugin-core
src/psr4/Log.php
Log.instance
public static function instance() { if ( ! isset( self::$logger ) ) { self::$logger = new Logger( self::$path ); } return self::$logger; }
php
public static function instance() { if ( ! isset( self::$logger ) ) { self::$logger = new Logger( self::$path ); } return self::$logger; }
[ "public", "static", "function", "instance", "(", ")", "{", "if", "(", "!", "isset", "(", "self", "::", "$", "logger", ")", ")", "{", "self", "::", "$", "logger", "=", "new", "Logger", "(", "self", "::", "$", "path", ")", ";", "}", "return", "self...
Returns Logger instance. @since 1.0 @return mixed.
[ "Returns", "Logger", "instance", "." ]
train
https://github.com/amostajo/wordpress-plugin-core/blob/63aba30b07057df540c3af4dc50b92bd5501d6fd/src/psr4/Log.php#L65-L71
amostajo/wordpress-plugin-core
src/psr4/Log.php
Log.debug
public static function debug( $message, $values = [] ) { $logger = self::instance(); if ( $logger ) { $logger->debug( $message, is_array( $values ) ? $values : ( is_object( $values ) ? (array)$values : [ $values ] ) ); } }
php
public static function debug( $message, $values = [] ) { $logger = self::instance(); if ( $logger ) { $logger->debug( $message, is_array( $values ) ? $values : ( is_object( $values ) ? (array)$values : [ $values ] ) ); } }
[ "public", "static", "function", "debug", "(", "$", "message", ",", "$", "values", "=", "[", "]", ")", "{", "$", "logger", "=", "self", "::", "instance", "(", ")", ";", "if", "(", "$", "logger", ")", "{", "$", "logger", "->", "debug", "(", "$", ...
Debugs / prints value in log. @since 1.0 @param mixed $message Message to debug. @param array $values Value(s) to debug.
[ "Debugs", "/", "prints", "value", "in", "log", "." ]
train
https://github.com/amostajo/wordpress-plugin-core/blob/63aba30b07057df540c3af4dc50b92bd5501d6fd/src/psr4/Log.php#L92-L106
xinix-technology/norm
src/Norm/Controller/NormController.php
NormController.getCriteria
public function getCriteria() { $gets = $this->request->get(); if (empty($this->routeData)) { $criteria = array(); } else { $criteria = $this->routeData; } foreach ($gets as $key => $value) { if ($key[0] !== '!') { $criter...
php
public function getCriteria() { $gets = $this->request->get(); if (empty($this->routeData)) { $criteria = array(); } else { $criteria = $this->routeData; } foreach ($gets as $key => $value) { if ($key[0] !== '!') { $criter...
[ "public", "function", "getCriteria", "(", ")", "{", "$", "gets", "=", "$", "this", "->", "request", "->", "get", "(", ")", ";", "if", "(", "empty", "(", "$", "this", "->", "routeData", ")", ")", "{", "$", "criteria", "=", "array", "(", ")", ";", ...
Get criteria of current request @return array
[ "Get", "criteria", "of", "current", "request" ]
train
https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Controller/NormController.php#L63-L82
xinix-technology/norm
src/Norm/Controller/NormController.php
NormController.getOr
public function getOr() { $or = array(); if($this->request->get('!or')){ foreach ($this->request->get('!or') as $key => $value) { if(is_array($value)){ foreach($value as $k => $v){ $or[] = array($key => $v); ...
php
public function getOr() { $or = array(); if($this->request->get('!or')){ foreach ($this->request->get('!or') as $key => $value) { if(is_array($value)){ foreach($value as $k => $v){ $or[] = array($key => $v); ...
[ "public", "function", "getOr", "(", ")", "{", "$", "or", "=", "array", "(", ")", ";", "if", "(", "$", "this", "->", "request", "->", "get", "(", "'!or'", ")", ")", "{", "foreach", "(", "$", "this", "->", "request", "->", "get", "(", "'!or'", ")...
Get **or** criteria of current request. @return array
[ "Get", "**", "or", "**", "criteria", "of", "current", "request", "." ]
train
https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Controller/NormController.php#L89-L110
xinix-technology/norm
src/Norm/Controller/NormController.php
NormController.getSort
public function getSort() { $sorts = $get = $this->request->get('!sort') ?: array(); foreach ($sorts as $key => &$value) { $value = (int) $value; } return $sorts; }
php
public function getSort() { $sorts = $get = $this->request->get('!sort') ?: array(); foreach ($sorts as $key => &$value) { $value = (int) $value; } return $sorts; }
[ "public", "function", "getSort", "(", ")", "{", "$", "sorts", "=", "$", "get", "=", "$", "this", "->", "request", "->", "get", "(", "'!sort'", ")", "?", ":", "array", "(", ")", ";", "foreach", "(", "$", "sorts", "as", "$", "key", "=>", "&", "$"...
Get **sort** command of current request. @return array
[ "Get", "**", "sort", "**", "command", "of", "current", "request", "." ]
train
https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Controller/NormController.php#L117-L126
xinix-technology/norm
src/Norm/Controller/NormController.php
NormController.getLimit
public function getLimit() { $limit = $this->request->get('!limit'); if (is_null($limit) && !is_null($this->collection->option('limit'))) { $limit = $this->collection->option('limit'); } return $limit; }
php
public function getLimit() { $limit = $this->request->get('!limit'); if (is_null($limit) && !is_null($this->collection->option('limit'))) { $limit = $this->collection->option('limit'); } return $limit; }
[ "public", "function", "getLimit", "(", ")", "{", "$", "limit", "=", "$", "this", "->", "request", "->", "get", "(", "'!limit'", ")", ";", "if", "(", "is_null", "(", "$", "limit", ")", "&&", "!", "is_null", "(", "$", "this", "->", "collection", "->"...
Get **limit** command of current request. @return array
[ "Get", "**", "limit", "**", "command", "of", "current", "request", "." ]
train
https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Controller/NormController.php#L145-L154
xinix-technology/norm
src/Norm/Controller/NormController.php
NormController.search
public function search() { $entries = $this->collection->find($this->getCriteria()) ->match($this->getMatch()) ->sort($this->getSort()) ->skip($this->getSkip()) ->limit($this->getLimit()); $this->data['entries'] = $entries; }
php
public function search() { $entries = $this->collection->find($this->getCriteria()) ->match($this->getMatch()) ->sort($this->getSort()) ->skip($this->getSkip()) ->limit($this->getLimit()); $this->data['entries'] = $entries; }
[ "public", "function", "search", "(", ")", "{", "$", "entries", "=", "$", "this", "->", "collection", "->", "find", "(", "$", "this", "->", "getCriteria", "(", ")", ")", "->", "match", "(", "$", "this", "->", "getMatch", "(", ")", ")", "->", "sort",...
Handle **search / listing** request. @return void
[ "Handle", "**", "search", "/", "listing", "**", "request", "." ]
train
https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Controller/NormController.php#L173-L182
xinix-technology/norm
src/Norm/Controller/NormController.php
NormController.create
public function create() { $entry = $this->collection->newInstance()->set($this->getCriteria()); $this->data['entry'] = $entry; if ($this->request->isPost()) { try { $result = $entry->set($this->request->getBody())->save(); h('notification.info'...
php
public function create() { $entry = $this->collection->newInstance()->set($this->getCriteria()); $this->data['entry'] = $entry; if ($this->request->isPost()) { try { $result = $entry->set($this->request->getBody())->save(); h('notification.info'...
[ "public", "function", "create", "(", ")", "{", "$", "entry", "=", "$", "this", "->", "collection", "->", "newInstance", "(", ")", "->", "set", "(", "$", "this", "->", "getCriteria", "(", ")", ")", ";", "$", "this", "->", "data", "[", "'entry'", "]"...
Handle creation of new document. @return void
[ "Handle", "creation", "of", "new", "document", "." ]
train
https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Controller/NormController.php#L189-L221
xinix-technology/norm
src/Norm/Controller/NormController.php
NormController.read
public function read($id) { $found = false; try { $this->data['entry'] = $entry = $this->collection->findOne($id); } catch (Exception $e) { // noop } if (isset($entry)) { $found = true; } if (! $found) { retur...
php
public function read($id) { $found = false; try { $this->data['entry'] = $entry = $this->collection->findOne($id); } catch (Exception $e) { // noop } if (isset($entry)) { $found = true; } if (! $found) { retur...
[ "public", "function", "read", "(", "$", "id", ")", "{", "$", "found", "=", "false", ";", "try", "{", "$", "this", "->", "data", "[", "'entry'", "]", "=", "$", "entry", "=", "$", "this", "->", "collection", "->", "findOne", "(", "$", "id", ")", ...
Show a document **detail** by an ID. @param mixed $id @return void
[ "Show", "a", "document", "**", "detail", "**", "by", "an", "ID", "." ]
train
https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Controller/NormController.php#L230-L247
xinix-technology/norm
src/Norm/Controller/NormController.php
NormController.update
public function update($id) { try { $entry = $this->collection->findOne($id); } catch (Exception $e) { // noop } if (is_null($entry)) { return $this->app->notFound(); } if ($this->request->isPost() || $this->request->isPut()) { ...
php
public function update($id) { try { $entry = $this->collection->findOne($id); } catch (Exception $e) { // noop } if (is_null($entry)) { return $this->app->notFound(); } if ($this->request->isPost() || $this->request->isPut()) { ...
[ "public", "function", "update", "(", "$", "id", ")", "{", "try", "{", "$", "entry", "=", "$", "this", "->", "collection", "->", "findOne", "(", "$", "id", ")", ";", "}", "catch", "(", "Exception", "$", "e", ")", "{", "// noop", "}", "if", "(", ...
Perform **updating** a document. @param mixed $id @return void
[ "Perform", "**", "updating", "**", "a", "document", "." ]
train
https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Controller/NormController.php#L256-L299
xinix-technology/norm
src/Norm/Controller/NormController.php
NormController.delete
public function delete($id) { $id = explode(',', $id); if ($this->request->isPost() || $this->request->isDelete()) { $single = false; if (count($id) === 1) { $single = true; } try { $this->data['entries'] = array(); ...
php
public function delete($id) { $id = explode(',', $id); if ($this->request->isPost() || $this->request->isDelete()) { $single = false; if (count($id) === 1) { $single = true; } try { $this->data['entries'] = array(); ...
[ "public", "function", "delete", "(", "$", "id", ")", "{", "$", "id", "=", "explode", "(", "','", ",", "$", "id", ")", ";", "if", "(", "$", "this", "->", "request", "->", "isPost", "(", ")", "||", "$", "this", "->", "request", "->", "isDelete", ...
Perform **deletion** of a document by an ID given. @param mixed $id @return void
[ "Perform", "**", "deletion", "**", "of", "a", "document", "by", "an", "ID", "given", "." ]
train
https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Controller/NormController.php#L308-L359
xinix-technology/norm
src/Norm/Controller/NormController.php
NormController.schema
public function schema($schema = null) { if (func_num_args() === 0) { return $this->collection->schema(); } return $this->collection->schema($schema); }
php
public function schema($schema = null) { if (func_num_args() === 0) { return $this->collection->schema(); } return $this->collection->schema($schema); }
[ "public", "function", "schema", "(", "$", "schema", "=", "null", ")", "{", "if", "(", "func_num_args", "(", ")", "===", "0", ")", "{", "return", "$", "this", "->", "collection", "->", "schema", "(", ")", ";", "}", "return", "$", "this", "->", "coll...
Get schema of collection @param string|null $schema @return mixed
[ "Get", "schema", "of", "collection" ]
train
https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Controller/NormController.php#L368-L375
xinix-technology/norm
src/Norm/Controller/NormController.php
NormController.routeModel
public function routeModel($key) { if (! isset($this->routeModels[$key])) { $Clazz = Inflector::classify($key); $collection = Norm::factory($this->schema($key)->get('foreign')); $this->routeModels[$key] = $collection->findOne($this->routeData($key)); } ...
php
public function routeModel($key) { if (! isset($this->routeModels[$key])) { $Clazz = Inflector::classify($key); $collection = Norm::factory($this->schema($key)->get('foreign')); $this->routeModels[$key] = $collection->findOne($this->routeData($key)); } ...
[ "public", "function", "routeModel", "(", "$", "key", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "routeModels", "[", "$", "key", "]", ")", ")", "{", "$", "Clazz", "=", "Inflector", "::", "classify", "(", "$", "key", ")", ";", "$", ...
Register a route model. @param string $key @return mixed
[ "Register", "a", "route", "model", "." ]
train
https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Controller/NormController.php#L396-L407
SachaMorard/phalcon-console
Library/Phalcon/Script.php
Script.dispatch
public function dispatch(Command $command) { // If beforeCommand fails abort if ($this->_eventsManager->fire('command:beforeCommand', $command) === false) { return false; } // If run the commands fails abort too if ($command->run($command->getParameters()) === fa...
php
public function dispatch(Command $command) { // If beforeCommand fails abort if ($this->_eventsManager->fire('command:beforeCommand', $command) === false) { return false; } // If run the commands fails abort too if ($command->run($command->getParameters()) === fa...
[ "public", "function", "dispatch", "(", "Command", "$", "command", ")", "{", "// If beforeCommand fails abort", "if", "(", "$", "this", "->", "_eventsManager", "->", "fire", "(", "'command:beforeCommand'", ",", "$", "command", ")", "===", "false", ")", "{", "re...
Dispatch the Command @param Command $command @return bool
[ "Dispatch", "the", "Command" ]
train
https://github.com/SachaMorard/phalcon-console/blob/a7922e4c488ea19bc0ecce793e6f01cf9cf3c0c3/Library/Phalcon/Script.php#L108-L123
SachaMorard/phalcon-console
Library/Phalcon/Script.php
Script.run
public function run() { if (!isset($_SERVER['argv'][1])) { $_SERVER['argv'][1] = 'commands'; } $input = $_SERVER['argv'][1]; // Force `commands` command if (in_array(strtolower(trim($input)), ['-h', '--help', 'help'], true)) { $input = $_SERVER['argv...
php
public function run() { if (!isset($_SERVER['argv'][1])) { $_SERVER['argv'][1] = 'commands'; } $input = $_SERVER['argv'][1]; // Force `commands` command if (in_array(strtolower(trim($input)), ['-h', '--help', 'help'], true)) { $input = $_SERVER['argv...
[ "public", "function", "run", "(", ")", "{", "if", "(", "!", "isset", "(", "$", "_SERVER", "[", "'argv'", "]", "[", "1", "]", ")", ")", "{", "$", "_SERVER", "[", "'argv'", "]", "[", "1", "]", "=", "'commands'", ";", "}", "$", "input", "=", "$"...
Run the scripts @throws ScriptException
[ "Run", "the", "scripts" ]
train
https://github.com/SachaMorard/phalcon-console/blob/a7922e4c488ea19bc0ecce793e6f01cf9cf3c0c3/Library/Phalcon/Script.php#L130-L177
wucdbm/php-cs-fixers
src/Fixer/EnsureBlankLineAfterClassOpeningFixer.php
EnsureBlankLineAfterClassOpeningFixer.applyFix
protected function applyFix(\SplFileInfo $file, Tokens $tokens) { foreach ($tokens as $index => $token) { if (!$token->isClassy()) { continue; } $startBraceIndex = $tokens->getNextTokenOfKind($index, ['{']); $whitespace = $this->createBlankLine($...
php
protected function applyFix(\SplFileInfo $file, Tokens $tokens) { foreach ($tokens as $index => $token) { if (!$token->isClassy()) { continue; } $startBraceIndex = $tokens->getNextTokenOfKind($index, ['{']); $whitespace = $this->createBlankLine($...
[ "protected", "function", "applyFix", "(", "\\", "SplFileInfo", "$", "file", ",", "Tokens", "$", "tokens", ")", "{", "foreach", "(", "$", "tokens", "as", "$", "index", "=>", "$", "token", ")", "{", "if", "(", "!", "$", "token", "->", "isClassy", "(", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/wucdbm/php-cs-fixers/blob/5b12529bd0f81e0c7eb2cebd61b11cd65f279f9e/src/Fixer/EnsureBlankLineAfterClassOpeningFixer.php#L59-L103
ClanCats/Core
src/bundles/Database/DB.php
DB.fetch
public static function fetch( $query, $params = array(), $handler = null, $arguments = array( 'obj' ) ) { return Handler::create( $handler )->fetch( $query, $params, $arguments ); }
php
public static function fetch( $query, $params = array(), $handler = null, $arguments = array( 'obj' ) ) { return Handler::create( $handler )->fetch( $query, $params, $arguments ); }
[ "public", "static", "function", "fetch", "(", "$", "query", ",", "$", "params", "=", "array", "(", ")", ",", "$", "handler", "=", "null", ",", "$", "arguments", "=", "array", "(", "'obj'", ")", ")", "{", "return", "Handler", "::", "create", "(", "$...
Fetch data from an sql query Returns always an array of results @param string $query @param array $params @return array
[ "Fetch", "data", "from", "an", "sql", "query", "Returns", "always", "an", "array", "of", "results" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Database/DB.php#L86-L89
ClanCats/Core
src/bundles/Database/DB.php
DB.run
public static function run( $query, $params = array(), $handler = null ) { return Handler::create( $handler )->run( $query, $params ); }
php
public static function run( $query, $params = array(), $handler = null ) { return Handler::create( $handler )->run( $query, $params ); }
[ "public", "static", "function", "run", "(", "$", "query", ",", "$", "params", "=", "array", "(", ")", ",", "$", "handler", "=", "null", ")", "{", "return", "Handler", "::", "create", "(", "$", "handler", ")", "->", "run", "(", "$", "query", ",", ...
Run an sql statement will return the number of affected rows @param string $query @param array $params @return mixed
[ "Run", "an", "sql", "statement", "will", "return", "the", "number", "of", "affected", "rows" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Database/DB.php#L98-L101
ClanCats/Core
src/bundles/Database/DB.php
DB.select
public static function select( $table, $fields = array(), $handler = null ) { return Query::select( $table, $fields, $handler ); }
php
public static function select( $table, $fields = array(), $handler = null ) { return Query::select( $table, $fields, $handler ); }
[ "public", "static", "function", "select", "(", "$", "table", ",", "$", "fields", "=", "array", "(", ")", ",", "$", "handler", "=", "null", ")", "{", "return", "Query", "::", "select", "(", "$", "table", ",", "$", "fields", ",", "$", "handler", ")",...
Select data from the database @param string $table @param array $fields @return mixed
[ "Select", "data", "from", "the", "database" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Database/DB.php#L110-L113
ClanCats/Core
src/bundles/Database/DB.php
DB.model
public static function model( $model, $handler = null ) { $model_data = call_user_func( $model.'::_model' ); return Query::select( $model_data['table'], null, $model_data['handler'] ) ->fetch_handler( $model.'::_fetch_handler' ); }
php
public static function model( $model, $handler = null ) { $model_data = call_user_func( $model.'::_model' ); return Query::select( $model_data['table'], null, $model_data['handler'] ) ->fetch_handler( $model.'::_fetch_handler' ); }
[ "public", "static", "function", "model", "(", "$", "model", ",", "$", "handler", "=", "null", ")", "{", "$", "model_data", "=", "call_user_func", "(", "$", "model", ".", "'::_model'", ")", ";", "return", "Query", "::", "select", "(", "$", "model_data", ...
Create a select query with an model assignment @param string $table @param array $fields @return mixed
[ "Create", "a", "select", "query", "with", "an", "model", "assignment" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Database/DB.php#L122-L127
ClanCats/Core
src/bundles/Database/DB.php
DB.find
public static function find( $table, $id, $key = null, $handler = null ) { return Query::select( $table )->find( $id, $key, $handler ); }
php
public static function find( $table, $id, $key = null, $handler = null ) { return Query::select( $table )->find( $id, $key, $handler ); }
[ "public", "static", "function", "find", "(", "$", "table", ",", "$", "id", ",", "$", "key", "=", "null", ",", "$", "handler", "=", "null", ")", "{", "return", "Query", "::", "select", "(", "$", "table", ")", "->", "find", "(", "$", "id", ",", "...
Find something, means select one record by key @param string $table @param int $id @param string $key @param string $handler @return mixed
[ "Find", "something", "means", "select", "one", "record", "by", "key" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Database/DB.php#L138-L141
ClanCats/Core
src/bundles/Database/DB.php
DB.first
public static function first( $table, $key = null, $handler = null ) { return Query::select( $table )->first( $key, $handler ); }
php
public static function first( $table, $key = null, $handler = null ) { return Query::select( $table )->first( $key, $handler ); }
[ "public", "static", "function", "first", "(", "$", "table", ",", "$", "key", "=", "null", ",", "$", "handler", "=", "null", ")", "{", "return", "Query", "::", "select", "(", "$", "table", ")", "->", "first", "(", "$", "key", ",", "$", "handler", ...
Get the first result by key @param string $table @param string $key @param string $handler @return mixed
[ "Get", "the", "first", "result", "by", "key" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Database/DB.php#L151-L154
ClanCats/Core
src/bundles/Database/DB.php
DB.last
public static function last( $table, $key = null, $handler = null ) { return Query::select( $table )->last( $key, $handler ); }
php
public static function last( $table, $key = null, $handler = null ) { return Query::select( $table )->last( $key, $handler ); }
[ "public", "static", "function", "last", "(", "$", "table", ",", "$", "key", "=", "null", ",", "$", "handler", "=", "null", ")", "{", "return", "Query", "::", "select", "(", "$", "table", ")", "->", "last", "(", "$", "key", ",", "$", "handler", ")...
Get the last result by key @param string $table @param string $key @param string $handler @return mixed
[ "Get", "the", "last", "result", "by", "key" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Database/DB.php#L164-L167
ClanCats/Core
src/bundles/Database/DB.php
DB.insert
public static function insert( $table, $values = array(), $handler = null ) { return Query::insert( $table, $values, $handler ); }
php
public static function insert( $table, $values = array(), $handler = null ) { return Query::insert( $table, $values, $handler ); }
[ "public", "static", "function", "insert", "(", "$", "table", ",", "$", "values", "=", "array", "(", ")", ",", "$", "handler", "=", "null", ")", "{", "return", "Query", "::", "insert", "(", "$", "table", ",", "$", "values", ",", "$", "handler", ")",...
Create an insert query object @param string $table @param array $data @return mixed
[ "Create", "an", "insert", "query", "object" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Database/DB.php#L188-L191
ClanCats/Core
src/bundles/Database/DB.php
DB.update
public static function update( $table, $data = null, $handler = null ) { return Query::update( $table, $data, $handler ); }
php
public static function update( $table, $data = null, $handler = null ) { return Query::update( $table, $data, $handler ); }
[ "public", "static", "function", "update", "(", "$", "table", ",", "$", "data", "=", "null", ",", "$", "handler", "=", "null", ")", "{", "return", "Query", "::", "update", "(", "$", "table", ",", "$", "data", ",", "$", "handler", ")", ";", "}" ]
Create an update @param string $table @param array $values @param string $handler @return DB\Query
[ "Create", "an", "update" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Database/DB.php#L201-L204
terion-name/package-installer
src/Terion/PackageInstaller/SpecialsResolver.php
SpecialsResolver.specials
public function specials($package, Version $version) { $specials = $this->searchProvides($package); if ($specials) { $this->providesJsonDetected = true; } else { $this->providesJsonDetected = false; $specials = $this->searchReflect($package, $version); ...
php
public function specials($package, Version $version) { $specials = $this->searchProvides($package); if ($specials) { $this->providesJsonDetected = true; } else { $this->providesJsonDetected = false; $specials = $this->searchReflect($package, $version); ...
[ "public", "function", "specials", "(", "$", "package", ",", "Version", "$", "version", ")", "{", "$", "specials", "=", "$", "this", "->", "searchProvides", "(", "$", "package", ")", ";", "if", "(", "$", "specials", ")", "{", "$", "this", "->", "provi...
@param Package|string $package @param Version $version @return array|bool
[ "@param", "Package|string", "$package", "@param", "Version", "$version" ]
train
https://github.com/terion-name/package-installer/blob/a1f53085b0b5dbbcc308476f61188103051bd201/src/Terion/PackageInstaller/SpecialsResolver.php#L44-L57
terion-name/package-installer
src/Terion/PackageInstaller/SpecialsResolver.php
SpecialsResolver.searchProvides
protected function searchProvides($package) { $packageName = $package instanceof Package ? $package->getName() : $package; $providesJsonLocation = base_path("vendor/{$packageName}/provides.json"); if (file_exists($providesJsonLocation)) { $provides = json_decode(str_replace('\\',...
php
protected function searchProvides($package) { $packageName = $package instanceof Package ? $package->getName() : $package; $providesJsonLocation = base_path("vendor/{$packageName}/provides.json"); if (file_exists($providesJsonLocation)) { $provides = json_decode(str_replace('\\',...
[ "protected", "function", "searchProvides", "(", "$", "package", ")", "{", "$", "packageName", "=", "$", "package", "instanceof", "Package", "?", "$", "package", "->", "getName", "(", ")", ":", "$", "package", ";", "$", "providesJsonLocation", "=", "base_path...
@param Package|string $package @return array|bool
[ "@param", "Package|string", "$package" ]
train
https://github.com/terion-name/package-installer/blob/a1f53085b0b5dbbcc308476f61188103051bd201/src/Terion/PackageInstaller/SpecialsResolver.php#L64-L80
terion-name/package-installer
src/Terion/PackageInstaller/SpecialsResolver.php
SpecialsResolver.searchReflect
protected function searchReflect($package, Version $version) { $namespaces = $this->getNamespaces($package, $version); $this->loadPackageClasses($package, $version); $classes = $this->listPackageClasses($namespaces); $providers = array(); $aliases = array(); foreach ...
php
protected function searchReflect($package, Version $version) { $namespaces = $this->getNamespaces($package, $version); $this->loadPackageClasses($package, $version); $classes = $this->listPackageClasses($namespaces); $providers = array(); $aliases = array(); foreach ...
[ "protected", "function", "searchReflect", "(", "$", "package", ",", "Version", "$", "version", ")", "{", "$", "namespaces", "=", "$", "this", "->", "getNamespaces", "(", "$", "package", ",", "$", "version", ")", ";", "$", "this", "->", "loadPackageClasses"...
@param Package|string $package @param Version $version @return array
[ "@param", "Package|string", "$package", "@param", "Version", "$version" ]
train
https://github.com/terion-name/package-installer/blob/a1f53085b0b5dbbcc308476f61188103051bd201/src/Terion/PackageInstaller/SpecialsResolver.php#L88-L110
terion-name/package-installer
src/Terion/PackageInstaller/SpecialsResolver.php
SpecialsResolver.getNamespaces
protected function getNamespaces($package, Version $version) { $autoload = $version->getAutoload(); $namespaces = array(); foreach ($autoload as $type => $map) { if ($type === 'psr-0' or $type === 'psr-4') { foreach ($map as $ns => $rules) { $n...
php
protected function getNamespaces($package, Version $version) { $autoload = $version->getAutoload(); $namespaces = array(); foreach ($autoload as $type => $map) { if ($type === 'psr-0' or $type === 'psr-4') { foreach ($map as $ns => $rules) { $n...
[ "protected", "function", "getNamespaces", "(", "$", "package", ",", "Version", "$", "version", ")", "{", "$", "autoload", "=", "$", "version", "->", "getAutoload", "(", ")", ";", "$", "namespaces", "=", "array", "(", ")", ";", "foreach", "(", "$", "aut...
@param Package|string $package @param Version $version @return array
[ "@param", "Package|string", "$package", "@param", "Version", "$version" ]
train
https://github.com/terion-name/package-installer/blob/a1f53085b0b5dbbcc308476f61188103051bd201/src/Terion/PackageInstaller/SpecialsResolver.php#L118-L132
terion-name/package-installer
src/Terion/PackageInstaller/SpecialsResolver.php
SpecialsResolver.getLoadPackagePathes
protected function getLoadPackagePathes($package, Version $version) { $packageName = $package instanceof Package ? $package->getName() : $package; $basePath = 'vendor' . DIRECTORY_SEPARATOR . implode(DIRECTORY_SEPARATOR, explode('/', $packageName)); $paths = array('directories' => array(), '...
php
protected function getLoadPackagePathes($package, Version $version) { $packageName = $package instanceof Package ? $package->getName() : $package; $basePath = 'vendor' . DIRECTORY_SEPARATOR . implode(DIRECTORY_SEPARATOR, explode('/', $packageName)); $paths = array('directories' => array(), '...
[ "protected", "function", "getLoadPackagePathes", "(", "$", "package", ",", "Version", "$", "version", ")", "{", "$", "packageName", "=", "$", "package", "instanceof", "Package", "?", "$", "package", "->", "getName", "(", ")", ":", "$", "package", ";", "$",...
@param Package|string $package @param Version $version @return array
[ "@param", "Package|string", "$package", "@param", "Version", "$version" ]
train
https://github.com/terion-name/package-installer/blob/a1f53085b0b5dbbcc308476f61188103051bd201/src/Terion/PackageInstaller/SpecialsResolver.php#L183-L236
terion-name/package-installer
src/Terion/PackageInstaller/SpecialsResolver.php
SpecialsResolver.excludeFilesInPath
protected function excludeFilesInPath($basePath) { $paths = ['tests' . DIRECTORY_SEPARATOR, 'test' . DIRECTORY_SEPARATOR]; $phpUnit = $basePath . DIRECTORY_SEPARATOR . 'phpunit.xml'; if (!file_exists($phpUnit)) { $phpUnit = $basePath . DIRECTORY_SEPARATOR . 'phpunit.xml.dist'; ...
php
protected function excludeFilesInPath($basePath) { $paths = ['tests' . DIRECTORY_SEPARATOR, 'test' . DIRECTORY_SEPARATOR]; $phpUnit = $basePath . DIRECTORY_SEPARATOR . 'phpunit.xml'; if (!file_exists($phpUnit)) { $phpUnit = $basePath . DIRECTORY_SEPARATOR . 'phpunit.xml.dist'; ...
[ "protected", "function", "excludeFilesInPath", "(", "$", "basePath", ")", "{", "$", "paths", "=", "[", "'tests'", ".", "DIRECTORY_SEPARATOR", ",", "'test'", ".", "DIRECTORY_SEPARATOR", "]", ";", "$", "phpUnit", "=", "$", "basePath", ".", "DIRECTORY_SEPARATOR", ...
@param $basePath @return array
[ "@param", "$basePath" ]
train
https://github.com/terion-name/package-installer/blob/a1f53085b0b5dbbcc308476f61188103051bd201/src/Terion/PackageInstaller/SpecialsResolver.php#L243-L261
terion-name/package-installer
src/Terion/PackageInstaller/SpecialsResolver.php
SpecialsResolver.listPackageClasses
protected function listPackageClasses(array $namespaces) { return array_filter(get_declared_classes(), function ($class) use ($namespaces) { $valid = false; foreach ($namespaces as $ns) { $valid = (strpos($class, $ns) === 0) ? true : $valid; } ...
php
protected function listPackageClasses(array $namespaces) { return array_filter(get_declared_classes(), function ($class) use ($namespaces) { $valid = false; foreach ($namespaces as $ns) { $valid = (strpos($class, $ns) === 0) ? true : $valid; } ...
[ "protected", "function", "listPackageClasses", "(", "array", "$", "namespaces", ")", "{", "return", "array_filter", "(", "get_declared_classes", "(", ")", ",", "function", "(", "$", "class", ")", "use", "(", "$", "namespaces", ")", "{", "$", "valid", "=", ...
@param array $namespaces @return array
[ "@param", "array", "$namespaces" ]
train
https://github.com/terion-name/package-installer/blob/a1f53085b0b5dbbcc308476f61188103051bd201/src/Terion/PackageInstaller/SpecialsResolver.php#L268-L277
ufocoder/yii2-SyncSocial
src/SyncService.php
SyncService.isConnected
public function isConnected(OAuthToken $accessToken = null) { /** * @var $service \yii\authclient\BaseOAuth */ if ($accessToken === null) { $accessToken = $this->service->getAccessToken(); } if (is_object($accessToken) && $accessToken->getIsValid()) { return true; } else { return false; }...
php
public function isConnected(OAuthToken $accessToken = null) { /** * @var $service \yii\authclient\BaseOAuth */ if ($accessToken === null) { $accessToken = $this->service->getAccessToken(); } if (is_object($accessToken) && $accessToken->getIsValid()) { return true; } else { return false; }...
[ "public", "function", "isConnected", "(", "OAuthToken", "$", "accessToken", "=", "null", ")", "{", "/**\n\t\t * @var $service \\yii\\authclient\\BaseOAuth\n\t\t */", "if", "(", "$", "accessToken", "===", "null", ")", "{", "$", "accessToken", "=", "$", "this", "->", ...
@param OAuthToken $accessToken @return bool
[ "@param", "OAuthToken", "$accessToken" ]
train
https://github.com/ufocoder/yii2-SyncSocial/blob/2dbaaec2dad782c52fdd5b648a31ba7fe2a75e1b/src/SyncService.php#L148-L164