id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
17,300 | shinjin/freezer | src/LazyProxy.php | LazyProxy.__isset | public function __isset($name)
{
if ($this->thawedObject === null) {
if ($name === $this->storage->getFreezer()->getIdProperty()) {
return true;
}
}
return isset($this->replaceProxy(2)->{$name});
} | php | public function __isset($name)
{
if ($this->thawedObject === null) {
if ($name === $this->storage->getFreezer()->getIdProperty()) {
return true;
}
}
return isset($this->replaceProxy(2)->{$name});
} | [
"public",
"function",
"__isset",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"thawedObject",
"===",
"null",
")",
"{",
"if",
"(",
"$",
"name",
"===",
"$",
"this",
"->",
"storage",
"->",
"getFreezer",
"(",
")",
"->",
"getIdProperty",
"(",... | Delegates the property isset check to the real object and
tries to replace the lazy proxy object with it.
@param string $name
@return mixed | [
"Delegates",
"the",
"property",
"isset",
"check",
"to",
"the",
"real",
"object",
"and",
"tries",
"to",
"replace",
"the",
"lazy",
"proxy",
"object",
"with",
"it",
"."
] | f5955fb5476fa8ac456e27c0edafaae331d02cd3 | https://github.com/shinjin/freezer/blob/f5955fb5476fa8ac456e27c0edafaae331d02cd3/src/LazyProxy.php#L119-L128 |
17,301 | shinjin/freezer | src/LazyProxy.php | LazyProxy.replaceProxy | protected function replaceProxy($offset)
{
$object = $this->getObject();
/**
* 0: LazyProxy::replaceProxy()
* 1: LazyProxy::__get($name) / LazyProxy::__set($name, $value)
* 2: Frame that accesses $name
* 1: LazyProxy::__call($method, $arguments)
* 2: ... | php | protected function replaceProxy($offset)
{
$object = $this->getObject();
/**
* 0: LazyProxy::replaceProxy()
* 1: LazyProxy::__get($name) / LazyProxy::__set($name, $value)
* 2: Frame that accesses $name
* 1: LazyProxy::__call($method, $arguments)
* 2: ... | [
"protected",
"function",
"replaceProxy",
"(",
"$",
"offset",
")",
"{",
"$",
"object",
"=",
"$",
"this",
"->",
"getObject",
"(",
")",
";",
"/**\n * 0: LazyProxy::replaceProxy()\n * 1: LazyProxy::__get($name) / LazyProxy::__set($name, $value)\n * 2: Frame... | Tries to replace the lazy proxy object with the real object.
@param integer $offset
@return object | [
"Tries",
"to",
"replace",
"the",
"lazy",
"proxy",
"object",
"with",
"the",
"real",
"object",
"."
] | f5955fb5476fa8ac456e27c0edafaae331d02cd3 | https://github.com/shinjin/freezer/blob/f5955fb5476fa8ac456e27c0edafaae331d02cd3/src/LazyProxy.php#L136-L164 |
17,302 | dburkart/scurvy | expression.php | Expression.newVar | public function newVar($str) {
$str = trim($str);
// Try to make it a variable
if (preg_match('/^[a-zA-Z0-9\'_][a-zA-Z0-9\'_-]*$/', $str))
return new Atom(EXPR_VAR, $str);
else {
return false;
}
} | php | public function newVar($str) {
$str = trim($str);
// Try to make it a variable
if (preg_match('/^[a-zA-Z0-9\'_][a-zA-Z0-9\'_-]*$/', $str))
return new Atom(EXPR_VAR, $str);
else {
return false;
}
} | [
"public",
"function",
"newVar",
"(",
"$",
"str",
")",
"{",
"$",
"str",
"=",
"trim",
"(",
"$",
"str",
")",
";",
"// Try to make it a variable",
"if",
"(",
"preg_match",
"(",
"'/^[a-zA-Z0-9\\'_][a-zA-Z0-9\\'_-]*$/'",
",",
"$",
"str",
")",
")",
"return",
"new",... | Creates a new variable atom, subsequent to validating that the string
is correct for a variable
@param str the name of the variable
@return the newly created atom | [
"Creates",
"a",
"new",
"variable",
"atom",
"subsequent",
"to",
"validating",
"that",
"the",
"string",
"is",
"correct",
"for",
"a",
"variable"
] | 990a7c4f0517298de304438cf9cd95a303a231fb | https://github.com/dburkart/scurvy/blob/990a7c4f0517298de304438cf9cd95a303a231fb/expression.php#L343-L352 |
17,303 | fubhy/graphql-php | src/Executor/Executor.php | Executor.buildExecutionContext | protected static function buildExecutionContext(Schema $schema, $root, Document $ast, $operationName = NULL, array $args = NULL, &$errors)
{
$operations = [];
$fragments = [];
foreach ($ast->get('definitions') as $statement) {
switch ($statement::KIND) {
case Nod... | php | protected static function buildExecutionContext(Schema $schema, $root, Document $ast, $operationName = NULL, array $args = NULL, &$errors)
{
$operations = [];
$fragments = [];
foreach ($ast->get('definitions') as $statement) {
switch ($statement::KIND) {
case Nod... | [
"protected",
"static",
"function",
"buildExecutionContext",
"(",
"Schema",
"$",
"schema",
",",
"$",
"root",
",",
"Document",
"$",
"ast",
",",
"$",
"operationName",
"=",
"NULL",
",",
"array",
"$",
"args",
"=",
"NULL",
",",
"&",
"$",
"errors",
")",
"{",
... | Constructs a ExecutionContext object from the arguments passed to
execute, which we will pass throughout the other execution methods.
@param Schema $schema
@param $root
@param Document $ast
@param string|null $operationName
@param array $args
@param $errors
@return ExecutionContext
@throws \Exception | [
"Constructs",
"a",
"ExecutionContext",
"object",
"from",
"the",
"arguments",
"passed",
"to",
"execute",
"which",
"we",
"will",
"pass",
"throughout",
"the",
"other",
"execution",
"methods",
"."
] | c1de2233c731ca29e5c5db4c43f3b9db36478c83 | https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Executor/Executor.php#L94-L125 |
17,304 | fubhy/graphql-php | src/Executor/Executor.php | Executor.executeOperation | protected static function executeOperation(ExecutionContext $context, $root, OperationDefinition $operation)
{
$type = self::getOperationRootType($context->schema, $operation);
$fields = self::collectFields($context, $type, $operation->get('selectionSet'), new \ArrayObject(), new \ArrayObject());
... | php | protected static function executeOperation(ExecutionContext $context, $root, OperationDefinition $operation)
{
$type = self::getOperationRootType($context->schema, $operation);
$fields = self::collectFields($context, $type, $operation->get('selectionSet'), new \ArrayObject(), new \ArrayObject());
... | [
"protected",
"static",
"function",
"executeOperation",
"(",
"ExecutionContext",
"$",
"context",
",",
"$",
"root",
",",
"OperationDefinition",
"$",
"operation",
")",
"{",
"$",
"type",
"=",
"self",
"::",
"getOperationRootType",
"(",
"$",
"context",
"->",
"schema",... | Implements the "Evaluating operations" section of the spec. | [
"Implements",
"the",
"Evaluating",
"operations",
"section",
"of",
"the",
"spec",
"."
] | c1de2233c731ca29e5c5db4c43f3b9db36478c83 | https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Executor/Executor.php#L130-L139 |
17,305 | fubhy/graphql-php | src/Executor/Executor.php | Executor.getOperationRootType | protected static function getOperationRootType(Schema $schema, OperationDefinition $operation)
{
switch ($operation->get('operation')) {
case 'query':
return $schema->getQueryType();
case 'mutation':
$mutationType = $schema->getMutationType();
... | php | protected static function getOperationRootType(Schema $schema, OperationDefinition $operation)
{
switch ($operation->get('operation')) {
case 'query':
return $schema->getQueryType();
case 'mutation':
$mutationType = $schema->getMutationType();
... | [
"protected",
"static",
"function",
"getOperationRootType",
"(",
"Schema",
"$",
"schema",
",",
"OperationDefinition",
"$",
"operation",
")",
"{",
"switch",
"(",
"$",
"operation",
"->",
"get",
"(",
"'operation'",
")",
")",
"{",
"case",
"'query'",
":",
"return",
... | Extracts the root type of the operation from the schema.
@param Schema $schema
@param OperationDefinition $operation
@return ObjectType
@throws \Exception | [
"Extracts",
"the",
"root",
"type",
"of",
"the",
"operation",
"from",
"the",
"schema",
"."
] | c1de2233c731ca29e5c5db4c43f3b9db36478c83 | https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Executor/Executor.php#L152-L167 |
17,306 | fubhy/graphql-php | src/Executor/Executor.php | Executor.executeFieldsSerially | protected static function executeFieldsSerially(ExecutionContext $context, ObjectType $parent, $source, $fields)
{
$results = [];
foreach ($fields as $response => $asts) {
$result = self::resolveField($context, $parent, $source, $asts);
if ($result !== self::$UNDEFINED) {
... | php | protected static function executeFieldsSerially(ExecutionContext $context, ObjectType $parent, $source, $fields)
{
$results = [];
foreach ($fields as $response => $asts) {
$result = self::resolveField($context, $parent, $source, $asts);
if ($result !== self::$UNDEFINED) {
... | [
"protected",
"static",
"function",
"executeFieldsSerially",
"(",
"ExecutionContext",
"$",
"context",
",",
"ObjectType",
"$",
"parent",
",",
"$",
"source",
",",
"$",
"fields",
")",
"{",
"$",
"results",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"fields",
"as"... | Implements the "Evaluating selection sets" section of the spec for "write" mode. | [
"Implements",
"the",
"Evaluating",
"selection",
"sets",
"section",
"of",
"the",
"spec",
"for",
"write",
"mode",
"."
] | c1de2233c731ca29e5c5db4c43f3b9db36478c83 | https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Executor/Executor.php#L172-L185 |
17,307 | fubhy/graphql-php | src/Executor/Executor.php | Executor.executeFields | protected static function executeFields(ExecutionContext $context, ObjectType $parent, $source, $fields)
{
return self::executeFieldsSerially($context, $parent, $source, $fields);
} | php | protected static function executeFields(ExecutionContext $context, ObjectType $parent, $source, $fields)
{
return self::executeFieldsSerially($context, $parent, $source, $fields);
} | [
"protected",
"static",
"function",
"executeFields",
"(",
"ExecutionContext",
"$",
"context",
",",
"ObjectType",
"$",
"parent",
",",
"$",
"source",
",",
"$",
"fields",
")",
"{",
"return",
"self",
"::",
"executeFieldsSerially",
"(",
"$",
"context",
",",
"$",
"... | Implements the "Evaluating selection sets" section of the spec for "read" mode.
@param ExecutionContext $context
@param ObjectType $parent
@param $source
@param $fields
@return array | [
"Implements",
"the",
"Evaluating",
"selection",
"sets",
"section",
"of",
"the",
"spec",
"for",
"read",
"mode",
"."
] | c1de2233c731ca29e5c5db4c43f3b9db36478c83 | https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Executor/Executor.php#L197-L200 |
17,308 | 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",
"."
] | c1de2233c731ca29e5c5db4c43f3b9db36478c83 | https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Executor/Executor.php#L214-L267 |
17,309 | 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"
] | c1de2233c731ca29e5c5db4c43f3b9db36478c83 | https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Executor/Executor.php#L272-L290 |
17,310 | 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",
"."
] | c1de2233c731ca29e5c5db4c43f3b9db36478c83 | https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Executor/Executor.php#L301-L318 |
17,311 | 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"
] | c1de2233c731ca29e5c5db4c43f3b9db36478c83 | https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Executor/Executor.php#L327-L330 |
17,312 | 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",
"."
] | c1de2233c731ca29e5c5db4c43f3b9db36478c83 | https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Executor/Executor.php#L345-L367 |
17,313 | 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",
"."
] | c1de2233c731ca29e5c5db4c43f3b9db36478c83 | https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Executor/Executor.php#L386-L402 |
17,314 | 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",
... | c1de2233c731ca29e5c5db4c43f3b9db36478c83 | https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Executor/Executor.php#L511-L526 |
17,315 | 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"
] | 63937fecea4bc927b1ac9669fee5cf50278d28d3 | https://github.com/jinexus-framework/jinexus-mvc/blob/63937fecea4bc927b1ac9669fee5cf50278d28d3/src/View/AbstractView.php#L152-L177 |
17,316 | 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"
] | 63937fecea4bc927b1ac9669fee5cf50278d28d3 | https://github.com/jinexus-framework/jinexus-mvc/blob/63937fecea4bc927b1ac9669fee5cf50278d28d3/src/View/AbstractView.php#L185-L210 |
17,317 | 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"
] | 63937fecea4bc927b1ac9669fee5cf50278d28d3 | https://github.com/jinexus-framework/jinexus-mvc/blob/63937fecea4bc927b1ac9669fee5cf50278d28d3/src/View/AbstractView.php#L219-L228 |
17,318 | 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"
] | 63937fecea4bc927b1ac9669fee5cf50278d28d3 | https://github.com/jinexus-framework/jinexus-mvc/blob/63937fecea4bc927b1ac9669fee5cf50278d28d3/src/View/AbstractView.php#L247-L255 |
17,319 | 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"
] | 63937fecea4bc927b1ac9669fee5cf50278d28d3 | https://github.com/jinexus-framework/jinexus-mvc/blob/63937fecea4bc927b1ac9669fee5cf50278d28d3/src/View/AbstractView.php#L262-L267 |
17,320 | 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"
] | 63937fecea4bc927b1ac9669fee5cf50278d28d3 | https://github.com/jinexus-framework/jinexus-mvc/blob/63937fecea4bc927b1ac9669fee5cf50278d28d3/src/View/AbstractView.php#L275-L299 |
17,321 | 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"
] | a4e92000fc61ddc7f297984ef9924b6d9df508a4 | https://github.com/controlabs/routify/blob/a4e92000fc61ddc7f297984ef9924b6d9df508a4/src/Routify/RouteGroup.php#L41-L51 |
17,322 | 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"
] | 467bfa2547e6b4fa487d2d7f35fa6cc618dbc763 | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/DependencyManager.php#L108-L118 |
17,323 | 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"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/UI/Form.php#L64-L79 |
17,324 | 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"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/UI/Form.php#L101-L127 |
17,325 | 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"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/UI/Form.php#L148-L155 |
17,326 | 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"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/UI/Form.php#L204-L223 |
17,327 | 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"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/UI/Form.php#L233-L251 |
17,328 | 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"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/UI/Form.php#L263-L281 |
17,329 | 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"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/UI/Form.php#L334-L371 |
17,330 | 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",
"."
] | 726981245a8d59319ee594a582f80a30256df98b | https://github.com/neos/doctools/blob/726981245a8d59319ee594a582f80a30256df98b/Classes/Command/ReferenceCommandController.php#L71-L83 |
17,331 | 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",
"."
] | 726981245a8d59319ee594a582f80a30256df98b | https://github.com/neos/doctools/blob/726981245a8d59319ee594a582f80a30256df98b/Classes/Command/ReferenceCommandController.php#L111-L141 |
17,332 | 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",
"."
] | 5d0dce3313df9e22ab60749bcf01f1753de8c143 | https://github.com/accgit/single-web/blob/5d0dce3313df9e22ab60749bcf01f1753de8c143/src/Single/Single.php#L49-L55 |
17,333 | 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",
"."
] | cc982cf1941eb5776287d64f027218bd4835ed2b | https://github.com/kattsoftware/phassets/blob/cc982cf1941eb5776287d64f027218bd4835ed2b/src/Phassets/Factory.php#L50-L61 |
17,334 | 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",
"."
] | cc982cf1941eb5776287d64f027218bd4835ed2b | https://github.com/kattsoftware/phassets/blob/cc982cf1941eb5776287d64f027218bd4835ed2b/src/Phassets/Factory.php#L71-L82 |
17,335 | 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",
"."
] | cc982cf1941eb5776287d64f027218bd4835ed2b | https://github.com/kattsoftware/phassets/blob/cc982cf1941eb5776287d64f027218bd4835ed2b/src/Phassets/Factory.php#L104-L115 |
17,336 | 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",
"."
] | cc982cf1941eb5776287d64f027218bd4835ed2b | https://github.com/kattsoftware/phassets/blob/cc982cf1941eb5776287d64f027218bd4835ed2b/src/Phassets/Factory.php#L125-L136 |
17,337 | 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",
"."
] | cc982cf1941eb5776287d64f027218bd4835ed2b | https://github.com/kattsoftware/phassets/blob/cc982cf1941eb5776287d64f027218bd4835ed2b/src/Phassets/Factory.php#L166-L177 |
17,338 | 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",
"."
] | 7b8eb9cdc83e01138dda0e709c07e3beb6aad136 | https://github.com/digitalkaoz/versioneye-php/blob/7b8eb9cdc83e01138dda0e709c07e3beb6aad136/src/Output/Products.php#L42-L68 |
17,339 | 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",
"."
] | 7b8eb9cdc83e01138dda0e709c07e3beb6aad136 | https://github.com/digitalkaoz/versioneye-php/blob/7b8eb9cdc83e01138dda0e709c07e3beb6aad136/src/Output/Products.php#L109-L129 |
17,340 | 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",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/LessHelper.php#L73-L99 |
17,341 | 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",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/LessHelper.php#L108-L129 |
17,342 | 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",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/LessHelper.php#L137-L148 |
17,343 | 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",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/LessHelper.php#L167-L188 |
17,344 | 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",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/LessHelper.php#L197-L212 |
17,345 | 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",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/LessHelper.php#L220-L232 |
17,346 | 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",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/LessHelper.php#L252-L272 |
17,347 | 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",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/LessHelper.php#L294-L299 |
17,348 | 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"
] | cd032893ca083a343f5871e855cce68f4ede3a17 | https://github.com/inc2734/wp-share-buttons/blob/cd032893ca083a343f5871e855cce68f4ede3a17/src/App/Contract/Shortcode/Button.php#L43-L54 |
17,349 | 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",
"."
] | 1413b2eed0fbfed0521457ac7ef0d668ac30c212 | https://github.com/factorio-item-browser/export-data/blob/1413b2eed0fbfed0521457ac7ef0d668ac30c212/src/Registry/AbstractRegistry.php#L51-L55 |
17,350 | 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",
"."
] | 1413b2eed0fbfed0521457ac7ef0d668ac30c212 | https://github.com/factorio-item-browser/export-data/blob/1413b2eed0fbfed0521457ac7ef0d668ac30c212/src/Registry/AbstractRegistry.php#L62-L69 |
17,351 | 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",
"."
] | 1413b2eed0fbfed0521457ac7ef0d668ac30c212 | https://github.com/factorio-item-browser/export-data/blob/1413b2eed0fbfed0521457ac7ef0d668ac30c212/src/Registry/AbstractRegistry.php#L75-L79 |
17,352 | 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",
"."
] | 1413b2eed0fbfed0521457ac7ef0d668ac30c212 | https://github.com/factorio-item-browser/export-data/blob/1413b2eed0fbfed0521457ac7ef0d668ac30c212/src/Registry/AbstractRegistry.php#L96-L100 |
17,353 | 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"
] | 667f4b24771f27fb9c8d6c38ffaf72d9cd55ca4a | https://github.com/Ocramius/OcraDiCompiler/blob/667f4b24771f27fb9c8d6c38ffaf72d9cd55ca4a/src/OcraDiCompiler/Definition/ClassListCompilerDefinition.php#L54-L62 |
17,354 | 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",
"."
] | 63aba30b07057df540c3af4dc50b92bd5501d6fd | https://github.com/amostajo/wordpress-plugin-core/blob/63aba30b07057df540c3af4dc50b92bd5501d6fd/src/psr4/Log.php#L65-L71 |
17,355 | 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"
] | c357f7d3a75d05324dd84b8f6a968a094c53d603 | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Controller/NormController.php#L63-L82 |
17,356 | 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",
"."
] | c357f7d3a75d05324dd84b8f6a968a094c53d603 | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Controller/NormController.php#L189-L221 |
17,357 | 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"
] | c357f7d3a75d05324dd84b8f6a968a094c53d603 | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Controller/NormController.php#L368-L375 |
17,358 | 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",
"."
] | c357f7d3a75d05324dd84b8f6a968a094c53d603 | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Controller/NormController.php#L396-L407 |
17,359 | 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"
] | a7922e4c488ea19bc0ecce793e6f01cf9cf3c0c3 | https://github.com/SachaMorard/phalcon-console/blob/a7922e4c488ea19bc0ecce793e6f01cf9cf3c0c3/Library/Phalcon/Script.php#L108-L123 |
17,360 | 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"
] | a7922e4c488ea19bc0ecce793e6f01cf9cf3c0c3 | https://github.com/SachaMorard/phalcon-console/blob/a7922e4c488ea19bc0ecce793e6f01cf9cf3c0c3/Library/Phalcon/Script.php#L130-L177 |
17,361 | 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"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Database/DB.php#L86-L89 |
17,362 | 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"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Database/DB.php#L98-L101 |
17,363 | 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"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Database/DB.php#L122-L127 |
17,364 | 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"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Database/DB.php#L164-L167 |
17,365 | 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"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Database/DB.php#L188-L191 |
17,366 | slashworks/control-bundle | src/Slashworks/AppBundle/Controller/CustomerController.php | CustomerController.modalInfoAction | public function modalInfoAction($id)
{
/** @var Customer $oCustomer */
$oCustomer = CustomerQuery::create()->findOneById($id);
return $this->render('SlashworksAppBundle:Customer:modal_info.html.twig', array(
'customer' => $oCustomer
));
... | php | public function modalInfoAction($id)
{
/** @var Customer $oCustomer */
$oCustomer = CustomerQuery::create()->findOneById($id);
return $this->render('SlashworksAppBundle:Customer:modal_info.html.twig', array(
'customer' => $oCustomer
));
... | [
"public",
"function",
"modalInfoAction",
"(",
"$",
"id",
")",
"{",
"/** @var Customer $oCustomer */",
"$",
"oCustomer",
"=",
"CustomerQuery",
"::",
"create",
"(",
")",
"->",
"findOneById",
"(",
"$",
"id",
")",
";",
"return",
"$",
"this",
"->",
"render",
"(",... | Modal info window for customerinformations
@param int $id
@return \Symfony\Component\HttpFoundation\Response | [
"Modal",
"info",
"window",
"for",
"customerinformations"
] | 2ba86d96f1f41f9424e2229c4e2b13017e973f89 | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Controller/CustomerController.php#L109-L119 |
17,367 | slashworks/control-bundle | src/Slashworks/AppBundle/Controller/CustomerController.php | CustomerController.newAction | public function newAction()
{
$oCustomer = new Customer();
$form = $this->createCreateForm($oCustomer);
return $this->render('SlashworksAppBundle:Customer:new.html.twig', array(
'entity' => $oCustomer,
'form' => $form->createView(),
... | php | public function newAction()
{
$oCustomer = new Customer();
$form = $this->createCreateForm($oCustomer);
return $this->render('SlashworksAppBundle:Customer:new.html.twig', array(
'entity' => $oCustomer,
'form' => $form->createView(),
... | [
"public",
"function",
"newAction",
"(",
")",
"{",
"$",
"oCustomer",
"=",
"new",
"Customer",
"(",
")",
";",
"$",
"form",
"=",
"$",
"this",
"->",
"createCreateForm",
"(",
"$",
"oCustomer",
")",
";",
"return",
"$",
"this",
"->",
"render",
"(",
"'Slashwork... | Displays a form to create a new Customer entity.
@return \Symfony\Component\HttpFoundation\Response | [
"Displays",
"a",
"form",
"to",
"create",
"a",
"new",
"Customer",
"entity",
"."
] | 2ba86d96f1f41f9424e2229c4e2b13017e973f89 | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Controller/CustomerController.php#L127-L137 |
17,368 | slashworks/control-bundle | src/Slashworks/AppBundle/Controller/CustomerController.php | CustomerController.editAction | public function editAction($id)
{
/** @var Customer $oCustomer */
$oCustomer = CustomerQuery::create()->findOneById($id);
if (count($oCustomer) === 0) {
throw $this->createNotFoundException('Unable to find Customer entity.');
}
$oEdi... | php | public function editAction($id)
{
/** @var Customer $oCustomer */
$oCustomer = CustomerQuery::create()->findOneById($id);
if (count($oCustomer) === 0) {
throw $this->createNotFoundException('Unable to find Customer entity.');
}
$oEdi... | [
"public",
"function",
"editAction",
"(",
"$",
"id",
")",
"{",
"/** @var Customer $oCustomer */",
"$",
"oCustomer",
"=",
"CustomerQuery",
"::",
"create",
"(",
")",
"->",
"findOneById",
"(",
"$",
"id",
")",
";",
"if",
"(",
"count",
"(",
"$",
"oCustomer",
")"... | Displays a form to edit an existing Customer entity.
@param int $id
@return \Symfony\Component\HttpFoundation\Response | [
"Displays",
"a",
"form",
"to",
"edit",
"an",
"existing",
"Customer",
"entity",
"."
] | 2ba86d96f1f41f9424e2229c4e2b13017e973f89 | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Controller/CustomerController.php#L147-L165 |
17,369 | slashworks/control-bundle | src/Slashworks/AppBundle/Controller/CustomerController.php | CustomerController.updateAction | public function updateAction(Request $request, $id)
{
/** @var Customer $oCustomer */
$oCustomer = CustomerQuery::create()->findOneById($id);
if (count($oCustomer) === 0) {
throw $this->createNotFoundException('Unable to find Customer entity.');
... | php | public function updateAction(Request $request, $id)
{
/** @var Customer $oCustomer */
$oCustomer = CustomerQuery::create()->findOneById($id);
if (count($oCustomer) === 0) {
throw $this->createNotFoundException('Unable to find Customer entity.');
... | [
"public",
"function",
"updateAction",
"(",
"Request",
"$",
"request",
",",
"$",
"id",
")",
"{",
"/** @var Customer $oCustomer */",
"$",
"oCustomer",
"=",
"CustomerQuery",
"::",
"create",
"(",
")",
"->",
"findOneById",
"(",
"$",
"id",
")",
";",
"if",
"(",
"... | Update existing customer
@param \Symfony\Component\HttpFoundation\Request $request
@param int $id
@return \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response | [
"Update",
"existing",
"customer"
] | 2ba86d96f1f41f9424e2229c4e2b13017e973f89 | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Controller/CustomerController.php#L176-L207 |
17,370 | slashworks/control-bundle | src/Slashworks/AppBundle/Controller/CustomerController.php | CustomerController._handleLogoUpload | private function _handleLogoUpload(Request &$request, Customer &$oCustomer)
{
$sLogoPath = "";
/** @var FileBag $t */
$oFiles = $request->files;
$aFiles = $oFiles->get("slashworks_appbundle_customer");
$sUploadPath = __DIR__ . "/../../../..... | php | private function _handleLogoUpload(Request &$request, Customer &$oCustomer)
{
$sLogoPath = "";
/** @var FileBag $t */
$oFiles = $request->files;
$aFiles = $oFiles->get("slashworks_appbundle_customer");
$sUploadPath = __DIR__ . "/../../../..... | [
"private",
"function",
"_handleLogoUpload",
"(",
"Request",
"&",
"$",
"request",
",",
"Customer",
"&",
"$",
"oCustomer",
")",
"{",
"$",
"sLogoPath",
"=",
"\"\"",
";",
"/** @var FileBag $t */",
"$",
"oFiles",
"=",
"$",
"request",
"->",
"files",
";",
"$",
"a... | Handle Logo uplaod
@param \Symfony\Component\HttpFoundation\Request $request
@param \Slashworks\AppBundle\Model\Customer $oCustomer
@return string | [
"Handle",
"Logo",
"uplaod"
] | 2ba86d96f1f41f9424e2229c4e2b13017e973f89 | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Controller/CustomerController.php#L242-L267 |
17,371 | slashworks/control-bundle | src/Slashworks/AppBundle/Controller/CustomerController.php | CustomerController.createCreateForm | private function createCreateForm(Customer $oCustomer)
{
$form = $this->createForm(new CustomerType(array("language" => $this->get('request')->getLocale())), $oCustomer, array(
'action' => $this->generateUrl('backend_system_customer_create'),
'method' => 'POST',
... | php | private function createCreateForm(Customer $oCustomer)
{
$form = $this->createForm(new CustomerType(array("language" => $this->get('request')->getLocale())), $oCustomer, array(
'action' => $this->generateUrl('backend_system_customer_create'),
'method' => 'POST',
... | [
"private",
"function",
"createCreateForm",
"(",
"Customer",
"$",
"oCustomer",
")",
"{",
"$",
"form",
"=",
"$",
"this",
"->",
"createForm",
"(",
"new",
"CustomerType",
"(",
"array",
"(",
"\"language\"",
"=>",
"$",
"this",
"->",
"get",
"(",
"'request'",
")",... | Creates a form to create a Customer entity.
@param Customer $oCustomer The entity
@return \Symfony\Component\Form\Form The form | [
"Creates",
"a",
"form",
"to",
"create",
"a",
"Customer",
"entity",
"."
] | 2ba86d96f1f41f9424e2229c4e2b13017e973f89 | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Controller/CustomerController.php#L277-L288 |
17,372 | slashworks/control-bundle | src/Slashworks/AppBundle/Controller/CustomerController.php | CustomerController.createEditForm | private function createEditForm(Customer $oCustomer)
{
$oForm = $this->createForm(new CustomerType(array("language" => $this->get('request')->getLocale())), $oCustomer, array(
'action' => $this->generateUrl('backend_system_customer_update', array('id' => $oCustomer->getId())),
... | php | private function createEditForm(Customer $oCustomer)
{
$oForm = $this->createForm(new CustomerType(array("language" => $this->get('request')->getLocale())), $oCustomer, array(
'action' => $this->generateUrl('backend_system_customer_update', array('id' => $oCustomer->getId())),
... | [
"private",
"function",
"createEditForm",
"(",
"Customer",
"$",
"oCustomer",
")",
"{",
"$",
"oForm",
"=",
"$",
"this",
"->",
"createForm",
"(",
"new",
"CustomerType",
"(",
"array",
"(",
"\"language\"",
"=>",
"$",
"this",
"->",
"get",
"(",
"'request'",
")",
... | Create form for editing customer
@param \Slashworks\AppBundle\Model\Customer $oCustomer
@return \Symfony\Component\Form\Form | [
"Create",
"form",
"for",
"editing",
"customer"
] | 2ba86d96f1f41f9424e2229c4e2b13017e973f89 | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Controller/CustomerController.php#L298-L309 |
17,373 | mremi/Flowdock | src/Mremi/Flowdock/Api/Push/Push.php | Push.sendMessage | protected function sendMessage(BaseMessageInterface $message, $baseUrl, array $options = array())
{
$client = $this->createClient(sprintf('%s/%s', $baseUrl, $this->flowApiToken));
$response = $client->post(null, array_merge(
$options, [
'headers' => ['Content-Type' => 'a... | php | protected function sendMessage(BaseMessageInterface $message, $baseUrl, array $options = array())
{
$client = $this->createClient(sprintf('%s/%s', $baseUrl, $this->flowApiToken));
$response = $client->post(null, array_merge(
$options, [
'headers' => ['Content-Type' => 'a... | [
"protected",
"function",
"sendMessage",
"(",
"BaseMessageInterface",
"$",
"message",
",",
"$",
"baseUrl",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"client",
"=",
"$",
"this",
"->",
"createClient",
"(",
"sprintf",
"(",
"'%s/%s'",... | Sends a message to a flow
@param BaseMessageInterface $message A message instance to send
@param string $baseUrl A base URL
@param array $options An array of options used by request
@return boolean | [
"Sends",
"a",
"message",
"to",
"a",
"flow"
] | 287bfdcef17529055f803f2316e3ad31826e79eb | https://github.com/mremi/Flowdock/blob/287bfdcef17529055f803f2316e3ad31826e79eb/src/Mremi/Flowdock/Api/Push/Push.php#L66-L80 |
17,374 | alanpich/slender | src/Core/ConfigFinder/ConfigFinder.php | ConfigFinder.findFiles | public function findFiles()
{
$search = (new Finder())->files();
// Add in paths
foreach ($this->paths as $path) {
if (is_readable($path)) {
$search->in($path);
}
}
// Add in names
foreach ($this->files as $pattern) {
... | php | public function findFiles()
{
$search = (new Finder())->files();
// Add in paths
foreach ($this->paths as $path) {
if (is_readable($path)) {
$search->in($path);
}
}
// Add in names
foreach ($this->files as $pattern) {
... | [
"public",
"function",
"findFiles",
"(",
")",
"{",
"$",
"search",
"=",
"(",
"new",
"Finder",
"(",
")",
")",
"->",
"files",
"(",
")",
";",
"// Add in paths",
"foreach",
"(",
"$",
"this",
"->",
"paths",
"as",
"$",
"path",
")",
"{",
"if",
"(",
"is_read... | Return an array of file paths to config files
@return array of string paths | [
"Return",
"an",
"array",
"of",
"file",
"paths",
"to",
"config",
"files"
] | 247f5c08af20cda95b116eb5d9f6f623d61e8a8a | https://github.com/alanpich/slender/blob/247f5c08af20cda95b116eb5d9f6f623d61e8a8a/src/Core/ConfigFinder/ConfigFinder.php#L54-L75 |
17,375 | vi-kon/laravel-auth | src/ViKon/Auth/Model/User.php | User.hasRole | public function hasRole($role)
{
if (!$this->roles->where('token', $role)->isEmpty()) {
return true;
}
foreach ($this->groups as $group) {
if (!$group->roles->where('token', $role)->isEmpty()) {
return true;
}
}
return fal... | php | public function hasRole($role)
{
if (!$this->roles->where('token', $role)->isEmpty()) {
return true;
}
foreach ($this->groups as $group) {
if (!$group->roles->where('token', $role)->isEmpty()) {
return true;
}
}
return fal... | [
"public",
"function",
"hasRole",
"(",
"$",
"role",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"roles",
"->",
"where",
"(",
"'token'",
",",
"$",
"role",
")",
"->",
"isEmpty",
"(",
")",
")",
"{",
"return",
"true",
";",
"}",
"foreach",
"(",
"$",
... | Check if user has given role
@param string $role
@return bool | [
"Check",
"if",
"user",
"has",
"given",
"role"
] | 501c20128f43347a2ca271a53435297f9ef7f567 | https://github.com/vi-kon/laravel-auth/blob/501c20128f43347a2ca271a53435297f9ef7f567/src/ViKon/Auth/Model/User.php#L167-L180 |
17,376 | vi-kon/laravel-auth | src/ViKon/Auth/Model/User.php | User.hasPermission | public function hasPermission($permission)
{
if (!$this->permissions->where('token', $permission)->isEmpty()) {
return true;
}
foreach ($this->groups as $group) {
foreach ($group->roles as $role) {
if (!$role->permissions->where('token', $permission)-... | php | public function hasPermission($permission)
{
if (!$this->permissions->where('token', $permission)->isEmpty()) {
return true;
}
foreach ($this->groups as $group) {
foreach ($group->roles as $role) {
if (!$role->permissions->where('token', $permission)-... | [
"public",
"function",
"hasPermission",
"(",
"$",
"permission",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"permissions",
"->",
"where",
"(",
"'token'",
",",
"$",
"permission",
")",
"->",
"isEmpty",
"(",
")",
")",
"{",
"return",
"true",
";",
"}",
"f... | Check if user has given permission
@param string $permission
@return bool | [
"Check",
"if",
"user",
"has",
"given",
"permission"
] | 501c20128f43347a2ca271a53435297f9ef7f567 | https://github.com/vi-kon/laravel-auth/blob/501c20128f43347a2ca271a53435297f9ef7f567/src/ViKon/Auth/Model/User.php#L189-L210 |
17,377 | jenwachter/html-form | src/Elements/Parents/Field.php | Field.extractArgs | public function extractArgs($args)
{
foreach ($args as $k => $v) {
if (property_exists($this, $k)) {
$this->$k = $v;
} else {
throw new \InvalidArgumentException("{$k} is not a valid option.");
}
}
} | php | public function extractArgs($args)
{
foreach ($args as $k => $v) {
if (property_exists($this, $k)) {
$this->$k = $v;
} else {
throw new \InvalidArgumentException("{$k} is not a valid option.");
}
}
} | [
"public",
"function",
"extractArgs",
"(",
"$",
"args",
")",
"{",
"foreach",
"(",
"$",
"args",
"as",
"$",
"k",
"=>",
"$",
"v",
")",
"{",
"if",
"(",
"property_exists",
"(",
"$",
"this",
",",
"$",
"k",
")",
")",
"{",
"$",
"this",
"->",
"$",
"k",
... | Loops through a given array and it the key
exists as a property on this object, it is
assigned.
@param array $args Associative array
@return self | [
"Loops",
"through",
"a",
"given",
"array",
"and",
"it",
"the",
"key",
"exists",
"as",
"a",
"property",
"on",
"this",
"object",
"it",
"is",
"assigned",
"."
] | eaece87d474f7da5c25679548fb8f1608a94303c | https://github.com/jenwachter/html-form/blob/eaece87d474f7da5c25679548fb8f1608a94303c/src/Elements/Parents/Field.php#L125-L134 |
17,378 | jenwachter/html-form | src/Elements/Parents/Field.php | Field.getDisplayValue | public function getDisplayValue($formid = null)
{
if ($formid && isset($_SESSION[$formid][$this->name])) {
$value = $_SESSION[$formid][$this->name];
} else if (isset($_POST[$this->name])) {
$value = $_POST[$this->name];
} else {
$value = $this->defaultValue;
}
return $this->cleanValue($value);
} | php | public function getDisplayValue($formid = null)
{
if ($formid && isset($_SESSION[$formid][$this->name])) {
$value = $_SESSION[$formid][$this->name];
} else if (isset($_POST[$this->name])) {
$value = $_POST[$this->name];
} else {
$value = $this->defaultValue;
}
return $this->cleanValue($value);
} | [
"public",
"function",
"getDisplayValue",
"(",
"$",
"formid",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"formid",
"&&",
"isset",
"(",
"$",
"_SESSION",
"[",
"$",
"formid",
"]",
"[",
"$",
"this",
"->",
"name",
"]",
")",
")",
"{",
"$",
"value",
"=",
"$"... | Get the value to display in the form field.
Either the value in the session, post data,
the default value, or nothing.
@param string Form ID
@return [type] [description] | [
"Get",
"the",
"value",
"to",
"display",
"in",
"the",
"form",
"field",
".",
"Either",
"the",
"value",
"in",
"the",
"session",
"post",
"data",
"the",
"default",
"value",
"or",
"nothing",
"."
] | eaece87d474f7da5c25679548fb8f1608a94303c | https://github.com/jenwachter/html-form/blob/eaece87d474f7da5c25679548fb8f1608a94303c/src/Elements/Parents/Field.php#L165-L176 |
17,379 | jenwachter/html-form | src/Elements/Parents/Field.php | Field.cleanValue | protected function cleanValue($value)
{
if (is_array($value)) {
return array_map(function ($v) {
return $this->cleanValue($v);
}, $value);
} else {
return stripslashes($value);
}
} | php | protected function cleanValue($value)
{
if (is_array($value)) {
return array_map(function ($v) {
return $this->cleanValue($v);
}, $value);
} else {
return stripslashes($value);
}
} | [
"protected",
"function",
"cleanValue",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"return",
"array_map",
"(",
"function",
"(",
"$",
"v",
")",
"{",
"return",
"$",
"this",
"->",
"cleanValue",
"(",
"$",
"v",
... | Clean a value up for repopulation in a form field
@param mixed $value String or array
@return mixed | [
"Clean",
"a",
"value",
"up",
"for",
"repopulation",
"in",
"a",
"form",
"field"
] | eaece87d474f7da5c25679548fb8f1608a94303c | https://github.com/jenwachter/html-form/blob/eaece87d474f7da5c25679548fb8f1608a94303c/src/Elements/Parents/Field.php#L183-L192 |
17,380 | jenwachter/html-form | src/Elements/Parents/Field.php | Field.validate | public function validate()
{
$this->errors = array();
$value = $this->getRawValue();
if ($this->required) {
$passed = $this->validateRequired($value);
// don't do anymore validation until it passes the required validation
if (!$passed) return $this->errors;
// validate by field type
$this->val... | php | public function validate()
{
$this->errors = array();
$value = $this->getRawValue();
if ($this->required) {
$passed = $this->validateRequired($value);
// don't do anymore validation until it passes the required validation
if (!$passed) return $this->errors;
// validate by field type
$this->val... | [
"public",
"function",
"validate",
"(",
")",
"{",
"$",
"this",
"->",
"errors",
"=",
"array",
"(",
")",
";",
"$",
"value",
"=",
"$",
"this",
"->",
"getRawValue",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"required",
")",
"{",
"$",
"passed",
"=",... | Validate a field
@return boolean TRUE is valid; FALSE if invalid | [
"Validate",
"a",
"field"
] | eaece87d474f7da5c25679548fb8f1608a94303c | https://github.com/jenwachter/html-form/blob/eaece87d474f7da5c25679548fb8f1608a94303c/src/Elements/Parents/Field.php#L198-L224 |
17,381 | jenwachter/html-form | src/Elements/Parents/Field.php | Field.validateMaxLength | public function validateMaxLength($value)
{
if (!isset($this->attr["maxlength"])) return true;
$maxlength = trim($this->attr["maxlength"]);
$length = strlen($value);
if ($length > $maxlength) {
$this->errors[] = "\"{$this->label}\" contains {$length} characters, but it is limited to {$maxlength... | php | public function validateMaxLength($value)
{
if (!isset($this->attr["maxlength"])) return true;
$maxlength = trim($this->attr["maxlength"]);
$length = strlen($value);
if ($length > $maxlength) {
$this->errors[] = "\"{$this->label}\" contains {$length} characters, but it is limited to {$maxlength... | [
"public",
"function",
"validateMaxLength",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"attr",
"[",
"\"maxlength\"",
"]",
")",
")",
"return",
"true",
";",
"$",
"maxlength",
"=",
"trim",
"(",
"$",
"this",
"->",
"attr"... | Validates the maximum length of a form element.
@param string $value Current value of form field
@return boolean | [
"Validates",
"the",
"maximum",
"length",
"of",
"a",
"form",
"element",
"."
] | eaece87d474f7da5c25679548fb8f1608a94303c | https://github.com/jenwachter/html-form/blob/eaece87d474f7da5c25679548fb8f1608a94303c/src/Elements/Parents/Field.php#L248-L261 |
17,382 | jenwachter/html-form | src/Elements/Parents/Field.php | Field.validatePattern | public function validatePattern($value)
{
if (!isset($this->attr["pattern"])) return true;
$pattern = trim($this->attr["pattern"], "/");
if (!preg_match("/{$pattern}/", $value)) {
$this->errors[] = "\"{$this->label}\" must match the specified pattern.";
return false;
}
return true;
} | php | public function validatePattern($value)
{
if (!isset($this->attr["pattern"])) return true;
$pattern = trim($this->attr["pattern"], "/");
if (!preg_match("/{$pattern}/", $value)) {
$this->errors[] = "\"{$this->label}\" must match the specified pattern.";
return false;
}
return true;
} | [
"public",
"function",
"validatePattern",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"attr",
"[",
"\"pattern\"",
"]",
")",
")",
"return",
"true",
";",
"$",
"pattern",
"=",
"trim",
"(",
"$",
"this",
"->",
"attr",
"[... | Validates a form element with a pattern attribute.
@param string $label Form element label
@param string $value Current value of form field
@param string $element Form element object
@return boolean TRUE if passed validation; FALSE if failed validation | [
"Validates",
"a",
"form",
"element",
"with",
"a",
"pattern",
"attribute",
"."
] | eaece87d474f7da5c25679548fb8f1608a94303c | https://github.com/jenwachter/html-form/blob/eaece87d474f7da5c25679548fb8f1608a94303c/src/Elements/Parents/Field.php#L282-L294 |
17,383 | Double-Opt-in/php-client-api | src/Client/Commands/ActionsCommand.php | ActionsCommand.uri | public function uri(CryptographyEngine $cryptographyEngine)
{
$uri = parent::uri($cryptographyEngine);
$params = array(
'hash' => $cryptographyEngine->hash($this->email),
);
if (null !== $this->action)
$params['action'] = $this->action;
if (null !== $this->scope)
$params['scope'] = $this->scope;
... | php | public function uri(CryptographyEngine $cryptographyEngine)
{
$uri = parent::uri($cryptographyEngine);
$params = array(
'hash' => $cryptographyEngine->hash($this->email),
);
if (null !== $this->action)
$params['action'] = $this->action;
if (null !== $this->scope)
$params['scope'] = $this->scope;
... | [
"public",
"function",
"uri",
"(",
"CryptographyEngine",
"$",
"cryptographyEngine",
")",
"{",
"$",
"uri",
"=",
"parent",
"::",
"uri",
"(",
"$",
"cryptographyEngine",
")",
";",
"$",
"params",
"=",
"array",
"(",
"'hash'",
"=>",
"$",
"cryptographyEngine",
"->",
... | returns query parameter
hash: email will be hashed before requesting the server
action: optional action will be transmitted in plain text
scope: optional scope will be transmitted in plain text
@param CryptographyEngine $cryptographyEngine
@return string | [
"returns",
"query",
"parameter"
] | 2f17da58ec20a408bbd55b2cdd053bc689f995f4 | https://github.com/Double-Opt-in/php-client-api/blob/2f17da58ec20a408bbd55b2cdd053bc689f995f4/src/Client/Commands/ActionsCommand.php#L74-L91 |
17,384 | Double-Opt-in/php-client-api | src/Client/Commands/ActionsCommand.php | ActionsCommand.response | public function response(Response $response, CryptographyEngine $cryptographyEngine)
{
$decryptedResponse = new DecryptedCommandResponse($response);
$decryptedResponse->assignCryptographyEngine($cryptographyEngine, $this->email);
return $decryptedResponse;
} | php | public function response(Response $response, CryptographyEngine $cryptographyEngine)
{
$decryptedResponse = new DecryptedCommandResponse($response);
$decryptedResponse->assignCryptographyEngine($cryptographyEngine, $this->email);
return $decryptedResponse;
} | [
"public",
"function",
"response",
"(",
"Response",
"$",
"response",
",",
"CryptographyEngine",
"$",
"cryptographyEngine",
")",
"{",
"$",
"decryptedResponse",
"=",
"new",
"DecryptedCommandResponse",
"(",
"$",
"response",
")",
";",
"$",
"decryptedResponse",
"->",
"a... | creates a response from http response
@param Response $response
@param CryptographyEngine $cryptographyEngine
@return DecryptedCommandResponse | [
"creates",
"a",
"response",
"from",
"http",
"response"
] | 2f17da58ec20a408bbd55b2cdd053bc689f995f4 | https://github.com/Double-Opt-in/php-client-api/blob/2f17da58ec20a408bbd55b2cdd053bc689f995f4/src/Client/Commands/ActionsCommand.php#L113-L120 |
17,385 | userfriendly/SocialUserBundle | Controller/ProfileController.php | ProfileController.usernameAvailableAction | public function usernameAvailableAction( Request $request )
{
$response = array(
'cssClass' => 'success',
'text' => 'username is available',
);
$user = $this->get( 'userfriendly_social_user.oauth_user_provider' )
->findOneByUsernameSlug( $request-... | php | public function usernameAvailableAction( Request $request )
{
$response = array(
'cssClass' => 'success',
'text' => 'username is available',
);
$user = $this->get( 'userfriendly_social_user.oauth_user_provider' )
->findOneByUsernameSlug( $request-... | [
"public",
"function",
"usernameAvailableAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"response",
"=",
"array",
"(",
"'cssClass'",
"=>",
"'success'",
",",
"'text'",
"=>",
"'username is available'",
",",
")",
";",
"$",
"user",
"=",
"$",
"this",
"->"... | AJAX action for checking username availability
@param \Symfony\Component\HttpFoundation\Request $request
@return \Symfony\Component\HttpFoundation\Response | [
"AJAX",
"action",
"for",
"checking",
"username",
"availability"
] | 1dfcf76af2bc639901c471e6f28b04d73fb65452 | https://github.com/userfriendly/SocialUserBundle/blob/1dfcf76af2bc639901c471e6f28b04d73fb65452/Controller/ProfileController.php#L131-L156 |
17,386 | userfriendly/SocialUserBundle | Controller/ProfileController.php | ProfileController.showAndEdit | private function showAndEdit( Request $request, $action )
{
$user = $this->get( 'userfriendly_social_user.oauth_user_provider' )
->findOneByUsernameSlug( $request->get( 'username_slug' ));
if ( $user )
{
$currentUser = $this->get( 'security.context' )->getTok... | php | private function showAndEdit( Request $request, $action )
{
$user = $this->get( 'userfriendly_social_user.oauth_user_provider' )
->findOneByUsernameSlug( $request->get( 'username_slug' ));
if ( $user )
{
$currentUser = $this->get( 'security.context' )->getTok... | [
"private",
"function",
"showAndEdit",
"(",
"Request",
"$",
"request",
",",
"$",
"action",
")",
"{",
"$",
"user",
"=",
"$",
"this",
"->",
"get",
"(",
"'userfriendly_social_user.oauth_user_provider'",
")",
"->",
"findOneByUsernameSlug",
"(",
"$",
"request",
"->",
... | Private methods for use in this Controller's public methods | [
"Private",
"methods",
"for",
"use",
"in",
"this",
"Controller",
"s",
"public",
"methods"
] | 1dfcf76af2bc639901c471e6f28b04d73fb65452 | https://github.com/userfriendly/SocialUserBundle/blob/1dfcf76af2bc639901c471e6f28b04d73fb65452/Controller/ProfileController.php#L162-L182 |
17,387 | FuriosoJack/LaraException | src/Controllers/BasicController.php | BasicController.laraException | public function laraException(Request $request)
{
$storage = Storage::disk('local');
$fileName = base64_decode(urldecode($request->get('errors')));
if(!$storage->exists($fileName)){
$info = null;
}else{
$info = $storage->get($fileName);
}
$... | php | public function laraException(Request $request)
{
$storage = Storage::disk('local');
$fileName = base64_decode(urldecode($request->get('errors')));
if(!$storage->exists($fileName)){
$info = null;
}else{
$info = $storage->get($fileName);
}
$... | [
"public",
"function",
"laraException",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"storage",
"=",
"Storage",
"::",
"disk",
"(",
"'local'",
")",
";",
"$",
"fileName",
"=",
"base64_decode",
"(",
"urldecode",
"(",
"$",
"request",
"->",
"get",
"(",
"'err... | Controlador encargado de validar que debe retornar si la vista o el response JSON
@return \Illuminate\Contracts\View\Factory|\Illuminate\Http\JsonResponse|\Illuminate\View\View | [
"Controlador",
"encargado",
"de",
"validar",
"que",
"debe",
"retornar",
"si",
"la",
"vista",
"o",
"el",
"response",
"JSON"
] | b30ec2ed3331d99fca4d0ae47c8710a522bd0c19 | https://github.com/FuriosoJack/LaraException/blob/b30ec2ed3331d99fca4d0ae47c8710a522bd0c19/src/Controllers/BasicController.php#L31-L67 |
17,388 | CakeCMS/Core | src/ORM/Behavior/CachedBehavior.php | CachedBehavior.initialize | public function initialize(array $config)
{
$config = Hash::merge($this->_defaultConfig, $config);
$this->setConfig($config);
} | php | public function initialize(array $config)
{
$config = Hash::merge($this->_defaultConfig, $config);
$this->setConfig($config);
} | [
"public",
"function",
"initialize",
"(",
"array",
"$",
"config",
")",
"{",
"$",
"config",
"=",
"Hash",
"::",
"merge",
"(",
"$",
"this",
"->",
"_defaultConfig",
",",
"$",
"config",
")",
";",
"$",
"this",
"->",
"setConfig",
"(",
"$",
"config",
")",
";"... | Initialize hook.
@param array $config The config for this behavior.
@return void | [
"Initialize",
"hook",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/ORM/Behavior/CachedBehavior.php#L49-L53 |
17,389 | CakeCMS/Core | src/ORM/Behavior/CachedBehavior.php | CachedBehavior._clearCacheGroup | protected function _clearCacheGroup()
{
$cacheGroups = (array) $this->getConfig('groups');
foreach ($cacheGroups as $group) {
Cache::clearGroup($group, $this->getConfig('config'));
}
} | php | protected function _clearCacheGroup()
{
$cacheGroups = (array) $this->getConfig('groups');
foreach ($cacheGroups as $group) {
Cache::clearGroup($group, $this->getConfig('config'));
}
} | [
"protected",
"function",
"_clearCacheGroup",
"(",
")",
"{",
"$",
"cacheGroups",
"=",
"(",
"array",
")",
"$",
"this",
"->",
"getConfig",
"(",
"'groups'",
")",
";",
"foreach",
"(",
"$",
"cacheGroups",
"as",
"$",
"group",
")",
"{",
"Cache",
"::",
"clearGrou... | Clear cache group.
@return void | [
"Clear",
"cache",
"group",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/ORM/Behavior/CachedBehavior.php#L86-L92 |
17,390 | Kylob/Bootstrap | src/Common.php | Common.lister | public function lister($tag, array $list)
{
$html = '';
$class = '';
if ($space = strpos($tag, ' ')) {
$class = trim(substr($tag, $space));
$tag = substr($tag, 0, $space);
}
foreach ($list as $key => $value) {
if ($tag == 'dl') {
... | php | public function lister($tag, array $list)
{
$html = '';
$class = '';
if ($space = strpos($tag, ' ')) {
$class = trim(substr($tag, $space));
$tag = substr($tag, 0, $space);
}
foreach ($list as $key => $value) {
if ($tag == 'dl') {
... | [
"public",
"function",
"lister",
"(",
"$",
"tag",
",",
"array",
"$",
"list",
")",
"{",
"$",
"html",
"=",
"''",
";",
"$",
"class",
"=",
"''",
";",
"if",
"(",
"$",
"space",
"=",
"strpos",
"(",
"$",
"tag",
",",
"' '",
")",
")",
"{",
"$",
"class",... | This assists you in making Ordered, Unordered, and Definition lists. It is especially useful when you are nesting lists within lists. Your code almost looks exactly like you would expect to see it on the big screen. It would have been nice if we could have named this method 'list', but someone has taken that already.
... | [
"This",
"assists",
"you",
"in",
"making",
"Ordered",
"Unordered",
"and",
"Definition",
"lists",
".",
"It",
"is",
"especially",
"useful",
"when",
"you",
"are",
"nesting",
"lists",
"within",
"lists",
".",
"Your",
"code",
"almost",
"looks",
"exactly",
"like",
"... | 0d7677a90656fbc461eabb5512ab16f9d5f728c6 | https://github.com/Kylob/Bootstrap/blob/0d7677a90656fbc461eabb5512ab16f9d5f728c6/src/Common.php#L172-L190 |
17,391 | Kylob/Bootstrap | src/Common.php | Common.search | public function search($url, array $form = array())
{
$html = '';
$form = array_merge(array(
'name' => 'search',
'role' => 'search',
'class' => 'form-horizontal',
'placeholder' => 'Search',
'button' => $this->icon('search'),
'si... | php | public function search($url, array $form = array())
{
$html = '';
$form = array_merge(array(
'name' => 'search',
'role' => 'search',
'class' => 'form-horizontal',
'placeholder' => 'Search',
'button' => $this->icon('search'),
'si... | [
"public",
"function",
"search",
"(",
"$",
"url",
",",
"array",
"$",
"form",
"=",
"array",
"(",
")",
")",
"{",
"$",
"html",
"=",
"''",
";",
"$",
"form",
"=",
"array_merge",
"(",
"array",
"(",
"'name'",
"=>",
"'search'",
",",
"'role'",
"=>",
"'search... | This will assist you in creating a search bar for your site.
@param string $url This is the url that you would like the search term to be sent to
@param array $form To customize the form, you can submit an array with any of the following keys:
- '**name**' - The name of the input field. The default is '**search**'.... | [
"This",
"will",
"assist",
"you",
"in",
"creating",
"a",
"search",
"bar",
"for",
"your",
"site",
"."
] | 0d7677a90656fbc461eabb5512ab16f9d5f728c6 | https://github.com/Kylob/Bootstrap/blob/0d7677a90656fbc461eabb5512ab16f9d5f728c6/src/Common.php#L213-L248 |
17,392 | Kylob/Bootstrap | src/Common.php | Common.icon | public function icon($symbol, $prefix = 'glyphicon', $tag = 'i')
{
$base = $prefix;
$classes = explode(' ', $symbol);
$prefix = array($classes[0]); // ie. only prefix the first class
$params = '';
if ($space = strpos($tag, ' ')) {
$params = ' '.trim(substr($tag, $... | php | public function icon($symbol, $prefix = 'glyphicon', $tag = 'i')
{
$base = $prefix;
$classes = explode(' ', $symbol);
$prefix = array($classes[0]); // ie. only prefix the first class
$params = '';
if ($space = strpos($tag, ' ')) {
$params = ' '.trim(substr($tag, $... | [
"public",
"function",
"icon",
"(",
"$",
"symbol",
",",
"$",
"prefix",
"=",
"'glyphicon'",
",",
"$",
"tag",
"=",
"'i'",
")",
"{",
"$",
"base",
"=",
"$",
"prefix",
";",
"$",
"classes",
"=",
"explode",
"(",
"' '",
",",
"$",
"symbol",
")",
";",
"$",
... | Create an icon without the verbosity.
@param string $symbol The icon you would like to display without the base and icon class prefix.
@param string $prefix The base and icon class prefix. The default is a Bootstrap icon, but this can be used with any icon font by simply entering their prefix value here.
@param string... | [
"Create",
"an",
"icon",
"without",
"the",
"verbosity",
"."
] | 0d7677a90656fbc461eabb5512ab16f9d5f728c6 | https://github.com/Kylob/Bootstrap/blob/0d7677a90656fbc461eabb5512ab16f9d5f728c6/src/Common.php#L309-L326 |
17,393 | Kylob/Bootstrap | src/Common.php | Common.button | public function button($class, $name, array $options = array())
{
$attributes = array('type' => 'button');
foreach ($options as $key => $value) {
if (!in_array($key, array('dropdown', 'dropup', 'active', 'disabled', 'pull'))) {
$attributes[$key] = $value;
}
... | php | public function button($class, $name, array $options = array())
{
$attributes = array('type' => 'button');
foreach ($options as $key => $value) {
if (!in_array($key, array('dropdown', 'dropup', 'active', 'disabled', 'pull'))) {
$attributes[$key] = $value;
}
... | [
"public",
"function",
"button",
"(",
"$",
"class",
",",
"$",
"name",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"attributes",
"=",
"array",
"(",
"'type'",
"=>",
"'button'",
")",
";",
"foreach",
"(",
"$",
"options",
"as",
"... | A button by itself is easy enough, but when you start including dropdowns and groups your markup can get ugly quick. Follow the examples. We'll start simple and go from there.
@param string $class The classes: '**xs**', '**sm**', '**lg**', '**block**', '**default**', '**primary**', '**success**', '**info**', '**warn... | [
"A",
"button",
"by",
"itself",
"is",
"easy",
"enough",
"but",
"when",
"you",
"start",
"including",
"dropdowns",
"and",
"groups",
"your",
"markup",
"can",
"get",
"ugly",
"quick",
".",
"Follow",
"the",
"examples",
".",
"We",
"ll",
"start",
"simple",
"and",
... | 0d7677a90656fbc461eabb5512ab16f9d5f728c6 | https://github.com/Kylob/Bootstrap/blob/0d7677a90656fbc461eabb5512ab16f9d5f728c6/src/Common.php#L366-L409 |
17,394 | Kylob/Bootstrap | src/Common.php | Common.group | public function group($class, array $buttons, $form = '')
{
$attributes = array('class' => $this->prefixClasses('btn-group', array('xs', 'sm', 'lg', 'justified', 'vertical'), $class));
if ($form == 'checkbox' || $form == 'radio') {
$attributes['data-toggle'] = 'buttons-'.$form;
}... | php | public function group($class, array $buttons, $form = '')
{
$attributes = array('class' => $this->prefixClasses('btn-group', array('xs', 'sm', 'lg', 'justified', 'vertical'), $class));
if ($form == 'checkbox' || $form == 'radio') {
$attributes['data-toggle'] = 'buttons-'.$form;
}... | [
"public",
"function",
"group",
"(",
"$",
"class",
",",
"array",
"$",
"buttons",
",",
"$",
"form",
"=",
"''",
")",
"{",
"$",
"attributes",
"=",
"array",
"(",
"'class'",
"=>",
"$",
"this",
"->",
"prefixClasses",
"(",
"'btn-group'",
",",
"array",
"(",
"... | Group your buttons together.
@param string $class The classes: '**xs**', '**sm**', '**lg**', '**justified**', and '**vertical**' will all be prefixed with '**btn-group-...**', and we include the '**btn-group**' class too. When you size a group up, then don't size the individual buttons.
@param array $buttons An ``a... | [
"Group",
"your",
"buttons",
"together",
"."
] | 0d7677a90656fbc461eabb5512ab16f9d5f728c6 | https://github.com/Kylob/Bootstrap/blob/0d7677a90656fbc461eabb5512ab16f9d5f728c6/src/Common.php#L437-L451 |
17,395 | Kylob/Bootstrap | src/Common.php | Common.tabs | public function tabs(array $links, array $options = array())
{
$class = 'nav nav-tabs';
if (isset($options['align'])) {
switch ($options['align']) {
case 'justified':
$class .= ' nav-justified';
break;
case 'left':
... | php | public function tabs(array $links, array $options = array())
{
$class = 'nav nav-tabs';
if (isset($options['align'])) {
switch ($options['align']) {
case 'justified':
$class .= ' nav-justified';
break;
case 'left':
... | [
"public",
"function",
"tabs",
"(",
"array",
"$",
"links",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"class",
"=",
"'nav nav-tabs'",
";",
"if",
"(",
"isset",
"(",
"$",
"options",
"[",
"'align'",
"]",
")",
")",
"{",
"switch... | Creates a Bootstrap tabs nav menu.
@param array $links An ``array($name => $href, ...)`` of links. If **$href** is an array unto itself, then it will be turned into a dropdown menu with the same header and divider rules applied as with ``$bp->buttons()``.
@param array $options The available options are:
- '**active... | [
"Creates",
"a",
"Bootstrap",
"tabs",
"nav",
"menu",
"."
] | 0d7677a90656fbc461eabb5512ab16f9d5f728c6 | https://github.com/Kylob/Bootstrap/blob/0d7677a90656fbc461eabb5512ab16f9d5f728c6/src/Common.php#L586-L602 |
17,396 | Kylob/Bootstrap | src/Common.php | Common.pills | public function pills(array $links, array $options = array())
{
$class = 'nav nav-pills';
if (isset($options['align'])) {
switch ($options['align']) {
case 'justified':
$class .= ' nav-justified';
break;
case 'vertic... | php | public function pills(array $links, array $options = array())
{
$class = 'nav nav-pills';
if (isset($options['align'])) {
switch ($options['align']) {
case 'justified':
$class .= ' nav-justified';
break;
case 'vertic... | [
"public",
"function",
"pills",
"(",
"array",
"$",
"links",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"class",
"=",
"'nav nav-pills'",
";",
"if",
"(",
"isset",
"(",
"$",
"options",
"[",
"'align'",
"]",
")",
")",
"{",
"swit... | Creates a Bootstrap pills nav menu.
@param array $links An ``array($name => $href, ...)`` of links. If **$href** is an array unto itself, then it will be turned into a dropdown menu with the same header and divider rules applied as with ``$bp->buttons()``.
@param array $options The available options are:
- '**activ... | [
"Creates",
"a",
"Bootstrap",
"pills",
"nav",
"menu",
"."
] | 0d7677a90656fbc461eabb5512ab16f9d5f728c6 | https://github.com/Kylob/Bootstrap/blob/0d7677a90656fbc461eabb5512ab16f9d5f728c6/src/Common.php#L637-L657 |
17,397 | Kylob/Bootstrap | src/Common.php | Common.breadcrumbs | public function breadcrumbs(array $links)
{
if (empty($links)) {
return '';
}
foreach ($links as $name => $href) {
if (is_array($href)) {
list($dropdown, $id) = $this->dropdown($href);
$link = $this->page->tag('a', array('href' => '#', ... | php | public function breadcrumbs(array $links)
{
if (empty($links)) {
return '';
}
foreach ($links as $name => $href) {
if (is_array($href)) {
list($dropdown, $id) = $this->dropdown($href);
$link = $this->page->tag('a', array('href' => '#', ... | [
"public",
"function",
"breadcrumbs",
"(",
"array",
"$",
"links",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"links",
")",
")",
"{",
"return",
"''",
";",
"}",
"foreach",
"(",
"$",
"links",
"as",
"$",
"name",
"=>",
"$",
"href",
")",
"{",
"if",
"(",
... | Creates a Bootstrap styled breadcrumb trail. The last link is automatically activated.
@param array $links An ``array($name => $href)`` of links to display. The **$href** may also be another ``array($name => $href)`` of dropdown links.
@return string
@example
```php
$bp->breadcrumbs(array(
'Home' => '#',
'Library' ... | [
"Creates",
"a",
"Bootstrap",
"styled",
"breadcrumb",
"trail",
".",
"The",
"last",
"link",
"is",
"automatically",
"activated",
"."
] | 0d7677a90656fbc461eabb5512ab16f9d5f728c6 | https://github.com/Kylob/Bootstrap/blob/0d7677a90656fbc461eabb5512ab16f9d5f728c6/src/Common.php#L676-L696 |
17,398 | Kylob/Bootstrap | src/Common.php | Common.alert | public function alert($type, $alert, $dismissable = true)
{
$html = '';
$class = 'alert alert-'.$type;
if ($dismissable) {
$class .= ' alert-dismissable';
}
$html .= '<div class="'.$class.'" role="alert">';
if ($dismissable) {
$html .= '<button... | php | public function alert($type, $alert, $dismissable = true)
{
$html = '';
$class = 'alert alert-'.$type;
if ($dismissable) {
$class .= ' alert-dismissable';
}
$html .= '<div class="'.$class.'" role="alert">';
if ($dismissable) {
$html .= '<button... | [
"public",
"function",
"alert",
"(",
"$",
"type",
",",
"$",
"alert",
",",
"$",
"dismissable",
"=",
"true",
")",
"{",
"$",
"html",
"=",
"''",
";",
"$",
"class",
"=",
"'alert alert-'",
".",
"$",
"type",
";",
"if",
"(",
"$",
"dismissable",
")",
"{",
... | Creates Bootstrap alert messages.
@param string $type Either '**success**', '**info**', '**warning**', or '**danger**'.
@param string $alert The status message. All ``<h1-6>`` headers and ``<a>`` links will be classed appropriately.
@param bool $dismissable If you set this to false, then the alert will ... | [
"Creates",
"Bootstrap",
"alert",
"messages",
"."
] | 0d7677a90656fbc461eabb5512ab16f9d5f728c6 | https://github.com/Kylob/Bootstrap/blob/0d7677a90656fbc461eabb5512ab16f9d5f728c6/src/Common.php#L757-L772 |
17,399 | Kylob/Bootstrap | src/Common.php | Common.progress | public function progress($percent, $class = '', $display = false)
{
$html = '';
$classes = (array) $class;
foreach ((array) $percent as $key => $progress) {
$class = (isset($classes[$key])) ? $classes[$key] : '';
$class = $this->prefixClasses('progress-bar', array('su... | php | public function progress($percent, $class = '', $display = false)
{
$html = '';
$classes = (array) $class;
foreach ((array) $percent as $key => $progress) {
$class = (isset($classes[$key])) ? $classes[$key] : '';
$class = $this->prefixClasses('progress-bar', array('su... | [
"public",
"function",
"progress",
"(",
"$",
"percent",
",",
"$",
"class",
"=",
"''",
",",
"$",
"display",
"=",
"false",
")",
"{",
"$",
"html",
"=",
"''",
";",
"$",
"classes",
"=",
"(",
"array",
")",
"$",
"class",
";",
"foreach",
"(",
"(",
"array"... | Creates every flavor of progress bar that Bootstrap has to offer.
@param int $percent The amount of progress from 0 to 100. In order to stack multiple values then turn this into an array.
@param string $class You can include one of the four contextual classes: '**success**', '**info**', '**warning**' or '**danger... | [
"Creates",
"every",
"flavor",
"of",
"progress",
"bar",
"that",
"Bootstrap",
"has",
"to",
"offer",
"."
] | 0d7677a90656fbc461eabb5512ab16f9d5f728c6 | https://github.com/Kylob/Bootstrap/blob/0d7677a90656fbc461eabb5512ab16f9d5f728c6/src/Common.php#L791-L809 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.