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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
200,200 | wb-crowdfusion/crowdfusion | system/core/classes/libraries/xml/SimpleXMLExtended.php | SimpleXMLExtended.xpathNSOne | public function xpathNSOne($path, $namespaces)
{
$result = $this->xpathNS($path, $namespaces);
if(is_array($result))
return current($result);
return $result;
} | php | public function xpathNSOne($path, $namespaces)
{
$result = $this->xpathNS($path, $namespaces);
if(is_array($result))
return current($result);
return $result;
} | [
"public",
"function",
"xpathNSOne",
"(",
"$",
"path",
",",
"$",
"namespaces",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"xpathNS",
"(",
"$",
"path",
",",
"$",
"namespaces",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"result",
")",
")",
"retu... | Queries for a single result of an xpath query respecting the namespaces given
@param string $path The xpath query
@param array $namespaces The namespaces [prefix => ns]
@see SimpleXML::registerXPathNamespace()
@return mixed The SimpleXMLElement that matches the xpath query or FALSE | [
"Queries",
"for",
"a",
"single",
"result",
"of",
"an",
"xpath",
"query",
"respecting",
"the",
"namespaces",
"given"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/xml/SimpleXMLExtended.php#L71-L79 |
200,201 | wb-crowdfusion/crowdfusion | system/core/classes/libraries/xml/SimpleXMLExtended.php | SimpleXMLExtended.xpathOne | public function xpathOne($path)
{
$result = $this->xpath($path);
if(is_array($result))
return current($result);
return $result;
} | php | public function xpathOne($path)
{
$result = $this->xpath($path);
if(is_array($result))
return current($result);
return $result;
} | [
"public",
"function",
"xpathOne",
"(",
"$",
"path",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"xpath",
"(",
"$",
"path",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"result",
")",
")",
"return",
"current",
"(",
"$",
"result",
")",
";",
"ret... | Query an xpath and return the first result
@param string $path The xpath query
@return SimpleXMLElement The matching result or FALSE | [
"Query",
"an",
"xpath",
"and",
"return",
"the",
"first",
"result"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/xml/SimpleXMLExtended.php#L88-L96 |
200,202 | wb-crowdfusion/crowdfusion | system/core/classes/libraries/xml/SimpleXMLExtended.php | SimpleXMLExtended.addChild | public function addChild($name, $value=null, $namespace=null)
{
$esc_val = utf8_encode(htmlentities($value, ENT_QUOTES, 'UTF-8', false));
if ($value == $esc_val)
return parent::addChild($name, $esc_val, $namespace);
else {
$xml_field = parent::addChild($name, '', $nam... | php | public function addChild($name, $value=null, $namespace=null)
{
$esc_val = utf8_encode(htmlentities($value, ENT_QUOTES, 'UTF-8', false));
if ($value == $esc_val)
return parent::addChild($name, $esc_val, $namespace);
else {
$xml_field = parent::addChild($name, '', $nam... | [
"public",
"function",
"addChild",
"(",
"$",
"name",
",",
"$",
"value",
"=",
"null",
",",
"$",
"namespace",
"=",
"null",
")",
"{",
"$",
"esc_val",
"=",
"utf8_encode",
"(",
"htmlentities",
"(",
"$",
"value",
",",
"ENT_QUOTES",
",",
"'UTF-8'",
",",
"false... | Adds a child to the current element, but with automatic CDATA support.
@param string $name The name of the child element to add
@param string $value The value of the child element
@param string $namespace If specified, use this namespace
@return SimpleXMLElement a SimpleXMLElement object representing the chi... | [
"Adds",
"a",
"child",
"to",
"the",
"current",
"element",
"but",
"with",
"automatic",
"CDATA",
"support",
"."
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/xml/SimpleXMLExtended.php#L121-L133 |
200,203 | wb-crowdfusion/crowdfusion | system/core/classes/libraries/xml/SimpleXMLExtended.php | SimpleXMLExtended.replace | public function replace(SimpleXMLExtended $child)
{
$node1 = dom_import_simplexml($this);
$dom_sxe = dom_import_simplexml($child);
$node2 = $node1->ownerDocument->importNode($dom_sxe, true);
$node1->parentNode->replaceChild($node2, $node1);
return $this;
} | php | public function replace(SimpleXMLExtended $child)
{
$node1 = dom_import_simplexml($this);
$dom_sxe = dom_import_simplexml($child);
$node2 = $node1->ownerDocument->importNode($dom_sxe, true);
$node1->parentNode->replaceChild($node2, $node1);
return $this;
} | [
"public",
"function",
"replace",
"(",
"SimpleXMLExtended",
"$",
"child",
")",
"{",
"$",
"node1",
"=",
"dom_import_simplexml",
"(",
"$",
"this",
")",
";",
"$",
"dom_sxe",
"=",
"dom_import_simplexml",
"(",
"$",
"child",
")",
";",
"$",
"node2",
"=",
"$",
"n... | Replaces the current element with the element specified
@param SimpleXMLExtended $child The element to replace me
@return this | [
"Replaces",
"the",
"current",
"element",
"with",
"the",
"element",
"specified"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/xml/SimpleXMLExtended.php#L173-L181 |
200,204 | wb-crowdfusion/crowdfusion | system/core/classes/libraries/xml/SimpleXMLExtended.php | SimpleXMLExtended.asPrettyXML | public function asPrettyXML($level = 4)
{
// removed duplicate XML start of the document declaration
$xml = preg_replace('/\<\?xml([^\>\/]*)\>/', '' , $this->asXML());
$dom = new DOMDocument();
$dom->preserveWhiteSpace = false;
$dom->formatOutput = true;
$dom->loadXM... | php | public function asPrettyXML($level = 4)
{
// removed duplicate XML start of the document declaration
$xml = preg_replace('/\<\?xml([^\>\/]*)\>/', '' , $this->asXML());
$dom = new DOMDocument();
$dom->preserveWhiteSpace = false;
$dom->formatOutput = true;
$dom->loadXM... | [
"public",
"function",
"asPrettyXML",
"(",
"$",
"level",
"=",
"4",
")",
"{",
"// removed duplicate XML start of the document declaration",
"$",
"xml",
"=",
"preg_replace",
"(",
"'/\\<\\?xml([^\\>\\/]*)\\>/'",
",",
"''",
",",
"$",
"this",
"->",
"asXML",
"(",
")",
")... | Returns a properly indented form of the current XML tree
@param string $level The number of spaces to use as indentation.
@return string Beautifully formatted XML code that will make your mom smile. Use your manners!
@deprecated $level is deprecated in 3.2.9, to be removed in 3.3. | [
"Returns",
"a",
"properly",
"indented",
"form",
"of",
"the",
"current",
"XML",
"tree"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/xml/SimpleXMLExtended.php#L206-L218 |
200,205 | LartTyler/PHP-Enum | src/DaybreakStudios/Enum/Enum.php | Enum.valueOf | public static function valueOf($str) {
$key = get_called_class();
if (!array_key_exists($key, self::$types))
return null;
$str = str_replace(array(' ', '-'), '_', trim($str));
if (array_key_exists($str, self::$types[$key]))
return self::$types[$key][$str];
return null;
} | php | public static function valueOf($str) {
$key = get_called_class();
if (!array_key_exists($key, self::$types))
return null;
$str = str_replace(array(' ', '-'), '_', trim($str));
if (array_key_exists($str, self::$types[$key]))
return self::$types[$key][$str];
return null;
} | [
"public",
"static",
"function",
"valueOf",
"(",
"$",
"str",
")",
"{",
"$",
"key",
"=",
"get_called_class",
"(",
")",
";",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"key",
",",
"self",
"::",
"$",
"types",
")",
")",
"return",
"null",
";",
"$",
"s... | Attempts to match a string name to an enum element.
Strings passed to this method will be converted to a format allowable in an enum name. That is to say,
they will have any spaces or dashes converted to underscores, and all whitespace on either side of the
string will be trimmed.
@param string $str the string to ma... | [
"Attempts",
"to",
"match",
"a",
"string",
"name",
"to",
"an",
"enum",
"element",
"."
] | 58fa321b74969931631f875a208792b3b4ffa776 | https://github.com/LartTyler/PHP-Enum/blob/58fa321b74969931631f875a208792b3b4ffa776/src/DaybreakStudios/Enum/Enum.php#L132-L144 |
200,206 | faizalpribadi/Event | ObjectEvent.php | ObjectEvent.getParameter | public function getParameter($key)
{
if ($this->hasParameter($key)) {
return $this->parameters[$key];
}
throw new \InvalidArgumentException(
sprintf('Wrong parameter key "%s" , invalid returned the key', $key)
);
} | php | public function getParameter($key)
{
if ($this->hasParameter($key)) {
return $this->parameters[$key];
}
throw new \InvalidArgumentException(
sprintf('Wrong parameter key "%s" , invalid returned the key', $key)
);
} | [
"public",
"function",
"getParameter",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasParameter",
"(",
"$",
"key",
")",
")",
"{",
"return",
"$",
"this",
"->",
"parameters",
"[",
"$",
"key",
"]",
";",
"}",
"throw",
"new",
"\\",
"Invalid... | Get the parameter of object event
@param string|array $key
@return string|array mixed
@throws \InvalidArgumentException | [
"Get",
"the",
"parameter",
"of",
"object",
"event"
] | f1bbd2d018b31b926ede66fd6b0787fbf38e6e99 | https://github.com/faizalpribadi/Event/blob/f1bbd2d018b31b926ede66fd6b0787fbf38e6e99/ObjectEvent.php#L72-L81 |
200,207 | bseddon/XPath20 | Tokenizer.php | StringReader.read | public function read()
{
$this->position++;
if ( $this->position >= count( $this->buffer ) ) return false;
return $this->buffer[ $this->position ];
} | php | public function read()
{
$this->position++;
if ( $this->position >= count( $this->buffer ) ) return false;
return $this->buffer[ $this->position ];
} | [
"public",
"function",
"read",
"(",
")",
"{",
"$",
"this",
"->",
"position",
"++",
";",
"if",
"(",
"$",
"this",
"->",
"position",
">=",
"count",
"(",
"$",
"this",
"->",
"buffer",
")",
")",
"return",
"false",
";",
"return",
"$",
"this",
"->",
"buffer... | Read the buffer and the current position
@return boolean|mixed | [
"Read",
"the",
"buffer",
"and",
"the",
"current",
"position"
] | 69882b6efffaa5470a819d5fdd2f6473ddeb046d | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/Tokenizer.php#L1930-L1936 |
200,208 | bseddon/XPath20 | Tokenizer.php | StringReader.peek | public function peek()
{
$peekPosition = $this->position + 1;
// BMS 2017-09-05 This should return -1. False is equivalent to zero which is a valid buffer offset value.
if ( $peekPosition >= count( $this->buffer ) ) return -1; // false;
return $this->buffer[ $peekPosition ];
} | php | public function peek()
{
$peekPosition = $this->position + 1;
// BMS 2017-09-05 This should return -1. False is equivalent to zero which is a valid buffer offset value.
if ( $peekPosition >= count( $this->buffer ) ) return -1; // false;
return $this->buffer[ $peekPosition ];
} | [
"public",
"function",
"peek",
"(",
")",
"{",
"$",
"peekPosition",
"=",
"$",
"this",
"->",
"position",
"+",
"1",
";",
"// BMS 2017-09-05 This should return -1. False is equivalent to zero which is a valid buffer offset value.\r",
"if",
"(",
"$",
"peekPosition",
">=",
"cou... | Look one char ahead in the buffer
@return number|mixed | [
"Look",
"one",
"char",
"ahead",
"in",
"the",
"buffer"
] | 69882b6efffaa5470a819d5fdd2f6473ddeb046d | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/Tokenizer.php#L1942-L1949 |
200,209 | jmfeurprier/perf-database | lib/perf/Db/QueryFilter.php | QueryFilter.mergeAnd | public function mergeAnd(self $filter)
{
$clause = "({$this->clause}) AND ({$filter->clause})";
$parameters = array_merge($this->parameters, $filter->parameters);
return new self($clause, $parameters);
} | php | public function mergeAnd(self $filter)
{
$clause = "({$this->clause}) AND ({$filter->clause})";
$parameters = array_merge($this->parameters, $filter->parameters);
return new self($clause, $parameters);
} | [
"public",
"function",
"mergeAnd",
"(",
"self",
"$",
"filter",
")",
"{",
"$",
"clause",
"=",
"\"({$this->clause}) AND ({$filter->clause})\"",
";",
"$",
"parameters",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"parameters",
",",
"$",
"filter",
"->",
"parameters",... | Combines two filters together with a "AND" operator. Current and provided instances will not be altered;
the returned new instance will hold the result of the computation.
@param QueryFilter $filter The filter to be added to the current instance.
@return QueryFilter | [
"Combines",
"two",
"filters",
"together",
"with",
"a",
"AND",
"operator",
".",
"Current",
"and",
"provided",
"instances",
"will",
"not",
"be",
"altered",
";",
"the",
"returned",
"new",
"instance",
"will",
"hold",
"the",
"result",
"of",
"the",
"computation",
... | 9b39dc76be9f8a33d02aadc168fdb74d786f0ff2 | https://github.com/jmfeurprier/perf-database/blob/9b39dc76be9f8a33d02aadc168fdb74d786f0ff2/lib/perf/Db/QueryFilter.php#L80-L86 |
200,210 | jmfeurprier/perf-database | lib/perf/Db/QueryFilter.php | QueryFilter.mergeOr | public function mergeOr(self $filter)
{
$clause = "({$this->clause}) OR ({$filter->clause})";
$parameters = array_merge($this->parameters, $filter->parameters);
return new self($clause, $parameters);
} | php | public function mergeOr(self $filter)
{
$clause = "({$this->clause}) OR ({$filter->clause})";
$parameters = array_merge($this->parameters, $filter->parameters);
return new self($clause, $parameters);
} | [
"public",
"function",
"mergeOr",
"(",
"self",
"$",
"filter",
")",
"{",
"$",
"clause",
"=",
"\"({$this->clause}) OR ({$filter->clause})\"",
";",
"$",
"parameters",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"parameters",
",",
"$",
"filter",
"->",
"parameters",
... | Combines two filters together with a "OR" operator. Current and provided instances will not be altered;
the returned new instance will hold the result of the computation.
@param QueryFilter $filter The filter to be added to the current instance.
@return QueryFilter | [
"Combines",
"two",
"filters",
"together",
"with",
"a",
"OR",
"operator",
".",
"Current",
"and",
"provided",
"instances",
"will",
"not",
"be",
"altered",
";",
"the",
"returned",
"new",
"instance",
"will",
"hold",
"the",
"result",
"of",
"the",
"computation",
"... | 9b39dc76be9f8a33d02aadc168fdb74d786f0ff2 | https://github.com/jmfeurprier/perf-database/blob/9b39dc76be9f8a33d02aadc168fdb74d786f0ff2/lib/perf/Db/QueryFilter.php#L95-L101 |
200,211 | squareproton/Bond | src/Bond/Di/ProxyFactoryNative.php | ProxyFactoryNative.resolve | private function resolve(Definition $definition)
{
if(!$this->container->isFrozen()) {
throw new \LogicException("cannot use create method on factory without freezing/compiling container");
}
$subContainer = new ContainerBuilder();
$subContainer->merge($this->container);
... | php | private function resolve(Definition $definition)
{
if(!$this->container->isFrozen()) {
throw new \LogicException("cannot use create method on factory without freezing/compiling container");
}
$subContainer = new ContainerBuilder();
$subContainer->merge($this->container);
... | [
"private",
"function",
"resolve",
"(",
"Definition",
"$",
"definition",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"container",
"->",
"isFrozen",
"(",
")",
")",
"{",
"throw",
"new",
"\\",
"LogicException",
"(",
"\"cannot use create method on factory without fr... | todo heavy optimization likely to be needed for this method | [
"todo",
"heavy",
"optimization",
"likely",
"to",
"be",
"needed",
"for",
"this",
"method"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Di/ProxyFactoryNative.php#L68-L79 |
200,212 | dms-org/common.structure | src/FileSystem/PathHelper.php | PathHelper.normalize | public static function normalize(string $path) : string
{
if (strpos($path, 'data://') === 0) {
return $path;
}
$path = self::stringReplaceIgnoringStreamWrapper(['\\', '/'], DIRECTORY_SEPARATOR, $path);
$startOfPath = strpos($path, '://') === false ? 0 : strpos($path, ... | php | public static function normalize(string $path) : string
{
if (strpos($path, 'data://') === 0) {
return $path;
}
$path = self::stringReplaceIgnoringStreamWrapper(['\\', '/'], DIRECTORY_SEPARATOR, $path);
$startOfPath = strpos($path, '://') === false ? 0 : strpos($path, ... | [
"public",
"static",
"function",
"normalize",
"(",
"string",
"$",
"path",
")",
":",
"string",
"{",
"if",
"(",
"strpos",
"(",
"$",
"path",
",",
"'data://'",
")",
"===",
"0",
")",
"{",
"return",
"$",
"path",
";",
"}",
"$",
"path",
"=",
"self",
"::",
... | Normalizes the supplied path
@param string $path
@return string | [
"Normalizes",
"the",
"supplied",
"path"
] | 23f122182f60df5ec847047a81a39c8aab019ff1 | https://github.com/dms-org/common.structure/blob/23f122182f60df5ec847047a81a39c8aab019ff1/src/FileSystem/PathHelper.php#L19-L35 |
200,213 | dms-org/common.structure | src/FileSystem/PathHelper.php | PathHelper.combine | public static function combine(string ... $paths) : string
{
$paths = array_map([__CLASS__, 'normalize'], $paths);
$paths = array_filter($paths, function ($path) {
return trim($path, DIRECTORY_SEPARATOR) !== '.';
});
$combinedPath = implode(DIRECTORY_SEPARATOR, $paths);... | php | public static function combine(string ... $paths) : string
{
$paths = array_map([__CLASS__, 'normalize'], $paths);
$paths = array_filter($paths, function ($path) {
return trim($path, DIRECTORY_SEPARATOR) !== '.';
});
$combinedPath = implode(DIRECTORY_SEPARATOR, $paths);... | [
"public",
"static",
"function",
"combine",
"(",
"string",
"...",
"$",
"paths",
")",
":",
"string",
"{",
"$",
"paths",
"=",
"array_map",
"(",
"[",
"__CLASS__",
",",
"'normalize'",
"]",
",",
"$",
"paths",
")",
";",
"$",
"paths",
"=",
"array_filter",
"(",... | Combines the supplied paths
@param string[] $paths
@return string | [
"Combines",
"the",
"supplied",
"paths"
] | 23f122182f60df5ec847047a81a39c8aab019ff1 | https://github.com/dms-org/common.structure/blob/23f122182f60df5ec847047a81a39c8aab019ff1/src/FileSystem/PathHelper.php#L44-L59 |
200,214 | modulusphp/security | Auth.php | Auth.routes | public static function routes()
{
Route::group(['namespace' => 'Auth'], function () {
Route::group(['middleware' => ['guest']], function () {
Route::get('login', 'LoginController@showLoginPage')->name('showLogin');
Route::post('login', 'LoginController@login')->name('login');
Rout... | php | public static function routes()
{
Route::group(['namespace' => 'Auth'], function () {
Route::group(['middleware' => ['guest']], function () {
Route::get('login', 'LoginController@showLoginPage')->name('showLogin');
Route::post('login', 'LoginController@login')->name('login');
Rout... | [
"public",
"static",
"function",
"routes",
"(",
")",
"{",
"Route",
"::",
"group",
"(",
"[",
"'namespace'",
"=>",
"'Auth'",
"]",
",",
"function",
"(",
")",
"{",
"Route",
"::",
"group",
"(",
"[",
"'middleware'",
"=>",
"[",
"'guest'",
"]",
"]",
",",
"fun... | Register auth routes
@return void | [
"Register",
"auth",
"routes"
] | 7a0b7f7a23f682588a3582b810d61266f7c14567 | https://github.com/modulusphp/security/blob/7a0b7f7a23f682588a3582b810d61266f7c14567/Auth.php#L32-L60 |
200,215 | anime-db/catalog-bundle | src/Plugin/Fill/Filler/Filler.php | Filler.fillFromSearchResult | public function fillFromSearchResult(ItemSearch $item)
{
$query = parse_url($item->getLink(), PHP_URL_QUERY);
parse_str($query, $query);
if (empty($query[$this->getForm()->getName()])) {
return;
}
return $this->fill($query[$this->getForm()->getName()]);
} | php | public function fillFromSearchResult(ItemSearch $item)
{
$query = parse_url($item->getLink(), PHP_URL_QUERY);
parse_str($query, $query);
if (empty($query[$this->getForm()->getName()])) {
return;
}
return $this->fill($query[$this->getForm()->getName()]);
} | [
"public",
"function",
"fillFromSearchResult",
"(",
"ItemSearch",
"$",
"item",
")",
"{",
"$",
"query",
"=",
"parse_url",
"(",
"$",
"item",
"->",
"getLink",
"(",
")",
",",
"PHP_URL_QUERY",
")",
";",
"parse_str",
"(",
"$",
"query",
",",
"$",
"query",
")",
... | Fill from search result.
@param ItemSearch $item
@return Item|null | [
"Fill",
"from",
"search",
"result",
"."
] | 631b6f92a654e91bee84f46218c52cf42bdb8606 | https://github.com/anime-db/catalog-bundle/blob/631b6f92a654e91bee84f46218c52cf42bdb8606/src/Plugin/Fill/Filler/Filler.php#L89-L98 |
200,216 | stubbles/stubbles-date | src/main/php/span/Month.php | Month.asString | public function asString(): string
{
return (string) $this->year . '-' . ((10 > $this->month && strlen((string) $this->month) === 1) ? ('0' . $this->month) : ($this->month));
} | php | public function asString(): string
{
return (string) $this->year . '-' . ((10 > $this->month && strlen((string) $this->month) === 1) ? ('0' . $this->month) : ($this->month));
} | [
"public",
"function",
"asString",
"(",
")",
":",
"string",
"{",
"return",
"(",
"string",
")",
"$",
"this",
"->",
"year",
".",
"'-'",
".",
"(",
"(",
"10",
">",
"$",
"this",
"->",
"month",
"&&",
"strlen",
"(",
"(",
"string",
")",
"$",
"this",
"->",... | returns a string representation of the date object
@return string | [
"returns",
"a",
"string",
"representation",
"of",
"the",
"date",
"object"
] | 98553392bec03affc53a6e3eb7f88408c2720d1c | https://github.com/stubbles/stubbles-date/blob/98553392bec03affc53a6e3eb7f88408c2720d1c/src/main/php/span/Month.php#L199-L202 |
200,217 | JumpGateio/Core | src/JumpGate/Core/Http/Controllers/BaseController.php | BaseController.setViewData | protected function setViewData($key, $value = null)
{
if (is_array($key)) {
foreach ($key as $name => $data) {
view()->share($name, $data);
}
} else {
view()->share($key, $value);
}
} | php | protected function setViewData($key, $value = null)
{
if (is_array($key)) {
foreach ($key as $name => $data) {
view()->share($name, $data);
}
} else {
view()->share($key, $value);
}
} | [
"protected",
"function",
"setViewData",
"(",
"$",
"key",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"key",
")",
")",
"{",
"foreach",
"(",
"$",
"key",
"as",
"$",
"name",
"=>",
"$",
"data",
")",
"{",
"view",
"(",
"... | Pass data to the view.
@param mixed $key
@param mixed $value | [
"Pass",
"data",
"to",
"the",
"view",
"."
] | 485b5cf03b3072267bffbee428b81e48d407d6b6 | https://github.com/JumpGateio/Core/blob/485b5cf03b3072267bffbee428b81e48d407d6b6/src/JumpGate/Core/Http/Controllers/BaseController.php#L32-L41 |
200,218 | Danack/Weaver | src/Weaver/SingleClassWeaveGenerator.php | SingleClassWeaveGenerator.addPropertiesAndConstantsFromReflection | function addPropertiesAndConstantsFromReflection(ClassReflection $classReflection ) {
$constants = $classReflection->getConstants();
foreach ($constants as $name => $value) {
$this->generator->addProperty($name, $value, PropertyGenerator::FLAG_CONSTANT);
}
$properties = $cla... | php | function addPropertiesAndConstantsFromReflection(ClassReflection $classReflection ) {
$constants = $classReflection->getConstants();
foreach ($constants as $name => $value) {
$this->generator->addProperty($name, $value, PropertyGenerator::FLAG_CONSTANT);
}
$properties = $cla... | [
"function",
"addPropertiesAndConstantsFromReflection",
"(",
"ClassReflection",
"$",
"classReflection",
")",
"{",
"$",
"constants",
"=",
"$",
"classReflection",
"->",
"getConstants",
"(",
")",
";",
"foreach",
"(",
"$",
"constants",
"as",
"$",
"name",
"=>",
"$",
"... | addPropertiesAndConstantsFromReflection - does what it's name says.
@param ClassReflection $classReflection
@internal param $originalSourceClass | [
"addPropertiesAndConstantsFromReflection",
"-",
"does",
"what",
"it",
"s",
"name",
"says",
"."
] | 414894cd397daff22d2c71e4988784a1f71b702e | https://github.com/Danack/Weaver/blob/414894cd397daff22d2c71e4988784a1f71b702e/src/Weaver/SingleClassWeaveGenerator.php#L61-L73 |
200,219 | GoIntegro/json | JsonCoder.php | JsonCoder.matchSchema | public function matchSchema($json, $schema)
{
$validator = new Validator();
if (is_string($json)) {
$json = $this->decode($json, TRUE);
} elseif (is_array($json)) {
$json = (object) $json;
}
if (is_string($schema)) {
$schema = $this->deco... | php | public function matchSchema($json, $schema)
{
$validator = new Validator();
if (is_string($json)) {
$json = $this->decode($json, TRUE);
} elseif (is_array($json)) {
$json = (object) $json;
}
if (is_string($schema)) {
$schema = $this->deco... | [
"public",
"function",
"matchSchema",
"(",
"$",
"json",
",",
"$",
"schema",
")",
"{",
"$",
"validator",
"=",
"new",
"Validator",
"(",
")",
";",
"if",
"(",
"is_string",
"(",
"$",
"json",
")",
")",
"{",
"$",
"json",
"=",
"$",
"this",
"->",
"decode",
... | Matches a JSON string or structure to a schema.
It would be lovely to be able to return an object containing both
the result and the errors wich would itself be castable to boolean,
but alas, this is not yet possible on PHP.
@param string $json
@param string $schema
@return boolean
@see http://json-schema.org/ | [
"Matches",
"a",
"JSON",
"string",
"or",
"structure",
"to",
"a",
"schema",
"."
] | d1b1401176d5a1e9883c30ade9c60bafb6afcb14 | https://github.com/GoIntegro/json/blob/d1b1401176d5a1e9883c30ade9c60bafb6afcb14/JsonCoder.php#L107-L127 |
200,220 | GoIntegro/json | JsonCoder.php | JsonCoder.getSchemaErrorMessage | public function getSchemaErrorMessage()
{
$message = NULL;
foreach ($this->lastSchemaErrors as $error) {
$message .= sprintf(
"[%s] %s\n", $error['property'], $error['message']
);
}
if (!empty($message)) {
$message = self::FAIL_JS... | php | public function getSchemaErrorMessage()
{
$message = NULL;
foreach ($this->lastSchemaErrors as $error) {
$message .= sprintf(
"[%s] %s\n", $error['property'], $error['message']
);
}
if (!empty($message)) {
$message = self::FAIL_JS... | [
"public",
"function",
"getSchemaErrorMessage",
"(",
")",
"{",
"$",
"message",
"=",
"NULL",
";",
"foreach",
"(",
"$",
"this",
"->",
"lastSchemaErrors",
"as",
"$",
"error",
")",
"{",
"$",
"message",
".=",
"sprintf",
"(",
"\"[%s] %s\\n\"",
",",
"$",
"error",
... | Returns the latest schema matching errors as a text message.
@return string
@see http://php.net/manual/en/function.json-last-error-msg.php | [
"Returns",
"the",
"latest",
"schema",
"matching",
"errors",
"as",
"a",
"text",
"message",
"."
] | d1b1401176d5a1e9883c30ade9c60bafb6afcb14 | https://github.com/GoIntegro/json/blob/d1b1401176d5a1e9883c30ade9c60bafb6afcb14/JsonCoder.php#L144-L159 |
200,221 | cubicmushroom/valueobjects | src/Structure/Dictionary.php | Dictionary.fromNative | public static function fromNative()
{
$array = \func_get_arg(0);
$keyValuePairs = array();
foreach ($array as $arrayKey => $arrayValue) {
$key = new StringLiteral(\strval($arrayKey));
if ($arrayValue instanceof \Traversable || \is_array($arrayValue)) {
... | php | public static function fromNative()
{
$array = \func_get_arg(0);
$keyValuePairs = array();
foreach ($array as $arrayKey => $arrayValue) {
$key = new StringLiteral(\strval($arrayKey));
if ($arrayValue instanceof \Traversable || \is_array($arrayValue)) {
... | [
"public",
"static",
"function",
"fromNative",
"(",
")",
"{",
"$",
"array",
"=",
"\\",
"func_get_arg",
"(",
"0",
")",
";",
"$",
"keyValuePairs",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"array",
"as",
"$",
"arrayKey",
"=>",
"$",
"arrayValue",
... | Returns a new Dictionary object
@param array $array
@return self | [
"Returns",
"a",
"new",
"Dictionary",
"object"
] | 4554239ab75d65eeb9773219aa5b07e9fbfabb92 | https://github.com/cubicmushroom/valueobjects/blob/4554239ab75d65eeb9773219aa5b07e9fbfabb92/src/Structure/Dictionary.php#L16-L36 |
200,222 | cubicmushroom/valueobjects | src/Structure/Dictionary.php | Dictionary.keys | public function keys()
{
$count = $this->count()->toNative();
$keysArray = new \SplFixedArray($count);
foreach ($this->items as $key => $item) {
$keysArray->offsetSet($key, $item->getKey());
}
return new Collection($keysArray);
} | php | public function keys()
{
$count = $this->count()->toNative();
$keysArray = new \SplFixedArray($count);
foreach ($this->items as $key => $item) {
$keysArray->offsetSet($key, $item->getKey());
}
return new Collection($keysArray);
} | [
"public",
"function",
"keys",
"(",
")",
"{",
"$",
"count",
"=",
"$",
"this",
"->",
"count",
"(",
")",
"->",
"toNative",
"(",
")",
";",
"$",
"keysArray",
"=",
"new",
"\\",
"SplFixedArray",
"(",
"$",
"count",
")",
";",
"foreach",
"(",
"$",
"this",
... | Returns a Collection of the keys
@return Collection | [
"Returns",
"a",
"Collection",
"of",
"the",
"keys"
] | 4554239ab75d65eeb9773219aa5b07e9fbfabb92 | https://github.com/cubicmushroom/valueobjects/blob/4554239ab75d65eeb9773219aa5b07e9fbfabb92/src/Structure/Dictionary.php#L60-L70 |
200,223 | cubicmushroom/valueobjects | src/Structure/Dictionary.php | Dictionary.values | public function values()
{
$count = $this->count()->toNative();
$valuesArray = new \SplFixedArray($count);
foreach ($this->items as $key => $item) {
$valuesArray->offsetSet($key, $item->getValue());
}
return new Collection($valuesArray);
} | php | public function values()
{
$count = $this->count()->toNative();
$valuesArray = new \SplFixedArray($count);
foreach ($this->items as $key => $item) {
$valuesArray->offsetSet($key, $item->getValue());
}
return new Collection($valuesArray);
} | [
"public",
"function",
"values",
"(",
")",
"{",
"$",
"count",
"=",
"$",
"this",
"->",
"count",
"(",
")",
"->",
"toNative",
"(",
")",
";",
"$",
"valuesArray",
"=",
"new",
"\\",
"SplFixedArray",
"(",
"$",
"count",
")",
";",
"foreach",
"(",
"$",
"this"... | Returns a Collection of the values
@return Collection | [
"Returns",
"a",
"Collection",
"of",
"the",
"values"
] | 4554239ab75d65eeb9773219aa5b07e9fbfabb92 | https://github.com/cubicmushroom/valueobjects/blob/4554239ab75d65eeb9773219aa5b07e9fbfabb92/src/Structure/Dictionary.php#L77-L87 |
200,224 | larapulse/support | src/Handlers/RegEx.php | RegEx.prepare | public static function prepare(string $string, $quotes = '/') : string
{
$string = $quotes ? preg_quote($string, $quotes) : $string;
return str_replace(
array_keys(self::REGEX_CHARS_REPLACEMENT),
array_values(self::REGEX_CHARS_REPLACEMENT),
$string
);
... | php | public static function prepare(string $string, $quotes = '/') : string
{
$string = $quotes ? preg_quote($string, $quotes) : $string;
return str_replace(
array_keys(self::REGEX_CHARS_REPLACEMENT),
array_values(self::REGEX_CHARS_REPLACEMENT),
$string
);
... | [
"public",
"static",
"function",
"prepare",
"(",
"string",
"$",
"string",
",",
"$",
"quotes",
"=",
"'/'",
")",
":",
"string",
"{",
"$",
"string",
"=",
"$",
"quotes",
"?",
"preg_quote",
"(",
"$",
"string",
",",
"$",
"quotes",
")",
":",
"$",
"string",
... | Prepare string to be safety used in regex
@param string $string
@param string $quotes
@return string | [
"Prepare",
"string",
"to",
"be",
"safety",
"used",
"in",
"regex"
] | 601ee3fd6967be669afe081322340c82c7edf32d | https://github.com/larapulse/support/blob/601ee3fd6967be669afe081322340c82c7edf32d/src/Handlers/RegEx.php#L38-L47 |
200,225 | ekyna/RequireJsBundle | Twig/RequireJsExtension.php | RequireJsExtension.renderRequireJs | public function renderRequireJs($compressed = true)
{
if ($compressed && !$this->buildFileExists()) {
// TODO throw exception ?
$compressed = false;
}
return $this->template->render([
'compressed' => $compressed,
'build_path' => $this->config[... | php | public function renderRequireJs($compressed = true)
{
if ($compressed && !$this->buildFileExists()) {
// TODO throw exception ?
$compressed = false;
}
return $this->template->render([
'compressed' => $compressed,
'build_path' => $this->config[... | [
"public",
"function",
"renderRequireJs",
"(",
"$",
"compressed",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"compressed",
"&&",
"!",
"$",
"this",
"->",
"buildFileExists",
"(",
")",
")",
"{",
"// TODO throw exception ?",
"$",
"compressed",
"=",
"false",
";",
"}... | Renders the RequireJs initialisation script.
@param bool $compressed
@return string | [
"Renders",
"the",
"RequireJs",
"initialisation",
"script",
"."
] | 2b746d25c17487838447d72a03d1050819bcf66a | https://github.com/ekyna/RequireJsBundle/blob/2b746d25c17487838447d72a03d1050819bcf66a/Twig/RequireJsExtension.php#L68-L80 |
200,226 | naucon/Utility | src/ArrayMergeAbstract.php | ArrayMergeAbstract.setDeviation | protected function setDeviation($mergedArray)
{
if (is_array($this->getDeviationArray1())
&& count($this->getDeviationArray1()) > 0
) {
$this->setDeviationArray2($this->deviationArray($this->getDeviationArray1(), $mergedArray));
} else {
$this->setD... | php | protected function setDeviation($mergedArray)
{
if (is_array($this->getDeviationArray1())
&& count($this->getDeviationArray1()) > 0
) {
$this->setDeviationArray2($this->deviationArray($this->getDeviationArray1(), $mergedArray));
} else {
$this->setD... | [
"protected",
"function",
"setDeviation",
"(",
"$",
"mergedArray",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"getDeviationArray1",
"(",
")",
")",
"&&",
"count",
"(",
"$",
"this",
"->",
"getDeviationArray1",
"(",
")",
")",
">",
"0",
")",
"... | set deviation arrays
@param array $mergedArray merged array
@return void | [
"set",
"deviation",
"arrays"
] | d225bb5d09d82400917f710c9d502949a66442c4 | https://github.com/naucon/Utility/blob/d225bb5d09d82400917f710c9d502949a66442c4/src/ArrayMergeAbstract.php#L221-L230 |
200,227 | Wedeto/DB | src/Model.php | Model.getDB | public function getDB($db = null)
{
if (null !== $db && !($db instanceof DB))
throw new InvalidTypeException("Invalid database");
return $db ?: $this->_source_db ?: DI::getInjector()->getInstance(DB::class);
} | php | public function getDB($db = null)
{
if (null !== $db && !($db instanceof DB))
throw new InvalidTypeException("Invalid database");
return $db ?: $this->_source_db ?: DI::getInjector()->getInstance(DB::class);
} | [
"public",
"function",
"getDB",
"(",
"$",
"db",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"db",
"&&",
"!",
"(",
"$",
"db",
"instanceof",
"DB",
")",
")",
"throw",
"new",
"InvalidTypeException",
"(",
"\"Invalid database\"",
")",
";",
"return",... | Get a suitable database. Either the provided database argument,
or when null, the source database. If source database is also null,
the default database is returned.
@return Wedeto\DB\DB A suitable database | [
"Get",
"a",
"suitable",
"database",
".",
"Either",
"the",
"provided",
"database",
"argument",
"or",
"when",
"null",
"the",
"source",
"database",
".",
"If",
"source",
"database",
"is",
"also",
"null",
"the",
"default",
"database",
"is",
"returned",
"."
] | 715f8f2e3ae6b53c511c40b620921cb9c87e6f62 | https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/Model.php#L90-L95 |
200,228 | Wedeto/DB | src/Model.php | Model.insert | public function insert($db = null)
{
$this->getDAO($this->getDB($db))->save($this);
return $this;
} | php | public function insert($db = null)
{
$this->getDAO($this->getDB($db))->save($this);
return $this;
} | [
"public",
"function",
"insert",
"(",
"$",
"db",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"getDAO",
"(",
"$",
"this",
"->",
"getDB",
"(",
"$",
"db",
")",
")",
"->",
"save",
"(",
"$",
"this",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Insert the record to the database
@return Wedeto\DB\Model the saved object | [
"Insert",
"the",
"record",
"to",
"the",
"database"
] | 715f8f2e3ae6b53c511c40b620921cb9c87e6f62 | https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/Model.php#L115-L119 |
200,229 | Wedeto/DB | src/Model.php | Model.delete | public function delete($db = null)
{
$this->getDAO($this->getDB($db))->delete($this);
return $this;
} | php | public function delete($db = null)
{
$this->getDAO($this->getDB($db))->delete($this);
return $this;
} | [
"public",
"function",
"delete",
"(",
"$",
"db",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"getDAO",
"(",
"$",
"this",
"->",
"getDB",
"(",
"$",
"db",
")",
")",
"->",
"delete",
"(",
"$",
"this",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Remove the current record from the database it was retrieved from. | [
"Remove",
"the",
"current",
"record",
"from",
"the",
"database",
"it",
"was",
"retrieved",
"from",
"."
] | 715f8f2e3ae6b53c511c40b620921cb9c87e6f62 | https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/Model.php#L124-L128 |
200,230 | Wedeto/DB | src/Model.php | Model.setSourceDB | public function setSourceDB(DB $db)
{
if ($db === null)
throw new \InvalidArgumentException("Source database must not be null");
$this->_source_db = $db;
return $this;
} | php | public function setSourceDB(DB $db)
{
if ($db === null)
throw new \InvalidArgumentException("Source database must not be null");
$this->_source_db = $db;
return $this;
} | [
"public",
"function",
"setSourceDB",
"(",
"DB",
"$",
"db",
")",
"{",
"if",
"(",
"$",
"db",
"===",
"null",
")",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"\"Source database must not be null\"",
")",
";",
"$",
"this",
"->",
"_source_db",
"=",
"$",... | Set the database this object came from
@param Wedeto\DB\DB $db The database connection
@return Wedeto\DB\DAO Provides fluent interface | [
"Set",
"the",
"database",
"this",
"object",
"came",
"from"
] | 715f8f2e3ae6b53c511c40b620921cb9c87e6f62 | https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/Model.php#L136-L142 |
200,231 | Wedeto/DB | src/Model.php | Model.assignRecord | public function assignRecord(array $record, DB $database)
{
$dao = $this->getDAO();
$table = $dao->getTable($database);
$pkey = $table->getPrimaryColumns();
if ($pkey !== null)
{
$this->_id = array();
foreach ($pkey as $col)
$this->_id[... | php | public function assignRecord(array $record, DB $database)
{
$dao = $this->getDAO();
$table = $dao->getTable($database);
$pkey = $table->getPrimaryColumns();
if ($pkey !== null)
{
$this->_id = array();
foreach ($pkey as $col)
$this->_id[... | [
"public",
"function",
"assignRecord",
"(",
"array",
"$",
"record",
",",
"DB",
"$",
"database",
")",
"{",
"$",
"dao",
"=",
"$",
"this",
"->",
"getDAO",
"(",
")",
";",
"$",
"table",
"=",
"$",
"dao",
"->",
"getTable",
"(",
"$",
"database",
")",
";",
... | Assign the provided record to this object.
@param array $record The record obtained from the database.
@param Wedeto\DB\DB $database The database this record comes from
@return Wedeto\DB\DAO Provides fluent interface | [
"Assign",
"the",
"provided",
"record",
"to",
"this",
"object",
"."
] | 715f8f2e3ae6b53c511c40b620921cb9c87e6f62 | https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/Model.php#L158-L190 |
200,232 | Wedeto/DB | src/Model.php | Model.setID | public function setID($id)
{
$dao = $this->getDAO();
$pkey = $dao->getPrimaryKey();
if (count($pkey) === 1 && is_scalar($id))
{
$pcol = reset($pkey);
$this->setField($pcol->getName(), $id);
}
elseif (is_array($id) && array_keys($id) === array_... | php | public function setID($id)
{
$dao = $this->getDAO();
$pkey = $dao->getPrimaryKey();
if (count($pkey) === 1 && is_scalar($id))
{
$pcol = reset($pkey);
$this->setField($pcol->getName(), $id);
}
elseif (is_array($id) && array_keys($id) === array_... | [
"public",
"function",
"setID",
"(",
"$",
"id",
")",
"{",
"$",
"dao",
"=",
"$",
"this",
"->",
"getDAO",
"(",
")",
";",
"$",
"pkey",
"=",
"$",
"dao",
"->",
"getPrimaryKey",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"pkey",
")",
"===",
"1",
"... | Set the primary key of the model instance
@param mixed $id The primary key. Either a scalar value or an array for a combined primary key
@return Wedeto\DB\Model Provides fluent interface | [
"Set",
"the",
"primary",
"key",
"of",
"the",
"model",
"instance"
] | 715f8f2e3ae6b53c511c40b620921cb9c87e6f62 | https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/Model.php#L222-L245 |
200,233 | Wedeto/DB | src/Model.php | Model.destruct | public function destruct()
{
$this->_id = [];
$this->_source_db = null;
$this->_record = [];
$this->_changed = [];
return $this;
} | php | public function destruct()
{
$this->_id = [];
$this->_source_db = null;
$this->_record = [];
$this->_changed = [];
return $this;
} | [
"public",
"function",
"destruct",
"(",
")",
"{",
"$",
"this",
"->",
"_id",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"_source_db",
"=",
"null",
";",
"$",
"this",
"->",
"_record",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"_changed",
"=",
"[",
"]",
";... | Remove the data from this object, after removal
@return Wedeto\DB\Model Prvides fluent interface | [
"Remove",
"the",
"data",
"from",
"this",
"object",
"after",
"removal"
] | 715f8f2e3ae6b53c511c40b620921cb9c87e6f62 | https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/Model.php#L251-L258 |
200,234 | Wedeto/DB | src/Model.php | Model.getField | public function getField(string $field)
{
if (isset($this->_record[$field]))
return $this->_record[$field];
return null;
} | php | public function getField(string $field)
{
if (isset($this->_record[$field]))
return $this->_record[$field];
return null;
} | [
"public",
"function",
"getField",
"(",
"string",
"$",
"field",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_record",
"[",
"$",
"field",
"]",
")",
")",
"return",
"$",
"this",
"->",
"_record",
"[",
"$",
"field",
"]",
";",
"return",
"null",... | Get the value for a field of this record.
@param string $field The name of the field to get
@return mixed The value of this field | [
"Get",
"the",
"value",
"for",
"a",
"field",
"of",
"this",
"record",
"."
] | 715f8f2e3ae6b53c511c40b620921cb9c87e6f62 | https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/Model.php#L277-L282 |
200,235 | Wedeto/DB | src/Model.php | Model.setField | public function setField(string $field, $value)
{
if (isset($this->_record[$field]) && $this->_record[$field] === $value)
return;
$db = $this->getDB();
$dao = $db->getDAO(static::class);
$columns = $dao->getColumns();
if (!isset($columns[$field]))
thr... | php | public function setField(string $field, $value)
{
if (isset($this->_record[$field]) && $this->_record[$field] === $value)
return;
$db = $this->getDB();
$dao = $db->getDAO(static::class);
$columns = $dao->getColumns();
if (!isset($columns[$field]))
thr... | [
"public",
"function",
"setField",
"(",
"string",
"$",
"field",
",",
"$",
"value",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_record",
"[",
"$",
"field",
"]",
")",
"&&",
"$",
"this",
"->",
"_record",
"[",
"$",
"field",
"]",
"===",
"$"... | Set a field to a new value. The value will be validated first by
calling validate.
@param string $field The field to retrieve
@param mixed $value The value to set it to.
@return Wedeto\DB\DAO Provides fluent interface. | [
"Set",
"a",
"field",
"to",
"a",
"new",
"value",
".",
"The",
"value",
"will",
"be",
"validated",
"first",
"by",
"calling",
"validate",
"."
] | 715f8f2e3ae6b53c511c40b620921cb9c87e6f62 | https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/Model.php#L305-L332 |
200,236 | Wedeto/DB | src/Model.php | Model.validate | public static function validate(Column $coldef, $value)
{
$field = $coldef->getName();
try
{
$valid = $coldef->validate($value);
}
catch (InvalidValueException $e)
{
$rep = WF::str($value);
throw new InvalidValueException("Field $fi... | php | public static function validate(Column $coldef, $value)
{
$field = $coldef->getName();
try
{
$valid = $coldef->validate($value);
}
catch (InvalidValueException $e)
{
$rep = WF::str($value);
throw new InvalidValueException("Field $fi... | [
"public",
"static",
"function",
"validate",
"(",
"Column",
"$",
"coldef",
",",
"$",
"value",
")",
"{",
"$",
"field",
"=",
"$",
"coldef",
"->",
"getName",
"(",
")",
";",
"try",
"{",
"$",
"valid",
"=",
"$",
"coldef",
"->",
"validate",
"(",
"$",
"valu... | Validate a value for the field before setting it. This method is called
from the setField method before updating the value. You can override
this to add validators. Be sure to call the super validator to validate
the base field to match the column definition.
@param Column $coldef The column
@param mixed $value The va... | [
"Validate",
"a",
"value",
"for",
"the",
"field",
"before",
"setting",
"it",
".",
"This",
"method",
"is",
"called",
"from",
"the",
"setField",
"method",
"before",
"updating",
"the",
"value",
".",
"You",
"can",
"override",
"this",
"to",
"add",
"validators",
... | 715f8f2e3ae6b53c511c40b620921cb9c87e6f62 | https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/Model.php#L399-L413 |
200,237 | wb-crowdfusion/crowdfusion | system/core/classes/libraries/caching/stores/AbstractCacheStore.php | AbstractCacheStore.storageFormat | protected function storageFormat($key, $data, $ttl)
{
$start = time();
$expire = $start + $ttl;
return array('key' => $key, 'value' => $data, 'duration' => $ttl, 'created' => $start, 'expires' => $expire);
} | php | protected function storageFormat($key, $data, $ttl)
{
$start = time();
$expire = $start + $ttl;
return array('key' => $key, 'value' => $data, 'duration' => $ttl, 'created' => $start, 'expires' => $expire);
} | [
"protected",
"function",
"storageFormat",
"(",
"$",
"key",
",",
"$",
"data",
",",
"$",
"ttl",
")",
"{",
"$",
"start",
"=",
"time",
"(",
")",
";",
"$",
"expire",
"=",
"$",
"start",
"+",
"$",
"ttl",
";",
"return",
"array",
"(",
"'key'",
"=>",
"$",
... | Defines the array that will be used to store data.
Changing this will require updating all functions that also fetch data.
At no point after this function is called should the data be manipulated,
only inserted directly into cache.
@param string $key Key name
@param string $data Data to store
@param int $ttl Durati... | [
"Defines",
"the",
"array",
"that",
"will",
"be",
"used",
"to",
"store",
"data",
".",
"Changing",
"this",
"will",
"require",
"updating",
"all",
"functions",
"that",
"also",
"fetch",
"data",
"."
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/caching/stores/AbstractCacheStore.php#L33-L39 |
200,238 | brunschgi/TerrificComposerBundle | Controller/ModuleController.php | ModuleController.detailsAction | public function detailsAction(Request $request, $module, $template, $skins)
{
$fullModule = null;
try {
$moduleManager = $this->get('terrific.composer.module.manager');
$fullModule = $moduleManager->getModuleByName($module);
// prepare the parameter for module r... | php | public function detailsAction(Request $request, $module, $template, $skins)
{
$fullModule = null;
try {
$moduleManager = $this->get('terrific.composer.module.manager');
$fullModule = $moduleManager->getModuleByName($module);
// prepare the parameter for module r... | [
"public",
"function",
"detailsAction",
"(",
"Request",
"$",
"request",
",",
"$",
"module",
",",
"$",
"template",
",",
"$",
"skins",
")",
"{",
"$",
"fullModule",
"=",
"null",
";",
"try",
"{",
"$",
"moduleManager",
"=",
"$",
"this",
"->",
"get",
"(",
"... | Display the details of a terrific module.
@Route("/module/details/{module}/{template}/{skins}", defaults={"template" = null, "skins" = null}, name = "composer_module_details")
@Template() | [
"Display",
"the",
"details",
"of",
"a",
"terrific",
"module",
"."
] | 6eef4ace887c19ef166ab6654de385bc1ffbf5f1 | https://github.com/brunschgi/TerrificComposerBundle/blob/6eef4ace887c19ef166ab6654de385bc1ffbf5f1/Controller/ModuleController.php#L36-L70 |
200,239 | brunschgi/TerrificComposerBundle | Controller/ModuleController.php | ModuleController.createAction | public function createAction(Request $request)
{
if ($this->get('session')->has('module')) {
// get the last module from the session to fill some defaults for the new one
$tmpModule = $this->get('session')->get('module');
// setup a fresh module object
$modul... | php | public function createAction(Request $request)
{
if ($this->get('session')->has('module')) {
// get the last module from the session to fill some defaults for the new one
$tmpModule = $this->get('session')->get('module');
// setup a fresh module object
$modul... | [
"public",
"function",
"createAction",
"(",
"Request",
"$",
"request",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"get",
"(",
"'session'",
")",
"->",
"has",
"(",
"'module'",
")",
")",
"{",
"// get the last module from the session to fill some defaults for the new one",
... | Creates a terrific module.
@Route("/module/create", name="composer_create_module")
@Template()
@param Request $request
@return Response | [
"Creates",
"a",
"terrific",
"module",
"."
] | 6eef4ace887c19ef166ab6654de385bc1ffbf5f1 | https://github.com/brunschgi/TerrificComposerBundle/blob/6eef4ace887c19ef166ab6654de385bc1ffbf5f1/Controller/ModuleController.php#L81-L138 |
200,240 | brunschgi/TerrificComposerBundle | Controller/ModuleController.php | ModuleController.addskinAction | public function addskinAction(Request $request)
{
// setup a fresh skin and module object
$skin = new Skin();
$module = new Module();
if ($this->get('session')->has('module')) {
// get the last module from the session to fill some additional defaults for the new skin
... | php | public function addskinAction(Request $request)
{
// setup a fresh skin and module object
$skin = new Skin();
$module = new Module();
if ($this->get('session')->has('module')) {
// get the last module from the session to fill some additional defaults for the new skin
... | [
"public",
"function",
"addskinAction",
"(",
"Request",
"$",
"request",
")",
"{",
"// setup a fresh skin and module object",
"$",
"skin",
"=",
"new",
"Skin",
"(",
")",
";",
"$",
"module",
"=",
"new",
"Module",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
... | Adds a skin to the module.
@Route("/module/addskin", name="composer_add_skin")
@Template()
@param Request $request
@return Response | [
"Adds",
"a",
"skin",
"to",
"the",
"module",
"."
] | 6eef4ace887c19ef166ab6654de385bc1ffbf5f1 | https://github.com/brunschgi/TerrificComposerBundle/blob/6eef4ace887c19ef166ab6654de385bc1ffbf5f1/Controller/ModuleController.php#L149-L196 |
200,241 | phpffcms/ffcms-core | src/Network/Request/RouteMapFeatures.php | RouteMapFeatures.runRouteBinding | private function runRouteBinding(): void
{
// calculated depend of language
$pathway = $this->getPathInfo();
/** @var array $routing */
$routing = App::$Properties->getAll('Routing');
// try to work with static aliases
if (Any::isArray($routing) && isset($routing['Al... | php | private function runRouteBinding(): void
{
// calculated depend of language
$pathway = $this->getPathInfo();
/** @var array $routing */
$routing = App::$Properties->getAll('Routing');
// try to work with static aliases
if (Any::isArray($routing) && isset($routing['Al... | [
"private",
"function",
"runRouteBinding",
"(",
")",
":",
"void",
"{",
"// calculated depend of language",
"$",
"pathway",
"=",
"$",
"this",
"->",
"getPathInfo",
"(",
")",
";",
"/** @var array $routing */",
"$",
"routing",
"=",
"App",
"::",
"$",
"Properties",
"->... | Build static and dynamic path aliases for working set
@return void | [
"Build",
"static",
"and",
"dynamic",
"path",
"aliases",
"for",
"working",
"set"
] | 44a309553ef9f115ccfcfd71f2ac6e381c612082 | https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Network/Request/RouteMapFeatures.php#L26-L54 |
200,242 | phpffcms/ffcms-core | src/Network/Request/RouteMapFeatures.php | RouteMapFeatures.findStaticAliases | private function findStaticAliases(?array $map = null, ?string $pathway = null): ?string
{
if (!$map) {
return $pathway;
}
// current pathway is found as "old path" (or alias target). Make redirect to new pathway.
if (Arr::in($pathway, $map)) {
// find "new p... | php | private function findStaticAliases(?array $map = null, ?string $pathway = null): ?string
{
if (!$map) {
return $pathway;
}
// current pathway is found as "old path" (or alias target). Make redirect to new pathway.
if (Arr::in($pathway, $map)) {
// find "new p... | [
"private",
"function",
"findStaticAliases",
"(",
"?",
"array",
"$",
"map",
"=",
"null",
",",
"?",
"string",
"$",
"pathway",
"=",
"null",
")",
":",
"?",
"string",
"{",
"if",
"(",
"!",
"$",
"map",
")",
"{",
"return",
"$",
"pathway",
";",
"}",
"// cur... | Prepare static pathway aliasing for routing
@param array|null $map
@param string|null $pathway
@return string|null | [
"Prepare",
"static",
"pathway",
"aliasing",
"for",
"routing"
] | 44a309553ef9f115ccfcfd71f2ac6e381c612082 | https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Network/Request/RouteMapFeatures.php#L62-L91 |
200,243 | phpffcms/ffcms-core | src/Network/Request/RouteMapFeatures.php | RouteMapFeatures.findDynamicCallbacks | private function findDynamicCallbacks(array $map = null, ?string $controller = null): void
{
if (!$map) {
return;
}
// try to find global callback for this controller slug
if (array_key_exists($controller, $map)) {
$class = (string)$map[$controller];
... | php | private function findDynamicCallbacks(array $map = null, ?string $controller = null): void
{
if (!$map) {
return;
}
// try to find global callback for this controller slug
if (array_key_exists($controller, $map)) {
$class = (string)$map[$controller];
... | [
"private",
"function",
"findDynamicCallbacks",
"(",
"array",
"$",
"map",
"=",
"null",
",",
"?",
"string",
"$",
"controller",
"=",
"null",
")",
":",
"void",
"{",
"if",
"(",
"!",
"$",
"map",
")",
"{",
"return",
";",
"}",
"// try to find global callback for t... | Prepare dynamic callback data for routing
@param array|null $map
@param string|null $controller
@return void | [
"Prepare",
"dynamic",
"callback",
"data",
"for",
"routing"
] | 44a309553ef9f115ccfcfd71f2ac6e381c612082 | https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Network/Request/RouteMapFeatures.php#L99-L112 |
200,244 | rollerworks/search-core | SearchConditionSerializer.php | SearchConditionSerializer.serialize | public function serialize(SearchCondition $searchCondition): array
{
$setName = $searchCondition->getFieldSet()->getSetName();
return [$setName, serialize($searchCondition->getValuesGroup())];
} | php | public function serialize(SearchCondition $searchCondition): array
{
$setName = $searchCondition->getFieldSet()->getSetName();
return [$setName, serialize($searchCondition->getValuesGroup())];
} | [
"public",
"function",
"serialize",
"(",
"SearchCondition",
"$",
"searchCondition",
")",
":",
"array",
"{",
"$",
"setName",
"=",
"$",
"searchCondition",
"->",
"getFieldSet",
"(",
")",
"->",
"getSetName",
"(",
")",
";",
"return",
"[",
"$",
"setName",
",",
"s... | Serialize a SearchCondition.
The returned value is an array you can safely serialize yourself.
This is not done already because storing a serialized SearchCondition
in a php session would serialize the serialized result again.
Caution: The FieldSet must be loadable from the factory.
@return array [FieldSet-name, ser... | [
"Serialize",
"a",
"SearchCondition",
"."
] | 6b5671b8c4d6298906ded768261b0a59845140fb | https://github.com/rollerworks/search-core/blob/6b5671b8c4d6298906ded768261b0a59845140fb/SearchConditionSerializer.php#L46-L51 |
200,245 | rollerworks/search-core | SearchConditionSerializer.php | SearchConditionSerializer.unserialize | public function unserialize(array $searchCondition): SearchCondition
{
if (2 !== \count($searchCondition) || !isset($searchCondition[0], $searchCondition[1])) {
throw new InvalidArgumentException(
'Serialized search condition must be exactly two values [FieldSet-name, serialized ... | php | public function unserialize(array $searchCondition): SearchCondition
{
if (2 !== \count($searchCondition) || !isset($searchCondition[0], $searchCondition[1])) {
throw new InvalidArgumentException(
'Serialized search condition must be exactly two values [FieldSet-name, serialized ... | [
"public",
"function",
"unserialize",
"(",
"array",
"$",
"searchCondition",
")",
":",
"SearchCondition",
"{",
"if",
"(",
"2",
"!==",
"\\",
"count",
"(",
"$",
"searchCondition",
")",
"||",
"!",
"isset",
"(",
"$",
"searchCondition",
"[",
"0",
"]",
",",
"$",... | Unserialize a serialized SearchCondition.
@param array $searchCondition [FieldSet-name, serialized ValuesGroup object]
@throws InvalidArgumentException when serialized SearchCondition is invalid
(invalid structure or failed to unserialize) | [
"Unserialize",
"a",
"serialized",
"SearchCondition",
"."
] | 6b5671b8c4d6298906ded768261b0a59845140fb | https://github.com/rollerworks/search-core/blob/6b5671b8c4d6298906ded768261b0a59845140fb/SearchConditionSerializer.php#L61-L77 |
200,246 | OxfordInfoLabs/kinikit-core | src/Util/HTTP/URLHelper.php | URLHelper.getCurrentFullHostString | public static function getCurrentFullHostString() {
$hostString = $_SERVER["HTTPS"] ? "https" : "http";
$hostString .= "://";
$hostString .= $_SERVER["HTTP_HOST"];
$hostString .= $_SERVER["SERVER_PORT"] != 80 ? ":" . $_SERVER["SERVER_PORT"] : "";
return $hostString;
} | php | public static function getCurrentFullHostString() {
$hostString = $_SERVER["HTTPS"] ? "https" : "http";
$hostString .= "://";
$hostString .= $_SERVER["HTTP_HOST"];
$hostString .= $_SERVER["SERVER_PORT"] != 80 ? ":" . $_SERVER["SERVER_PORT"] : "";
return $hostString;
} | [
"public",
"static",
"function",
"getCurrentFullHostString",
"(",
")",
"{",
"$",
"hostString",
"=",
"$",
"_SERVER",
"[",
"\"HTTPS\"",
"]",
"?",
"\"https\"",
":",
"\"http\"",
";",
"$",
"hostString",
".=",
"\"://\"",
";",
"$",
"hostString",
".=",
"$",
"_SERVER"... | Return the current full host string for the current request including protocol and ports etc. | [
"Return",
"the",
"current",
"full",
"host",
"string",
"for",
"the",
"current",
"request",
"including",
"protocol",
"and",
"ports",
"etc",
"."
] | edc1b2e6ffabd595c4c7d322279b3dd1e59ef359 | https://github.com/OxfordInfoLabs/kinikit-core/blob/edc1b2e6ffabd595c4c7d322279b3dd1e59ef359/src/Util/HTTP/URLHelper.php#L42-L52 |
200,247 | OxfordInfoLabs/kinikit-core | src/Util/HTTP/URLHelper.php | URLHelper.getPartialURLFromSegment | public function getPartialURLFromSegment($segmentIdx) {
$partialURL = "";
for ($i = $segmentIdx; $i < sizeof($this->segments); $i++) {
$partialURL .= (($i > $segmentIdx) ? "/" : "") . $this->segments [$i];
}
return $partialURL;
} | php | public function getPartialURLFromSegment($segmentIdx) {
$partialURL = "";
for ($i = $segmentIdx; $i < sizeof($this->segments); $i++) {
$partialURL .= (($i > $segmentIdx) ? "/" : "") . $this->segments [$i];
}
return $partialURL;
} | [
"public",
"function",
"getPartialURLFromSegment",
"(",
"$",
"segmentIdx",
")",
"{",
"$",
"partialURL",
"=",
"\"\"",
";",
"for",
"(",
"$",
"i",
"=",
"$",
"segmentIdx",
";",
"$",
"i",
"<",
"sizeof",
"(",
"$",
"this",
"->",
"segments",
")",
";",
"$",
"i... | Get a partial string version of this url object starting from a particular segment
@return string | [
"Get",
"a",
"partial",
"string",
"version",
"of",
"this",
"url",
"object",
"starting",
"from",
"a",
"particular",
"segment"
] | edc1b2e6ffabd595c4c7d322279b3dd1e59ef359 | https://github.com/OxfordInfoLabs/kinikit-core/blob/edc1b2e6ffabd595c4c7d322279b3dd1e59ef359/src/Util/HTTP/URLHelper.php#L86-L95 |
200,248 | OxfordInfoLabs/kinikit-core | src/Util/HTTP/URLHelper.php | URLHelper.getQueryParametersArray | public function getQueryParametersArray() {
$queryString = $this->getQueryString();
if (strlen($queryString) == 0) return array();
$splitQuery = explode("&", substr($queryString, 1));
$returnedParams = array();
foreach ($splitQuery as $param) {
$splitParam = explode... | php | public function getQueryParametersArray() {
$queryString = $this->getQueryString();
if (strlen($queryString) == 0) return array();
$splitQuery = explode("&", substr($queryString, 1));
$returnedParams = array();
foreach ($splitQuery as $param) {
$splitParam = explode... | [
"public",
"function",
"getQueryParametersArray",
"(",
")",
"{",
"$",
"queryString",
"=",
"$",
"this",
"->",
"getQueryString",
"(",
")",
";",
"if",
"(",
"strlen",
"(",
"$",
"queryString",
")",
"==",
"0",
")",
"return",
"array",
"(",
")",
";",
"$",
"spli... | Get all query parameters contained within this URL as an associative array.
@return array | [
"Get",
"all",
"query",
"parameters",
"contained",
"within",
"this",
"URL",
"as",
"an",
"associative",
"array",
"."
] | edc1b2e6ffabd595c4c7d322279b3dd1e59ef359 | https://github.com/OxfordInfoLabs/kinikit-core/blob/edc1b2e6ffabd595c4c7d322279b3dd1e59ef359/src/Util/HTTP/URLHelper.php#L165-L179 |
200,249 | OxfordInfoLabs/kinikit-core | src/Util/HTTP/URLHelper.php | URLHelper.processURL | private function processURL($url) {
// Clean up special characters in url params
$url = str_replace("%20", " ", $url);
// Store a private copy for use later
$this->url = URLHelper::$testURL == null ? $url : URLHelper::$testURL;
// Split it on protocol first if required.
... | php | private function processURL($url) {
// Clean up special characters in url params
$url = str_replace("%20", " ", $url);
// Store a private copy for use later
$this->url = URLHelper::$testURL == null ? $url : URLHelper::$testURL;
// Split it on protocol first if required.
... | [
"private",
"function",
"processURL",
"(",
"$",
"url",
")",
"{",
"// Clean up special characters in url params",
"$",
"url",
"=",
"str_replace",
"(",
"\"%20\"",
",",
"\" \"",
",",
"$",
"url",
")",
";",
"// Store a private copy for use later",
"$",
"this",
"->",
"ur... | off query parameters too. | [
"off",
"query",
"parameters",
"too",
"."
] | edc1b2e6ffabd595c4c7d322279b3dd1e59ef359 | https://github.com/OxfordInfoLabs/kinikit-core/blob/edc1b2e6ffabd595c4c7d322279b3dd1e59ef359/src/Util/HTTP/URLHelper.php#L185-L214 |
200,250 | cloudtek/dynamodm | lib/Cloudtek/DynamoDM/Mapping/ClassMetadataFactory.php | ClassMetadataFactory.addInheritedAttributes | private function addInheritedAttributes(ClassMetadata $subClass, ClassMetadata $parentClass)
{
$propertyFactory = new PropertyMetadataFactory($subClass);
foreach ($parentClass->propertyMetadata as $attributeName => $parentMapping) {
//in case of inheritance from superclass, otherwise th... | php | private function addInheritedAttributes(ClassMetadata $subClass, ClassMetadata $parentClass)
{
$propertyFactory = new PropertyMetadataFactory($subClass);
foreach ($parentClass->propertyMetadata as $attributeName => $parentMapping) {
//in case of inheritance from superclass, otherwise th... | [
"private",
"function",
"addInheritedAttributes",
"(",
"ClassMetadata",
"$",
"subClass",
",",
"ClassMetadata",
"$",
"parentClass",
")",
"{",
"$",
"propertyFactory",
"=",
"new",
"PropertyMetadataFactory",
"(",
"$",
"subClass",
")",
";",
"foreach",
"(",
"$",
"parentC... | Adds inherited attributes to the subclass mapping.
@param ClassMetadata $subClass
@param ClassMetadata $parentClass
@throws MappingException | [
"Adds",
"inherited",
"attributes",
"to",
"the",
"subclass",
"mapping",
"."
] | 119d355e2c5cbaef1f867970349b4432f5704fcd | https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/Mapping/ClassMetadataFactory.php#L58-L72 |
200,251 | erenmustafaozdal/laravel-modules-base | src/Services/CollectionService.php | CollectionService.renderAncestorsAndSelf | public function renderAncestorsAndSelf($items, $glue = '/', $keys = ['name'])
{
$items = $items->map(function($item,$key) use($keys, $glue)
{
$ancSelf = $item->ancestorsAndSelf()->get();
$result = [ 'id' => $item->id];
foreach ($keys as $k) {
... | php | public function renderAncestorsAndSelf($items, $glue = '/', $keys = ['name'])
{
$items = $items->map(function($item,$key) use($keys, $glue)
{
$ancSelf = $item->ancestorsAndSelf()->get();
$result = [ 'id' => $item->id];
foreach ($keys as $k) {
... | [
"public",
"function",
"renderAncestorsAndSelf",
"(",
"$",
"items",
",",
"$",
"glue",
"=",
"'/'",
",",
"$",
"keys",
"=",
"[",
"'name'",
"]",
")",
"{",
"$",
"items",
"=",
"$",
"items",
"->",
"map",
"(",
"function",
"(",
"$",
"item",
",",
"$",
"key",
... | ancestors and self render and get
@param Collection $items
@param string $glue
@param array $keys
@return array | [
"ancestors",
"and",
"self",
"render",
"and",
"get"
] | c26600543817642926bcf16ada84009e00d784e0 | https://github.com/erenmustafaozdal/laravel-modules-base/blob/c26600543817642926bcf16ada84009e00d784e0/src/Services/CollectionService.php#L30-L55 |
200,252 | zodream/database | src/Manager.php | Manager.setConfigs | public function setConfigs(array $args) {
if (!is_array(current($args))) {
$args = [
$this->currentName => $args
];
}
foreach ($args as $key => $item) {
if (array_key_exists($key, $this->configs)) {
$this->configs[$key] = array_... | php | public function setConfigs(array $args) {
if (!is_array(current($args))) {
$args = [
$this->currentName => $args
];
}
foreach ($args as $key => $item) {
if (array_key_exists($key, $this->configs)) {
$this->configs[$key] = array_... | [
"public",
"function",
"setConfigs",
"(",
"array",
"$",
"args",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"current",
"(",
"$",
"args",
")",
")",
")",
"{",
"$",
"args",
"=",
"[",
"$",
"this",
"->",
"currentName",
"=>",
"$",
"args",
"]",
";",
"}",
... | ADD 2D ARRAY
@param array $args
@return $this | [
"ADD",
"2D",
"ARRAY"
] | 03712219c057799d07350a3a2650c55bcc92c28e | https://github.com/zodream/database/blob/03712219c057799d07350a3a2650c55bcc92c28e/src/Manager.php#L25-L39 |
200,253 | zodream/database | src/Manager.php | Manager.getEngine | public function getEngine($name = null) {
if (is_null($name)) {
$name = $this->getCurrentName();
}
if (array_key_exists($name, $this->engines)) {
return $this->engines[$name];
}
if (!$this->hasConfig($name)) {
throw new \InvalidArgumentExceptio... | php | public function getEngine($name = null) {
if (is_null($name)) {
$name = $this->getCurrentName();
}
if (array_key_exists($name, $this->engines)) {
return $this->engines[$name];
}
if (!$this->hasConfig($name)) {
throw new \InvalidArgumentExceptio... | [
"public",
"function",
"getEngine",
"(",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"name",
")",
")",
"{",
"$",
"name",
"=",
"$",
"this",
"->",
"getCurrentName",
"(",
")",
";",
"}",
"if",
"(",
"array_key_exists",
"(",
"$",
... | GET DATABASE ENGINE
@param string $name
@return mixed
@throws \Exception | [
"GET",
"DATABASE",
"ENGINE"
] | 03712219c057799d07350a3a2650c55bcc92c28e | https://github.com/zodream/database/blob/03712219c057799d07350a3a2650c55bcc92c28e/src/Manager.php#L73-L90 |
200,254 | pryley/castor-framework | src/Container.php | Container.make | public function make( $abstract )
{
$service = isset( $this->services[$abstract] )
? $this->services[$abstract]
: $this->addNamespace( $abstract );
if( is_callable( $service )) {
return call_user_func_array( $service, [$this] );
}
if( is_object( $service )) {
return $service;
}
return $this->... | php | public function make( $abstract )
{
$service = isset( $this->services[$abstract] )
? $this->services[$abstract]
: $this->addNamespace( $abstract );
if( is_callable( $service )) {
return call_user_func_array( $service, [$this] );
}
if( is_object( $service )) {
return $service;
}
return $this->... | [
"public",
"function",
"make",
"(",
"$",
"abstract",
")",
"{",
"$",
"service",
"=",
"isset",
"(",
"$",
"this",
"->",
"services",
"[",
"$",
"abstract",
"]",
")",
"?",
"$",
"this",
"->",
"services",
"[",
"$",
"abstract",
"]",
":",
"$",
"this",
"->",
... | Resolve the given type from the container.
Allow unbound aliases that omit the root namespace
i.e. 'Controller' translates to 'GeminiLabs\Castor\Controller'
@param mixed $abstract
@return mixed | [
"Resolve",
"the",
"given",
"type",
"from",
"the",
"container",
".",
"Allow",
"unbound",
"aliases",
"that",
"omit",
"the",
"root",
"namespace",
"i",
".",
"e",
".",
"Controller",
"translates",
"to",
"GeminiLabs",
"\\",
"Castor",
"\\",
"Controller"
] | cbc137d02625cd05f4cc96414d6f70e451cb821f | https://github.com/pryley/castor-framework/blob/cbc137d02625cd05f4cc96414d6f70e451cb821f/src/Container.php#L70-L84 |
200,255 | squareproton/Bond | src/Bond/RecordManager/Task/NormalityCollection/Persist.php | Persist.additionalSavingTasks | protected function additionalSavingTasks( Pg $pg, $simulate = false, array &$ignoreList = array(), $action = self::ACTION_OBJECT )
{
// additional saving tasks?
$repository = $this->recordManager->entityManager->getRepository( $this->object->class );
$normality = $repository->normality;
... | php | protected function additionalSavingTasks( Pg $pg, $simulate = false, array &$ignoreList = array(), $action = self::ACTION_OBJECT )
{
// additional saving tasks?
$repository = $this->recordManager->entityManager->getRepository( $this->object->class );
$normality = $repository->normality;
... | [
"protected",
"function",
"additionalSavingTasks",
"(",
"Pg",
"$",
"pg",
",",
"$",
"simulate",
"=",
"false",
",",
"array",
"&",
"$",
"ignoreList",
"=",
"array",
"(",
")",
",",
"$",
"action",
"=",
"self",
"::",
"ACTION_OBJECT",
")",
"{",
"// additional savin... | Execute additional saving tasks.
@return true | [
"Execute",
"additional",
"saving",
"tasks",
"."
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/RecordManager/Task/NormalityCollection/Persist.php#L240-L277 |
200,256 | jabernardo/lollipop-php | Library/Text/Inflector.php | Inflector.camelize | static function camelize($str) {
// john_aldrich -> john aldrich
$str = str_replace('_', ' ', $str);
// john aldrich -> John Aldrich
$str = ucwords($str);
// John Aldrich -> JohnAldrich
$str = str_replace(' ', '', $str);
return lcfirst($str);
} | php | static function camelize($str) {
// john_aldrich -> john aldrich
$str = str_replace('_', ' ', $str);
// john aldrich -> John Aldrich
$str = ucwords($str);
// John Aldrich -> JohnAldrich
$str = str_replace(' ', '', $str);
return lcfirst($str);
} | [
"static",
"function",
"camelize",
"(",
"$",
"str",
")",
"{",
"// john_aldrich -> john aldrich",
"$",
"str",
"=",
"str_replace",
"(",
"'_'",
",",
"' '",
",",
"$",
"str",
")",
";",
"// john aldrich -> John Aldrich",
"$",
"str",
"=",
"ucwords",
"(",
"$",
"str",... | Changes word format to camelize
@param string $str String
@return string | [
"Changes",
"word",
"format",
"to",
"camelize"
] | 004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5 | https://github.com/jabernardo/lollipop-php/blob/004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5/Library/Text/Inflector.php#L26-L37 |
200,257 | jabernardo/lollipop-php | Library/Text/Inflector.php | Inflector.studly | static function studly($str) {
// john_aldrich -> john aldrich
$str = str_replace('_', ' ', $str);
// john aldrich -> John Aldrich
$str = ucwords($str);
// John Aldrich -> JohnAldrich
$str = str_replace(' ', '', $str);
return $str;
} | php | static function studly($str) {
// john_aldrich -> john aldrich
$str = str_replace('_', ' ', $str);
// john aldrich -> John Aldrich
$str = ucwords($str);
// John Aldrich -> JohnAldrich
$str = str_replace(' ', '', $str);
return $str;
} | [
"static",
"function",
"studly",
"(",
"$",
"str",
")",
"{",
"// john_aldrich -> john aldrich",
"$",
"str",
"=",
"str_replace",
"(",
"'_'",
",",
"' '",
",",
"$",
"str",
")",
";",
"// john aldrich -> John Aldrich",
"$",
"str",
"=",
"ucwords",
"(",
"$",
"str",
... | Changes word format to studly
@param string $str String
@return string | [
"Changes",
"word",
"format",
"to",
"studly"
] | 004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5 | https://github.com/jabernardo/lollipop-php/blob/004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5/Library/Text/Inflector.php#L46-L57 |
200,258 | skimia/AngularBundle | Components/FileGenerator/MyJsMin.php | MyJsMin.get | private function get() {
// Get next input character and advance position in file
if ($this->inPos < $this->inLength) {
$c = $this->in[$this->inPos];
++$this->inPos;
}
else {
return self::EOF;
}
// Test for non-problematic characters
if ($c === "\n" || $c === self::EOF || ord($c) >= self::ORD_s... | php | private function get() {
// Get next input character and advance position in file
if ($this->inPos < $this->inLength) {
$c = $this->in[$this->inPos];
++$this->inPos;
}
else {
return self::EOF;
}
// Test for non-problematic characters
if ($c === "\n" || $c === self::EOF || ord($c) >= self::ORD_s... | [
"private",
"function",
"get",
"(",
")",
"{",
"// Get next input character and advance position in file",
"if",
"(",
"$",
"this",
"->",
"inPos",
"<",
"$",
"this",
"->",
"inLength",
")",
"{",
"$",
"c",
"=",
"$",
"this",
"->",
"in",
"[",
"$",
"this",
"->",
... | Get the next character from the input stream.
If said character is a control character, translate it to a space or linefeed.
@return string The next character from the specified input stream.
@see $in
@see peek() | [
"Get",
"the",
"next",
"character",
"from",
"the",
"input",
"stream",
"."
] | ce12fbc03f8554a7879467e73a739ede8991ec48 | https://github.com/skimia/AngularBundle/blob/ce12fbc03f8554a7879467e73a739ede8991ec48/Components/FileGenerator/MyJsMin.php#L173-L200 |
200,259 | skimia/AngularBundle | Components/FileGenerator/MyJsMin.php | MyJsMin.peek | private function peek()
{
return ($this->inPos < $this->inLength) ? $this->in[$this->inPos] : self::EOF;
} | php | private function peek()
{
return ($this->inPos < $this->inLength) ? $this->in[$this->inPos] : self::EOF;
} | [
"private",
"function",
"peek",
"(",
")",
"{",
"return",
"(",
"$",
"this",
"->",
"inPos",
"<",
"$",
"this",
"->",
"inLength",
")",
"?",
"$",
"this",
"->",
"in",
"[",
"$",
"this",
"->",
"inPos",
"]",
":",
"self",
"::",
"EOF",
";",
"}"
] | Get the next character from the input stream, without gettng it.
@return string The next character from the specified input stream, without advancing the position
in the underlying file.
@see $in
@see get() | [
"Get",
"the",
"next",
"character",
"from",
"the",
"input",
"stream",
"without",
"gettng",
"it",
"."
] | ce12fbc03f8554a7879467e73a739ede8991ec48 | https://github.com/skimia/AngularBundle/blob/ce12fbc03f8554a7879467e73a739ede8991ec48/Components/FileGenerator/MyJsMin.php#L221-L224 |
200,260 | skimia/AngularBundle | Components/FileGenerator/MyJsMin.php | MyJsMin.next | function next() {
// Get next char from input, translated if necessary
$c = $this->get();
// Check comment possibility
if ($c == '/') {
// Look ahead : a comment is two slashes or slashes followed by asterisk (to be closed)
switch ($this->peek()) {
case '/' :
// Comment is up to the end o... | php | function next() {
// Get next char from input, translated if necessary
$c = $this->get();
// Check comment possibility
if ($c == '/') {
// Look ahead : a comment is two slashes or slashes followed by asterisk (to be closed)
switch ($this->peek()) {
case '/' :
// Comment is up to the end o... | [
"function",
"next",
"(",
")",
"{",
"// Get next char from input, translated if necessary",
"$",
"c",
"=",
"$",
"this",
"->",
"get",
"(",
")",
";",
"// Check comment possibility",
"if",
"(",
"$",
"c",
"==",
"'/'",
")",
"{",
"// Look ahead : a comment is two slashes o... | Get the next character from the input stream, excluding comments.
{@link peek()} is used to see if a '/' is followed by a '*' or '/'.
Multiline comments are actually returned as a single space.
@return string The next character from the specified input stream, skipping comments.
@see $in | [
"Get",
"the",
"next",
"character",
"from",
"the",
"input",
"stream",
"excluding",
"comments",
"."
] | ce12fbc03f8554a7879467e73a739ede8991ec48 | https://github.com/skimia/AngularBundle/blob/ce12fbc03f8554a7879467e73a739ede8991ec48/Components/FileGenerator/MyJsMin.php#L244-L286 |
200,261 | skimia/AngularBundle | Components/FileGenerator/MyJsMin.php | MyJsMin.action | function action($action) {
// Choice of possible actions
// Note the frequent fallthroughs : the actions are decrementally "long"
switch ($action) {
case self::JSMIN_ACT_FULL :
// Write A to output, then fall through
$this->put($this->theA);
case self::JSMIN_ACT_BUF : // N.B. possible fallthroug... | php | function action($action) {
// Choice of possible actions
// Note the frequent fallthroughs : the actions are decrementally "long"
switch ($action) {
case self::JSMIN_ACT_FULL :
// Write A to output, then fall through
$this->put($this->theA);
case self::JSMIN_ACT_BUF : // N.B. possible fallthroug... | [
"function",
"action",
"(",
"$",
"action",
")",
"{",
"// Choice of possible actions",
"// Note the frequent fallthroughs : the actions are decrementally \"long\"",
"switch",
"(",
"$",
"action",
")",
"{",
"case",
"self",
"::",
"JSMIN_ACT_FULL",
":",
"// Write A to output, then ... | Do something !
The action to perform is determined by the argument :
JSMin::ACT_FULL : Output A. Copy B to A. Get the next B.
JSMin::ACT_BUF : Copy B to A. Get the next B. (Delete A).
JSMin::ACT_IMM : Get the next B. (Delete B).
A string is treated as a single character. Also, regular expressions are recognized if... | [
"Do",
"something",
"!"
] | ce12fbc03f8554a7879467e73a739ede8991ec48 | https://github.com/skimia/AngularBundle/blob/ce12fbc03f8554a7879467e73a739ede8991ec48/Components/FileGenerator/MyJsMin.php#L302-L415 |
200,262 | eliasis-framework/complement | src/Traits/ComplementHandler.php | ComplementHandler.getControllerInstance | public function getControllerInstance($class, $namespace = '')
{
if (isset($this->complement['namespaces'])) {
if (isset($this->complement['namespaces'][$namespace])) {
$namespace = $this->complement['namespaces'][$namespace];
$_class = $namespace . $class;
... | php | public function getControllerInstance($class, $namespace = '')
{
if (isset($this->complement['namespaces'])) {
if (isset($this->complement['namespaces'][$namespace])) {
$namespace = $this->complement['namespaces'][$namespace];
$_class = $namespace . $class;
... | [
"public",
"function",
"getControllerInstance",
"(",
"$",
"class",
",",
"$",
"namespace",
"=",
"''",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"complement",
"[",
"'namespaces'",
"]",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->... | Get complement controller instance.
@since 1.1.0
@param array $class → class name
@param array $namespace → namespace index
@return object|false → class instance or false | [
"Get",
"complement",
"controller",
"instance",
"."
] | d50e92cf01600ff4573bf1761c312069044748c3 | https://github.com/eliasis-framework/complement/blob/d50e92cf01600ff4573bf1761c312069044748c3/src/Traits/ComplementHandler.php#L102-L126 |
200,263 | eliasis-framework/complement | src/Traits/ComplementHandler.php | ComplementHandler.setComplement | private function setComplement($complement)
{
$this->getStates();
$this->setComplementParams($complement);
$state = $this->getState();
$action = $this->getAction($state);
$this->setAction($action);
$this->setState($state);
$this->getSettings();
$sta... | php | private function setComplement($complement)
{
$this->getStates();
$this->setComplementParams($complement);
$state = $this->getState();
$action = $this->getAction($state);
$this->setAction($action);
$this->setState($state);
$this->getSettings();
$sta... | [
"private",
"function",
"setComplement",
"(",
"$",
"complement",
")",
"{",
"$",
"this",
"->",
"getStates",
"(",
")",
";",
"$",
"this",
"->",
"setComplementParams",
"(",
"$",
"complement",
")",
";",
"$",
"state",
"=",
"$",
"this",
"->",
"getState",
"(",
... | Set complement.
@param string $complement → complement settings
@uses \Eliasis\Complement\Traits\ComplementState->getStates()
@uses \Eliasis\Complement\Traits\ComplementState->getState()
@uses \Eliasis\Complement\Traits\ComplementState->setState()
@uses \Eliasis\Complement\Traits\ComplementAction->getAction()
@uses \... | [
"Set",
"complement",
"."
] | d50e92cf01600ff4573bf1761c312069044748c3 | https://github.com/eliasis-framework/complement/blob/d50e92cf01600ff4573bf1761c312069044748c3/src/Traits/ComplementHandler.php#L143-L164 |
200,264 | eliasis-framework/complement | src/Traits/ComplementHandler.php | ComplementHandler.setComplementParams | private function setComplementParams($complement)
{
$params = array_intersect_key(
array_flip(self::$required),
$complement
);
$slug = explode('.', basename($complement['config-file']));
$default['slug'] = $slug[0];
$complementType = self::getType('st... | php | private function setComplementParams($complement)
{
$params = array_intersect_key(
array_flip(self::$required),
$complement
);
$slug = explode('.', basename($complement['config-file']));
$default['slug'] = $slug[0];
$complementType = self::getType('st... | [
"private",
"function",
"setComplementParams",
"(",
"$",
"complement",
")",
"{",
"$",
"params",
"=",
"array_intersect_key",
"(",
"array_flip",
"(",
"self",
"::",
"$",
"required",
")",
",",
"$",
"complement",
")",
";",
"$",
"slug",
"=",
"explode",
"(",
"'.'"... | Check required params and set complement params.
@param string $complement → complement settings
@uses \Eliasis\Complement\Complement->$complement
@uses \Eliasis\Complement\Traits\ComplementHandler::getType()
@uses \Eliasis\Complement\Traits\ComplementAction->$hooks
@throws ComplementException → complement configura... | [
"Check",
"required",
"params",
"and",
"set",
"complement",
"params",
"."
] | d50e92cf01600ff4573bf1761c312069044748c3 | https://github.com/eliasis-framework/complement/blob/d50e92cf01600ff4573bf1761c312069044748c3/src/Traits/ComplementHandler.php#L177-L216 |
200,265 | eliasis-framework/complement | src/Traits/ComplementHandler.php | ComplementHandler.getLanguage | private function getLanguage()
{
$wpLang = (function_exists('get_locale')) ? get_locale() : null;
$browserLang = null;
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
$browserLang = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
}
return substr($wpLang ?: $browserLang ?: 'en'... | php | private function getLanguage()
{
$wpLang = (function_exists('get_locale')) ? get_locale() : null;
$browserLang = null;
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
$browserLang = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
}
return substr($wpLang ?: $browserLang ?: 'en'... | [
"private",
"function",
"getLanguage",
"(",
")",
"{",
"$",
"wpLang",
"=",
"(",
"function_exists",
"(",
"'get_locale'",
")",
")",
"?",
"get_locale",
"(",
")",
":",
"null",
";",
"$",
"browserLang",
"=",
"null",
";",
"if",
"(",
"isset",
"(",
"$",
"_SERVER"... | Gets the current locale.
@uses \get_locale() → gets the current locale in WordPress | [
"Gets",
"the",
"current",
"locale",
"."
] | d50e92cf01600ff4573bf1761c312069044748c3 | https://github.com/eliasis-framework/complement/blob/d50e92cf01600ff4573bf1761c312069044748c3/src/Traits/ComplementHandler.php#L247-L256 |
200,266 | eliasis-framework/complement | src/Traits/ComplementHandler.php | ComplementHandler.setImage | private function setImage()
{
$slug = $this->complement['slug'];
$complementType = self::getType('strtoupper');
$complementPath = App::$complementType();
$complementUrl = $complementType . '_URL';
$complementUrl = App::$complementUrl();
$file = 'public/images/' . $s... | php | private function setImage()
{
$slug = $this->complement['slug'];
$complementType = self::getType('strtoupper');
$complementPath = App::$complementType();
$complementUrl = $complementType . '_URL';
$complementUrl = App::$complementUrl();
$file = 'public/images/' . $s... | [
"private",
"function",
"setImage",
"(",
")",
"{",
"$",
"slug",
"=",
"$",
"this",
"->",
"complement",
"[",
"'slug'",
"]",
";",
"$",
"complementType",
"=",
"self",
"::",
"getType",
"(",
"'strtoupper'",
")",
";",
"$",
"complementPath",
"=",
"App",
"::",
"... | Set image url.
@uses \Eliasis\Framework\App::COMPLEMENT()
@uses \Eliasis\Framework\App::COMPLEMENT_URL()
@uses \Eliasis\Complement\Complement->$complement
@uses \Eliasis\Complement\Traits\ComplementHandler::getType() | [
"Set",
"image",
"url",
"."
] | d50e92cf01600ff4573bf1761c312069044748c3 | https://github.com/eliasis-framework/complement/blob/d50e92cf01600ff4573bf1761c312069044748c3/src/Traits/ComplementHandler.php#L266-L293 |
200,267 | eliasis-framework/complement | src/Traits/ComplementHandler.php | ComplementHandler.getType | private static function getType($mode = 'strtolower', $plural = true)
{
$namespace = get_called_class();
$class = explode('\\', $namespace);
$complement = strtolower(array_pop($class) . ($plural ? 's' : ''));
switch ($mode) {
case 'ucfirst':
return ucfirs... | php | private static function getType($mode = 'strtolower', $plural = true)
{
$namespace = get_called_class();
$class = explode('\\', $namespace);
$complement = strtolower(array_pop($class) . ($plural ? 's' : ''));
switch ($mode) {
case 'ucfirst':
return ucfirs... | [
"private",
"static",
"function",
"getType",
"(",
"$",
"mode",
"=",
"'strtolower'",
",",
"$",
"plural",
"=",
"true",
")",
"{",
"$",
"namespace",
"=",
"get_called_class",
"(",
")",
";",
"$",
"class",
"=",
"explode",
"(",
"'\\\\'",
",",
"$",
"namespace",
... | Get complement type.
@param string $mode → ucfirst|strtoupper|strtolower
@param bool $plural → plural|singular
@return object → complement instance | [
"Get",
"complement",
"type",
"."
] | d50e92cf01600ff4573bf1761c312069044748c3 | https://github.com/eliasis-framework/complement/blob/d50e92cf01600ff4573bf1761c312069044748c3/src/Traits/ComplementHandler.php#L303-L317 |
200,268 | eliasis-framework/complement | src/Traits/ComplementHandler.php | ComplementHandler.addRoutes | private function addRoutes()
{
if (class_exists($Router = 'Josantonius\Router\Router')) {
if (isset($this->complement['routes'])) {
$Router::add($this->complement['routes']);
}
}
} | php | private function addRoutes()
{
if (class_exists($Router = 'Josantonius\Router\Router')) {
if (isset($this->complement['routes'])) {
$Router::add($this->complement['routes']);
}
}
} | [
"private",
"function",
"addRoutes",
"(",
")",
"{",
"if",
"(",
"class_exists",
"(",
"$",
"Router",
"=",
"'Josantonius\\Router\\Router'",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"complement",
"[",
"'routes'",
"]",
")",
")",
"{",
"$",
"... | Add complement routes if exists.
@uses \Josantonius\Router\Router::add
@uses \Eliasis\Complement\Complement->$complement | [
"Add",
"complement",
"routes",
"if",
"exists",
"."
] | d50e92cf01600ff4573bf1761c312069044748c3 | https://github.com/eliasis-framework/complement/blob/d50e92cf01600ff4573bf1761c312069044748c3/src/Traits/ComplementHandler.php#L325-L332 |
200,269 | Fulfillment-dot-com/api-wrapper-php | src/Api.php | Api.refreshAccessToken | public function refreshAccessToken()
{
$newToken = $this->http->requestAccessToken();
if (!is_null($newToken))
{
$this->config->setAccessToken($newToken);
$this->http = new Request($this->guzzle, $this->config, $this->climate);
if ($this->config->shouldStoreToken())
{
file_put_contents(Helper::ge... | php | public function refreshAccessToken()
{
$newToken = $this->http->requestAccessToken();
if (!is_null($newToken))
{
$this->config->setAccessToken($newToken);
$this->http = new Request($this->guzzle, $this->config, $this->climate);
if ($this->config->shouldStoreToken())
{
file_put_contents(Helper::ge... | [
"public",
"function",
"refreshAccessToken",
"(",
")",
"{",
"$",
"newToken",
"=",
"$",
"this",
"->",
"http",
"->",
"requestAccessToken",
"(",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"newToken",
")",
")",
"{",
"$",
"this",
"->",
"config",
"->",
... | Get a new access token
@return string|null
@throws Exceptions\MissingCredentialException
@throws Exceptions\UnauthorizedMerchantException | [
"Get",
"a",
"new",
"access",
"token"
] | f4352843d060bc1b460c1283f25c210c9b94d324 | https://github.com/Fulfillment-dot-com/api-wrapper-php/blob/f4352843d060bc1b460c1283f25c210c9b94d324/src/Api.php#L208-L222 |
200,270 | modulusphp/utility | Command.php | Command.wait | public static function wait(string $args) : ?SymfonyProcess
{
$process = new SymfonyProcess('php ' . Accessor::$appRoot . 'craftsman ' . $args);
$process->start();
$process->wait();
$process->stop();
return $process;
} | php | public static function wait(string $args) : ?SymfonyProcess
{
$process = new SymfonyProcess('php ' . Accessor::$appRoot . 'craftsman ' . $args);
$process->start();
$process->wait();
$process->stop();
return $process;
} | [
"public",
"static",
"function",
"wait",
"(",
"string",
"$",
"args",
")",
":",
"?",
"SymfonyProcess",
"{",
"$",
"process",
"=",
"new",
"SymfonyProcess",
"(",
"'php '",
".",
"Accessor",
"::",
"$",
"appRoot",
".",
"'craftsman '",
".",
"$",
"args",
")",
";",... | Run and wait
@param string $args
@return SymfonyProcess $process | [
"Run",
"and",
"wait"
] | c1e127539b13d3ec8381e41c64b881e0701807f5 | https://github.com/modulusphp/utility/blob/c1e127539b13d3ec8381e41c64b881e0701807f5/Command.php#L47-L56 |
200,271 | brunschgi/TerrificComposerBundle | Service/ModuleManager.php | ModuleManager.createModule | public function createModule(Module $module)
{
$dst = $this->rootDir.'/../src/Terrific/Module/'.StringUtils::camelize($module->getName());
if($this->toolbarMode === ToolbarListener::DEMO) {
// prevent module creation in demo mode
throw new \Exception('This action is not supp... | php | public function createModule(Module $module)
{
$dst = $this->rootDir.'/../src/Terrific/Module/'.StringUtils::camelize($module->getName());
if($this->toolbarMode === ToolbarListener::DEMO) {
// prevent module creation in demo mode
throw new \Exception('This action is not supp... | [
"public",
"function",
"createModule",
"(",
"Module",
"$",
"module",
")",
"{",
"$",
"dst",
"=",
"$",
"this",
"->",
"rootDir",
".",
"'/../src/Terrific/Module/'",
".",
"StringUtils",
"::",
"camelize",
"(",
"$",
"module",
"->",
"getName",
"(",
")",
")",
";",
... | Creates a Terrific Module
@param Module $module The module to create | [
"Creates",
"a",
"Terrific",
"Module"
] | 6eef4ace887c19ef166ab6654de385bc1ffbf5f1 | https://github.com/brunschgi/TerrificComposerBundle/blob/6eef4ace887c19ef166ab6654de385bc1ffbf5f1/Service/ModuleManager.php#L61-L75 |
200,272 | brunschgi/TerrificComposerBundle | Service/ModuleManager.php | ModuleManager.createSkin | public function createSkin(Skin $skin)
{
$module = new Module();
$module->setName($skin->getModule());
$module->addSkin($skin);
$dst = $this->rootDir.'/../src/Terrific/Module/'.StringUtils::camelize($module->getName());
if($this->toolbarMode === ToolbarListener::DEMO) {
... | php | public function createSkin(Skin $skin)
{
$module = new Module();
$module->setName($skin->getModule());
$module->addSkin($skin);
$dst = $this->rootDir.'/../src/Terrific/Module/'.StringUtils::camelize($module->getName());
if($this->toolbarMode === ToolbarListener::DEMO) {
... | [
"public",
"function",
"createSkin",
"(",
"Skin",
"$",
"skin",
")",
"{",
"$",
"module",
"=",
"new",
"Module",
"(",
")",
";",
"$",
"module",
"->",
"setName",
"(",
"$",
"skin",
"->",
"getModule",
"(",
")",
")",
";",
"$",
"module",
"->",
"addSkin",
"("... | Creates a Terrific Skin
@param Skin $skin The skin to create | [
"Creates",
"a",
"Terrific",
"Skin"
] | 6eef4ace887c19ef166ab6654de385bc1ffbf5f1 | https://github.com/brunschgi/TerrificComposerBundle/blob/6eef4ace887c19ef166ab6654de385bc1ffbf5f1/Service/ModuleManager.php#L82-L100 |
200,273 | brunschgi/TerrificComposerBundle | Service/ModuleManager.php | ModuleManager.getModules | public function getModules()
{
$modules = array();
$dir = $this->rootDir.'/../src/Terrific/Module/';
$finder = new Finder();
$finder->directories()->in($dir)->depth('== 0');
foreach ($finder as $file) {
$module = $file->getFilename();
$modules[$modu... | php | public function getModules()
{
$modules = array();
$dir = $this->rootDir.'/../src/Terrific/Module/';
$finder = new Finder();
$finder->directories()->in($dir)->depth('== 0');
foreach ($finder as $file) {
$module = $file->getFilename();
$modules[$modu... | [
"public",
"function",
"getModules",
"(",
")",
"{",
"$",
"modules",
"=",
"array",
"(",
")",
";",
"$",
"dir",
"=",
"$",
"this",
"->",
"rootDir",
".",
"'/../src/Terrific/Module/'",
";",
"$",
"finder",
"=",
"new",
"Finder",
"(",
")",
";",
"$",
"finder",
... | Gets all existing Modules
@return array All existing Module instances | [
"Gets",
"all",
"existing",
"Modules"
] | 6eef4ace887c19ef166ab6654de385bc1ffbf5f1 | https://github.com/brunschgi/TerrificComposerBundle/blob/6eef4ace887c19ef166ab6654de385bc1ffbf5f1/Service/ModuleManager.php#L107-L124 |
200,274 | SlabPHP/database | src/Models/MySQL/Loader.php | Loader.getCount | public function getCount($where = '', $variables = null)
{
$where = $this->formatWhereClause($where);
$response = $this->driver->query("select count(*) as numberOfItems from " . $this->getTable() . ' ' . $where . ";", $variables);
if (!$response->count()) return 0;
$response = $re... | php | public function getCount($where = '', $variables = null)
{
$where = $this->formatWhereClause($where);
$response = $this->driver->query("select count(*) as numberOfItems from " . $this->getTable() . ' ' . $where . ";", $variables);
if (!$response->count()) return 0;
$response = $re... | [
"public",
"function",
"getCount",
"(",
"$",
"where",
"=",
"''",
",",
"$",
"variables",
"=",
"null",
")",
"{",
"$",
"where",
"=",
"$",
"this",
"->",
"formatWhereClause",
"(",
"$",
"where",
")",
";",
"$",
"response",
"=",
"$",
"this",
"->",
"driver",
... | Return the number of items available in the table
@param string $where
@param string[] $variables
@return integer | [
"Return",
"the",
"number",
"of",
"items",
"available",
"in",
"the",
"table"
] | d77c38f2260429c6e054633eb0daf3f755c988a9 | https://github.com/SlabPHP/database/blob/d77c38f2260429c6e054633eb0daf3f755c988a9/src/Models/MySQL/Loader.php#L119-L130 |
200,275 | SlabPHP/database | src/Models/MySQL/Loader.php | Loader.formatWhereClause | protected function formatWhereClause($where)
{
if (!empty($where)) {
if (stripos($where, 'where') === false || stripos($where, 'select') !== false) {
$where = ' where ' . $where;
}
}
return $where;
} | php | protected function formatWhereClause($where)
{
if (!empty($where)) {
if (stripos($where, 'where') === false || stripos($where, 'select') !== false) {
$where = ' where ' . $where;
}
}
return $where;
} | [
"protected",
"function",
"formatWhereClause",
"(",
"$",
"where",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"where",
")",
")",
"{",
"if",
"(",
"stripos",
"(",
"$",
"where",
",",
"'where'",
")",
"===",
"false",
"||",
"stripos",
"(",
"$",
"where",
... | Some simple checks for a where clause
@param $where
@return string | [
"Some",
"simple",
"checks",
"for",
"a",
"where",
"clause"
] | d77c38f2260429c6e054633eb0daf3f755c988a9 | https://github.com/SlabPHP/database/blob/d77c38f2260429c6e054633eb0daf3f755c988a9/src/Models/MySQL/Loader.php#L138-L147 |
200,276 | SlabPHP/database | src/Models/MySQL/Loader.php | Loader.fetchAll | public function fetchAll($page, $pagination, $where)
{
$index = ceil(($page - 1) * $pagination);
$where = $this->formatWhereClause($where);
$sql = "
select " . $this->getMappingAsSQL() . "
from " . $this->getTable() . "
" . $where . "
limit " . $index . ',' . intval($pagination... | php | public function fetchAll($page, $pagination, $where)
{
$index = ceil(($page - 1) * $pagination);
$where = $this->formatWhereClause($where);
$sql = "
select " . $this->getMappingAsSQL() . "
from " . $this->getTable() . "
" . $where . "
limit " . $index . ',' . intval($pagination... | [
"public",
"function",
"fetchAll",
"(",
"$",
"page",
",",
"$",
"pagination",
",",
"$",
"where",
")",
"{",
"$",
"index",
"=",
"ceil",
"(",
"(",
"$",
"page",
"-",
"1",
")",
"*",
"$",
"pagination",
")",
";",
"$",
"where",
"=",
"$",
"this",
"->",
"f... | Actually fetch all the items with the given params
@param $page
@param $pagination
@param $where
@return \stdClass[] | [
"Actually",
"fetch",
"all",
"the",
"items",
"with",
"the",
"given",
"params"
] | d77c38f2260429c6e054633eb0daf3f755c988a9 | https://github.com/SlabPHP/database/blob/d77c38f2260429c6e054633eb0daf3f755c988a9/src/Models/MySQL/Loader.php#L171-L186 |
200,277 | SlabPHP/database | src/Models/MySQL/Loader.php | Loader.fetchByColumn | protected function fetchByColumn($column, $value)
{
/**
* @var \Slab\Database\Providers\BaseResponse $response
*/
$response = $this->driver->query("select " . $this->getMappingAsSQL() . " from " . $this->getTable() . " where `" . $column . "` = ? limit 1;", array($value), static::D... | php | protected function fetchByColumn($column, $value)
{
/**
* @var \Slab\Database\Providers\BaseResponse $response
*/
$response = $this->driver->query("select " . $this->getMappingAsSQL() . " from " . $this->getTable() . " where `" . $column . "` = ? limit 1;", array($value), static::D... | [
"protected",
"function",
"fetchByColumn",
"(",
"$",
"column",
",",
"$",
"value",
")",
"{",
"/**\n * @var \\Slab\\Database\\Providers\\BaseResponse $response\n */",
"$",
"response",
"=",
"$",
"this",
"->",
"driver",
"->",
"query",
"(",
"\"select \"",
".",... | Do actual mysql query by specific criteria
@param string $column
@param string $value
@return NULL|mixed | [
"Do",
"actual",
"mysql",
"query",
"by",
"specific",
"criteria"
] | d77c38f2260429c6e054633eb0daf3f755c988a9 | https://github.com/SlabPHP/database/blob/d77c38f2260429c6e054633eb0daf3f755c988a9/src/Models/MySQL/Loader.php#L195-L203 |
200,278 | SlabPHP/database | src/Models/MySQL/Loader.php | Loader.getPrimaryKey | public function getPrimaryKey($tableAlias = '')
{
$output = '';
if (!empty($tableAlias)) {
$output .= '`' . $tableAlias . '`.';
}
$output .= '`'.static::ID_COLUMN.'`';
return $output;
} | php | public function getPrimaryKey($tableAlias = '')
{
$output = '';
if (!empty($tableAlias)) {
$output .= '`' . $tableAlias . '`.';
}
$output .= '`'.static::ID_COLUMN.'`';
return $output;
} | [
"public",
"function",
"getPrimaryKey",
"(",
"$",
"tableAlias",
"=",
"''",
")",
"{",
"$",
"output",
"=",
"''",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"tableAlias",
")",
")",
"{",
"$",
"output",
".=",
"'`'",
".",
"$",
"tableAlias",
".",
"'`.'",
";",... | Return primary key qualified or not
@param string $tableAlias
@return string | [
"Return",
"primary",
"key",
"qualified",
"or",
"not"
] | d77c38f2260429c6e054633eb0daf3f755c988a9 | https://github.com/SlabPHP/database/blob/d77c38f2260429c6e054633eb0daf3f755c988a9/src/Models/MySQL/Loader.php#L250-L261 |
200,279 | SlabPHP/database | src/Models/MySQL/Loader.php | Loader.getColumnsAsSQL | public function getColumnsAsSQL($tableAlias = '', $columnPrefix = '')
{
if (empty($this->mapping)) {
return '*';
}
$output = '';
foreach ($this->mapping as $column => $mappingField) {
if (!empty($output)) {
$output .= ',';
}
... | php | public function getColumnsAsSQL($tableAlias = '', $columnPrefix = '')
{
if (empty($this->mapping)) {
return '*';
}
$output = '';
foreach ($this->mapping as $column => $mappingField) {
if (!empty($output)) {
$output .= ',';
}
... | [
"public",
"function",
"getColumnsAsSQL",
"(",
"$",
"tableAlias",
"=",
"''",
",",
"$",
"columnPrefix",
"=",
"''",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"mapping",
")",
")",
"{",
"return",
"'*'",
";",
"}",
"$",
"output",
"=",
"''",
";... | Get raw columns as SQL, with some prefix options
@param string $tableAlias
@param string $columnPrefix
@return string | [
"Get",
"raw",
"columns",
"as",
"SQL",
"with",
"some",
"prefix",
"options"
] | d77c38f2260429c6e054633eb0daf3f755c988a9 | https://github.com/SlabPHP/database/blob/d77c38f2260429c6e054633eb0daf3f755c988a9/src/Models/MySQL/Loader.php#L270-L294 |
200,280 | SlabPHP/database | src/Models/MySQL/Loader.php | Loader.resetMappingOptions | protected function resetMappingOptions()
{
$this->mappingOptions = new \stdClass();
$this->mappingOptions->destructiveMapping = false;
$this->mappingOptions->assignNonMappedColumns = true;
$this->mappingOptions->fieldPrefix = '';
$this->mappingOptions->throwOnEmptyId = false;... | php | protected function resetMappingOptions()
{
$this->mappingOptions = new \stdClass();
$this->mappingOptions->destructiveMapping = false;
$this->mappingOptions->assignNonMappedColumns = true;
$this->mappingOptions->fieldPrefix = '';
$this->mappingOptions->throwOnEmptyId = false;... | [
"protected",
"function",
"resetMappingOptions",
"(",
")",
"{",
"$",
"this",
"->",
"mappingOptions",
"=",
"new",
"\\",
"stdClass",
"(",
")",
";",
"$",
"this",
"->",
"mappingOptions",
"->",
"destructiveMapping",
"=",
"false",
";",
"$",
"this",
"->",
"mappingOp... | Reset mapping options | [
"Reset",
"mapping",
"options"
] | d77c38f2260429c6e054633eb0daf3f755c988a9 | https://github.com/SlabPHP/database/blob/d77c38f2260429c6e054633eb0daf3f755c988a9/src/Models/MySQL/Loader.php#L299-L307 |
200,281 | SlabPHP/database | src/Models/MySQL/Loader.php | Loader.setDestructiveMapping | public function setDestructiveMapping($destructiveMapping)
{
if (empty($this->mappingOptions)) $this->resetMappingOptions();
$this->mappingOptions->destructiveMapping = $destructiveMapping;
return $this;
} | php | public function setDestructiveMapping($destructiveMapping)
{
if (empty($this->mappingOptions)) $this->resetMappingOptions();
$this->mappingOptions->destructiveMapping = $destructiveMapping;
return $this;
} | [
"public",
"function",
"setDestructiveMapping",
"(",
"$",
"destructiveMapping",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"mappingOptions",
")",
")",
"$",
"this",
"->",
"resetMappingOptions",
"(",
")",
";",
"$",
"this",
"->",
"mappingOptions",
"->... | Set destructive mapping option
@param $destructiveMapping
@return $this | [
"Set",
"destructive",
"mapping",
"option"
] | d77c38f2260429c6e054633eb0daf3f755c988a9 | https://github.com/SlabPHP/database/blob/d77c38f2260429c6e054633eb0daf3f755c988a9/src/Models/MySQL/Loader.php#L328-L335 |
200,282 | SlabPHP/database | src/Models/MySQL/Loader.php | Loader.setAssignNonMappedColumns | public function setAssignNonMappedColumns($assignNonMappedColumns)
{
if (empty($this->mappingOptions)) $this->resetMappingOptions();
$this->mappingOptions->assignNonMappedColumns = $assignNonMappedColumns;
return $this;
} | php | public function setAssignNonMappedColumns($assignNonMappedColumns)
{
if (empty($this->mappingOptions)) $this->resetMappingOptions();
$this->mappingOptions->assignNonMappedColumns = $assignNonMappedColumns;
return $this;
} | [
"public",
"function",
"setAssignNonMappedColumns",
"(",
"$",
"assignNonMappedColumns",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"mappingOptions",
")",
")",
"$",
"this",
"->",
"resetMappingOptions",
"(",
")",
";",
"$",
"this",
"->",
"mappingOptions... | Set flag for assigning non-mapped columns
@param $assignNonMappedColumns
@return $this | [
"Set",
"flag",
"for",
"assigning",
"non",
"-",
"mapped",
"columns"
] | d77c38f2260429c6e054633eb0daf3f755c988a9 | https://github.com/SlabPHP/database/blob/d77c38f2260429c6e054633eb0daf3f755c988a9/src/Models/MySQL/Loader.php#L343-L350 |
200,283 | SlabPHP/database | src/Models/MySQL/Loader.php | Loader.setFieldPrefix | public function setFieldPrefix($fieldPrefix)
{
if (empty($this->mappingOptions)) $this->resetMappingOptions();
$this->mappingOptions->fieldPrefix = $fieldPrefix;
return $this;
} | php | public function setFieldPrefix($fieldPrefix)
{
if (empty($this->mappingOptions)) $this->resetMappingOptions();
$this->mappingOptions->fieldPrefix = $fieldPrefix;
return $this;
} | [
"public",
"function",
"setFieldPrefix",
"(",
"$",
"fieldPrefix",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"mappingOptions",
")",
")",
"$",
"this",
"->",
"resetMappingOptions",
"(",
")",
";",
"$",
"this",
"->",
"mappingOptions",
"->",
"fieldPre... | Set mapping option field prefix
@param $fieldPrefix
@return $this | [
"Set",
"mapping",
"option",
"field",
"prefix"
] | d77c38f2260429c6e054633eb0daf3f755c988a9 | https://github.com/SlabPHP/database/blob/d77c38f2260429c6e054633eb0daf3f755c988a9/src/Models/MySQL/Loader.php#L358-L365 |
200,284 | SlabPHP/database | src/Models/MySQL/Loader.php | Loader.setThrowIfEmptyId | public function setThrowIfEmptyId($throwOnEmptyId)
{
if (empty($this->mappingOptions)) $this->resetMappingOptions();
$this->mappingOptions->throwOnEmptyId = $throwOnEmptyId;
return $this;
} | php | public function setThrowIfEmptyId($throwOnEmptyId)
{
if (empty($this->mappingOptions)) $this->resetMappingOptions();
$this->mappingOptions->throwOnEmptyId = $throwOnEmptyId;
return $this;
} | [
"public",
"function",
"setThrowIfEmptyId",
"(",
"$",
"throwOnEmptyId",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"mappingOptions",
")",
")",
"$",
"this",
"->",
"resetMappingOptions",
"(",
")",
";",
"$",
"this",
"->",
"mappingOptions",
"->",
"th... | Throw an exception if the main id doesn't get mapped?
@param $throwOnEmptyId
@return $this | [
"Throw",
"an",
"exception",
"if",
"the",
"main",
"id",
"doesn",
"t",
"get",
"mapped?"
] | d77c38f2260429c6e054633eb0daf3f755c988a9 | https://github.com/SlabPHP/database/blob/d77c38f2260429c6e054633eb0daf3f755c988a9/src/Models/MySQL/Loader.php#L373-L380 |
200,285 | SlabPHP/database | src/Models/MySQL/Loader.php | Loader.mapObject | protected function mapObject($databaseResult)
{
foreach ($databaseResult as $column => $value) {
if (!empty($this->mapping[$column])) {
list($variable, $modifier) = $this->splitVariableWithModifier($this->mapping[$column]);
$this->$variable = $this->getMappedValu... | php | protected function mapObject($databaseResult)
{
foreach ($databaseResult as $column => $value) {
if (!empty($this->mapping[$column])) {
list($variable, $modifier) = $this->splitVariableWithModifier($this->mapping[$column]);
$this->$variable = $this->getMappedValu... | [
"protected",
"function",
"mapObject",
"(",
"$",
"databaseResult",
")",
"{",
"foreach",
"(",
"$",
"databaseResult",
"as",
"$",
"column",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"mapping",
"[",
"$",
"column",
"]",
... | Map a single object to this instance
@param \stdClass $databaseResult | [
"Map",
"a",
"single",
"object",
"to",
"this",
"instance"
] | d77c38f2260429c6e054633eb0daf3f755c988a9 | https://github.com/SlabPHP/database/blob/d77c38f2260429c6e054633eb0daf3f755c988a9/src/Models/MySQL/Loader.php#L387-L398 |
200,286 | SlabPHP/database | src/Models/MySQL/Loader.php | Loader.splitVariableWithModifier | protected function splitVariableWithModifier($column)
{
$modifier = false;
if (strpos($column, ':') !== false) {
return explode(':', $column);
}
return [$column, false];
} | php | protected function splitVariableWithModifier($column)
{
$modifier = false;
if (strpos($column, ':') !== false) {
return explode(':', $column);
}
return [$column, false];
} | [
"protected",
"function",
"splitVariableWithModifier",
"(",
"$",
"column",
")",
"{",
"$",
"modifier",
"=",
"false",
";",
"if",
"(",
"strpos",
"(",
"$",
"column",
",",
"':'",
")",
"!==",
"false",
")",
"{",
"return",
"explode",
"(",
"':'",
",",
"$",
"colu... | Splits variable with a modifier
@param string $column
@return array | [
"Splits",
"variable",
"with",
"a",
"modifier"
] | d77c38f2260429c6e054633eb0daf3f755c988a9 | https://github.com/SlabPHP/database/blob/d77c38f2260429c6e054633eb0daf3f755c988a9/src/Models/MySQL/Loader.php#L454-L462 |
200,287 | SlabPHP/database | src/Models/MySQL/Loader.php | Loader.modifierDate | protected function modifierDate($input)
{
if (empty($input)) return NULL;
//if ($input == '0000-00-00 00:00:00') return NULL;
if ($input instanceof \DateTime) return $input;
try {
$output = new \DateTime($input);
$output->setTimeZone(new \DateTimeZone('Ameri... | php | protected function modifierDate($input)
{
if (empty($input)) return NULL;
//if ($input == '0000-00-00 00:00:00') return NULL;
if ($input instanceof \DateTime) return $input;
try {
$output = new \DateTime($input);
$output->setTimeZone(new \DateTimeZone('Ameri... | [
"protected",
"function",
"modifierDate",
"(",
"$",
"input",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"input",
")",
")",
"return",
"NULL",
";",
"//if ($input == '0000-00-00 00:00:00') return NULL;",
"if",
"(",
"$",
"input",
"instanceof",
"\\",
"DateTime",
")",
"... | Return a date time modified input
@param string $input
@return \DateTime|NULL | [
"Return",
"a",
"date",
"time",
"modified",
"input"
] | d77c38f2260429c6e054633eb0daf3f755c988a9 | https://github.com/SlabPHP/database/blob/d77c38f2260429c6e054633eb0daf3f755c988a9/src/Models/MySQL/Loader.php#L493-L510 |
200,288 | SlabPHP/database | src/Models/MySQL/Loader.php | Loader.modifierTimezone | protected function modifierTimezone($input)
{
if ($input instanceof \DateTimeZone) return $input;
try {
$output = new \DateTimeZone($input);
return $output;
} catch (\Exception $exception) {
if (!empty($this->log)) $this->log->error("Failed to convert \\... | php | protected function modifierTimezone($input)
{
if ($input instanceof \DateTimeZone) return $input;
try {
$output = new \DateTimeZone($input);
return $output;
} catch (\Exception $exception) {
if (!empty($this->log)) $this->log->error("Failed to convert \\... | [
"protected",
"function",
"modifierTimezone",
"(",
"$",
"input",
")",
"{",
"if",
"(",
"$",
"input",
"instanceof",
"\\",
"DateTimeZone",
")",
"return",
"$",
"input",
";",
"try",
"{",
"$",
"output",
"=",
"new",
"\\",
"DateTimeZone",
"(",
"$",
"input",
")",
... | Return a timezone modified input
@param string $input
@return \DateTimeZone|NULL | [
"Return",
"a",
"timezone",
"modified",
"input"
] | d77c38f2260429c6e054633eb0daf3f755c988a9 | https://github.com/SlabPHP/database/blob/d77c38f2260429c6e054633eb0daf3f755c988a9/src/Models/MySQL/Loader.php#L518-L531 |
200,289 | SlabPHP/database | src/Models/MySQL/Loader.php | Loader.buildModel | public function buildModel($databaseResult = null)
{
$this->resetMappingOptions();
if (empty($databaseResult)) return;
$this->mapObject($databaseResult);
} | php | public function buildModel($databaseResult = null)
{
$this->resetMappingOptions();
if (empty($databaseResult)) return;
$this->mapObject($databaseResult);
} | [
"public",
"function",
"buildModel",
"(",
"$",
"databaseResult",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"resetMappingOptions",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"databaseResult",
")",
")",
"return",
";",
"$",
"this",
"->",
"mapObject",
"(",
... | Map the object to itself
@param \stdClass $databaseResult - The database result to map
@param bool $assignNonMappedColumns - Leave fields that aren't mapped in the output object
@param bool $destructiveMapping - Remove field from databaseResult upon mapping
@param string $fieldPrefix - An optional prefix for fields in... | [
"Map",
"the",
"object",
"to",
"itself"
] | d77c38f2260429c6e054633eb0daf3f755c988a9 | https://github.com/SlabPHP/database/blob/d77c38f2260429c6e054633eb0daf3f755c988a9/src/Models/MySQL/Loader.php#L541-L548 |
200,290 | SlabPHP/database | src/Models/MySQL/Loader.php | Loader.performMappingOnObject | public function performMappingOnObject(DataObject $object)
{
//By default, we already have our data mapped in the object (hopefully properly)
//But we do need to convert things that may need converting
foreach ($this->mapping as $field => $variable) {
$modifier = false;
... | php | public function performMappingOnObject(DataObject $object)
{
//By default, we already have our data mapped in the object (hopefully properly)
//But we do need to convert things that may need converting
foreach ($this->mapping as $field => $variable) {
$modifier = false;
... | [
"public",
"function",
"performMappingOnObject",
"(",
"DataObject",
"$",
"object",
")",
"{",
"//By default, we already have our data mapped in the object (hopefully properly)",
"//But we do need to convert things that may need converting",
"foreach",
"(",
"$",
"this",
"->",
"mapping",... | Array walk function, overridable
The response object will automatically try to fire this when pulling a list of automapped objects.
@param DataObject $Object | [
"Array",
"walk",
"function",
"overridable"
] | d77c38f2260429c6e054633eb0daf3f755c988a9 | https://github.com/SlabPHP/database/blob/d77c38f2260429c6e054633eb0daf3f755c988a9/src/Models/MySQL/Loader.php#L557-L570 |
200,291 | SlabPHP/database | src/Models/MySQL/Loader.php | Loader.insertObject | public function insertObject(DataObject $object, $skipID = true)
{
$data = [];
foreach ($this->mapping as $column => $local) {
if ($skipID && ($column == static::ID_COLUMN)) continue;
$modifier = false;
if (strpos($local, ':') !== false) {
list($... | php | public function insertObject(DataObject $object, $skipID = true)
{
$data = [];
foreach ($this->mapping as $column => $local) {
if ($skipID && ($column == static::ID_COLUMN)) continue;
$modifier = false;
if (strpos($local, ':') !== false) {
list($... | [
"public",
"function",
"insertObject",
"(",
"DataObject",
"$",
"object",
",",
"$",
"skipID",
"=",
"true",
")",
"{",
"$",
"data",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"mapping",
"as",
"$",
"column",
"=>",
"$",
"local",
")",
"{",
"if... | Attempts to insert the object into the table
@param DataObject $object
@param boolean $skipID
@return bool|\Slab\Database\Providers\BaseResponse | [
"Attempts",
"to",
"insert",
"the",
"object",
"into",
"the",
"table"
] | d77c38f2260429c6e054633eb0daf3f755c988a9 | https://github.com/SlabPHP/database/blob/d77c38f2260429c6e054633eb0daf3f755c988a9/src/Models/MySQL/Loader.php#L589-L634 |
200,292 | SlabPHP/database | src/Models/MySQL/Loader.php | Loader.getUnmappedArray | public function getUnmappedArray(DataObject $object)
{
$output = [];
foreach ($this->mapping as $unmappedField => $mappedField) {
if (strpos($mappedField, ':') !== false) {
list($mappedField, $modifier) = explode(':', $mappedField);
}
$output[$un... | php | public function getUnmappedArray(DataObject $object)
{
$output = [];
foreach ($this->mapping as $unmappedField => $mappedField) {
if (strpos($mappedField, ':') !== false) {
list($mappedField, $modifier) = explode(':', $mappedField);
}
$output[$un... | [
"public",
"function",
"getUnmappedArray",
"(",
"DataObject",
"$",
"object",
")",
"{",
"$",
"output",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"mapping",
"as",
"$",
"unmappedField",
"=>",
"$",
"mappedField",
")",
"{",
"if",
"(",
"strpos",
... | Return an array of an object as an unmapped aray, useful for dumping defaults
@return array | [
"Return",
"an",
"array",
"of",
"an",
"object",
"as",
"an",
"unmapped",
"aray",
"useful",
"for",
"dumping",
"defaults"
] | d77c38f2260429c6e054633eb0daf3f755c988a9 | https://github.com/SlabPHP/database/blob/d77c38f2260429c6e054633eb0daf3f755c988a9/src/Models/MySQL/Loader.php#L641-L654 |
200,293 | togucms/TemplateBundle | Loader/FilesystemLoader.php | FilesystemLoader.findFilename | public function findFilename($name) {
$logicalName = (string) $name;
if(isset($this->cache[$logicalName])) {
return $this->cache[$logicalName];
}
try {
$template = $this->parser->parse($name);
$file = $this->locator->locate($template);
} catch (\Exception $e) {
... | php | public function findFilename($name) {
$logicalName = (string) $name;
if(isset($this->cache[$logicalName])) {
return $this->cache[$logicalName];
}
try {
$template = $this->parser->parse($name);
$file = $this->locator->locate($template);
} catch (\Exception $e) {
... | [
"public",
"function",
"findFilename",
"(",
"$",
"name",
")",
"{",
"$",
"logicalName",
"=",
"(",
"string",
")",
"$",
"name",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"cache",
"[",
"$",
"logicalName",
"]",
")",
")",
"{",
"return",
"$",
"this"... | Helper function for getting a template file name.
@param string $name
@return string Template file name | [
"Helper",
"function",
"for",
"getting",
"a",
"template",
"file",
"name",
"."
] | b07d3bff948d547e95f81154503dfa3a333eef64 | https://github.com/togucms/TemplateBundle/blob/b07d3bff948d547e95f81154503dfa3a333eef64/Loader/FilesystemLoader.php#L57-L71 |
200,294 | koolkode/security | src/Cipher/Cipher.php | Cipher.decryptMessage | public function decryptMessage($message)
{
$calgo = $this->config->getCipherAlgorithm();
$cmode = $this->config->getCipherMode();
$malgo = $this->config->getHmacAlgorithm();
$size = mcrypt_get_iv_size($calgo, $cmode);
$keySize = mcrypt_get_key_size($calgo, $cm... | php | public function decryptMessage($message)
{
$calgo = $this->config->getCipherAlgorithm();
$cmode = $this->config->getCipherMode();
$malgo = $this->config->getHmacAlgorithm();
$size = mcrypt_get_iv_size($calgo, $cmode);
$keySize = mcrypt_get_key_size($calgo, $cm... | [
"public",
"function",
"decryptMessage",
"(",
"$",
"message",
")",
"{",
"$",
"calgo",
"=",
"$",
"this",
"->",
"config",
"->",
"getCipherAlgorithm",
"(",
")",
";",
"$",
"cmode",
"=",
"$",
"this",
"->",
"config",
"->",
"getCipherMode",
"(",
")",
";",
"$",... | Decrypts a message with auhtenticity check.
@param string $message Encoded message.
@return mixed Plaintext message.
@throws IntegrityCheckFailedException | [
"Decrypts",
"a",
"message",
"with",
"auhtenticity",
"check",
"."
] | d3d8d42392f520754847d29b6df19aaa38c79e8e | https://github.com/koolkode/security/blob/d3d8d42392f520754847d29b6df19aaa38c79e8e/src/Cipher/Cipher.php#L39-L68 |
200,295 | koolkode/security | src/Cipher/Cipher.php | Cipher.encryptMessage | public function encryptMessage($input)
{
$input = (string)$input;
$calgo = $this->config->getCipherAlgorithm();
$cmode = $this->config->getCipherMode();
$malgo = $this->config->getHmacAlgorithm();
$size = mcrypt_get_iv_size($calgo, $cmode);
... | php | public function encryptMessage($input)
{
$input = (string)$input;
$calgo = $this->config->getCipherAlgorithm();
$cmode = $this->config->getCipherMode();
$malgo = $this->config->getHmacAlgorithm();
$size = mcrypt_get_iv_size($calgo, $cmode);
... | [
"public",
"function",
"encryptMessage",
"(",
"$",
"input",
")",
"{",
"$",
"input",
"=",
"(",
"string",
")",
"$",
"input",
";",
"$",
"calgo",
"=",
"$",
"this",
"->",
"config",
"->",
"getCipherAlgorithm",
"(",
")",
";",
"$",
"cmode",
"=",
"$",
"this",
... | Encrypts the given message and adds an authenticity code.
<pre><b>CIPHERTEXT</b> := IV + ENCRYPT(CLEARTEXT, PBKDF(ENCRYPTION_KEY))
<b>MESSAGE</b> := CIPHERTEXT + HMAC(CIPHERTEXT, PBKDF(HMAC_KEY))
</pre>
@param string $input Plaintext message.
@return string Encrypted message. | [
"Encrypts",
"the",
"given",
"message",
"and",
"adds",
"an",
"authenticity",
"code",
"."
] | d3d8d42392f520754847d29b6df19aaa38c79e8e | https://github.com/koolkode/security/blob/d3d8d42392f520754847d29b6df19aaa38c79e8e/src/Cipher/Cipher.php#L80-L103 |
200,296 | ptlis/grep-db | src/Search/Result/RowSearchResult.php | RowSearchResult.getColumnResult | public function getColumnResult(string $columnName): FieldSearchResult
{
if (!$this->hasColumnResult($columnName)) {
throw new \RuntimeException('Could not find changed column named "' . $columnName . '"');
}
return $this->fieldMatchList[$columnName];
} | php | public function getColumnResult(string $columnName): FieldSearchResult
{
if (!$this->hasColumnResult($columnName)) {
throw new \RuntimeException('Could not find changed column named "' . $columnName . '"');
}
return $this->fieldMatchList[$columnName];
} | [
"public",
"function",
"getColumnResult",
"(",
"string",
"$",
"columnName",
")",
":",
"FieldSearchResult",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasColumnResult",
"(",
"$",
"columnName",
")",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'Could... | Returns the column result matching the passed name. | [
"Returns",
"the",
"column",
"result",
"matching",
"the",
"passed",
"name",
"."
] | 7abff68982d426690d0515ccd7adc7a2e3d72a3f | https://github.com/ptlis/grep-db/blob/7abff68982d426690d0515ccd7adc7a2e3d72a3f/src/Search/Result/RowSearchResult.php#L78-L85 |
200,297 | prosoftSolutions/Pager | DependencyInjection/WhiteOctoberPagerfantaExtension.php | WhiteOctoberPagerfantaExtension.load | public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
$processor = new Processor();
$config = $processor->processConfiguration($configuration, $configs);
$container->setParameter('white_october_pagerfanta.default_view', $config['de... | php | public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
$processor = new Processor();
$config = $processor->processConfiguration($configuration, $configs);
$container->setParameter('white_october_pagerfanta.default_view', $config['de... | [
"public",
"function",
"load",
"(",
"array",
"$",
"configs",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"configuration",
"=",
"new",
"Configuration",
"(",
")",
";",
"$",
"processor",
"=",
"new",
"Processor",
"(",
")",
";",
"$",
"config",
"=... | Responds to the "white_october_pagerfanta" configuration parameter.
@param array $configs
@param ContainerBuilder $container | [
"Responds",
"to",
"the",
"white_october_pagerfanta",
"configuration",
"parameter",
"."
] | 96446ee22caedc0b9bb486d9ffe7a50b6c13177f | https://github.com/prosoftSolutions/Pager/blob/96446ee22caedc0b9bb486d9ffe7a50b6c13177f/DependencyInjection/WhiteOctoberPagerfantaExtension.php#L33-L53 |
200,298 | cloudtek/dynamodm | lib/Cloudtek/DynamoDM/Expression/Condition/Logical/Logical.php | Logical.getAttributeConditions | public function getAttributeConditions($attributeName, $unindexablePredicates = false)
{
return array_filter(
$this->parts,
function (Condition $part) use ($attributeName, $unindexablePredicates) {
if ($part instanceof self) {
return $part->getAttr... | php | public function getAttributeConditions($attributeName, $unindexablePredicates = false)
{
return array_filter(
$this->parts,
function (Condition $part) use ($attributeName, $unindexablePredicates) {
if ($part instanceof self) {
return $part->getAttr... | [
"public",
"function",
"getAttributeConditions",
"(",
"$",
"attributeName",
",",
"$",
"unindexablePredicates",
"=",
"false",
")",
"{",
"return",
"array_filter",
"(",
"$",
"this",
"->",
"parts",
",",
"function",
"(",
"Condition",
"$",
"part",
")",
"use",
"(",
... | Return all conditions of the specified type in this expression which use
the indicated attribute as an operand.
@param string $attributeName
@param bool $unindexablePredicates Whether to return only indexable predicates
(using AND) or only unindexable predicates
(using OR or NOT)
@return Condition[] | [
"Return",
"all",
"conditions",
"of",
"the",
"specified",
"type",
"in",
"this",
"expression",
"which",
"use",
"the",
"indicated",
"attribute",
"as",
"an",
"operand",
"."
] | 119d355e2c5cbaef1f867970349b4432f5704fcd | https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/Expression/Condition/Logical/Logical.php#L43-L55 |
200,299 | ScaraMVC/Framework | src/Scara/Foundation/Application.php | Application.boot | public function boot()
{
$this->loadConfig();
$this->registerExceptionHandler();
$this->registerProviders();
$this->registerAliases();
$this->registerScaraMasterSessionToken();
} | php | public function boot()
{
$this->loadConfig();
$this->registerExceptionHandler();
$this->registerProviders();
$this->registerAliases();
$this->registerScaraMasterSessionToken();
} | [
"public",
"function",
"boot",
"(",
")",
"{",
"$",
"this",
"->",
"loadConfig",
"(",
")",
";",
"$",
"this",
"->",
"registerExceptionHandler",
"(",
")",
";",
"$",
"this",
"->",
"registerProviders",
"(",
")",
";",
"$",
"this",
"->",
"registerAliases",
"(",
... | Handles registering Scara's pre-execution status.
@return void | [
"Handles",
"registering",
"Scara",
"s",
"pre",
"-",
"execution",
"status",
"."
] | 199b08b45fadf5dae14ac4732af03b36e15bbef2 | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Foundation/Application.php#L58-L65 |
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.