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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
234,200 | awurth/SlimHelpers | Command/RoutesCommand.php | RoutesCommand.text | public function text(InputInterface $input, OutputInterface $output)
{
foreach ($this->router->getRoutes() as $route) {
if (!empty($route->getName())) {
$output->writeln('<fg=cyan;options=bold>'.$route->getName().'</>');
$output->writeln(' '.implode(', ', $rout... | php | public function text(InputInterface $input, OutputInterface $output)
{
foreach ($this->router->getRoutes() as $route) {
if (!empty($route->getName())) {
$output->writeln('<fg=cyan;options=bold>'.$route->getName().'</>');
$output->writeln(' '.implode(', ', $rout... | [
"public",
"function",
"text",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"router",
"->",
"getRoutes",
"(",
")",
"as",
"$",
"route",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
... | Displays routes in plain text.
@param InputInterface $input
@param OutputInterface $output | [
"Displays",
"routes",
"in",
"plain",
"text",
"."
] | abaa0e16e285148f4e4c6b2fd0bb176bce6dac36 | https://github.com/awurth/SlimHelpers/blob/abaa0e16e285148f4e4c6b2fd0bb176bce6dac36/Command/RoutesCommand.php#L74-L88 |
234,201 | awurth/SlimHelpers | Command/RoutesCommand.php | RoutesCommand.markdown | public function markdown(InputInterface $input, OutputInterface $output)
{
$output->writeln('# Routes');
$output->writeln('');
$url = rtrim($this->options['url'], '/');
foreach ($this->router->getRoutes() as $route) {
$output->writeln(sprintf('### `%s` [%s](%s)',
... | php | public function markdown(InputInterface $input, OutputInterface $output)
{
$output->writeln('# Routes');
$output->writeln('');
$url = rtrim($this->options['url'], '/');
foreach ($this->router->getRoutes() as $route) {
$output->writeln(sprintf('### `%s` [%s](%s)',
... | [
"public",
"function",
"markdown",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"output",
"->",
"writeln",
"(",
"'# Routes'",
")",
";",
"$",
"output",
"->",
"writeln",
"(",
"''",
")",
";",
"$",
"url",
"=",
"... | Displays routes in markdown format.
@param InputInterface $input
@param OutputInterface $output | [
"Displays",
"routes",
"in",
"markdown",
"format",
"."
] | abaa0e16e285148f4e4c6b2fd0bb176bce6dac36 | https://github.com/awurth/SlimHelpers/blob/abaa0e16e285148f4e4c6b2fd0bb176bce6dac36/Command/RoutesCommand.php#L96-L118 |
234,202 | phpmath/bignumber | src/Utils.php | Utils.convertToBase10 | public static function convertToBase10($number, $fromBase)
{
$number = (string)ceil(static::getPlainNumber($number));
if ($fromBase == 10) {
return $number;
} elseif ($fromBase < 2 || $fromBase > 32) {
throw new InvalidArgumentException(sprintf(
'Base... | php | public static function convertToBase10($number, $fromBase)
{
$number = (string)ceil(static::getPlainNumber($number));
if ($fromBase == 10) {
return $number;
} elseif ($fromBase < 2 || $fromBase > 32) {
throw new InvalidArgumentException(sprintf(
'Base... | [
"public",
"static",
"function",
"convertToBase10",
"(",
"$",
"number",
",",
"$",
"fromBase",
")",
"{",
"$",
"number",
"=",
"(",
"string",
")",
"ceil",
"(",
"static",
"::",
"getPlainNumber",
"(",
"$",
"number",
")",
")",
";",
"if",
"(",
"$",
"fromBase",... | Converts the provided number from an arbitrary base to to a base 10 number.
@param string|int|BigNumber $number The number to convert.
@param int $fromBase The base to convert the number from.
@return string
@throws InvalidArgumentException Thrown when the base is out of reach. | [
"Converts",
"the",
"provided",
"number",
"from",
"an",
"arbitrary",
"base",
"to",
"to",
"a",
"base",
"10",
"number",
"."
] | 9d8343a535a66e1e61362abf71ca26133222fe9a | https://github.com/phpmath/bignumber/blob/9d8343a535a66e1e61362abf71ca26133222fe9a/src/Utils.php#L45-L78 |
234,203 | phpmath/bignumber | src/Utils.php | Utils.convertExponentialToString | public static function convertExponentialToString($value)
{
if (!is_float($value)) {
return $value;
}
$result = explode('E', strtoupper($value));
if (count($result) === 1) {
return $result[0];
}
$dotSplitted = explode('.', $result[0]);
... | php | public static function convertExponentialToString($value)
{
if (!is_float($value)) {
return $value;
}
$result = explode('E', strtoupper($value));
if (count($result) === 1) {
return $result[0];
}
$dotSplitted = explode('.', $result[0]);
... | [
"public",
"static",
"function",
"convertExponentialToString",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"is_float",
"(",
"$",
"value",
")",
")",
"{",
"return",
"$",
"value",
";",
"}",
"$",
"result",
"=",
"explode",
"(",
"'E'",
",",
"strtoupper",
"("... | Converts the given exponential value to a string.
@param float|string $value The exponential value to convert.
@return string | [
"Converts",
"the",
"given",
"exponential",
"value",
"to",
"a",
"string",
"."
] | 9d8343a535a66e1e61362abf71ca26133222fe9a | https://github.com/phpmath/bignumber/blob/9d8343a535a66e1e61362abf71ca26133222fe9a/src/Utils.php#L140-L155 |
234,204 | phpmath/bignumber | src/Utils.php | Utils.multiply | public static function multiply(BigNumber $lft, BigNumber $rgt, $scale = 10, $mutable = true)
{
$bigNumber = new BigNumber($lft, $scale, $mutable);
return $bigNumber->multiply($rgt);
} | php | public static function multiply(BigNumber $lft, BigNumber $rgt, $scale = 10, $mutable = true)
{
$bigNumber = new BigNumber($lft, $scale, $mutable);
return $bigNumber->multiply($rgt);
} | [
"public",
"static",
"function",
"multiply",
"(",
"BigNumber",
"$",
"lft",
",",
"BigNumber",
"$",
"rgt",
",",
"$",
"scale",
"=",
"10",
",",
"$",
"mutable",
"=",
"true",
")",
"{",
"$",
"bigNumber",
"=",
"new",
"BigNumber",
"(",
"$",
"lft",
",",
"$",
... | Multiplies the two given numbers.
@param BigNumber $lft The left number.
@param BigNumber $rgt The right number.
@param int $scale The scale of the calculated number.
@param bool $mutable Whether or not the result is mutable.
@return BigNumber | [
"Multiplies",
"the",
"two",
"given",
"numbers",
"."
] | 9d8343a535a66e1e61362abf71ca26133222fe9a | https://github.com/phpmath/bignumber/blob/9d8343a535a66e1e61362abf71ca26133222fe9a/src/Utils.php#L166-L171 |
234,205 | txj123/zilf | src/Zilf/DataCrawler/PhpQuery/phpQuery/Zend/Validate/File/ImageSize.php | Zend_Validate_File_ImageSize.setImageMax | public function setImageMax($maxwidth, $maxheight)
{
if ($maxwidth === null) {
$tempwidth = null;
} else if (($this->_minwidth !== null) and ($maxwidth < $this->_minwidth)) {
include_once 'Zend/Validate/Exception.php';
throw new Zend_Validate_Exception(
... | php | public function setImageMax($maxwidth, $maxheight)
{
if ($maxwidth === null) {
$tempwidth = null;
} else if (($this->_minwidth !== null) and ($maxwidth < $this->_minwidth)) {
include_once 'Zend/Validate/Exception.php';
throw new Zend_Validate_Exception(
... | [
"public",
"function",
"setImageMax",
"(",
"$",
"maxwidth",
",",
"$",
"maxheight",
")",
"{",
"if",
"(",
"$",
"maxwidth",
"===",
"null",
")",
"{",
"$",
"tempwidth",
"=",
"null",
";",
"}",
"else",
"if",
"(",
"(",
"$",
"this",
"->",
"_minwidth",
"!==",
... | Sets the maximum image size
@param integer $maxwidth The maximum image width
@param integer $maxheight The maximum image height
@throws Zend_Validate_Exception When maxwidth is smaller than minwidth
@throws Zend_Validate_Exception When maxheight is smaller than minheight
@return Zend_Validate_StringLength Provides ... | [
"Sets",
"the",
"maximum",
"image",
"size"
] | 8fc979ae338e850e6f40bfb97d4d57869f9e4480 | https://github.com/txj123/zilf/blob/8fc979ae338e850e6f40bfb97d4d57869f9e4480/src/Zilf/DataCrawler/PhpQuery/phpQuery/Zend/Validate/File/ImageSize.php#L219-L248 |
234,206 | txj123/zilf | src/Zilf/DataCrawler/PhpQuery/phpQuery/Zend/Validate/File/ImageSize.php | Zend_Validate_File_ImageSize.setImageWidth | public function setImageWidth($minwidth, $maxwidth)
{
$this->setImageMin($minwidth, $this->_minheight);
$this->setImageMax($maxwidth, $this->_maxheight);
return $this;
} | php | public function setImageWidth($minwidth, $maxwidth)
{
$this->setImageMin($minwidth, $this->_minheight);
$this->setImageMax($maxwidth, $this->_maxheight);
return $this;
} | [
"public",
"function",
"setImageWidth",
"(",
"$",
"minwidth",
",",
"$",
"maxwidth",
")",
"{",
"$",
"this",
"->",
"setImageMin",
"(",
"$",
"minwidth",
",",
"$",
"this",
"->",
"_minheight",
")",
";",
"$",
"this",
"->",
"setImageMax",
"(",
"$",
"maxwidth",
... | Sets the mimimum and maximum image width
@param integer $minwidth The minimum image width
@param integer $maxwidth The maximum image width
@return Zend_Validate_File_ImageSize Provides a fluent interface | [
"Sets",
"the",
"mimimum",
"and",
"maximum",
"image",
"width"
] | 8fc979ae338e850e6f40bfb97d4d57869f9e4480 | https://github.com/txj123/zilf/blob/8fc979ae338e850e6f40bfb97d4d57869f9e4480/src/Zilf/DataCrawler/PhpQuery/phpQuery/Zend/Validate/File/ImageSize.php#L257-L262 |
234,207 | txj123/zilf | src/Zilf/DataCrawler/PhpQuery/phpQuery/Zend/Validate/File/ImageSize.php | Zend_Validate_File_ImageSize.setImageHeight | public function setImageHeight($minheight, $maxheight)
{
$this->setImageMin($this->_minwidth, $minheight);
$this->setImageMax($this->_maxwidth, $maxheight);
return $this;
} | php | public function setImageHeight($minheight, $maxheight)
{
$this->setImageMin($this->_minwidth, $minheight);
$this->setImageMax($this->_maxwidth, $maxheight);
return $this;
} | [
"public",
"function",
"setImageHeight",
"(",
"$",
"minheight",
",",
"$",
"maxheight",
")",
"{",
"$",
"this",
"->",
"setImageMin",
"(",
"$",
"this",
"->",
"_minwidth",
",",
"$",
"minheight",
")",
";",
"$",
"this",
"->",
"setImageMax",
"(",
"$",
"this",
... | Sets the mimimum and maximum image height
@param integer $minheight The minimum image height
@param integer $maxheight The maximum image height
@return Zend_Validate_File_ImageSize Provides a fluent interface | [
"Sets",
"the",
"mimimum",
"and",
"maximum",
"image",
"height"
] | 8fc979ae338e850e6f40bfb97d4d57869f9e4480 | https://github.com/txj123/zilf/blob/8fc979ae338e850e6f40bfb97d4d57869f9e4480/src/Zilf/DataCrawler/PhpQuery/phpQuery/Zend/Validate/File/ImageSize.php#L271-L276 |
234,208 | txj123/zilf | src/Zilf/Db/base/Module.php | Module.getInstance | public static function getInstance()
{
$class = get_called_class();
return isset(Zilf::$app->loadedModules[$class]) ? Zilf::$app->loadedModules[$class] : null;
} | php | public static function getInstance()
{
$class = get_called_class();
return isset(Zilf::$app->loadedModules[$class]) ? Zilf::$app->loadedModules[$class] : null;
} | [
"public",
"static",
"function",
"getInstance",
"(",
")",
"{",
"$",
"class",
"=",
"get_called_class",
"(",
")",
";",
"return",
"isset",
"(",
"Zilf",
"::",
"$",
"app",
"->",
"loadedModules",
"[",
"$",
"class",
"]",
")",
"?",
"Zilf",
"::",
"$",
"app",
"... | Returns the currently requested instance of this module class.
If the module class is not currently requested, `null` will be returned.
This method is provided so that you access the module instance from anywhere within the module.
@return static|null the currently requested instance of this module class, or `null` if... | [
"Returns",
"the",
"currently",
"requested",
"instance",
"of",
"this",
"module",
"class",
".",
"If",
"the",
"module",
"class",
"is",
"not",
"currently",
"requested",
"null",
"will",
"be",
"returned",
".",
"This",
"method",
"is",
"provided",
"so",
"that",
"you... | 8fc979ae338e850e6f40bfb97d4d57869f9e4480 | https://github.com/txj123/zilf/blob/8fc979ae338e850e6f40bfb97d4d57869f9e4480/src/Zilf/Db/base/Module.php#L170-L174 |
234,209 | kiwiz/esquery | src/Result.php | Result.execute | public function execute() {
if(is_null($this->client)) {
$this->client = $this->getConnection();
}
if(is_null($this->query)) {
throw new Exception('No query');
}
list($query_data, $meta) = $this->constructQuery($this->source, $this->query, $this->aggs, $t... | php | public function execute() {
if(is_null($this->client)) {
$this->client = $this->getConnection();
}
if(is_null($this->query)) {
throw new Exception('No query');
}
list($query_data, $meta) = $this->constructQuery($this->source, $this->query, $this->aggs, $t... | [
"public",
"function",
"execute",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"client",
")",
")",
"{",
"$",
"this",
"->",
"client",
"=",
"$",
"this",
"->",
"getConnection",
"(",
")",
";",
"}",
"if",
"(",
"is_null",
"(",
"$",
"this... | Process the query and return the results. | [
"Process",
"the",
"query",
"and",
"return",
"the",
"results",
"."
] | ad05f8d18cb9f1227a82f8d0b9d270882865b31d | https://github.com/kiwiz/esquery/blob/ad05f8d18cb9f1227a82f8d0b9d270882865b31d/src/Result.php#L86-L101 |
234,210 | kiwiz/esquery | src/Result.php | Result.jsonSerialize | public function jsonSerialize() {
list($query_data, $meta) = $this->constructQuery($this->source, $this->query, $this->aggs, $this->post_query, $this->settings);
return $query_data;
} | php | public function jsonSerialize() {
list($query_data, $meta) = $this->constructQuery($this->source, $this->query, $this->aggs, $this->post_query, $this->settings);
return $query_data;
} | [
"public",
"function",
"jsonSerialize",
"(",
")",
"{",
"list",
"(",
"$",
"query_data",
",",
"$",
"meta",
")",
"=",
"$",
"this",
"->",
"constructQuery",
"(",
"$",
"this",
"->",
"source",
",",
"$",
"this",
"->",
"query",
",",
"$",
"this",
"->",
"aggs",
... | Output the query as a json string. | [
"Output",
"the",
"query",
"as",
"a",
"json",
"string",
"."
] | ad05f8d18cb9f1227a82f8d0b9d270882865b31d | https://github.com/kiwiz/esquery/blob/ad05f8d18cb9f1227a82f8d0b9d270882865b31d/src/Result.php#L137-L141 |
234,211 | kiwiz/esquery | src/Result.php | Result.constructSettings | private function constructSettings($settings) {
$ret = [];
if(array_key_exists('fields', $settings)) {
$ret['_source'] = ['include' => $settings['fields']];
}
if(array_key_exists('sort', $settings)) {
$ret['sort'] = array_map(function($x) { return [$x[0] => ['or... | php | private function constructSettings($settings) {
$ret = [];
if(array_key_exists('fields', $settings)) {
$ret['_source'] = ['include' => $settings['fields']];
}
if(array_key_exists('sort', $settings)) {
$ret['sort'] = array_map(function($x) { return [$x[0] => ['or... | [
"private",
"function",
"constructSettings",
"(",
"$",
"settings",
")",
"{",
"$",
"ret",
"=",
"[",
"]",
";",
"if",
"(",
"array_key_exists",
"(",
"'fields'",
",",
"$",
"settings",
")",
")",
"{",
"$",
"ret",
"[",
"'_source'",
"]",
"=",
"[",
"'include'",
... | Construct settings for the request body. | [
"Construct",
"settings",
"for",
"the",
"request",
"body",
"."
] | ad05f8d18cb9f1227a82f8d0b9d270882865b31d | https://github.com/kiwiz/esquery/blob/ad05f8d18cb9f1227a82f8d0b9d270882865b31d/src/Result.php#L487-L506 |
234,212 | kiwiz/esquery | src/Result.php | Result.processHitResultsRecurse | private function processHitResultsRecurse($results, $prefix=null) {
if(!is_array($results)) {
return [$prefix => $results];
}
$ret = [];
foreach($results as $key=>$result) {
// Flatten arrays.
$sub_prefix = is_null($prefix) ? $key:"$prefix.$key";
... | php | private function processHitResultsRecurse($results, $prefix=null) {
if(!is_array($results)) {
return [$prefix => $results];
}
$ret = [];
foreach($results as $key=>$result) {
// Flatten arrays.
$sub_prefix = is_null($prefix) ? $key:"$prefix.$key";
... | [
"private",
"function",
"processHitResultsRecurse",
"(",
"$",
"results",
",",
"$",
"prefix",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"results",
")",
")",
"{",
"return",
"[",
"$",
"prefix",
"=>",
"$",
"results",
"]",
";",
"}",
"$",... | Process any hit results recursively. | [
"Process",
"any",
"hit",
"results",
"recursively",
"."
] | ad05f8d18cb9f1227a82f8d0b9d270882865b31d | https://github.com/kiwiz/esquery/blob/ad05f8d18cb9f1227a82f8d0b9d270882865b31d/src/Result.php#L582-L594 |
234,213 | kiwiz/esquery | src/Result.php | Result.postProcessResults | private function postProcessResults($post_query, $results, $meta) {
if(is_null($post_query)) {
return $results;
}
$ret = [];
switch($post_query[0]) {
// Join up all results with a given key:value.
case Token::C_TRANS:
$key = $post_quer... | php | private function postProcessResults($post_query, $results, $meta) {
if(is_null($post_query)) {
return $results;
}
$ret = [];
switch($post_query[0]) {
// Join up all results with a given key:value.
case Token::C_TRANS:
$key = $post_quer... | [
"private",
"function",
"postProcessResults",
"(",
"$",
"post_query",
",",
"$",
"results",
",",
"$",
"meta",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"post_query",
")",
")",
"{",
"return",
"$",
"results",
";",
"}",
"$",
"ret",
"=",
"[",
"]",
";",
"... | Run any post-processing steps on the results. | [
"Run",
"any",
"post",
"-",
"processing",
"steps",
"on",
"the",
"results",
"."
] | ad05f8d18cb9f1227a82f8d0b9d270882865b31d | https://github.com/kiwiz/esquery/blob/ad05f8d18cb9f1227a82f8d0b9d270882865b31d/src/Result.php#L631-L667 |
234,214 | awurth/SlimHelpers | Controller/RouterTrait.php | RouterTrait.path | protected function path($route, array $params = [], array $queryParams = [])
{
return $this->container['router']->pathFor($route, $params, $queryParams);
} | php | protected function path($route, array $params = [], array $queryParams = [])
{
return $this->container['router']->pathFor($route, $params, $queryParams);
} | [
"protected",
"function",
"path",
"(",
"$",
"route",
",",
"array",
"$",
"params",
"=",
"[",
"]",
",",
"array",
"$",
"queryParams",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"container",
"[",
"'router'",
"]",
"->",
"pathFor",
"(",
"$",
"r... | Generates a URL from a route.
@param string $route
@param array $params
@param array $queryParams
@return string | [
"Generates",
"a",
"URL",
"from",
"a",
"route",
"."
] | abaa0e16e285148f4e4c6b2fd0bb176bce6dac36 | https://github.com/awurth/SlimHelpers/blob/abaa0e16e285148f4e4c6b2fd0bb176bce6dac36/Controller/RouterTrait.php#L18-L21 |
234,215 | awurth/SlimHelpers | Controller/RouterTrait.php | RouterTrait.relativePath | protected function relativePath($route, array $params = [], array $queryParams = [])
{
return $this->container['router']->relativePathFor($route, $params, $queryParams);
} | php | protected function relativePath($route, array $params = [], array $queryParams = [])
{
return $this->container['router']->relativePathFor($route, $params, $queryParams);
} | [
"protected",
"function",
"relativePath",
"(",
"$",
"route",
",",
"array",
"$",
"params",
"=",
"[",
"]",
",",
"array",
"$",
"queryParams",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"container",
"[",
"'router'",
"]",
"->",
"relativePathFor",
... | Generates a relative URL from a route.
@param string $route
@param array $params
@param array $queryParams
@return string | [
"Generates",
"a",
"relative",
"URL",
"from",
"a",
"route",
"."
] | abaa0e16e285148f4e4c6b2fd0bb176bce6dac36 | https://github.com/awurth/SlimHelpers/blob/abaa0e16e285148f4e4c6b2fd0bb176bce6dac36/Controller/RouterTrait.php#L32-L35 |
234,216 | awurth/SlimHelpers | Controller/RouterTrait.php | RouterTrait.redirect | protected function redirect(Response $response, $route, array $params = [])
{
return $response->withRedirect($this->container['router']->pathFor($route, $params));
} | php | protected function redirect(Response $response, $route, array $params = [])
{
return $response->withRedirect($this->container['router']->pathFor($route, $params));
} | [
"protected",
"function",
"redirect",
"(",
"Response",
"$",
"response",
",",
"$",
"route",
",",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"response",
"->",
"withRedirect",
"(",
"$",
"this",
"->",
"container",
"[",
"'router'",
"]",
... | Redirects to a route.
@param Response $response
@param string $route
@param array $params
@return Response | [
"Redirects",
"to",
"a",
"route",
"."
] | abaa0e16e285148f4e4c6b2fd0bb176bce6dac36 | https://github.com/awurth/SlimHelpers/blob/abaa0e16e285148f4e4c6b2fd0bb176bce6dac36/Controller/RouterTrait.php#L46-L49 |
234,217 | geocoder-php/maxmind-provider | MaxMind.php | MaxMind.fieldsForService | private function fieldsForService(string $service): array
{
switch ($service) {
case self::CITY_EXTENDED_SERVICE:
return [
'countryCode',
'regionCode',
'locality',
'postalCode',
'l... | php | private function fieldsForService(string $service): array
{
switch ($service) {
case self::CITY_EXTENDED_SERVICE:
return [
'countryCode',
'regionCode',
'locality',
'postalCode',
'l... | [
"private",
"function",
"fieldsForService",
"(",
"string",
"$",
"service",
")",
":",
"array",
"{",
"switch",
"(",
"$",
"service",
")",
"{",
"case",
"self",
"::",
"CITY_EXTENDED_SERVICE",
":",
"return",
"[",
"'countryCode'",
",",
"'regionCode'",
",",
"'locality'... | We do not support Country and City services because they do not return much fields.
@see http://dev.maxmind.com/geoip/web-services
@param string $service
@return string[] | [
"We",
"do",
"not",
"support",
"Country",
"and",
"City",
"services",
"because",
"they",
"do",
"not",
"return",
"much",
"fields",
"."
] | eddb07f690036fc95dd411de42158a68fb114cd8 | https://github.com/geocoder-php/maxmind-provider/blob/eddb07f690036fc95dd411de42158a68fb114cd8/MaxMind.php#L180-L226 |
234,218 | txj123/zilf | src/Zilf/DataCrawler/PhpQuery/phpQuery/Zend/Http/Cookie.php | Zend_Http_Cookie.isExpired | public function isExpired($now = null)
{
if ($now === null) { $now = time();
}
if (is_int($this->expires) && $this->expires < $now) {
return true;
} else {
return false;
}
} | php | public function isExpired($now = null)
{
if ($now === null) { $now = time();
}
if (is_int($this->expires) && $this->expires < $now) {
return true;
} else {
return false;
}
} | [
"public",
"function",
"isExpired",
"(",
"$",
"now",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"now",
"===",
"null",
")",
"{",
"$",
"now",
"=",
"time",
"(",
")",
";",
"}",
"if",
"(",
"is_int",
"(",
"$",
"this",
"->",
"expires",
")",
"&&",
"$",
"t... | Check whether the cookie has expired
Always returns false if the cookie is a session cookie (has no expiry time)
@param int $now Timestamp to consider as "now"
@return boolean | [
"Check",
"whether",
"the",
"cookie",
"has",
"expired"
] | 8fc979ae338e850e6f40bfb97d4d57869f9e4480 | https://github.com/txj123/zilf/blob/8fc979ae338e850e6f40bfb97d4d57869f9e4480/src/Zilf/DataCrawler/PhpQuery/phpQuery/Zend/Http/Cookie.php#L189-L198 |
234,219 | mcustiel/php-simple-di | src/Dependency.php | Dependency.get | public function get()
{
if (! $this->singleton) {
return call_user_func($this->loader);
}
if ($this->object === null) {
$this->object = call_user_func($this->loader);
}
return $this->object;
} | php | public function get()
{
if (! $this->singleton) {
return call_user_func($this->loader);
}
if ($this->object === null) {
$this->object = call_user_func($this->loader);
}
return $this->object;
} | [
"public",
"function",
"get",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"singleton",
")",
"{",
"return",
"call_user_func",
"(",
"$",
"this",
"->",
"loader",
")",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"object",
"===",
"null",
")",
"{",
"$... | Returns the specific dependency instance.
@return mixed | [
"Returns",
"the",
"specific",
"dependency",
"instance",
"."
] | da0116625d9704185c4a9f01210469266970b265 | https://github.com/mcustiel/php-simple-di/blob/da0116625d9704185c4a9f01210469266970b265/src/Dependency.php#L47-L57 |
234,220 | txj123/zilf | src/Zilf/Queue/RedisQueue.php | RedisQueue.blockingPop | protected function blockingPop($queue)
{
$rawBody = $this->getConnection()->blpop($queue, $this->blockFor);
if (! empty($rawBody)) {
$payload = json_decode($rawBody[1], true);
$payload['attempts']++;
$reserved = json_encode($payload);
$this->getCon... | php | protected function blockingPop($queue)
{
$rawBody = $this->getConnection()->blpop($queue, $this->blockFor);
if (! empty($rawBody)) {
$payload = json_decode($rawBody[1], true);
$payload['attempts']++;
$reserved = json_encode($payload);
$this->getCon... | [
"protected",
"function",
"blockingPop",
"(",
"$",
"queue",
")",
"{",
"$",
"rawBody",
"=",
"$",
"this",
"->",
"getConnection",
"(",
")",
"->",
"blpop",
"(",
"$",
"queue",
",",
"$",
"this",
"->",
"blockFor",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$... | Retrieve the next job by blocking-pop.
@param string $queue
@return array | [
"Retrieve",
"the",
"next",
"job",
"by",
"blocking",
"-",
"pop",
"."
] | 8fc979ae338e850e6f40bfb97d4d57869f9e4480 | https://github.com/txj123/zilf/blob/8fc979ae338e850e6f40bfb97d4d57869f9e4480/src/Zilf/Queue/RedisQueue.php#L234-L255 |
234,221 | txj123/zilf | src/Zilf/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php | MongoDbSessionHandler.createDateTime | private function createDateTime($seconds = null)
{
if (null === $seconds) {
$seconds = time();
}
if ($this->mongo instanceof \MongoDB\Client) {
return new \MongoDB\BSON\UTCDateTime($seconds * 1000);
}
return new \MongoDate($seconds);
} | php | private function createDateTime($seconds = null)
{
if (null === $seconds) {
$seconds = time();
}
if ($this->mongo instanceof \MongoDB\Client) {
return new \MongoDB\BSON\UTCDateTime($seconds * 1000);
}
return new \MongoDate($seconds);
} | [
"private",
"function",
"createDateTime",
"(",
"$",
"seconds",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"seconds",
")",
"{",
"$",
"seconds",
"=",
"time",
"(",
")",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"mongo",
"instanceof",
"\\",
"Mo... | Create a date object using the class appropriate for the current mongo connection.
Return an instance of a MongoDate or \MongoDB\BSON\UTCDateTime
@param int $seconds An integer representing UTC seconds since Jan 1 1970. Defaults to now. | [
"Create",
"a",
"date",
"object",
"using",
"the",
"class",
"appropriate",
"for",
"the",
"current",
"mongo",
"connection",
"."
] | 8fc979ae338e850e6f40bfb97d4d57869f9e4480 | https://github.com/txj123/zilf/blob/8fc979ae338e850e6f40bfb97d4d57869f9e4480/src/Zilf/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php#L226-L237 |
234,222 | txj123/zilf | src/Zilf/Db/Command.php | Command.logQuery | protected function logQuery($category)
{
if ($this->db->enableLogging) {
$rawSql = $this->getRawSql();
//Zilf::info($rawSql, $category);
}
if (!$this->db->enableProfiling) {
return [false, isset($rawSql) ? $rawSql : null];
}
return [true, ... | php | protected function logQuery($category)
{
if ($this->db->enableLogging) {
$rawSql = $this->getRawSql();
//Zilf::info($rawSql, $category);
}
if (!$this->db->enableProfiling) {
return [false, isset($rawSql) ? $rawSql : null];
}
return [true, ... | [
"protected",
"function",
"logQuery",
"(",
"$",
"category",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"db",
"->",
"enableLogging",
")",
"{",
"$",
"rawSql",
"=",
"$",
"this",
"->",
"getRawSql",
"(",
")",
";",
"//Zilf::info($rawSql, $category);",
"}",
"if",
"... | Logs the current database query if query logging is enabled and returns
the profiling token if profiling is enabled.
@param string $category the log category.
@return array array of two elements, the first is boolean of whether profiling is enabled or not.
The second is the rawSql if it has been created. | [
"Logs",
"the",
"current",
"database",
"query",
"if",
"query",
"logging",
"is",
"enabled",
"and",
"returns",
"the",
"profiling",
"token",
"if",
"profiling",
"is",
"enabled",
"."
] | 8fc979ae338e850e6f40bfb97d4d57869f9e4480 | https://github.com/txj123/zilf/blob/8fc979ae338e850e6f40bfb97d4d57869f9e4480/src/Zilf/Db/Command.php#L1162-L1173 |
234,223 | oxygen-cms/core | src/Html/Toolbar/Toolbar.php | Toolbar.setOrder | public function setOrder(array $keys) {
$this->itemsOrdered = [];
foreach($keys as $label => $value) {
if($value === 'spacer' || $value === '|') {
$this->itemsOrdered[] = $this->spacer;
} elseif(is_array($value)) {
$parts = explode(',', $label);
... | php | public function setOrder(array $keys) {
$this->itemsOrdered = [];
foreach($keys as $label => $value) {
if($value === 'spacer' || $value === '|') {
$this->itemsOrdered[] = $this->spacer;
} elseif(is_array($value)) {
$parts = explode(',', $label);
... | [
"public",
"function",
"setOrder",
"(",
"array",
"$",
"keys",
")",
"{",
"$",
"this",
"->",
"itemsOrdered",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"keys",
"as",
"$",
"label",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"===",
"'spacer'",... | Sets the order of items on the toolbar.
@param array $keys
@return void | [
"Sets",
"the",
"order",
"of",
"items",
"on",
"the",
"toolbar",
"."
] | 8f8349c669771d9a7a719a7b120821e06cb5a20b | https://github.com/oxygen-cms/core/blob/8f8349c669771d9a7a719a7b120821e06cb5a20b/src/Html/Toolbar/Toolbar.php#L122-L145 |
234,224 | oxygen-cms/core | src/Html/Toolbar/Toolbar.php | Toolbar.hasItem | public function hasItem($identifier) {
return isset($this->itemsPool[$this->prefix . '.' . $identifier]) || isset($this->itemsPool[$identifier]);
} | php | public function hasItem($identifier) {
return isset($this->itemsPool[$this->prefix . '.' . $identifier]) || isset($this->itemsPool[$identifier]);
} | [
"public",
"function",
"hasItem",
"(",
"$",
"identifier",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"itemsPool",
"[",
"$",
"this",
"->",
"prefix",
".",
"'.'",
".",
"$",
"identifier",
"]",
")",
"||",
"isset",
"(",
"$",
"this",
"->",
"itemsPo... | Determines a ToolbarItem exists.
@param string $identifier
@return boolean | [
"Determines",
"a",
"ToolbarItem",
"exists",
"."
] | 8f8349c669771d9a7a719a7b120821e06cb5a20b | https://github.com/oxygen-cms/core/blob/8f8349c669771d9a7a719a7b120821e06cb5a20b/src/Html/Toolbar/Toolbar.php#L153-L155 |
234,225 | oxygen-cms/core | src/Html/Toolbar/Toolbar.php | Toolbar.getItem | public function getItem($identifier) {
if(!isset($this->itemsPool[$identifier]) && $this->prefix !== null) {
return $this->itemsPool[$this->prefix . '.' . $identifier];
}
return $this->itemsPool[$identifier];
} | php | public function getItem($identifier) {
if(!isset($this->itemsPool[$identifier]) && $this->prefix !== null) {
return $this->itemsPool[$this->prefix . '.' . $identifier];
}
return $this->itemsPool[$identifier];
} | [
"public",
"function",
"getItem",
"(",
"$",
"identifier",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"itemsPool",
"[",
"$",
"identifier",
"]",
")",
"&&",
"$",
"this",
"->",
"prefix",
"!==",
"null",
")",
"{",
"return",
"$",
"this",
"-... | Get a ToolbarItem.
@param string $identifier
@return ToolbarItem | [
"Get",
"a",
"ToolbarItem",
"."
] | 8f8349c669771d9a7a719a7b120821e06cb5a20b | https://github.com/oxygen-cms/core/blob/8f8349c669771d9a7a719a7b120821e06cb5a20b/src/Html/Toolbar/Toolbar.php#L163-L169 |
234,226 | jcchavezs/dd-trace-php | src/DdTrace/Tracer.php | Tracer.flushTraces | public function flushTraces()
{
$spans = $this->buffer->pop();
$spansCount = $spans->count();
if ($this->debugLoggingEnabled) {
$this->logger->debug(sprintf("Sending %d spans", $spansCount));
foreach($spans as $span) {
$this->logger->debug(sprintf("S... | php | public function flushTraces()
{
$spans = $this->buffer->pop();
$spansCount = $spans->count();
if ($this->debugLoggingEnabled) {
$this->logger->debug(sprintf("Sending %d spans", $spansCount));
foreach($spans as $span) {
$this->logger->debug(sprintf("S... | [
"public",
"function",
"flushTraces",
"(",
")",
"{",
"$",
"spans",
"=",
"$",
"this",
"->",
"buffer",
"->",
"pop",
"(",
")",
";",
"$",
"spansCount",
"=",
"$",
"spans",
"->",
"count",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"debugLoggingEnabled",
... | FlushTraces will push any currently buffered traces to the server.
XXX Note that it is currently exported because some tests use it. They
really should not. | [
"FlushTraces",
"will",
"push",
"any",
"currently",
"buffered",
"traces",
"to",
"the",
"server",
".",
"XXX",
"Note",
"that",
"it",
"is",
"currently",
"exported",
"because",
"some",
"tests",
"use",
"it",
".",
"They",
"really",
"should",
"not",
"."
] | d10be51fc63cb5bfc4de19c1880fe7b5397a8b0d | https://github.com/jcchavezs/dd-trace-php/blob/d10be51fc63cb5bfc4de19c1880fe7b5397a8b0d/src/DdTrace/Tracer.php#L74-L94 |
234,227 | txj123/zilf | src/Zilf/Log/LogManager.php | LogManager.createSlackDriver | protected function createSlackDriver(array $config)
{
return new Monolog(
$this->parseChannel($config), [
$this->prepareHandler(
new SlackWebhookHandler(
$config['url'],
$config['channel'] ?? null,
$config['u... | php | protected function createSlackDriver(array $config)
{
return new Monolog(
$this->parseChannel($config), [
$this->prepareHandler(
new SlackWebhookHandler(
$config['url'],
$config['channel'] ?? null,
$config['u... | [
"protected",
"function",
"createSlackDriver",
"(",
"array",
"$",
"config",
")",
"{",
"return",
"new",
"Monolog",
"(",
"$",
"this",
"->",
"parseChannel",
"(",
"$",
"config",
")",
",",
"[",
"$",
"this",
"->",
"prepareHandler",
"(",
"new",
"SlackWebhookHandler"... | Create an instance of the Slack log driver.
@param array $config
@return \Psr\Log\LoggerInterface | [
"Create",
"an",
"instance",
"of",
"the",
"Slack",
"log",
"driver",
"."
] | 8fc979ae338e850e6f40bfb97d4d57869f9e4480 | https://github.com/txj123/zilf/blob/8fc979ae338e850e6f40bfb97d4d57869f9e4480/src/Zilf/Log/LogManager.php#L296-L314 |
234,228 | txj123/zilf | src/Zilf/Log/LogManager.php | LogManager.createSyslogDriver | protected function createSyslogDriver(array $config)
{
return new Monolog(
$this->parseChannel($config), [
$this->prepareHandler(
new SyslogHandler(
$this->app['config']['app.name'], $config['facility'] ?? LOG_USER, $this->level($config)
... | php | protected function createSyslogDriver(array $config)
{
return new Monolog(
$this->parseChannel($config), [
$this->prepareHandler(
new SyslogHandler(
$this->app['config']['app.name'], $config['facility'] ?? LOG_USER, $this->level($config)
... | [
"protected",
"function",
"createSyslogDriver",
"(",
"array",
"$",
"config",
")",
"{",
"return",
"new",
"Monolog",
"(",
"$",
"this",
"->",
"parseChannel",
"(",
"$",
"config",
")",
",",
"[",
"$",
"this",
"->",
"prepareHandler",
"(",
"new",
"SyslogHandler",
"... | Create an instance of the syslog log driver.
@param array $config
@return \Psr\Log\LoggerInterface | [
"Create",
"an",
"instance",
"of",
"the",
"syslog",
"log",
"driver",
"."
] | 8fc979ae338e850e6f40bfb97d4d57869f9e4480 | https://github.com/txj123/zilf/blob/8fc979ae338e850e6f40bfb97d4d57869f9e4480/src/Zilf/Log/LogManager.php#L322-L333 |
234,229 | txj123/zilf | src/Zilf/Log/LogManager.php | LogManager.createMonologDriver | protected function createMonologDriver(array $config)
{
if (!is_a($config['handler'], HandlerInterface::class, true)) {
throw new InvalidArgumentException(
$config['handler'] . ' must be an instance of ' . HandlerInterface::class
);
}
return new Monol... | php | protected function createMonologDriver(array $config)
{
if (!is_a($config['handler'], HandlerInterface::class, true)) {
throw new InvalidArgumentException(
$config['handler'] . ' must be an instance of ' . HandlerInterface::class
);
}
return new Monol... | [
"protected",
"function",
"createMonologDriver",
"(",
"array",
"$",
"config",
")",
"{",
"if",
"(",
"!",
"is_a",
"(",
"$",
"config",
"[",
"'handler'",
"]",
",",
"HandlerInterface",
"::",
"class",
",",
"true",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentEx... | Create an instance of any handler available in Monolog.
@param array $config
@return \Psr\Log\LoggerInterface
@throws \InvalidArgumentException
@throws \Illuminate\Contracts\Container\BindingResolutionException | [
"Create",
"an",
"instance",
"of",
"any",
"handler",
"available",
"in",
"Monolog",
"."
] | 8fc979ae338e850e6f40bfb97d4d57869f9e4480 | https://github.com/txj123/zilf/blob/8fc979ae338e850e6f40bfb97d4d57869f9e4480/src/Zilf/Log/LogManager.php#L363-L376 |
234,230 | oxygen-cms/core | src/View/StringView.php | StringView.gatherInfo | protected function gatherInfo() {
$info = new stdClass();
$info->contents = $this->contents;
$info->path = $this->path;
$info->lastModified = $this->lastModified;
return $info;
} | php | protected function gatherInfo() {
$info = new stdClass();
$info->contents = $this->contents;
$info->path = $this->path;
$info->lastModified = $this->lastModified;
return $info;
} | [
"protected",
"function",
"gatherInfo",
"(",
")",
"{",
"$",
"info",
"=",
"new",
"stdClass",
"(",
")",
";",
"$",
"info",
"->",
"contents",
"=",
"$",
"this",
"->",
"contents",
";",
"$",
"info",
"->",
"path",
"=",
"$",
"this",
"->",
"path",
";",
"$",
... | Gathers the information about the view.
@return \stdClass | [
"Gathers",
"the",
"information",
"about",
"the",
"view",
"."
] | 8f8349c669771d9a7a719a7b120821e06cb5a20b | https://github.com/oxygen-cms/core/blob/8f8349c669771d9a7a719a7b120821e06cb5a20b/src/View/StringView.php#L110-L117 |
234,231 | railken/search-query | src/Languages/BoomTree/Resolvers/ValueResolver.php | ValueResolver.parseValue | public function parseValue($value)
{
if (strlen($value) === 0) {
return $value;
}
if ($value[0] === '"' || $value[0] === "'") {
$value = substr($value, 1, -1);
}
$value = stripslashes($value);
return $value;
} | php | public function parseValue($value)
{
if (strlen($value) === 0) {
return $value;
}
if ($value[0] === '"' || $value[0] === "'") {
$value = substr($value, 1, -1);
}
$value = stripslashes($value);
return $value;
} | [
"public",
"function",
"parseValue",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"strlen",
"(",
"$",
"value",
")",
"===",
"0",
")",
"{",
"return",
"$",
"value",
";",
"}",
"if",
"(",
"$",
"value",
"[",
"0",
"]",
"===",
"'\"'",
"||",
"$",
"value",
"["... | Parse the value before adding to the node.
@param mixed $value
@return mixed | [
"Parse",
"the",
"value",
"before",
"adding",
"to",
"the",
"node",
"."
] | 06e1bfb3eb59347afec9ca764d6f8c3b691d6889 | https://github.com/railken/search-query/blob/06e1bfb3eb59347afec9ca764d6f8c3b691d6889/src/Languages/BoomTree/Resolvers/ValueResolver.php#L35-L48 |
234,232 | oxygen-cms/core | src/Html/Form/EditableField.php | EditableField.getValue | public function getValue() {
if($this->input->old($this->getMeta()->name)) {
return $this->getMeta()->getType()->transformInput($this->getMeta(), $this->input->old($this->getMeta()->name));
} else {
if($this->value !== null) {
return parent::getValue();
... | php | public function getValue() {
if($this->input->old($this->getMeta()->name)) {
return $this->getMeta()->getType()->transformInput($this->getMeta(), $this->input->old($this->getMeta()->name));
} else {
if($this->value !== null) {
return parent::getValue();
... | [
"public",
"function",
"getValue",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"input",
"->",
"old",
"(",
"$",
"this",
"->",
"getMeta",
"(",
")",
"->",
"name",
")",
")",
"{",
"return",
"$",
"this",
"->",
"getMeta",
"(",
")",
"->",
"getType",
"(",... | Get the value of the field.
@return mixed | [
"Get",
"the",
"value",
"of",
"the",
"field",
"."
] | 8f8349c669771d9a7a719a7b120821e06cb5a20b | https://github.com/oxygen-cms/core/blob/8f8349c669771d9a7a719a7b120821e06cb5a20b/src/Html/Form/EditableField.php#L49-L59 |
234,233 | krafthaus/bauhaus | src/KraftHaus/Bauhaus/Mapper/ScopeMapper.php | ScopeMapper.scope | public function scope($scope)
{
$scope = (new Scope())->scope($scope);
$this->scopes[] = $scope;
return $scope;
} | php | public function scope($scope)
{
$scope = (new Scope())->scope($scope);
$this->scopes[] = $scope;
return $scope;
} | [
"public",
"function",
"scope",
"(",
"$",
"scope",
")",
"{",
"$",
"scope",
"=",
"(",
"new",
"Scope",
"(",
")",
")",
"->",
"scope",
"(",
"$",
"scope",
")",
";",
"$",
"this",
"->",
"scopes",
"[",
"]",
"=",
"$",
"scope",
";",
"return",
"$",
"scope"... | Add a scope.
@param string $scope
@access public
@return ScopeMapper | [
"Add",
"a",
"scope",
"."
] | 02b6c5f4f7e5b5748d5300ab037feaff2a84ca80 | https://github.com/krafthaus/bauhaus/blob/02b6c5f4f7e5b5748d5300ab037feaff2a84ca80/src/KraftHaus/Bauhaus/Mapper/ScopeMapper.php#L38-L44 |
234,234 | awurth/SlimHelpers | Controller/RestTrait.php | RestTrait.created | protected function created(Response $response, $route, array $params = [])
{
return $this->redirect($response, $route, $params)->withStatus(201);
} | php | protected function created(Response $response, $route, array $params = [])
{
return $this->redirect($response, $route, $params)->withStatus(201);
} | [
"protected",
"function",
"created",
"(",
"Response",
"$",
"response",
",",
"$",
"route",
",",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"redirect",
"(",
"$",
"response",
",",
"$",
"route",
",",
"$",
"params",
")",
... | Returns a "201 Created" response with a location header.
@param Response $response
@param string $route
@param array $params
@return Response | [
"Returns",
"a",
"201",
"Created",
"response",
"with",
"a",
"location",
"header",
"."
] | abaa0e16e285148f4e4c6b2fd0bb176bce6dac36 | https://github.com/awurth/SlimHelpers/blob/abaa0e16e285148f4e4c6b2fd0bb176bce6dac36/Controller/RestTrait.php#L33-L36 |
234,235 | schmunk42/p3extensions | components/image/drivers/Image_ImageMagick_Driver.php | Image_ImageMagick_Driver.process | public function process($image, $actions, $dir, $file, $render = FALSE)
{
// We only need the filename
$image = $image['file'];
// Unique temporary filename
$this->tmp_image = $dir.'k2img--'.sha1(time().$dir.$file).substr($file, strrpos($file, '.'));
// Copy the image to the temporary file
copy($image, $... | php | public function process($image, $actions, $dir, $file, $render = FALSE)
{
// We only need the filename
$image = $image['file'];
// Unique temporary filename
$this->tmp_image = $dir.'k2img--'.sha1(time().$dir.$file).substr($file, strrpos($file, '.'));
// Copy the image to the temporary file
copy($image, $... | [
"public",
"function",
"process",
"(",
"$",
"image",
",",
"$",
"actions",
",",
"$",
"dir",
",",
"$",
"file",
",",
"$",
"render",
"=",
"FALSE",
")",
"{",
"// We only need the filename",
"$",
"image",
"=",
"$",
"image",
"[",
"'file'",
"]",
";",
"// Unique... | Creates a temporary image and executes the given actions. By creating a
temporary copy of the image before manipulating it, this process is atomic. | [
"Creates",
"a",
"temporary",
"image",
"and",
"executes",
"the",
"given",
"actions",
".",
"By",
"creating",
"a",
"temporary",
"copy",
"of",
"the",
"image",
"before",
"manipulating",
"it",
"this",
"process",
"is",
"atomic",
"."
] | 93999c06fc8e3eadd83983d001df231e46b06838 | https://github.com/schmunk42/p3extensions/blob/93999c06fc8e3eadd83983d001df231e46b06838/components/image/drivers/Image_ImageMagick_Driver.php#L57-L119 |
234,236 | oxygen-cms/core | src/Routing/BlueprintRegistrar.php | BlueprintRegistrar.blueprint | public function blueprint(Blueprint $blueprint) {
foreach($blueprint->getActions() as $action) {
$this->action($action);
}
} | php | public function blueprint(Blueprint $blueprint) {
foreach($blueprint->getActions() as $action) {
$this->action($action);
}
} | [
"public",
"function",
"blueprint",
"(",
"Blueprint",
"$",
"blueprint",
")",
"{",
"foreach",
"(",
"$",
"blueprint",
"->",
"getActions",
"(",
")",
"as",
"$",
"action",
")",
"{",
"$",
"this",
"->",
"action",
"(",
"$",
"action",
")",
";",
"}",
"}"
] | Generates a Route from a \Oxygen\Core\Blueprint\Blueprint
@param \Oxygen\Core\Blueprint\Blueprint $blueprint | [
"Generates",
"a",
"Route",
"from",
"a",
"\\",
"Oxygen",
"\\",
"Core",
"\\",
"Blueprint",
"\\",
"Blueprint"
] | 8f8349c669771d9a7a719a7b120821e06cb5a20b | https://github.com/oxygen-cms/core/blob/8f8349c669771d9a7a719a7b120821e06cb5a20b/src/Routing/BlueprintRegistrar.php#L36-L40 |
234,237 | oxygen-cms/core | src/Routing/BlueprintRegistrar.php | BlueprintRegistrar.action | public function action(Action $action) {
if($action->register === Action::REGISTER_AT_END) {
$this->registerActionsLast[] = $action;
} else {
if($action->register) {
$this->registerAction($action);
}
}
} | php | public function action(Action $action) {
if($action->register === Action::REGISTER_AT_END) {
$this->registerActionsLast[] = $action;
} else {
if($action->register) {
$this->registerAction($action);
}
}
} | [
"public",
"function",
"action",
"(",
"Action",
"$",
"action",
")",
"{",
"if",
"(",
"$",
"action",
"->",
"register",
"===",
"Action",
"::",
"REGISTER_AT_END",
")",
"{",
"$",
"this",
"->",
"registerActionsLast",
"[",
"]",
"=",
"$",
"action",
";",
"}",
"e... | Generates a Route from a Oxygen\Core\Action\Action
@param \Oxygen\Core\Action\Action $action | [
"Generates",
"a",
"Route",
"from",
"a",
"Oxygen",
"\\",
"Core",
"\\",
"Action",
"\\",
"Action"
] | 8f8349c669771d9a7a719a7b120821e06cb5a20b | https://github.com/oxygen-cms/core/blob/8f8349c669771d9a7a719a7b120821e06cb5a20b/src/Routing/BlueprintRegistrar.php#L47-L55 |
234,238 | txj123/zilf | src/Zilf/HttpFoundation/Request.php | Request.isMethodSafe | public function isMethodSafe(/* $andCacheable = true */)
{
if (!func_num_args() || func_get_arg(0)) {
// This deprecation should be turned into a BadMethodCallException in 4.0 (without adding the argument in the signature)
// then setting $andCacheable to false should be deprecated i... | php | public function isMethodSafe(/* $andCacheable = true */)
{
if (!func_num_args() || func_get_arg(0)) {
// This deprecation should be turned into a BadMethodCallException in 4.0 (without adding the argument in the signature)
// then setting $andCacheable to false should be deprecated i... | [
"public",
"function",
"isMethodSafe",
"(",
"/* $andCacheable = true */",
")",
"{",
"if",
"(",
"!",
"func_num_args",
"(",
")",
"||",
"func_get_arg",
"(",
"0",
")",
")",
"{",
"// This deprecation should be turned into a BadMethodCallException in 4.0 (without adding the argument... | Checks whether or not the method is safe.
@see https://tools.ietf.org/html/rfc7231#section-4.2.1
@param bool $andCacheable Adds the additional condition that the method should be cacheable. True by default.
@return bool | [
"Checks",
"whether",
"or",
"not",
"the",
"method",
"is",
"safe",
"."
] | 8fc979ae338e850e6f40bfb97d4d57869f9e4480 | https://github.com/txj123/zilf/blob/8fc979ae338e850e6f40bfb97d4d57869f9e4480/src/Zilf/HttpFoundation/Request.php#L1546-L1557 |
234,239 | txj123/zilf | src/Zilf/Cache/MemcachedConnector.php | MemcachedConnector.validateConnection | protected function validateConnection($memcached)
{
$status = $memcached->getVersion();
if (! is_array($status)) {
throw new RuntimeException('No Memcached servers added.');
}
if (in_array('255.255.255', $status) && count(array_unique($status)) === 1) {
thro... | php | protected function validateConnection($memcached)
{
$status = $memcached->getVersion();
if (! is_array($status)) {
throw new RuntimeException('No Memcached servers added.');
}
if (in_array('255.255.255', $status) && count(array_unique($status)) === 1) {
thro... | [
"protected",
"function",
"validateConnection",
"(",
"$",
"memcached",
")",
"{",
"$",
"status",
"=",
"$",
"memcached",
"->",
"getVersion",
"(",
")",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"status",
")",
")",
"{",
"throw",
"new",
"RuntimeException",
"(... | Validate the given Memcached connection.
@param \Memcached $memcached
@return \Memcached | [
"Validate",
"the",
"given",
"Memcached",
"connection",
"."
] | 8fc979ae338e850e6f40bfb97d4d57869f9e4480 | https://github.com/txj123/zilf/blob/8fc979ae338e850e6f40bfb97d4d57869f9e4480/src/Zilf/Cache/MemcachedConnector.php#L97-L110 |
234,240 | txj123/zilf | src/Zilf/DataCrawler/PhpQuery/phpQuery/Zend/Validate/StringLength.php | Zend_Validate_StringLength.setMin | public function setMin($min)
{
if (null !== $this->_max && $min > $this->_max) {
/**
* @see Zend_Validate_Exception
*/
include_once 'Zend/Validate/Exception.php';
throw new Zend_Validate_Exception(
"The minimum must be less than o... | php | public function setMin($min)
{
if (null !== $this->_max && $min > $this->_max) {
/**
* @see Zend_Validate_Exception
*/
include_once 'Zend/Validate/Exception.php';
throw new Zend_Validate_Exception(
"The minimum must be less than o... | [
"public",
"function",
"setMin",
"(",
"$",
"min",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"_max",
"&&",
"$",
"min",
">",
"$",
"this",
"->",
"_max",
")",
"{",
"/**\n * @see Zend_Validate_Exception\n */",
"include_once",
"'Z... | Sets the min option
@param integer $min
@throws Zend_Validate_Exception
@return Zend_Validate_StringLength Provides a fluent interface | [
"Sets",
"the",
"min",
"option"
] | 8fc979ae338e850e6f40bfb97d4d57869f9e4480 | https://github.com/txj123/zilf/blob/8fc979ae338e850e6f40bfb97d4d57869f9e4480/src/Zilf/DataCrawler/PhpQuery/phpQuery/Zend/Validate/StringLength.php#L104-L118 |
234,241 | txj123/zilf | src/Zilf/DataCrawler/PhpQuery/phpQuery/Zend/Validate/StringLength.php | Zend_Validate_StringLength.setMax | public function setMax($max)
{
if (null === $max) {
$this->_max = null;
} else if ($max < $this->_min) {
/**
* @see Zend_Validate_Exception
*/
include_once 'Zend/Validate/Exception.php';
throw new Zend_Validate_Exception(
... | php | public function setMax($max)
{
if (null === $max) {
$this->_max = null;
} else if ($max < $this->_min) {
/**
* @see Zend_Validate_Exception
*/
include_once 'Zend/Validate/Exception.php';
throw new Zend_Validate_Exception(
... | [
"public",
"function",
"setMax",
"(",
"$",
"max",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"max",
")",
"{",
"$",
"this",
"->",
"_max",
"=",
"null",
";",
"}",
"else",
"if",
"(",
"$",
"max",
"<",
"$",
"this",
"->",
"_min",
")",
"{",
"/**\n ... | Sets the max option
@param integer|null $max
@throws Zend_Validate_Exception
@return Zend_Validate_StringLength Provides a fluent interface | [
"Sets",
"the",
"max",
"option"
] | 8fc979ae338e850e6f40bfb97d4d57869f9e4480 | https://github.com/txj123/zilf/blob/8fc979ae338e850e6f40bfb97d4d57869f9e4480/src/Zilf/DataCrawler/PhpQuery/phpQuery/Zend/Validate/StringLength.php#L137-L155 |
234,242 | krafthaus/bauhaus | src/KraftHaus/Bauhaus/Builder/FilterBuilder.php | FilterBuilder.build | public function build()
{
$filterMapper = $this->getMapper();
$input = Input::all();
$result = new FilterResult();
foreach ($filterMapper->getFields() as $field) {
$clone = clone $field;
$name = $clone->getName();
if (Input::has($name)) {
$clone->setValue($input[$name]);
}
$clone->setCon... | php | public function build()
{
$filterMapper = $this->getMapper();
$input = Input::all();
$result = new FilterResult();
foreach ($filterMapper->getFields() as $field) {
$clone = clone $field;
$name = $clone->getName();
if (Input::has($name)) {
$clone->setValue($input[$name]);
}
$clone->setCon... | [
"public",
"function",
"build",
"(",
")",
"{",
"$",
"filterMapper",
"=",
"$",
"this",
"->",
"getMapper",
"(",
")",
";",
"$",
"input",
"=",
"Input",
"::",
"all",
"(",
")",
";",
"$",
"result",
"=",
"new",
"FilterResult",
"(",
")",
";",
"foreach",
"(",... | Build the filter data.
@return mixed|void | [
"Build",
"the",
"filter",
"data",
"."
] | 02b6c5f4f7e5b5748d5300ab037feaff2a84ca80 | https://github.com/krafthaus/bauhaus/blob/02b6c5f4f7e5b5748d5300ab037feaff2a84ca80/src/KraftHaus/Bauhaus/Builder/FilterBuilder.php#L35-L54 |
234,243 | oxygen-cms/core | src/View/ViewServiceProvider.php | ViewServiceProvider.registerBladeStringEngine | public function registerBladeStringEngine($resolver) {
$app = $this->app;
// The Compiler engine requires an instance of the CompilerInterface, which in
// this case will be the Blade compiler, so we'll first create the compiler
// instance to pass into the engine so it can compile the ... | php | public function registerBladeStringEngine($resolver) {
$app = $this->app;
// The Compiler engine requires an instance of the CompilerInterface, which in
// this case will be the Blade compiler, so we'll first create the compiler
// instance to pass into the engine so it can compile the ... | [
"public",
"function",
"registerBladeStringEngine",
"(",
"$",
"resolver",
")",
"{",
"$",
"app",
"=",
"$",
"this",
"->",
"app",
";",
"// The Compiler engine requires an instance of the CompilerInterface, which in",
"// this case will be the Blade compiler, so we'll first create the c... | Register the StringBladeCompiler implementation.
@param \Illuminate\View\Engines\EngineResolver $resolver
@return void | [
"Register",
"the",
"StringBladeCompiler",
"implementation",
"."
] | 8f8349c669771d9a7a719a7b120821e06cb5a20b | https://github.com/oxygen-cms/core/blob/8f8349c669771d9a7a719a7b120821e06cb5a20b/src/View/ViewServiceProvider.php#L87-L103 |
234,244 | superrbstudio/async | src/Superrb/Async/Handler.php | Handler.run | public function run(...$args): bool
{
$this->channel = new Channel($this->messageBuffer);
$this->pid = pcntl_fork();
// If $pid is set, we are in the parent process
if ($this->pid) {
// If we want the process to run asynchronously,
// we can just store the P... | php | public function run(...$args): bool
{
$this->channel = new Channel($this->messageBuffer);
$this->pid = pcntl_fork();
// If $pid is set, we are in the parent process
if ($this->pid) {
// If we want the process to run asynchronously,
// we can just store the P... | [
"public",
"function",
"run",
"(",
"...",
"$",
"args",
")",
":",
"bool",
"{",
"$",
"this",
"->",
"channel",
"=",
"new",
"Channel",
"(",
"$",
"this",
"->",
"messageBuffer",
")",
";",
"$",
"this",
"->",
"pid",
"=",
"pcntl_fork",
"(",
")",
";",
"// If ... | Run the forked process.
@param ... $args
@return bool | [
"Run",
"the",
"forked",
"process",
"."
] | 8ca958dd453588c8b474ccba01bc7f709714a03b | https://github.com/superrbstudio/async/blob/8ca958dd453588c8b474ccba01bc7f709714a03b/src/Superrb/Async/Handler.php#L117-L158 |
234,245 | superrbstudio/async | src/Superrb/Async/Handler.php | Handler.wait | public function wait(): bool
{
if (!$this->pid) {
throw new BadMethodCallException('wait can only be called from the parent of a forked process');
}
// Cascade the call to waitAll for asynchronous processes
if ($this->async) {
return $this->waitAll();
... | php | public function wait(): bool
{
if (!$this->pid) {
throw new BadMethodCallException('wait can only be called from the parent of a forked process');
}
// Cascade the call to waitAll for asynchronous processes
if ($this->async) {
return $this->waitAll();
... | [
"public",
"function",
"wait",
"(",
")",
":",
"bool",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"pid",
")",
"{",
"throw",
"new",
"BadMethodCallException",
"(",
"'wait can only be called from the parent of a forked process'",
")",
";",
"}",
"// Cascade the call to waitA... | Wait for a child process to complete.
@throws BadMethodCallException
@return bool | [
"Wait",
"for",
"a",
"child",
"process",
"to",
"complete",
"."
] | 8ca958dd453588c8b474ccba01bc7f709714a03b | https://github.com/superrbstudio/async/blob/8ca958dd453588c8b474ccba01bc7f709714a03b/src/Superrb/Async/Handler.php#L167-L193 |
234,246 | superrbstudio/async | src/Superrb/Async/Handler.php | Handler.waitAll | public function waitAll(): bool
{
if (!$this->pid) {
throw new BadMethodCallException('waitAll can only be called from the parent of a forked process');
}
if (!$this->async) {
throw new BadMethodCallException('waitAll can only be used with asynchronous forked process... | php | public function waitAll(): bool
{
if (!$this->pid) {
throw new BadMethodCallException('waitAll can only be called from the parent of a forked process');
}
if (!$this->async) {
throw new BadMethodCallException('waitAll can only be used with asynchronous forked process... | [
"public",
"function",
"waitAll",
"(",
")",
":",
"bool",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"pid",
")",
"{",
"throw",
"new",
"BadMethodCallException",
"(",
"'waitAll can only be called from the parent of a forked process'",
")",
";",
"}",
"if",
"(",
"!",
"... | Wait for all child processes to complete.
@throws BadMethodCallException
@return bool Whether ANY of the child processes failed | [
"Wait",
"for",
"all",
"child",
"processes",
"to",
"complete",
"."
] | 8ca958dd453588c8b474ccba01bc7f709714a03b | https://github.com/superrbstudio/async/blob/8ca958dd453588c8b474ccba01bc7f709714a03b/src/Superrb/Async/Handler.php#L202-L246 |
234,247 | superrbstudio/async | src/Superrb/Async/Handler.php | Handler.getMessages | public function getMessages(): Generator
{
if (!$this->pid) {
throw new BadMethodCallException('getMessages can only be called from the parent of a forked process');
}
// Loop through the messages and yield each item in the collection
foreach ($this->messages as $message... | php | public function getMessages(): Generator
{
if (!$this->pid) {
throw new BadMethodCallException('getMessages can only be called from the parent of a forked process');
}
// Loop through the messages and yield each item in the collection
foreach ($this->messages as $message... | [
"public",
"function",
"getMessages",
"(",
")",
":",
"Generator",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"pid",
")",
"{",
"throw",
"new",
"BadMethodCallException",
"(",
"'getMessages can only be called from the parent of a forked process'",
")",
";",
"}",
"// Loop t... | Get any messages received from child processes.
@return Generator | [
"Get",
"any",
"messages",
"received",
"from",
"child",
"processes",
"."
] | 8ca958dd453588c8b474ccba01bc7f709714a03b | https://github.com/superrbstudio/async/blob/8ca958dd453588c8b474ccba01bc7f709714a03b/src/Superrb/Async/Handler.php#L263-L273 |
234,248 | txj123/zilf | src/Zilf/Finder/Iterator/RecursiveDirectoryIterator.php | RecursiveDirectoryIterator.rewind | public function rewind()
{
if (false === $this->isRewindable()) {
return;
}
// @see https://bugs.php.net/68557
if (PHP_VERSION_ID < 50523 || PHP_VERSION_ID >= 50600 && PHP_VERSION_ID < 50607) {
parent::next();
}
parent::rewind();
} | php | public function rewind()
{
if (false === $this->isRewindable()) {
return;
}
// @see https://bugs.php.net/68557
if (PHP_VERSION_ID < 50523 || PHP_VERSION_ID >= 50600 && PHP_VERSION_ID < 50607) {
parent::next();
}
parent::rewind();
} | [
"public",
"function",
"rewind",
"(",
")",
"{",
"if",
"(",
"false",
"===",
"$",
"this",
"->",
"isRewindable",
"(",
")",
")",
"{",
"return",
";",
"}",
"// @see https://bugs.php.net/68557",
"if",
"(",
"PHP_VERSION_ID",
"<",
"50523",
"||",
"PHP_VERSION_ID",
">="... | Do nothing for non rewindable stream. | [
"Do",
"nothing",
"for",
"non",
"rewindable",
"stream",
"."
] | 8fc979ae338e850e6f40bfb97d4d57869f9e4480 | https://github.com/txj123/zilf/blob/8fc979ae338e850e6f40bfb97d4d57869f9e4480/src/Zilf/Finder/Iterator/RecursiveDirectoryIterator.php#L115-L127 |
234,249 | txj123/zilf | src/Zilf/Finder/Iterator/RecursiveDirectoryIterator.php | RecursiveDirectoryIterator.isRewindable | public function isRewindable()
{
if (null !== $this->rewindable) {
return $this->rewindable;
}
// workaround for an HHVM bug, should be removed when https://github.com/facebook/hhvm/issues/7281 is fixed
if ('' === $this->getPath()) {
return $this->rewindable ... | php | public function isRewindable()
{
if (null !== $this->rewindable) {
return $this->rewindable;
}
// workaround for an HHVM bug, should be removed when https://github.com/facebook/hhvm/issues/7281 is fixed
if ('' === $this->getPath()) {
return $this->rewindable ... | [
"public",
"function",
"isRewindable",
"(",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"rewindable",
")",
"{",
"return",
"$",
"this",
"->",
"rewindable",
";",
"}",
"// workaround for an HHVM bug, should be removed when https://github.com/facebook/hhvm/issues/... | Checks if the stream is rewindable.
@return bool true when the stream is rewindable, false otherwise | [
"Checks",
"if",
"the",
"stream",
"is",
"rewindable",
"."
] | 8fc979ae338e850e6f40bfb97d4d57869f9e4480 | https://github.com/txj123/zilf/blob/8fc979ae338e850e6f40bfb97d4d57869f9e4480/src/Zilf/Finder/Iterator/RecursiveDirectoryIterator.php#L134-L155 |
234,250 | txj123/zilf | src/Zilf/HttpFoundation/File/UploadedFile.php | UploadedFile.guessClientExtension | public function guessClientExtension()
{
$type = $this->getClientMimeType();
$guesser = ExtensionGuesser::getInstance();
return $guesser->guess($type);
} | php | public function guessClientExtension()
{
$type = $this->getClientMimeType();
$guesser = ExtensionGuesser::getInstance();
return $guesser->guess($type);
} | [
"public",
"function",
"guessClientExtension",
"(",
")",
"{",
"$",
"type",
"=",
"$",
"this",
"->",
"getClientMimeType",
"(",
")",
";",
"$",
"guesser",
"=",
"ExtensionGuesser",
"::",
"getInstance",
"(",
")",
";",
"return",
"$",
"guesser",
"->",
"guess",
"(",... | Returns the extension based on the client mime type.
If the mime type is unknown, returns null.
This method uses the mime type as guessed by getClientMimeType()
to guess the file extension. As such, the extension returned
by this method cannot be trusted.
For a trusted extension, use guessExtension() instead (which ... | [
"Returns",
"the",
"extension",
"based",
"on",
"the",
"client",
"mime",
"type",
"."
] | 8fc979ae338e850e6f40bfb97d4d57869f9e4480 | https://github.com/txj123/zilf/blob/8fc979ae338e850e6f40bfb97d4d57869f9e4480/src/Zilf/HttpFoundation/File/UploadedFile.php#L160-L166 |
234,251 | txj123/zilf | src/Zilf/HttpFoundation/File/UploadedFile.php | UploadedFile.isValid | public function isValid()
{
$isOk = $this->error === UPLOAD_ERR_OK;
return $this->test ? $isOk : $isOk && is_uploaded_file($this->getPathname());
} | php | public function isValid()
{
$isOk = $this->error === UPLOAD_ERR_OK;
return $this->test ? $isOk : $isOk && is_uploaded_file($this->getPathname());
} | [
"public",
"function",
"isValid",
"(",
")",
"{",
"$",
"isOk",
"=",
"$",
"this",
"->",
"error",
"===",
"UPLOAD_ERR_OK",
";",
"return",
"$",
"this",
"->",
"test",
"?",
"$",
"isOk",
":",
"$",
"isOk",
"&&",
"is_uploaded_file",
"(",
"$",
"this",
"->",
"get... | Returns whether the file was uploaded successfully.
@return bool True if the file has been uploaded with HTTP and no error occurred | [
"Returns",
"whether",
"the",
"file",
"was",
"uploaded",
"successfully",
"."
] | 8fc979ae338e850e6f40bfb97d4d57869f9e4480 | https://github.com/txj123/zilf/blob/8fc979ae338e850e6f40bfb97d4d57869f9e4480/src/Zilf/HttpFoundation/File/UploadedFile.php#L199-L204 |
234,252 | txj123/zilf | src/Zilf/Db/mssql/QueryBuilder.php | QueryBuilder.getAllColumnNames | protected function getAllColumnNames($modelClass = null)
{
if (!$modelClass) {
return null;
}
/* @var $modelClass \Zilf\Db\ActiveRecord */
$schema = $modelClass::getTableSchema();
return array_keys($schema->columns);
} | php | protected function getAllColumnNames($modelClass = null)
{
if (!$modelClass) {
return null;
}
/* @var $modelClass \Zilf\Db\ActiveRecord */
$schema = $modelClass::getTableSchema();
return array_keys($schema->columns);
} | [
"protected",
"function",
"getAllColumnNames",
"(",
"$",
"modelClass",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"modelClass",
")",
"{",
"return",
"null",
";",
"}",
"/* @var $modelClass \\Zilf\\Db\\ActiveRecord */",
"$",
"schema",
"=",
"$",
"modelClass",
"::",
... | Returns an array of column names given model name.
@param string $modelClass name of the model class
@return array|null array of column names | [
"Returns",
"an",
"array",
"of",
"column",
"names",
"given",
"model",
"name",
"."
] | 8fc979ae338e850e6f40bfb97d4d57869f9e4480 | https://github.com/txj123/zilf/blob/8fc979ae338e850e6f40bfb97d4d57869f9e4480/src/Zilf/Db/mssql/QueryBuilder.php#L309-L317 |
234,253 | txj123/zilf | src/Zilf/Db/mssql/QueryBuilder.php | QueryBuilder.normalizeTableRowData | private function normalizeTableRowData($table, $columns, &$params)
{
if (($tableSchema = $this->db->getSchema()->getTableSchema($table)) !== null) {
$columnSchemas = $tableSchema->columns;
foreach ($columns as $name => $value) {
// @see https://github.com/Zilfsoft/Zil... | php | private function normalizeTableRowData($table, $columns, &$params)
{
if (($tableSchema = $this->db->getSchema()->getTableSchema($table)) !== null) {
$columnSchemas = $tableSchema->columns;
foreach ($columns as $name => $value) {
// @see https://github.com/Zilfsoft/Zil... | [
"private",
"function",
"normalizeTableRowData",
"(",
"$",
"table",
",",
"$",
"columns",
",",
"&",
"$",
"params",
")",
"{",
"if",
"(",
"(",
"$",
"tableSchema",
"=",
"$",
"this",
"->",
"db",
"->",
"getSchema",
"(",
")",
"->",
"getTableSchema",
"(",
"$",
... | Normalizes data to be saved into the table, performing extra preparations and type converting, if necessary.
@param string $table the table that data will be saved into.
@param array $columns the column data (name => value) to be saved into the table.
@return array normalized columns | [
"Normalizes",
"data",
"to",
"be",
"saved",
"into",
"the",
"table",
"performing",
"extra",
"preparations",
"and",
"type",
"converting",
"if",
"necessary",
"."
] | 8fc979ae338e850e6f40bfb97d4d57869f9e4480 | https://github.com/txj123/zilf/blob/8fc979ae338e850e6f40bfb97d4d57869f9e4480/src/Zilf/Db/mssql/QueryBuilder.php#L347-L362 |
234,254 | crysalead/sql-dialect | src/Statement/Insert.php | Insert._buildValues | protected function _buildValues()
{
$states = $this->_schema ? ['schema' => $this->_schema] : [];
$parts = [];
foreach ($this->_parts['values'] as $values) {
$data = [];
foreach ($values as $key => $value) {
$states['name'] = $key;
$da... | php | protected function _buildValues()
{
$states = $this->_schema ? ['schema' => $this->_schema] : [];
$parts = [];
foreach ($this->_parts['values'] as $values) {
$data = [];
foreach ($values as $key => $value) {
$states['name'] = $key;
$da... | [
"protected",
"function",
"_buildValues",
"(",
")",
"{",
"$",
"states",
"=",
"$",
"this",
"->",
"_schema",
"?",
"[",
"'schema'",
"=>",
"$",
"this",
"->",
"_schema",
"]",
":",
"[",
"]",
";",
"$",
"parts",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"t... | Build `VALUES` clause.
@return string Returns the `VALUES` clause. | [
"Build",
"VALUES",
"clause",
"."
] | 867a768086fb3eb539752671a0dd54b949fe9d79 | https://github.com/crysalead/sql-dialect/blob/867a768086fb3eb539752671a0dd54b949fe9d79/src/Statement/Insert.php#L99-L112 |
234,255 | silverstripe/comment-notifications | src/Extensions/CommentNotifier.php | CommentNotifier.onAfterPostComment | public function onAfterPostComment(Comment $comment)
{
$parent = $comment->Parent();
if (!$parent || !$parent->hasMethod('notificationRecipients')) {
return;
}
// Ask parent to submit all recipients
$recipients = $parent->notificationRecipients($comment);
... | php | public function onAfterPostComment(Comment $comment)
{
$parent = $comment->Parent();
if (!$parent || !$parent->hasMethod('notificationRecipients')) {
return;
}
// Ask parent to submit all recipients
$recipients = $parent->notificationRecipients($comment);
... | [
"public",
"function",
"onAfterPostComment",
"(",
"Comment",
"$",
"comment",
")",
"{",
"$",
"parent",
"=",
"$",
"comment",
"->",
"Parent",
"(",
")",
";",
"if",
"(",
"!",
"$",
"parent",
"||",
"!",
"$",
"parent",
"->",
"hasMethod",
"(",
"'notificationRecipi... | Notify Members of the post there is a new comment.
@param Comment $comment | [
"Notify",
"Members",
"of",
"the",
"post",
"there",
"is",
"a",
"new",
"comment",
"."
] | e80a98630bb842146a32e88f3257231369e05ea2 | https://github.com/silverstripe/comment-notifications/blob/e80a98630bb842146a32e88f3257231369e05ea2/src/Extensions/CommentNotifier.php#L23-L37 |
234,256 | silverstripe/comment-notifications | src/Extensions/CommentNotifier.php | CommentNotifier.notifyCommentRecipient | public function notifyCommentRecipient($comment, $parent, $recipient)
{
$subject = $parent->notificationSubject($comment, $recipient);
$sender = $parent->notificationSender($comment, $recipient);
$template = $parent->notificationTemplate($comment, $recipient);
// Validate email
... | php | public function notifyCommentRecipient($comment, $parent, $recipient)
{
$subject = $parent->notificationSubject($comment, $recipient);
$sender = $parent->notificationSender($comment, $recipient);
$template = $parent->notificationTemplate($comment, $recipient);
// Validate email
... | [
"public",
"function",
"notifyCommentRecipient",
"(",
"$",
"comment",
",",
"$",
"parent",
",",
"$",
"recipient",
")",
"{",
"$",
"subject",
"=",
"$",
"parent",
"->",
"notificationSubject",
"(",
"$",
"comment",
",",
"$",
"recipient",
")",
";",
"$",
"sender",
... | Send comment notification to a given recipient
@param Comment $comment
@param DataObject $parent Object with the {@see CommentNotifiable} extension applied
@param Member|string $recipient Either a member object or an email address to which notifications should be sent | [
"Send",
"comment",
"notification",
"to",
"a",
"given",
"recipient"
] | e80a98630bb842146a32e88f3257231369e05ea2 | https://github.com/silverstripe/comment-notifications/blob/e80a98630bb842146a32e88f3257231369e05ea2/src/Extensions/CommentNotifier.php#L46-L92 |
234,257 | txj123/zilf | src/Zilf/DataCrawler/PhpQuery/phpQuery/Zend/Uri/Http.php | Zend_Uri_Http.fromString | public static function fromString($uri)
{
if (is_string($uri) === false) {
throw new InvalidArgumentException('$uri is not a string');
}
$uri = explode(':', $uri, 2);
$scheme = strtolower($uri[0]);
$schemeSpecific = isset($uri[1]) === true ? $u... | php | public static function fromString($uri)
{
if (is_string($uri) === false) {
throw new InvalidArgumentException('$uri is not a string');
}
$uri = explode(':', $uri, 2);
$scheme = strtolower($uri[0]);
$schemeSpecific = isset($uri[1]) === true ? $u... | [
"public",
"static",
"function",
"fromString",
"(",
"$",
"uri",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"uri",
")",
"===",
"false",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'$uri is not a string'",
")",
";",
"}",
"$",
"uri",
"=",
"e... | Creates a Zend_Uri_Http from the given string
@param string $uri String to create URI from, must start with
'http://' or 'https://'
@throws InvalidArgumentException When the given $uri is not a string or
does not start with http:// or https://
@throws Zend_Uri_Exception When the given $uri is invalid
@return ... | [
"Creates",
"a",
"Zend_Uri_Http",
"from",
"the",
"given",
"string"
] | 8fc979ae338e850e6f40bfb97d4d57869f9e4480 | https://github.com/txj123/zilf/blob/8fc979ae338e850e6f40bfb97d4d57869f9e4480/src/Zilf/DataCrawler/PhpQuery/phpQuery/Zend/Uri/Http.php#L150-L166 |
234,258 | txj123/zilf | src/Zilf/DataCrawler/PhpQuery/phpQuery/Zend/Uri/Http.php | Zend_Uri_Http.validatePassword | public function validatePassword($password = null)
{
if ($password === null) {
$password = $this->_password;
}
// If the password is empty, then it is considered valid
if (strlen($password) === 0) {
return true;
}
// If the password is nonemp... | php | public function validatePassword($password = null)
{
if ($password === null) {
$password = $this->_password;
}
// If the password is empty, then it is considered valid
if (strlen($password) === 0) {
return true;
}
// If the password is nonemp... | [
"public",
"function",
"validatePassword",
"(",
"$",
"password",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"password",
"===",
"null",
")",
"{",
"$",
"password",
"=",
"$",
"this",
"->",
"_password",
";",
"}",
"// If the password is empty, then it is considered valid"... | Returns true if and only if the password passes validation. If no password is passed,
then the password contained in the instance variable is used.
@param string $password The HTTP password
@throws Zend_Uri_Exception When password validation fails
@return boolean
@link http://www.faqs.org/rfcs/rfc2396.html | [
"Returns",
"true",
"if",
"and",
"only",
"if",
"the",
"password",
"passes",
"validation",
".",
"If",
"no",
"password",
"is",
"passed",
"then",
"the",
"password",
"contained",
"in",
"the",
"instance",
"variable",
"is",
"used",
"."
] | 8fc979ae338e850e6f40bfb97d4d57869f9e4480 | https://github.com/txj123/zilf/blob/8fc979ae338e850e6f40bfb97d4d57869f9e4480/src/Zilf/DataCrawler/PhpQuery/phpQuery/Zend/Uri/Http.php#L348-L375 |
234,259 | txj123/zilf | src/Zilf/DataCrawler/PhpQuery/phpQuery/Zend/Uri/Http.php | Zend_Uri_Http.validateHost | public function validateHost($host = null)
{
if ($host === null) {
$host = $this->_host;
}
// If the host is empty, then it is considered invalid
if (strlen($host) === 0) {
return false;
}
// Check the host against the allowed values; delegat... | php | public function validateHost($host = null)
{
if ($host === null) {
$host = $this->_host;
}
// If the host is empty, then it is considered invalid
if (strlen($host) === 0) {
return false;
}
// Check the host against the allowed values; delegat... | [
"public",
"function",
"validateHost",
"(",
"$",
"host",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"host",
"===",
"null",
")",
"{",
"$",
"host",
"=",
"$",
"this",
"->",
"_host",
";",
"}",
"// If the host is empty, then it is considered invalid",
"if",
"(",
"st... | Returns true if and only if the host string passes validation. If no host is passed,
then the host contained in the instance variable is used.
@param string $host The HTTP host
@return boolean
@uses Zend_Filter | [
"Returns",
"true",
"if",
"and",
"only",
"if",
"the",
"host",
"string",
"passes",
"validation",
".",
"If",
"no",
"host",
"is",
"passed",
"then",
"the",
"host",
"contained",
"in",
"the",
"instance",
"variable",
"is",
"used",
"."
] | 8fc979ae338e850e6f40bfb97d4d57869f9e4480 | https://github.com/txj123/zilf/blob/8fc979ae338e850e6f40bfb97d4d57869f9e4480/src/Zilf/DataCrawler/PhpQuery/phpQuery/Zend/Uri/Http.php#L415-L430 |
234,260 | txj123/zilf | src/Zilf/DataCrawler/PhpQuery/phpQuery/Zend/Uri/Http.php | Zend_Uri_Http.validatePort | public function validatePort($port = null)
{
if ($port === null) {
$port = $this->_port;
}
// If the port is empty, then it is considered valid
if (strlen($port) === 0) {
return true;
}
// Check the port against the allowed values
ret... | php | public function validatePort($port = null)
{
if ($port === null) {
$port = $this->_port;
}
// If the port is empty, then it is considered valid
if (strlen($port) === 0) {
return true;
}
// Check the port against the allowed values
ret... | [
"public",
"function",
"validatePort",
"(",
"$",
"port",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"port",
"===",
"null",
")",
"{",
"$",
"port",
"=",
"$",
"this",
"->",
"_port",
";",
"}",
"// If the port is empty, then it is considered valid",
"if",
"(",
"strl... | Returns true if and only if the TCP port string passes validation. If no port is passed,
then the port contained in the instance variable is used.
@param string $port The HTTP port
@return boolean | [
"Returns",
"true",
"if",
"and",
"only",
"if",
"the",
"TCP",
"port",
"string",
"passes",
"validation",
".",
"If",
"no",
"port",
"is",
"passed",
"then",
"the",
"port",
"contained",
"in",
"the",
"instance",
"variable",
"is",
"used",
"."
] | 8fc979ae338e850e6f40bfb97d4d57869f9e4480 | https://github.com/txj123/zilf/blob/8fc979ae338e850e6f40bfb97d4d57869f9e4480/src/Zilf/DataCrawler/PhpQuery/phpQuery/Zend/Uri/Http.php#L469-L482 |
234,261 | txj123/zilf | src/Zilf/DataCrawler/PhpQuery/phpQuery/Zend/Uri/Http.php | Zend_Uri_Http.validateFragment | public function validateFragment($fragment = null)
{
if ($fragment === null) {
$fragment = $this->_fragment;
}
// If fragment is empty, it is considered to be valid
if (strlen($fragment) === 0) {
return true;
}
// Determine whether the fragme... | php | public function validateFragment($fragment = null)
{
if ($fragment === null) {
$fragment = $this->_fragment;
}
// If fragment is empty, it is considered to be valid
if (strlen($fragment) === 0) {
return true;
}
// Determine whether the fragme... | [
"public",
"function",
"validateFragment",
"(",
"$",
"fragment",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"fragment",
"===",
"null",
")",
"{",
"$",
"fragment",
"=",
"$",
"this",
"->",
"_fragment",
";",
"}",
"// If fragment is empty, it is considered to be valid",
... | Returns true if and only if the fragment passes validation. If no fragment is passed,
then the fragment contained in the instance variable is used.
@param string $fragment Fragment of an URI
@throws Zend_Uri_Exception When fragment validation fails
@return boolean
@link http://www.faqs.org/rfcs/rfc2396.html | [
"Returns",
"true",
"if",
"and",
"only",
"if",
"the",
"fragment",
"passes",
"validation",
".",
"If",
"no",
"fragment",
"is",
"passed",
"then",
"the",
"fragment",
"contained",
"in",
"the",
"instance",
"variable",
"is",
"used",
"."
] | 8fc979ae338e850e6f40bfb97d4d57869f9e4480 | https://github.com/txj123/zilf/blob/8fc979ae338e850e6f40bfb97d4d57869f9e4480/src/Zilf/DataCrawler/PhpQuery/phpQuery/Zend/Uri/Http.php#L665-L685 |
234,262 | txj123/zilf | src/Zilf/Security/Hashids/Hashids.php | Hashids.encodeHex | public function encodeHex($str)
{
if (!ctype_xdigit((string)$str)) {
return '';
}
$numbers = trim(chunk_split($str, 12, ' '));
$numbers = explode(' ', $numbers);
foreach ($numbers as $i => $number) {
$numbers[$i] = hexdec('1' . $number);
}
... | php | public function encodeHex($str)
{
if (!ctype_xdigit((string)$str)) {
return '';
}
$numbers = trim(chunk_split($str, 12, ' '));
$numbers = explode(' ', $numbers);
foreach ($numbers as $i => $number) {
$numbers[$i] = hexdec('1' . $number);
}
... | [
"public",
"function",
"encodeHex",
"(",
"$",
"str",
")",
"{",
"if",
"(",
"!",
"ctype_xdigit",
"(",
"(",
"string",
")",
"$",
"str",
")",
")",
"{",
"return",
"''",
";",
"}",
"$",
"numbers",
"=",
"trim",
"(",
"chunk_split",
"(",
"$",
"str",
",",
"12... | Encode hexadecimal values and generate a hash string.
@param string $str
@return string | [
"Encode",
"hexadecimal",
"values",
"and",
"generate",
"a",
"hash",
"string",
"."
] | 8fc979ae338e850e6f40bfb97d4d57869f9e4480 | https://github.com/txj123/zilf/blob/8fc979ae338e850e6f40bfb97d4d57869f9e4480/src/Zilf/Security/Hashids/Hashids.php#L261-L275 |
234,263 | jlcd/api-cielo30 | src/Cielo.php | Cielo.cancelPayment | public function cancelPayment(CieloPayment $cieloPayment)
{
try {
$sale = (new CieloEcommerce($this->merchant, $this->environment))->cancelSale($cieloPayment->getId(), $cieloPayment->getValue());
$paymentData = $sale->jsonSerialize();
$paymentStatus = $sale->getStatus();... | php | public function cancelPayment(CieloPayment $cieloPayment)
{
try {
$sale = (new CieloEcommerce($this->merchant, $this->environment))->cancelSale($cieloPayment->getId(), $cieloPayment->getValue());
$paymentData = $sale->jsonSerialize();
$paymentStatus = $sale->getStatus();... | [
"public",
"function",
"cancelPayment",
"(",
"CieloPayment",
"$",
"cieloPayment",
")",
"{",
"try",
"{",
"$",
"sale",
"=",
"(",
"new",
"CieloEcommerce",
"(",
"$",
"this",
"->",
"merchant",
",",
"$",
"this",
"->",
"environment",
")",
")",
"->",
"cancelSale",
... | Executes a payment refund request on Cielo
@param CieloPayment $cieloPayment
@throws ResourceErrorException
@return ResourceResponse | [
"Executes",
"a",
"payment",
"refund",
"request",
"on",
"Cielo"
] | a8f24e8878a7bd2990565fe889d89116c2aecfa7 | https://github.com/jlcd/api-cielo30/blob/a8f24e8878a7bd2990565fe889d89116c2aecfa7/src/Cielo.php#L89-L103 |
234,264 | dave-redfern/laravel-doctrine-tenancy | src/TenancyServiceProvider.php | TenancyServiceProvider.registerTenantAwareViewFinder | protected function registerTenantAwareViewFinder(Repository $config)
{
$this->app->bind('view.finder', function ($app) use ($config) {
$paths = $config['view.paths'];
return new FileViewFinder($app['files'], $paths);
});
} | php | protected function registerTenantAwareViewFinder(Repository $config)
{
$this->app->bind('view.finder', function ($app) use ($config) {
$paths = $config['view.paths'];
return new FileViewFinder($app['files'], $paths);
});
} | [
"protected",
"function",
"registerTenantAwareViewFinder",
"(",
"Repository",
"$",
"config",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"bind",
"(",
"'view.finder'",
",",
"function",
"(",
"$",
"app",
")",
"use",
"(",
"$",
"config",
")",
"{",
"$",
"paths",
... | Re-register the view finder with one that allows manipulating the paths array
@param Repository $config
@return void | [
"Re",
"-",
"register",
"the",
"view",
"finder",
"with",
"one",
"that",
"allows",
"manipulating",
"the",
"paths",
"array"
] | 3307fc57ad64d5a4dd5dfb235e19b301661255f9 | https://github.com/dave-redfern/laravel-doctrine-tenancy/blob/3307fc57ad64d5a4dd5dfb235e19b301661255f9/src/TenancyServiceProvider.php#L167-L174 |
234,265 | dave-redfern/laravel-doctrine-tenancy | src/TenancyServiceProvider.php | TenancyServiceProvider.registerMultiAccountTenancy | protected function registerMultiAccountTenancy(Repository $config)
{
if (!$config->get('tenancy.multi_account.enabled', false)) {
return;
}
$this->registerMultiAccountParticipantRepository($config);
$this->registerTenantParticipantMappings($config->get('tenancy.multi_acc... | php | protected function registerMultiAccountTenancy(Repository $config)
{
if (!$config->get('tenancy.multi_account.enabled', false)) {
return;
}
$this->registerMultiAccountParticipantRepository($config);
$this->registerTenantParticipantMappings($config->get('tenancy.multi_acc... | [
"protected",
"function",
"registerMultiAccountTenancy",
"(",
"Repository",
"$",
"config",
")",
"{",
"if",
"(",
"!",
"$",
"config",
"->",
"get",
"(",
"'tenancy.multi_account.enabled'",
",",
"false",
")",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"regis... | Set-up multi-account tenancy services
@param Repository $config | [
"Set",
"-",
"up",
"multi",
"-",
"account",
"tenancy",
"services"
] | 3307fc57ad64d5a4dd5dfb235e19b301661255f9 | https://github.com/dave-redfern/laravel-doctrine-tenancy/blob/3307fc57ad64d5a4dd5dfb235e19b301661255f9/src/TenancyServiceProvider.php#L215-L223 |
234,266 | dave-redfern/laravel-doctrine-tenancy | src/TenancyServiceProvider.php | TenancyServiceProvider.registerMultiSiteTenancy | protected function registerMultiSiteTenancy(Repository $config)
{
if (!$config->get('tenancy.multi_site.enabled', false)) {
return;
}
if (!$this->app instanceof TenantAwareApplication) {
throw new \RuntimeException(
'Multi-site requires updating your ... | php | protected function registerMultiSiteTenancy(Repository $config)
{
if (!$config->get('tenancy.multi_site.enabled', false)) {
return;
}
if (!$this->app instanceof TenantAwareApplication) {
throw new \RuntimeException(
'Multi-site requires updating your ... | [
"protected",
"function",
"registerMultiSiteTenancy",
"(",
"Repository",
"$",
"config",
")",
"{",
"if",
"(",
"!",
"$",
"config",
"->",
"get",
"(",
"'tenancy.multi_site.enabled'",
",",
"false",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"$",
"this",
... | Set-up and check the app for multi-site tenancy
@param Repository $config | [
"Set",
"-",
"up",
"and",
"check",
"the",
"app",
"for",
"multi",
"-",
"site",
"tenancy"
] | 3307fc57ad64d5a4dd5dfb235e19b301661255f9 | https://github.com/dave-redfern/laravel-doctrine-tenancy/blob/3307fc57ad64d5a4dd5dfb235e19b301661255f9/src/TenancyServiceProvider.php#L230-L251 |
234,267 | dave-redfern/laravel-doctrine-tenancy | src/TenancyServiceProvider.php | TenancyServiceProvider.registerTenantParticipantMappings | protected function registerTenantParticipantMappings(array $mappings = [])
{
$resolver = $this->app->make('auth.tenant.type_resolver');
foreach ($mappings as $alias => $class) {
$resolver->addMapping($alias, $class);
}
} | php | protected function registerTenantParticipantMappings(array $mappings = [])
{
$resolver = $this->app->make('auth.tenant.type_resolver');
foreach ($mappings as $alias => $class) {
$resolver->addMapping($alias, $class);
}
} | [
"protected",
"function",
"registerTenantParticipantMappings",
"(",
"array",
"$",
"mappings",
"=",
"[",
"]",
")",
"{",
"$",
"resolver",
"=",
"$",
"this",
"->",
"app",
"->",
"make",
"(",
"'auth.tenant.type_resolver'",
")",
";",
"foreach",
"(",
"$",
"mappings",
... | Register the participant mapping aliases
@param array $mappings
@return void | [
"Register",
"the",
"participant",
"mapping",
"aliases"
] | 3307fc57ad64d5a4dd5dfb235e19b301661255f9 | https://github.com/dave-redfern/laravel-doctrine-tenancy/blob/3307fc57ad64d5a4dd5dfb235e19b301661255f9/src/TenancyServiceProvider.php#L262-L268 |
234,268 | oxygen-cms/core | src/Console/BlueprintListCommand.php | BlueprintListCommand.getTable | protected function getTable(array $blueprints) {
$results = [];
foreach($blueprints as $key => $blueprint) {
$results[] = $this->getGeneralInformation($key, $blueprint);
}
return array_filter($results);
} | php | protected function getTable(array $blueprints) {
$results = [];
foreach($blueprints as $key => $blueprint) {
$results[] = $this->getGeneralInformation($key, $blueprint);
}
return array_filter($results);
} | [
"protected",
"function",
"getTable",
"(",
"array",
"$",
"blueprints",
")",
"{",
"$",
"results",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"blueprints",
"as",
"$",
"key",
"=>",
"$",
"blueprint",
")",
"{",
"$",
"results",
"[",
"]",
"=",
"$",
"this",
"... | Compile the blueprints into a displayable format.
@param array $blueprints
@return array | [
"Compile",
"the",
"blueprints",
"into",
"a",
"displayable",
"format",
"."
] | 8f8349c669771d9a7a719a7b120821e06cb5a20b | https://github.com/oxygen-cms/core/blob/8f8349c669771d9a7a719a7b120821e06cb5a20b/src/Console/BlueprintListCommand.php#L63-L71 |
234,269 | opis/orm | src/Core/EntityMapper.php | EntityMapper.getTable | public function getTable(): string
{
if ($this->table === null) {
$this->table = $this->getEntityName() . 's';
}
return $this->table;
} | php | public function getTable(): string
{
if ($this->table === null) {
$this->table = $this->getEntityName() . 's';
}
return $this->table;
} | [
"public",
"function",
"getTable",
"(",
")",
":",
"string",
"{",
"if",
"(",
"$",
"this",
"->",
"table",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"table",
"=",
"$",
"this",
"->",
"getEntityName",
"(",
")",
".",
"'s'",
";",
"}",
"return",
"$",
"t... | Get the entity's table
@return string | [
"Get",
"the",
"entity",
"s",
"table"
] | 2723235be55242cd20452b8c9648d4823b7ce8b5 | https://github.com/opis/orm/blob/2723235be55242cd20452b8c9648d4823b7ce8b5/src/Core/EntityMapper.php#L271-L278 |
234,270 | opis/orm | src/Core/EntityMapper.php | EntityMapper.getForeignKey | public function getForeignKey(): ForeignKey
{
if ($this->foreignKey === null) {
$pk = $this->getPrimaryKey();
$prefix = $this->getEntityName();
$this->foreignKey = new class($pk, $prefix) extends ForeignKey
{
/**
* constructor... | php | public function getForeignKey(): ForeignKey
{
if ($this->foreignKey === null) {
$pk = $this->getPrimaryKey();
$prefix = $this->getEntityName();
$this->foreignKey = new class($pk, $prefix) extends ForeignKey
{
/**
* constructor... | [
"public",
"function",
"getForeignKey",
"(",
")",
":",
"ForeignKey",
"{",
"if",
"(",
"$",
"this",
"->",
"foreignKey",
"===",
"null",
")",
"{",
"$",
"pk",
"=",
"$",
"this",
"->",
"getPrimaryKey",
"(",
")",
";",
"$",
"prefix",
"=",
"$",
"this",
"->",
... | Get the default foreign key
@return ForeignKey | [
"Get",
"the",
"default",
"foreign",
"key"
] | 2723235be55242cd20452b8c9648d4823b7ce8b5 | https://github.com/opis/orm/blob/2723235be55242cd20452b8c9648d4823b7ce8b5/src/Core/EntityMapper.php#L304-L328 |
234,271 | opis/orm | src/Core/EntityMapper.php | EntityMapper.getEntityName | protected function getEntityName()
{
if ($this->entityName === null) {
$name = $this->entityClass;
if (false !== $pos = strrpos($name, '\\')) {
$name = substr($name, $pos + 1);
}
$name = strtolower(preg_replace('/([^A-Z])([A-Z])/', "$1_$2", $n... | php | protected function getEntityName()
{
if ($this->entityName === null) {
$name = $this->entityClass;
if (false !== $pos = strrpos($name, '\\')) {
$name = substr($name, $pos + 1);
}
$name = strtolower(preg_replace('/([^A-Z])([A-Z])/', "$1_$2", $n... | [
"protected",
"function",
"getEntityName",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"entityName",
"===",
"null",
")",
"{",
"$",
"name",
"=",
"$",
"this",
"->",
"entityClass",
";",
"if",
"(",
"false",
"!==",
"$",
"pos",
"=",
"strrpos",
"(",
"$",
... | Returns the entity's name
@return string | [
"Returns",
"the",
"entity",
"s",
"name"
] | 2723235be55242cd20452b8c9648d4823b7ce8b5 | https://github.com/opis/orm/blob/2723235be55242cd20452b8c9648d4823b7ce8b5/src/Core/EntityMapper.php#L445-L459 |
234,272 | kiwiz/esquery | src/Settings.php | Settings.load | public function load($arr) {
foreach($arr as $key=>$value) {
if(array_key_exists($key, self::$KEYS)) {
if($this->valid(self::$KEYS[$key], $value)) {
$this->$key = $value;
}
}
}
} | php | public function load($arr) {
foreach($arr as $key=>$value) {
if(array_key_exists($key, self::$KEYS)) {
if($this->valid(self::$KEYS[$key], $value)) {
$this->$key = $value;
}
}
}
} | [
"public",
"function",
"load",
"(",
"$",
"arr",
")",
"{",
"foreach",
"(",
"$",
"arr",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"key",
",",
"self",
"::",
"$",
"KEYS",
")",
")",
"{",
"if",
"(",
"$",
... | Load settings from an array.
@param array $arr Settings array. | [
"Load",
"settings",
"from",
"an",
"array",
"."
] | ad05f8d18cb9f1227a82f8d0b9d270882865b31d | https://github.com/kiwiz/esquery/blob/ad05f8d18cb9f1227a82f8d0b9d270882865b31d/src/Settings.php#L65-L73 |
234,273 | kiwiz/esquery | src/Settings.php | Settings.valid | private function valid($types, $value) {
$types = (array) $types;
foreach($types as $type) {
switch($type) {
case self::T_NULL:
if(is_null($value)) {
return true;
}
break;
case self::T_INT:
... | php | private function valid($types, $value) {
$types = (array) $types;
foreach($types as $type) {
switch($type) {
case self::T_NULL:
if(is_null($value)) {
return true;
}
break;
case self::T_INT:
... | [
"private",
"function",
"valid",
"(",
"$",
"types",
",",
"$",
"value",
")",
"{",
"$",
"types",
"=",
"(",
"array",
")",
"$",
"types",
";",
"foreach",
"(",
"$",
"types",
"as",
"$",
"type",
")",
"{",
"switch",
"(",
"$",
"type",
")",
"{",
"case",
"s... | Check type.
@param int|int[] $types
@param mixed $value
@return bool Valid | [
"Check",
"type",
"."
] | ad05f8d18cb9f1227a82f8d0b9d270882865b31d | https://github.com/kiwiz/esquery/blob/ad05f8d18cb9f1227a82f8d0b9d270882865b31d/src/Settings.php#L81-L110 |
234,274 | kiwiz/esquery | src/Settings.php | Settings.copy | public function copy() {
$settings = new Settings();
$settings->fields = $this->fields;
$settings->map = $this->map;
$settings->flatten = $this->flatten;
$settings->sort = $this->sort;
$settings->count = $this->count;
return $settings;
} | php | public function copy() {
$settings = new Settings();
$settings->fields = $this->fields;
$settings->map = $this->map;
$settings->flatten = $this->flatten;
$settings->sort = $this->sort;
$settings->count = $this->count;
return $settings;
} | [
"public",
"function",
"copy",
"(",
")",
"{",
"$",
"settings",
"=",
"new",
"Settings",
"(",
")",
";",
"$",
"settings",
"->",
"fields",
"=",
"$",
"this",
"->",
"fields",
";",
"$",
"settings",
"->",
"map",
"=",
"$",
"this",
"->",
"map",
";",
"$",
"s... | Create a new object, copying over global settings.
@return Settings | [
"Create",
"a",
"new",
"object",
"copying",
"over",
"global",
"settings",
"."
] | ad05f8d18cb9f1227a82f8d0b9d270882865b31d | https://github.com/kiwiz/esquery/blob/ad05f8d18cb9f1227a82f8d0b9d270882865b31d/src/Settings.php#L116-L124 |
234,275 | crysalead/sql-dialect | src/Statement/CreateTable.php | CreateTable.toString | public function toString()
{
if (!$this->_parts['table']) {
throw new SqlException("Invalid `CREATE TABLE` statement missing table name.");
}
if (!$this->_parts['columns']) {
throw new SqlException("Invalid `CREATE TABLE` statement missing columns.");
}
... | php | public function toString()
{
if (!$this->_parts['table']) {
throw new SqlException("Invalid `CREATE TABLE` statement missing table name.");
}
if (!$this->_parts['columns']) {
throw new SqlException("Invalid `CREATE TABLE` statement missing columns.");
}
... | [
"public",
"function",
"toString",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_parts",
"[",
"'table'",
"]",
")",
"{",
"throw",
"new",
"SqlException",
"(",
"\"Invalid `CREATE TABLE` statement missing table name.\"",
")",
";",
"}",
"if",
"(",
"!",
"$",
... | Render the SQL statement.
@return string The generated SQL string. | [
"Render",
"the",
"SQL",
"statement",
"."
] | 867a768086fb3eb539752671a0dd54b949fe9d79 | https://github.com/crysalead/sql-dialect/blob/867a768086fb3eb539752671a0dd54b949fe9d79/src/Statement/CreateTable.php#L115-L130 |
234,276 | crysalead/sql-dialect | src/Statement/CreateTable.php | CreateTable._buildDefinition | protected function _buildDefinition($columns, $constraints)
{
foreach ($columns as $name => $field) {
$field['name'] = $name;
$field = $this->dialect()->field($field);
if (!empty($field['serial'])) {
$primary = $name;
}
$result[] =... | php | protected function _buildDefinition($columns, $constraints)
{
foreach ($columns as $name => $field) {
$field['name'] = $name;
$field = $this->dialect()->field($field);
if (!empty($field['serial'])) {
$primary = $name;
}
$result[] =... | [
"protected",
"function",
"_buildDefinition",
"(",
"$",
"columns",
",",
"$",
"constraints",
")",
"{",
"foreach",
"(",
"$",
"columns",
"as",
"$",
"name",
"=>",
"$",
"field",
")",
"{",
"$",
"field",
"[",
"'name'",
"]",
"=",
"$",
"name",
";",
"$",
"field... | Helper for building columns definition.
@param array $columns The columns.
@param array $constraints The columns constraints.
@return string The SQL columns definition list. | [
"Helper",
"for",
"building",
"columns",
"definition",
"."
] | 867a768086fb3eb539752671a0dd54b949fe9d79 | https://github.com/crysalead/sql-dialect/blob/867a768086fb3eb539752671a0dd54b949fe9d79/src/Statement/CreateTable.php#L139-L168 |
234,277 | txj123/zilf | src/Zilf/Validation/Validator.php | Validator.validateDate | protected function validateDate($attribute, $value)
{
if ($value instanceof DateTime) {
return true;
}
if (strtotime($value) === false) {
return false;
}
$date = date_parse($value);
return checkdate($date['month'], $date['day'], $date['year'... | php | protected function validateDate($attribute, $value)
{
if ($value instanceof DateTime) {
return true;
}
if (strtotime($value) === false) {
return false;
}
$date = date_parse($value);
return checkdate($date['month'], $date['day'], $date['year'... | [
"protected",
"function",
"validateDate",
"(",
"$",
"attribute",
",",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"instanceof",
"DateTime",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"strtotime",
"(",
"$",
"value",
")",
"===",
"false",
")",
... | Validate that an attribute is a valid date.
@param string $attribute
@param mixed $value
@return bool | [
"Validate",
"that",
"an",
"attribute",
"is",
"a",
"valid",
"date",
"."
] | 8fc979ae338e850e6f40bfb97d4d57869f9e4480 | https://github.com/txj123/zilf/blob/8fc979ae338e850e6f40bfb97d4d57869f9e4480/src/Zilf/Validation/Validator.php#L1262-L1275 |
234,278 | txj123/zilf | src/Zilf/Validation/Validator.php | Validator.callExtension | protected function callExtension($rule, $parameters)
{
$callback = $this->extensions[$rule];
if ($callback instanceof Closure) {
return call_user_func_array($callback, $parameters);
} elseif (is_string($callback)) {
return $this->callClassBasedExtension($callback, $p... | php | protected function callExtension($rule, $parameters)
{
$callback = $this->extensions[$rule];
if ($callback instanceof Closure) {
return call_user_func_array($callback, $parameters);
} elseif (is_string($callback)) {
return $this->callClassBasedExtension($callback, $p... | [
"protected",
"function",
"callExtension",
"(",
"$",
"rule",
",",
"$",
"parameters",
")",
"{",
"$",
"callback",
"=",
"$",
"this",
"->",
"extensions",
"[",
"$",
"rule",
"]",
";",
"if",
"(",
"$",
"callback",
"instanceof",
"Closure",
")",
"{",
"return",
"c... | Call a custom validator extension.
@param string $rule
@param array $parameters
@return bool | [
"Call",
"a",
"custom",
"validator",
"extension",
"."
] | 8fc979ae338e850e6f40bfb97d4d57869f9e4480 | https://github.com/txj123/zilf/blob/8fc979ae338e850e6f40bfb97d4d57869f9e4480/src/Zilf/Validation/Validator.php#L2460-L2469 |
234,279 | txj123/zilf | src/Zilf/DataCrawler/PhpQuery/phpQuery/Zend/Json/Decoder.php | Zend_Json_Decoder._decodeValue | protected function _decodeValue()
{
switch ($this->_token) {
case self::DATUM:
$result = $this->_tokenValue;
$this->_getNextToken();
return($result);
break;
case self::LBRACE:
return($this->_decodeObject());
bre... | php | protected function _decodeValue()
{
switch ($this->_token) {
case self::DATUM:
$result = $this->_tokenValue;
$this->_getNextToken();
return($result);
break;
case self::LBRACE:
return($this->_decodeObject());
bre... | [
"protected",
"function",
"_decodeValue",
"(",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"_token",
")",
"{",
"case",
"self",
"::",
"DATUM",
":",
"$",
"result",
"=",
"$",
"this",
"->",
"_tokenValue",
";",
"$",
"this",
"->",
"_getNextToken",
"(",
")",
... | Recursive driving rountine for supported toplevel tops
@return mixed | [
"Recursive",
"driving",
"rountine",
"for",
"supported",
"toplevel",
"tops"
] | 8fc979ae338e850e6f40bfb97d4d57869f9e4480 | https://github.com/txj123/zilf/blob/8fc979ae338e850e6f40bfb97d4d57869f9e4480/src/Zilf/DataCrawler/PhpQuery/phpQuery/Zend/Json/Decoder.php#L168-L186 |
234,280 | txj123/zilf | src/Zilf/DataCrawler/PhpQuery/phpQuery/Zend/Json/Decoder.php | Zend_Json_Decoder._eatWhitespace | protected function _eatWhitespace()
{
if (preg_match(
'/([\t\b\f\n\r ])*/s',
$this->_source,
$matches,
PREG_OFFSET_CAPTURE,
$this->_offset
)
&& $matches[0][1] == $this->_offset
) {
$this->_offset += strlen($m... | php | protected function _eatWhitespace()
{
if (preg_match(
'/([\t\b\f\n\r ])*/s',
$this->_source,
$matches,
PREG_OFFSET_CAPTURE,
$this->_offset
)
&& $matches[0][1] == $this->_offset
) {
$this->_offset += strlen($m... | [
"protected",
"function",
"_eatWhitespace",
"(",
")",
"{",
"if",
"(",
"preg_match",
"(",
"'/([\\t\\b\\f\\n\\r ])*/s'",
",",
"$",
"this",
"->",
"_source",
",",
"$",
"matches",
",",
"PREG_OFFSET_CAPTURE",
",",
"$",
"this",
"->",
"_offset",
")",
"&&",
"$",
"matc... | Removes whitepsace characters from the source input | [
"Removes",
"whitepsace",
"characters",
"from",
"the",
"source",
"input"
] | 8fc979ae338e850e6f40bfb97d4d57869f9e4480 | https://github.com/txj123/zilf/blob/8fc979ae338e850e6f40bfb97d4d57869f9e4480/src/Zilf/DataCrawler/PhpQuery/phpQuery/Zend/Json/Decoder.php#L288-L301 |
234,281 | dave-redfern/laravel-doctrine-tenancy | src/Http/Middleware/TenantSiteResolver.php | TenantSiteResolver.appendPathsInFinder | protected function appendPathsInFinder(TenantViewFinder $finder, TenantParticipant $tenant)
{
$finder->prependLocation($this->createViewPath($tenant->getTenantOwner()->getDomain()));
$finder->prependLocation($this->createViewPath($tenant->getDomain()));
return $finder->getPaths();
} | php | protected function appendPathsInFinder(TenantViewFinder $finder, TenantParticipant $tenant)
{
$finder->prependLocation($this->createViewPath($tenant->getTenantOwner()->getDomain()));
$finder->prependLocation($this->createViewPath($tenant->getDomain()));
return $finder->getPaths();
} | [
"protected",
"function",
"appendPathsInFinder",
"(",
"TenantViewFinder",
"$",
"finder",
",",
"TenantParticipant",
"$",
"tenant",
")",
"{",
"$",
"finder",
"->",
"prependLocation",
"(",
"$",
"this",
"->",
"createViewPath",
"(",
"$",
"tenant",
"->",
"getTenantOwner",... | Prepends the view paths to the FileViewFinder, provided it has been replaced
@param TenantViewFinder $finder
@param TenantParticipant $tenant
@return array | [
"Prepends",
"the",
"view",
"paths",
"to",
"the",
"FileViewFinder",
"provided",
"it",
"has",
"been",
"replaced"
] | 3307fc57ad64d5a4dd5dfb235e19b301661255f9 | https://github.com/dave-redfern/laravel-doctrine-tenancy/blob/3307fc57ad64d5a4dd5dfb235e19b301661255f9/src/Http/Middleware/TenantSiteResolver.php#L101-L107 |
234,282 | dave-redfern/laravel-doctrine-tenancy | src/Http/Middleware/TenantSiteResolver.php | TenantSiteResolver.registerPathsInFinder | protected function registerPathsInFinder(Factory $view, FileViewFinder $finder, TenantParticipant $tenant)
{
$paths = [];
$this->addPathToViewPaths($paths, $tenant->getDomain());
$this->addPathToViewPaths($paths, $tenant->getTenantOwner()->getDomain());
$paths = array_merge($paths, $... | php | protected function registerPathsInFinder(Factory $view, FileViewFinder $finder, TenantParticipant $tenant)
{
$paths = [];
$this->addPathToViewPaths($paths, $tenant->getDomain());
$this->addPathToViewPaths($paths, $tenant->getTenantOwner()->getDomain());
$paths = array_merge($paths, $... | [
"protected",
"function",
"registerPathsInFinder",
"(",
"Factory",
"$",
"view",
",",
"FileViewFinder",
"$",
"finder",
",",
"TenantParticipant",
"$",
"tenant",
")",
"{",
"$",
"paths",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"addPathToViewPaths",
"(",
"$",
"path... | Registers the view paths by creating a new array and injecting a new FileViewFinder
@param Factory $view
@param FileViewFinder $finder
@param TenantParticipant $tenant
@return array | [
"Registers",
"the",
"view",
"paths",
"by",
"creating",
"a",
"new",
"array",
"and",
"injecting",
"a",
"new",
"FileViewFinder"
] | 3307fc57ad64d5a4dd5dfb235e19b301661255f9 | https://github.com/dave-redfern/laravel-doctrine-tenancy/blob/3307fc57ad64d5a4dd5dfb235e19b301661255f9/src/Http/Middleware/TenantSiteResolver.php#L118-L131 |
234,283 | dave-redfern/laravel-doctrine-tenancy | src/Http/Middleware/TenantSiteResolver.php | TenantSiteResolver.createViewFinder | protected function createViewFinder(FileViewFinder $finder, array $paths = [])
{
$new = new FileViewFinder(app('files'), $paths, $finder->getExtensions());
foreach ($finder->getHints() as $namespace => $hints) {
$new->addNamespace($namespace, $hints);
}
return $new;
... | php | protected function createViewFinder(FileViewFinder $finder, array $paths = [])
{
$new = new FileViewFinder(app('files'), $paths, $finder->getExtensions());
foreach ($finder->getHints() as $namespace => $hints) {
$new->addNamespace($namespace, $hints);
}
return $new;
... | [
"protected",
"function",
"createViewFinder",
"(",
"FileViewFinder",
"$",
"finder",
",",
"array",
"$",
"paths",
"=",
"[",
"]",
")",
"{",
"$",
"new",
"=",
"new",
"FileViewFinder",
"(",
"app",
"(",
"'files'",
")",
",",
"$",
"paths",
",",
"$",
"finder",
"-... | Creates a new FileViewFinder, copying the current contents
@param FileViewFinder $finder
@param array $paths
@return FileViewFinder | [
"Creates",
"a",
"new",
"FileViewFinder",
"copying",
"the",
"current",
"contents"
] | 3307fc57ad64d5a4dd5dfb235e19b301661255f9 | https://github.com/dave-redfern/laravel-doctrine-tenancy/blob/3307fc57ad64d5a4dd5dfb235e19b301661255f9/src/Http/Middleware/TenantSiteResolver.php#L141-L150 |
234,284 | bitExpert/adrenaline | src/bitExpert/Adrenaline/Adrenaline.php | Adrenaline.createRoute | protected function createRoute(array $methods, string $name, string $path, $target, array $matchers = []) : Route
{
$builder = RouteBuilder::route($this->defaultRouteClass);
$builder->from($path)->to($target);
foreach ($methods as $method) {
$builder->accepting($method);
... | php | protected function createRoute(array $methods, string $name, string $path, $target, array $matchers = []) : Route
{
$builder = RouteBuilder::route($this->defaultRouteClass);
$builder->from($path)->to($target);
foreach ($methods as $method) {
$builder->accepting($method);
... | [
"protected",
"function",
"createRoute",
"(",
"array",
"$",
"methods",
",",
"string",
"$",
"name",
",",
"string",
"$",
"path",
",",
"$",
"target",
",",
"array",
"$",
"matchers",
"=",
"[",
"]",
")",
":",
"Route",
"{",
"$",
"builder",
"=",
"RouteBuilder",... | Creates a route using given params
@param array $methods
@param string $name
@param string $path
@param mixed $target
@param array $matchers
@return Route | [
"Creates",
"a",
"route",
"using",
"given",
"params"
] | 2cb9b79147dee04221261d765d66416f0b796b0f | https://github.com/bitExpert/adrenaline/blob/2cb9b79147dee04221261d765d66416f0b796b0f/src/bitExpert/Adrenaline/Adrenaline.php#L237-L256 |
234,285 | bitExpert/adrenaline | src/bitExpert/Adrenaline/Adrenaline.php | Adrenaline.get | public function get(string $name, string $path, $target, array $matchers = []) : self
{
$route = $this->createRoute(['GET'], $name, $path, $target, $matchers);
$this->addRoute($route);
return $this;
} | php | public function get(string $name, string $path, $target, array $matchers = []) : self
{
$route = $this->createRoute(['GET'], $name, $path, $target, $matchers);
$this->addRoute($route);
return $this;
} | [
"public",
"function",
"get",
"(",
"string",
"$",
"name",
",",
"string",
"$",
"path",
",",
"$",
"target",
",",
"array",
"$",
"matchers",
"=",
"[",
"]",
")",
":",
"self",
"{",
"$",
"route",
"=",
"$",
"this",
"->",
"createRoute",
"(",
"[",
"'GET'",
... | Adds a GET route
@param string $name
@param string $path
@param mixed $target
@param callable[][] $matchers
@return Adrenaline | [
"Adds",
"a",
"GET",
"route"
] | 2cb9b79147dee04221261d765d66416f0b796b0f | https://github.com/bitExpert/adrenaline/blob/2cb9b79147dee04221261d765d66416f0b796b0f/src/bitExpert/Adrenaline/Adrenaline.php#L267-L272 |
234,286 | bitExpert/adrenaline | src/bitExpert/Adrenaline/Adrenaline.php | Adrenaline.put | public function put(string $name, string $path, $target, array $matchers = []) : self
{
$route = $this->createRoute([RequestMethodInterface::METHOD_PUT], $name, $path, $target, $matchers);
$this->addRoute($route);
return $this;
} | php | public function put(string $name, string $path, $target, array $matchers = []) : self
{
$route = $this->createRoute([RequestMethodInterface::METHOD_PUT], $name, $path, $target, $matchers);
$this->addRoute($route);
return $this;
} | [
"public",
"function",
"put",
"(",
"string",
"$",
"name",
",",
"string",
"$",
"path",
",",
"$",
"target",
",",
"array",
"$",
"matchers",
"=",
"[",
"]",
")",
":",
"self",
"{",
"$",
"route",
"=",
"$",
"this",
"->",
"createRoute",
"(",
"[",
"RequestMet... | Adds a PUT route
@param string $name
@param string $path
@param mixed $target
@param callable[][] $matchers
@return Adrenaline | [
"Adds",
"a",
"PUT",
"route"
] | 2cb9b79147dee04221261d765d66416f0b796b0f | https://github.com/bitExpert/adrenaline/blob/2cb9b79147dee04221261d765d66416f0b796b0f/src/bitExpert/Adrenaline/Adrenaline.php#L299-L304 |
234,287 | bitExpert/adrenaline | src/bitExpert/Adrenaline/Adrenaline.php | Adrenaline.delete | public function delete(string $name, string $path, $target, array $matchers = []) : self
{
$route = $this->createRoute([RequestMethodInterface::METHOD_DELETE], $name, $path, $target, $matchers);
$this->addRoute($route);
return $this;
} | php | public function delete(string $name, string $path, $target, array $matchers = []) : self
{
$route = $this->createRoute([RequestMethodInterface::METHOD_DELETE], $name, $path, $target, $matchers);
$this->addRoute($route);
return $this;
} | [
"public",
"function",
"delete",
"(",
"string",
"$",
"name",
",",
"string",
"$",
"path",
",",
"$",
"target",
",",
"array",
"$",
"matchers",
"=",
"[",
"]",
")",
":",
"self",
"{",
"$",
"route",
"=",
"$",
"this",
"->",
"createRoute",
"(",
"[",
"Request... | Adds a DELETE route
@param string $name
@param string $path
@param mixed $target
@param callable[][] $matchers
@return Adrenaline | [
"Adds",
"a",
"DELETE",
"route"
] | 2cb9b79147dee04221261d765d66416f0b796b0f | https://github.com/bitExpert/adrenaline/blob/2cb9b79147dee04221261d765d66416f0b796b0f/src/bitExpert/Adrenaline/Adrenaline.php#L315-L320 |
234,288 | bitExpert/adrenaline | src/bitExpert/Adrenaline/Adrenaline.php | Adrenaline.options | public function options(string $name, string $path, $target, array $matchers = []) : self
{
$route = $this->createRoute([RequestMethodInterface::METHOD_OPTIONS], $name, $path, $target, $matchers);
$this->addRoute($route);
return $this;
} | php | public function options(string $name, string $path, $target, array $matchers = []) : self
{
$route = $this->createRoute([RequestMethodInterface::METHOD_OPTIONS], $name, $path, $target, $matchers);
$this->addRoute($route);
return $this;
} | [
"public",
"function",
"options",
"(",
"string",
"$",
"name",
",",
"string",
"$",
"path",
",",
"$",
"target",
",",
"array",
"$",
"matchers",
"=",
"[",
"]",
")",
":",
"self",
"{",
"$",
"route",
"=",
"$",
"this",
"->",
"createRoute",
"(",
"[",
"Reques... | Adds an OPTIONS route
@param string $name
@param string $path
@param mixed $target
@param callable[][] $matchers
@return Adrenaline | [
"Adds",
"an",
"OPTIONS",
"route"
] | 2cb9b79147dee04221261d765d66416f0b796b0f | https://github.com/bitExpert/adrenaline/blob/2cb9b79147dee04221261d765d66416f0b796b0f/src/bitExpert/Adrenaline/Adrenaline.php#L331-L336 |
234,289 | bitExpert/adrenaline | src/bitExpert/Adrenaline/Adrenaline.php | Adrenaline.patch | public function patch(string $name, string $path, $target, array $matchers = []) : self
{
$route = $this->createRoute([RequestMethodInterface::METHOD_PATCH], $name, $path, $target, $matchers);
$this->addRoute($route);
return $this;
} | php | public function patch(string $name, string $path, $target, array $matchers = []) : self
{
$route = $this->createRoute([RequestMethodInterface::METHOD_PATCH], $name, $path, $target, $matchers);
$this->addRoute($route);
return $this;
} | [
"public",
"function",
"patch",
"(",
"string",
"$",
"name",
",",
"string",
"$",
"path",
",",
"$",
"target",
",",
"array",
"$",
"matchers",
"=",
"[",
"]",
")",
":",
"self",
"{",
"$",
"route",
"=",
"$",
"this",
"->",
"createRoute",
"(",
"[",
"RequestM... | Adds a PATCH route
@param string $name
@param string $path
@param mixed $target
@param callable[][] $matchers
@return Adrenaline | [
"Adds",
"a",
"PATCH",
"route"
] | 2cb9b79147dee04221261d765d66416f0b796b0f | https://github.com/bitExpert/adrenaline/blob/2cb9b79147dee04221261d765d66416f0b796b0f/src/bitExpert/Adrenaline/Adrenaline.php#L347-L352 |
234,290 | txj123/zilf | src/Zilf/Db/QueryBuilder.php | QueryBuilder.prepareInsertValues | protected function prepareInsertValues($table, $columns, $params = [])
{
$schema = $this->db->getSchema();
$tableSchema = $schema->getTableSchema($table);
$columnSchemas = $tableSchema !== null ? $tableSchema->columns : [];
$names = [];
$placeholders = [];
$values = '... | php | protected function prepareInsertValues($table, $columns, $params = [])
{
$schema = $this->db->getSchema();
$tableSchema = $schema->getTableSchema($table);
$columnSchemas = $tableSchema !== null ? $tableSchema->columns : [];
$names = [];
$placeholders = [];
$values = '... | [
"protected",
"function",
"prepareInsertValues",
"(",
"$",
"table",
",",
"$",
"columns",
",",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"schema",
"=",
"$",
"this",
"->",
"db",
"->",
"getSchema",
"(",
")",
";",
"$",
"tableSchema",
"=",
"$",
"schema"... | Prepares a `VALUES` part for an `INSERT` SQL statement.
@param string $table the table that new rows will be inserted into.
@param array|Query $columns the column data (name => value) to be inserted into the table or instance
of [[Zilf\Db\Query|Query]] to perform INSERT INTO ... SELECT SQL statement.
@param ... | [
"Prepares",
"a",
"VALUES",
"part",
"for",
"an",
"INSERT",
"SQL",
"statement",
"."
] | 8fc979ae338e850e6f40bfb97d4d57869f9e4480 | https://github.com/txj123/zilf/blob/8fc979ae338e850e6f40bfb97d4d57869f9e4480/src/Zilf/Db/QueryBuilder.php#L364-L390 |
234,291 | appzcoder/phpcloc | src/Analyzers/ClocAnalyzer.php | ClocAnalyzer.setStats | protected function setStats($extension, $stat)
{
if (isset($this->stats[$extension])) {
$this->stats[$extension]['files'] += $stat['files'];
$this->stats[$extension]['blank'] += $stat['blank'];
$this->stats[$extension]['comment'] += $stat['comment'];
$this->st... | php | protected function setStats($extension, $stat)
{
if (isset($this->stats[$extension])) {
$this->stats[$extension]['files'] += $stat['files'];
$this->stats[$extension]['blank'] += $stat['blank'];
$this->stats[$extension]['comment'] += $stat['comment'];
$this->st... | [
"protected",
"function",
"setStats",
"(",
"$",
"extension",
",",
"$",
"stat",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"stats",
"[",
"$",
"extension",
"]",
")",
")",
"{",
"$",
"this",
"->",
"stats",
"[",
"$",
"extension",
"]",
"[",
"... | Set or increment the stat.
@param string $extension
@param array $stat
@return void | [
"Set",
"or",
"increment",
"the",
"stat",
"."
] | 0fa4b45e490238e7210009e4a1278e7a1c98d0c2 | https://github.com/appzcoder/phpcloc/blob/0fa4b45e490238e7210009e4a1278e7a1c98d0c2/src/Analyzers/ClocAnalyzer.php#L318-L328 |
234,292 | krafthaus/bauhaus | src/KraftHaus/Bauhaus/Util/Value.php | Value.encode | public static function encode($strategy, $value)
{
switch ($strategy) {
case 'explode':
return implode(',', $value);
case 'json':
return json_encode($value);
case 'serialize':
return serialize($value);
}
return $value;
} | php | public static function encode($strategy, $value)
{
switch ($strategy) {
case 'explode':
return implode(',', $value);
case 'json':
return json_encode($value);
case 'serialize':
return serialize($value);
}
return $value;
} | [
"public",
"static",
"function",
"encode",
"(",
"$",
"strategy",
",",
"$",
"value",
")",
"{",
"switch",
"(",
"$",
"strategy",
")",
"{",
"case",
"'explode'",
":",
"return",
"implode",
"(",
"','",
",",
"$",
"value",
")",
";",
"case",
"'json'",
":",
"ret... | Encode a value based on the strategy
@param string $strategy
@param string $value
@access public
@return string | [
"Encode",
"a",
"value",
"based",
"on",
"the",
"strategy"
] | 02b6c5f4f7e5b5748d5300ab037feaff2a84ca80 | https://github.com/krafthaus/bauhaus/blob/02b6c5f4f7e5b5748d5300ab037feaff2a84ca80/src/KraftHaus/Bauhaus/Util/Value.php#L30-L42 |
234,293 | krafthaus/bauhaus | src/KraftHaus/Bauhaus/Util/Value.php | Value.decode | public static function decode($strategy, $value)
{
switch ($strategy) {
case 'explode':
return explode(',', $value);
case 'json':
return json_decode($value);
case 'serialize':
return unserialize($value);
}
return $value;
} | php | public static function decode($strategy, $value)
{
switch ($strategy) {
case 'explode':
return explode(',', $value);
case 'json':
return json_decode($value);
case 'serialize':
return unserialize($value);
}
return $value;
} | [
"public",
"static",
"function",
"decode",
"(",
"$",
"strategy",
",",
"$",
"value",
")",
"{",
"switch",
"(",
"$",
"strategy",
")",
"{",
"case",
"'explode'",
":",
"return",
"explode",
"(",
"','",
",",
"$",
"value",
")",
";",
"case",
"'json'",
":",
"ret... | Decode a value based on the strategy.
@param string $strategy
@param string $value
@access public
@return array|mixed | [
"Decode",
"a",
"value",
"based",
"on",
"the",
"strategy",
"."
] | 02b6c5f4f7e5b5748d5300ab037feaff2a84ca80 | https://github.com/krafthaus/bauhaus/blob/02b6c5f4f7e5b5748d5300ab037feaff2a84ca80/src/KraftHaus/Bauhaus/Util/Value.php#L53-L65 |
234,294 | txj123/zilf | src/Zilf/DataCrawler/PhpQuery/phpQuery/Zend/Validate/Barcode.php | Zend_Validate_Barcode.setType | public function setType($barcodeType)
{
switch (strtolower($barcodeType)) {
case 'upc':
case 'upc-a':
$className = 'UpcA';
break;
case 'ean13':
case 'ean-13':
$className = 'Ean13';
break;
default:
include_onc... | php | public function setType($barcodeType)
{
switch (strtolower($barcodeType)) {
case 'upc':
case 'upc-a':
$className = 'UpcA';
break;
case 'ean13':
case 'ean-13':
$className = 'Ean13';
break;
default:
include_onc... | [
"public",
"function",
"setType",
"(",
"$",
"barcodeType",
")",
"{",
"switch",
"(",
"strtolower",
"(",
"$",
"barcodeType",
")",
")",
"{",
"case",
"'upc'",
":",
"case",
"'upc-a'",
":",
"$",
"className",
"=",
"'UpcA'",
";",
"break",
";",
"case",
"'ean13'",
... | Sets a new barcode validator
@param string $barcodeType - Barcode validator to use
@return void
@throws Zend_Validate_Exception | [
"Sets",
"a",
"new",
"barcode",
"validator"
] | 8fc979ae338e850e6f40bfb97d4d57869f9e4480 | https://github.com/txj123/zilf/blob/8fc979ae338e850e6f40bfb97d4d57869f9e4480/src/Zilf/DataCrawler/PhpQuery/phpQuery/Zend/Validate/Barcode.php#L64-L85 |
234,295 | dave-redfern/laravel-doctrine-tenancy | src/View/FileViewFinder.php | FileViewFinder.prependLocation | public function prependLocation($location)
{
if ($location && !in_array($location, $this->paths)) {
array_unshift($this->paths, $location);
}
return $this;
} | php | public function prependLocation($location)
{
if ($location && !in_array($location, $this->paths)) {
array_unshift($this->paths, $location);
}
return $this;
} | [
"public",
"function",
"prependLocation",
"(",
"$",
"location",
")",
"{",
"if",
"(",
"$",
"location",
"&&",
"!",
"in_array",
"(",
"$",
"location",
",",
"$",
"this",
"->",
"paths",
")",
")",
"{",
"array_unshift",
"(",
"$",
"this",
"->",
"paths",
",",
"... | Append a path to the top of the array of paths
@param string $location
@return $this | [
"Append",
"a",
"path",
"to",
"the",
"top",
"of",
"the",
"array",
"of",
"paths"
] | 3307fc57ad64d5a4dd5dfb235e19b301661255f9 | https://github.com/dave-redfern/laravel-doctrine-tenancy/blob/3307fc57ad64d5a4dd5dfb235e19b301661255f9/src/View/FileViewFinder.php#L40-L47 |
234,296 | txj123/zilf | src/Zilf/Queue/Listener.php | Listener.formatCommand | protected function formatCommand($command, $connection, $queue, ListenerOptions $options)
{
return sprintf(
$command,
ProcessUtils::escapeArgument($connection),
ProcessUtils::escapeArgument($queue),
$options->delay, $options->memory,
$options->slee... | php | protected function formatCommand($command, $connection, $queue, ListenerOptions $options)
{
return sprintf(
$command,
ProcessUtils::escapeArgument($connection),
ProcessUtils::escapeArgument($queue),
$options->delay, $options->memory,
$options->slee... | [
"protected",
"function",
"formatCommand",
"(",
"$",
"command",
",",
"$",
"connection",
",",
"$",
"queue",
",",
"ListenerOptions",
"$",
"options",
")",
"{",
"return",
"sprintf",
"(",
"$",
"command",
",",
"ProcessUtils",
"::",
"escapeArgument",
"(",
"$",
"conn... | Format the given command with the listener options.
@param string $command
@param string $connection
@param string $queue
@param \Illuminate\Queue\ListenerOptions $options
@return string | [
"Format",
"the",
"given",
"command",
"with",
"the",
"listener",
"options",
"."
] | 8fc979ae338e850e6f40bfb97d4d57869f9e4480 | https://github.com/txj123/zilf/blob/8fc979ae338e850e6f40bfb97d4d57869f9e4480/src/Zilf/Queue/Listener.php#L171-L180 |
234,297 | txj123/zilf | src/Zilf/DataCrawler/PhpQuery/phpQuery/phpQueryEvents.php | phpQueryEvents.trigger | public static function trigger($document, $type, $data = array(), $node = null)
{
// trigger: function(type, data, elem, donative, extra) {
$documentID = phpQuery::getDocumentID($document);
$namespace = null;
if (strpos($type, '.') !== false) {
list($name, $namespace) = ... | php | public static function trigger($document, $type, $data = array(), $node = null)
{
// trigger: function(type, data, elem, donative, extra) {
$documentID = phpQuery::getDocumentID($document);
$namespace = null;
if (strpos($type, '.') !== false) {
list($name, $namespace) = ... | [
"public",
"static",
"function",
"trigger",
"(",
"$",
"document",
",",
"$",
"type",
",",
"$",
"data",
"=",
"array",
"(",
")",
",",
"$",
"node",
"=",
"null",
")",
"{",
"// trigger: function(type, data, elem, donative, extra) {",
"$",
"documentID",
"=",
"phpQuery... | Trigger a type of event on every matched element.
@param DOMNode|phpQueryObject|string $document
@param unknown_type $type
@param unknown_type $data
@TODO exclusive events (with !)
@TODO global events (test)
@TODO support more than event in $type (space-separated) | [
"Trigger",
"a",
"type",
"of",
"event",
"on",
"every",
"matched",
"element",
"."
] | 8fc979ae338e850e6f40bfb97d4d57869f9e4480 | https://github.com/txj123/zilf/blob/8fc979ae338e850e6f40bfb97d4d57869f9e4480/src/Zilf/DataCrawler/PhpQuery/phpQuery/phpQueryEvents.php#L22-L98 |
234,298 | crysalead/sql-dialect | src/Statement/Behavior/HasWhere.php | HasWhere.where | public function where($conditions)
{
if ($conditions = is_array($conditions) && func_num_args() === 1 ? $conditions : func_get_args()) {
$this->_parts['where'][] = $conditions;
}
return $this;
} | php | public function where($conditions)
{
if ($conditions = is_array($conditions) && func_num_args() === 1 ? $conditions : func_get_args()) {
$this->_parts['where'][] = $conditions;
}
return $this;
} | [
"public",
"function",
"where",
"(",
"$",
"conditions",
")",
"{",
"if",
"(",
"$",
"conditions",
"=",
"is_array",
"(",
"$",
"conditions",
")",
"&&",
"func_num_args",
"(",
")",
"===",
"1",
"?",
"$",
"conditions",
":",
"func_get_args",
"(",
")",
")",
"{",
... | Adds some where conditions to the query.
@param string|array $conditions The conditions for this query.
@return object Returns `$this`. | [
"Adds",
"some",
"where",
"conditions",
"to",
"the",
"query",
"."
] | 867a768086fb3eb539752671a0dd54b949fe9d79 | https://github.com/crysalead/sql-dialect/blob/867a768086fb3eb539752671a0dd54b949fe9d79/src/Statement/Behavior/HasWhere.php#L12-L18 |
234,299 | maniaplanet/dedicated-server-api | libraries/Maniaplanet/DedicatedServer/Connection.php | Connection.authenticate | function authenticate($user, $password)
{
if (!is_string($user) || !isset(self::$levels[$user])) {
throw new InvalidArgumentException('user = ' . print_r($user, true));
}
if (self::$levels[$this->user] >= self::$levels[$user]) {
return true;
}
if (!is... | php | function authenticate($user, $password)
{
if (!is_string($user) || !isset(self::$levels[$user])) {
throw new InvalidArgumentException('user = ' . print_r($user, true));
}
if (self::$levels[$this->user] >= self::$levels[$user]) {
return true;
}
if (!is... | [
"function",
"authenticate",
"(",
"$",
"user",
",",
"$",
"password",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"user",
")",
"||",
"!",
"isset",
"(",
"self",
"::",
"$",
"levels",
"[",
"$",
"user",
"]",
")",
")",
"{",
"throw",
"new",
"Invalid... | Allow user authentication by specifying a login and a password, to gain access to the set of functionalities corresponding to this authorization level.
@param string $user
@param string $password
@return bool
@throws InvalidArgumentException | [
"Allow",
"user",
"authentication",
"by",
"specifying",
"a",
"login",
"and",
"a",
"password",
"to",
"gain",
"access",
"to",
"the",
"set",
"of",
"functionalities",
"corresponding",
"to",
"this",
"authorization",
"level",
"."
] | c42664b21739fd6335cf2ecfe1907a0eca07c1da | https://github.com/maniaplanet/dedicated-server-api/blob/c42664b21739fd6335cf2ecfe1907a0eca07c1da/libraries/Maniaplanet/DedicatedServer/Connection.php#L75-L93 |
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.