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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
197,900 | bseddon/XPath20 | DOM/DOMSchemaElement.php | DOMSchemaElement.fromQName | public static function fromQName( $name )
{
$types = SchemaTypes::getInstance();
if ( $name instanceof QName )
{
// If prefix is empty try looking it up
if ( empty( $name->prefix ) )
{
$prefix = $types->getPrefixForNamespace( $name->namespaceURI );
if ( $prefix ) $name->prefix = $pref... | php | public static function fromQName( $name )
{
$types = SchemaTypes::getInstance();
if ( $name instanceof QName )
{
// If prefix is empty try looking it up
if ( empty( $name->prefix ) )
{
$prefix = $types->getPrefixForNamespace( $name->namespaceURI );
if ( $prefix ) $name->prefix = $pref... | [
"public",
"static",
"function",
"fromQName",
"(",
"$",
"name",
")",
"{",
"$",
"types",
"=",
"SchemaTypes",
"::",
"getInstance",
"(",
")",
";",
"if",
"(",
"$",
"name",
"instanceof",
"QName",
")",
"{",
"// If prefix is empty try looking it up\r",
"if",
"(",
"e... | The qualified name of the element
@param QName|string $name | [
"The",
"qualified",
"name",
"of",
"the",
"element"
] | 69882b6efffaa5470a819d5fdd2f6473ddeb046d | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMSchemaElement.php#L50-L95 |
197,901 | mullanaphy/markup | src/PHY/Markup/Element.php | Element.toString | public function toString()
{
if ($this->void) {
return '<'.$this->tag.$this->createAttributes().' />';
} else {
return '<'.$this->tag.$this->createAttributes().'>'.$this->recursivelyStringify($this->content).'</'.$this->tag.'>';
}
} | php | public function toString()
{
if ($this->void) {
return '<'.$this->tag.$this->createAttributes().' />';
} else {
return '<'.$this->tag.$this->createAttributes().'>'.$this->recursivelyStringify($this->content).'</'.$this->tag.'>';
}
} | [
"public",
"function",
"toString",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"void",
")",
"{",
"return",
"'<'",
".",
"$",
"this",
"->",
"tag",
".",
"$",
"this",
"->",
"createAttributes",
"(",
")",
".",
"' />'",
";",
"}",
"else",
"{",
"return",
... | Generates the HTML and will recursively generate HTML out of inner
content.
@return string | [
"Generates",
"the",
"HTML",
"and",
"will",
"recursively",
"generate",
"HTML",
"out",
"of",
"inner",
"content",
"."
] | 7babac73bbefc2203aca990a8a42294a9738a0dd | https://github.com/mullanaphy/markup/blob/7babac73bbefc2203aca990a8a42294a9738a0dd/src/PHY/Markup/Element.php#L108-L115 |
197,902 | mullanaphy/markup | src/PHY/Markup/Element.php | Element.toArray | public function toArray()
{
return [
'tag' => $this->tag,
'void' => $this->void,
'attributes' => $this->attributes,
'content' => $this->recursivelyArrayify($this->content)
];
} | php | public function toArray()
{
return [
'tag' => $this->tag,
'void' => $this->void,
'attributes' => $this->attributes,
'content' => $this->recursivelyArrayify($this->content)
];
} | [
"public",
"function",
"toArray",
"(",
")",
"{",
"return",
"[",
"'tag'",
"=>",
"$",
"this",
"->",
"tag",
",",
"'void'",
"=>",
"$",
"this",
"->",
"void",
",",
"'attributes'",
"=>",
"$",
"this",
"->",
"attributes",
",",
"'content'",
"=>",
"$",
"this",
"... | Return our element as an array.
@return array | [
"Return",
"our",
"element",
"as",
"an",
"array",
"."
] | 7babac73bbefc2203aca990a8a42294a9738a0dd | https://github.com/mullanaphy/markup/blob/7babac73bbefc2203aca990a8a42294a9738a0dd/src/PHY/Markup/Element.php#L133-L141 |
197,903 | mullanaphy/markup | src/PHY/Markup/Element.php | Element.append | public function append($content = null)
{
if (null === $content) {
return;
} else if (is_array($content)) {
foreach ($content as $row) {
$this->content[] = $row;
}
} else {
$this->content[] = ... | php | public function append($content = null)
{
if (null === $content) {
return;
} else if (is_array($content)) {
foreach ($content as $row) {
$this->content[] = $row;
}
} else {
$this->content[] = ... | [
"public",
"function",
"append",
"(",
"$",
"content",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"content",
")",
"{",
"return",
";",
"}",
"else",
"if",
"(",
"is_array",
"(",
"$",
"content",
")",
")",
"{",
"foreach",
"(",
"$",
"content",
... | Append content into an element.
@param mixed $content
@return Element | [
"Append",
"content",
"into",
"an",
"element",
"."
] | 7babac73bbefc2203aca990a8a42294a9738a0dd | https://github.com/mullanaphy/markup/blob/7babac73bbefc2203aca990a8a42294a9738a0dd/src/PHY/Markup/Element.php#L159-L171 |
197,904 | mullanaphy/markup | src/PHY/Markup/Element.php | Element.attributes | public function attributes(array $attributes)
{
$this->attributes = array_replace($this->attributes, $this->markup->attributes($this->tag, $attributes));
return $this;
} | php | public function attributes(array $attributes)
{
$this->attributes = array_replace($this->attributes, $this->markup->attributes($this->tag, $attributes));
return $this;
} | [
"public",
"function",
"attributes",
"(",
"array",
"$",
"attributes",
")",
"{",
"$",
"this",
"->",
"attributes",
"=",
"array_replace",
"(",
"$",
"this",
"->",
"attributes",
",",
"$",
"this",
"->",
"markup",
"->",
"attributes",
"(",
"$",
"this",
"->",
"tag... | Change attributes of an element.
@param array $attributes
@return Element | [
"Change",
"attributes",
"of",
"an",
"element",
"."
] | 7babac73bbefc2203aca990a8a42294a9738a0dd | https://github.com/mullanaphy/markup/blob/7babac73bbefc2203aca990a8a42294a9738a0dd/src/PHY/Markup/Element.php#L179-L184 |
197,905 | mullanaphy/markup | src/PHY/Markup/Element.php | Element.prepend | public function prepend($content = null)
{
if (null === $content) {
return;
} else if (is_array($content)) {
foreach (array_reverse($content) as $row) {
array_unshift($this->content, $row);
}
} else {
... | php | public function prepend($content = null)
{
if (null === $content) {
return;
} else if (is_array($content)) {
foreach (array_reverse($content) as $row) {
array_unshift($this->content, $row);
}
} else {
... | [
"public",
"function",
"prepend",
"(",
"$",
"content",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"content",
")",
"{",
"return",
";",
"}",
"else",
"if",
"(",
"is_array",
"(",
"$",
"content",
")",
")",
"{",
"foreach",
"(",
"array_reverse",
... | Prepend content into an element.
@param mixed $content
@return Element | [
"Prepend",
"content",
"into",
"an",
"element",
"."
] | 7babac73bbefc2203aca990a8a42294a9738a0dd | https://github.com/mullanaphy/markup/blob/7babac73bbefc2203aca990a8a42294a9738a0dd/src/PHY/Markup/Element.php#L229-L241 |
197,906 | kaylathedev/io | src/JsonFileStorage.php | JsonFileStorage.open | public function open()
{
if (is_file($this->filename)) {
$fileData = file_get_contents($this->filename);
if (false === $fileData) {
throw new IOException('Unable to get the contents of the json file!');
}
} else {
$fileData = null;
... | php | public function open()
{
if (is_file($this->filename)) {
$fileData = file_get_contents($this->filename);
if (false === $fileData) {
throw new IOException('Unable to get the contents of the json file!');
}
} else {
$fileData = null;
... | [
"public",
"function",
"open",
"(",
")",
"{",
"if",
"(",
"is_file",
"(",
"$",
"this",
"->",
"filename",
")",
")",
"{",
"$",
"fileData",
"=",
"file_get_contents",
"(",
"$",
"this",
"->",
"filename",
")",
";",
"if",
"(",
"false",
"===",
"$",
"fileData",... | Opens the json file.
If the file isn't found, and the {@link createIfNotExists} method is
called with true, then the file will be created when data is written to it.
If the file is empty, then this class will assume the contents to be a
json object.
@return void | [
"Opens",
"the",
"json",
"file",
"."
] | 9e8754a6972fc80523d0aaadb6f5629e552f0043 | https://github.com/kaylathedev/io/blob/9e8754a6972fc80523d0aaadb6f5629e552f0043/src/JsonFileStorage.php#L72-L95 |
197,907 | kaylathedev/io | src/JsonFileStorage.php | JsonFileStorage.set | public function set($key, $value)
{
$this->assertOpened();
$this->contents[(string) $key] = $value;
} | php | public function set($key, $value)
{
$this->assertOpened();
$this->contents[(string) $key] = $value;
} | [
"public",
"function",
"set",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"assertOpened",
"(",
")",
";",
"$",
"this",
"->",
"contents",
"[",
"(",
"string",
")",
"$",
"key",
"]",
"=",
"$",
"value",
";",
"}"
] | Overwrites a record with the key parameter.
If the record doesn't exist, it will be created automatically.
The entire record will be replaced by the value parameter.
@param string $key The record's key.
@param mixed $value The value to be replaced with the record's contents.
@return void | [
"Overwrites",
"a",
"record",
"with",
"the",
"key",
"parameter",
"."
] | 9e8754a6972fc80523d0aaadb6f5629e552f0043 | https://github.com/kaylathedev/io/blob/9e8754a6972fc80523d0aaadb6f5629e552f0043/src/JsonFileStorage.php#L107-L111 |
197,908 | kaylathedev/io | src/JsonFileStorage.php | JsonFileStorage.get | public function get($key)
{
$this->assertOpened();
$key = (string) $key;
if (isset($this->contents[$key])) {
return $this->contents[$key];
}
return null;
} | php | public function get($key)
{
$this->assertOpened();
$key = (string) $key;
if (isset($this->contents[$key])) {
return $this->contents[$key];
}
return null;
} | [
"public",
"function",
"get",
"(",
"$",
"key",
")",
"{",
"$",
"this",
"->",
"assertOpened",
"(",
")",
";",
"$",
"key",
"=",
"(",
"string",
")",
"$",
"key",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"contents",
"[",
"$",
"key",
"]",
")",
... | Returns a record that originates from the opened json file.
If the key doesn't exist, then null will be returned.
@param string $key The key of the record.
@return mixed | [
"Returns",
"a",
"record",
"that",
"originates",
"from",
"the",
"opened",
"json",
"file",
"."
] | 9e8754a6972fc80523d0aaadb6f5629e552f0043 | https://github.com/kaylathedev/io/blob/9e8754a6972fc80523d0aaadb6f5629e552f0043/src/JsonFileStorage.php#L121-L129 |
197,909 | kaylathedev/io | src/JsonFileStorage.php | JsonFileStorage.clear | public function clear()
{
$this->assertOpened();
foreach ($this->contents as $key => $value) {
unset($this->contents[$key]);
}
} | php | public function clear()
{
$this->assertOpened();
foreach ($this->contents as $key => $value) {
unset($this->contents[$key]);
}
} | [
"public",
"function",
"clear",
"(",
")",
"{",
"$",
"this",
"->",
"assertOpened",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"contents",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"contents",
"[",
"$",
... | Deletes all of the records.
@return void | [
"Deletes",
"all",
"of",
"the",
"records",
"."
] | 9e8754a6972fc80523d0aaadb6f5629e552f0043 | https://github.com/kaylathedev/io/blob/9e8754a6972fc80523d0aaadb6f5629e552f0043/src/JsonFileStorage.php#L160-L166 |
197,910 | kaylathedev/io | src/JsonFileStorage.php | JsonFileStorage.close | public function close()
{
if (null !== $this->contents) {
$result = file_put_contents($this->filename, json_encode($this->contents));
if (false === $result) {
throw new IOException('Unable to write to file!');
}
$this->contents = null;
... | php | public function close()
{
if (null !== $this->contents) {
$result = file_put_contents($this->filename, json_encode($this->contents));
if (false === $result) {
throw new IOException('Unable to write to file!');
}
$this->contents = null;
... | [
"public",
"function",
"close",
"(",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"contents",
")",
"{",
"$",
"result",
"=",
"file_put_contents",
"(",
"$",
"this",
"->",
"filename",
",",
"json_encode",
"(",
"$",
"this",
"->",
"contents",
")",
... | Writes any pending changes to the opened json file
and disposes of the class.
If this object wasn't opened, then this method will do nothing.
@return void | [
"Writes",
"any",
"pending",
"changes",
"to",
"the",
"opened",
"json",
"file",
"and",
"disposes",
"of",
"the",
"class",
"."
] | 9e8754a6972fc80523d0aaadb6f5629e552f0043 | https://github.com/kaylathedev/io/blob/9e8754a6972fc80523d0aaadb6f5629e552f0043/src/JsonFileStorage.php#L175-L184 |
197,911 | Dhii/callback-abstract | src/NormalizeCallableCapableTrait.php | NormalizeCallableCapableTrait._normalizeCallable | public function _normalizeCallable($callable)
{
// Closure remains as such
if ($callable instanceof Closure) {
return $callable;
}
// Invocable objects take precedence over stringable ones
if (!(is_object($callable) && is_callable($callable))) {
try {... | php | public function _normalizeCallable($callable)
{
// Closure remains as such
if ($callable instanceof Closure) {
return $callable;
}
// Invocable objects take precedence over stringable ones
if (!(is_object($callable) && is_callable($callable))) {
try {... | [
"public",
"function",
"_normalizeCallable",
"(",
"$",
"callable",
")",
"{",
"// Closure remains as such",
"if",
"(",
"$",
"callable",
"instanceof",
"Closure",
")",
"{",
"return",
"$",
"callable",
";",
"}",
"// Invocable objects take precedence over stringable ones",
"if... | Normalizes a callable, such that it is possible to distinguish between function and method formats.
- 'MyClass:myMethod' -> ['MyClass', 'myMethod'].
- Closures remain closures.
- Invocable object -> [$object, '__invoke']
- An object that is both stringable and invocable will be treated as invocable.
- Arrays remain ar... | [
"Normalizes",
"a",
"callable",
"such",
"that",
"it",
"is",
"possible",
"to",
"distinguish",
"between",
"function",
"and",
"method",
"formats",
"."
] | 43ed4e99fc6ccdaf46a25d06da482a2fba8d9b19 | https://github.com/Dhii/callback-abstract/blob/43ed4e99fc6ccdaf46a25d06da482a2fba8d9b19/src/NormalizeCallableCapableTrait.php#L37-L59 |
197,912 | sndsgd/http | src/http/data/Collection.php | Collection.addValue | public function addValue(string $key, $value)
{
# ensure the total input variables doesn't exceed `max_input_variables`
if ($this->count === $this->maxVars) {
throw new DecodeException("max_input_variables exceeded");
}
# if the key has both open and close brackets
... | php | public function addValue(string $key, $value)
{
# ensure the total input variables doesn't exceed `max_input_variables`
if ($this->count === $this->maxVars) {
throw new DecodeException("max_input_variables exceeded");
}
# if the key has both open and close brackets
... | [
"public",
"function",
"addValue",
"(",
"string",
"$",
"key",
",",
"$",
"value",
")",
"{",
"# ensure the total input variables doesn't exceed `max_input_variables`",
"if",
"(",
"$",
"this",
"->",
"count",
"===",
"$",
"this",
"->",
"maxVars",
")",
"{",
"throw",
"n... | Add a value to the collection
@param string $key The key to add the value under
@param string|\sndsgd\http\UploadedFile $value The value to add | [
"Add",
"a",
"value",
"to",
"the",
"collection"
] | e7f82010a66c6d3241a24ea82baf4593130c723b | https://github.com/sndsgd/http/blob/e7f82010a66c6d3241a24ea82baf4593130c723b/src/http/data/Collection.php#L70-L90 |
197,913 | sndsgd/http | src/http/data/Collection.php | Collection.addNestedValue | protected function addNestedValue(string $key, $value, int $pos)
{
# convert the levels into an array of strings
$levels = (strpos($key, "][") !== false)
? explode("][", substr($key, $pos + 1, -1))
: [substr($key, $pos + 1, -1)];
array_unshift($levels, substr($key, 0... | php | protected function addNestedValue(string $key, $value, int $pos)
{
# convert the levels into an array of strings
$levels = (strpos($key, "][") !== false)
? explode("][", substr($key, $pos + 1, -1))
: [substr($key, $pos + 1, -1)];
array_unshift($levels, substr($key, 0... | [
"protected",
"function",
"addNestedValue",
"(",
"string",
"$",
"key",
",",
"$",
"value",
",",
"int",
"$",
"pos",
")",
"{",
"# convert the levels into an array of strings",
"$",
"levels",
"=",
"(",
"strpos",
"(",
"$",
"key",
",",
"\"][\"",
")",
"!==",
"false"... | Add a value that has a nested key
@param string $key
@param mixed $value
@param integer $pos The position of the first open bracket | [
"Add",
"a",
"value",
"that",
"has",
"a",
"nested",
"key"
] | e7f82010a66c6d3241a24ea82baf4593130c723b | https://github.com/sndsgd/http/blob/e7f82010a66c6d3241a24ea82baf4593130c723b/src/http/data/Collection.php#L99-L131 |
197,914 | squareproton/Bond | src/Bond/Normality/PhpClass.php | PhpClass.getUsesDeclarations | private function getUsesDeclarations()
{
asort( $this->usesDeclarations );
$output = [];
foreach( $this->usesDeclarations as $namespace ) {
$output[] = sprintf( 'use %s;', $namespace );
}
return new Format( $output );
} | php | private function getUsesDeclarations()
{
asort( $this->usesDeclarations );
$output = [];
foreach( $this->usesDeclarations as $namespace ) {
$output[] = sprintf( 'use %s;', $namespace );
}
return new Format( $output );
} | [
"private",
"function",
"getUsesDeclarations",
"(",
")",
"{",
"asort",
"(",
"$",
"this",
"->",
"usesDeclarations",
")",
";",
"$",
"output",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"usesDeclarations",
"as",
"$",
"namespace",
")",
"{",
"$",
... | Get uses declaration
@return Bond/Format | [
"Get",
"uses",
"declaration"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Normality/PhpClass.php#L194-L202 |
197,915 | squareproton/Bond | src/Bond/Normality/PhpClass.php | PhpClass.getClassDeclaration | private function getClassDeclaration()
{
return new Format(
sprintf(
'%sclass %s%s%s',
$this->isAbstract ? 'abstract ' : '',
$this->class,
$this->getImplementOrExtendsDeclaration('extends', $this->extends),
$this->ge... | php | private function getClassDeclaration()
{
return new Format(
sprintf(
'%sclass %s%s%s',
$this->isAbstract ? 'abstract ' : '',
$this->class,
$this->getImplementOrExtendsDeclaration('extends', $this->extends),
$this->ge... | [
"private",
"function",
"getClassDeclaration",
"(",
")",
"{",
"return",
"new",
"Format",
"(",
"sprintf",
"(",
"'%sclass %s%s%s'",
",",
"$",
"this",
"->",
"isAbstract",
"?",
"'abstract '",
":",
"''",
",",
"$",
"this",
"->",
"class",
",",
"$",
"this",
"->",
... | Get class declaration
@return Bond/Format | [
"Get",
"class",
"declaration"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Normality/PhpClass.php#L208-L219 |
197,916 | squareproton/Bond | src/Bond/Normality/PhpClass.php | PhpClass.getClassBody | private function getClassBody()
{
// sort the class components by their name
$this->classComponents->sort(
function( PhpClassComponent $a, PhpClassComponent $b ) {
if ($a::SORT_ORDERING == $b::SORT_ORDERING) {
return $a->name < $b->name ? -1 : 1;
... | php | private function getClassBody()
{
// sort the class components by their name
$this->classComponents->sort(
function( PhpClassComponent $a, PhpClassComponent $b ) {
if ($a::SORT_ORDERING == $b::SORT_ORDERING) {
return $a->name < $b->name ? -1 : 1;
... | [
"private",
"function",
"getClassBody",
"(",
")",
"{",
"// sort the class components by their name",
"$",
"this",
"->",
"classComponents",
"->",
"sort",
"(",
"function",
"(",
"PhpClassComponent",
"$",
"a",
",",
"PhpClassComponent",
"$",
"b",
")",
"{",
"if",
"(",
... | Get class body
@return Bond\Format | [
"Get",
"class",
"body"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Normality/PhpClass.php#L242-L277 |
197,917 | modulusphp/utility | GlobalVariables.php | GlobalVariables.get | public static function get() : array
{
return [
'csrf_token' => CSRF::generate(),
'errors' => Variable::has('validation.errors') ? Variable::get('validation.errors') : (new ValidatorFactory())->make([], [])->errors(),
'old' => Variable::has('form.old') ? Variable::get('form.old') : [],
];
... | php | public static function get() : array
{
return [
'csrf_token' => CSRF::generate(),
'errors' => Variable::has('validation.errors') ? Variable::get('validation.errors') : (new ValidatorFactory())->make([], [])->errors(),
'old' => Variable::has('form.old') ? Variable::get('form.old') : [],
];
... | [
"public",
"static",
"function",
"get",
"(",
")",
":",
"array",
"{",
"return",
"[",
"'csrf_token'",
"=>",
"CSRF",
"::",
"generate",
"(",
")",
",",
"'errors'",
"=>",
"Variable",
"::",
"has",
"(",
"'validation.errors'",
")",
"?",
"Variable",
"::",
"get",
"(... | Get global variables
@return array | [
"Get",
"global",
"variables"
] | c1e127539b13d3ec8381e41c64b881e0701807f5 | https://github.com/modulusphp/utility/blob/c1e127539b13d3ec8381e41c64b881e0701807f5/GlobalVariables.php#L19-L26 |
197,918 | Jalle19/yii-lazy-image | src/yiilazyimage/components/LazyImage.php | LazyImage.loadAssets | private static function loadAssets()
{
$am = \Yii::app()->assetManager;
$cs = \Yii::app()->clientScript;
// Publish all assets
self::$_assetsUrl = $am->publish(realpath(__DIR__.'/../assets'));
// Register jquery-unveil
$script = YII_DEBUG ? 'jquery-unveil.js' : 'jquery-unveil.min.js';
$cs->registerScr... | php | private static function loadAssets()
{
$am = \Yii::app()->assetManager;
$cs = \Yii::app()->clientScript;
// Publish all assets
self::$_assetsUrl = $am->publish(realpath(__DIR__.'/../assets'));
// Register jquery-unveil
$script = YII_DEBUG ? 'jquery-unveil.js' : 'jquery-unveil.min.js';
$cs->registerScr... | [
"private",
"static",
"function",
"loadAssets",
"(",
")",
"{",
"$",
"am",
"=",
"\\",
"Yii",
"::",
"app",
"(",
")",
"->",
"assetManager",
";",
"$",
"cs",
"=",
"\\",
"Yii",
"::",
"app",
"(",
")",
"->",
"clientScript",
";",
"// Publish all assets",
"self",... | Publishes the required assets | [
"Publishes",
"the",
"required",
"assets"
] | 8440028b7223b88fcd3f25e917ac8c40006567a8 | https://github.com/Jalle19/yii-lazy-image/blob/8440028b7223b88fcd3f25e917ac8c40006567a8/src/yiilazyimage/components/LazyImage.php#L56-L73 |
197,919 | QoboLtd/Qobo-WP-Custom-Theme-Path | src/qobo-custom-theme-path.php | Qobo_Custom_Theme_Path.get_default_path | public function get_default_path() {
if ( ! defined( 'ABSPATH' ) ) {
throw \RuntimeException( 'ABSPATH constant is not defined. Something is very wrong!' );
}
$default_path = $this->default_path;
// Allow to change this in wp-config.php or elsewhere.
if ( defined( 'QB_CUSTOM_THEME_PATH' ) ) {
$default... | php | public function get_default_path() {
if ( ! defined( 'ABSPATH' ) ) {
throw \RuntimeException( 'ABSPATH constant is not defined. Something is very wrong!' );
}
$default_path = $this->default_path;
// Allow to change this in wp-config.php or elsewhere.
if ( defined( 'QB_CUSTOM_THEME_PATH' ) ) {
$default... | [
"public",
"function",
"get_default_path",
"(",
")",
"{",
"if",
"(",
"!",
"defined",
"(",
"'ABSPATH'",
")",
")",
"{",
"throw",
"\\",
"RuntimeException",
"(",
"'ABSPATH constant is not defined. Something is very wrong!'",
")",
";",
"}",
"$",
"default_path",
"=",
"$... | Get default path
Get the default path to custom themes directory. Can be adjusted
from outside with QB_CUSTOM_THEME_PATH constant, defined, for
example, in wp-config.php.
@throws RuntimeException If ABSPATH constant is not defined.
@return string | [
"Get",
"default",
"path"
] | e7cdb5bfa4fbb482c460589c9adf2d5fed83ec91 | https://github.com/QoboLtd/Qobo-WP-Custom-Theme-Path/blob/e7cdb5bfa4fbb482c460589c9adf2d5fed83ec91/src/qobo-custom-theme-path.php#L30-L44 |
197,920 | QoboLtd/Qobo-WP-Custom-Theme-Path | src/qobo-custom-theme-path.php | Qobo_Custom_Theme_Path.validate_path | public function validate_path( $path ) {
$result = null;
$path = (string) $path;
// Empty values are not valid.
if ( empty( $path ) ) {
return 'Empty path is not allowed';
}
// Path must not end in slash.
// As per https://codex.wordpress.org/Function_Reference/register_theme_directory .
if ( DIRE... | php | public function validate_path( $path ) {
$result = null;
$path = (string) $path;
// Empty values are not valid.
if ( empty( $path ) ) {
return 'Empty path is not allowed';
}
// Path must not end in slash.
// As per https://codex.wordpress.org/Function_Reference/register_theme_directory .
if ( DIRE... | [
"public",
"function",
"validate_path",
"(",
"$",
"path",
")",
"{",
"$",
"result",
"=",
"null",
";",
"$",
"path",
"=",
"(",
"string",
")",
"$",
"path",
";",
"// Empty values are not valid.",
"if",
"(",
"empty",
"(",
"$",
"path",
")",
")",
"{",
"return",... | Validate given path
@param string $path Path to check.
@return string|null Problem description. | [
"Validate",
"given",
"path"
] | e7cdb5bfa4fbb482c460589c9adf2d5fed83ec91 | https://github.com/QoboLtd/Qobo-WP-Custom-Theme-Path/blob/e7cdb5bfa4fbb482c460589c9adf2d5fed83ec91/src/qobo-custom-theme-path.php#L52-L69 |
197,921 | QoboLtd/Qobo-WP-Custom-Theme-Path | src/qobo-custom-theme-path.php | Qobo_Custom_Theme_Path.register_path | public function register_path( $dir = null, $persistent = true ) {
$result = false;
// Cast parameters to known values.
$dir = (string) $dir;
$persistent = (bool) $persistent;
if ( empty( $dir ) ) {
$dir = $this->get_default_path();
}
$path_fail_reason = $this->validate_path( $dir );
if ( $path_fa... | php | public function register_path( $dir = null, $persistent = true ) {
$result = false;
// Cast parameters to known values.
$dir = (string) $dir;
$persistent = (bool) $persistent;
if ( empty( $dir ) ) {
$dir = $this->get_default_path();
}
$path_fail_reason = $this->validate_path( $dir );
if ( $path_fa... | [
"public",
"function",
"register_path",
"(",
"$",
"dir",
"=",
"null",
",",
"$",
"persistent",
"=",
"true",
")",
"{",
"$",
"result",
"=",
"false",
";",
"// Cast parameters to known values.",
"$",
"dir",
"=",
"(",
"string",
")",
"$",
"dir",
";",
"$",
"persi... | Register custom theme path
@param string $dir Directory to register (Relative to WP_CONTENT_DIR).
@param bool $persistent Whether to update WordPress options or not.
@return boolean|WP_Error True on success, false or WP_Error otherwise | [
"Register",
"custom",
"theme",
"path"
] | e7cdb5bfa4fbb482c460589c9adf2d5fed83ec91 | https://github.com/QoboLtd/Qobo-WP-Custom-Theme-Path/blob/e7cdb5bfa4fbb482c460589c9adf2d5fed83ec91/src/qobo-custom-theme-path.php#L78-L112 |
197,922 | wb-crowdfusion/crowdfusion | system/core/classes/nodedb/model/MetaPartial.php | MetaPartial.toString | public function toString()
{
$metaString = '#';
$metaString .= $this->fields['MetaName'];
if (!empty($this->fields['MetaValue']))
$metaString .= '="'. $this->fields['MetaValue'] .'"';
return $metaString;
} | php | public function toString()
{
$metaString = '#';
$metaString .= $this->fields['MetaName'];
if (!empty($this->fields['MetaValue']))
$metaString .= '="'. $this->fields['MetaValue'] .'"';
return $metaString;
} | [
"public",
"function",
"toString",
"(",
")",
"{",
"$",
"metaString",
"=",
"'#'",
";",
"$",
"metaString",
".=",
"$",
"this",
"->",
"fields",
"[",
"'MetaName'",
"]",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"fields",
"[",
"'MetaValue'",
"]"... | Returns the string representation of this MetaPartial
@return string | [
"Returns",
"the",
"string",
"representation",
"of",
"this",
"MetaPartial"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/nodedb/model/MetaPartial.php#L131-L141 |
197,923 | freialib/hlin.tools | src/Arr.php | Arr.join | static function join($glue, array $list, callable $manipulator) {
$glued = '';
foreach ($list as $key => $value) {
$item = $manipulator($key, $value);
if ($item !== false) {
$glued .= $glue.$item;
}
}
if ( ! empty($glued)) {
$glued = substr($glued, strlen($glue));
}
return $glued;
} | php | static function join($glue, array $list, callable $manipulator) {
$glued = '';
foreach ($list as $key => $value) {
$item = $manipulator($key, $value);
if ($item !== false) {
$glued .= $glue.$item;
}
}
if ( ! empty($glued)) {
$glued = substr($glued, strlen($glue));
}
return $glued;
} | [
"static",
"function",
"join",
"(",
"$",
"glue",
",",
"array",
"$",
"list",
",",
"callable",
"$",
"manipulator",
")",
"{",
"$",
"glued",
"=",
"''",
";",
"foreach",
"(",
"$",
"list",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"item",
"=",... | PHP join with a callback
This is slightly different from implode($glue, array_map) in that it can
ignore entries if the entry in question passes false out.
@return string | [
"PHP",
"join",
"with",
"a",
"callback"
] | 42ad9e9fe081918d2ee5d52b72d174ccdcf7cbe7 | https://github.com/freialib/hlin.tools/blob/42ad9e9fe081918d2ee5d52b72d174ccdcf7cbe7/src/Arr.php#L18-L32 |
197,924 | joegreen88/zf1-component-validate | src/Zend/Validate/Barcode.php | Zend_Validate_Barcode.setAdapter | public function setAdapter($adapter, $options = null)
{
$adapter = ucfirst(strtolower($adapter));
if (Zend_Loader::isReadable('Zend/Validate/Barcode/' . $adapter. '.php')) {
$adapter = 'Zend_Validate_Barcode_' . $adapter;
}
if (!class_exists($adapter)) {
Zen... | php | public function setAdapter($adapter, $options = null)
{
$adapter = ucfirst(strtolower($adapter));
if (Zend_Loader::isReadable('Zend/Validate/Barcode/' . $adapter. '.php')) {
$adapter = 'Zend_Validate_Barcode_' . $adapter;
}
if (!class_exists($adapter)) {
Zen... | [
"public",
"function",
"setAdapter",
"(",
"$",
"adapter",
",",
"$",
"options",
"=",
"null",
")",
"{",
"$",
"adapter",
"=",
"ucfirst",
"(",
"strtolower",
"(",
"$",
"adapter",
")",
")",
";",
"if",
"(",
"Zend_Loader",
"::",
"isReadable",
"(",
"'Zend/Validate... | Sets a new barcode adapter
@param string|Zend_Validate_Barcode $adapter Barcode adapter to use
@param array $options Options for this adapter
@return void
@throws Zend_Validate_Exception | [
"Sets",
"a",
"new",
"barcode",
"adapter"
] | 88d9ea016f73d48ff0ba7d06ecbbf28951fd279e | https://github.com/joegreen88/zf1-component-validate/blob/88d9ea016f73d48ff0ba7d06ecbbf28951fd279e/src/Zend/Validate/Barcode.php#L132-L153 |
197,925 | naucon/Utility | src/ObservableAbstract.php | ObservableAbstract.addObserver | public function addObserver(ObserverInterface $observerObject)
{
if (is_null($observerObject)) {
throw new ObservableException('Given observer is null.', E_WARNING);
} else {
$this->getObserverSetObject()->add($observerObject);
}
} | php | public function addObserver(ObserverInterface $observerObject)
{
if (is_null($observerObject)) {
throw new ObservableException('Given observer is null.', E_WARNING);
} else {
$this->getObserverSetObject()->add($observerObject);
}
} | [
"public",
"function",
"addObserver",
"(",
"ObserverInterface",
"$",
"observerObject",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"observerObject",
")",
")",
"{",
"throw",
"new",
"ObservableException",
"(",
"'Given observer is null.'",
",",
"E_WARNING",
")",
";",
... | add a observer to the observable
@param ObserverInterface $observerObject
@return void
@throws ObservableException | [
"add",
"a",
"observer",
"to",
"the",
"observable"
] | d225bb5d09d82400917f710c9d502949a66442c4 | https://github.com/naucon/Utility/blob/d225bb5d09d82400917f710c9d502949a66442c4/src/ObservableAbstract.php#L65-L72 |
197,926 | naucon/Utility | src/ObservableAbstract.php | ObservableAbstract.notifyObservers | public function notifyObservers($arg = null)
{
if ($this->hasChanged()) {
foreach ($this->getObserverSetObject() as $observerObject) {
$observerObject->update($this, $arg);
}
$this->clearChanged();
}
} | php | public function notifyObservers($arg = null)
{
if ($this->hasChanged()) {
foreach ($this->getObserverSetObject() as $observerObject) {
$observerObject->update($this, $arg);
}
$this->clearChanged();
}
} | [
"public",
"function",
"notifyObservers",
"(",
"$",
"arg",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasChanged",
"(",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getObserverSetObject",
"(",
")",
"as",
"$",
"observerObject",
")",
"{",... | notify all observer
@param mixed $arg optional argument
@return void | [
"notify",
"all",
"observer"
] | d225bb5d09d82400917f710c9d502949a66442c4 | https://github.com/naucon/Utility/blob/d225bb5d09d82400917f710c9d502949a66442c4/src/ObservableAbstract.php#L111-L119 |
197,927 | Linkvalue-Interne/MobileNotifBundle | DependencyInjection/LinkValueMobileNotifExtension.php | LinkValueMobileNotifExtension.registerClients | private function registerClients(array $config, ContainerBuilder $container)
{
foreach ($config['clients'] as $clientType => $clients) {
$clientFQCN = ($clientType == 'apns') ? 'LinkValue\MobileNotifBundle\Client\ApnsClient' : 'LinkValue\MobileNotifBundle\Client\GcmClient';
foreach ... | php | private function registerClients(array $config, ContainerBuilder $container)
{
foreach ($config['clients'] as $clientType => $clients) {
$clientFQCN = ($clientType == 'apns') ? 'LinkValue\MobileNotifBundle\Client\ApnsClient' : 'LinkValue\MobileNotifBundle\Client\GcmClient';
foreach ... | [
"private",
"function",
"registerClients",
"(",
"array",
"$",
"config",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"foreach",
"(",
"$",
"config",
"[",
"'clients'",
"]",
"as",
"$",
"clientType",
"=>",
"$",
"clients",
")",
"{",
"$",
"clientFQCN",
"=... | Register each client as service, such as "link_value_mobile_notif.clients.the_client_type.my_custom_client_name"
@param array $config
@param ContainerBuilder $container | [
"Register",
"each",
"client",
"as",
"service",
"such",
"as",
"link_value_mobile_notif",
".",
"clients",
".",
"the_client_type",
".",
"my_custom_client_name"
] | 8124f4132c581516be9928ece81ae2cf9f59763d | https://github.com/Linkvalue-Interne/MobileNotifBundle/blob/8124f4132c581516be9928ece81ae2cf9f59763d/DependencyInjection/LinkValueMobileNotifExtension.php#L36-L65 |
197,928 | wearenolte/wp-endpoints-static | src/StaticApi/GravityForms.php | GravityForms.get_settings | public static function get_settings() {
// If the gforms plugin is not active.
if ( ! class_exists( 'GFWebAPI' ) ) {
return false;
}
$settings = get_option( 'gravityformsaddon_gravityformswebapi_settings' );
// If the API is not enabled.
if ( empty( $settings ) || ! $settings['enabled'] ) {
return f... | php | public static function get_settings() {
// If the gforms plugin is not active.
if ( ! class_exists( 'GFWebAPI' ) ) {
return false;
}
$settings = get_option( 'gravityformsaddon_gravityformswebapi_settings' );
// If the API is not enabled.
if ( empty( $settings ) || ! $settings['enabled'] ) {
return f... | [
"public",
"static",
"function",
"get_settings",
"(",
")",
"{",
"// If the gforms plugin is not active.",
"if",
"(",
"!",
"class_exists",
"(",
"'GFWebAPI'",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"settings",
"=",
"get_option",
"(",
"'gravityformsaddon_gra... | Get the settings need to Gravity Forms. | [
"Get",
"the",
"settings",
"need",
"to",
"Gravity",
"Forms",
"."
] | 23258bba9b65d55b78b3dc3edc123d75009b0825 | https://github.com/wearenolte/wp-endpoints-static/blob/23258bba9b65d55b78b3dc3edc123d75009b0825/src/StaticApi/GravityForms.php#L14-L56 |
197,929 | wearenolte/wp-endpoints-static | src/StaticApi/GravityForms.php | GravityForms.calculate_signature | private static function calculate_signature( $string, $private_key ) {
$hash = hash_hmac( 'sha1', $string, $private_key, true );
return rawurlencode( base64_encode( $hash ) );
} | php | private static function calculate_signature( $string, $private_key ) {
$hash = hash_hmac( 'sha1', $string, $private_key, true );
return rawurlencode( base64_encode( $hash ) );
} | [
"private",
"static",
"function",
"calculate_signature",
"(",
"$",
"string",
",",
"$",
"private_key",
")",
"{",
"$",
"hash",
"=",
"hash_hmac",
"(",
"'sha1'",
",",
"$",
"string",
",",
"$",
"private_key",
",",
"true",
")",
";",
"return",
"rawurlencode",
"(",
... | Get the signature.
@param string $string The string to sign.
@param string $private_key The private key to sign it with.
@return string | [
"Get",
"the",
"signature",
"."
] | 23258bba9b65d55b78b3dc3edc123d75009b0825 | https://github.com/wearenolte/wp-endpoints-static/blob/23258bba9b65d55b78b3dc3edc123d75009b0825/src/StaticApi/GravityForms.php#L65-L69 |
197,930 | FuzeWorks/Core | src/FuzeWorks/Layout.php | Layout.display | public function display($file, $directory = null, $directOutput = false)
{
$output = Factory::getInstance()->output;
$directory = (is_null($directory) ? $this->directory : $directory);
if ($directOutput === true)
{
echo $this->get($file, $directory);
}
el... | php | public function display($file, $directory = null, $directOutput = false)
{
$output = Factory::getInstance()->output;
$directory = (is_null($directory) ? $this->directory : $directory);
if ($directOutput === true)
{
echo $this->get($file, $directory);
}
el... | [
"public",
"function",
"display",
"(",
"$",
"file",
",",
"$",
"directory",
"=",
"null",
",",
"$",
"directOutput",
"=",
"false",
")",
"{",
"$",
"output",
"=",
"Factory",
"::",
"getInstance",
"(",
")",
"->",
"output",
";",
"$",
"directory",
"=",
"(",
"i... | Retrieve a template file using a string and a directory and immediatly parse it to the output class.
What template file gets loaded depends on the template engine that is being used.
PHP for example uses .php files. Providing this function with 'home/dashboard' will load the home/layout.dashboard.php file.
You can als... | [
"Retrieve",
"a",
"template",
"file",
"using",
"a",
"string",
"and",
"a",
"directory",
"and",
"immediatly",
"parse",
"it",
"to",
"the",
"output",
"class",
"."
] | 051c64fdaa3a648174cbd54557d05ad553dd826b | https://github.com/FuzeWorks/Core/blob/051c64fdaa3a648174cbd54557d05ad553dd826b/src/FuzeWorks/Layout.php#L114-L129 |
197,931 | FuzeWorks/Core | src/FuzeWorks/Layout.php | Layout.get | public function get($file, $directory = null): string
{
$directory = (is_null($directory) ? $this->directory : $directory);
Logger::newLevel("Loading template file '".$file."' in '".$directory."'");
// First load the template engines
$this->loadTemplateEngines();
// First r... | php | public function get($file, $directory = null): string
{
$directory = (is_null($directory) ? $this->directory : $directory);
Logger::newLevel("Loading template file '".$file."' in '".$directory."'");
// First load the template engines
$this->loadTemplateEngines();
// First r... | [
"public",
"function",
"get",
"(",
"$",
"file",
",",
"$",
"directory",
"=",
"null",
")",
":",
"string",
"{",
"$",
"directory",
"=",
"(",
"is_null",
"(",
"$",
"directory",
")",
"?",
"$",
"this",
"->",
"directory",
":",
"$",
"directory",
")",
";",
"Lo... | Retrieve a template file using a string and a directory.
What template file gets loaded depends on the template engine that is being used.
PHP for example uses .php files. Providing this function with 'home/dashboard' will load the home/layout.dashboard.php file.
You can also provide no particular engine, and the mana... | [
"Retrieve",
"a",
"template",
"file",
"using",
"a",
"string",
"and",
"a",
"directory",
"."
] | 051c64fdaa3a648174cbd54557d05ad553dd826b | https://github.com/FuzeWorks/Core/blob/051c64fdaa3a648174cbd54557d05ad553dd826b/src/FuzeWorks/Layout.php#L146-L199 |
197,932 | FuzeWorks/Core | src/FuzeWorks/Layout.php | Layout.getEngineFromExtension | public function getEngineFromExtension($extension): TemplateEngine
{
if (isset($this->file_extensions[strtolower($extension)])) {
return $this->engines[ $this->file_extensions[strtolower($extension)]];
}
throw new LayoutException('Could not get Template Engine. No engine has cor... | php | public function getEngineFromExtension($extension): TemplateEngine
{
if (isset($this->file_extensions[strtolower($extension)])) {
return $this->engines[ $this->file_extensions[strtolower($extension)]];
}
throw new LayoutException('Could not get Template Engine. No engine has cor... | [
"public",
"function",
"getEngineFromExtension",
"(",
"$",
"extension",
")",
":",
"TemplateEngine",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"file_extensions",
"[",
"strtolower",
"(",
"$",
"extension",
")",
"]",
")",
")",
"{",
"return",
"$",
"this",... | Retrieve a Template Engine from a File Extension.
@param string $extension File extention to look for
@return TemplateEngine | [
"Retrieve",
"a",
"Template",
"Engine",
"from",
"a",
"File",
"Extension",
"."
] | 051c64fdaa3a648174cbd54557d05ad553dd826b | https://github.com/FuzeWorks/Core/blob/051c64fdaa3a648174cbd54557d05ad553dd826b/src/FuzeWorks/Layout.php#L208-L215 |
197,933 | FuzeWorks/Core | src/FuzeWorks/Layout.php | Layout.getFileFromString | public function getFileFromString($string, $directory, $extensions = array()): string
{
$directory = preg_replace('#/+#', '/', (!is_null($directory) ? $directory : $this->directory).DS);
if (strpbrk($directory, "\\/?%*:|\"<>") === TRUE || strpbrk($string, "\\/?%*:|\"<>") === TRUE)
{
... | php | public function getFileFromString($string, $directory, $extensions = array()): string
{
$directory = preg_replace('#/+#', '/', (!is_null($directory) ? $directory : $this->directory).DS);
if (strpbrk($directory, "\\/?%*:|\"<>") === TRUE || strpbrk($string, "\\/?%*:|\"<>") === TRUE)
{
... | [
"public",
"function",
"getFileFromString",
"(",
"$",
"string",
",",
"$",
"directory",
",",
"$",
"extensions",
"=",
"array",
"(",
")",
")",
":",
"string",
"{",
"$",
"directory",
"=",
"preg_replace",
"(",
"'#/+#'",
",",
"'/'",
",",
"(",
"!",
"is_null",
"... | Converts a layout string to a file using the directory and the used extensions.
It will detect whether the file exists and choose a file according to the provided extensions
@param string $string The string used by a controller. eg: 'dashboard/home'
@param string $directory The directory to search in for the tem... | [
"Converts",
"a",
"layout",
"string",
"to",
"a",
"file",
"using",
"the",
"directory",
"and",
"the",
"used",
"extensions",
"."
] | 051c64fdaa3a648174cbd54557d05ad553dd826b | https://github.com/FuzeWorks/Core/blob/051c64fdaa3a648174cbd54557d05ad553dd826b/src/FuzeWorks/Layout.php#L241-L295 |
197,934 | FuzeWorks/Core | src/FuzeWorks/Layout.php | Layout.setFileFromString | public function setFileFromString($string, $directory, $extensions = array())
{
$this->file = $this->getFileFromString($string, $directory, $extensions);
$this->directory = preg_replace('#/+#', '/', (!is_null($directory) ? $directory : $this->directory).DS);
} | php | public function setFileFromString($string, $directory, $extensions = array())
{
$this->file = $this->getFileFromString($string, $directory, $extensions);
$this->directory = preg_replace('#/+#', '/', (!is_null($directory) ? $directory : $this->directory).DS);
} | [
"public",
"function",
"setFileFromString",
"(",
"$",
"string",
",",
"$",
"directory",
",",
"$",
"extensions",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"file",
"=",
"$",
"this",
"->",
"getFileFromString",
"(",
"$",
"string",
",",
"$",
"direc... | Converts a layout string to a file using the directory and the used extensions.
It also sets the file variable of this class.
It will detect whether the file exists and choose a file according to the provided extensions
@param string $string The string used by a controller. eg: 'dashboard/home'
@param string $dir... | [
"Converts",
"a",
"layout",
"string",
"to",
"a",
"file",
"using",
"the",
"directory",
"and",
"the",
"used",
"extensions",
".",
"It",
"also",
"sets",
"the",
"file",
"variable",
"of",
"this",
"class",
"."
] | 051c64fdaa3a648174cbd54557d05ad553dd826b | https://github.com/FuzeWorks/Core/blob/051c64fdaa3a648174cbd54557d05ad553dd826b/src/FuzeWorks/Layout.php#L310-L314 |
197,935 | FuzeWorks/Core | src/FuzeWorks/Layout.php | Layout.setEngine | public function setEngine($name): bool
{
$this->loadTemplateEngines();
if (isset($this->engines[$name])) {
$this->current_engine = $this->engines[$name];
Logger::log('Set the Template Engine to '.$name);
return true;
}
throw new LayoutException('C... | php | public function setEngine($name): bool
{
$this->loadTemplateEngines();
if (isset($this->engines[$name])) {
$this->current_engine = $this->engines[$name];
Logger::log('Set the Template Engine to '.$name);
return true;
}
throw new LayoutException('C... | [
"public",
"function",
"setEngine",
"(",
"$",
"name",
")",
":",
"bool",
"{",
"$",
"this",
"->",
"loadTemplateEngines",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"engines",
"[",
"$",
"name",
"]",
")",
")",
"{",
"$",
"this",
"->",
"... | Set the engine for the next layout.
@param string $name Name of the template engine
@return bool true on success
@throws LayoutException on error | [
"Set",
"the",
"engine",
"for",
"the",
"next",
"layout",
"."
] | 051c64fdaa3a648174cbd54557d05ad553dd826b | https://github.com/FuzeWorks/Core/blob/051c64fdaa3a648174cbd54557d05ad553dd826b/src/FuzeWorks/Layout.php#L399-L409 |
197,936 | FuzeWorks/Core | src/FuzeWorks/Layout.php | Layout.getEngine | public function getEngine($name): TemplateEngine
{
$this->loadTemplateEngines();
if (isset($this->engines[$name])) {
return $this->engines[$name];
}
throw new LayoutException('Could not return engine. Engine does not exist', 1);
} | php | public function getEngine($name): TemplateEngine
{
$this->loadTemplateEngines();
if (isset($this->engines[$name])) {
return $this->engines[$name];
}
throw new LayoutException('Could not return engine. Engine does not exist', 1);
} | [
"public",
"function",
"getEngine",
"(",
"$",
"name",
")",
":",
"TemplateEngine",
"{",
"$",
"this",
"->",
"loadTemplateEngines",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"engines",
"[",
"$",
"name",
"]",
")",
")",
"{",
"return",
"$",... | Get a loaded template engine.
@param string $name Name of the template engine
@return TemplateEngine | [
"Get",
"a",
"loaded",
"template",
"engine",
"."
] | 051c64fdaa3a648174cbd54557d05ad553dd826b | https://github.com/FuzeWorks/Core/blob/051c64fdaa3a648174cbd54557d05ad553dd826b/src/FuzeWorks/Layout.php#L418-L425 |
197,937 | FuzeWorks/Core | src/FuzeWorks/Layout.php | Layout.registerEngine | public function registerEngine($engineClass, $engineName, $engineFileExtensions = array()): bool
{
// First check if the engine already exists
if (isset($this->engines[$engineName])) {
throw new LayoutException("Could not register engine. Engine '".$engineName."' already registered", 1);... | php | public function registerEngine($engineClass, $engineName, $engineFileExtensions = array()): bool
{
// First check if the engine already exists
if (isset($this->engines[$engineName])) {
throw new LayoutException("Could not register engine. Engine '".$engineName."' already registered", 1);... | [
"public",
"function",
"registerEngine",
"(",
"$",
"engineClass",
",",
"$",
"engineName",
",",
"$",
"engineFileExtensions",
"=",
"array",
"(",
")",
")",
":",
"bool",
"{",
"// First check if the engine already exists",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
... | Register a new template engine.
@param object $engineClass Object that implements the \FuzeWorks\TemplateEngine
@param string $engineName Name of the template engine
@param array $engineFileExtensions File extensions this template engine should be used for
@return bool true on success
@throws Layo... | [
"Register",
"a",
"new",
"template",
"engine",
"."
] | 051c64fdaa3a648174cbd54557d05ad553dd826b | https://github.com/FuzeWorks/Core/blob/051c64fdaa3a648174cbd54557d05ad553dd826b/src/FuzeWorks/Layout.php#L437-L471 |
197,938 | FuzeWorks/Core | src/FuzeWorks/Layout.php | Layout.loadTemplateEngines | public function loadTemplateEngines()
{
if (!$this->engines_loaded) {
Events::fireEvent('layoutLoadEngineEvent');
// Load the engines provided in this file
$this->registerEngine(new PHPEngine(), 'PHP', array('php'));
$this->registerEngine(new JsonEngine(), 'J... | php | public function loadTemplateEngines()
{
if (!$this->engines_loaded) {
Events::fireEvent('layoutLoadEngineEvent');
// Load the engines provided in this file
$this->registerEngine(new PHPEngine(), 'PHP', array('php'));
$this->registerEngine(new JsonEngine(), 'J... | [
"public",
"function",
"loadTemplateEngines",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"engines_loaded",
")",
"{",
"Events",
"::",
"fireEvent",
"(",
"'layoutLoadEngineEvent'",
")",
";",
"// Load the engines provided in this file",
"$",
"this",
"->",
"regis... | Load the template engines by sending a layoutLoadEngineEvent. | [
"Load",
"the",
"template",
"engines",
"by",
"sending",
"a",
"layoutLoadEngineEvent",
"."
] | 051c64fdaa3a648174cbd54557d05ad553dd826b | https://github.com/FuzeWorks/Core/blob/051c64fdaa3a648174cbd54557d05ad553dd826b/src/FuzeWorks/Layout.php#L476-L488 |
197,939 | FuzeWorks/Core | src/FuzeWorks/Layout.php | Layout.reset | public function reset()
{
if (!is_null($this->current_engine)) {
$this->current_engine->reset();
}
// Unload the engines
$this->engines = array();
$this->engines_loaded = false;
$this->file_extensions = array();
$this->current_engine = null;
... | php | public function reset()
{
if (!is_null($this->current_engine)) {
$this->current_engine->reset();
}
// Unload the engines
$this->engines = array();
$this->engines_loaded = false;
$this->file_extensions = array();
$this->current_engine = null;
... | [
"public",
"function",
"reset",
"(",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
"->",
"current_engine",
")",
")",
"{",
"$",
"this",
"->",
"current_engine",
"->",
"reset",
"(",
")",
";",
"}",
"// Unload the engines",
"$",
"this",
"->",
"engin... | Resets the layout manager to its default state. | [
"Resets",
"the",
"layout",
"manager",
"to",
"its",
"default",
"state",
"."
] | 051c64fdaa3a648174cbd54557d05ad553dd826b | https://github.com/FuzeWorks/Core/blob/051c64fdaa3a648174cbd54557d05ad553dd826b/src/FuzeWorks/Layout.php#L513-L528 |
197,940 | frodosghost/PublishBundle | DependencyInjection/ManhattanPublishExtension.php | ManhattanPublishExtension.remapPublishStates | protected function remapPublishStates(array $config, ContainerBuilder $container)
{
$publishStates = array();
foreach ($config as $role) {
$publishStates[$role['value']] = $role['name'];
}
$container->setParameter('manhattan.publish.states', $publishStates);
} | php | protected function remapPublishStates(array $config, ContainerBuilder $container)
{
$publishStates = array();
foreach ($config as $role) {
$publishStates[$role['value']] = $role['name'];
}
$container->setParameter('manhattan.publish.states', $publishStates);
} | [
"protected",
"function",
"remapPublishStates",
"(",
"array",
"$",
"config",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"publishStates",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"config",
"as",
"$",
"role",
")",
"{",
"$",
"publishSta... | Remaps parsed array for default into Choices field
@param array $config
@param ContainerBuilder $container | [
"Remaps",
"parsed",
"array",
"for",
"default",
"into",
"Choices",
"field"
] | 7aaf7d7567a14e57e87b8d7474fbdd064f7b09bc | https://github.com/frodosghost/PublishBundle/blob/7aaf7d7567a14e57e87b8d7474fbdd064f7b09bc/DependencyInjection/ManhattanPublishExtension.php#L39-L48 |
197,941 | frodosghost/PublishBundle | DependencyInjection/ManhattanPublishExtension.php | ManhattanPublishExtension.prepend | public function prepend(ContainerBuilder $container)
{
$bundles = $container->getParameter('kernel.bundles');
// Once Manhattan Console is registered include the additional configuration files
if (isset($bundles['ManhattanPublishBundle'])) {
$loader = new Loader\YamlFileLoader($... | php | public function prepend(ContainerBuilder $container)
{
$bundles = $container->getParameter('kernel.bundles');
// Once Manhattan Console is registered include the additional configuration files
if (isset($bundles['ManhattanPublishBundle'])) {
$loader = new Loader\YamlFileLoader($... | [
"public",
"function",
"prepend",
"(",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"bundles",
"=",
"$",
"container",
"->",
"getParameter",
"(",
"'kernel.bundles'",
")",
";",
"// Once Manhattan Console is registered include the additional configuration files",
"if",
... | Prepend extension to load in config file
{@inheritDoc} | [
"Prepend",
"extension",
"to",
"load",
"in",
"config",
"file"
] | 7aaf7d7567a14e57e87b8d7474fbdd064f7b09bc | https://github.com/frodosghost/PublishBundle/blob/7aaf7d7567a14e57e87b8d7474fbdd064f7b09bc/DependencyInjection/ManhattanPublishExtension.php#L55-L64 |
197,942 | linpax/microphp-framework | src/mvc/controllers/ViewController.php | ViewController.redirect | public function redirect($path, $status = 301)
{
if (!$this->asWidget) {
/** @var ResponseInterface $response */
$response = (new ResponseInjector)->build();
if (!$response) {
throw new Exception('Component `response` not configured');
}
... | php | public function redirect($path, $status = 301)
{
if (!$this->asWidget) {
/** @var ResponseInterface $response */
$response = (new ResponseInjector)->build();
if (!$response) {
throw new Exception('Component `response` not configured');
}
... | [
"public",
"function",
"redirect",
"(",
"$",
"path",
",",
"$",
"status",
"=",
"301",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"asWidget",
")",
"{",
"/** @var ResponseInterface $response */",
"$",
"response",
"=",
"(",
"new",
"ResponseInjector",
")",
"->... | Redirect user to path
@access public
@param string $path path to redirect
@param integer $status status for redirect
@return false|ResponseInterface
@throws Exception|\InvalidArgumentException | [
"Redirect",
"user",
"to",
"path"
] | 11f3370f3f64c516cce9b84ecd8276c6e9ae8df9 | https://github.com/linpax/microphp-framework/blob/11f3370f3f64c516cce9b84ecd8276c6e9ae8df9/src/mvc/controllers/ViewController.php#L94-L110 |
197,943 | Kris-Kuiper/sFire-Framework | src/Routing/Extend/Forward.php | Forward.params | public function params($params) {
if(false === is_array($params)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type array, "%s" given', __METHOD__, gettype($data)), E_USER_ERROR);
}
$this -> params = $params;
return $this;
} | php | public function params($params) {
if(false === is_array($params)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type array, "%s" given', __METHOD__, gettype($data)), E_USER_ERROR);
}
$this -> params = $params;
return $this;
} | [
"public",
"function",
"params",
"(",
"$",
"params",
")",
"{",
"if",
"(",
"false",
"===",
"is_array",
"(",
"$",
"params",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'Argument 1 passed to %s() must be of the type array, \"%s\" given'",
",",
"__M... | Set the parameters
@param array $param
@return sFire\Router\Forward | [
"Set",
"the",
"parameters"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Routing/Extend/Forward.php#L74-L83 |
197,944 | Kris-Kuiper/sFire-Framework | src/Routing/Extend/Forward.php | Forward.domain | public function domain($domain, $protocol = null) {
if(false === is_string($domain)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($domain)), E_USER_ERROR);
}
//Check if identifier exists
if(false === Router :: routeExists($thi... | php | public function domain($domain, $protocol = null) {
if(false === is_string($domain)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($domain)), E_USER_ERROR);
}
//Check if identifier exists
if(false === Router :: routeExists($thi... | [
"public",
"function",
"domain",
"(",
"$",
"domain",
",",
"$",
"protocol",
"=",
"null",
")",
"{",
"if",
"(",
"false",
"===",
"is_string",
"(",
"$",
"domain",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'Argument 1 passed to %s() must be of... | Set the domain name with HTTP protocol
@param string $domain
@param string $protocol
@return sFire\Router\Forward | [
"Set",
"the",
"domain",
"name",
"with",
"HTTP",
"protocol"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Routing/Extend/Forward.php#L92-L114 |
197,945 | Kris-Kuiper/sFire-Framework | src/Routing/Extend/Forward.php | Forward.seconds | public function seconds($seconds) {
if(false === ('-' . intval($seconds) == '-' . $seconds)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($seconds)), E_USER_ERROR);
}
$this -> seconds = $seconds;
return $this;
} | php | public function seconds($seconds) {
if(false === ('-' . intval($seconds) == '-' . $seconds)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($seconds)), E_USER_ERROR);
}
$this -> seconds = $seconds;
return $this;
} | [
"public",
"function",
"seconds",
"(",
"$",
"seconds",
")",
"{",
"if",
"(",
"false",
"===",
"(",
"'-'",
".",
"intval",
"(",
"$",
"seconds",
")",
"==",
"'-'",
".",
"$",
"seconds",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'Argumen... | Set the amount of seconds
@param number $seconds
@return sFire\Router\Forward | [
"Set",
"the",
"amount",
"of",
"seconds"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Routing/Extend/Forward.php#L122-L131 |
197,946 | Kris-Kuiper/sFire-Framework | src/Routing/Extend/Forward.php | Forward.execute | public function execute($code = null) {
if(null !== $code && false === ('-' . intval($code) == '-' . $code)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($code)), E_USER_ERROR);
}
$this -> setUrl();
if(null !== $this -> sec... | php | public function execute($code = null) {
if(null !== $code && false === ('-' . intval($code) == '-' . $code)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($code)), E_USER_ERROR);
}
$this -> setUrl();
if(null !== $this -> sec... | [
"public",
"function",
"execute",
"(",
"$",
"code",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"code",
"&&",
"false",
"===",
"(",
"'-'",
".",
"intval",
"(",
"$",
"code",
")",
"==",
"'-'",
".",
"$",
"code",
")",
")",
"{",
"return",
"tr... | Execute forward, with options HTTP status code
@param integer $code | [
"Execute",
"forward",
"with",
"options",
"HTTP",
"status",
"code"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Routing/Extend/Forward.php#L138-L151 |
197,947 | kaiohken1982/NeobazaarDocumentModule | src/Document/Model/Image.php | Image.deleteImages | public function deleteImages()
{
$thumb = false;
$img = false;
if(file_exists($this->path)) {
unlink($this->path);
}
if(file_exists($this->thumbnailPath)) {
unlink($this->thumbnailPath);
}
$img = !file_exists($this->path);
$thumb = !file_exists($this->thumbnailPath);
... | php | public function deleteImages()
{
$thumb = false;
$img = false;
if(file_exists($this->path)) {
unlink($this->path);
}
if(file_exists($this->thumbnailPath)) {
unlink($this->thumbnailPath);
}
$img = !file_exists($this->path);
$thumb = !file_exists($this->thumbnailPath);
... | [
"public",
"function",
"deleteImages",
"(",
")",
"{",
"$",
"thumb",
"=",
"false",
";",
"$",
"img",
"=",
"false",
";",
"if",
"(",
"file_exists",
"(",
"$",
"this",
"->",
"path",
")",
")",
"{",
"unlink",
"(",
"$",
"this",
"->",
"path",
")",
";",
"}",... | Phisically remove images that are related
to this doument entity.
It does not touch anything on the database!
@return boolean | [
"Phisically",
"remove",
"images",
"that",
"are",
"related",
"to",
"this",
"doument",
"entity",
".",
"It",
"does",
"not",
"touch",
"anything",
"on",
"the",
"database!"
] | edb0223878fe02e791d2a0266c5a7c0f2029e3fe | https://github.com/kaiohken1982/NeobazaarDocumentModule/blob/edb0223878fe02e791d2a0266c5a7c0f2029e3fe/src/Document/Model/Image.php#L118-L135 |
197,948 | zhaoxianfang/tools | src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php | XmlFileLoader.parseFileToDOM | private function parseFileToDOM($file)
{
try {
$dom = XmlUtils::loadFile($file, array($this, 'validateSchema'));
} catch (\InvalidArgumentException $e) {
throw new InvalidArgumentException(sprintf('Unable to parse file "%s".', $file), $e->getCode(), $e);
}
$t... | php | private function parseFileToDOM($file)
{
try {
$dom = XmlUtils::loadFile($file, array($this, 'validateSchema'));
} catch (\InvalidArgumentException $e) {
throw new InvalidArgumentException(sprintf('Unable to parse file "%s".', $file), $e->getCode(), $e);
}
$t... | [
"private",
"function",
"parseFileToDOM",
"(",
"$",
"file",
")",
"{",
"try",
"{",
"$",
"dom",
"=",
"XmlUtils",
"::",
"loadFile",
"(",
"$",
"file",
",",
"array",
"(",
"$",
"this",
",",
"'validateSchema'",
")",
")",
";",
"}",
"catch",
"(",
"\\",
"Invali... | Parses a XML file to a \DOMDocument.
@param string $file Path to a file
@return \DOMDocument
@throws InvalidArgumentException When loading of XML file returns error | [
"Parses",
"a",
"XML",
"file",
"to",
"a",
"\\",
"DOMDocument",
"."
] | d8fc8a9ecd75b5ce4236f0a2e9fdc055108573e7 | https://github.com/zhaoxianfang/tools/blob/d8fc8a9ecd75b5ce4236f0a2e9fdc055108573e7/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php#L381-L392 |
197,949 | zhaoxianfang/tools | src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php | XmlFileLoader.validateExtensions | private function validateExtensions(\DOMDocument $dom, $file)
{
foreach ($dom->documentElement->childNodes as $node) {
if (!$node instanceof \DOMElement || 'http://symfony.com/schema/dic/services' === $node->namespaceURI) {
continue;
}
// can it be handle... | php | private function validateExtensions(\DOMDocument $dom, $file)
{
foreach ($dom->documentElement->childNodes as $node) {
if (!$node instanceof \DOMElement || 'http://symfony.com/schema/dic/services' === $node->namespaceURI) {
continue;
}
// can it be handle... | [
"private",
"function",
"validateExtensions",
"(",
"\\",
"DOMDocument",
"$",
"dom",
",",
"$",
"file",
")",
"{",
"foreach",
"(",
"$",
"dom",
"->",
"documentElement",
"->",
"childNodes",
"as",
"$",
"node",
")",
"{",
"if",
"(",
"!",
"$",
"node",
"instanceof"... | Validates an extension.
@param \DOMDocument $dom
@param string $file
@throws InvalidArgumentException When no extension is found corresponding to a tag | [
"Validates",
"an",
"extension",
"."
] | d8fc8a9ecd75b5ce4236f0a2e9fdc055108573e7 | https://github.com/zhaoxianfang/tools/blob/d8fc8a9ecd75b5ce4236f0a2e9fdc055108573e7/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php#L673-L692 |
197,950 | zhaoxianfang/tools | src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php | XmlFileLoader.loadFromExtensions | private function loadFromExtensions(\DOMDocument $xml)
{
foreach ($xml->documentElement->childNodes as $node) {
if (!$node instanceof \DOMElement || self::NS === $node->namespaceURI) {
continue;
}
$values = static::convertDomElementToArray($node);
... | php | private function loadFromExtensions(\DOMDocument $xml)
{
foreach ($xml->documentElement->childNodes as $node) {
if (!$node instanceof \DOMElement || self::NS === $node->namespaceURI) {
continue;
}
$values = static::convertDomElementToArray($node);
... | [
"private",
"function",
"loadFromExtensions",
"(",
"\\",
"DOMDocument",
"$",
"xml",
")",
"{",
"foreach",
"(",
"$",
"xml",
"->",
"documentElement",
"->",
"childNodes",
"as",
"$",
"node",
")",
"{",
"if",
"(",
"!",
"$",
"node",
"instanceof",
"\\",
"DOMElement"... | Loads from an extension.
@param \DOMDocument $xml | [
"Loads",
"from",
"an",
"extension",
"."
] | d8fc8a9ecd75b5ce4236f0a2e9fdc055108573e7 | https://github.com/zhaoxianfang/tools/blob/d8fc8a9ecd75b5ce4236f0a2e9fdc055108573e7/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php#L699-L713 |
197,951 | Aviogram/Common | src/PHPClass/ScopeTrait.php | ScopeTrait.setScope | public function setScope($scope)
{
if (in_array($scope, $this->scopes) === false) {
throw Exception\Scope::invalidScope($scope, $this->scopes);
}
$this->scope = $scope;
return $this;
} | php | public function setScope($scope)
{
if (in_array($scope, $this->scopes) === false) {
throw Exception\Scope::invalidScope($scope, $this->scopes);
}
$this->scope = $scope;
return $this;
} | [
"public",
"function",
"setScope",
"(",
"$",
"scope",
")",
"{",
"if",
"(",
"in_array",
"(",
"$",
"scope",
",",
"$",
"this",
"->",
"scopes",
")",
"===",
"false",
")",
"{",
"throw",
"Exception",
"\\",
"Scope",
"::",
"invalidScope",
"(",
"$",
"scope",
",... | Set the current scope
@param string $scope (See ScopeInterface::SCOPE_*)
@return $this
@throws Exception\Scope When the scope does not exists | [
"Set",
"the",
"current",
"scope"
] | bcff2e409cccd4791a3f9bca0b2cdd70c25ddec5 | https://github.com/Aviogram/Common/blob/bcff2e409cccd4791a3f9bca0b2cdd70c25ddec5/src/PHPClass/ScopeTrait.php#L25-L34 |
197,952 | eloquent/blox | src/BloxParser.php | BloxParser.parseBlockComment | public function parseBlockComment($blockComment)
{
$blockCommentLines = $this->parseBlockCommentLines($blockComment);
return new Element\DocumentationBlock(
$this->parseBlockCommentTags($blockCommentLines),
$this->parseBlockCommentSummary($blockCommentLines),
$th... | php | public function parseBlockComment($blockComment)
{
$blockCommentLines = $this->parseBlockCommentLines($blockComment);
return new Element\DocumentationBlock(
$this->parseBlockCommentTags($blockCommentLines),
$this->parseBlockCommentSummary($blockCommentLines),
$th... | [
"public",
"function",
"parseBlockComment",
"(",
"$",
"blockComment",
")",
"{",
"$",
"blockCommentLines",
"=",
"$",
"this",
"->",
"parseBlockCommentLines",
"(",
"$",
"blockComment",
")",
";",
"return",
"new",
"Element",
"\\",
"DocumentationBlock",
"(",
"$",
"this... | Parse a documentation block comment.
@param string $blockComment The documentation block comment.
@return DocumentationBlock The parsed documentation block object. | [
"Parse",
"a",
"documentation",
"block",
"comment",
"."
] | dcfe82a0a703124ab5807d894979530d6fdb536b | https://github.com/eloquent/blox/blob/dcfe82a0a703124ab5807d894979530d6fdb536b/src/BloxParser.php#L26-L35 |
197,953 | nicmart/DomainSpecificQuery | src/Language/Compiler/LanguageCompiler.php | LanguageCompiler.value | public function value($value)
{
//terminal case
if (!is_array($value)) {
if (strpbrk($value, Lexer::ESCAPED_STRING) !== false) {
if (!(substr($value, 0, 1) == '"' && substr($value, -1) == '"')) {
return '(' . addcslashes($value, Lexer::ESCAPED_STRING_P... | php | public function value($value)
{
//terminal case
if (!is_array($value)) {
if (strpbrk($value, Lexer::ESCAPED_STRING) !== false) {
if (!(substr($value, 0, 1) == '"' && substr($value, -1) == '"')) {
return '(' . addcslashes($value, Lexer::ESCAPED_STRING_P... | [
"public",
"function",
"value",
"(",
"$",
"value",
")",
"{",
"//terminal case",
"if",
"(",
"!",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"if",
"(",
"strpbrk",
"(",
"$",
"value",
",",
"Lexer",
"::",
"ESCAPED_STRING",
")",
"!==",
"false",
")",
"{",... | Compile a value
@param string $value
@return string | [
"Compile",
"a",
"value"
] | 7c01fe94337afdfae5884809e8b5487127a63ac3 | https://github.com/nicmart/DomainSpecificQuery/blob/7c01fe94337afdfae5884809e8b5487127a63ac3/src/Language/Compiler/LanguageCompiler.php#L45-L64 |
197,954 | nicmart/DomainSpecificQuery | src/Language/Compiler/LanguageCompiler.php | LanguageCompiler.isAnInExpression | public function isAnInExpression(TreeExpression $expr)
{
$count = $expr->count();
if ($count <= 1 || strtolower($expr->getValue()) != 'or' )
return false;
$children = $expr->getChildren();
if (!$children[0] instanceof FieldExpression)
return false;
f... | php | public function isAnInExpression(TreeExpression $expr)
{
$count = $expr->count();
if ($count <= 1 || strtolower($expr->getValue()) != 'or' )
return false;
$children = $expr->getChildren();
if (!$children[0] instanceof FieldExpression)
return false;
f... | [
"public",
"function",
"isAnInExpression",
"(",
"TreeExpression",
"$",
"expr",
")",
"{",
"$",
"count",
"=",
"$",
"expr",
"->",
"count",
"(",
")",
";",
"if",
"(",
"$",
"count",
"<=",
"1",
"||",
"strtolower",
"(",
"$",
"expr",
"->",
"getValue",
"(",
")"... | Can be the tree expression converted in a "FIELD IN ..." expression?
@param TreeExpression $expr
@return bool | [
"Can",
"be",
"the",
"tree",
"expression",
"converted",
"in",
"a",
"FIELD",
"IN",
"...",
"expression?"
] | 7c01fe94337afdfae5884809e8b5487127a63ac3 | https://github.com/nicmart/DomainSpecificQuery/blob/7c01fe94337afdfae5884809e8b5487127a63ac3/src/Language/Compiler/LanguageCompiler.php#L95-L113 |
197,955 | SysControllers/Admin | public/assets/global/plugins/kcfinder/lib/helper_text.php | text.xmlData | static function xmlData($string, $cdata=false) {
$string = str_replace("]]>", "]]]]><![CDATA[>", $string);
if (!$cdata)
$string = "<![CDATA[$string]]>";
return $string;
} | php | static function xmlData($string, $cdata=false) {
$string = str_replace("]]>", "]]]]><![CDATA[>", $string);
if (!$cdata)
$string = "<![CDATA[$string]]>";
return $string;
} | [
"static",
"function",
"xmlData",
"(",
"$",
"string",
",",
"$",
"cdata",
"=",
"false",
")",
"{",
"$",
"string",
"=",
"str_replace",
"(",
"\"]]>\"",
",",
"\"]]]]><![CDATA[>\"",
",",
"$",
"string",
")",
";",
"if",
"(",
"!",
"$",
"cdata",
")",
"$",
"stri... | Normalize the string for XML tag content data
@param string $string
@param bool $cdata | [
"Normalize",
"the",
"string",
"for",
"XML",
"tag",
"content",
"data"
] | 8f1df46aca422b87f2f522fbba610dcfa0c5f7f3 | https://github.com/SysControllers/Admin/blob/8f1df46aca422b87f2f522fbba610dcfa0c5f7f3/public/assets/global/plugins/kcfinder/lib/helper_text.php#L55-L60 |
197,956 | SysControllers/Admin | public/assets/global/plugins/kcfinder/lib/helper_text.php | text.compressCSS | static function compressCSS($code) {
$code = self::clearWhitespaces($code);
$code = preg_replace('/ ?\{ ?/', "{", $code);
$code = preg_replace('/ ?\} ?/', "}", $code);
$code = preg_replace('/ ?\; ?/', ";", $code);
$code = preg_replace('/ ?\> ?/', ">", $code);
$code = preg... | php | static function compressCSS($code) {
$code = self::clearWhitespaces($code);
$code = preg_replace('/ ?\{ ?/', "{", $code);
$code = preg_replace('/ ?\} ?/', "}", $code);
$code = preg_replace('/ ?\; ?/', ";", $code);
$code = preg_replace('/ ?\> ?/', ">", $code);
$code = preg... | [
"static",
"function",
"compressCSS",
"(",
"$",
"code",
")",
"{",
"$",
"code",
"=",
"self",
"::",
"clearWhitespaces",
"(",
"$",
"code",
")",
";",
"$",
"code",
"=",
"preg_replace",
"(",
"'/ ?\\{ ?/'",
",",
"\"{\"",
",",
"$",
"code",
")",
";",
"$",
"cod... | Returns compressed content of given CSS code
@param string $code
@return string | [
"Returns",
"compressed",
"content",
"of",
"given",
"CSS",
"code"
] | 8f1df46aca422b87f2f522fbba610dcfa0c5f7f3 | https://github.com/SysControllers/Admin/blob/8f1df46aca422b87f2f522fbba610dcfa0c5f7f3/public/assets/global/plugins/kcfinder/lib/helper_text.php#L66-L76 |
197,957 | williamcarril/model-validation | src/WGPC/Eloquent/Model.php | Model.putErrors | public function putErrors($errors) {
if (!is_array($errors) && !($errors instanceof MessageProvider)) {
$errors = [$errors];
}
$this->errors->merge($errors);
} | php | public function putErrors($errors) {
if (!is_array($errors) && !($errors instanceof MessageProvider)) {
$errors = [$errors];
}
$this->errors->merge($errors);
} | [
"public",
"function",
"putErrors",
"(",
"$",
"errors",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"errors",
")",
"&&",
"!",
"(",
"$",
"errors",
"instanceof",
"MessageProvider",
")",
")",
"{",
"$",
"errors",
"=",
"[",
"$",
"errors",
"]",
";",
"... | Puts more errors in its message bag.
@return boolean | [
"Puts",
"more",
"errors",
"in",
"its",
"message",
"bag",
"."
] | a6008d04c3ee7e54b87160f471c445d183d41367 | https://github.com/williamcarril/model-validation/blob/a6008d04c3ee7e54b87160f471c445d183d41367/src/WGPC/Eloquent/Model.php#L105-L110 |
197,958 | WellCommerce/DistributionBundle | Controller/Admin/PackageController.php | PackageController.syncAction | public function syncAction()
{
$this->manager->syncPackages(PackageHelperInterface::DEFAULT_PACKAGE_BUNDLE_TYPE);
$this->manager->syncPackages(PackageHelperInterface::DEFAULT_PACKAGE_THEME_TYPE);
$this->manager->getFlashHelper()->addSuccess('package.flash.sync.success');
return $thi... | php | public function syncAction()
{
$this->manager->syncPackages(PackageHelperInterface::DEFAULT_PACKAGE_BUNDLE_TYPE);
$this->manager->syncPackages(PackageHelperInterface::DEFAULT_PACKAGE_THEME_TYPE);
$this->manager->getFlashHelper()->addSuccess('package.flash.sync.success');
return $thi... | [
"public",
"function",
"syncAction",
"(",
")",
"{",
"$",
"this",
"->",
"manager",
"->",
"syncPackages",
"(",
"PackageHelperInterface",
"::",
"DEFAULT_PACKAGE_BUNDLE_TYPE",
")",
";",
"$",
"this",
"->",
"manager",
"->",
"syncPackages",
"(",
"PackageHelperInterface",
... | Action used to sync packages from remote servers ie. packagist.org
@return \Symfony\Component\HttpFoundation\RedirectResponse | [
"Action",
"used",
"to",
"sync",
"packages",
"from",
"remote",
"servers",
"ie",
".",
"packagist",
".",
"org"
] | 82b1b4c2c5a59536aaae22506b23ccd5d141cbb0 | https://github.com/WellCommerce/DistributionBundle/blob/82b1b4c2c5a59536aaae22506b23ccd5d141cbb0/Controller/Admin/PackageController.php#L32-L39 |
197,959 | ekyna/PaymentBundle | Controller/PaymentController.php | PaymentController.notifyAction | public function notifyAction(Request $request)
{
$token = $this->getHttpRequestVerifier()->verify($request);
$gateway = $this->getPayum()->getGateway($token->getGatewayName());
$gateway->execute($notify = new Notify($token));
/** @var \Ekyna\Component\Sale\Payment\PaymentInterface... | php | public function notifyAction(Request $request)
{
$token = $this->getHttpRequestVerifier()->verify($request);
$gateway = $this->getPayum()->getGateway($token->getGatewayName());
$gateway->execute($notify = new Notify($token));
/** @var \Ekyna\Component\Sale\Payment\PaymentInterface... | [
"public",
"function",
"notifyAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"token",
"=",
"$",
"this",
"->",
"getHttpRequestVerifier",
"(",
")",
"->",
"verify",
"(",
"$",
"request",
")",
";",
"$",
"gateway",
"=",
"$",
"this",
"->",
"getPayum",
... | Notify action.
@param Request $request
@return Response | [
"Notify",
"action",
"."
] | 1b4f4103b28e3a4f8dbfac2cbd872d728238f4d1 | https://github.com/ekyna/PaymentBundle/blob/1b4f4103b28e3a4f8dbfac2cbd872d728238f4d1/Controller/PaymentController.php#L27-L42 |
197,960 | ekyna/PaymentBundle | Controller/PaymentController.php | PaymentController.doneAction | public function doneAction(Request $request)
{
$debug = $this->container->getParameter('kernel.debug');
$token = $this->getHttpRequestVerifier()->verify($request);
$gateway = $this->getPayum()->getGateway($token->getGatewayName());
$gateway->execute($done = new Done($token));
... | php | public function doneAction(Request $request)
{
$debug = $this->container->getParameter('kernel.debug');
$token = $this->getHttpRequestVerifier()->verify($request);
$gateway = $this->getPayum()->getGateway($token->getGatewayName());
$gateway->execute($done = new Done($token));
... | [
"public",
"function",
"doneAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"debug",
"=",
"$",
"this",
"->",
"container",
"->",
"getParameter",
"(",
"'kernel.debug'",
")",
";",
"$",
"token",
"=",
"$",
"this",
"->",
"getHttpRequestVerifier",
"(",
")"... | Done action.
@param Request $request
@return Response | [
"Done",
"action",
"."
] | 1b4f4103b28e3a4f8dbfac2cbd872d728238f4d1 | https://github.com/ekyna/PaymentBundle/blob/1b4f4103b28e3a4f8dbfac2cbd872d728238f4d1/Controller/PaymentController.php#L50-L80 |
197,961 | phpguard/listen | src/PhpGuard/Listen/Adapter/Tracker.php | Tracker.add | public function add(TrackedObject $tracked)
{
$id = $tracked->getID();
if(isset($this->map[$id])){
return;
}
$this->map[$id] = $tracked;
$this->adapter->watch($tracked);
} | php | public function add(TrackedObject $tracked)
{
$id = $tracked->getID();
if(isset($this->map[$id])){
return;
}
$this->map[$id] = $tracked;
$this->adapter->watch($tracked);
} | [
"public",
"function",
"add",
"(",
"TrackedObject",
"$",
"tracked",
")",
"{",
"$",
"id",
"=",
"$",
"tracked",
"->",
"getID",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"map",
"[",
"$",
"id",
"]",
")",
")",
"{",
"return",
";",
"}"... | Add a new TrackedObject into map
@param TrackedObject $tracked | [
"Add",
"a",
"new",
"TrackedObject",
"into",
"map"
] | cd0cda150858d6d85deb025a72996873d2af3532 | https://github.com/phpguard/listen/blob/cd0cda150858d6d85deb025a72996873d2af3532/src/PhpGuard/Listen/Adapter/Tracker.php#L110-L118 |
197,962 | phpguard/listen | src/PhpGuard/Listen/Adapter/Tracker.php | Tracker.addChangeSet | public function addChangeSet($tracked,$eventMask)
{
if($tracked instanceof TrackedObject){
$path = $tracked->getResource();
if($this->fileOnly && !$tracked->getResource() instanceof FileResource){
return;
}
}else{
$path = $tracked;
... | php | public function addChangeSet($tracked,$eventMask)
{
if($tracked instanceof TrackedObject){
$path = $tracked->getResource();
if($this->fileOnly && !$tracked->getResource() instanceof FileResource){
return;
}
}else{
$path = $tracked;
... | [
"public",
"function",
"addChangeSet",
"(",
"$",
"tracked",
",",
"$",
"eventMask",
")",
"{",
"if",
"(",
"$",
"tracked",
"instanceof",
"TrackedObject",
")",
"{",
"$",
"path",
"=",
"$",
"tracked",
"->",
"getResource",
"(",
")",
";",
"if",
"(",
"$",
"this"... | Add a new event to changeset
@param TrackedObject $tracked
@param int $eventMask | [
"Add",
"a",
"new",
"event",
"to",
"changeset"
] | cd0cda150858d6d85deb025a72996873d2af3532 | https://github.com/phpguard/listen/blob/cd0cda150858d6d85deb025a72996873d2af3532/src/PhpGuard/Listen/Adapter/Tracker.php#L251-L264 |
197,963 | phpguard/listen | src/PhpGuard/Listen/Adapter/Tracker.php | Tracker.scanDir | private function scanDir($path)
{
if(!is_dir($path)) return;
/* @var \Symfony\Component\Finder\SplFileInfo $spl */
$finder = $this->createFinder();
$rootSPL = new DirectoryResource($path);
$rootResource = new DirectoryResource($rootSPL);
$rootResource = $this->creat... | php | private function scanDir($path)
{
if(!is_dir($path)) return;
/* @var \Symfony\Component\Finder\SplFileInfo $spl */
$finder = $this->createFinder();
$rootSPL = new DirectoryResource($path);
$rootResource = new DirectoryResource($rootSPL);
$rootResource = $this->creat... | [
"private",
"function",
"scanDir",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"path",
")",
")",
"return",
";",
"/* @var \\Symfony\\Component\\Finder\\SplFileInfo $spl */",
"$",
"finder",
"=",
"$",
"this",
"->",
"createFinder",
"(",
")",
"... | Scan path and add it to listener
@param string $path | [
"Scan",
"path",
"and",
"add",
"it",
"to",
"listener"
] | cd0cda150858d6d85deb025a72996873d2af3532 | https://github.com/phpguard/listen/blob/cd0cda150858d6d85deb025a72996873d2af3532/src/PhpGuard/Listen/Adapter/Tracker.php#L270-L293 |
197,964 | phpguard/listen | src/PhpGuard/Listen/Adapter/Tracker.php | Tracker.createTrackedObject | public function createTrackedObject(ResourceInterface $resource)
{
$tracked = new TrackedObject();
$tracked->setResource($resource);
$tracked->setChecksum($resource->getChecksum());
if(is_null($tracked->getID())){
$tracked->setID(PathUtil::createPathID($resource->getReso... | php | public function createTrackedObject(ResourceInterface $resource)
{
$tracked = new TrackedObject();
$tracked->setResource($resource);
$tracked->setChecksum($resource->getChecksum());
if(is_null($tracked->getID())){
$tracked->setID(PathUtil::createPathID($resource->getReso... | [
"public",
"function",
"createTrackedObject",
"(",
"ResourceInterface",
"$",
"resource",
")",
"{",
"$",
"tracked",
"=",
"new",
"TrackedObject",
"(",
")",
";",
"$",
"tracked",
"->",
"setResource",
"(",
"$",
"resource",
")",
";",
"$",
"tracked",
"->",
"setCheck... | Create new TrackedObject
@param ResourceInterface $resource
@return TrackedObject | [
"Create",
"new",
"TrackedObject"
] | cd0cda150858d6d85deb025a72996873d2af3532 | https://github.com/phpguard/listen/blob/cd0cda150858d6d85deb025a72996873d2af3532/src/PhpGuard/Listen/Adapter/Tracker.php#L301-L311 |
197,965 | modulusphp/http | Controllers/Auth/RegisterController.php | RegisterController.create | protected function create(Request $request) : Model
{
return User::create([
'name' => $request->input('name'),
'email' => $request->input('email'),
'password' => Hash::make($request->input('password'))
]);
} | php | protected function create(Request $request) : Model
{
return User::create([
'name' => $request->input('name'),
'email' => $request->input('email'),
'password' => Hash::make($request->input('password'))
]);
} | [
"protected",
"function",
"create",
"(",
"Request",
"$",
"request",
")",
":",
"Model",
"{",
"return",
"User",
"::",
"create",
"(",
"[",
"'name'",
"=>",
"$",
"request",
"->",
"input",
"(",
"'name'",
")",
",",
"'email'",
"=>",
"$",
"request",
"->",
"input... | Add new a new user
@param \Modulus\Http\Request $request
@return \App\User | [
"Add",
"new",
"a",
"new",
"user"
] | fc5c0f2b582a04de1685578d3fb790686a0a240c | https://github.com/modulusphp/http/blob/fc5c0f2b582a04de1685578d3fb790686a0a240c/Controllers/Auth/RegisterController.php#L50-L57 |
197,966 | DreadLabs/typo3-cms-phing-helper | Classes/Filters/LocalConfigurationFilter.php | LocalConfigurationFilter.chain | public function chain(Reader $reader)
{
$newFilter = new LocalConfigurationFilter($reader);
$newFilter->setProject($this->getProject());
$newFilter->setCacheDir($this->getCacheDir());
$newFilter->setTYPO3Version($this->getTYPO3Version());
$newFilter->addInstallTool($this->ins... | php | public function chain(Reader $reader)
{
$newFilter = new LocalConfigurationFilter($reader);
$newFilter->setProject($this->getProject());
$newFilter->setCacheDir($this->getCacheDir());
$newFilter->setTYPO3Version($this->getTYPO3Version());
$newFilter->addInstallTool($this->ins... | [
"public",
"function",
"chain",
"(",
"Reader",
"$",
"reader",
")",
"{",
"$",
"newFilter",
"=",
"new",
"LocalConfigurationFilter",
"(",
"$",
"reader",
")",
";",
"$",
"newFilter",
"->",
"setProject",
"(",
"$",
"this",
"->",
"getProject",
"(",
")",
")",
";",... | Creates a new LocalConfigurationFilter using the passed in
Reader for instantiation.
@param Reader A Reader object providing the underlying stream. Must not be <code>null</code>.
@return Reader A new filter based on this configuration, but filtering the specified reader | [
"Creates",
"a",
"new",
"LocalConfigurationFilter",
"using",
"the",
"passed",
"in",
"Reader",
"for",
"instantiation",
"."
] | b6606102c4702a92bc1872eba962febceaa0e645 | https://github.com/DreadLabs/typo3-cms-phing-helper/blob/b6606102c4702a92bc1872eba962febceaa0e645/Classes/Filters/LocalConfigurationFilter.php#L139-L149 |
197,967 | DreadLabs/typo3-cms-phing-helper | Classes/Filters/LocalConfigurationFilter.php | LocalConfigurationFilter.read | public function read($len = null)
{
if (FALSE === $this->getInitialized()) {
$this->initialize();
$this->setInitialized(TRUE);
}
$defaultConfiguration = '';
if (-1 === version_compare($this->getTYPO3Version(), '0.0.0')) {
throw new BuildException... | php | public function read($len = null)
{
if (FALSE === $this->getInitialized()) {
$this->initialize();
$this->setInitialized(TRUE);
}
$defaultConfiguration = '';
if (-1 === version_compare($this->getTYPO3Version(), '0.0.0')) {
throw new BuildException... | [
"public",
"function",
"read",
"(",
"$",
"len",
"=",
"null",
")",
"{",
"if",
"(",
"FALSE",
"===",
"$",
"this",
"->",
"getInitialized",
"(",
")",
")",
"{",
"$",
"this",
"->",
"initialize",
"(",
")",
";",
"$",
"this",
"->",
"setInitialized",
"(",
"TRU... | Reads stream, applies property file formatting and returns resulting stream.
@return string transformed buffer.
@throws BuildException if TYPO3version is not set in unresolveableReplacementPairs | [
"Reads",
"stream",
"applies",
"property",
"file",
"formatting",
"and",
"returns",
"resulting",
"stream",
"."
] | b6606102c4702a92bc1872eba962febceaa0e645 | https://github.com/DreadLabs/typo3-cms-phing-helper/blob/b6606102c4702a92bc1872eba962febceaa0e645/Classes/Filters/LocalConfigurationFilter.php#L157-L185 |
197,968 | DreadLabs/typo3-cms-phing-helper | Classes/Filters/LocalConfigurationFilter.php | LocalConfigurationFilter.initialize | private function initialize()
{
$params = $this->getParameters();
if ($params) {
foreach ($params as $param) {
$setter = 'set' . str_replace(' ', '', ucwords(str_replace('-', ' ', $param->getName())));
if (FALSE === method_exists($this, $setter)) {
... | php | private function initialize()
{
$params = $this->getParameters();
if ($params) {
foreach ($params as $param) {
$setter = 'set' . str_replace(' ', '', ucwords(str_replace('-', ' ', $param->getName())));
if (FALSE === method_exists($this, $setter)) {
... | [
"private",
"function",
"initialize",
"(",
")",
"{",
"$",
"params",
"=",
"$",
"this",
"->",
"getParameters",
"(",
")",
";",
"if",
"(",
"$",
"params",
")",
"{",
"foreach",
"(",
"$",
"params",
"as",
"$",
"param",
")",
"{",
"$",
"setter",
"=",
"'set'",... | Initializes any parameters
This method is only called when this filter is used through a <filterreader> tag in build file.
@return void | [
"Initializes",
"any",
"parameters"
] | b6606102c4702a92bc1872eba962febceaa0e645 | https://github.com/DreadLabs/typo3-cms-phing-helper/blob/b6606102c4702a92bc1872eba962febceaa0e645/Classes/Filters/LocalConfigurationFilter.php#L194-L213 |
197,969 | DreadLabs/typo3-cms-phing-helper | Classes/Filters/LocalConfigurationFilter.php | LocalConfigurationFilter.setDefaultConfiguration | protected function setDefaultConfiguration($rawContent)
{
$resolvedContent = strtr($rawContent, $this->unresolveableReplacementPairs);
$cacheFile = tempnam($this->cacheDir, 'tmp');
$fh = fopen($cacheFile, 'w');
fwrite($fh, $resolvedContent);
fclose($fh);
$this->d... | php | protected function setDefaultConfiguration($rawContent)
{
$resolvedContent = strtr($rawContent, $this->unresolveableReplacementPairs);
$cacheFile = tempnam($this->cacheDir, 'tmp');
$fh = fopen($cacheFile, 'w');
fwrite($fh, $resolvedContent);
fclose($fh);
$this->d... | [
"protected",
"function",
"setDefaultConfiguration",
"(",
"$",
"rawContent",
")",
"{",
"$",
"resolvedContent",
"=",
"strtr",
"(",
"$",
"rawContent",
",",
"$",
"this",
"->",
"unresolveableReplacementPairs",
")",
";",
"$",
"cacheFile",
"=",
"tempnam",
"(",
"$",
"... | modifies the given raw content by creating a temp file and resolving some TYPO3 CMS constants
@param string $rawContent
@return void | [
"modifies",
"the",
"given",
"raw",
"content",
"by",
"creating",
"a",
"temp",
"file",
"and",
"resolving",
"some",
"TYPO3",
"CMS",
"constants"
] | b6606102c4702a92bc1872eba962febceaa0e645 | https://github.com/DreadLabs/typo3-cms-phing-helper/blob/b6606102c4702a92bc1872eba962febceaa0e645/Classes/Filters/LocalConfigurationFilter.php#L221-L236 |
197,970 | DreadLabs/typo3-cms-phing-helper | Classes/Filters/LocalConfigurationFilter.php | LocalConfigurationFilter.createPropertyPathsFromCommentArray | public function createPropertyPathsFromCommentArray($comments)
{
$out = '';
foreach ($comments as $mainKey => $subKeys) {
foreach ($subKeys as $subKey => $comment) {
// uncommented entries are undocumented & for internal use only (I guess)
if ('' === $com... | php | public function createPropertyPathsFromCommentArray($comments)
{
$out = '';
foreach ($comments as $mainKey => $subKeys) {
foreach ($subKeys as $subKey => $comment) {
// uncommented entries are undocumented & for internal use only (I guess)
if ('' === $com... | [
"public",
"function",
"createPropertyPathsFromCommentArray",
"(",
"$",
"comments",
")",
"{",
"$",
"out",
"=",
"''",
";",
"foreach",
"(",
"$",
"comments",
"as",
"$",
"mainKey",
"=>",
"$",
"subKeys",
")",
"{",
"foreach",
"(",
"$",
"subKeys",
"as",
"$",
"su... | creates the property file lines for the given comments array
@param array $comments
@return string | [
"creates",
"the",
"property",
"file",
"lines",
"for",
"the",
"given",
"comments",
"array"
] | b6606102c4702a92bc1872eba962febceaa0e645 | https://github.com/DreadLabs/typo3-cms-phing-helper/blob/b6606102c4702a92bc1872eba962febceaa0e645/Classes/Filters/LocalConfigurationFilter.php#L244-L273 |
197,971 | translationexchange/tml-php-clientsdk | library/Tr8n/Base.php | Base.toArray | public function toArray($keys=array()) {
$vars = get_object_vars($this);
$results = array();
if (count($keys) == 0) {
foreach($vars as $name=>$value) {
if (is_string($value) || is_numeric($value) || is_bool($value)) {
$results[$name] = $value;
... | php | public function toArray($keys=array()) {
$vars = get_object_vars($this);
$results = array();
if (count($keys) == 0) {
foreach($vars as $name=>$value) {
if (is_string($value) || is_numeric($value) || is_bool($value)) {
$results[$name] = $value;
... | [
"public",
"function",
"toArray",
"(",
"$",
"keys",
"=",
"array",
"(",
")",
")",
"{",
"$",
"vars",
"=",
"get_object_vars",
"(",
"$",
"this",
")",
";",
"$",
"results",
"=",
"array",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"keys",
")",
"==",
... | Serializes an object into a dictionary
@param array $keys
@return array | [
"Serializes",
"an",
"object",
"into",
"a",
"dictionary"
] | fe51473824e62cfd883c6aa0c6a3783a16ce8425 | https://github.com/translationexchange/tml-php-clientsdk/blob/fe51473824e62cfd883c6aa0c6a3783a16ce8425/library/Tr8n/Base.php#L54-L73 |
197,972 | cinnamonlab/framework | src/Framework/Response.php | Response.json | static function json( $data, $code = 200 ) {
return (new Response())
->setCode($code)
->setContent(json_encode($data))
->setContentType('application/json');
} | php | static function json( $data, $code = 200 ) {
return (new Response())
->setCode($code)
->setContent(json_encode($data))
->setContentType('application/json');
} | [
"static",
"function",
"json",
"(",
"$",
"data",
",",
"$",
"code",
"=",
"200",
")",
"{",
"return",
"(",
"new",
"Response",
"(",
")",
")",
"->",
"setCode",
"(",
"$",
"code",
")",
"->",
"setContent",
"(",
"json_encode",
"(",
"$",
"data",
")",
")",
"... | Create Response object with JSON header + content
@param array $data
@param int $code HTTP code (optional)
@return Response object | [
"Create",
"Response",
"object",
"with",
"JSON",
"header",
"+",
"content"
] | 958ba3e60d3f927adc40a543ec6d4f08d38cfd2c | https://github.com/cinnamonlab/framework/blob/958ba3e60d3f927adc40a543ec6d4f08d38cfd2c/src/Framework/Response.php#L17-L22 |
197,973 | cinnamonlab/framework | src/Framework/Response.php | Response.setCode | function setCode( $code ) {
$this->code = $code;
$this->addHeader($this->getDefaultHeaderFromCode( $code ));
return $this;
} | php | function setCode( $code ) {
$this->code = $code;
$this->addHeader($this->getDefaultHeaderFromCode( $code ));
return $this;
} | [
"function",
"setCode",
"(",
"$",
"code",
")",
"{",
"$",
"this",
"->",
"code",
"=",
"$",
"code",
";",
"$",
"this",
"->",
"addHeader",
"(",
"$",
"this",
"->",
"getDefaultHeaderFromCode",
"(",
"$",
"code",
")",
")",
";",
"return",
"$",
"this",
";",
"}... | Set HTTP code and put on header
@param $code
@return $this | [
"Set",
"HTTP",
"code",
"and",
"put",
"on",
"header"
] | 958ba3e60d3f927adc40a543ec6d4f08d38cfd2c | https://github.com/cinnamonlab/framework/blob/958ba3e60d3f927adc40a543ec6d4f08d38cfd2c/src/Framework/Response.php#L54-L58 |
197,974 | shgysk8zer0/core_api | abstracts/file_io.php | File_IO.openFile | final public function openFile($filename, $use_include_path = false)
{
$this->getPathInfo($filename, $use_include_path);
$this->fileResource = fopen(
$this->dirname . DIRECTORY_SEPARATOR . $this->basename,
self::FILE_MODE
);
return flock($this->fileResource, LOCK_EX);
} | php | final public function openFile($filename, $use_include_path = false)
{
$this->getPathInfo($filename, $use_include_path);
$this->fileResource = fopen(
$this->dirname . DIRECTORY_SEPARATOR . $this->basename,
self::FILE_MODE
);
return flock($this->fileResource, LOCK_EX);
} | [
"final",
"public",
"function",
"openFile",
"(",
"$",
"filename",
",",
"$",
"use_include_path",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"getPathInfo",
"(",
"$",
"filename",
",",
"$",
"use_include_path",
")",
";",
"$",
"this",
"->",
"fileResource",
"=",
... | Opens the file in the specified mode designating read, write, create
capabilities. Obtains exclusive lock on file, which is released when class
is destroyed.
@param string $filename Name/path of file to be working with
@param bool $use_include_path If you want to search for the file in the include_path
@retu... | [
"Opens",
"the",
"file",
"in",
"the",
"specified",
"mode",
"designating",
"read",
"write",
"create",
"capabilities",
".",
"Obtains",
"exclusive",
"lock",
"on",
"file",
"which",
"is",
"released",
"when",
"class",
"is",
"destroyed",
"."
] | 9e9b8baf761af874b95256ad2462e55fbb2b2e58 | https://github.com/shgysk8zer0/core_api/blob/9e9b8baf761af874b95256ad2462e55fbb2b2e58/abstracts/file_io.php#L55-L63 |
197,975 | SagittariusX/Beluga.Date | src/Beluga/Date/DateTime.php | DateTime.getDifferenceYears | public final function getDifferenceYears( $dt = null, bool $abs = true ) : int
{
$dt = $dt ?: static::Now( $this->getTimezone() );
return (int) $this->diff( $dt, $abs )->format( '%r%y' );
} | php | public final function getDifferenceYears( $dt = null, bool $abs = true ) : int
{
$dt = $dt ?: static::Now( $this->getTimezone() );
return (int) $this->diff( $dt, $abs )->format( '%r%y' );
} | [
"public",
"final",
"function",
"getDifferenceYears",
"(",
"$",
"dt",
"=",
"null",
",",
"bool",
"$",
"abs",
"=",
"true",
")",
":",
"int",
"{",
"$",
"dt",
"=",
"$",
"dt",
"?",
":",
"static",
"::",
"Now",
"(",
"$",
"this",
"->",
"getTimezone",
"(",
... | Get the difference in years between current date time and defined.
If no other date time is defined Now is used.
@param \Beluga\Date\DateTime|null $dt
@param bool $abs Get the absolute of the difference
@return int | [
"Get",
"the",
"difference",
"in",
"years",
"between",
"current",
"date",
"time",
"and",
"defined",
"."
] | 1bd28500e81eb5db8502e58506ebeb9268154884 | https://github.com/SagittariusX/Beluga.Date/blob/1bd28500e81eb5db8502e58506ebeb9268154884/src/Beluga/Date/DateTime.php#L549-L556 |
197,976 | SagittariusX/Beluga.Date | src/Beluga/Date/DateTime.php | DateTime.setISODate | public function setISODate( $year, $week, $day = null )
: DateTime
{
parent::setISODate( $year, $week, $day );
return $this;
} | php | public function setISODate( $year, $week, $day = null )
: DateTime
{
parent::setISODate( $year, $week, $day );
return $this;
} | [
"public",
"function",
"setISODate",
"(",
"$",
"year",
",",
"$",
"week",
",",
"$",
"day",
"=",
"null",
")",
":",
"DateTime",
"{",
"parent",
"::",
"setISODate",
"(",
"$",
"year",
",",
"$",
"week",
",",
"$",
"day",
")",
";",
"return",
"$",
"this",
"... | Sets a date by ISO-8601 conform data.
@param integer $year The year
@param integer $week The Week number (Weeks begins at monday)
@param integer $day The day
@return \Beluga\Date\DateTime | [
"Sets",
"a",
"date",
"by",
"ISO",
"-",
"8601",
"conform",
"data",
"."
] | 1bd28500e81eb5db8502e58506ebeb9268154884 | https://github.com/SagittariusX/Beluga.Date/blob/1bd28500e81eb5db8502e58506ebeb9268154884/src/Beluga/Date/DateTime.php#L717-L725 |
197,977 | SagittariusX/Beluga.Date | src/Beluga/Date/DateTime.php | DateTime.setYear | public final function setYear( int $year = null )
: DateTime
{
if ( \is_null( $year ) )
{
$year = static::CurrentYear();
}
return $this->setDateParts( $year );
} | php | public final function setYear( int $year = null )
: DateTime
{
if ( \is_null( $year ) )
{
$year = static::CurrentYear();
}
return $this->setDateParts( $year );
} | [
"public",
"final",
"function",
"setYear",
"(",
"int",
"$",
"year",
"=",
"null",
")",
":",
"DateTime",
"{",
"if",
"(",
"\\",
"is_null",
"(",
"$",
"year",
")",
")",
"{",
"$",
"year",
"=",
"static",
"::",
"CurrentYear",
"(",
")",
";",
"}",
"return",
... | Changes the current defined year to defined value.
@param integer $year The new year value. If the value NULL is used it means: Use the year of NOW()
@return \Beluga\Date\DateTime | [
"Changes",
"the",
"current",
"defined",
"year",
"to",
"defined",
"value",
"."
] | 1bd28500e81eb5db8502e58506ebeb9268154884 | https://github.com/SagittariusX/Beluga.Date/blob/1bd28500e81eb5db8502e58506ebeb9268154884/src/Beluga/Date/DateTime.php#L733-L744 |
197,978 | SagittariusX/Beluga.Date | src/Beluga/Date/DateTime.php | DateTime.setMonth | public final function setMonth( int $month = null )
: DateTime
{
if ( \is_null( $month ) )
{
$month = static::CurrentMonth();
}
return $this->setDateParts( null, $month );
} | php | public final function setMonth( int $month = null )
: DateTime
{
if ( \is_null( $month ) )
{
$month = static::CurrentMonth();
}
return $this->setDateParts( null, $month );
} | [
"public",
"final",
"function",
"setMonth",
"(",
"int",
"$",
"month",
"=",
"null",
")",
":",
"DateTime",
"{",
"if",
"(",
"\\",
"is_null",
"(",
"$",
"month",
")",
")",
"{",
"$",
"month",
"=",
"static",
"::",
"CurrentMonth",
"(",
")",
";",
"}",
"retur... | Changes the current defined month to defined value.
@param integer $month The new month value. If the value NULL is used it means: Use the month of NOW()
@return \Beluga\Date\DateTime | [
"Changes",
"the",
"current",
"defined",
"month",
"to",
"defined",
"value",
"."
] | 1bd28500e81eb5db8502e58506ebeb9268154884 | https://github.com/SagittariusX/Beluga.Date/blob/1bd28500e81eb5db8502e58506ebeb9268154884/src/Beluga/Date/DateTime.php#L752-L763 |
197,979 | SagittariusX/Beluga.Date | src/Beluga/Date/DateTime.php | DateTime.setDay | public final function setDay( int $day = null )
: DateTime
{
if ( \is_null( $day ) )
{
$day = static::CurrentDay();
}
return $this->setDateParts( null, null, $day );
} | php | public final function setDay( int $day = null )
: DateTime
{
if ( \is_null( $day ) )
{
$day = static::CurrentDay();
}
return $this->setDateParts( null, null, $day );
} | [
"public",
"final",
"function",
"setDay",
"(",
"int",
"$",
"day",
"=",
"null",
")",
":",
"DateTime",
"{",
"if",
"(",
"\\",
"is_null",
"(",
"$",
"day",
")",
")",
"{",
"$",
"day",
"=",
"static",
"::",
"CurrentDay",
"(",
")",
";",
"}",
"return",
"$",... | Changes the current defined day to defined value.
@param integer $day The new day value. If the value NULL is used it means: Use the day of NOW()
@return \Beluga\Date\DateTime | [
"Changes",
"the",
"current",
"defined",
"day",
"to",
"defined",
"value",
"."
] | 1bd28500e81eb5db8502e58506ebeb9268154884 | https://github.com/SagittariusX/Beluga.Date/blob/1bd28500e81eb5db8502e58506ebeb9268154884/src/Beluga/Date/DateTime.php#L771-L782 |
197,980 | SagittariusX/Beluga.Date | src/Beluga/Date/DateTime.php | DateTime.setHour | public final function setHour( int $hour = null )
: DateTime
{
if ( \is_null( $hour ) )
{
$hour = static::CurrentHour();
}
return $this->setTimeParts( $hour );
} | php | public final function setHour( int $hour = null )
: DateTime
{
if ( \is_null( $hour ) )
{
$hour = static::CurrentHour();
}
return $this->setTimeParts( $hour );
} | [
"public",
"final",
"function",
"setHour",
"(",
"int",
"$",
"hour",
"=",
"null",
")",
":",
"DateTime",
"{",
"if",
"(",
"\\",
"is_null",
"(",
"$",
"hour",
")",
")",
"{",
"$",
"hour",
"=",
"static",
"::",
"CurrentHour",
"(",
")",
";",
"}",
"return",
... | Changes the current defined hour to defined value.
@param integer $hour The new hour value. If the value NULL is used it means: Use the hour of NOW()
@return \Beluga\Date\DateTime | [
"Changes",
"the",
"current",
"defined",
"hour",
"to",
"defined",
"value",
"."
] | 1bd28500e81eb5db8502e58506ebeb9268154884 | https://github.com/SagittariusX/Beluga.Date/blob/1bd28500e81eb5db8502e58506ebeb9268154884/src/Beluga/Date/DateTime.php#L790-L801 |
197,981 | SagittariusX/Beluga.Date | src/Beluga/Date/DateTime.php | DateTime.setMinute | public final function setMinute( int $minute = null )
: DateTime
{
if ( \is_null( $minute ) )
{
$minute = static::CurrentMinute();
}
return $this->setTimeParts( null, $minute );
} | php | public final function setMinute( int $minute = null )
: DateTime
{
if ( \is_null( $minute ) )
{
$minute = static::CurrentMinute();
}
return $this->setTimeParts( null, $minute );
} | [
"public",
"final",
"function",
"setMinute",
"(",
"int",
"$",
"minute",
"=",
"null",
")",
":",
"DateTime",
"{",
"if",
"(",
"\\",
"is_null",
"(",
"$",
"minute",
")",
")",
"{",
"$",
"minute",
"=",
"static",
"::",
"CurrentMinute",
"(",
")",
";",
"}",
"... | Changes the current defined minute to defined value.
@param integer $minute The new minute value. If the value NULL is used it means: Use the minute of NOW()
@return \Beluga\Date\DateTime | [
"Changes",
"the",
"current",
"defined",
"minute",
"to",
"defined",
"value",
"."
] | 1bd28500e81eb5db8502e58506ebeb9268154884 | https://github.com/SagittariusX/Beluga.Date/blob/1bd28500e81eb5db8502e58506ebeb9268154884/src/Beluga/Date/DateTime.php#L809-L820 |
197,982 | SagittariusX/Beluga.Date | src/Beluga/Date/DateTime.php | DateTime.setSecond | public final function setSecond( int $second = null )
: DateTime
{
if ( \is_null( $second ) )
{
$second = static::CurrentSecond();
}
return $this->setTimeParts( null, null, $second );
} | php | public final function setSecond( int $second = null )
: DateTime
{
if ( \is_null( $second ) )
{
$second = static::CurrentSecond();
}
return $this->setTimeParts( null, null, $second );
} | [
"public",
"final",
"function",
"setSecond",
"(",
"int",
"$",
"second",
"=",
"null",
")",
":",
"DateTime",
"{",
"if",
"(",
"\\",
"is_null",
"(",
"$",
"second",
")",
")",
"{",
"$",
"second",
"=",
"static",
"::",
"CurrentSecond",
"(",
")",
";",
"}",
"... | Changes the current defined second to defined value.
@param integer $second The new second value. If the value NULL is used it means: Use the second of NOW()
@return \Beluga\Date\DateTime | [
"Changes",
"the",
"current",
"defined",
"second",
"to",
"defined",
"value",
"."
] | 1bd28500e81eb5db8502e58506ebeb9268154884 | https://github.com/SagittariusX/Beluga.Date/blob/1bd28500e81eb5db8502e58506ebeb9268154884/src/Beluga/Date/DateTime.php#L828-L839 |
197,983 | SagittariusX/Beluga.Date | src/Beluga/Date/DateTime.php | DateTime.addSeconds | public final function addSeconds( int $seconds = 1 )
: DateTime
{
return $this->move( new \DateInterval( 'PT' . \abs( $seconds ) . 'S' ), $seconds < 0 );
} | php | public final function addSeconds( int $seconds = 1 )
: DateTime
{
return $this->move( new \DateInterval( 'PT' . \abs( $seconds ) . 'S' ), $seconds < 0 );
} | [
"public",
"final",
"function",
"addSeconds",
"(",
"int",
"$",
"seconds",
"=",
"1",
")",
":",
"DateTime",
"{",
"return",
"$",
"this",
"->",
"move",
"(",
"new",
"\\",
"DateInterval",
"(",
"'PT'",
".",
"\\",
"abs",
"(",
"$",
"seconds",
")",
".",
"'S'",
... | Adds the defined number of seconds.
@param integer $seconds The seconds to add (use a negative value to subtract/remove the seconds)
@return \Beluga\Date\DateTime Returns the current changed instance. | [
"Adds",
"the",
"defined",
"number",
"of",
"seconds",
"."
] | 1bd28500e81eb5db8502e58506ebeb9268154884 | https://github.com/SagittariusX/Beluga.Date/blob/1bd28500e81eb5db8502e58506ebeb9268154884/src/Beluga/Date/DateTime.php#L885-L891 |
197,984 | SagittariusX/Beluga.Date | src/Beluga/Date/DateTime.php | DateTime.addMinutes | public final function addMinutes( int $minutes = 1 )
: DateTime
{
return $this->move( new \DateInterval( 'PT' . \abs( $minutes ) . 'M' ), $minutes < 0 );
} | php | public final function addMinutes( int $minutes = 1 )
: DateTime
{
return $this->move( new \DateInterval( 'PT' . \abs( $minutes ) . 'M' ), $minutes < 0 );
} | [
"public",
"final",
"function",
"addMinutes",
"(",
"int",
"$",
"minutes",
"=",
"1",
")",
":",
"DateTime",
"{",
"return",
"$",
"this",
"->",
"move",
"(",
"new",
"\\",
"DateInterval",
"(",
"'PT'",
".",
"\\",
"abs",
"(",
"$",
"minutes",
")",
".",
"'M'",
... | Adds the defined number of minutes.
@param integer $minutes The minutes to add (use a negative value to subtract/remove the minutes)
@return \Beluga\Date\DateTime Returns the current changed instance. | [
"Adds",
"the",
"defined",
"number",
"of",
"minutes",
"."
] | 1bd28500e81eb5db8502e58506ebeb9268154884 | https://github.com/SagittariusX/Beluga.Date/blob/1bd28500e81eb5db8502e58506ebeb9268154884/src/Beluga/Date/DateTime.php#L927-L933 |
197,985 | SagittariusX/Beluga.Date | src/Beluga/Date/DateTime.php | DateTime.addHours | public final function addHours( int $hours = 1 )
: DateTime
{
return $this->move( new \DateInterval( 'PT' . \abs( $hours ) . 'H' ), $hours < 0 );
} | php | public final function addHours( int $hours = 1 )
: DateTime
{
return $this->move( new \DateInterval( 'PT' . \abs( $hours ) . 'H' ), $hours < 0 );
} | [
"public",
"final",
"function",
"addHours",
"(",
"int",
"$",
"hours",
"=",
"1",
")",
":",
"DateTime",
"{",
"return",
"$",
"this",
"->",
"move",
"(",
"new",
"\\",
"DateInterval",
"(",
"'PT'",
".",
"\\",
"abs",
"(",
"$",
"hours",
")",
".",
"'H'",
")",... | Adds the defined number of hours.
@param integer $hours The hours to add (use a negative value to subtract/remove the hours)
@return \Beluga\Date\DateTime Returns the current changed instance. | [
"Adds",
"the",
"defined",
"number",
"of",
"hours",
"."
] | 1bd28500e81eb5db8502e58506ebeb9268154884 | https://github.com/SagittariusX/Beluga.Date/blob/1bd28500e81eb5db8502e58506ebeb9268154884/src/Beluga/Date/DateTime.php#L955-L961 |
197,986 | SagittariusX/Beluga.Date | src/Beluga/Date/DateTime.php | DateTime.addDays | public final function addDays( int $days = 1 )
: DateTime
{
return $this->move( new \DateInterval( 'P' . \abs( $days ) . 'D' ), $days < 0 );
} | php | public final function addDays( int $days = 1 )
: DateTime
{
return $this->move( new \DateInterval( 'P' . \abs( $days ) . 'D' ), $days < 0 );
} | [
"public",
"final",
"function",
"addDays",
"(",
"int",
"$",
"days",
"=",
"1",
")",
":",
"DateTime",
"{",
"return",
"$",
"this",
"->",
"move",
"(",
"new",
"\\",
"DateInterval",
"(",
"'P'",
".",
"\\",
"abs",
"(",
"$",
"days",
")",
".",
"'D'",
")",
"... | Adds the defined number of days.
@param integer $days The days to add (use a negative value to subtract/remove the days)
@return \Beluga\Date\DateTime Returns the current changed instance. | [
"Adds",
"the",
"defined",
"number",
"of",
"days",
"."
] | 1bd28500e81eb5db8502e58506ebeb9268154884 | https://github.com/SagittariusX/Beluga.Date/blob/1bd28500e81eb5db8502e58506ebeb9268154884/src/Beluga/Date/DateTime.php#L969-L975 |
197,987 | SagittariusX/Beluga.Date | src/Beluga/Date/DateTime.php | DateTime.addWeeks | public final function addWeeks( int $weeks = 1 )
: DateTime
{
return $this->move( new \DateInterval( 'P' . \abs( $weeks ) . 'W' ), $weeks < 0 );
} | php | public final function addWeeks( int $weeks = 1 )
: DateTime
{
return $this->move( new \DateInterval( 'P' . \abs( $weeks ) . 'W' ), $weeks < 0 );
} | [
"public",
"final",
"function",
"addWeeks",
"(",
"int",
"$",
"weeks",
"=",
"1",
")",
":",
"DateTime",
"{",
"return",
"$",
"this",
"->",
"move",
"(",
"new",
"\\",
"DateInterval",
"(",
"'P'",
".",
"\\",
"abs",
"(",
"$",
"weeks",
")",
".",
"'W'",
")",
... | Adds the defined number of weeks.
@param integer $weeks The weeks to add (use a negative value to subtract/remove the weeks)
@return \Beluga\Date\DateTime Returns the current changed instance. | [
"Adds",
"the",
"defined",
"number",
"of",
"weeks",
"."
] | 1bd28500e81eb5db8502e58506ebeb9268154884 | https://github.com/SagittariusX/Beluga.Date/blob/1bd28500e81eb5db8502e58506ebeb9268154884/src/Beluga/Date/DateTime.php#L983-L989 |
197,988 | SagittariusX/Beluga.Date | src/Beluga/Date/DateTime.php | DateTime.formatNamedDate | public final function formatNamedDate( bool $short = false )
: string
{
if ( $short )
{
return \sprintf(
'%s., %s. %s %d',
$this->getShortWeekDayName(),
$this->getDay(),
$this->getShortMonthName(),
$this->getYear()
);
... | php | public final function formatNamedDate( bool $short = false )
: string
{
if ( $short )
{
return \sprintf(
'%s., %s. %s %d',
$this->getShortWeekDayName(),
$this->getDay(),
$this->getShortMonthName(),
$this->getYear()
);
... | [
"public",
"final",
"function",
"formatNamedDate",
"(",
"bool",
"$",
"short",
"=",
"false",
")",
":",
"string",
"{",
"if",
"(",
"$",
"short",
")",
"{",
"return",
"\\",
"sprintf",
"(",
"'%s., %s. %s %d'",
",",
"$",
"this",
"->",
"getShortWeekDayName",
"(",
... | Formats the current instance to a named date, depending to current used locale.
The output uses long names like "Montag, 20. Dezember 2030" or short names
like "Mon, 20. Dec 2030"
@param boolean $short Return names in short notation?
@return string | [
"Formats",
"the",
"current",
"instance",
"to",
"a",
"named",
"date",
"depending",
"to",
"current",
"used",
"locale",
".",
"The",
"output",
"uses",
"long",
"names",
"like",
"Montag",
"20",
".",
"Dezember",
"2030",
"or",
"short",
"names",
"like",
"Mon",
"20"... | 1bd28500e81eb5db8502e58506ebeb9268154884 | https://github.com/SagittariusX/Beluga.Date/blob/1bd28500e81eb5db8502e58506ebeb9268154884/src/Beluga/Date/DateTime.php#L1042-L1065 |
197,989 | SagittariusX/Beluga.Date | src/Beluga/Date/DateTime.php | DateTime.Parse | public static function Parse( $datetime, \DateTimeZone $timezone = null )
{
if ( \is_null( $datetime ) )
{
// NULL returns FALSE
return false;
}
if ( $datetime instanceof DateTime )
{
// Its already a \Beluga\DateTime => return it.
return $datetime;... | php | public static function Parse( $datetime, \DateTimeZone $timezone = null )
{
if ( \is_null( $datetime ) )
{
// NULL returns FALSE
return false;
}
if ( $datetime instanceof DateTime )
{
// Its already a \Beluga\DateTime => return it.
return $datetime;... | [
"public",
"static",
"function",
"Parse",
"(",
"$",
"datetime",
",",
"\\",
"DateTimeZone",
"$",
"timezone",
"=",
"null",
")",
"{",
"if",
"(",
"\\",
"is_null",
"(",
"$",
"datetime",
")",
")",
"{",
"// NULL returns FALSE",
"return",
"false",
";",
"}",
"if",... | Parses a value to a \Beluga\Date\DateTime instance.
@param mixed $datetime The value to parse as DateTime. If can be a date(time) string, a unix timestamp
, a object of type \DateTime or something that can be converted, by a string
cast, to a valid date(time) string.
@param \DateTimeZone $timezone An optiona... | [
"Parses",
"a",
"value",
"to",
"a",
"\\",
"Beluga",
"\\",
"Date",
"\\",
"DateTime",
"instance",
"."
] | 1bd28500e81eb5db8502e58506ebeb9268154884 | https://github.com/SagittariusX/Beluga.Date/blob/1bd28500e81eb5db8502e58506ebeb9268154884/src/Beluga/Date/DateTime.php#L1205-L1284 |
197,990 | SagittariusX/Beluga.Date | src/Beluga/Date/DateTime.php | DateTime.Create | public static function Create(
int $year, int $month, int $day, int $hour = 0, int $minute = 0, int $second = 0 ) : DateTime
{
$dt = new DateTime();
$dt->setDate( $year, $month, $day );
$dt->setTime( $hour, $minute, $second );
return $dt;
} | php | public static function Create(
int $year, int $month, int $day, int $hour = 0, int $minute = 0, int $second = 0 ) : DateTime
{
$dt = new DateTime();
$dt->setDate( $year, $month, $day );
$dt->setTime( $hour, $minute, $second );
return $dt;
} | [
"public",
"static",
"function",
"Create",
"(",
"int",
"$",
"year",
",",
"int",
"$",
"month",
",",
"int",
"$",
"day",
",",
"int",
"$",
"hour",
"=",
"0",
",",
"int",
"$",
"minute",
"=",
"0",
",",
"int",
"$",
"second",
"=",
"0",
")",
":",
"DateTim... | Init's a new instance.
@param integer $year The year
@param integer $month The month number (1-12)
@param integer $day The day of month number (1-31 depending to leap year and month)
@param integer $hour The Hour (0-23)
@param integer $minute The Minute (0-59)
@param integer $second The Second (0-59)
@re... | [
"Init",
"s",
"a",
"new",
"instance",
"."
] | 1bd28500e81eb5db8502e58506ebeb9268154884 | https://github.com/SagittariusX/Beluga.Date/blob/1bd28500e81eb5db8502e58506ebeb9268154884/src/Beluga/Date/DateTime.php#L1297-L1306 |
197,991 | SagittariusX/Beluga.Date | src/Beluga/Date/DateTime.php | DateTime.FromDateTime | public static function FromDateTime( \DateTime $dt ) : DateTime
{
if ( $dt instanceof DateTime )
{
return clone $dt;
}
return new DateTime( $dt->format('Y-m-d H:i:s.u'), $dt->getTimezone() );
} | php | public static function FromDateTime( \DateTime $dt ) : DateTime
{
if ( $dt instanceof DateTime )
{
return clone $dt;
}
return new DateTime( $dt->format('Y-m-d H:i:s.u'), $dt->getTimezone() );
} | [
"public",
"static",
"function",
"FromDateTime",
"(",
"\\",
"DateTime",
"$",
"dt",
")",
":",
"DateTime",
"{",
"if",
"(",
"$",
"dt",
"instanceof",
"DateTime",
")",
"{",
"return",
"clone",
"$",
"dt",
";",
"}",
"return",
"new",
"DateTime",
"(",
"$",
"dt",
... | Create a DateTime instance from PHP \DateTime instance.
@param \DateTime $dt
@return \Beluga\Date\DateTime | [
"Create",
"a",
"DateTime",
"instance",
"from",
"PHP",
"\\",
"DateTime",
"instance",
"."
] | 1bd28500e81eb5db8502e58506ebeb9268154884 | https://github.com/SagittariusX/Beluga.Date/blob/1bd28500e81eb5db8502e58506ebeb9268154884/src/Beluga/Date/DateTime.php#L1314-L1324 |
197,992 | SagittariusX/Beluga.Date | src/Beluga/Date/DateTime.php | DateTime.FromFormat | public static function FromFormat( string $format, $time, \DateTimeZone $timezone = null ) : DateTime
{
if ( $timezone !== null )
{
$dt = parent::createFromFormat( $format, $time, $timezone );
}
else
{
$dt = parent::createFromFormat( $format, $time );
}
if... | php | public static function FromFormat( string $format, $time, \DateTimeZone $timezone = null ) : DateTime
{
if ( $timezone !== null )
{
$dt = parent::createFromFormat( $format, $time, $timezone );
}
else
{
$dt = parent::createFromFormat( $format, $time );
}
if... | [
"public",
"static",
"function",
"FromFormat",
"(",
"string",
"$",
"format",
",",
"$",
"time",
",",
"\\",
"DateTimeZone",
"$",
"timezone",
"=",
"null",
")",
":",
"DateTime",
"{",
"if",
"(",
"$",
"timezone",
"!==",
"null",
")",
"{",
"$",
"dt",
"=",
"pa... | Create a DateTime instance from a specific format.
@param string $format
@param string $time
@param \DateTimeZone $timezone
@throws \Beluga\ArgumentError
@return \Beluga\Date\DateTime | [
"Create",
"a",
"DateTime",
"instance",
"from",
"a",
"specific",
"format",
"."
] | 1bd28500e81eb5db8502e58506ebeb9268154884 | https://github.com/SagittariusX/Beluga.Date/blob/1bd28500e81eb5db8502e58506ebeb9268154884/src/Beluga/Date/DateTime.php#L1340-L1363 |
197,993 | SagittariusX/Beluga.Date | src/Beluga/Date/DateTime.php | DateTime.Now | public static function Now(
\DateTimeZone $timezone = null, bool $useDayStart = false, bool $useDayEnd = false ) : DateTime
{
$dt = new DateTime( 'now', $timezone );
if ( $useDayStart )
{
$dt->setTime( 0, 0, 0 );
}
else if ( $useDayEnd )
{
$dt->setTime( 2... | php | public static function Now(
\DateTimeZone $timezone = null, bool $useDayStart = false, bool $useDayEnd = false ) : DateTime
{
$dt = new DateTime( 'now', $timezone );
if ( $useDayStart )
{
$dt->setTime( 0, 0, 0 );
}
else if ( $useDayEnd )
{
$dt->setTime( 2... | [
"public",
"static",
"function",
"Now",
"(",
"\\",
"DateTimeZone",
"$",
"timezone",
"=",
"null",
",",
"bool",
"$",
"useDayStart",
"=",
"false",
",",
"bool",
"$",
"useDayEnd",
"=",
"false",
")",
":",
"DateTime",
"{",
"$",
"dt",
"=",
"new",
"DateTime",
"(... | Init's a \Beluga\Date\DateTime with current DateTime and returns it.
@param \DateTimeZone $timezone
@param boolean $useDayStart Set 00:00:00 as time? (default=FALSE)
@param boolean $useDayEnd Set 23:59:59 as time? (default=FALSE)
@return \Beluga\Date\DateTime | [
"Init",
"s",
"a",
"\\",
"Beluga",
"\\",
"Date",
"\\",
"DateTime",
"with",
"current",
"DateTime",
"and",
"returns",
"it",
"."
] | 1bd28500e81eb5db8502e58506ebeb9268154884 | https://github.com/SagittariusX/Beluga.Date/blob/1bd28500e81eb5db8502e58506ebeb9268154884/src/Beluga/Date/DateTime.php#L1471-L1488 |
197,994 | SagittariusX/Beluga.Date | src/Beluga/Date/DateTime.php | DateTime.FromFile | public static function FromFile( string $file, bool $checkIfFileExists = false )
{
if ( $checkIfFileExists && ! \file_exists( $file ) )
{
return false;
}
try
{
return DateTime::Parse( \filemtime( $file ) );
}
catch ( \Throwable $ex )
{
$ex ... | php | public static function FromFile( string $file, bool $checkIfFileExists = false )
{
if ( $checkIfFileExists && ! \file_exists( $file ) )
{
return false;
}
try
{
return DateTime::Parse( \filemtime( $file ) );
}
catch ( \Throwable $ex )
{
$ex ... | [
"public",
"static",
"function",
"FromFile",
"(",
"string",
"$",
"file",
",",
"bool",
"$",
"checkIfFileExists",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"checkIfFileExists",
"&&",
"!",
"\\",
"file_exists",
"(",
"$",
"file",
")",
")",
"{",
"return",
"false"... | Gets the last change DateTime of defined file.
@param string $file Get the last change time from this file.
@param boolean $checkIfFileExists Check if the file exists, before getting the datetime. (default=FALSE)
@return \Beluga\Date\DateTime|bool Returns the DateTime, or boolean FALSE if does not exis... | [
"Gets",
"the",
"last",
"change",
"DateTime",
"of",
"defined",
"file",
"."
] | 1bd28500e81eb5db8502e58506ebeb9268154884 | https://github.com/SagittariusX/Beluga.Date/blob/1bd28500e81eb5db8502e58506ebeb9268154884/src/Beluga/Date/DateTime.php#L1497-L1515 |
197,995 | SagittariusX/Beluga.Date | src/Beluga/Date/DateTime.php | DateTime.GetDaysInMonth | public static function GetDaysInMonth( int $year, int $month ) : int
{
$dt = new \DateTime();
$dt->setDate( $year, $month, 2 );
$dt->setTime( 0, 0, 2 );
return \intval( $dt->format( 't' ) );
} | php | public static function GetDaysInMonth( int $year, int $month ) : int
{
$dt = new \DateTime();
$dt->setDate( $year, $month, 2 );
$dt->setTime( 0, 0, 2 );
return \intval( $dt->format( 't' ) );
} | [
"public",
"static",
"function",
"GetDaysInMonth",
"(",
"int",
"$",
"year",
",",
"int",
"$",
"month",
")",
":",
"int",
"{",
"$",
"dt",
"=",
"new",
"\\",
"DateTime",
"(",
")",
";",
"$",
"dt",
"->",
"setDate",
"(",
"$",
"year",
",",
"$",
"month",
",... | Gets the days of the defined month in defined year.
@param integer $year
@param integer $month
@return integer | [
"Gets",
"the",
"days",
"of",
"the",
"defined",
"month",
"in",
"defined",
"year",
"."
] | 1bd28500e81eb5db8502e58506ebeb9268154884 | https://github.com/SagittariusX/Beluga.Date/blob/1bd28500e81eb5db8502e58506ebeb9268154884/src/Beluga/Date/DateTime.php#L1524-L1533 |
197,996 | ekyna/Table | Source/AbstractAdapter.php | AbstractAdapter.initializeFiltering | protected function initializeFiltering(ContextInterface $context)
{
$activeFilters = $context->getActiveFilters();
foreach ($activeFilters as $activeFilter) {
$filterName = $activeFilter->getFilterName();
if ($this->table->hasFilter($filterName)) {
$this->tab... | php | protected function initializeFiltering(ContextInterface $context)
{
$activeFilters = $context->getActiveFilters();
foreach ($activeFilters as $activeFilter) {
$filterName = $activeFilter->getFilterName();
if ($this->table->hasFilter($filterName)) {
$this->tab... | [
"protected",
"function",
"initializeFiltering",
"(",
"ContextInterface",
"$",
"context",
")",
"{",
"$",
"activeFilters",
"=",
"$",
"context",
"->",
"getActiveFilters",
"(",
")",
";",
"foreach",
"(",
"$",
"activeFilters",
"as",
"$",
"activeFilter",
")",
"{",
"$... | Initializes filtering by applying all active filters through the related filter types.
@param ContextInterface $context | [
"Initializes",
"filtering",
"by",
"applying",
"all",
"active",
"filters",
"through",
"the",
"related",
"filter",
"types",
"."
] | 6f06e8fd8a3248d52f3a91f10508471344db311a | https://github.com/ekyna/Table/blob/6f06e8fd8a3248d52f3a91f10508471344db311a/Source/AbstractAdapter.php#L124-L134 |
197,997 | ekyna/Table | Source/AbstractAdapter.php | AbstractAdapter.initializeSorting | protected function initializeSorting(ContextInterface $context)
{
if (null !== $activeSort = $context->getActiveSort()) {
$columnName = $activeSort->getColumnName();
if ($this->table->hasColumn($columnName)) {
$this->table->getColumn($columnName)->applySort($this, $ac... | php | protected function initializeSorting(ContextInterface $context)
{
if (null !== $activeSort = $context->getActiveSort()) {
$columnName = $activeSort->getColumnName();
if ($this->table->hasColumn($columnName)) {
$this->table->getColumn($columnName)->applySort($this, $ac... | [
"protected",
"function",
"initializeSorting",
"(",
"ContextInterface",
"$",
"context",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"activeSort",
"=",
"$",
"context",
"->",
"getActiveSort",
"(",
")",
")",
"{",
"$",
"columnName",
"=",
"$",
"activeSort",
"->",
"... | Initializes sorting by applying all active sorts through the related column types.
@param ContextInterface $context | [
"Initializes",
"sorting",
"by",
"applying",
"all",
"active",
"sorts",
"through",
"the",
"related",
"column",
"types",
"."
] | 6f06e8fd8a3248d52f3a91f10508471344db311a | https://github.com/ekyna/Table/blob/6f06e8fd8a3248d52f3a91f10508471344db311a/Source/AbstractAdapter.php#L141-L149 |
197,998 | MatiasNAmendola/slimpower-jwt | src/RandomStringGenerator.php | RandomStringGenerator.generateWithCustomAlphabet | public static function generateWithCustomAlphabet($customAlphabet = '0123456789ABCDEF', $tokenLength = 32) {
// Set initial alphabet.
$generator = new RandomStringGenerator($customAlphabet);
// Change alphabet whenever needed.
//$generator->setAlphabet($customAlphabet);
// Call... | php | public static function generateWithCustomAlphabet($customAlphabet = '0123456789ABCDEF', $tokenLength = 32) {
// Set initial alphabet.
$generator = new RandomStringGenerator($customAlphabet);
// Change alphabet whenever needed.
//$generator->setAlphabet($customAlphabet);
// Call... | [
"public",
"static",
"function",
"generateWithCustomAlphabet",
"(",
"$",
"customAlphabet",
"=",
"'0123456789ABCDEF'",
",",
"$",
"tokenLength",
"=",
"32",
")",
"{",
"// Set initial alphabet.",
"$",
"generator",
"=",
"new",
"RandomStringGenerator",
"(",
"$",
"customAlpha... | Generate token with custom alphabet
@param string $customAlphabet Set custom alphabet
@param int $tokenLength Set token length.
@return string | [
"Generate",
"token",
"with",
"custom",
"alphabet"
] | 5afc151e8a37b06fe6cb6a44ff776e7ec9f40e98 | https://github.com/MatiasNAmendola/slimpower-jwt/blob/5afc151e8a37b06fe6cb6a44ff776e7ec9f40e98/src/RandomStringGenerator.php#L85-L96 |
197,999 | ndavison/groundwork-framework | src/Groundwork/Classes/Application.php | Application.init | public function init()
{
$this->register('request', function($app) {
return new Request($app->config['baseurl']);
});
$this->register('response', function($app) {
return new Response();
});
$this->register('router', function($app) {
... | php | public function init()
{
$this->register('request', function($app) {
return new Request($app->config['baseurl']);
});
$this->register('response', function($app) {
return new Response();
});
$this->register('router', function($app) {
... | [
"public",
"function",
"init",
"(",
")",
"{",
"$",
"this",
"->",
"register",
"(",
"'request'",
",",
"function",
"(",
"$",
"app",
")",
"{",
"return",
"new",
"Request",
"(",
"$",
"app",
"->",
"config",
"[",
"'baseurl'",
"]",
")",
";",
"}",
")",
";",
... | Initialise the IoC aliases and routes. | [
"Initialise",
"the",
"IoC",
"aliases",
"and",
"routes",
"."
] | c3d22a1410c8d8a07b4ca1f99a35a1181516cd6c | https://github.com/ndavison/groundwork-framework/blob/c3d22a1410c8d8a07b4ca1f99a35a1181516cd6c/src/Groundwork/Classes/Application.php#L30-L51 |
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.