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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
4,500 | indigophp-archive/http-adapter | src/Client.php | Client.send | public function send(Request $request)
{
$response = $this->adapter->send($request);
return $response->getBody()->getContents();
} | php | public function send(Request $request)
{
$response = $this->adapter->send($request);
return $response->getBody()->getContents();
} | [
"public",
"function",
"send",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"adapter",
"->",
"send",
"(",
"$",
"request",
")",
";",
"return",
"$",
"response",
"->",
"getBody",
"(",
")",
"->",
"getContents",
"(",
"... | Sends a request and returns it's body
@param Request $request
@return string | [
"Sends",
"a",
"request",
"and",
"returns",
"it",
"s",
"body"
] | 2233e8329a0704e020857228c2b538438e127475 | https://github.com/indigophp-archive/http-adapter/blob/2233e8329a0704e020857228c2b538438e127475/src/Client.php#L73-L78 |
4,501 | indigophp-archive/http-adapter | src/Client.php | Client.createRequest | public function createRequest($method, $url = null, array $options = [])
{
$protocol_version = '1.1';
$body = null;
$headers = [];
extract($options);
$request = new Message\Request;
$request->setMethod($method);
$request->setUrl($url ? (string) $this->creat... | php | public function createRequest($method, $url = null, array $options = [])
{
$protocol_version = '1.1';
$body = null;
$headers = [];
extract($options);
$request = new Message\Request;
$request->setMethod($method);
$request->setUrl($url ? (string) $this->creat... | [
"public",
"function",
"createRequest",
"(",
"$",
"method",
",",
"$",
"url",
"=",
"null",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"protocol_version",
"=",
"'1.1'",
";",
"$",
"body",
"=",
"null",
";",
"$",
"headers",
"=",
"[",
"]"... | Creates a request
@param string $method
@param string|null $url
@param array $options
@return Request | [
"Creates",
"a",
"request"
] | 2233e8329a0704e020857228c2b538438e127475 | https://github.com/indigophp-archive/http-adapter/blob/2233e8329a0704e020857228c2b538438e127475/src/Client.php#L89-L113 |
4,502 | indigophp-archive/http-adapter | src/Client.php | Client.createUrl | protected function createUrl($url)
{
// is absolute URL?
if (strpos($url, '://')) {
return Url::createFromUrl($url);
}
// only query and path matters in relative url
$url = Url::createFromUrl($url);
$query = $this->baseUrl->getQuery();
$path = $th... | php | protected function createUrl($url)
{
// is absolute URL?
if (strpos($url, '://')) {
return Url::createFromUrl($url);
}
// only query and path matters in relative url
$url = Url::createFromUrl($url);
$query = $this->baseUrl->getQuery();
$path = $th... | [
"protected",
"function",
"createUrl",
"(",
"$",
"url",
")",
"{",
"// is absolute URL?",
"if",
"(",
"strpos",
"(",
"$",
"url",
",",
"'://'",
")",
")",
"{",
"return",
"Url",
"::",
"createFromUrl",
"(",
"$",
"url",
")",
";",
"}",
"// only query and path matte... | Creates a URL using the base URL
@param string|null|Url $url
@return Url | [
"Creates",
"a",
"URL",
"using",
"the",
"base",
"URL"
] | 2233e8329a0704e020857228c2b538438e127475 | https://github.com/indigophp-archive/http-adapter/blob/2233e8329a0704e020857228c2b538438e127475/src/Client.php#L122-L138 |
4,503 | tzlion/neodb | NeoDb.php | NeoDb.subVars | private function subVars($query, $vars = [])
{
if (!is_array($vars)) {
$vars = [$vars];
}
$queryParts = explode( "?", $query );
if ( count( $queryParts ) -1 != count ( $vars ) ) {
throw new \Exception( "Number of variables supplied does not match number of ?s... | php | private function subVars($query, $vars = [])
{
if (!is_array($vars)) {
$vars = [$vars];
}
$queryParts = explode( "?", $query );
if ( count( $queryParts ) -1 != count ( $vars ) ) {
throw new \Exception( "Number of variables supplied does not match number of ?s... | [
"private",
"function",
"subVars",
"(",
"$",
"query",
",",
"$",
"vars",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"vars",
")",
")",
"{",
"$",
"vars",
"=",
"[",
"$",
"vars",
"]",
";",
"}",
"$",
"queryParts",
"=",
"explode",
... | fakey bound parameters | [
"fakey",
"bound",
"parameters"
] | 81bd2f9885ffe447fdfdd7f3b17886932a962e21 | https://github.com/tzlion/neodb/blob/81bd2f9885ffe447fdfdd7f3b17886932a962e21/NeoDb.php#L126-L146 |
4,504 | phlexible/phlexible | src/Phlexible/Bundle/MessageBundle/Entity/Repository/FilterRepository.php | FilterRepository.findApplicableFiltersByMessage | public function findApplicableFiltersByMessage(Message $message, $handler = null)
{
if ($handler) {
$filters = $this->findByHandler($handler);
} else {
$filters = $this->findAll();
}
$applicableFilters = [];
$checker = new MessageChecker();
f... | php | public function findApplicableFiltersByMessage(Message $message, $handler = null)
{
if ($handler) {
$filters = $this->findByHandler($handler);
} else {
$filters = $this->findAll();
}
$applicableFilters = [];
$checker = new MessageChecker();
f... | [
"public",
"function",
"findApplicableFiltersByMessage",
"(",
"Message",
"$",
"message",
",",
"$",
"handler",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"handler",
")",
"{",
"$",
"filters",
"=",
"$",
"this",
"->",
"findByHandler",
"(",
"$",
"handler",
")",
";... | Return all filters applicable for a message.
@param Message $message
@param string $handler
@return Filter[] | [
"Return",
"all",
"filters",
"applicable",
"for",
"a",
"message",
"."
] | 132f24924c9bb0dbb6c1ea84db0a463f97fa3893 | https://github.com/phlexible/phlexible/blob/132f24924c9bb0dbb6c1ea84db0a463f97fa3893/src/Phlexible/Bundle/MessageBundle/Entity/Repository/FilterRepository.php#L55-L75 |
4,505 | clusterpoint/php-client-api | internals/lib_protobuf.inc.php | ProtoBuf_Field.FromBytes | public function FromBytes($stream, $offset) // ret <= 0 - error
{
$moved = 0;
$vi = 0;
$moved += $parsed = ProtoBuf_Bytes2Varint($stream, $offset + $moved, $vi);
if ($parsed <= 0)
return $parsed;
//echo "vi $vi\n";
$this->wt = ($vi & 0x07);
$this->fn = ($vi >> 3);
//echo "field wt " . $this->wt . "... | php | public function FromBytes($stream, $offset) // ret <= 0 - error
{
$moved = 0;
$vi = 0;
$moved += $parsed = ProtoBuf_Bytes2Varint($stream, $offset + $moved, $vi);
if ($parsed <= 0)
return $parsed;
//echo "vi $vi\n";
$this->wt = ($vi & 0x07);
$this->fn = ($vi >> 3);
//echo "field wt " . $this->wt . "... | [
"public",
"function",
"FromBytes",
"(",
"$",
"stream",
",",
"$",
"offset",
")",
"// ret <= 0 - error",
"{",
"$",
"moved",
"=",
"0",
";",
"$",
"vi",
"=",
"0",
";",
"$",
"moved",
"+=",
"$",
"parsed",
"=",
"ProtoBuf_Bytes2Varint",
"(",
"$",
"stream",
",",... | if fixed64 is in fact 32bit value, this is just to improve compatibility with 32bit php, which does not support 64 | [
"if",
"fixed64",
"is",
"in",
"fact",
"32bit",
"value",
"this",
"is",
"just",
"to",
"improve",
"compatibility",
"with",
"32bit",
"php",
"which",
"does",
"not",
"support",
"64"
] | 44c98a727271c91bb9b9a70975ec4f69d99e64e7 | https://github.com/clusterpoint/php-client-api/blob/44c98a727271c91bb9b9a70975ec4f69d99e64e7/internals/lib_protobuf.inc.php#L86-L142 |
4,506 | EmilSjunnesson/rss | src/library/SimplePie.php | SimplePie.set_feed_url | public function set_feed_url($url)
{
$this->multifeed_url = array();
if (is_array($url))
{
foreach ($url as $value)
{
$this->multifeed_url[] = $this->registry->call('Misc', 'fix_protocol', array($value, 1));
}
}
else
{
$this->feed_url = $this->registry->call('Misc', 'fix_protocol', array($u... | php | public function set_feed_url($url)
{
$this->multifeed_url = array();
if (is_array($url))
{
foreach ($url as $value)
{
$this->multifeed_url[] = $this->registry->call('Misc', 'fix_protocol', array($value, 1));
}
}
else
{
$this->feed_url = $this->registry->call('Misc', 'fix_protocol', array($u... | [
"public",
"function",
"set_feed_url",
"(",
"$",
"url",
")",
"{",
"$",
"this",
"->",
"multifeed_url",
"=",
"array",
"(",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"url",
")",
")",
"{",
"foreach",
"(",
"$",
"url",
"as",
"$",
"value",
")",
"{",
"$"... | Set the URL of the feed you want to parse
This allows you to enter the URL of the feed you want to parse, or the
website you want to try to use auto-discovery on. This takes priority
over any set raw data.
You can set multiple feeds to mash together by passing an array instead
of a string for the $url. Remember that ... | [
"Set",
"the",
"URL",
"of",
"the",
"feed",
"you",
"want",
"to",
"parse"
] | 51b75c010ab0acbde18559eb0f5d93fce98cc393 | https://github.com/EmilSjunnesson/rss/blob/51b75c010ab0acbde18559eb0f5d93fce98cc393/src/library/SimplePie.php#L717-L731 |
4,507 | EmilSjunnesson/rss | src/library/SimplePie.php | SimplePie.set_stupidly_fast | public function set_stupidly_fast($set = false)
{
if ($set)
{
$this->enable_order_by_date(false);
$this->remove_div(false);
$this->strip_comments(false);
$this->strip_htmltags(false);
$this->strip_attributes(false);
$this->set_image_handler(false);
}
} | php | public function set_stupidly_fast($set = false)
{
if ($set)
{
$this->enable_order_by_date(false);
$this->remove_div(false);
$this->strip_comments(false);
$this->strip_htmltags(false);
$this->strip_attributes(false);
$this->set_image_handler(false);
}
} | [
"public",
"function",
"set_stupidly_fast",
"(",
"$",
"set",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"set",
")",
"{",
"$",
"this",
"->",
"enable_order_by_date",
"(",
"false",
")",
";",
"$",
"this",
"->",
"remove_div",
"(",
"false",
")",
";",
"$",
"thi... | Set options to make SP as fast as possible
Forgoes a substantial amount of data sanitization in favor of speed. This
turns SimplePie into a dumb parser of feeds.
@param bool $set Whether to set them or not | [
"Set",
"options",
"to",
"make",
"SP",
"as",
"fast",
"as",
"possible"
] | 51b75c010ab0acbde18559eb0f5d93fce98cc393 | https://github.com/EmilSjunnesson/rss/blob/51b75c010ab0acbde18559eb0f5d93fce98cc393/src/library/SimplePie.php#L1066-L1077 |
4,508 | mikeshiyan/lite-sql-insert | src/Iterate/Scenario/BaseInsertTrait.php | BaseInsertTrait.preRun | public function preRun(): void {
$this->insert = $this->getConnection()->insert($this->getTable(), $this->getFields());
} | php | public function preRun(): void {
$this->insert = $this->getConnection()->insert($this->getTable(), $this->getFields());
} | [
"public",
"function",
"preRun",
"(",
")",
":",
"void",
"{",
"$",
"this",
"->",
"insert",
"=",
"$",
"this",
"->",
"getConnection",
"(",
")",
"->",
"insert",
"(",
"$",
"this",
"->",
"getTable",
"(",
")",
",",
"$",
"this",
"->",
"getFields",
"(",
")",... | Prepares a statement and initiates a transaction in the pre-run phase.
@see \Shiyan\Iterate\Scenario\ScenarioInterface::preRun() | [
"Prepares",
"a",
"statement",
"and",
"initiates",
"a",
"transaction",
"in",
"the",
"pre",
"-",
"run",
"phase",
"."
] | c0c26b7976d61ba5a95561363824c03ba31cee3b | https://github.com/mikeshiyan/lite-sql-insert/blob/c0c26b7976d61ba5a95561363824c03ba31cee3b/src/Iterate/Scenario/BaseInsertTrait.php#L127-L129 |
4,509 | praxisnetau/silverware-social | src/Buttons/EmailSharingButton.php | EmailSharingButton.getMessage | public function getMessage()
{
if ($this->EmailMessage) {
return sprintf('%s %s', rtrim($this->EmailMessage), $this->getCurrentPageLink());
}
return $this->getCurrentPageLink();
} | php | public function getMessage()
{
if ($this->EmailMessage) {
return sprintf('%s %s', rtrim($this->EmailMessage), $this->getCurrentPageLink());
}
return $this->getCurrentPageLink();
} | [
"public",
"function",
"getMessage",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"EmailMessage",
")",
"{",
"return",
"sprintf",
"(",
"'%s %s'",
",",
"rtrim",
"(",
"$",
"this",
"->",
"EmailMessage",
")",
",",
"$",
"this",
"->",
"getCurrentPageLink",
"(",
... | Answers the message for the email.
@return string | [
"Answers",
"the",
"message",
"for",
"the",
"email",
"."
] | 99d9092dae674ef0898bbee99386ae356cf6d3c3 | https://github.com/praxisnetau/silverware-social/blob/99d9092dae674ef0898bbee99386ae356cf6d3c3/src/Buttons/EmailSharingButton.php#L190-L197 |
4,510 | praxisnetau/silverware-social | src/Buttons/EmailSharingButton.php | EmailSharingButton.getButtonLink | public function getButtonLink()
{
return sprintf(
'mailto:?subject=%s&body=%s',
Convert::raw2mailto($this->getSubject()),
Convert::raw2mailto($this->getMessage())
);
} | php | public function getButtonLink()
{
return sprintf(
'mailto:?subject=%s&body=%s',
Convert::raw2mailto($this->getSubject()),
Convert::raw2mailto($this->getMessage())
);
} | [
"public",
"function",
"getButtonLink",
"(",
")",
"{",
"return",
"sprintf",
"(",
"'mailto:?subject=%s&body=%s'",
",",
"Convert",
"::",
"raw2mailto",
"(",
"$",
"this",
"->",
"getSubject",
"(",
")",
")",
",",
"Convert",
"::",
"raw2mailto",
"(",
"$",
"this",
"->... | Answers the link for the sharing button.
@return string | [
"Answers",
"the",
"link",
"for",
"the",
"sharing",
"button",
"."
] | 99d9092dae674ef0898bbee99386ae356cf6d3c3 | https://github.com/praxisnetau/silverware-social/blob/99d9092dae674ef0898bbee99386ae356cf6d3c3/src/Buttons/EmailSharingButton.php#L204-L211 |
4,511 | HeroicTeam/m | Foundation/Core.php | Core.bind | public function bind($name, \Closure $callable, $singleton = false)
{
$this->_ioc[$name] = array(
'closure' => $callable,
'singleton' => (bool) $singleton,
'instance' => null
);
return $this;
} | php | public function bind($name, \Closure $callable, $singleton = false)
{
$this->_ioc[$name] = array(
'closure' => $callable,
'singleton' => (bool) $singleton,
'instance' => null
);
return $this;
} | [
"public",
"function",
"bind",
"(",
"$",
"name",
",",
"\\",
"Closure",
"$",
"callable",
",",
"$",
"singleton",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"_ioc",
"[",
"$",
"name",
"]",
"=",
"array",
"(",
"'closure'",
"=>",
"$",
"callable",
",",
"'si... | Registers a new object container.
@param string $name
@param \Closure $callable
@param bool $singleton
@return \m\Foundation\Core | [
"Registers",
"a",
"new",
"object",
"container",
"."
] | daa6d5956ee6c989379fe5fae39feccc59cf4add | https://github.com/HeroicTeam/m/blob/daa6d5956ee6c989379fe5fae39feccc59cf4add/Foundation/Core.php#L51-L60 |
4,512 | HeroicTeam/m | Foundation/Core.php | Core.make | public function make($name, array $params = array(), $force = false)
{
if (isset($this->_ioc[$name])) {
// If a singleton instance exists, return it
if ($this->_ioc[$name]['instance'] && !$force)
return $this->_ioc[$name]['instance'];
// Include an insta... | php | public function make($name, array $params = array(), $force = false)
{
if (isset($this->_ioc[$name])) {
// If a singleton instance exists, return it
if ($this->_ioc[$name]['instance'] && !$force)
return $this->_ioc[$name]['instance'];
// Include an insta... | [
"public",
"function",
"make",
"(",
"$",
"name",
",",
"array",
"$",
"params",
"=",
"array",
"(",
")",
",",
"$",
"force",
"=",
"false",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_ioc",
"[",
"$",
"name",
"]",
")",
")",
"{",
"// If a s... | Resolves a set container and returns the result.
@param string $name
@param array $params
@param bool $force
@return object|null | [
"Resolves",
"a",
"set",
"container",
"and",
"returns",
"the",
"result",
"."
] | daa6d5956ee6c989379fe5fae39feccc59cf4add | https://github.com/HeroicTeam/m/blob/daa6d5956ee6c989379fe5fae39feccc59cf4add/Foundation/Core.php#L82-L104 |
4,513 | HeroicTeam/m | Foundation/Core.php | Core.on | public function on($event, $callable)
{
if (!is_callable($callable) && !$callable instanceof \Closure)
throw new \InvalidArgumentException();
if (!isset($this->_hooks[$event]))
$this->_hooks[$event] = array();
$this->_hooks[$event][] = $callable;
return $th... | php | public function on($event, $callable)
{
if (!is_callable($callable) && !$callable instanceof \Closure)
throw new \InvalidArgumentException();
if (!isset($this->_hooks[$event]))
$this->_hooks[$event] = array();
$this->_hooks[$event][] = $callable;
return $th... | [
"public",
"function",
"on",
"(",
"$",
"event",
",",
"$",
"callable",
")",
"{",
"if",
"(",
"!",
"is_callable",
"(",
"$",
"callable",
")",
"&&",
"!",
"$",
"callable",
"instanceof",
"\\",
"Closure",
")",
"throw",
"new",
"\\",
"InvalidArgumentException",
"("... | Binds a new callable action to a hook event.
@param string $event
@param \Closure|callable $callable
@return \m\Foundation\Core
@throws \InvalidArgumentException | [
"Binds",
"a",
"new",
"callable",
"action",
"to",
"a",
"hook",
"event",
"."
] | daa6d5956ee6c989379fe5fae39feccc59cf4add | https://github.com/HeroicTeam/m/blob/daa6d5956ee6c989379fe5fae39feccc59cf4add/Foundation/Core.php#L149-L160 |
4,514 | twister-php/twister | src/DateTime.php | DateTime.setDateTime | public function setDateTime(...$params)
{
switch (count($params))
{
case 5:
// $second is optional in setTime()
// array_push($params, 0); // I don't think we need this ... array_slice should pass 2 params to setTime()!
// fallthrough
case 6:
return parent::setDate(...array_slice($pa... | php | public function setDateTime(...$params)
{
switch (count($params))
{
case 5:
// $second is optional in setTime()
// array_push($params, 0); // I don't think we need this ... array_slice should pass 2 params to setTime()!
// fallthrough
case 6:
return parent::setDate(...array_slice($pa... | [
"public",
"function",
"setDateTime",
"(",
"...",
"$",
"params",
")",
"{",
"switch",
"(",
"count",
"(",
"$",
"params",
")",
")",
"{",
"case",
"5",
":",
"//\t$second is optional in setTime()\r",
"//\tarray_push($params, 0);\t\t//\tI don't think we need this ... array_slice ... | Set the date and time all together
This function also supports sending a single DateTime string in `YYYY-MM-DD HH:MM:SS` format
@param int|string $year | $datetime string
@param int $month
@param int $day
@param int $hour
@param int $minute
@param int $second = 0
@throws... | [
"Set",
"the",
"date",
"and",
"time",
"all",
"together"
] | c06ea2650331faf11590c017c850dc5f0bbc5c13 | https://github.com/twister-php/twister/blob/c06ea2650331faf11590c017c850dc5f0bbc5c13/src/DateTime.php#L327-L348 |
4,515 | twister-php/twister | src/DateTime.php | DateTime.createInterval | public static function createInterval($interval)
{
return isset(static::$intervals[$interval])
? static::$intervals[$interval]
: static::$intervals[$interval] = $interval[0] === 'P'
? new \DateInterval($interval)
: \DateInterval::createFromDateString($interval);
} | php | public static function createInterval($interval)
{
return isset(static::$intervals[$interval])
? static::$intervals[$interval]
: static::$intervals[$interval] = $interval[0] === 'P'
? new \DateInterval($interval)
: \DateInterval::createFromDateString($interval);
} | [
"public",
"static",
"function",
"createInterval",
"(",
"$",
"interval",
")",
"{",
"return",
"isset",
"(",
"static",
"::",
"$",
"intervals",
"[",
"$",
"interval",
"]",
")",
"?",
"static",
"::",
"$",
"intervals",
"[",
"$",
"interval",
"]",
":",
"static",
... | Create a DateInterval from ISO 8601 duration string OR relative parts!
This method does a small test on the $interval string for `[0] === 'P'`
@link http://php.net/manual/en/dateinterval.construct.php
@link http://php.net/manual/en/dateinterval.createfromdatestring.php
@link http://php.net/manual/en/datetime.formats.... | [
"Create",
"a",
"DateInterval",
"from",
"ISO",
"8601",
"duration",
"string",
"OR",
"relative",
"parts!"
] | c06ea2650331faf11590c017c850dc5f0bbc5c13 | https://github.com/twister-php/twister/blob/c06ea2650331faf11590c017c850dc5f0bbc5c13/src/DateTime.php#L387-L394 |
4,516 | twister-php/twister | src/DateTime.php | DateTime.createIntervalFromSpec | public static function createIntervalFromSpec($interval_spec)
{
return isset(static::$intervals[$interval_spec])
? static::$intervals[$interval_spec]
: static::$intervals[$interval_spec] = new \DateInterval($interval_spec);
} | php | public static function createIntervalFromSpec($interval_spec)
{
return isset(static::$intervals[$interval_spec])
? static::$intervals[$interval_spec]
: static::$intervals[$interval_spec] = new \DateInterval($interval_spec);
} | [
"public",
"static",
"function",
"createIntervalFromSpec",
"(",
"$",
"interval_spec",
")",
"{",
"return",
"isset",
"(",
"static",
"::",
"$",
"intervals",
"[",
"$",
"interval_spec",
"]",
")",
"?",
"static",
"::",
"$",
"intervals",
"[",
"$",
"interval_spec",
"]... | Create a DateInterval from ISO 8601 duration string
@link http://php.net/manual/en/dateinterval.construct.php
@return DateInterval | [
"Create",
"a",
"DateInterval",
"from",
"ISO",
"8601",
"duration",
"string"
] | c06ea2650331faf11590c017c850dc5f0bbc5c13 | https://github.com/twister-php/twister/blob/c06ea2650331faf11590c017c850dc5f0bbc5c13/src/DateTime.php#L404-L409 |
4,517 | twister-php/twister | src/DateTime.php | DateTime.createIntervalFromDateString | public static function createIntervalFromDateString($time)
{
return isset(static::$intervals[$time])
? static::$intervals[$time]
: static::$intervals[$time] = \DateInterval::createFromDateString($time);
} | php | public static function createIntervalFromDateString($time)
{
return isset(static::$intervals[$time])
? static::$intervals[$time]
: static::$intervals[$time] = \DateInterval::createFromDateString($time);
} | [
"public",
"static",
"function",
"createIntervalFromDateString",
"(",
"$",
"time",
")",
"{",
"return",
"isset",
"(",
"static",
"::",
"$",
"intervals",
"[",
"$",
"time",
"]",
")",
"?",
"static",
"::",
"$",
"intervals",
"[",
"$",
"time",
"]",
":",
"static",... | Create a DateInterval from a string of relative parts
`Uses the normal date parsers and sets up a DateInterval from the relative parts of the parsed string.`
@link http://php.net/manual/en/dateinterval.createfromdatestring.php
@link http://php.net/manual/en/datetime.formats.relative.php
The difference between `DateI... | [
"Create",
"a",
"DateInterval",
"from",
"a",
"string",
"of",
"relative",
"parts"
] | c06ea2650331faf11590c017c850dc5f0bbc5c13 | https://github.com/twister-php/twister/blob/c06ea2650331faf11590c017c850dc5f0bbc5c13/src/DateTime.php#L426-L431 |
4,518 | twister-php/twister | src/DateTime.php | DateTime.create | public static function create(...$params)
{
switch (count($params))
{
case 1: // '2017-01-01'
case 2: // '2017-01-01', $tz
case 3: // $year, $month, $day
case 4: // $year, $month, $day, $tz
case 5: // $year, $month, $day, $hour, $minute // not useful
case 6: // $year, $month, $day,... | php | public static function create(...$params)
{
switch (count($params))
{
case 1: // '2017-01-01'
case 2: // '2017-01-01', $tz
case 3: // $year, $month, $day
case 4: // $year, $month, $day, $tz
case 5: // $year, $month, $day, $hour, $minute // not useful
case 6: // $year, $month, $day,... | [
"public",
"static",
"function",
"create",
"(",
"...",
"$",
"params",
")",
"{",
"switch",
"(",
"count",
"(",
"$",
"params",
")",
")",
"{",
"case",
"1",
":",
"//\t'2017-01-01'\r",
"case",
"2",
":",
"//\t'2017-01-01', $tz\r",
"case",
"3",
":",
"//\t$year, $mo... | Create a new Twister\DateTime instance from a specific date and time.
If any of $year, $month or $day are set to null their now() values will be used.
If $hour is null it will be set to its now() value and the default
values for $minute and $second will be their now() values.
If $hour is not null then the default v... | [
"Create",
"a",
"new",
"Twister",
"\\",
"DateTime",
"instance",
"from",
"a",
"specific",
"date",
"and",
"time",
"."
] | c06ea2650331faf11590c017c850dc5f0bbc5c13 | https://github.com/twister-php/twister/blob/c06ea2650331faf11590c017c850dc5f0bbc5c13/src/DateTime.php#L576-L590 |
4,519 | twister-php/twister | src/DateTime.php | DateTime.__parse | public static function __parse($date, &$result = null) // WARNING I don't think I need this ...
{
$result = date_parse($date);
if ($result['warning_count'] === 0 && $result['error_count'] === 0) // halt, I think there is a faster way to build the DateTime ... just parse it here, check for errors ... ... | php | public static function __parse($date, &$result = null) // WARNING I don't think I need this ...
{
$result = date_parse($date);
if ($result['warning_count'] === 0 && $result['error_count'] === 0) // halt, I think there is a faster way to build the DateTime ... just parse it here, check for errors ... ... | [
"public",
"static",
"function",
"__parse",
"(",
"$",
"date",
",",
"&",
"$",
"result",
"=",
"null",
")",
"//\tWARNING I don't think I need this ...\r",
"{",
"$",
"result",
"=",
"date_parse",
"(",
"$",
"date",
")",
";",
"if",
"(",
"$",
"result",
"[",
"'warn... | Wrapper around date_parse
@link http://php.net/manual/en/function.date-parse.php
@param mixed $str Value to modify, after being cast to string
@param string $encoding The character encoding
@throws \InvalidArgumentException if an array or object without a
__toString method is passed as the first argument
@... | [
"Wrapper",
"around",
"date_parse"
] | c06ea2650331faf11590c017c850dc5f0bbc5c13 | https://github.com/twister-php/twister/blob/c06ea2650331faf11590c017c850dc5f0bbc5c13/src/DateTime.php#L607-L645 |
4,520 | twister-php/twister | src/DateTime.php | DateTime.md5 | public function md5($format = null, $raw_output = false)
{
return hash('md5', parent::format($format === null ? static::$format : $format), $raw_output);
} | php | public function md5($format = null, $raw_output = false)
{
return hash('md5', parent::format($format === null ? static::$format : $format), $raw_output);
} | [
"public",
"function",
"md5",
"(",
"$",
"format",
"=",
"null",
",",
"$",
"raw_output",
"=",
"false",
")",
"{",
"return",
"hash",
"(",
"'md5'",
",",
"parent",
"::",
"format",
"(",
"$",
"format",
"===",
"null",
"?",
"static",
"::",
"$",
"format",
":",
... | Gets an MD5 hash code of the internal date. Return result can be raw binary or hex by default
@param bool|null $raw_output return the raw binary bytes or hex values of the md5 hash
@return string | [
"Gets",
"an",
"MD5",
"hash",
"code",
"of",
"the",
"internal",
"date",
".",
"Return",
"result",
"can",
"be",
"raw",
"binary",
"or",
"hex",
"by",
"default"
] | c06ea2650331faf11590c017c850dc5f0bbc5c13 | https://github.com/twister-php/twister/blob/c06ea2650331faf11590c017c850dc5f0bbc5c13/src/DateTime.php#L948-L951 |
4,521 | twister-php/twister | src/DateTime.php | DateTime.sha256 | public function sha256($format = null, $raw_output = false)
{
return hash('sha256', parent::format($format === null ? static::$format : $format), $raw_output);
} | php | public function sha256($format = null, $raw_output = false)
{
return hash('sha256', parent::format($format === null ? static::$format : $format), $raw_output);
} | [
"public",
"function",
"sha256",
"(",
"$",
"format",
"=",
"null",
",",
"$",
"raw_output",
"=",
"false",
")",
"{",
"return",
"hash",
"(",
"'sha256'",
",",
"parent",
"::",
"format",
"(",
"$",
"format",
"===",
"null",
"?",
"static",
"::",
"$",
"format",
... | Gets a SHA-256 hash code of the internal string. Return result can be raw binary or hex by default
@param bool|null $raw_output return the raw binary bytes or hex values of the SHA-256 hash
@return string | [
"Gets",
"a",
"SHA",
"-",
"256",
"hash",
"code",
"of",
"the",
"internal",
"string",
".",
"Return",
"result",
"can",
"be",
"raw",
"binary",
"or",
"hex",
"by",
"default"
] | c06ea2650331faf11590c017c850dc5f0bbc5c13 | https://github.com/twister-php/twister/blob/c06ea2650331faf11590c017c850dc5f0bbc5c13/src/DateTime.php#L1127-L1130 |
4,522 | twister-php/twister | src/DateTime.php | DateTime.sha384 | public function sha384($format = null, $raw_output = false)
{
return hash('sha384', parent::format($format === null ? static::$format : $format), $raw_output);
} | php | public function sha384($format = null, $raw_output = false)
{
return hash('sha384', parent::format($format === null ? static::$format : $format), $raw_output);
} | [
"public",
"function",
"sha384",
"(",
"$",
"format",
"=",
"null",
",",
"$",
"raw_output",
"=",
"false",
")",
"{",
"return",
"hash",
"(",
"'sha384'",
",",
"parent",
"::",
"format",
"(",
"$",
"format",
"===",
"null",
"?",
"static",
"::",
"$",
"format",
... | Gets a SHA-384 hash code of the internal string. Return result can be raw binary or hex by default
@param bool|null $raw_output return the raw binary bytes or hex values of the SHA-384 hash
@return string | [
"Gets",
"a",
"SHA",
"-",
"384",
"hash",
"code",
"of",
"the",
"internal",
"string",
".",
"Return",
"result",
"can",
"be",
"raw",
"binary",
"or",
"hex",
"by",
"default"
] | c06ea2650331faf11590c017c850dc5f0bbc5c13 | https://github.com/twister-php/twister/blob/c06ea2650331faf11590c017c850dc5f0bbc5c13/src/DateTime.php#L1138-L1141 |
4,523 | twister-php/twister | src/DateTime.php | DateTime.sha512 | public function sha512($format = null, $raw_output = false)
{
return hash('sha512', parent::format($format === null ? static::$format : $format), $raw_output);
} | php | public function sha512($format = null, $raw_output = false)
{
return hash('sha512', parent::format($format === null ? static::$format : $format), $raw_output);
} | [
"public",
"function",
"sha512",
"(",
"$",
"format",
"=",
"null",
",",
"$",
"raw_output",
"=",
"false",
")",
"{",
"return",
"hash",
"(",
"'sha512'",
",",
"parent",
"::",
"format",
"(",
"$",
"format",
"===",
"null",
"?",
"static",
"::",
"$",
"format",
... | Gets a SHA-512 hash code of the internal string. Return result can be raw binary or hex by default
@param bool|null $raw_output return the raw binary bytes or hex values of the SHA-512 hash
@return string | [
"Gets",
"a",
"SHA",
"-",
"512",
"hash",
"code",
"of",
"the",
"internal",
"string",
".",
"Return",
"result",
"can",
"be",
"raw",
"binary",
"or",
"hex",
"by",
"default"
] | c06ea2650331faf11590c017c850dc5f0bbc5c13 | https://github.com/twister-php/twister/blob/c06ea2650331faf11590c017c850dc5f0bbc5c13/src/DateTime.php#L1149-L1152 |
4,524 | arnold-almeida/UIKit | src/Almeida/UIKit/Collections/Actions/AbstractActions.php | AbstractActions.map | public static function map($actions=array(), $options=array())
{
if (empty($actions)) {
return null;
}
$out = array();
$count = 0;
$len = count($actions);
foreach ($actions as $label => $mixed) {
$count++;
$action = new Item... | php | public static function map($actions=array(), $options=array())
{
if (empty($actions)) {
return null;
}
$out = array();
$count = 0;
$len = count($actions);
foreach ($actions as $label => $mixed) {
$count++;
$action = new Item... | [
"public",
"static",
"function",
"map",
"(",
"$",
"actions",
"=",
"array",
"(",
")",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"actions",
")",
")",
"{",
"return",
"null",
";",
"}",
"$",
"out",
"=",
"arr... | Get actions mapped
Preserve structure
@param array $actions [description]
@param array $options [description]
@return [type] [description] | [
"Get",
"actions",
"mapped",
"Preserve",
"structure"
] | cc52f46df011ec2f3676245c90c376da20c40e41 | https://github.com/arnold-almeida/UIKit/blob/cc52f46df011ec2f3676245c90c376da20c40e41/src/Almeida/UIKit/Collections/Actions/AbstractActions.php#L71-L100 |
4,525 | orbt/ResourceMirror | ResourceMirror.php | ResourceMirror.getReplicator | public function getReplicator()
{
if (!isset($this->replicator)) {
$this->replicator = $this->createReplicator();
}
return $this->replicator;
} | php | public function getReplicator()
{
if (!isset($this->replicator)) {
$this->replicator = $this->createReplicator();
}
return $this->replicator;
} | [
"public",
"function",
"getReplicator",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"replicator",
")",
")",
"{",
"$",
"this",
"->",
"replicator",
"=",
"$",
"this",
"->",
"createReplicator",
"(",
")",
";",
"}",
"return",
"$",
"this"... | Returns the replicator used.
@return Resource\Replicator | [
"Returns",
"the",
"replicator",
"used",
"."
] | 562a847c6b4a1879adec2b61cdcf8ed359a05443 | https://github.com/orbt/ResourceMirror/blob/562a847c6b4a1879adec2b61cdcf8ed359a05443/ResourceMirror.php#L99-L105 |
4,526 | orbt/ResourceMirror | ResourceMirror.php | ResourceMirror.materializeCollection | public function materializeCollection($collection)
{
$materializedCollection = new Collection();
foreach ($collection as $resource) {
$materializedCollection->add($this->materialize($resource));
}
return $materializedCollection;
} | php | public function materializeCollection($collection)
{
$materializedCollection = new Collection();
foreach ($collection as $resource) {
$materializedCollection->add($this->materialize($resource));
}
return $materializedCollection;
} | [
"public",
"function",
"materializeCollection",
"(",
"$",
"collection",
")",
"{",
"$",
"materializedCollection",
"=",
"new",
"Collection",
"(",
")",
";",
"foreach",
"(",
"$",
"collection",
"as",
"$",
"resource",
")",
"{",
"$",
"materializedCollection",
"->",
"a... | Materializes a collection of resources.
@param Collection $collection
Resource collection to materialize.
@return Collection
A collection of materialized resources. | [
"Materializes",
"a",
"collection",
"of",
"resources",
"."
] | 562a847c6b4a1879adec2b61cdcf8ed359a05443 | https://github.com/orbt/ResourceMirror/blob/562a847c6b4a1879adec2b61cdcf8ed359a05443/ResourceMirror.php#L123-L130 |
4,527 | orbt/ResourceMirror | ResourceMirror.php | ResourceMirror.materialize | public function materialize($resource, $overwrite = false)
{
if ($resource instanceof MaterializedResource) {
return $resource;
}
if ($overwrite || !$this->exists($resource)) {
try {
$this->getReplicator()->replicate($resource);
}
... | php | public function materialize($resource, $overwrite = false)
{
if ($resource instanceof MaterializedResource) {
return $resource;
}
if ($overwrite || !$this->exists($resource)) {
try {
$this->getReplicator()->replicate($resource);
}
... | [
"public",
"function",
"materialize",
"(",
"$",
"resource",
",",
"$",
"overwrite",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"resource",
"instanceof",
"MaterializedResource",
")",
"{",
"return",
"$",
"resource",
";",
"}",
"if",
"(",
"$",
"overwrite",
"||",
... | Materializes a resource.
@param Resource\Resource $resource
Resource to materialize.
@param bool $overwrite
Whether to overwrite a resource if it already exists.
@return Resource\MaterializedResource
Materialized resource container, or the given resource if already materialized.
@throws MaterializeException
If the re... | [
"Materializes",
"a",
"resource",
"."
] | 562a847c6b4a1879adec2b61cdcf8ed359a05443 | https://github.com/orbt/ResourceMirror/blob/562a847c6b4a1879adec2b61cdcf8ed359a05443/ResourceMirror.php#L145-L167 |
4,528 | orbt/ResourceMirror | ResourceMirror.php | ResourceMirror.store | public function store($resource)
{
if (!$resource instanceof LocalResource) {
throw new \InvalidArgumentException('Resource is not local.');
}
$file = $this->directory.'/'.$resource->getPath();
@mkdir(dirname($file), 0777, true);
file_put_contents($file, $resourc... | php | public function store($resource)
{
if (!$resource instanceof LocalResource) {
throw new \InvalidArgumentException('Resource is not local.');
}
$file = $this->directory.'/'.$resource->getPath();
@mkdir(dirname($file), 0777, true);
file_put_contents($file, $resourc... | [
"public",
"function",
"store",
"(",
"$",
"resource",
")",
"{",
"if",
"(",
"!",
"$",
"resource",
"instanceof",
"LocalResource",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Resource is not local.'",
")",
";",
"}",
"$",
"file",
"=",
"$",
... | Stores a local resource. Existing files are overwritten.
@param LocalResource $resource
@return MaterializedResource
@throws \InvalidArgumentException
If given resource is not local. | [
"Stores",
"a",
"local",
"resource",
".",
"Existing",
"files",
"are",
"overwritten",
"."
] | 562a847c6b4a1879adec2b61cdcf8ed359a05443 | https://github.com/orbt/ResourceMirror/blob/562a847c6b4a1879adec2b61cdcf8ed359a05443/ResourceMirror.php#L178-L188 |
4,529 | skeeks-cms/cms-rp-view-widget | src/RpViewWidget.php | RpViewWidget.getCallableData | public function getCallableData()
{
$result = parent::getCallableData();
$data = $this->model->toArray();
$data['class'] = $this->model->className();
$result['object'] = $data;
return $result;
} | php | public function getCallableData()
{
$result = parent::getCallableData();
$data = $this->model->toArray();
$data['class'] = $this->model->className();
$result['object'] = $data;
return $result;
} | [
"public",
"function",
"getCallableData",
"(",
")",
"{",
"$",
"result",
"=",
"parent",
"::",
"getCallableData",
"(",
")",
";",
"$",
"data",
"=",
"$",
"this",
"->",
"model",
"->",
"toArray",
"(",
")",
";",
"$",
"data",
"[",
"'class'",
"]",
"=",
"$",
... | Admin edit widget data
@return array | [
"Admin",
"edit",
"widget",
"data"
] | 463bae22f677f69753d3d742876388bcff2e85ad | https://github.com/skeeks-cms/cms-rp-view-widget/blob/463bae22f677f69753d3d742876388bcff2e85ad/src/RpViewWidget.php#L113-L121 |
4,530 | skeeks-cms/cms-rp-view-widget | src/RpViewWidget.php | RpViewWidget.getRpAttributes | public function getRpAttributes()
{
$result = [];
$rpm = $this->model->relatedPropertiesModel;
if ($attributes = $this->visibleRpAttributes)
{
foreach ($attributes as $attribute)
{
if (!$this->visible_only_has_values)
{
... | php | public function getRpAttributes()
{
$result = [];
$rpm = $this->model->relatedPropertiesModel;
if ($attributes = $this->visibleRpAttributes)
{
foreach ($attributes as $attribute)
{
if (!$this->visible_only_has_values)
{
... | [
"public",
"function",
"getRpAttributes",
"(",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"$",
"rpm",
"=",
"$",
"this",
"->",
"model",
"->",
"relatedPropertiesModel",
";",
"if",
"(",
"$",
"attributes",
"=",
"$",
"this",
"->",
"visibleRpAttributes",
")",... | Smart visible code => value
@return array | [
"Smart",
"visible",
"code",
"=",
">",
"value"
] | 463bae22f677f69753d3d742876388bcff2e85ad | https://github.com/skeeks-cms/cms-rp-view-widget/blob/463bae22f677f69753d3d742876388bcff2e85ad/src/RpViewWidget.php#L171-L196 |
4,531 | skeeks-cms/cms-rp-view-widget | src/RpViewWidget.php | RpViewWidget.getVisibleRpAttributes | public function getVisibleRpAttributes()
{
if ($this->visible_properties)
{
return (array) $this->visible_properties;
} else
{
$this->model->relatedPropertiesModel->initAllProperties();
$attributes = $this->model->relatedPropertiesModel->toArray();... | php | public function getVisibleRpAttributes()
{
if ($this->visible_properties)
{
return (array) $this->visible_properties;
} else
{
$this->model->relatedPropertiesModel->initAllProperties();
$attributes = $this->model->relatedPropertiesModel->toArray();... | [
"public",
"function",
"getVisibleRpAttributes",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"visible_properties",
")",
"{",
"return",
"(",
"array",
")",
"$",
"this",
"->",
"visible_properties",
";",
"}",
"else",
"{",
"$",
"this",
"->",
"model",
"->",
"r... | Only visible codes
@return array | [
"Only",
"visible",
"codes"
] | 463bae22f677f69753d3d742876388bcff2e85ad | https://github.com/skeeks-cms/cms-rp-view-widget/blob/463bae22f677f69753d3d742876388bcff2e85ad/src/RpViewWidget.php#L203-L220 |
4,532 | digipolisgent/openbib-id-api | src/Value/UserActivities/LoanCollection.php | LoanCollection.fromXml | public static function fromXml(\DOMNodeList $xml)
{
$items = array();
foreach ($xml as $xmlTag) {
$items[] = Loan::fromXml($xmlTag);
}
return new static($items);
} | php | public static function fromXml(\DOMNodeList $xml)
{
$items = array();
foreach ($xml as $xmlTag) {
$items[] = Loan::fromXml($xmlTag);
}
return new static($items);
} | [
"public",
"static",
"function",
"fromXml",
"(",
"\\",
"DOMNodeList",
"$",
"xml",
")",
"{",
"$",
"items",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"xml",
"as",
"$",
"xmlTag",
")",
"{",
"$",
"items",
"[",
"]",
"=",
"Loan",
"::",
"fromXml",
... | Builds a LoanCollection object from XML.
@param \DOMNodeList $xml
The list of xml tags representing the loans.
@return LoanCollection
A LoanCollection object. | [
"Builds",
"a",
"LoanCollection",
"object",
"from",
"XML",
"."
] | 79f58dec53a91f44333d10fa4ef79f85f31fc2de | https://github.com/digipolisgent/openbib-id-api/blob/79f58dec53a91f44333d10fa4ef79f85f31fc2de/src/Value/UserActivities/LoanCollection.php#L18-L25 |
4,533 | xloit/xloit-std | src/StringUtils.php | StringUtils.title | public static function title($value, $encoding = null)
{
$options = [];
$encoding = $encoding ?: static::$encoding;
if ($encoding) {
$options['encoding'] = $encoding;
}
return StaticFilter::execute(
static::camelCaseToUnderscore($value), Filter\Uppe... | php | public static function title($value, $encoding = null)
{
$options = [];
$encoding = $encoding ?: static::$encoding;
if ($encoding) {
$options['encoding'] = $encoding;
}
return StaticFilter::execute(
static::camelCaseToUnderscore($value), Filter\Uppe... | [
"public",
"static",
"function",
"title",
"(",
"$",
"value",
",",
"$",
"encoding",
"=",
"null",
")",
"{",
"$",
"options",
"=",
"[",
"]",
";",
"$",
"encoding",
"=",
"$",
"encoding",
"?",
":",
"static",
"::",
"$",
"encoding",
";",
"if",
"(",
"$",
"e... | Convert the given string to title case.
@param string $value
@param string $encoding
@return string
@throws \Zend\Filter\Exception\ExceptionInterface | [
"Convert",
"the",
"given",
"string",
"to",
"title",
"case",
"."
] | 917ca269198975527caf50c2c976755ec426431e | https://github.com/xloit/xloit-std/blob/917ca269198975527caf50c2c976755ec426431e/src/StringUtils.php#L104-L116 |
4,534 | xloit/xloit-std | src/StringUtils.php | StringUtils.slug | public static function slug($string, $separator = '-', array $options = [])
{
if (!static::$slugify instanceof Slugify) {
static::$slugify = Slugify::create($options);
}
return mb_strtolower(static::$slugify->slugify($string, $separator));
} | php | public static function slug($string, $separator = '-', array $options = [])
{
if (!static::$slugify instanceof Slugify) {
static::$slugify = Slugify::create($options);
}
return mb_strtolower(static::$slugify->slugify($string, $separator));
} | [
"public",
"static",
"function",
"slug",
"(",
"$",
"string",
",",
"$",
"separator",
"=",
"'-'",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"static",
"::",
"$",
"slugify",
"instanceof",
"Slugify",
")",
"{",
"static",
"::",
... | Creates url friendly string.
@param string $string The input string.
@param string $separator The separator string.
@param array $options
@return string | [
"Creates",
"url",
"friendly",
"string",
"."
] | 917ca269198975527caf50c2c976755ec426431e | https://github.com/xloit/xloit-std/blob/917ca269198975527caf50c2c976755ec426431e/src/StringUtils.php#L127-L134 |
4,535 | xloit/xloit-std | src/StringUtils.php | StringUtils.alternator | public static function alternator(array $strings)
{
return function() use ($strings) {
static $i = 0;
$index = $i++ % count($strings);
return $strings[$index];
};
} | php | public static function alternator(array $strings)
{
return function() use ($strings) {
static $i = 0;
$index = $i++ % count($strings);
return $strings[$index];
};
} | [
"public",
"static",
"function",
"alternator",
"(",
"array",
"$",
"strings",
")",
"{",
"return",
"function",
"(",
")",
"use",
"(",
"$",
"strings",
")",
"{",
"static",
"$",
"i",
"=",
"0",
";",
"$",
"index",
"=",
"$",
"i",
"++",
"%",
"count",
"(",
"... | Returns a closure that will alternate between the defined strings.
@param array $strings Array of strings to alternate between.
@return Closure | [
"Returns",
"a",
"closure",
"that",
"will",
"alternate",
"between",
"the",
"defined",
"strings",
"."
] | 917ca269198975527caf50c2c976755ec426431e | https://github.com/xloit/xloit-std/blob/917ca269198975527caf50c2c976755ec426431e/src/StringUtils.php#L221-L229 |
4,536 | xloit/xloit-std | src/StringUtils.php | StringUtils.getRandomBytes | public static function getRandomBytes($byteLength)
{
$results = null;
if (function_exists('openssl_random_pseudo_bytes')) {
/** @noinspection CryptographicallySecureRandomnessInspection */
$results = openssl_random_pseudo_bytes($byteLength);
} elseif (is_readable('/d... | php | public static function getRandomBytes($byteLength)
{
$results = null;
if (function_exists('openssl_random_pseudo_bytes')) {
/** @noinspection CryptographicallySecureRandomnessInspection */
$results = openssl_random_pseudo_bytes($byteLength);
} elseif (is_readable('/d... | [
"public",
"static",
"function",
"getRandomBytes",
"(",
"$",
"byteLength",
")",
"{",
"$",
"results",
"=",
"null",
";",
"if",
"(",
"function_exists",
"(",
"'openssl_random_pseudo_bytes'",
")",
")",
"{",
"/** @noinspection CryptographicallySecureRandomnessInspection */",
"... | Returns X random raw binary bytes.
@param int $byteLength
@return string
@throws \Xloit\Std\Exception\RuntimeException | [
"Returns",
"X",
"random",
"raw",
"binary",
"bytes",
"."
] | 917ca269198975527caf50c2c976755ec426431e | https://github.com/xloit/xloit-std/blob/917ca269198975527caf50c2c976755ec426431e/src/StringUtils.php#L500-L544 |
4,537 | unyx/utils | platform/Php.php | Php.hasFlag | public static function hasFlag(string $flag) : bool
{
// Standardize the flag name - remove starting hyphens.
$flag = ltrim($flag, '-');
// Return the check right away if it's already cached.
if (isset(static::$flags[$flag])) {
return static::$flags[$flag];
}
... | php | public static function hasFlag(string $flag) : bool
{
// Standardize the flag name - remove starting hyphens.
$flag = ltrim($flag, '-');
// Return the check right away if it's already cached.
if (isset(static::$flags[$flag])) {
return static::$flags[$flag];
}
... | [
"public",
"static",
"function",
"hasFlag",
"(",
"string",
"$",
"flag",
")",
":",
"bool",
"{",
"// Standardize the flag name - remove starting hyphens.",
"$",
"flag",
"=",
"ltrim",
"(",
"$",
"flag",
",",
"'-'",
")",
";",
"// Return the check right away if it's already ... | Checks whether PHP has been compiled with the given flag.
@param string $flag The name of the flag to check. The two initial hyphens can be omitted.
@return bool True when PHP has been compiled with the given flag, false otherwise. | [
"Checks",
"whether",
"PHP",
"has",
"been",
"compiled",
"with",
"the",
"given",
"flag",
"."
] | 503a3dd46fd2216024ab771b6e830be16d36b358 | https://github.com/unyx/utils/blob/503a3dd46fd2216024ab771b6e830be16d36b358/platform/Php.php#L42-L59 |
4,538 | eosnewmedia/external-layout | src/Finisher/WorkingTagFinisher.php | WorkingTagFinisher.finish | public function finish(string $document, LayoutInterface $layout): string
{
return str_replace(
[
'<' . ManipulatorInterface::WORKING_TAG . '>',
'</' . ManipulatorInterface::WORKING_TAG . '>'
],
'',
$document
);
} | php | public function finish(string $document, LayoutInterface $layout): string
{
return str_replace(
[
'<' . ManipulatorInterface::WORKING_TAG . '>',
'</' . ManipulatorInterface::WORKING_TAG . '>'
],
'',
$document
);
} | [
"public",
"function",
"finish",
"(",
"string",
"$",
"document",
",",
"LayoutInterface",
"$",
"layout",
")",
":",
"string",
"{",
"return",
"str_replace",
"(",
"[",
"'<'",
".",
"ManipulatorInterface",
"::",
"WORKING_TAG",
".",
"'>'",
",",
"'</'",
".",
"Manipul... | Finish the plain text layout document
@param string $document
@param LayoutInterface $layout
@return string | [
"Finish",
"the",
"plain",
"text",
"layout",
"document"
] | 1c7771127ea24f3b7f33026c7d7dc6d8537c61cd | https://github.com/eosnewmedia/external-layout/blob/1c7771127ea24f3b7f33026c7d7dc6d8537c61cd/src/Finisher/WorkingTagFinisher.php#L21-L31 |
4,539 | antwebes/ChateaClientLib | src/Ant/ChateaClient/Service/Client/ChateaGratisAppClient.php | ChateaGratisAppClient.factory | public static function factory($config = array()){
// Provide a hash of default client configuration options
$default = array(
'Accept'=>'application/json',
'environment'=>'prod',
'service-description-name' => Client::NAME_SERVICE_API,
'store' => new FileS... | php | public static function factory($config = array()){
// Provide a hash of default client configuration options
$default = array(
'Accept'=>'application/json',
'environment'=>'prod',
'service-description-name' => Client::NAME_SERVICE_API,
'store' => new FileS... | [
"public",
"static",
"function",
"factory",
"(",
"$",
"config",
"=",
"array",
"(",
")",
")",
"{",
"// Provide a hash of default client configuration options",
"$",
"default",
"=",
"array",
"(",
"'Accept'",
"=>",
"'application/json'",
",",
"'environment'",
"=>",
"'pro... | Build new class ChateaOAuth2Client, this provides commands to run at ApiChateaServer
This client can get self credentials, and save in store. This version do not encrypted credentials.
@param array $config Associative array can configure the client. The parameters are:
client_id The public key of client. This parame... | [
"Build",
"new",
"class",
"ChateaOAuth2Client",
"this",
"provides",
"commands",
"to",
"run",
"at",
"ApiChateaServer",
"This",
"client",
"can",
"get",
"self",
"credentials",
"and",
"save",
"in",
"store",
".",
"This",
"version",
"do",
"not",
"encrypted",
"credentia... | b08b207886f4a9f79a0719e8c7b20e79a1b1732d | https://github.com/antwebes/ChateaClientLib/blob/b08b207886f4a9f79a0719e8c7b20e79a1b1732d/src/Ant/ChateaClient/Service/Client/ChateaGratisAppClient.php#L69-L101 |
4,540 | antwebes/ChateaClientLib | src/Ant/ChateaClient/Service/Client/ChateaGratisAppClient.php | ChateaGratisAppClient.prepareAccessToken | private function prepareAccessToken()
{
// if not exits data in the store
if(!$this->store->getPersistentData('token_expires_at')){
return $this->getAccessTokenWithClientCredentials();
// if access token expires.
}else if($this->store->getPersistentData('token_expires_at... | php | private function prepareAccessToken()
{
// if not exits data in the store
if(!$this->store->getPersistentData('token_expires_at')){
return $this->getAccessTokenWithClientCredentials();
// if access token expires.
}else if($this->store->getPersistentData('token_expires_at... | [
"private",
"function",
"prepareAccessToken",
"(",
")",
"{",
"// if not exits data in the store",
"if",
"(",
"!",
"$",
"this",
"->",
"store",
"->",
"getPersistentData",
"(",
"'token_expires_at'",
")",
")",
"{",
"return",
"$",
"this",
"->",
"getAccessTokenWithClientCr... | This retrieve the access token in store or in server
@return string the access token | [
"This",
"retrieve",
"the",
"access",
"token",
"in",
"store",
"or",
"in",
"server"
] | b08b207886f4a9f79a0719e8c7b20e79a1b1732d | https://github.com/antwebes/ChateaClientLib/blob/b08b207886f4a9f79a0719e8c7b20e79a1b1732d/src/Ant/ChateaClient/Service/Client/ChateaGratisAppClient.php#L134-L149 |
4,541 | finwo/php-datafile | src/DataFile.php | DataFile.init | public static function init()
{
// Initialize format drivers
foreach (glob(implode(DIRECTORY_SEPARATOR, array(__DIR__,'Format','*.php'))) as $filename) {
$filename = explode(DIRECTORY_SEPARATOR, $filename);
$filename = explode('.',array_pop($filename));
array_po... | php | public static function init()
{
// Initialize format drivers
foreach (glob(implode(DIRECTORY_SEPARATOR, array(__DIR__,'Format','*.php'))) as $filename) {
$filename = explode(DIRECTORY_SEPARATOR, $filename);
$filename = explode('.',array_pop($filename));
array_po... | [
"public",
"static",
"function",
"init",
"(",
")",
"{",
"// Initialize format drivers",
"foreach",
"(",
"glob",
"(",
"implode",
"(",
"DIRECTORY_SEPARATOR",
",",
"array",
"(",
"__DIR__",
",",
"'Format'",
",",
"'*.php'",
")",
")",
")",
"as",
"$",
"filename",
")... | Initialize all direct-access variables
This gets called as soon as this file is loaded | [
"Initialize",
"all",
"direct",
"-",
"access",
"variables",
"This",
"gets",
"called",
"as",
"soon",
"as",
"this",
"file",
"is",
"loaded"
] | 8333d1cc79cb5f40b0c382b33fe7dd27c68a9520 | https://github.com/finwo/php-datafile/blob/8333d1cc79cb5f40b0c382b33fe7dd27c68a9520/src/DataFile.php#L82-L122 |
4,542 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/form/instance.php | Form_Instance.set_attribute | public function set_attribute($key, $value)
{
$attributes = $this->get_config('form_attributes', array());
$attributes[$key] = $value;
$this->set_config('form_attributes', $attributes);
return $this;
} | php | public function set_attribute($key, $value)
{
$attributes = $this->get_config('form_attributes', array());
$attributes[$key] = $value;
$this->set_config('form_attributes', $attributes);
return $this;
} | [
"public",
"function",
"set_attribute",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"$",
"attributes",
"=",
"$",
"this",
"->",
"get_config",
"(",
"'form_attributes'",
",",
"array",
"(",
")",
")",
";",
"$",
"attributes",
"[",
"$",
"key",
"]",
"=",
"$... | Set form attribute
@param string
@param mixed | [
"Set",
"form",
"attribute"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/form/instance.php#L66-L73 |
4,543 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/form/instance.php | Form_Instance.get_attribute | public function get_attribute($key, $default = null)
{
$attributes = $this->get_config('form_attributes', array());
return array_key_exists($key, $attributes) ? $attributes[$key] : $default;
} | php | public function get_attribute($key, $default = null)
{
$attributes = $this->get_config('form_attributes', array());
return array_key_exists($key, $attributes) ? $attributes[$key] : $default;
} | [
"public",
"function",
"get_attribute",
"(",
"$",
"key",
",",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"attributes",
"=",
"$",
"this",
"->",
"get_config",
"(",
"'form_attributes'",
",",
"array",
"(",
")",
")",
";",
"return",
"array_key_exists",
"(",
"$... | Get form attribute
@param string
@param mixed | [
"Get",
"form",
"attribute"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/form/instance.php#L81-L86 |
4,544 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/form/instance.php | Form_Instance.open | public function open($attributes = array(), array $hidden = array())
{
$attributes = ! is_array($attributes) ? array('action' => $attributes) : $attributes;
// If there is still no action set, Form-post
if( ! array_key_exists('action', $attributes) or empty($attributes['action']))
{
$attributes['action'] =... | php | public function open($attributes = array(), array $hidden = array())
{
$attributes = ! is_array($attributes) ? array('action' => $attributes) : $attributes;
// If there is still no action set, Form-post
if( ! array_key_exists('action', $attributes) or empty($attributes['action']))
{
$attributes['action'] =... | [
"public",
"function",
"open",
"(",
"$",
"attributes",
"=",
"array",
"(",
")",
",",
"array",
"$",
"hidden",
"=",
"array",
"(",
")",
")",
"{",
"$",
"attributes",
"=",
"!",
"is_array",
"(",
"$",
"attributes",
")",
"?",
"array",
"(",
"'action'",
"=>",
... | Create a form open tag
@param string|array action string or array with more tag attribute settings
@return string | [
"Create",
"a",
"form",
"open",
"tag"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/form/instance.php#L104-L142 |
4,545 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/form/instance.php | Form_Instance.fieldset_open | public function fieldset_open($attributes = array(), $legend = null)
{
$fieldset_open = '<fieldset ' . array_to_attr($attributes) . ' >';
! is_null($legend) and $attributes['legend'] = $legend;
if ( ! empty($attributes['legend']))
{
$fieldset_open.= "\n<legend>".$attributes['legend']."</legend>";
}
re... | php | public function fieldset_open($attributes = array(), $legend = null)
{
$fieldset_open = '<fieldset ' . array_to_attr($attributes) . ' >';
! is_null($legend) and $attributes['legend'] = $legend;
if ( ! empty($attributes['legend']))
{
$fieldset_open.= "\n<legend>".$attributes['legend']."</legend>";
}
re... | [
"public",
"function",
"fieldset_open",
"(",
"$",
"attributes",
"=",
"array",
"(",
")",
",",
"$",
"legend",
"=",
"null",
")",
"{",
"$",
"fieldset_open",
"=",
"'<fieldset '",
".",
"array_to_attr",
"(",
"$",
"attributes",
")",
".",
"' >'",
";",
"!",
"is_nul... | Create a fieldset open tag
@param array array with tag attribute settings
@param string string for the fieldset legend
@return string | [
"Create",
"a",
"fieldset",
"open",
"tag"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/form/instance.php#L161-L172 |
4,546 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/form/instance.php | Form_Instance.file | public function file($field, array $attributes = array())
{
if (is_array($field))
{
$attributes = $field;
}
else
{
$attributes['name'] = (string) $field;
}
$attributes['type'] = 'file';
return $this->input($attributes);
} | php | public function file($field, array $attributes = array())
{
if (is_array($field))
{
$attributes = $field;
}
else
{
$attributes['name'] = (string) $field;
}
$attributes['type'] = 'file';
return $this->input($attributes);
} | [
"public",
"function",
"file",
"(",
"$",
"field",
",",
"array",
"$",
"attributes",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"field",
")",
")",
"{",
"$",
"attributes",
"=",
"$",
"field",
";",
"}",
"else",
"{",
"$",
"attrib... | Create a file upload input field
@param string|array either fieldname or full attributes array (when array other params are ignored)
@param array
@return string | [
"Create",
"a",
"file",
"upload",
"input",
"field"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/form/instance.php#L374-L387 |
4,547 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/form/instance.php | Form_Instance.reset | public function reset($field = 'reset', $value = 'Reset', array $attributes = array())
{
if (is_array($field))
{
$attributes = $field;
}
else
{
$attributes['name'] = (string) $field;
$attributes['value'] = (string) $value;
}
$attributes['type'] = 'reset';
return $this->input($attributes);
} | php | public function reset($field = 'reset', $value = 'Reset', array $attributes = array())
{
if (is_array($field))
{
$attributes = $field;
}
else
{
$attributes['name'] = (string) $field;
$attributes['value'] = (string) $value;
}
$attributes['type'] = 'reset';
return $this->input($attributes);
} | [
"public",
"function",
"reset",
"(",
"$",
"field",
"=",
"'reset'",
",",
"$",
"value",
"=",
"'Reset'",
",",
"array",
"$",
"attributes",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"field",
")",
")",
"{",
"$",
"attributes",
"=",... | Create a reset button
@param string|array either fieldname or full attributes array (when array other params are ignored)
@param string
@param array
@return string | [
"Create",
"a",
"reset",
"button"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/form/instance.php#L421-L435 |
4,548 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/form/instance.php | Form_Instance.submit | public function submit($field = 'submit', $value = 'Submit', array $attributes = array())
{
if (is_array($field))
{
$attributes = $field;
}
else
{
$attributes['name'] = (string) $field;
$attributes['value'] = (string) $value;
}
$attributes['type'] = 'submit';
return $this->input($attributes);... | php | public function submit($field = 'submit', $value = 'Submit', array $attributes = array())
{
if (is_array($field))
{
$attributes = $field;
}
else
{
$attributes['name'] = (string) $field;
$attributes['value'] = (string) $value;
}
$attributes['type'] = 'submit';
return $this->input($attributes);... | [
"public",
"function",
"submit",
"(",
"$",
"field",
"=",
"'submit'",
",",
"$",
"value",
"=",
"'Submit'",
",",
"array",
"$",
"attributes",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"field",
")",
")",
"{",
"$",
"attributes",
"... | Create a submit button
@param string|array either fieldname or full attributes array (when array other params are ignored)
@param string
@param array
@return string | [
"Create",
"a",
"submit",
"button"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/form/instance.php#L445-L459 |
4,549 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/form/instance.php | Form_Instance.build_field | public function build_field($field)
{
! $field instanceof Fieldset_Field && $field = $this->field($field);
return $field->build();
} | php | public function build_field($field)
{
! $field instanceof Fieldset_Field && $field = $this->field($field);
return $field->build();
} | [
"public",
"function",
"build_field",
"(",
"$",
"field",
")",
"{",
"!",
"$",
"field",
"instanceof",
"Fieldset_Field",
"&&",
"$",
"field",
"=",
"$",
"this",
"->",
"field",
"(",
"$",
"field",
")",
";",
"return",
"$",
"field",
"->",
"build",
"(",
")",
";... | Build & template individual field
@param string|Fieldset_Field field instance or name of a field in this form's fieldset
@return string
@depricated until v1.2 | [
"Build",
"&",
"template",
"individual",
"field"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/form/instance.php#L667-L672 |
4,550 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/form/instance.php | Form_Instance.add_csrf | public function add_csrf()
{
$this->add(\Config::get('security.csrf_token_key', 'fuel_csrf_token'), 'CSRF Token')
->set_type('hidden')
->set_value(\Security::fetch_token())
->add_rule(array('Security', 'check_token'));
return $this;
} | php | public function add_csrf()
{
$this->add(\Config::get('security.csrf_token_key', 'fuel_csrf_token'), 'CSRF Token')
->set_type('hidden')
->set_value(\Security::fetch_token())
->add_rule(array('Security', 'check_token'));
return $this;
} | [
"public",
"function",
"add_csrf",
"(",
")",
"{",
"$",
"this",
"->",
"add",
"(",
"\\",
"Config",
"::",
"get",
"(",
"'security.csrf_token_key'",
",",
"'fuel_csrf_token'",
")",
",",
"'CSRF Token'",
")",
"->",
"set_type",
"(",
"'hidden'",
")",
"->",
"set_value",... | Add a CSRF token and a validation rule to check it | [
"Add",
"a",
"CSRF",
"token",
"and",
"a",
"validation",
"rule",
"to",
"check",
"it"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/form/instance.php#L677-L685 |
4,551 | open-orchestra/open-orchestra-media-admin-bundle | MediaAdminBundle/DependencyInjection/OpenOrchestraMediaAdminExtension.php | OpenOrchestraMediaAdminExtension.setFilesParameters | protected function setFilesParameters(ContainerBuilder $container, array $config, YamlFileLoader $loader)
{
$container->setParameter(
'open_orchestra_media_admin.files.thumbnail_format',
$config['thumbnail']
);
$container->setParameter(
'open_orchestra_me... | php | protected function setFilesParameters(ContainerBuilder $container, array $config, YamlFileLoader $loader)
{
$container->setParameter(
'open_orchestra_media_admin.files.thumbnail_format',
$config['thumbnail']
);
$container->setParameter(
'open_orchestra_me... | [
"protected",
"function",
"setFilesParameters",
"(",
"ContainerBuilder",
"$",
"container",
",",
"array",
"$",
"config",
",",
"YamlFileLoader",
"$",
"loader",
")",
"{",
"$",
"container",
"->",
"setParameter",
"(",
"'open_orchestra_media_admin.files.thumbnail_format'",
","... | Add the files generation parameters to the container
Takes the Open Orchestra alternatives image formats or the application one instead if defined
@param ContainerBuilder $container
@param array $config
@param YamlFileLoader $loader | [
"Add",
"the",
"files",
"generation",
"parameters",
"to",
"the",
"container",
"Takes",
"the",
"Open",
"Orchestra",
"alternatives",
"image",
"formats",
"or",
"the",
"application",
"one",
"instead",
"if",
"defined"
] | 743fa00a6491b84d67221e215a806d8b210bf773 | https://github.com/open-orchestra/open-orchestra-media-admin-bundle/blob/743fa00a6491b84d67221e215a806d8b210bf773/MediaAdminBundle/DependencyInjection/OpenOrchestraMediaAdminExtension.php#L166-L191 |
4,552 | iRAP-software/package-core-libs | src/MysqliLib.php | MysqliLib.escapeValues | public static function escapeValues(array $data, \mysqli $mysqli)
{
foreach($data as $index => $value)
{
if ($value !== null)
{
$data[$index] = mysqli_escape_string($mysqli, $value);
}
}
return $data;
} | php | public static function escapeValues(array $data, \mysqli $mysqli)
{
foreach($data as $index => $value)
{
if ($value !== null)
{
$data[$index] = mysqli_escape_string($mysqli, $value);
}
}
return $data;
} | [
"public",
"static",
"function",
"escapeValues",
"(",
"array",
"$",
"data",
",",
"\\",
"mysqli",
"$",
"mysqli",
")",
"{",
"foreach",
"(",
"$",
"data",
"as",
"$",
"index",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"!==",
"null",
")",
"{"... | Escape an array of data for the database.
@param array $data - the data to be escaped, either as list or name/value pairs
@param \mysqli $mysqli - the mysqli connection we are going to use for escaping.
@return array - the escaped input array. | [
"Escape",
"an",
"array",
"of",
"data",
"for",
"the",
"database",
"."
] | 244871d2fbc2f3fac26ff4b98715224953d9befb | https://github.com/iRAP-software/package-core-libs/blob/244871d2fbc2f3fac26ff4b98715224953d9befb/src/MysqliLib.php#L98-L109 |
4,553 | iRAP-software/package-core-libs | src/MysqliLib.php | MysqliLib.generateBatchReplaceQuery | public static function generateBatchReplaceQuery(array $rows, $tableName, \mysqli $mysqli)
{
$query = "REPLACE " . self::generateBatchQueryCore($rows, $tableName, $mysqli);
return $query;
} | php | public static function generateBatchReplaceQuery(array $rows, $tableName, \mysqli $mysqli)
{
$query = "REPLACE " . self::generateBatchQueryCore($rows, $tableName, $mysqli);
return $query;
} | [
"public",
"static",
"function",
"generateBatchReplaceQuery",
"(",
"array",
"$",
"rows",
",",
"$",
"tableName",
",",
"\\",
"mysqli",
"$",
"mysqli",
")",
"{",
"$",
"query",
"=",
"\"REPLACE \"",
".",
"self",
"::",
"generateBatchQueryCore",
"(",
"$",
"rows",
","... | Generates a single REPLACE query that can replace any number of rows. Replacements will
perform an insert except if a row with the same primary key or unique index already exists,
in which case an UPDATE will take place.
@param array $rows - the data we wish to insert/replace into the database.
@param string tableName ... | [
"Generates",
"a",
"single",
"REPLACE",
"query",
"that",
"can",
"replace",
"any",
"number",
"of",
"rows",
".",
"Replacements",
"will",
"perform",
"an",
"insert",
"except",
"if",
"a",
"row",
"with",
"the",
"same",
"primary",
"key",
"or",
"unique",
"index",
"... | 244871d2fbc2f3fac26ff4b98715224953d9befb | https://github.com/iRAP-software/package-core-libs/blob/244871d2fbc2f3fac26ff4b98715224953d9befb/src/MysqliLib.php#L121-L125 |
4,554 | iRAP-software/package-core-libs | src/MysqliLib.php | MysqliLib.generateBatchInsertQuery | public static function generateBatchInsertQuery(array $rows, $tableName, \mysqli $mysqli)
{
$query = "INSERT " . self::generateBatchQueryCore($rows, $tableName, $mysqli);
return $query;
} | php | public static function generateBatchInsertQuery(array $rows, $tableName, \mysqli $mysqli)
{
$query = "INSERT " . self::generateBatchQueryCore($rows, $tableName, $mysqli);
return $query;
} | [
"public",
"static",
"function",
"generateBatchInsertQuery",
"(",
"array",
"$",
"rows",
",",
"$",
"tableName",
",",
"\\",
"mysqli",
"$",
"mysqli",
")",
"{",
"$",
"query",
"=",
"\"INSERT \"",
".",
"self",
"::",
"generateBatchQueryCore",
"(",
"$",
"rows",
",",
... | Generates a single INSERT query that for any number of rows. This is one of the most
efficient ways to insert a lot of data.
@param array $rows - the data we wish to insert/replace into the database.
@param string tableName - the name of the table being manipulated.
@param \mysqli $mysqli - the database connection that... | [
"Generates",
"a",
"single",
"INSERT",
"query",
"that",
"for",
"any",
"number",
"of",
"rows",
".",
"This",
"is",
"one",
"of",
"the",
"most",
"efficient",
"ways",
"to",
"insert",
"a",
"lot",
"of",
"data",
"."
] | 244871d2fbc2f3fac26ff4b98715224953d9befb | https://github.com/iRAP-software/package-core-libs/blob/244871d2fbc2f3fac26ff4b98715224953d9befb/src/MysqliLib.php#L136-L140 |
4,555 | iRAP-software/package-core-libs | src/MysqliLib.php | MysqliLib.generateBatchQueryCore | private static function generateBatchQueryCore(array $rows, $tableName, \mysqli $mysqli)
{
$firstRow = true;
$dataStringRows = array(); # will hold an array list of strings like "('x', 'y', 'z')"
if (count($rows) == 0)
{
throw new \Exception("Cannot create batch ... | php | private static function generateBatchQueryCore(array $rows, $tableName, \mysqli $mysqli)
{
$firstRow = true;
$dataStringRows = array(); # will hold an array list of strings like "('x', 'y', 'z')"
if (count($rows) == 0)
{
throw new \Exception("Cannot create batch ... | [
"private",
"static",
"function",
"generateBatchQueryCore",
"(",
"array",
"$",
"rows",
",",
"$",
"tableName",
",",
"\\",
"mysqli",
"$",
"mysqli",
")",
"{",
"$",
"firstRow",
"=",
"true",
";",
"$",
"dataStringRows",
"=",
"array",
"(",
")",
";",
"# will hold a... | Helper function to generateBatchReplaceQuery and generateBatchInsertQuery which are 99%
exactly the same except for the word REPLACE or INSERT.
@param array $rows - the data we wish to insert/replace into the database.
@param string tableName - the name of the table being manipulated.
@param \mysqli $mysqli - the datab... | [
"Helper",
"function",
"to",
"generateBatchReplaceQuery",
"and",
"generateBatchInsertQuery",
"which",
"are",
"99%",
"exactly",
"the",
"same",
"except",
"for",
"the",
"word",
"REPLACE",
"or",
"INSERT",
"."
] | 244871d2fbc2f3fac26ff4b98715224953d9befb | https://github.com/iRAP-software/package-core-libs/blob/244871d2fbc2f3fac26ff4b98715224953d9befb/src/MysqliLib.php#L152-L196 |
4,556 | iRAP-software/package-core-libs | src/MysqliLib.php | MysqliLib.convertResultToArrayList | public static function convertResultToArrayList(\mysqli_result $result)
{
$list = array();
while (($row = $result->fetch_assoc()) != null)
{
$list[] = $row;
}
return $list;
} | php | public static function convertResultToArrayList(\mysqli_result $result)
{
$list = array();
while (($row = $result->fetch_assoc()) != null)
{
$list[] = $row;
}
return $list;
} | [
"public",
"static",
"function",
"convertResultToArrayList",
"(",
"\\",
"mysqli_result",
"$",
"result",
")",
"{",
"$",
"list",
"=",
"array",
"(",
")",
";",
"while",
"(",
"(",
"$",
"row",
"=",
"$",
"result",
"->",
"fetch_assoc",
"(",
")",
")",
"!=",
"nul... | Convert a mysqli_result object into a list of rows. This is not memory efficient
but can save the developer from writing a loop.
@param mysqli_result $result
@return array | [
"Convert",
"a",
"mysqli_result",
"object",
"into",
"a",
"list",
"of",
"rows",
".",
"This",
"is",
"not",
"memory",
"efficient",
"but",
"can",
"save",
"the",
"developer",
"from",
"writing",
"a",
"loop",
"."
] | 244871d2fbc2f3fac26ff4b98715224953d9befb | https://github.com/iRAP-software/package-core-libs/blob/244871d2fbc2f3fac26ff4b98715224953d9befb/src/MysqliLib.php#L205-L215 |
4,557 | iRAP-software/package-core-libs | src/MysqliLib.php | MysqliLib.getTableColumnNames | public static function getTableColumnNames(\mysqli $mysqliConn, string $tableName) : array
{
$sql = "SHOW COLUMNS FROM `{$tableName}`";
$result = $mysqliConn->query($sql);
$columns = array();
while (($row = $result->fetch_array()) != null)
{
$col... | php | public static function getTableColumnNames(\mysqli $mysqliConn, string $tableName) : array
{
$sql = "SHOW COLUMNS FROM `{$tableName}`";
$result = $mysqliConn->query($sql);
$columns = array();
while (($row = $result->fetch_array()) != null)
{
$col... | [
"public",
"static",
"function",
"getTableColumnNames",
"(",
"\\",
"mysqli",
"$",
"mysqliConn",
",",
"string",
"$",
"tableName",
")",
":",
"array",
"{",
"$",
"sql",
"=",
"\"SHOW COLUMNS FROM `{$tableName}`\"",
";",
"$",
"result",
"=",
"$",
"mysqliConn",
"->",
"... | Fetches the names of the columns for a particular table.
@return array - the collection of column names | [
"Fetches",
"the",
"names",
"of",
"the",
"columns",
"for",
"a",
"particular",
"table",
"."
] | 244871d2fbc2f3fac26ff4b98715224953d9befb | https://github.com/iRAP-software/package-core-libs/blob/244871d2fbc2f3fac26ff4b98715224953d9befb/src/MysqliLib.php#L318-L331 |
4,558 | iRAP-software/package-core-libs | src/MysqliLib.php | MysqliLib.getTableHash | public static function getTableHash(
\mysqli $mysqliConn,
string $tableName,
array $columns = array()
) : string
{
$tableHash = "";
if (count($columns) == 0)
{
$columns = MysqliLib::getTableColumnNames($mysqliConn, $tableName);
s... | php | public static function getTableHash(
\mysqli $mysqliConn,
string $tableName,
array $columns = array()
) : string
{
$tableHash = "";
if (count($columns) == 0)
{
$columns = MysqliLib::getTableColumnNames($mysqliConn, $tableName);
s... | [
"public",
"static",
"function",
"getTableHash",
"(",
"\\",
"mysqli",
"$",
"mysqliConn",
",",
"string",
"$",
"tableName",
",",
"array",
"$",
"columns",
"=",
"array",
"(",
")",
")",
":",
"string",
"{",
"$",
"tableHash",
"=",
"\"\"",
";",
"if",
"(",
"coun... | Generates a hash for the entire table so we can quickly compare tables to see if they are
the same. The hash will be an empty string if the table has no data.
@param \iRAP\CoreLibs\mysqli $mysqliConn
@param string $tableName - the name of the table to fetch a hash for.
@param array $columns - optionally specify the col... | [
"Generates",
"a",
"hash",
"for",
"the",
"entire",
"table",
"so",
"we",
"can",
"quickly",
"compare",
"tables",
"to",
"see",
"if",
"they",
"are",
"the",
"same",
".",
"The",
"hash",
"will",
"be",
"an",
"empty",
"string",
"if",
"the",
"table",
"has",
"no",... | 244871d2fbc2f3fac26ff4b98715224953d9befb | https://github.com/iRAP-software/package-core-libs/blob/244871d2fbc2f3fac26ff4b98715224953d9befb/src/MysqliLib.php#L347-L408 |
4,559 | iRAP-software/package-core-libs | src/MysqliLib.php | MysqliLib.fetchPrimaryKey | public static function fetchPrimaryKey(\mysqli $mysqliConn, string $tableName) : array
{
$primaryKeyArray = array();
$query = "show index FROM `" . $tableName . "`";
/*@var $result mysqli_result */
$result = $mysqliConn->query($query);
if ($result === FALSE)... | php | public static function fetchPrimaryKey(\mysqli $mysqliConn, string $tableName) : array
{
$primaryKeyArray = array();
$query = "show index FROM `" . $tableName . "`";
/*@var $result mysqli_result */
$result = $mysqliConn->query($query);
if ($result === FALSE)... | [
"public",
"static",
"function",
"fetchPrimaryKey",
"(",
"\\",
"mysqli",
"$",
"mysqliConn",
",",
"string",
"$",
"tableName",
")",
":",
"array",
"{",
"$",
"primaryKeyArray",
"=",
"array",
"(",
")",
";",
"$",
"query",
"=",
"\"show index FROM `\"",
".",
"$",
"... | Dynamically discovers the primary key for this table and sets this objects member variable
accordingly. This returns an array
@param \mysqli $mysqliConn - the mysqli connection to get primary key through.
@param string $tableName - the name of the table to fetch the primary key for.
@return array - the column names tha... | [
"Dynamically",
"discovers",
"the",
"primary",
"key",
"for",
"this",
"table",
"and",
"sets",
"this",
"objects",
"member",
"variable",
"accordingly",
".",
"This",
"returns",
"an",
"array"
] | 244871d2fbc2f3fac26ff4b98715224953d9befb | https://github.com/iRAP-software/package-core-libs/blob/244871d2fbc2f3fac26ff4b98715224953d9befb/src/MysqliLib.php#L434-L461 |
4,560 | tomvlk/sweet-orm | src/SweetORM/ConnectionManager.php | ConnectionManager.createConnection | private static function createConnection()
{
// Validate if configuration has enough details.
$driver = Configuration::get('database_driver');
// Make DSN and options
$dsn = "";
$options = Configuration::get('database-options');
$options = !is_array($options) ? array... | php | private static function createConnection()
{
// Validate if configuration has enough details.
$driver = Configuration::get('database_driver');
// Make DSN and options
$dsn = "";
$options = Configuration::get('database-options');
$options = !is_array($options) ? array... | [
"private",
"static",
"function",
"createConnection",
"(",
")",
"{",
"// Validate if configuration has enough details.",
"$",
"driver",
"=",
"Configuration",
"::",
"get",
"(",
"'database_driver'",
")",
";",
"// Make DSN and options",
"$",
"dsn",
"=",
"\"\"",
";",
"$",
... | Create PDO connection with current Configuration
@throws \Exception | [
"Create",
"PDO",
"connection",
"with",
"current",
"Configuration"
] | bca014a9f83be34c87b14d6c8a36156e24577374 | https://github.com/tomvlk/sweet-orm/blob/bca014a9f83be34c87b14d6c8a36156e24577374/src/SweetORM/ConnectionManager.php#L67-L114 |
4,561 | cityware/city-wmi | src/Processors/Processors.php | Processors.get | public function get()
{
$processors = [];
$result = $this->connection->newQuery()->from(Classes::WIN32_PROCESSOR)->get();
foreach($result as $processor) {
$processors[] = new Processor($processor);
}
return $processors;
} | php | public function get()
{
$processors = [];
$result = $this->connection->newQuery()->from(Classes::WIN32_PROCESSOR)->get();
foreach($result as $processor) {
$processors[] = new Processor($processor);
}
return $processors;
} | [
"public",
"function",
"get",
"(",
")",
"{",
"$",
"processors",
"=",
"[",
"]",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"connection",
"->",
"newQuery",
"(",
")",
"->",
"from",
"(",
"Classes",
"::",
"WIN32_PROCESSOR",
")",
"->",
"get",
"(",
")",
"... | Returns all processors on the computer.
@return array | [
"Returns",
"all",
"processors",
"on",
"the",
"computer",
"."
] | c7296e6855b6719f537ff5c2dc19d521ce1415d8 | https://github.com/cityware/city-wmi/blob/c7296e6855b6719f537ff5c2dc19d521ce1415d8/src/Processors/Processors.php#L15-L26 |
4,562 | Silvestra/Silvestra | src/Silvestra/Component/Admin/Menu/Event/AdminMenuEvent.php | AdminMenuEvent.getItems | public function getItems()
{
uasort(
$this->items,
function (AdminMenuItem $first, AdminMenuItem $second) {
if ($first->getPriority() <= $second->getPriority()) {
return 1;
}
return -1;
}
);
... | php | public function getItems()
{
uasort(
$this->items,
function (AdminMenuItem $first, AdminMenuItem $second) {
if ($first->getPriority() <= $second->getPriority()) {
return 1;
}
return -1;
}
);
... | [
"public",
"function",
"getItems",
"(",
")",
"{",
"uasort",
"(",
"$",
"this",
"->",
"items",
",",
"function",
"(",
"AdminMenuItem",
"$",
"first",
",",
"AdminMenuItem",
"$",
"second",
")",
"{",
"if",
"(",
"$",
"first",
"->",
"getPriority",
"(",
")",
"<="... | Get admin menu items.
@return array|AdminMenuItem[] | [
"Get",
"admin",
"menu",
"items",
"."
] | b7367601b01495ae3c492b42042f804dee13ab06 | https://github.com/Silvestra/Silvestra/blob/b7367601b01495ae3c492b42042f804dee13ab06/src/Silvestra/Component/Admin/Menu/Event/AdminMenuEvent.php#L42-L56 |
4,563 | mizzencms/core | src/Navigation/Navigation.php | Navigation.setMenuAttributes | public function setMenuAttributes($type, ItemInterface $menu)
{
if (isset($this->getBag()->get('config')->nav->attributes->{$type})) {
$attributes = (array) $this->getBag()
->get('config')
->nav
->attributes
->{$type}
;
... | php | public function setMenuAttributes($type, ItemInterface $menu)
{
if (isset($this->getBag()->get('config')->nav->attributes->{$type})) {
$attributes = (array) $this->getBag()
->get('config')
->nav
->attributes
->{$type}
;
... | [
"public",
"function",
"setMenuAttributes",
"(",
"$",
"type",
",",
"ItemInterface",
"$",
"menu",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"getBag",
"(",
")",
"->",
"get",
"(",
"'config'",
")",
"->",
"nav",
"->",
"attributes",
"->",
"{",
"... | Responsible for adding attributes to menu item groups
@param string $type see switch for details
@param ItemInterface $menu | [
"Responsible",
"for",
"adding",
"attributes",
"to",
"menu",
"item",
"groups"
] | d4efb4d1af7f3948fa7bee43d54298c6164ac5bb | https://github.com/mizzencms/core/blob/d4efb4d1af7f3948fa7bee43d54298c6164ac5bb/src/Navigation/Navigation.php#L124-L153 |
4,564 | mtoolkit/mtoolkit-core | src/MFileInfo.php | MFileInfo.exists | public function exists(): bool
{
if ($this->caching == false) {
return file_exists($this->getAbsoluteFilePath());
}
if ($this->exists == null) {
$this->exists = file_exists($this->getAbsoluteFilePath());
}
return $this->exists;
} | php | public function exists(): bool
{
if ($this->caching == false) {
return file_exists($this->getAbsoluteFilePath());
}
if ($this->exists == null) {
$this->exists = file_exists($this->getAbsoluteFilePath());
}
return $this->exists;
} | [
"public",
"function",
"exists",
"(",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"this",
"->",
"caching",
"==",
"false",
")",
"{",
"return",
"file_exists",
"(",
"$",
"this",
"->",
"getAbsoluteFilePath",
"(",
")",
")",
";",
"}",
"if",
"(",
"$",
"this",
"... | Returns true if the file exists; otherwise returns false.
@return boolean | [
"Returns",
"true",
"if",
"the",
"file",
"exists",
";",
"otherwise",
"returns",
"false",
"."
] | 66c53273288a8652ff38240e063bdcffdf7c30aa | https://github.com/mtoolkit/mtoolkit-core/blob/66c53273288a8652ff38240e063bdcffdf7c30aa/src/MFileInfo.php#L218-L229 |
4,565 | mtoolkit/mtoolkit-core | src/MFileInfo.php | MFileInfo.getGroup | public function getGroup(): string
{
if ($this->caching == false) {
$groupId = $this->getGroupId();
if ($groupId == -2) {
return "";
}
$group = posix_getgrgid($groupId);
return $group["name"];
}
if ($this->group ... | php | public function getGroup(): string
{
if ($this->caching == false) {
$groupId = $this->getGroupId();
if ($groupId == -2) {
return "";
}
$group = posix_getgrgid($groupId);
return $group["name"];
}
if ($this->group ... | [
"public",
"function",
"getGroup",
"(",
")",
":",
"string",
"{",
"if",
"(",
"$",
"this",
"->",
"caching",
"==",
"false",
")",
"{",
"$",
"groupId",
"=",
"$",
"this",
"->",
"getGroupId",
"(",
")",
";",
"if",
"(",
"$",
"groupId",
"==",
"-",
"2",
")",... | Returns the group of the file. On Windows, on systems where files do not
have groups, or if an error occurs, an empty string is returned.
@return string | [
"Returns",
"the",
"group",
"of",
"the",
"file",
".",
"On",
"Windows",
"on",
"systems",
"where",
"files",
"do",
"not",
"have",
"groups",
"or",
"if",
"an",
"error",
"occurs",
"an",
"empty",
"string",
"is",
"returned",
"."
] | 66c53273288a8652ff38240e063bdcffdf7c30aa | https://github.com/mtoolkit/mtoolkit-core/blob/66c53273288a8652ff38240e063bdcffdf7c30aa/src/MFileInfo.php#L257-L284 |
4,566 | mtoolkit/mtoolkit-core | src/MFileInfo.php | MFileInfo.isDir | public function isDir(): bool
{
if ($this->caching == false) {
return is_dir($this->getAbsoluteFilePath());
}
if ($this->isDir == null) {
$this->isDir = is_dir($this->getAbsoluteFilePath());
}
return $this->isDir;
} | php | public function isDir(): bool
{
if ($this->caching == false) {
return is_dir($this->getAbsoluteFilePath());
}
if ($this->isDir == null) {
$this->isDir = is_dir($this->getAbsoluteFilePath());
}
return $this->isDir;
} | [
"public",
"function",
"isDir",
"(",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"this",
"->",
"caching",
"==",
"false",
")",
"{",
"return",
"is_dir",
"(",
"$",
"this",
"->",
"getAbsoluteFilePath",
"(",
")",
")",
";",
"}",
"if",
"(",
"$",
"this",
"->",
... | Returns true if this object points to a directory or to a symbolic link
to a directory; otherwise returns false.
@return boolean | [
"Returns",
"true",
"if",
"this",
"object",
"points",
"to",
"a",
"directory",
"or",
"to",
"a",
"symbolic",
"link",
"to",
"a",
"directory",
";",
"otherwise",
"returns",
"false",
"."
] | 66c53273288a8652ff38240e063bdcffdf7c30aa | https://github.com/mtoolkit/mtoolkit-core/blob/66c53273288a8652ff38240e063bdcffdf7c30aa/src/MFileInfo.php#L336-L347 |
4,567 | mtoolkit/mtoolkit-core | src/MFileInfo.php | MFileInfo.isFile | public function isFile(): bool
{
if ($this->caching == false) {
return is_file($this->getAbsoluteFilePath());
}
if ($this->isFile == null) {
$this->isFile = is_file($this->getAbsoluteFilePath());
}
return $this->isFile;
} | php | public function isFile(): bool
{
if ($this->caching == false) {
return is_file($this->getAbsoluteFilePath());
}
if ($this->isFile == null) {
$this->isFile = is_file($this->getAbsoluteFilePath());
}
return $this->isFile;
} | [
"public",
"function",
"isFile",
"(",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"this",
"->",
"caching",
"==",
"false",
")",
"{",
"return",
"is_file",
"(",
"$",
"this",
"->",
"getAbsoluteFilePath",
"(",
")",
")",
";",
"}",
"if",
"(",
"$",
"this",
"->",... | Returns true if this object points to a file or to a symbolic link to a
file. Returns false if the object points to something which isn't a file,
such as a directory.
@return boolean | [
"Returns",
"true",
"if",
"this",
"object",
"points",
"to",
"a",
"file",
"or",
"to",
"a",
"symbolic",
"link",
"to",
"a",
"file",
".",
"Returns",
"false",
"if",
"the",
"object",
"points",
"to",
"something",
"which",
"isn",
"t",
"a",
"file",
"such",
"as",... | 66c53273288a8652ff38240e063bdcffdf7c30aa | https://github.com/mtoolkit/mtoolkit-core/blob/66c53273288a8652ff38240e063bdcffdf7c30aa/src/MFileInfo.php#L369-L380 |
4,568 | mtoolkit/mtoolkit-core | src/MFileInfo.php | MFileInfo.isReadable | public function isReadable(): bool
{
if ($this->caching == false) {
return is_readable($this->getAbsoluteFilePath());
}
if ($this->isReadable == null) {
$this->isReadable = is_readable($this->getAbsoluteFilePath());
}
return $this->isReadable;
} | php | public function isReadable(): bool
{
if ($this->caching == false) {
return is_readable($this->getAbsoluteFilePath());
}
if ($this->isReadable == null) {
$this->isReadable = is_readable($this->getAbsoluteFilePath());
}
return $this->isReadable;
} | [
"public",
"function",
"isReadable",
"(",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"this",
"->",
"caching",
"==",
"false",
")",
"{",
"return",
"is_readable",
"(",
"$",
"this",
"->",
"getAbsoluteFilePath",
"(",
")",
")",
";",
"}",
"if",
"(",
"$",
"this",... | Returns true if the user can read the file; otherwise returns false.
@return boolean | [
"Returns",
"true",
"if",
"the",
"user",
"can",
"read",
"the",
"file",
";",
"otherwise",
"returns",
"false",
"."
] | 66c53273288a8652ff38240e063bdcffdf7c30aa | https://github.com/mtoolkit/mtoolkit-core/blob/66c53273288a8652ff38240e063bdcffdf7c30aa/src/MFileInfo.php#L390-L401 |
4,569 | mtoolkit/mtoolkit-core | src/MFileInfo.php | MFileInfo.isWritable | public function isWritable(): bool
{
if ($this->caching == false) {
return is_writable($this->getAbsoluteFilePath());
}
if ($this->isWritable == null) {
$this->isWritable = is_writable($this->getAbsoluteFilePath());
}
return $this->isWritable;
} | php | public function isWritable(): bool
{
if ($this->caching == false) {
return is_writable($this->getAbsoluteFilePath());
}
if ($this->isWritable == null) {
$this->isWritable = is_writable($this->getAbsoluteFilePath());
}
return $this->isWritable;
} | [
"public",
"function",
"isWritable",
"(",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"this",
"->",
"caching",
"==",
"false",
")",
"{",
"return",
"is_writable",
"(",
"$",
"this",
"->",
"getAbsoluteFilePath",
"(",
")",
")",
";",
"}",
"if",
"(",
"$",
"this",... | Returns true if the user can write to the file; otherwise returns false.
@return boolean | [
"Returns",
"true",
"if",
"the",
"user",
"can",
"write",
"to",
"the",
"file",
";",
"otherwise",
"returns",
"false",
"."
] | 66c53273288a8652ff38240e063bdcffdf7c30aa | https://github.com/mtoolkit/mtoolkit-core/blob/66c53273288a8652ff38240e063bdcffdf7c30aa/src/MFileInfo.php#L454-L465 |
4,570 | mtoolkit/mtoolkit-core | src/MFileInfo.php | MFileInfo.getLastModified | public function getLastModified(): \DateTime
{
if ($this->caching == false) {
return \DateTime::createFromFormat("F d Y H:i:s.", date("F d Y H:i:s.", filemtime($this->getAbsoluteFilePath())));
}
if ($this->lastModified == null) {
$this->lastModified = \DateTime::crea... | php | public function getLastModified(): \DateTime
{
if ($this->caching == false) {
return \DateTime::createFromFormat("F d Y H:i:s.", date("F d Y H:i:s.", filemtime($this->getAbsoluteFilePath())));
}
if ($this->lastModified == null) {
$this->lastModified = \DateTime::crea... | [
"public",
"function",
"getLastModified",
"(",
")",
":",
"\\",
"DateTime",
"{",
"if",
"(",
"$",
"this",
"->",
"caching",
"==",
"false",
")",
"{",
"return",
"\\",
"DateTime",
"::",
"createFromFormat",
"(",
"\"F d Y H:i:s.\"",
",",
"date",
"(",
"\"F d Y H:i:s.\... | Returns the date and time when the file was last modified.
@return \DateTime | [
"Returns",
"the",
"date",
"and",
"time",
"when",
"the",
"file",
"was",
"last",
"modified",
"."
] | 66c53273288a8652ff38240e063bdcffdf7c30aa | https://github.com/mtoolkit/mtoolkit-core/blob/66c53273288a8652ff38240e063bdcffdf7c30aa/src/MFileInfo.php#L472-L483 |
4,571 | mtoolkit/mtoolkit-core | src/MFileInfo.php | MFileInfo.getOwner | public function getOwner(): string
{
if ($this->caching == false) {
$ownerId = $this->getOwnerId();
if ($ownerId == -2) {
return "";
}
$owner = posix_getpwuid($ownerId);
return $owner["name"];
}
if ($this->owner ... | php | public function getOwner(): string
{
if ($this->caching == false) {
$ownerId = $this->getOwnerId();
if ($ownerId == -2) {
return "";
}
$owner = posix_getpwuid($ownerId);
return $owner["name"];
}
if ($this->owner ... | [
"public",
"function",
"getOwner",
"(",
")",
":",
"string",
"{",
"if",
"(",
"$",
"this",
"->",
"caching",
"==",
"false",
")",
"{",
"$",
"ownerId",
"=",
"$",
"this",
"->",
"getOwnerId",
"(",
")",
";",
"if",
"(",
"$",
"ownerId",
"==",
"-",
"2",
")",... | Returns the owner of the file. On systems where files do not have
owners, or if an error occurs, an empty string is returned.
@return string | [
"Returns",
"the",
"owner",
"of",
"the",
"file",
".",
"On",
"systems",
"where",
"files",
"do",
"not",
"have",
"owners",
"or",
"if",
"an",
"error",
"occurs",
"an",
"empty",
"string",
"is",
"returned",
"."
] | 66c53273288a8652ff38240e063bdcffdf7c30aa | https://github.com/mtoolkit/mtoolkit-core/blob/66c53273288a8652ff38240e063bdcffdf7c30aa/src/MFileInfo.php#L525-L552 |
4,572 | mtoolkit/mtoolkit-core | src/MFileInfo.php | MFileInfo.refresh | public function refresh(): void
{
$this->size = null;
$this->lastModified = null;
$this->isReadable = null;
$this->isWritable = null;
$this->exists = null;
$this->created = null;
$this->isSymLink = null;
$this->isDir = null;
$this->isFile = nul... | php | public function refresh(): void
{
$this->size = null;
$this->lastModified = null;
$this->isReadable = null;
$this->isWritable = null;
$this->exists = null;
$this->created = null;
$this->isSymLink = null;
$this->isDir = null;
$this->isFile = nul... | [
"public",
"function",
"refresh",
"(",
")",
":",
"void",
"{",
"$",
"this",
"->",
"size",
"=",
"null",
";",
"$",
"this",
"->",
"lastModified",
"=",
"null",
";",
"$",
"this",
"->",
"isReadable",
"=",
"null",
";",
"$",
"this",
"->",
"isWritable",
"=",
... | Refreshes the information about the file, i.e. reads in information from
the file system the next time a cached property is fetched. | [
"Refreshes",
"the",
"information",
"about",
"the",
"file",
"i",
".",
"e",
".",
"reads",
"in",
"information",
"from",
"the",
"file",
"system",
"the",
"next",
"time",
"a",
"cached",
"property",
"is",
"fetched",
"."
] | 66c53273288a8652ff38240e063bdcffdf7c30aa | https://github.com/mtoolkit/mtoolkit-core/blob/66c53273288a8652ff38240e063bdcffdf7c30aa/src/MFileInfo.php#L723-L740 |
4,573 | mtoolkit/mtoolkit-core | src/MFileInfo.php | MFileInfo.getSize | public function getSize(): int
{
if ($this->caching == false) {
return filesize($this->getAbsoluteFilePath());
}
if ($this->size == null) {
$this->size = filesize($this->getAbsoluteFilePath());
}
return $this->size;
} | php | public function getSize(): int
{
if ($this->caching == false) {
return filesize($this->getAbsoluteFilePath());
}
if ($this->size == null) {
$this->size = filesize($this->getAbsoluteFilePath());
}
return $this->size;
} | [
"public",
"function",
"getSize",
"(",
")",
":",
"int",
"{",
"if",
"(",
"$",
"this",
"->",
"caching",
"==",
"false",
")",
"{",
"return",
"filesize",
"(",
"$",
"this",
"->",
"getAbsoluteFilePath",
"(",
")",
")",
";",
"}",
"if",
"(",
"$",
"this",
"->"... | Returns the file size in bytes. If the file does not exist or cannot be
fetched, 0 is returned.
@return int | [
"Returns",
"the",
"file",
"size",
"in",
"bytes",
".",
"If",
"the",
"file",
"does",
"not",
"exist",
"or",
"cannot",
"be",
"fetched",
"0",
"is",
"returned",
"."
] | 66c53273288a8652ff38240e063bdcffdf7c30aa | https://github.com/mtoolkit/mtoolkit-core/blob/66c53273288a8652ff38240e063bdcffdf7c30aa/src/MFileInfo.php#L748-L759 |
4,574 | silverstripe-modular-project/silverstripe-placeable | code/extensions/LeftAndMainPlaceable.php | LeftAndMainPlaceable.augmentNewSiteTreeItem | public function augmentNewSiteTreeItem(&$item)
{
if (isset($_POST['PageTypeFake'])) {
$item->PageTypeFake = $_POST['PageTypeFake'];
}
if (isset($_POST['PageTypeID'])) {
$item->PageTypeID = $_POST['PageTypeID'];
}
} | php | public function augmentNewSiteTreeItem(&$item)
{
if (isset($_POST['PageTypeFake'])) {
$item->PageTypeFake = $_POST['PageTypeFake'];
}
if (isset($_POST['PageTypeID'])) {
$item->PageTypeID = $_POST['PageTypeID'];
}
} | [
"public",
"function",
"augmentNewSiteTreeItem",
"(",
"&",
"$",
"item",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"_POST",
"[",
"'PageTypeFake'",
"]",
")",
")",
"{",
"$",
"item",
"->",
"PageTypeFake",
"=",
"$",
"_POST",
"[",
"'PageTypeFake'",
"]",
";",
"}... | Assigns new placeable pages to a page type | [
"Assigns",
"new",
"placeable",
"pages",
"to",
"a",
"page",
"type"
] | 8ac5891493e5af2efaab7afa93ef2d1c1bea946f | https://github.com/silverstripe-modular-project/silverstripe-placeable/blob/8ac5891493e5af2efaab7afa93ef2d1c1bea946f/code/extensions/LeftAndMainPlaceable.php#L20-L28 |
4,575 | ricardoh/wurfl-php-api | WURFL/Handlers/Utils.php | WURFL_Handlers_Utils.firstSpace | public static function firstSpace($string) {
$firstSpace = strpos($string, " ");
return ($firstSpace === false)? strlen($string) : $firstSpace;
} | php | public static function firstSpace($string) {
$firstSpace = strpos($string, " ");
return ($firstSpace === false)? strlen($string) : $firstSpace;
} | [
"public",
"static",
"function",
"firstSpace",
"(",
"$",
"string",
")",
"{",
"$",
"firstSpace",
"=",
"strpos",
"(",
"$",
"string",
",",
"\" \"",
")",
";",
"return",
"(",
"$",
"firstSpace",
"===",
"false",
")",
"?",
"strlen",
"(",
"$",
"string",
")",
"... | First occurance of a space character
@param string $string Haystack
@return int Char index | [
"First",
"occurance",
"of",
"a",
"space",
"character"
] | 1aa6c8af5b4c34ce3b37407c5eeb6fb41e5f3546 | https://github.com/ricardoh/wurfl-php-api/blob/1aa6c8af5b4c34ce3b37407c5eeb6fb41e5f3546/WURFL/Handlers/Utils.php#L464-L467 |
4,576 | cityware/city-utility | src/ThreshoudCpuCalculation.php | ThreshoudCpuCalculation.calculate | public static function calculate($numSlots = 1, $numCores = 1, $ht = 'N') {
$totalCpu = ($ht == 'S') ? (($numSlots * $numCores) * 2) : ($numSlots * $numCores);
$aReturn = Array();
$aReturn['warning'] = Array();
$aReturn['critical'] = Array();
$aReturn['warning']['load1min'] = r... | php | public static function calculate($numSlots = 1, $numCores = 1, $ht = 'N') {
$totalCpu = ($ht == 'S') ? (($numSlots * $numCores) * 2) : ($numSlots * $numCores);
$aReturn = Array();
$aReturn['warning'] = Array();
$aReturn['critical'] = Array();
$aReturn['warning']['load1min'] = r... | [
"public",
"static",
"function",
"calculate",
"(",
"$",
"numSlots",
"=",
"1",
",",
"$",
"numCores",
"=",
"1",
",",
"$",
"ht",
"=",
"'N'",
")",
"{",
"$",
"totalCpu",
"=",
"(",
"$",
"ht",
"==",
"'S'",
")",
"?",
"(",
"(",
"$",
"numSlots",
"*",
"$",... | Return calculation Threshoud alert CPU
@param integer $numSlots
@param integer $numCores
@param string $ht
@return array | [
"Return",
"calculation",
"Threshoud",
"alert",
"CPU"
] | fadd33233cdaf743d87c3c30e341f2b96e96e476 | https://github.com/cityware/city-utility/blob/fadd33233cdaf743d87c3c30e341f2b96e96e476/src/ThreshoudCpuCalculation.php#L25-L41 |
4,577 | xinc-develop/xinc-core | src/Build/Build.php | Build.getLastBuild | public function getLastBuild()
{
if ($this->lastBuild == null) {
$build = new self($this->getEngine(), $this->getProject());
return $build;
}
return $this->lastBuild;
} | php | public function getLastBuild()
{
if ($this->lastBuild == null) {
$build = new self($this->getEngine(), $this->getProject());
return $build;
}
return $this->lastBuild;
} | [
"public",
"function",
"getLastBuild",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"lastBuild",
"==",
"null",
")",
"{",
"$",
"build",
"=",
"new",
"self",
"(",
"$",
"this",
"->",
"getEngine",
"(",
")",
",",
"$",
"this",
"->",
"getProject",
"(",
")",... | Returns the last build.
@return BuildInterface | [
"Returns",
"the",
"last",
"build",
"."
] | 4bb69a6afe19e1186950a3122cbfe0989823e0d6 | https://github.com/xinc-develop/xinc-core/blob/4bb69a6afe19e1186950a3122cbfe0989823e0d6/src/Build/Build.php#L177-L186 |
4,578 | xinc-develop/xinc-core | src/Build/Build.php | Build.serialize | public function serialize()
{
Xinc_Logger::getInstance()->flush();
$this->setLastBuild();
if (!in_array($this->getStatus(), array(self::PASSED, self::FAILED, self::STOPPED))) {
throw new Xinc_Build_Exception_NotRun();
} elseif ($this->getBuildTime() == null) {
... | php | public function serialize()
{
Xinc_Logger::getInstance()->flush();
$this->setLastBuild();
if (!in_array($this->getStatus(), array(self::PASSED, self::FAILED, self::STOPPED))) {
throw new Xinc_Build_Exception_NotRun();
} elseif ($this->getBuildTime() == null) {
... | [
"public",
"function",
"serialize",
"(",
")",
"{",
"Xinc_Logger",
"::",
"getInstance",
"(",
")",
"->",
"flush",
"(",
")",
";",
"$",
"this",
"->",
"setLastBuild",
"(",
")",
";",
"if",
"(",
"!",
"in_array",
"(",
"$",
"this",
"->",
"getStatus",
"(",
")",... | stores the build information.
@throws Xinc_Build_Exception_NotRun
@throws Xinc_Build_Exception_Serialization
@throws Xinc_Build_History_Exception_Storage
@return bool | [
"stores",
"the",
"build",
"information",
"."
] | 4bb69a6afe19e1186950a3122cbfe0989823e0d6 | https://github.com/xinc-develop/xinc-core/blob/4bb69a6afe19e1186950a3122cbfe0989823e0d6/src/Build/Build.php#L287-L339 |
4,579 | xinc-develop/xinc-core | src/Build/Build.php | Build.unserialize | public static function unserialize(Project $project, $buildTimestamp = null, $statusDir = null)
{
if ($statusDir == null) {
$statusDir = Xinc::getInstance()->getStatusDir();
}
if ($buildTimestamp == null) {
//$fileName = $statusDir . DIRECTORY_SEPARATOR . $project->g... | php | public static function unserialize(Project $project, $buildTimestamp = null, $statusDir = null)
{
if ($statusDir == null) {
$statusDir = Xinc::getInstance()->getStatusDir();
}
if ($buildTimestamp == null) {
//$fileName = $statusDir . DIRECTORY_SEPARATOR . $project->g... | [
"public",
"static",
"function",
"unserialize",
"(",
"Project",
"$",
"project",
",",
"$",
"buildTimestamp",
"=",
"null",
",",
"$",
"statusDir",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"statusDir",
"==",
"null",
")",
"{",
"$",
"statusDir",
"=",
"Xinc",
":... | Unserialize a build by its project and buildtimestamp.
@param Xincproject $project
@param int $buildTimestamp
@return Xinc_Build
@throws Xinc_Build_Exception_Unserialization
@throws Xinc_Build_Exception_NotFound | [
"Unserialize",
"a",
"build",
"by",
"its",
"project",
"and",
"buildtimestamp",
"."
] | 4bb69a6afe19e1186950a3122cbfe0989823e0d6 | https://github.com/xinc-develop/xinc-core/blob/4bb69a6afe19e1186950a3122cbfe0989823e0d6/src/Build/Build.php#L352-L398 |
4,580 | xinc-develop/xinc-core | src/Build/Build.php | Build.setNumber | public function setNumber($no)
{
$this->info('Setting Buildnumber to:'.$no);
$this->setProperty('build.number', $no);
$this->no = $no;
} | php | public function setNumber($no)
{
$this->info('Setting Buildnumber to:'.$no);
$this->setProperty('build.number', $no);
$this->no = $no;
} | [
"public",
"function",
"setNumber",
"(",
"$",
"no",
")",
"{",
"$",
"this",
"->",
"info",
"(",
"'Setting Buildnumber to:'",
".",
"$",
"no",
")",
";",
"$",
"this",
"->",
"setProperty",
"(",
"'build.number'",
",",
"$",
"no",
")",
";",
"$",
"this",
"->",
... | Sets the sequence number for this build.
@param int $no | [
"Sets",
"the",
"sequence",
"number",
"for",
"this",
"build",
"."
] | 4bb69a6afe19e1186950a3122cbfe0989823e0d6 | https://github.com/xinc-develop/xinc-core/blob/4bb69a6afe19e1186950a3122cbfe0989823e0d6/src/Build/Build.php#L444-L449 |
4,581 | xinc-develop/xinc-core | src/Build/Build.php | Build.process | public function process($slot)
{
$tasks = $this->getTasksForSlot($slot);
while ($tasks->valid()) {
$task = $tasks->current();
$this->log->info('Processing task: '.$task->getName());
try {
$task->process($this);
} catch (Exception $e) {
... | php | public function process($slot)
{
$tasks = $this->getTasksForSlot($slot);
while ($tasks->valid()) {
$task = $tasks->current();
$this->log->info('Processing task: '.$task->getName());
try {
$task->process($this);
} catch (Exception $e) {
... | [
"public",
"function",
"process",
"(",
"$",
"slot",
")",
"{",
"$",
"tasks",
"=",
"$",
"this",
"->",
"getTasksForSlot",
"(",
"$",
"slot",
")",
";",
"while",
"(",
"$",
"tasks",
"->",
"valid",
"(",
")",
")",
"{",
"$",
"task",
"=",
"$",
"tasks",
"->",... | processes the tasks that are registered for the slot.
@todo exception handling & maybe move to engine
@param mixed $slot | [
"processes",
"the",
"tasks",
"that",
"are",
"registered",
"for",
"the",
"slot",
"."
] | 4bb69a6afe19e1186950a3122cbfe0989823e0d6 | https://github.com/xinc-develop/xinc-core/blob/4bb69a6afe19e1186950a3122cbfe0989823e0d6/src/Build/Build.php#L513-L538 |
4,582 | samurai-fw/samurai | src/Samurai/Component/Response/HttpResponse.php | HttpResponse.getStatusMessage | public function getStatusMessage($status = null)
{
if (! $status) $status = $this->getStatus();
if (! $status || ! isset($this->status_messages[$status])) throw new \LogicException("No such status. -> {$status}");
return $this->status_messages[$status];
} | php | public function getStatusMessage($status = null)
{
if (! $status) $status = $this->getStatus();
if (! $status || ! isset($this->status_messages[$status])) throw new \LogicException("No such status. -> {$status}");
return $this->status_messages[$status];
} | [
"public",
"function",
"getStatusMessage",
"(",
"$",
"status",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"status",
")",
"$",
"status",
"=",
"$",
"this",
"->",
"getStatus",
"(",
")",
";",
"if",
"(",
"!",
"$",
"status",
"||",
"!",
"isset",
"(",
"$... | get status message.
@param int|null $status
@return string | [
"get",
"status",
"message",
"."
] | 7ca3847b13f86e2847a17ab5e8e4e20893021d5a | https://github.com/samurai-fw/samurai/blob/7ca3847b13f86e2847a17ab5e8e4e20893021d5a/src/Samurai/Component/Response/HttpResponse.php#L165-L172 |
4,583 | samurai-fw/samurai | src/Samurai/Component/Response/HttpResponse.php | HttpResponse.sendStatus | private function sendStatus()
{
if (headers_sent()) return;
if (isset($this->status_messages[$this->status])) {
header(sprintf('HTTP/%s %d %s', $this->request->getHttpVersion(), $this->status, $this->status_messages[$this->status]));
} else {
header('Status: ' . $thi... | php | private function sendStatus()
{
if (headers_sent()) return;
if (isset($this->status_messages[$this->status])) {
header(sprintf('HTTP/%s %d %s', $this->request->getHttpVersion(), $this->status, $this->status_messages[$this->status]));
} else {
header('Status: ' . $thi... | [
"private",
"function",
"sendStatus",
"(",
")",
"{",
"if",
"(",
"headers_sent",
"(",
")",
")",
"return",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"status_messages",
"[",
"$",
"this",
"->",
"status",
"]",
")",
")",
"{",
"header",
"(",
"sprintf"... | send status code.
@access private | [
"send",
"status",
"code",
"."
] | 7ca3847b13f86e2847a17ab5e8e4e20893021d5a | https://github.com/samurai-fw/samurai/blob/7ca3847b13f86e2847a17ab5e8e4e20893021d5a/src/Samurai/Component/Response/HttpResponse.php#L252-L261 |
4,584 | samurai-fw/samurai | src/Samurai/Component/Response/HttpResponse.php | HttpResponse.sendHeaders | private function sendHeaders()
{
foreach ($this->body->getHeaders() as $key => $value) {
$key = join('-', array_map('ucfirst', explode('-', $key)));
header(sprintf('%s: %s', $key, $value));
}
} | php | private function sendHeaders()
{
foreach ($this->body->getHeaders() as $key => $value) {
$key = join('-', array_map('ucfirst', explode('-', $key)));
header(sprintf('%s: %s', $key, $value));
}
} | [
"private",
"function",
"sendHeaders",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"body",
"->",
"getHeaders",
"(",
")",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"key",
"=",
"join",
"(",
"'-'",
",",
"array_map",
"(",
"'ucfirst'",
"... | send headers.
@access private | [
"send",
"headers",
"."
] | 7ca3847b13f86e2847a17ab5e8e4e20893021d5a | https://github.com/samurai-fw/samurai/blob/7ca3847b13f86e2847a17ab5e8e4e20893021d5a/src/Samurai/Component/Response/HttpResponse.php#L269-L275 |
4,585 | mikeshiyan/lite-sql-insert | src/Iterate/Scenario/InsertNamedMatchTrait.php | InsertNamedMatchTrait.getFields | protected function getFields(): array {
if (!$this->fields) {
// Search the pattern for named subpatterns and get their names.
// @link https://stackoverflow.com/a/47753964/3260408
preg_match_all("~(?<!\\\\)(?:\\\\{2})*\(\?(?|P?<([_A-Za-z]\w{0,31})>|'([_A-Za-z]\w{0,31})')~", $this->getPattern(), $... | php | protected function getFields(): array {
if (!$this->fields) {
// Search the pattern for named subpatterns and get their names.
// @link https://stackoverflow.com/a/47753964/3260408
preg_match_all("~(?<!\\\\)(?:\\\\{2})*\(\?(?|P?<([_A-Za-z]\w{0,31})>|'([_A-Za-z]\w{0,31})')~", $this->getPattern(), $... | [
"protected",
"function",
"getFields",
"(",
")",
":",
"array",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"fields",
")",
"{",
"// Search the pattern for named subpatterns and get their names.",
"// @link https://stackoverflow.com/a/47753964/3260408",
"preg_match_all",
"(",
"\"~... | Gets names of fields to insert into.
If not overridden, this method gets and returns the names of subpatterns.
@return string[]
Field names.
@throws \RuntimeException
If there are no named subpatterns in the pattern or they are not unique. | [
"Gets",
"names",
"of",
"fields",
"to",
"insert",
"into",
"."
] | c0c26b7976d61ba5a95561363824c03ba31cee3b | https://github.com/mikeshiyan/lite-sql-insert/blob/c0c26b7976d61ba5a95561363824c03ba31cee3b/src/Iterate/Scenario/InsertNamedMatchTrait.php#L37-L53 |
4,586 | harmony-project/modular-routing | source/Metadata/Loader/YamlFileLoader.php | YamlFileLoader.validate | protected function validate($config, $name, $path)
{
if (!is_array($config)) {
throw new \InvalidArgumentException(sprintf('The definition of "%s" in "%s" must be a YAML array.', $name, $path));
}
if ($extraKeys = array_diff(array_keys($config), self::$availableKeys)) {
... | php | protected function validate($config, $name, $path)
{
if (!is_array($config)) {
throw new \InvalidArgumentException(sprintf('The definition of "%s" in "%s" must be a YAML array.', $name, $path));
}
if ($extraKeys = array_diff(array_keys($config), self::$availableKeys)) {
... | [
"protected",
"function",
"validate",
"(",
"$",
"config",
",",
"$",
"name",
",",
"$",
"path",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"config",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'The definition ... | Validates the metadata configuration.
@param array $config A resource config
@param string $name The config key
@param string $path The loaded file path
@throws \InvalidArgumentException If one of the provided config keys is not supported,
something is missing or the combination is invalid. | [
"Validates",
"the",
"metadata",
"configuration",
"."
] | 399bb427678ddc17c67295c738b96faea485e2d8 | https://github.com/harmony-project/modular-routing/blob/399bb427678ddc17c67295c738b96faea485e2d8/source/Metadata/Loader/YamlFileLoader.php#L152-L165 |
4,587 | intothesource/laravel-entrance | src/Http/Controllers/EntranceController.php | EntranceController.doLogin | public function doLogin(Request $request)
{
$userdata = array(
'email' => $request->email,
'password' => $request->password
);
if(\Auth::attempt($userdata, true, true))
{
if(config('entrance.activated')) {
if(\Auth::... | php | public function doLogin(Request $request)
{
$userdata = array(
'email' => $request->email,
'password' => $request->password
);
if(\Auth::attempt($userdata, true, true))
{
if(config('entrance.activated')) {
if(\Auth::... | [
"public",
"function",
"doLogin",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"userdata",
"=",
"array",
"(",
"'email'",
"=>",
"$",
"request",
"->",
"email",
",",
"'password'",
"=>",
"$",
"request",
"->",
"password",
")",
";",
"if",
"(",
"\\",
"Auth",... | Logs user in after checking inserted data.
@param Request $request
@return void
@author David Bikanov | [
"Logs",
"user",
"in",
"after",
"checking",
"inserted",
"data",
"."
] | 06abacfd7fa06bb44aaa7196faafd7b243d185b0 | https://github.com/intothesource/laravel-entrance/blob/06abacfd7fa06bb44aaa7196faafd7b243d185b0/src/Http/Controllers/EntranceController.php#L27-L53 |
4,588 | intothesource/laravel-entrance | src/Http/Controllers/EntranceController.php | EntranceController.doLogout | public function doLogout(Request $request)
{
\Auth::logout();
$request->session()->flash('message', 'Succesvol uitgelogd');
return redirect()->route('login.index');
} | php | public function doLogout(Request $request)
{
\Auth::logout();
$request->session()->flash('message', 'Succesvol uitgelogd');
return redirect()->route('login.index');
} | [
"public",
"function",
"doLogout",
"(",
"Request",
"$",
"request",
")",
"{",
"\\",
"Auth",
"::",
"logout",
"(",
")",
";",
"$",
"request",
"->",
"session",
"(",
")",
"->",
"flash",
"(",
"'message'",
",",
"'Succesvol uitgelogd'",
")",
";",
"return",
"redire... | Logs user out.
@return void
@author David Bikanov | [
"Logs",
"user",
"out",
"."
] | 06abacfd7fa06bb44aaa7196faafd7b243d185b0 | https://github.com/intothesource/laravel-entrance/blob/06abacfd7fa06bb44aaa7196faafd7b243d185b0/src/Http/Controllers/EntranceController.php#L60-L65 |
4,589 | intothesource/laravel-entrance | src/Http/Controllers/EntranceController.php | EntranceController.sendReset | public function sendReset(Request $request)
{
$user = User::where('email', '=', $request->email)->first();
if($user !== null)
{
$existingReset = Password_reset::where('email', $request->email)->first();
if($existingReset !== null)
{
$exist... | php | public function sendReset(Request $request)
{
$user = User::where('email', '=', $request->email)->first();
if($user !== null)
{
$existingReset = Password_reset::where('email', $request->email)->first();
if($existingReset !== null)
{
$exist... | [
"public",
"function",
"sendReset",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"user",
"=",
"User",
"::",
"where",
"(",
"'email'",
",",
"'='",
",",
"$",
"request",
"->",
"email",
")",
"->",
"first",
"(",
")",
";",
"if",
"(",
"$",
"user",
"!==",
... | Sends a password reset e-mail to the user.
@param Request $request
@return void
@author David Bikanov | [
"Sends",
"a",
"password",
"reset",
"e",
"-",
"mail",
"to",
"the",
"user",
"."
] | 06abacfd7fa06bb44aaa7196faafd7b243d185b0 | https://github.com/intothesource/laravel-entrance/blob/06abacfd7fa06bb44aaa7196faafd7b243d185b0/src/Http/Controllers/EntranceController.php#L73-L115 |
4,590 | intothesource/laravel-entrance | src/Http/Controllers/EntranceController.php | EntranceController.doReset | public function doReset(Request $request)
{
$existingReset = Password_reset::where('email', $request->email)
->where('token', $request->token)
->first();
if ($existingReset !== null)
{
if ($request->... | php | public function doReset(Request $request)
{
$existingReset = Password_reset::where('email', $request->email)
->where('token', $request->token)
->first();
if ($existingReset !== null)
{
if ($request->... | [
"public",
"function",
"doReset",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"existingReset",
"=",
"Password_reset",
"::",
"where",
"(",
"'email'",
",",
"$",
"request",
"->",
"email",
")",
"->",
"where",
"(",
"'token'",
",",
"$",
"request",
"->",
"tok... | Resets the users password.
@param Request $request
@return void
@author David Bikanov | [
"Resets",
"the",
"users",
"password",
"."
] | 06abacfd7fa06bb44aaa7196faafd7b243d185b0 | https://github.com/intothesource/laravel-entrance/blob/06abacfd7fa06bb44aaa7196faafd7b243d185b0/src/Http/Controllers/EntranceController.php#L123-L152 |
4,591 | intothesource/laravel-entrance | src/Http/Controllers/EntranceController.php | EntranceController.doRegister | public function doRegister(RegisterRequest $request)
{
// Encrypt the password
$request['password'] = bcrypt($request->password);
$userModel = config('entrance.classes.user_model');
$user = $userModel::create($request->all());
if(config('intothesource')) {
$role... | php | public function doRegister(RegisterRequest $request)
{
// Encrypt the password
$request['password'] = bcrypt($request->password);
$userModel = config('entrance.classes.user_model');
$user = $userModel::create($request->all());
if(config('intothesource')) {
$role... | [
"public",
"function",
"doRegister",
"(",
"RegisterRequest",
"$",
"request",
")",
"{",
"// Encrypt the password",
"$",
"request",
"[",
"'password'",
"]",
"=",
"bcrypt",
"(",
"$",
"request",
"->",
"password",
")",
";",
"$",
"userModel",
"=",
"config",
"(",
"'e... | Register the given input
@param RegisterRequest $request
@return redirect | [
"Register",
"the",
"given",
"input"
] | 06abacfd7fa06bb44aaa7196faafd7b243d185b0 | https://github.com/intothesource/laravel-entrance/blob/06abacfd7fa06bb44aaa7196faafd7b243d185b0/src/Http/Controllers/EntranceController.php#L160-L176 |
4,592 | calgamo/bench | src/Reporter/AbstractBenchmarkReporter.php | AbstractBenchmarkReporter.aggregate | protected function aggregate() : array
{
$ret = [];
if ($this->flags & Benchmark::BENCHMARK_TIME === Benchmark::BENCHMARK_TIME){
$ret['time'] = TimeBenchmark::score($this->h_time);
}
if ($this->flags & Benchmark::BENCHMARK_MEMORY === Benchmark::BENCHMARK_MEMORY){
... | php | protected function aggregate() : array
{
$ret = [];
if ($this->flags & Benchmark::BENCHMARK_TIME === Benchmark::BENCHMARK_TIME){
$ret['time'] = TimeBenchmark::score($this->h_time);
}
if ($this->flags & Benchmark::BENCHMARK_MEMORY === Benchmark::BENCHMARK_MEMORY){
... | [
"protected",
"function",
"aggregate",
"(",
")",
":",
"array",
"{",
"$",
"ret",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"this",
"->",
"flags",
"&",
"Benchmark",
"::",
"BENCHMARK_TIME",
"===",
"Benchmark",
"::",
"BENCHMARK_TIME",
")",
"{",
"$",
"ret",
"[",
... | Aggregate benchmark result
@return array | [
"Aggregate",
"benchmark",
"result"
] | bf51f711a13604782c1922555e2c883417e78d71 | https://github.com/calgamo/bench/blob/bf51f711a13604782c1922555e2c883417e78d71/src/Reporter/AbstractBenchmarkReporter.php#L59-L70 |
4,593 | setrun/setrun-component-sys | src/entities/Language.php | Language.edit | public function edit($name, $slug, $locale, $alias, $icon): void
{
$this->name = $name;
$this->slug = $slug;
$this->locale = $locale;
$this->alias = $alias;
$this->icon = $icon;
$this->updated_by = Yii::$app->user->identity->id;
} | php | public function edit($name, $slug, $locale, $alias, $icon): void
{
$this->name = $name;
$this->slug = $slug;
$this->locale = $locale;
$this->alias = $alias;
$this->icon = $icon;
$this->updated_by = Yii::$app->user->identity->id;
} | [
"public",
"function",
"edit",
"(",
"$",
"name",
",",
"$",
"slug",
",",
"$",
"locale",
",",
"$",
"alias",
",",
"$",
"icon",
")",
":",
"void",
"{",
"$",
"this",
"->",
"name",
"=",
"$",
"name",
";",
"$",
"this",
"->",
"slug",
"=",
"$",
"slug",
"... | Edit a language.
@param string $name
@param string $slug
@param string $locale
@param string $alias
@param string $icon
@return void | [
"Edit",
"a",
"language",
"."
] | ad9a6442a2921e0f061ed4e455b050c56029d565 | https://github.com/setrun/setrun-component-sys/blob/ad9a6442a2921e0f061ed4e455b050c56029d565/src/entities/Language.php#L75-L83 |
4,594 | j3j5/twitterapio | src/TwitterIterator.php | TwitterIterator.checkRateLimits | public function checkRateLimits(array $response, array $original_arguments)
{
// Check for rate limits
if (is_array($response) && isset($response['errors'], $response['tts'])) {
if ($this->sleep_on_rate_limit) {
if ($response['tts'] == 0) {
$this->api-... | php | public function checkRateLimits(array $response, array $original_arguments)
{
// Check for rate limits
if (is_array($response) && isset($response['errors'], $response['tts'])) {
if ($this->sleep_on_rate_limit) {
if ($response['tts'] == 0) {
$this->api-... | [
"public",
"function",
"checkRateLimits",
"(",
"array",
"$",
"response",
",",
"array",
"$",
"original_arguments",
")",
"{",
"// Check for rate limits",
"if",
"(",
"is_array",
"(",
"$",
"response",
")",
"&&",
"isset",
"(",
"$",
"response",
"[",
"'errors'",
"]",
... | Check whether the response from Twitter's API is rate limiting the calls or not.
@param array $response Twitter's respose
@ | [
"Check",
"whether",
"the",
"response",
"from",
"Twitter",
"s",
"API",
"is",
"rate",
"limiting",
"the",
"calls",
"or",
"not",
"."
] | 67c3b12da7628ed679cee0060c9ab13412d9112c | https://github.com/j3j5/twitterapio/blob/67c3b12da7628ed679cee0060c9ab13412d9112c/src/TwitterIterator.php#L51-L72 |
4,595 | rezzza/jobflow | src/Rezzza/Jobflow/ResolvedJob.php | ResolvedJob.getInitOptionsResolver | public function getInitOptionsResolver()
{
if (null === $this->initOptionsResolver) {
if (null !== $this->parent) {
$this->initOptionsResolver = clone $this->parent->getInitOptionsResolver();
} else {
$this->initOptionsResolver = new OptionsResolver();... | php | public function getInitOptionsResolver()
{
if (null === $this->initOptionsResolver) {
if (null !== $this->parent) {
$this->initOptionsResolver = clone $this->parent->getInitOptionsResolver();
} else {
$this->initOptionsResolver = new OptionsResolver();... | [
"public",
"function",
"getInitOptionsResolver",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"initOptionsResolver",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"parent",
")",
"{",
"$",
"this",
"->",
"initOptionsResolver",
"=",
"... | Init options with innerType requirements
@return OptionsResolver | [
"Init",
"options",
"with",
"innerType",
"requirements"
] | 80ded8ac6ed6a2f4500b8f86e2958701ec84fd65 | https://github.com/rezzza/jobflow/blob/80ded8ac6ed6a2f4500b8f86e2958701ec84fd65/src/Rezzza/Jobflow/ResolvedJob.php#L97-L114 |
4,596 | rezzza/jobflow | src/Rezzza/Jobflow/ResolvedJob.php | ResolvedJob.getExecOptionsResolver | public function getExecOptionsResolver()
{
if (null === $this->execOptionsResolver) {
if (null !== $this->parent) {
$this->execOptionsResolver = clone $this->parent->getExecOptionsResolver();
} else {
$this->execOptionsResolver = new OptionsResolver();... | php | public function getExecOptionsResolver()
{
if (null === $this->execOptionsResolver) {
if (null !== $this->parent) {
$this->execOptionsResolver = clone $this->parent->getExecOptionsResolver();
} else {
$this->execOptionsResolver = new OptionsResolver();... | [
"public",
"function",
"getExecOptionsResolver",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"execOptionsResolver",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"parent",
")",
"{",
"$",
"this",
"->",
"execOptionsResolver",
"=",
"... | Exec options with innerType requirements
@return OptionsResolver | [
"Exec",
"options",
"with",
"innerType",
"requirements"
] | 80ded8ac6ed6a2f4500b8f86e2958701ec84fd65 | https://github.com/rezzza/jobflow/blob/80ded8ac6ed6a2f4500b8f86e2958701ec84fd65/src/Rezzza/Jobflow/ResolvedJob.php#L121-L138 |
4,597 | rezzza/jobflow | src/Rezzza/Jobflow/ResolvedJob.php | ResolvedJob.newBuilder | protected function newBuilder($name, JobFactory $factory, array $initOptions, array $execOptions)
{
return new JobBuilder($name, $factory, new EventDispatcher(), $initOptions, $execOptions);
} | php | protected function newBuilder($name, JobFactory $factory, array $initOptions, array $execOptions)
{
return new JobBuilder($name, $factory, new EventDispatcher(), $initOptions, $execOptions);
} | [
"protected",
"function",
"newBuilder",
"(",
"$",
"name",
",",
"JobFactory",
"$",
"factory",
",",
"array",
"$",
"initOptions",
",",
"array",
"$",
"execOptions",
")",
"{",
"return",
"new",
"JobBuilder",
"(",
"$",
"name",
",",
"$",
"factory",
",",
"new",
"E... | Create new JobBuilder for the innerType
@param string $name
@param JobFactory $factory
@return JobBuilder | [
"Create",
"new",
"JobBuilder",
"for",
"the",
"innerType"
] | 80ded8ac6ed6a2f4500b8f86e2958701ec84fd65 | https://github.com/rezzza/jobflow/blob/80ded8ac6ed6a2f4500b8f86e2958701ec84fd65/src/Rezzza/Jobflow/ResolvedJob.php#L148-L151 |
4,598 | marcqualie/mongominify | src/MongoMinify/Db.php | Db.createCollection | public function createCollection($name, $capped = false, $size = 0, $max = 0)
{
$this->native->createCollection($name, $capped, $size, $max);
return $this->selectCollection($name);
} | php | public function createCollection($name, $capped = false, $size = 0, $max = 0)
{
$this->native->createCollection($name, $capped, $size, $max);
return $this->selectCollection($name);
} | [
"public",
"function",
"createCollection",
"(",
"$",
"name",
",",
"$",
"capped",
"=",
"false",
",",
"$",
"size",
"=",
"0",
",",
"$",
"max",
"=",
"0",
")",
"{",
"$",
"this",
"->",
"native",
"->",
"createCollection",
"(",
"$",
"name",
",",
"$",
"cappe... | Create a new Collection | [
"Create",
"a",
"new",
"Collection"
] | 63240a91431e09279009235596bfc7f67636b269 | https://github.com/marcqualie/mongominify/blob/63240a91431e09279009235596bfc7f67636b269/src/MongoMinify/Db.php#L53-L58 |
4,599 | easy-system/es-http | src/Uploading/AbstractUploadStrategy.php | AbstractUploadStrategy.decideOnFailure | protected function decideOnFailure($error)
{
if (! isset($this->errors[$error])) {
throw new UnexpectedValueException(sprintf(
'Unexpected error "%s" received. All error must be specified '
. 'in errors array of this instance.',
$error
... | php | protected function decideOnFailure($error)
{
if (! isset($this->errors[$error])) {
throw new UnexpectedValueException(sprintf(
'Unexpected error "%s" received. All error must be specified '
. 'in errors array of this instance.',
$error
... | [
"protected",
"function",
"decideOnFailure",
"(",
"$",
"error",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"errors",
"[",
"$",
"error",
"]",
")",
")",
"{",
"throw",
"new",
"UnexpectedValueException",
"(",
"sprintf",
"(",
"'Unexpected error \... | Decides on failure.
@param string $error The error
@throws \UnexpectedValueException If the received error is not specified
in $this->errors | [
"Decides",
"on",
"failure",
"."
] | dd5852e94901e147a7546a8715133408ece767a1 | https://github.com/easy-system/es-http/blob/dd5852e94901e147a7546a8715133408ece767a1/src/Uploading/AbstractUploadStrategy.php#L130-L143 |
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.