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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
206,400 | laravel/framework | src/Illuminate/Support/Facades/Facade.php | Facade.resolved | public static function resolved(Closure $callback)
{
static::$app->afterResolving(static::getFacadeAccessor(), function ($service) use ($callback) {
$callback($service);
});
} | php | public static function resolved(Closure $callback)
{
static::$app->afterResolving(static::getFacadeAccessor(), function ($service) use ($callback) {
$callback($service);
});
} | [
"public",
"static",
"function",
"resolved",
"(",
"Closure",
"$",
"callback",
")",
"{",
"static",
"::",
"$",
"app",
"->",
"afterResolving",
"(",
"static",
"::",
"getFacadeAccessor",
"(",
")",
",",
"function",
"(",
"$",
"service",
")",
"use",
"(",
"$",
"ca... | Run a Closure when the facade has been resolved.
@param \Closure $callback
@return void | [
"Run",
"a",
"Closure",
"when",
"the",
"facade",
"has",
"been",
"resolved",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Support/Facades/Facade.php#L32-L37 |
206,401 | laravel/framework | src/Illuminate/Support/Facades/Facade.php | Facade.spy | public static function spy()
{
if (! static::isMock()) {
$class = static::getMockableClass();
return tap($class ? Mockery::spy($class) : Mockery::spy(), function ($spy) {
static::swap($spy);
});
}
} | php | public static function spy()
{
if (! static::isMock()) {
$class = static::getMockableClass();
return tap($class ? Mockery::spy($class) : Mockery::spy(), function ($spy) {
static::swap($spy);
});
}
} | [
"public",
"static",
"function",
"spy",
"(",
")",
"{",
"if",
"(",
"!",
"static",
"::",
"isMock",
"(",
")",
")",
"{",
"$",
"class",
"=",
"static",
"::",
"getMockableClass",
"(",
")",
";",
"return",
"tap",
"(",
"$",
"class",
"?",
"Mockery",
"::",
"spy... | Convert the facade into a Mockery spy.
@return \Mockery\MockInterface | [
"Convert",
"the",
"facade",
"into",
"a",
"Mockery",
"spy",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Support/Facades/Facade.php#L44-L53 |
206,402 | laravel/framework | src/Illuminate/Support/Facades/Facade.php | Facade.swap | public static function swap($instance)
{
static::$resolvedInstance[static::getFacadeAccessor()] = $instance;
if (isset(static::$app)) {
static::$app->instance(static::getFacadeAccessor(), $instance);
}
} | php | public static function swap($instance)
{
static::$resolvedInstance[static::getFacadeAccessor()] = $instance;
if (isset(static::$app)) {
static::$app->instance(static::getFacadeAccessor(), $instance);
}
} | [
"public",
"static",
"function",
"swap",
"(",
"$",
"instance",
")",
"{",
"static",
"::",
"$",
"resolvedInstance",
"[",
"static",
"::",
"getFacadeAccessor",
"(",
")",
"]",
"=",
"$",
"instance",
";",
"if",
"(",
"isset",
"(",
"static",
"::",
"$",
"app",
")... | Hotswap the underlying instance behind the facade.
@param mixed $instance
@return void | [
"Hotswap",
"the",
"underlying",
"instance",
"behind",
"the",
"facade",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Support/Facades/Facade.php#L128-L135 |
206,403 | laravel/framework | src/Illuminate/Routing/Redirector.php | Redirector.refresh | public function refresh($status = 302, $headers = [])
{
return $this->to($this->generator->getRequest()->path(), $status, $headers);
} | php | public function refresh($status = 302, $headers = [])
{
return $this->to($this->generator->getRequest()->path(), $status, $headers);
} | [
"public",
"function",
"refresh",
"(",
"$",
"status",
"=",
"302",
",",
"$",
"headers",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"to",
"(",
"$",
"this",
"->",
"generator",
"->",
"getRequest",
"(",
")",
"->",
"path",
"(",
")",
",",
"$",... | Create a new redirect response to the current URI.
@param int $status
@param array $headers
@return \Illuminate\Http\RedirectResponse | [
"Create",
"a",
"new",
"redirect",
"response",
"to",
"the",
"current",
"URI",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/Redirector.php#L69-L72 |
206,404 | laravel/framework | src/Illuminate/Routing/Redirector.php | Redirector.secure | public function secure($path, $status = 302, $headers = [])
{
return $this->to($path, $status, $headers, true);
} | php | public function secure($path, $status = 302, $headers = [])
{
return $this->to($path, $status, $headers, true);
} | [
"public",
"function",
"secure",
"(",
"$",
"path",
",",
"$",
"status",
"=",
"302",
",",
"$",
"headers",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"to",
"(",
"$",
"path",
",",
"$",
"status",
",",
"$",
"headers",
",",
"true",
")",
";",... | Create a new redirect response to the given HTTPS path.
@param string $path
@param int $status
@param array $headers
@return \Illuminate\Http\RedirectResponse | [
"Create",
"a",
"new",
"redirect",
"response",
"to",
"the",
"given",
"HTTPS",
"path",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/Redirector.php#L160-L163 |
206,405 | laravel/framework | src/Illuminate/Support/Str.php | Str.endsWith | public static function endsWith($haystack, $needles)
{
foreach ((array) $needles as $needle) {
if (substr($haystack, -strlen($needle)) === (string) $needle) {
return true;
}
}
return false;
} | php | public static function endsWith($haystack, $needles)
{
foreach ((array) $needles as $needle) {
if (substr($haystack, -strlen($needle)) === (string) $needle) {
return true;
}
}
return false;
} | [
"public",
"static",
"function",
"endsWith",
"(",
"$",
"haystack",
",",
"$",
"needles",
")",
"{",
"foreach",
"(",
"(",
"array",
")",
"$",
"needles",
"as",
"$",
"needle",
")",
"{",
"if",
"(",
"substr",
"(",
"$",
"haystack",
",",
"-",
"strlen",
"(",
"... | Determine if a given string ends with a given substring.
@param string $haystack
@param string|array $needles
@return bool | [
"Determine",
"if",
"a",
"given",
"string",
"ends",
"with",
"a",
"given",
"substring",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Support/Str.php#L122-L131 |
206,406 | laravel/framework | src/Illuminate/Support/Str.php | Str.finish | public static function finish($value, $cap)
{
$quoted = preg_quote($cap, '/');
return preg_replace('/(?:'.$quoted.')+$/u', '', $value).$cap;
} | php | public static function finish($value, $cap)
{
$quoted = preg_quote($cap, '/');
return preg_replace('/(?:'.$quoted.')+$/u', '', $value).$cap;
} | [
"public",
"static",
"function",
"finish",
"(",
"$",
"value",
",",
"$",
"cap",
")",
"{",
"$",
"quoted",
"=",
"preg_quote",
"(",
"$",
"cap",
",",
"'/'",
")",
";",
"return",
"preg_replace",
"(",
"'/(?:'",
".",
"$",
"quoted",
".",
"')+$/u'",
",",
"''",
... | Cap a string with a single instance of a given value.
@param string $value
@param string $cap
@return string | [
"Cap",
"a",
"string",
"with",
"a",
"single",
"instance",
"of",
"a",
"given",
"value",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Support/Str.php#L140-L145 |
206,407 | laravel/framework | src/Illuminate/Support/Str.php | Str.pluralStudly | public static function pluralStudly($value, $count = 2)
{
$parts = preg_split('/(.)(?=[A-Z])/u', $value, -1, PREG_SPLIT_DELIM_CAPTURE);
$lastWord = array_pop($parts);
return implode('', $parts).self::plural($lastWord, $count);
} | php | public static function pluralStudly($value, $count = 2)
{
$parts = preg_split('/(.)(?=[A-Z])/u', $value, -1, PREG_SPLIT_DELIM_CAPTURE);
$lastWord = array_pop($parts);
return implode('', $parts).self::plural($lastWord, $count);
} | [
"public",
"static",
"function",
"pluralStudly",
"(",
"$",
"value",
",",
"$",
"count",
"=",
"2",
")",
"{",
"$",
"parts",
"=",
"preg_split",
"(",
"'/(.)(?=[A-Z])/u'",
",",
"$",
"value",
",",
"-",
"1",
",",
"PREG_SPLIT_DELIM_CAPTURE",
")",
";",
"$",
"lastWo... | Pluralize the last word of an English, studly caps case string.
@param string $value
@param int $count
@return string | [
"Pluralize",
"the",
"last",
"word",
"of",
"an",
"English",
"studly",
"caps",
"case",
"string",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Support/Str.php#L290-L297 |
206,408 | laravel/framework | src/Illuminate/Support/Str.php | Str.start | public static function start($value, $prefix)
{
$quoted = preg_quote($prefix, '/');
return $prefix.preg_replace('/^(?:'.$quoted.')+/u', '', $value);
} | php | public static function start($value, $prefix)
{
$quoted = preg_quote($prefix, '/');
return $prefix.preg_replace('/^(?:'.$quoted.')+/u', '', $value);
} | [
"public",
"static",
"function",
"start",
"(",
"$",
"value",
",",
"$",
"prefix",
")",
"{",
"$",
"quoted",
"=",
"preg_quote",
"(",
"$",
"prefix",
",",
"'/'",
")",
";",
"return",
"$",
"prefix",
".",
"preg_replace",
"(",
"'/^(?:'",
".",
"$",
"quoted",
".... | Begin a string with a single instance of a given value.
@param string $value
@param string $prefix
@return string | [
"Begin",
"a",
"string",
"with",
"a",
"single",
"instance",
"of",
"a",
"given",
"value",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Support/Str.php#L390-L395 |
206,409 | laravel/framework | src/Illuminate/Validation/ValidationRuleParser.php | ValidationRuleParser.explodeRules | protected function explodeRules($rules)
{
foreach ($rules as $key => $rule) {
if (Str::contains($key, '*')) {
$rules = $this->explodeWildcardRules($rules, $key, [$rule]);
unset($rules[$key]);
} else {
$rules[$key] = $this->explodeExpli... | php | protected function explodeRules($rules)
{
foreach ($rules as $key => $rule) {
if (Str::contains($key, '*')) {
$rules = $this->explodeWildcardRules($rules, $key, [$rule]);
unset($rules[$key]);
} else {
$rules[$key] = $this->explodeExpli... | [
"protected",
"function",
"explodeRules",
"(",
"$",
"rules",
")",
"{",
"foreach",
"(",
"$",
"rules",
"as",
"$",
"key",
"=>",
"$",
"rule",
")",
"{",
"if",
"(",
"Str",
"::",
"contains",
"(",
"$",
"key",
",",
"'*'",
")",
")",
"{",
"$",
"rules",
"=",
... | Explode the rules into an array of explicit rules.
@param array $rules
@return array | [
"Explode",
"the",
"rules",
"into",
"an",
"array",
"of",
"explicit",
"rules",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Validation/ValidationRuleParser.php#L63-L76 |
206,410 | laravel/framework | src/Illuminate/Validation/ValidationRuleParser.php | ValidationRuleParser.explodeExplicitRule | protected function explodeExplicitRule($rule)
{
if (is_string($rule)) {
return explode('|', $rule);
} elseif (is_object($rule)) {
return [$this->prepareRule($rule)];
}
return array_map([$this, 'prepareRule'], $rule);
} | php | protected function explodeExplicitRule($rule)
{
if (is_string($rule)) {
return explode('|', $rule);
} elseif (is_object($rule)) {
return [$this->prepareRule($rule)];
}
return array_map([$this, 'prepareRule'], $rule);
} | [
"protected",
"function",
"explodeExplicitRule",
"(",
"$",
"rule",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"rule",
")",
")",
"{",
"return",
"explode",
"(",
"'|'",
",",
"$",
"rule",
")",
";",
"}",
"elseif",
"(",
"is_object",
"(",
"$",
"rule",
")",
... | Explode the explicit rule into an array if necessary.
@param mixed $rule
@return array | [
"Explode",
"the",
"explicit",
"rule",
"into",
"an",
"array",
"if",
"necessary",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Validation/ValidationRuleParser.php#L84-L93 |
206,411 | laravel/framework | src/Illuminate/Validation/ValidationRuleParser.php | ValidationRuleParser.prepareRule | protected function prepareRule($rule)
{
if ($rule instanceof Closure) {
$rule = new ClosureValidationRule($rule);
}
if (! is_object($rule) ||
$rule instanceof RuleContract ||
($rule instanceof Exists && $rule->queryCallbacks()) ||
($rule insta... | php | protected function prepareRule($rule)
{
if ($rule instanceof Closure) {
$rule = new ClosureValidationRule($rule);
}
if (! is_object($rule) ||
$rule instanceof RuleContract ||
($rule instanceof Exists && $rule->queryCallbacks()) ||
($rule insta... | [
"protected",
"function",
"prepareRule",
"(",
"$",
"rule",
")",
"{",
"if",
"(",
"$",
"rule",
"instanceof",
"Closure",
")",
"{",
"$",
"rule",
"=",
"new",
"ClosureValidationRule",
"(",
"$",
"rule",
")",
";",
"}",
"if",
"(",
"!",
"is_object",
"(",
"$",
"... | Prepare the given rule for the Validator.
@param mixed $rule
@return mixed | [
"Prepare",
"the",
"given",
"rule",
"for",
"the",
"Validator",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Validation/ValidationRuleParser.php#L101-L115 |
206,412 | laravel/framework | src/Illuminate/Validation/ValidationRuleParser.php | ValidationRuleParser.parseParameters | protected static function parseParameters($rule, $parameter)
{
$rule = strtolower($rule);
if (in_array($rule, ['regex', 'not_regex', 'notregex'], true)) {
return [$parameter];
}
return str_getcsv($parameter);
} | php | protected static function parseParameters($rule, $parameter)
{
$rule = strtolower($rule);
if (in_array($rule, ['regex', 'not_regex', 'notregex'], true)) {
return [$parameter];
}
return str_getcsv($parameter);
} | [
"protected",
"static",
"function",
"parseParameters",
"(",
"$",
"rule",
",",
"$",
"parameter",
")",
"{",
"$",
"rule",
"=",
"strtolower",
"(",
"$",
"rule",
")",
";",
"if",
"(",
"in_array",
"(",
"$",
"rule",
",",
"[",
"'regex'",
",",
"'not_regex'",
",",
... | Parse a parameter list.
@param string $rule
@param string $parameter
@return array | [
"Parse",
"a",
"parameter",
"list",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Validation/ValidationRuleParser.php#L249-L258 |
206,413 | laravel/framework | src/Illuminate/Validation/Concerns/FormatsMessages.php | FormatsMessages.getInlineMessage | protected function getInlineMessage($attribute, $rule)
{
$inlineEntry = $this->getFromLocalArray($attribute, Str::snake($rule));
return is_array($inlineEntry) && in_array($rule, $this->sizeRules)
? $inlineEntry[$this->getAttributeType($attribute)]
: $inlineEn... | php | protected function getInlineMessage($attribute, $rule)
{
$inlineEntry = $this->getFromLocalArray($attribute, Str::snake($rule));
return is_array($inlineEntry) && in_array($rule, $this->sizeRules)
? $inlineEntry[$this->getAttributeType($attribute)]
: $inlineEn... | [
"protected",
"function",
"getInlineMessage",
"(",
"$",
"attribute",
",",
"$",
"rule",
")",
"{",
"$",
"inlineEntry",
"=",
"$",
"this",
"->",
"getFromLocalArray",
"(",
"$",
"attribute",
",",
"Str",
"::",
"snake",
"(",
"$",
"rule",
")",
")",
";",
"return",
... | Get the proper inline error message for standard and size rules.
@param string $attribute
@param string $rule
@return string|null | [
"Get",
"the",
"proper",
"inline",
"error",
"message",
"for",
"standard",
"and",
"size",
"rules",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Validation/Concerns/FormatsMessages.php#L73-L80 |
206,414 | laravel/framework | src/Illuminate/Validation/Concerns/FormatsMessages.php | FormatsMessages.getWildcardCustomMessages | protected function getWildcardCustomMessages($messages, $search, $default)
{
foreach ($messages as $key => $message) {
if ($search === $key || (Str::contains($key, ['*']) && Str::is($key, $search))) {
return $message;
}
}
return $default;
} | php | protected function getWildcardCustomMessages($messages, $search, $default)
{
foreach ($messages as $key => $message) {
if ($search === $key || (Str::contains($key, ['*']) && Str::is($key, $search))) {
return $message;
}
}
return $default;
} | [
"protected",
"function",
"getWildcardCustomMessages",
"(",
"$",
"messages",
",",
"$",
"search",
",",
"$",
"default",
")",
"{",
"foreach",
"(",
"$",
"messages",
"as",
"$",
"key",
"=>",
"$",
"message",
")",
"{",
"if",
"(",
"$",
"search",
"===",
"$",
"key... | Check the given messages for a wildcard key.
@param array $messages
@param string $search
@param string $default
@return string | [
"Check",
"the",
"given",
"messages",
"for",
"a",
"wildcard",
"key",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Validation/Concerns/FormatsMessages.php#L140-L149 |
206,415 | laravel/framework | src/Illuminate/Cache/Repository.php | Repository.handleManyResult | protected function handleManyResult($keys, $key, $value)
{
// If we could not find the cache value, we will fire the missed event and get
// the default value for this cache value. This default could be a callback
// so we will execute the value function which will resolve it if needed.
... | php | protected function handleManyResult($keys, $key, $value)
{
// If we could not find the cache value, we will fire the missed event and get
// the default value for this cache value. This default could be a callback
// so we will execute the value function which will resolve it if needed.
... | [
"protected",
"function",
"handleManyResult",
"(",
"$",
"keys",
",",
"$",
"key",
",",
"$",
"value",
")",
"{",
"// If we could not find the cache value, we will fire the missed event and get",
"// the default value for this cache value. This default could be a callback",
"// so we will... | Handle a result for the "many" method.
@param array $keys
@param string $key
@param mixed $value
@return mixed | [
"Handle",
"a",
"result",
"for",
"the",
"many",
"method",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Cache/Repository.php#L158-L175 |
206,416 | laravel/framework | src/Illuminate/Cache/Repository.php | Repository.putManyForever | protected function putManyForever(array $values)
{
$result = true;
foreach ($values as $key => $value) {
if (! $this->forever($key, $value)) {
$result = false;
}
}
return $result;
} | php | protected function putManyForever(array $values)
{
$result = true;
foreach ($values as $key => $value) {
if (! $this->forever($key, $value)) {
$result = false;
}
}
return $result;
} | [
"protected",
"function",
"putManyForever",
"(",
"array",
"$",
"values",
")",
"{",
"$",
"result",
"=",
"true",
";",
"foreach",
"(",
"$",
"values",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"forever",
"(",
"$"... | Store multiple items in the cache indefinitely.
@param array $values
@return bool | [
"Store",
"multiple",
"items",
"in",
"the",
"cache",
"indefinitely",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Cache/Repository.php#L268-L279 |
206,417 | laravel/framework | src/Illuminate/Cache/Repository.php | Repository.rememberForever | public function rememberForever($key, Closure $callback)
{
$value = $this->get($key);
// If the item exists in the cache we will just return this immediately
// and if not we will execute the given Closure and cache the result
// of that forever so it is available for all subsequent... | php | public function rememberForever($key, Closure $callback)
{
$value = $this->get($key);
// If the item exists in the cache we will just return this immediately
// and if not we will execute the given Closure and cache the result
// of that forever so it is available for all subsequent... | [
"public",
"function",
"rememberForever",
"(",
"$",
"key",
",",
"Closure",
"$",
"callback",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"get",
"(",
"$",
"key",
")",
";",
"// If the item exists in the cache we will just return this immediately",
"// and if not we ... | Get an item from the cache, or execute the given Closure and store the result forever.
@param string $key
@param \Closure $callback
@return mixed | [
"Get",
"an",
"item",
"from",
"the",
"cache",
"or",
"execute",
"the",
"given",
"Closure",
"and",
"store",
"the",
"result",
"forever",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Cache/Repository.php#L411-L425 |
206,418 | laravel/framework | src/Illuminate/Cache/Repository.php | Repository.getSeconds | protected function getSeconds($ttl)
{
$duration = $this->parseDateInterval($ttl);
if ($duration instanceof DateTimeInterface) {
$duration = Carbon::now()->diffInRealSeconds($duration, false);
}
return (int) $duration > 0 ? $duration : 0;
} | php | protected function getSeconds($ttl)
{
$duration = $this->parseDateInterval($ttl);
if ($duration instanceof DateTimeInterface) {
$duration = Carbon::now()->diffInRealSeconds($duration, false);
}
return (int) $duration > 0 ? $duration : 0;
} | [
"protected",
"function",
"getSeconds",
"(",
"$",
"ttl",
")",
"{",
"$",
"duration",
"=",
"$",
"this",
"->",
"parseDateInterval",
"(",
"$",
"ttl",
")",
";",
"if",
"(",
"$",
"duration",
"instanceof",
"DateTimeInterface",
")",
"{",
"$",
"duration",
"=",
"Car... | Calculate the number of seconds for the given TTL.
@param \DateTimeInterface|\DateInterval|int $ttl
@return int | [
"Calculate",
"the",
"number",
"of",
"seconds",
"for",
"the",
"given",
"TTL",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Cache/Repository.php#L616-L625 |
206,419 | laravel/framework | src/Illuminate/Cache/DynamoDbStore.php | DynamoDbStore.isExpired | protected function isExpired(array $item, $expiration = null)
{
$expiration = $expiration ?: Carbon::now();
return isset($item[$this->expirationAttribute]) &&
$expiration->getTimestamp() >= $item[$this->expirationAttribute]['N'];
} | php | protected function isExpired(array $item, $expiration = null)
{
$expiration = $expiration ?: Carbon::now();
return isset($item[$this->expirationAttribute]) &&
$expiration->getTimestamp() >= $item[$this->expirationAttribute]['N'];
} | [
"protected",
"function",
"isExpired",
"(",
"array",
"$",
"item",
",",
"$",
"expiration",
"=",
"null",
")",
"{",
"$",
"expiration",
"=",
"$",
"expiration",
"?",
":",
"Carbon",
"::",
"now",
"(",
")",
";",
"return",
"isset",
"(",
"$",
"item",
"[",
"$",
... | Determine if the given item is expired.
@param array $item
@param \DateTimeInterface|null $expiration
@return bool | [
"Determine",
"if",
"the",
"given",
"item",
"is",
"expired",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Cache/DynamoDbStore.php#L176-L182 |
206,420 | laravel/framework | src/Illuminate/Cache/DynamoDbStore.php | DynamoDbStore.unserialize | protected function unserialize($value)
{
if (filter_var($value, FILTER_VALIDATE_INT) !== false) {
return (int) $value;
}
if (is_numeric($value)) {
return (float) $value;
}
return unserialize($value);
} | php | protected function unserialize($value)
{
if (filter_var($value, FILTER_VALIDATE_INT) !== false) {
return (int) $value;
}
if (is_numeric($value)) {
return (float) $value;
}
return unserialize($value);
} | [
"protected",
"function",
"unserialize",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"filter_var",
"(",
"$",
"value",
",",
"FILTER_VALIDATE_INT",
")",
"!==",
"false",
")",
"{",
"return",
"(",
"int",
")",
"$",
"value",
";",
"}",
"if",
"(",
"is_numeric",
"(",... | Unserialize the value.
@param mixed $value
@return mixed | [
"Unserialize",
"the",
"value",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Cache/DynamoDbStore.php#L481-L492 |
206,421 | laravel/framework | src/Illuminate/Http/Concerns/InteractsWithInput.php | InteractsWithInput.has | public function has($key)
{
$keys = is_array($key) ? $key : func_get_args();
$input = $this->all();
foreach ($keys as $value) {
if (! Arr::has($input, $value)) {
return false;
}
}
return true;
} | php | public function has($key)
{
$keys = is_array($key) ? $key : func_get_args();
$input = $this->all();
foreach ($keys as $value) {
if (! Arr::has($input, $value)) {
return false;
}
}
return true;
} | [
"public",
"function",
"has",
"(",
"$",
"key",
")",
"{",
"$",
"keys",
"=",
"is_array",
"(",
"$",
"key",
")",
"?",
"$",
"key",
":",
"func_get_args",
"(",
")",
";",
"$",
"input",
"=",
"$",
"this",
"->",
"all",
"(",
")",
";",
"foreach",
"(",
"$",
... | Determine if the request contains a given input item key.
@param string|array $key
@return bool | [
"Determine",
"if",
"the",
"request",
"contains",
"a",
"given",
"input",
"item",
"key",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Http/Concerns/InteractsWithInput.php#L79-L92 |
206,422 | laravel/framework | src/Illuminate/Http/Concerns/InteractsWithInput.php | InteractsWithInput.hasAny | public function hasAny($keys)
{
$keys = is_array($keys) ? $keys : func_get_args();
$input = $this->all();
foreach ($keys as $key) {
if (Arr::has($input, $key)) {
return true;
}
}
return false;
} | php | public function hasAny($keys)
{
$keys = is_array($keys) ? $keys : func_get_args();
$input = $this->all();
foreach ($keys as $key) {
if (Arr::has($input, $key)) {
return true;
}
}
return false;
} | [
"public",
"function",
"hasAny",
"(",
"$",
"keys",
")",
"{",
"$",
"keys",
"=",
"is_array",
"(",
"$",
"keys",
")",
"?",
"$",
"keys",
":",
"func_get_args",
"(",
")",
";",
"$",
"input",
"=",
"$",
"this",
"->",
"all",
"(",
")",
";",
"foreach",
"(",
... | Determine if the request contains any of the given inputs.
@param string|array $keys
@return bool | [
"Determine",
"if",
"the",
"request",
"contains",
"any",
"of",
"the",
"given",
"inputs",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Http/Concerns/InteractsWithInput.php#L100-L113 |
206,423 | laravel/framework | src/Illuminate/Http/Concerns/InteractsWithInput.php | InteractsWithInput.anyFilled | public function anyFilled($keys)
{
$keys = is_array($keys) ? $keys : func_get_args();
foreach ($keys as $key) {
if ($this->filled($key)) {
return true;
}
}
return false;
} | php | public function anyFilled($keys)
{
$keys = is_array($keys) ? $keys : func_get_args();
foreach ($keys as $key) {
if ($this->filled($key)) {
return true;
}
}
return false;
} | [
"public",
"function",
"anyFilled",
"(",
"$",
"keys",
")",
"{",
"$",
"keys",
"=",
"is_array",
"(",
"$",
"keys",
")",
"?",
"$",
"keys",
":",
"func_get_args",
"(",
")",
";",
"foreach",
"(",
"$",
"keys",
"as",
"$",
"key",
")",
"{",
"if",
"(",
"$",
... | Determine if the request contains a non-empty value for any of the given inputs.
@param string|array $keys
@return bool | [
"Determine",
"if",
"the",
"request",
"contains",
"a",
"non",
"-",
"empty",
"value",
"for",
"any",
"of",
"the",
"given",
"inputs",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Http/Concerns/InteractsWithInput.php#L140-L151 |
206,424 | laravel/framework | src/Illuminate/Database/Eloquent/Relations/HasManyThrough.php | HasManyThrough.prepareQueryBuilder | protected function prepareQueryBuilder($columns = ['*'])
{
$builder = $this->query->applyScopes();
return $builder->addSelect(
$this->shouldSelect($builder->getQuery()->columns ? [] : $columns)
);
} | php | protected function prepareQueryBuilder($columns = ['*'])
{
$builder = $this->query->applyScopes();
return $builder->addSelect(
$this->shouldSelect($builder->getQuery()->columns ? [] : $columns)
);
} | [
"protected",
"function",
"prepareQueryBuilder",
"(",
"$",
"columns",
"=",
"[",
"'*'",
"]",
")",
"{",
"$",
"builder",
"=",
"$",
"this",
"->",
"query",
"->",
"applyScopes",
"(",
")",
";",
"return",
"$",
"builder",
"->",
"addSelect",
"(",
"$",
"this",
"->... | Prepare the query builder for query execution.
@param array $columns
@return \Illuminate\Database\Eloquent\Builder | [
"Prepare",
"the",
"query",
"builder",
"for",
"query",
"execution",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Relations/HasManyThrough.php#L484-L491 |
206,425 | laravel/framework | src/Illuminate/Database/Eloquent/Relations/HasManyThrough.php | HasManyThrough.getRelationExistenceQueryForThroughSelfRelation | public function getRelationExistenceQueryForThroughSelfRelation(Builder $query, Builder $parentQuery, $columns = ['*'])
{
$table = $this->throughParent->getTable().' as '.$hash = $this->getRelationCountHash();
$query->join($table, $hash.'.'.$this->secondLocalKey, '=', $this->getQualifiedFarKeyName(... | php | public function getRelationExistenceQueryForThroughSelfRelation(Builder $query, Builder $parentQuery, $columns = ['*'])
{
$table = $this->throughParent->getTable().' as '.$hash = $this->getRelationCountHash();
$query->join($table, $hash.'.'.$this->secondLocalKey, '=', $this->getQualifiedFarKeyName(... | [
"public",
"function",
"getRelationExistenceQueryForThroughSelfRelation",
"(",
"Builder",
"$",
"query",
",",
"Builder",
"$",
"parentQuery",
",",
"$",
"columns",
"=",
"[",
"'*'",
"]",
")",
"{",
"$",
"table",
"=",
"$",
"this",
"->",
"throughParent",
"->",
"getTab... | Add the constraints for a relationship query on the same table as the through parent.
@param \Illuminate\Database\Eloquent\Builder $query
@param \Illuminate\Database\Eloquent\Builder $parentQuery
@param array|mixed $columns
@return \Illuminate\Database\Eloquent\Builder | [
"Add",
"the",
"constraints",
"for",
"a",
"relationship",
"query",
"on",
"the",
"same",
"table",
"as",
"the",
"through",
"parent",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Relations/HasManyThrough.php#L551-L564 |
206,426 | laravel/framework | src/Illuminate/Database/Query/Grammars/MySqlGrammar.php | MySqlGrammar.compileUpdateColumns | protected function compileUpdateColumns($values)
{
return collect($values)->map(function ($value, $key) {
if ($this->isJsonSelector($key)) {
return $this->compileJsonUpdateColumn($key, new JsonExpression($value));
}
return $this->wrap($key).' = '.$this->p... | php | protected function compileUpdateColumns($values)
{
return collect($values)->map(function ($value, $key) {
if ($this->isJsonSelector($key)) {
return $this->compileJsonUpdateColumn($key, new JsonExpression($value));
}
return $this->wrap($key).' = '.$this->p... | [
"protected",
"function",
"compileUpdateColumns",
"(",
"$",
"values",
")",
"{",
"return",
"collect",
"(",
"$",
"values",
")",
"->",
"map",
"(",
"function",
"(",
"$",
"value",
",",
"$",
"key",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isJsonSelector",
"("... | Compile all of the columns for an update statement.
@param array $values
@return string | [
"Compile",
"all",
"of",
"the",
"columns",
"for",
"an",
"update",
"statement",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Query/Grammars/MySqlGrammar.php#L182-L191 |
206,427 | laravel/framework | src/Illuminate/Mail/Mailable.php | Mailable.send | public function send(MailerContract $mailer)
{
return $this->withLocale($this->locale, function () use ($mailer) {
Container::getInstance()->call([$this, 'build']);
return $mailer->send($this->buildView(), $this->buildViewData(), function ($message) {
$this->buildFro... | php | public function send(MailerContract $mailer)
{
return $this->withLocale($this->locale, function () use ($mailer) {
Container::getInstance()->call([$this, 'build']);
return $mailer->send($this->buildView(), $this->buildViewData(), function ($message) {
$this->buildFro... | [
"public",
"function",
"send",
"(",
"MailerContract",
"$",
"mailer",
")",
"{",
"return",
"$",
"this",
"->",
"withLocale",
"(",
"$",
"this",
"->",
"locale",
",",
"function",
"(",
")",
"use",
"(",
"$",
"mailer",
")",
"{",
"Container",
"::",
"getInstance",
... | Send the message using the given mailer.
@param \Illuminate\Contracts\Mail\Mailer $mailer
@return void | [
"Send",
"the",
"message",
"using",
"the",
"given",
"mailer",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Mail/Mailable.php#L148-L161 |
206,428 | laravel/framework | src/Illuminate/Mail/Mailable.php | Mailable.queue | public function queue(Queue $queue)
{
if (isset($this->delay)) {
return $this->later($this->delay, $queue);
}
$connection = property_exists($this, 'connection') ? $this->connection : null;
$queueName = property_exists($this, 'queue') ? $this->queue : null;
retu... | php | public function queue(Queue $queue)
{
if (isset($this->delay)) {
return $this->later($this->delay, $queue);
}
$connection = property_exists($this, 'connection') ? $this->connection : null;
$queueName = property_exists($this, 'queue') ? $this->queue : null;
retu... | [
"public",
"function",
"queue",
"(",
"Queue",
"$",
"queue",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"delay",
")",
")",
"{",
"return",
"$",
"this",
"->",
"later",
"(",
"$",
"this",
"->",
"delay",
",",
"$",
"queue",
")",
";",
"}",
"$... | Queue the message for sending.
@param \Illuminate\Contracts\Queue\Factory $queue
@return mixed | [
"Queue",
"the",
"message",
"for",
"sending",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Mail/Mailable.php#L169-L182 |
206,429 | laravel/framework | src/Illuminate/Mail/Mailable.php | Mailable.render | public function render()
{
return $this->withLocale($this->locale, function () {
Container::getInstance()->call([$this, 'build']);
return Container::getInstance()->make('mailer')->render(
$this->buildView(), $this->buildViewData()
);
});
} | php | public function render()
{
return $this->withLocale($this->locale, function () {
Container::getInstance()->call([$this, 'build']);
return Container::getInstance()->make('mailer')->render(
$this->buildView(), $this->buildViewData()
);
});
} | [
"public",
"function",
"render",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"withLocale",
"(",
"$",
"this",
"->",
"locale",
",",
"function",
"(",
")",
"{",
"Container",
"::",
"getInstance",
"(",
")",
"->",
"call",
"(",
"[",
"$",
"this",
",",
"'build'... | Render the mailable into a view.
@return \Illuminate\View\View
@throws \ReflectionException | [
"Render",
"the",
"mailable",
"into",
"a",
"view",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Mail/Mailable.php#L209-L218 |
206,430 | laravel/framework | src/Illuminate/Mail/Mailable.php | Mailable.buildView | protected function buildView()
{
if (isset($this->html)) {
return array_filter([
'html' => new HtmlString($this->html),
'text' => $this->textView ?? null,
]);
}
if (isset($this->markdown)) {
return $this->buildMarkdownView(... | php | protected function buildView()
{
if (isset($this->html)) {
return array_filter([
'html' => new HtmlString($this->html),
'text' => $this->textView ?? null,
]);
}
if (isset($this->markdown)) {
return $this->buildMarkdownView(... | [
"protected",
"function",
"buildView",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"html",
")",
")",
"{",
"return",
"array_filter",
"(",
"[",
"'html'",
"=>",
"new",
"HtmlString",
"(",
"$",
"this",
"->",
"html",
")",
",",
"'text'",
"=>",... | Build the view for the message.
@return array|string
@throws \ReflectionException | [
"Build",
"the",
"view",
"for",
"the",
"message",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Mail/Mailable.php#L227-L247 |
206,431 | laravel/framework | src/Illuminate/Mail/Mailable.php | Mailable.buildMarkdownView | protected function buildMarkdownView()
{
$markdown = Container::getInstance()->make(Markdown::class);
if (isset($this->theme)) {
$markdown->theme($this->theme);
}
$data = $this->buildViewData();
return [
'html' => $markdown->render($this->markdown, ... | php | protected function buildMarkdownView()
{
$markdown = Container::getInstance()->make(Markdown::class);
if (isset($this->theme)) {
$markdown->theme($this->theme);
}
$data = $this->buildViewData();
return [
'html' => $markdown->render($this->markdown, ... | [
"protected",
"function",
"buildMarkdownView",
"(",
")",
"{",
"$",
"markdown",
"=",
"Container",
"::",
"getInstance",
"(",
")",
"->",
"make",
"(",
"Markdown",
"::",
"class",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"theme",
")",
")",
"{",
... | Build the Markdown view for the message.
@return array
@throws \ReflectionException | [
"Build",
"the",
"Markdown",
"view",
"for",
"the",
"message",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Mail/Mailable.php#L256-L270 |
206,432 | laravel/framework | src/Illuminate/Mail/Mailable.php | Mailable.buildViewData | public function buildViewData()
{
$data = $this->viewData;
if (static::$viewDataCallback) {
$data = array_merge($data, call_user_func(static::$viewDataCallback, $this));
}
foreach ((new ReflectionClass($this))->getProperties(ReflectionProperty::IS_PUBLIC) as $property) ... | php | public function buildViewData()
{
$data = $this->viewData;
if (static::$viewDataCallback) {
$data = array_merge($data, call_user_func(static::$viewDataCallback, $this));
}
foreach ((new ReflectionClass($this))->getProperties(ReflectionProperty::IS_PUBLIC) as $property) ... | [
"public",
"function",
"buildViewData",
"(",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"viewData",
";",
"if",
"(",
"static",
"::",
"$",
"viewDataCallback",
")",
"{",
"$",
"data",
"=",
"array_merge",
"(",
"$",
"data",
",",
"call_user_func",
"(",
"st... | Build the view data for the message.
@return array
@throws \ReflectionException | [
"Build",
"the",
"view",
"data",
"for",
"the",
"message",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Mail/Mailable.php#L279-L294 |
206,433 | laravel/framework | src/Illuminate/Mail/Mailable.php | Mailable.buildMarkdownText | protected function buildMarkdownText($markdown, $data)
{
return $this->textView
?? $markdown->renderText($this->markdown, $data);
} | php | protected function buildMarkdownText($markdown, $data)
{
return $this->textView
?? $markdown->renderText($this->markdown, $data);
} | [
"protected",
"function",
"buildMarkdownText",
"(",
"$",
"markdown",
",",
"$",
"data",
")",
"{",
"return",
"$",
"this",
"->",
"textView",
"??",
"$",
"markdown",
"->",
"renderText",
"(",
"$",
"this",
"->",
"markdown",
",",
"$",
"data",
")",
";",
"}"
] | Build the text view for a Markdown message.
@param \Illuminate\Mail\Markdown $markdown
@param array $data
@return string | [
"Build",
"the",
"text",
"view",
"for",
"a",
"Markdown",
"message",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Mail/Mailable.php#L303-L307 |
206,434 | laravel/framework | src/Illuminate/Mail/Mailable.php | Mailable.buildFrom | protected function buildFrom($message)
{
if (! empty($this->from)) {
$message->from($this->from[0]['address'], $this->from[0]['name']);
}
return $this;
} | php | protected function buildFrom($message)
{
if (! empty($this->from)) {
$message->from($this->from[0]['address'], $this->from[0]['name']);
}
return $this;
} | [
"protected",
"function",
"buildFrom",
"(",
"$",
"message",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"from",
")",
")",
"{",
"$",
"message",
"->",
"from",
"(",
"$",
"this",
"->",
"from",
"[",
"0",
"]",
"[",
"'address'",
"]",
",",
... | Add the sender to the message.
@param \Illuminate\Mail\Message $message
@return $this | [
"Add",
"the",
"sender",
"to",
"the",
"message",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Mail/Mailable.php#L315-L322 |
206,435 | laravel/framework | src/Illuminate/Mail/Mailable.php | Mailable.buildRecipients | protected function buildRecipients($message)
{
foreach (['to', 'cc', 'bcc', 'replyTo'] as $type) {
foreach ($this->{$type} as $recipient) {
$message->{$type}($recipient['address'], $recipient['name']);
}
}
return $this;
} | php | protected function buildRecipients($message)
{
foreach (['to', 'cc', 'bcc', 'replyTo'] as $type) {
foreach ($this->{$type} as $recipient) {
$message->{$type}($recipient['address'], $recipient['name']);
}
}
return $this;
} | [
"protected",
"function",
"buildRecipients",
"(",
"$",
"message",
")",
"{",
"foreach",
"(",
"[",
"'to'",
",",
"'cc'",
",",
"'bcc'",
",",
"'replyTo'",
"]",
"as",
"$",
"type",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"{",
"$",
"type",
"}",
"as",
"... | Add all of the recipients to the message.
@param \Illuminate\Mail\Message $message
@return $this | [
"Add",
"all",
"of",
"the",
"recipients",
"to",
"the",
"message",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Mail/Mailable.php#L330-L339 |
206,436 | laravel/framework | src/Illuminate/Mail/Mailable.php | Mailable.buildSubject | protected function buildSubject($message)
{
if ($this->subject) {
$message->subject($this->subject);
} else {
$message->subject(Str::title(Str::snake(class_basename($this), ' ')));
}
return $this;
} | php | protected function buildSubject($message)
{
if ($this->subject) {
$message->subject($this->subject);
} else {
$message->subject(Str::title(Str::snake(class_basename($this), ' ')));
}
return $this;
} | [
"protected",
"function",
"buildSubject",
"(",
"$",
"message",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"subject",
")",
"{",
"$",
"message",
"->",
"subject",
"(",
"$",
"this",
"->",
"subject",
")",
";",
"}",
"else",
"{",
"$",
"message",
"->",
"subject"... | Set the subject for the message.
@param \Illuminate\Mail\Message $message
@return $this | [
"Set",
"the",
"subject",
"for",
"the",
"message",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Mail/Mailable.php#L347-L356 |
206,437 | laravel/framework | src/Illuminate/Mail/Mailable.php | Mailable.buildAttachments | protected function buildAttachments($message)
{
foreach ($this->attachments as $attachment) {
$message->attach($attachment['file'], $attachment['options']);
}
foreach ($this->rawAttachments as $attachment) {
$message->attachData(
$attachment['data'], ... | php | protected function buildAttachments($message)
{
foreach ($this->attachments as $attachment) {
$message->attach($attachment['file'], $attachment['options']);
}
foreach ($this->rawAttachments as $attachment) {
$message->attachData(
$attachment['data'], ... | [
"protected",
"function",
"buildAttachments",
"(",
"$",
"message",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"attachments",
"as",
"$",
"attachment",
")",
"{",
"$",
"message",
"->",
"attach",
"(",
"$",
"attachment",
"[",
"'file'",
"]",
",",
"$",
"attach... | Add all of the attachments to the message.
@param \Illuminate\Mail\Message $message
@return $this | [
"Add",
"all",
"of",
"the",
"attachments",
"to",
"the",
"message",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Mail/Mailable.php#L364-L379 |
206,438 | laravel/framework | src/Illuminate/Mail/Mailable.php | Mailable.buildDiskAttachments | protected function buildDiskAttachments($message)
{
foreach ($this->diskAttachments as $attachment) {
$storage = Container::getInstance()->make(
FilesystemFactory::class
)->disk($attachment['disk']);
$message->attachData(
$storage->get($at... | php | protected function buildDiskAttachments($message)
{
foreach ($this->diskAttachments as $attachment) {
$storage = Container::getInstance()->make(
FilesystemFactory::class
)->disk($attachment['disk']);
$message->attachData(
$storage->get($at... | [
"protected",
"function",
"buildDiskAttachments",
"(",
"$",
"message",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"diskAttachments",
"as",
"$",
"attachment",
")",
"{",
"$",
"storage",
"=",
"Container",
"::",
"getInstance",
"(",
")",
"->",
"make",
"(",
"Fi... | Add all of the disk attachments to the message.
@param \Illuminate\Mail\Message $message
@return void | [
"Add",
"all",
"of",
"the",
"disk",
"attachments",
"to",
"the",
"message",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Mail/Mailable.php#L387-L400 |
206,439 | laravel/framework | src/Illuminate/Mail/Mailable.php | Mailable.runCallbacks | protected function runCallbacks($message)
{
foreach ($this->callbacks as $callback) {
$callback($message->getSwiftMessage());
}
return $this;
} | php | protected function runCallbacks($message)
{
foreach ($this->callbacks as $callback) {
$callback($message->getSwiftMessage());
}
return $this;
} | [
"protected",
"function",
"runCallbacks",
"(",
"$",
"message",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"callbacks",
"as",
"$",
"callback",
")",
"{",
"$",
"callback",
"(",
"$",
"message",
"->",
"getSwiftMessage",
"(",
")",
")",
";",
"}",
"return",
"... | Run the callbacks for the message.
@param \Illuminate\Mail\Message $message
@return $this | [
"Run",
"the",
"callbacks",
"for",
"the",
"message",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Mail/Mailable.php#L408-L415 |
206,440 | laravel/framework | src/Illuminate/Mail/Mailable.php | Mailable.addressesToArray | protected function addressesToArray($address, $name)
{
if (! is_array($address) && ! $address instanceof Collection) {
$address = is_string($name) ? [['name' => $name, 'email' => $address]] : [$address];
}
return $address;
} | php | protected function addressesToArray($address, $name)
{
if (! is_array($address) && ! $address instanceof Collection) {
$address = is_string($name) ? [['name' => $name, 'email' => $address]] : [$address];
}
return $address;
} | [
"protected",
"function",
"addressesToArray",
"(",
"$",
"address",
",",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"address",
")",
"&&",
"!",
"$",
"address",
"instanceof",
"Collection",
")",
"{",
"$",
"address",
"=",
"is_string",
"(",
... | Convert the given recipient arguments to an array.
@param object|array|string $address
@param string|null $name
@return array | [
"Convert",
"the",
"given",
"recipient",
"arguments",
"to",
"an",
"array",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Mail/Mailable.php#L598-L605 |
206,441 | laravel/framework | src/Illuminate/Mail/Mailable.php | Mailable.normalizeRecipient | protected function normalizeRecipient($recipient)
{
if (is_array($recipient)) {
return (object) $recipient;
} elseif (is_string($recipient)) {
return (object) ['email' => $recipient];
}
return $recipient;
} | php | protected function normalizeRecipient($recipient)
{
if (is_array($recipient)) {
return (object) $recipient;
} elseif (is_string($recipient)) {
return (object) ['email' => $recipient];
}
return $recipient;
} | [
"protected",
"function",
"normalizeRecipient",
"(",
"$",
"recipient",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"recipient",
")",
")",
"{",
"return",
"(",
"object",
")",
"$",
"recipient",
";",
"}",
"elseif",
"(",
"is_string",
"(",
"$",
"recipient",
")",... | Convert the given recipient into an object.
@param mixed $recipient
@return object | [
"Convert",
"the",
"given",
"recipient",
"into",
"an",
"object",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Mail/Mailable.php#L613-L622 |
206,442 | laravel/framework | src/Illuminate/Mail/Mailable.php | Mailable.hasRecipient | protected function hasRecipient($address, $name = null, $property = 'to')
{
$expected = $this->normalizeRecipient(
$this->addressesToArray($address, $name)[0]
);
$expected = [
'name' => $expected->name ?? null,
'address' => $expected->email,
];
... | php | protected function hasRecipient($address, $name = null, $property = 'to')
{
$expected = $this->normalizeRecipient(
$this->addressesToArray($address, $name)[0]
);
$expected = [
'name' => $expected->name ?? null,
'address' => $expected->email,
];
... | [
"protected",
"function",
"hasRecipient",
"(",
"$",
"address",
",",
"$",
"name",
"=",
"null",
",",
"$",
"property",
"=",
"'to'",
")",
"{",
"$",
"expected",
"=",
"$",
"this",
"->",
"normalizeRecipient",
"(",
"$",
"this",
"->",
"addressesToArray",
"(",
"$",... | Determine if the given recipient is set on the mailable.
@param object|array|string $address
@param string|null $name
@param string $property
@return bool | [
"Determine",
"if",
"the",
"given",
"recipient",
"is",
"set",
"on",
"the",
"mailable",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Mail/Mailable.php#L632-L650 |
206,443 | laravel/framework | src/Illuminate/Mail/Mailable.php | Mailable.text | public function text($textView, array $data = [])
{
$this->textView = $textView;
$this->viewData = array_merge($this->viewData, $data);
return $this;
} | php | public function text($textView, array $data = [])
{
$this->textView = $textView;
$this->viewData = array_merge($this->viewData, $data);
return $this;
} | [
"public",
"function",
"text",
"(",
"$",
"textView",
",",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"textView",
"=",
"$",
"textView",
";",
"$",
"this",
"->",
"viewData",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"viewData",
... | Set the plain text view for the message.
@param string $textView
@param array $data
@return $this | [
"Set",
"the",
"plain",
"text",
"view",
"for",
"the",
"message",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Mail/Mailable.php#L715-L721 |
206,444 | laravel/framework | src/Illuminate/Mail/Mailable.php | Mailable.with | public function with($key, $value = null)
{
if (is_array($key)) {
$this->viewData = array_merge($this->viewData, $key);
} else {
$this->viewData[$key] = $value;
}
return $this;
} | php | public function with($key, $value = null)
{
if (is_array($key)) {
$this->viewData = array_merge($this->viewData, $key);
} else {
$this->viewData[$key] = $value;
}
return $this;
} | [
"public",
"function",
"with",
"(",
"$",
"key",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"key",
")",
")",
"{",
"$",
"this",
"->",
"viewData",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"viewData",
",",
"$",
"key"... | Set the view data for the message.
@param string|array $key
@param mixed $value
@return $this | [
"Set",
"the",
"view",
"data",
"for",
"the",
"message",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Mail/Mailable.php#L730-L739 |
206,445 | laravel/framework | src/Illuminate/Routing/ResourceRegistrar.php | ResourceRegistrar.getResourceWildcard | public function getResourceWildcard($value)
{
if (isset($this->parameters[$value])) {
$value = $this->parameters[$value];
} elseif (isset(static::$parameterMap[$value])) {
$value = static::$parameterMap[$value];
} elseif ($this->parameters === 'singular' || static::$s... | php | public function getResourceWildcard($value)
{
if (isset($this->parameters[$value])) {
$value = $this->parameters[$value];
} elseif (isset(static::$parameterMap[$value])) {
$value = static::$parameterMap[$value];
} elseif ($this->parameters === 'singular' || static::$s... | [
"public",
"function",
"getResourceWildcard",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"parameters",
"[",
"$",
"value",
"]",
")",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"parameters",
"[",
"$",
"value",
"]",
"... | Format a resource parameter for usage.
@param string $value
@return string | [
"Format",
"a",
"resource",
"parameter",
"for",
"usage",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/ResourceRegistrar.php#L338-L349 |
206,446 | laravel/framework | src/Illuminate/Broadcasting/BroadcastController.php | BroadcastController.authenticate | public function authenticate(Request $request)
{
if ($request->hasSession()) {
$request->session()->reflash();
}
return Broadcast::auth($request);
} | php | public function authenticate(Request $request)
{
if ($request->hasSession()) {
$request->session()->reflash();
}
return Broadcast::auth($request);
} | [
"public",
"function",
"authenticate",
"(",
"Request",
"$",
"request",
")",
"{",
"if",
"(",
"$",
"request",
"->",
"hasSession",
"(",
")",
")",
"{",
"$",
"request",
"->",
"session",
"(",
")",
"->",
"reflash",
"(",
")",
";",
"}",
"return",
"Broadcast",
... | Authenticate the request for channel access.
@param \Illuminate\Http\Request $request
@return \Illuminate\Http\Response | [
"Authenticate",
"the",
"request",
"for",
"channel",
"access",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Broadcasting/BroadcastController.php#L17-L24 |
206,447 | laravel/framework | src/Illuminate/Queue/Worker.php | Worker.process | public function process($connectionName, $job, WorkerOptions $options)
{
try {
// First we will raise the before job event and determine if the job has already ran
// over its maximum attempt limits, which could primarily happen when this job is
// continually timing out ... | php | public function process($connectionName, $job, WorkerOptions $options)
{
try {
// First we will raise the before job event and determine if the job has already ran
// over its maximum attempt limits, which could primarily happen when this job is
// continually timing out ... | [
"public",
"function",
"process",
"(",
"$",
"connectionName",
",",
"$",
"job",
",",
"WorkerOptions",
"$",
"options",
")",
"{",
"try",
"{",
"// First we will raise the before job event and determine if the job has already ran",
"// over its maximum attempt limits, which could prima... | Process the given job from the queue.
@param string $connectionName
@param \Illuminate\Contracts\Queue\Job $job
@param \Illuminate\Queue\WorkerOptions $options
@return void
@throws \Throwable | [
"Process",
"the",
"given",
"job",
"from",
"the",
"queue",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Queue/Worker.php#L312-L337 |
206,448 | laravel/framework | src/Illuminate/Queue/Worker.php | Worker.listenForSignals | protected function listenForSignals()
{
pcntl_async_signals(true);
pcntl_signal(SIGTERM, function () {
$this->shouldQuit = true;
});
pcntl_signal(SIGUSR2, function () {
$this->paused = true;
});
pcntl_signal(SIGCONT, function () {
... | php | protected function listenForSignals()
{
pcntl_async_signals(true);
pcntl_signal(SIGTERM, function () {
$this->shouldQuit = true;
});
pcntl_signal(SIGUSR2, function () {
$this->paused = true;
});
pcntl_signal(SIGCONT, function () {
... | [
"protected",
"function",
"listenForSignals",
"(",
")",
"{",
"pcntl_async_signals",
"(",
"true",
")",
";",
"pcntl_signal",
"(",
"SIGTERM",
",",
"function",
"(",
")",
"{",
"$",
"this",
"->",
"shouldQuit",
"=",
"true",
";",
"}",
")",
";",
"pcntl_signal",
"(",... | Enable async signals for the process.
@return void | [
"Enable",
"async",
"signals",
"for",
"the",
"process",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Queue/Worker.php#L517-L532 |
206,449 | laravel/framework | src/Illuminate/Queue/Worker.php | Worker.stop | public function stop($status = 0)
{
$this->events->dispatch(new Events\WorkerStopping($status));
exit($status);
} | php | public function stop($status = 0)
{
$this->events->dispatch(new Events\WorkerStopping($status));
exit($status);
} | [
"public",
"function",
"stop",
"(",
"$",
"status",
"=",
"0",
")",
"{",
"$",
"this",
"->",
"events",
"->",
"dispatch",
"(",
"new",
"Events",
"\\",
"WorkerStopping",
"(",
"$",
"status",
")",
")",
";",
"exit",
"(",
"$",
"status",
")",
";",
"}"
] | Stop listening and bail out of the script.
@param int $status
@return void | [
"Stop",
"listening",
"and",
"bail",
"out",
"of",
"the",
"script",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Queue/Worker.php#L561-L566 |
206,450 | laravel/framework | src/Illuminate/Foundation/Http/Kernel.php | Kernel.dispatchToRouter | protected function dispatchToRouter()
{
return function ($request) {
$this->app->instance('request', $request);
return $this->router->dispatch($request);
};
} | php | protected function dispatchToRouter()
{
return function ($request) {
$this->app->instance('request', $request);
return $this->router->dispatch($request);
};
} | [
"protected",
"function",
"dispatchToRouter",
"(",
")",
"{",
"return",
"function",
"(",
"$",
"request",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"instance",
"(",
"'request'",
",",
"$",
"request",
")",
";",
"return",
"$",
"this",
"->",
"router",
"->",
"... | Get the route dispatcher callback.
@return \Closure | [
"Get",
"the",
"route",
"dispatcher",
"callback",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Http/Kernel.php#L171-L178 |
206,451 | laravel/framework | src/Illuminate/Foundation/Http/Kernel.php | Kernel.prependMiddleware | public function prependMiddleware($middleware)
{
if (array_search($middleware, $this->middleware) === false) {
array_unshift($this->middleware, $middleware);
}
return $this;
} | php | public function prependMiddleware($middleware)
{
if (array_search($middleware, $this->middleware) === false) {
array_unshift($this->middleware, $middleware);
}
return $this;
} | [
"public",
"function",
"prependMiddleware",
"(",
"$",
"middleware",
")",
"{",
"if",
"(",
"array_search",
"(",
"$",
"middleware",
",",
"$",
"this",
"->",
"middleware",
")",
"===",
"false",
")",
"{",
"array_unshift",
"(",
"$",
"this",
"->",
"middleware",
",",... | Add a new middleware to beginning of the stack if it does not already exist.
@param string $middleware
@return $this | [
"Add",
"a",
"new",
"middleware",
"to",
"beginning",
"of",
"the",
"stack",
"if",
"it",
"does",
"not",
"already",
"exist",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Http/Kernel.php#L272-L279 |
206,452 | laravel/framework | src/Illuminate/Validation/Factory.php | Factory.validate | public function validate(array $data, array $rules, array $messages = [], array $customAttributes = [])
{
return $this->make($data, $rules, $messages, $customAttributes)->validate();
} | php | public function validate(array $data, array $rules, array $messages = [], array $customAttributes = [])
{
return $this->make($data, $rules, $messages, $customAttributes)->validate();
} | [
"public",
"function",
"validate",
"(",
"array",
"$",
"data",
",",
"array",
"$",
"rules",
",",
"array",
"$",
"messages",
"=",
"[",
"]",
",",
"array",
"$",
"customAttributes",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"make",
"(",
"$",
"d... | Validate the given data against the provided rules.
@param array $data
@param array $rules
@param array $messages
@param array $customAttributes
@return array
@throws \Illuminate\Validation\ValidationException | [
"Validate",
"the",
"given",
"data",
"against",
"the",
"provided",
"rules",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Validation/Factory.php#L134-L137 |
206,453 | laravel/framework | src/Illuminate/Routing/RouteAction.php | RouteAction.parse | public static function parse($uri, $action)
{
// If no action is passed in right away, we assume the user will make use of
// fluent routing. In that case, we set a default closure, to be executed
// if the user never explicitly sets an action to handle the given uri.
if (is_null($ac... | php | public static function parse($uri, $action)
{
// If no action is passed in right away, we assume the user will make use of
// fluent routing. In that case, we set a default closure, to be executed
// if the user never explicitly sets an action to handle the given uri.
if (is_null($ac... | [
"public",
"static",
"function",
"parse",
"(",
"$",
"uri",
",",
"$",
"action",
")",
"{",
"// If no action is passed in right away, we assume the user will make use of",
"// fluent routing. In that case, we set a default closure, to be executed",
"// if the user never explicitly sets an ac... | Parse the given action into an array.
@param string $uri
@param mixed $action
@return array | [
"Parse",
"the",
"given",
"action",
"into",
"an",
"array",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/RouteAction.php#L19-L50 |
206,454 | laravel/framework | src/Illuminate/Database/Connectors/SqlServerConnector.php | SqlServerConnector.buildHostString | protected function buildHostString(array $config, $separator)
{
if (isset($config['port']) && ! empty($config['port'])) {
return $config['host'].$separator.$config['port'];
} else {
return $config['host'];
}
} | php | protected function buildHostString(array $config, $separator)
{
if (isset($config['port']) && ! empty($config['port'])) {
return $config['host'].$separator.$config['port'];
} else {
return $config['host'];
}
} | [
"protected",
"function",
"buildHostString",
"(",
"array",
"$",
"config",
",",
"$",
"separator",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"config",
"[",
"'port'",
"]",
")",
"&&",
"!",
"empty",
"(",
"$",
"config",
"[",
"'port'",
"]",
")",
")",
"{",
"r... | Build a host string from the given configuration.
@param array $config
@param string $separator
@return string | [
"Build",
"a",
"host",
"string",
"from",
"the",
"given",
"configuration",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Connectors/SqlServerConnector.php#L167-L174 |
206,455 | laravel/framework | src/Illuminate/Database/Query/Grammars/SqlServerGrammar.php | SqlServerGrammar.whereDate | protected function whereDate(Builder $query, $where)
{
$value = $this->parameter($where['value']);
return 'cast('.$this->wrap($where['column']).' as date) '.$where['operator'].' '.$value;
} | php | protected function whereDate(Builder $query, $where)
{
$value = $this->parameter($where['value']);
return 'cast('.$this->wrap($where['column']).' as date) '.$where['operator'].' '.$value;
} | [
"protected",
"function",
"whereDate",
"(",
"Builder",
"$",
"query",
",",
"$",
"where",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"parameter",
"(",
"$",
"where",
"[",
"'value'",
"]",
")",
";",
"return",
"'cast('",
".",
"$",
"this",
"->",
"wrap",... | Compile a "where date" clause.
@param \Illuminate\Database\Query\Builder $query
@param array $where
@return string | [
"Compile",
"a",
"where",
"date",
"clause",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Query/Grammars/SqlServerGrammar.php#L99-L104 |
206,456 | laravel/framework | src/Illuminate/Cache/DatabaseStore.php | DatabaseStore.unserialize | protected function unserialize($value)
{
if ($this->connection instanceof PostgresConnection && ! Str::contains($value, [':', ';'])) {
$value = base64_decode($value);
}
return unserialize($value);
} | php | protected function unserialize($value)
{
if ($this->connection instanceof PostgresConnection && ! Str::contains($value, [':', ';'])) {
$value = base64_decode($value);
}
return unserialize($value);
} | [
"protected",
"function",
"unserialize",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"connection",
"instanceof",
"PostgresConnection",
"&&",
"!",
"Str",
"::",
"contains",
"(",
"$",
"value",
",",
"[",
"':'",
",",
"';'",
"]",
")",
")",
"{",... | Unserialize the given value.
@param string $value
@return mixed | [
"Unserialize",
"the",
"given",
"value",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Cache/DatabaseStore.php#L286-L293 |
206,457 | laravel/framework | src/Illuminate/Cache/CacheManager.php | CacheManager.store | public function store($name = null)
{
$name = $name ?: $this->getDefaultDriver();
return $this->stores[$name] = $this->get($name);
} | php | public function store($name = null)
{
$name = $name ?: $this->getDefaultDriver();
return $this->stores[$name] = $this->get($name);
} | [
"public",
"function",
"store",
"(",
"$",
"name",
"=",
"null",
")",
"{",
"$",
"name",
"=",
"$",
"name",
"?",
":",
"$",
"this",
"->",
"getDefaultDriver",
"(",
")",
";",
"return",
"$",
"this",
"->",
"stores",
"[",
"$",
"name",
"]",
"=",
"$",
"this",... | Get a cache store instance by name, wrapped in a repository.
@param string|null $name
@return \Illuminate\Contracts\Cache\Repository | [
"Get",
"a",
"cache",
"store",
"instance",
"by",
"name",
"wrapped",
"in",
"a",
"repository",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Cache/CacheManager.php#L56-L61 |
206,458 | laravel/framework | src/Illuminate/Cache/CacheManager.php | CacheManager.createApcDriver | protected function createApcDriver(array $config)
{
$prefix = $this->getPrefix($config);
return $this->repository(new ApcStore(new ApcWrapper, $prefix));
} | php | protected function createApcDriver(array $config)
{
$prefix = $this->getPrefix($config);
return $this->repository(new ApcStore(new ApcWrapper, $prefix));
} | [
"protected",
"function",
"createApcDriver",
"(",
"array",
"$",
"config",
")",
"{",
"$",
"prefix",
"=",
"$",
"this",
"->",
"getPrefix",
"(",
"$",
"config",
")",
";",
"return",
"$",
"this",
"->",
"repository",
"(",
"new",
"ApcStore",
"(",
"new",
"ApcWrappe... | Create an instance of the APC cache driver.
@param array $config
@return \Illuminate\Cache\Repository | [
"Create",
"an",
"instance",
"of",
"the",
"APC",
"cache",
"driver",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Cache/CacheManager.php#L131-L136 |
206,459 | laravel/framework | src/Illuminate/Cache/CacheManager.php | CacheManager.createDynamodbDriver | protected function createDynamodbDriver(array $config)
{
$dynamoConfig = [
'region' => $config['region'],
'version' => 'latest',
];
if ($config['key'] && $config['secret']) {
$dynamoConfig['credentials'] = Arr::only(
$config, ['key', 'secr... | php | protected function createDynamodbDriver(array $config)
{
$dynamoConfig = [
'region' => $config['region'],
'version' => 'latest',
];
if ($config['key'] && $config['secret']) {
$dynamoConfig['credentials'] = Arr::only(
$config, ['key', 'secr... | [
"protected",
"function",
"createDynamodbDriver",
"(",
"array",
"$",
"config",
")",
"{",
"$",
"dynamoConfig",
"=",
"[",
"'region'",
"=>",
"$",
"config",
"[",
"'region'",
"]",
",",
"'version'",
"=>",
"'latest'",
",",
"]",
";",
"if",
"(",
"$",
"config",
"["... | Create an instance of the DynamoDB cache driver.
@param array $config
@return \Illuminate\Cache\Repository | [
"Create",
"an",
"instance",
"of",
"the",
"DynamoDB",
"cache",
"driver",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Cache/CacheManager.php#L227-L250 |
206,460 | laravel/framework | src/Illuminate/Cache/CacheManager.php | CacheManager.forgetDriver | public function forgetDriver($name = null)
{
$name = $name ?? $this->getDefaultDriver();
foreach ((array) $name as $cacheName) {
if (isset($this->stores[$cacheName])) {
unset($this->stores[$cacheName]);
}
}
return $this;
} | php | public function forgetDriver($name = null)
{
$name = $name ?? $this->getDefaultDriver();
foreach ((array) $name as $cacheName) {
if (isset($this->stores[$cacheName])) {
unset($this->stores[$cacheName]);
}
}
return $this;
} | [
"public",
"function",
"forgetDriver",
"(",
"$",
"name",
"=",
"null",
")",
"{",
"$",
"name",
"=",
"$",
"name",
"??",
"$",
"this",
"->",
"getDefaultDriver",
"(",
")",
";",
"foreach",
"(",
"(",
"array",
")",
"$",
"name",
"as",
"$",
"cacheName",
")",
"... | Unset the given driver instances.
@param array|string|null $name
@return $this | [
"Unset",
"the",
"given",
"driver",
"instances",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Cache/CacheManager.php#L320-L331 |
206,461 | laravel/framework | src/Illuminate/View/Engines/EngineResolver.php | EngineResolver.register | public function register($engine, Closure $resolver)
{
unset($this->resolved[$engine]);
$this->resolvers[$engine] = $resolver;
} | php | public function register($engine, Closure $resolver)
{
unset($this->resolved[$engine]);
$this->resolvers[$engine] = $resolver;
} | [
"public",
"function",
"register",
"(",
"$",
"engine",
",",
"Closure",
"$",
"resolver",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"resolved",
"[",
"$",
"engine",
"]",
")",
";",
"$",
"this",
"->",
"resolvers",
"[",
"$",
"engine",
"]",
"=",
"$",
"res... | Register a new engine resolver.
The engine string typically corresponds to a file extension.
@param string $engine
@param \Closure $resolver
@return void | [
"Register",
"a",
"new",
"engine",
"resolver",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/View/Engines/EngineResolver.php#L33-L38 |
206,462 | laravel/framework | src/Illuminate/View/Engines/EngineResolver.php | EngineResolver.resolve | public function resolve($engine)
{
if (isset($this->resolved[$engine])) {
return $this->resolved[$engine];
}
if (isset($this->resolvers[$engine])) {
return $this->resolved[$engine] = call_user_func($this->resolvers[$engine]);
}
throw new InvalidArgum... | php | public function resolve($engine)
{
if (isset($this->resolved[$engine])) {
return $this->resolved[$engine];
}
if (isset($this->resolvers[$engine])) {
return $this->resolved[$engine] = call_user_func($this->resolvers[$engine]);
}
throw new InvalidArgum... | [
"public",
"function",
"resolve",
"(",
"$",
"engine",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"resolved",
"[",
"$",
"engine",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"resolved",
"[",
"$",
"engine",
"]",
";",
"}",
"if",
"(",
... | Resolve an engine instance by name.
@param string $engine
@return \Illuminate\Contracts\View\Engine
@throws \InvalidArgumentException | [
"Resolve",
"an",
"engine",
"instance",
"by",
"name",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/View/Engines/EngineResolver.php#L48-L59 |
206,463 | laravel/framework | src/Illuminate/Mail/Mailer.php | Mailer.render | public function render($view, array $data = [])
{
// First we need to parse the view, which could either be a string or an array
// containing both an HTML and plain text versions of the view which should
// be used when sending an e-mail. We will extract both of them out here.
[$vie... | php | public function render($view, array $data = [])
{
// First we need to parse the view, which could either be a string or an array
// containing both an HTML and plain text versions of the view which should
// be used when sending an e-mail. We will extract both of them out here.
[$vie... | [
"public",
"function",
"render",
"(",
"$",
"view",
",",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"// First we need to parse the view, which could either be a string or an array",
"// containing both an HTML and plain text versions of the view which should",
"// be used when se... | Render the given message as a view.
@param string|array $view
@param array $data
@return string | [
"Render",
"the",
"given",
"message",
"as",
"a",
"view",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Mail/Mailer.php#L206-L216 |
206,464 | laravel/framework | src/Illuminate/Mail/Mailer.php | Mailer.sendMailable | protected function sendMailable(MailableContract $mailable)
{
return $mailable instanceof ShouldQueue
? $mailable->queue($this->queue)
: $mailable->send($this);
} | php | protected function sendMailable(MailableContract $mailable)
{
return $mailable instanceof ShouldQueue
? $mailable->queue($this->queue)
: $mailable->send($this);
} | [
"protected",
"function",
"sendMailable",
"(",
"MailableContract",
"$",
"mailable",
")",
"{",
"return",
"$",
"mailable",
"instanceof",
"ShouldQueue",
"?",
"$",
"mailable",
"->",
"queue",
"(",
"$",
"this",
"->",
"queue",
")",
":",
"$",
"mailable",
"->",
"send"... | Send the given mailable.
@param \Illuminate\Contracts\Mail\Mailable $mailable
@return mixed | [
"Send",
"the",
"given",
"mailable",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Mail/Mailer.php#L271-L276 |
206,465 | laravel/framework | src/Illuminate/Mail/Mailer.php | Mailer.setGlobalToAndRemoveCcAndBcc | protected function setGlobalToAndRemoveCcAndBcc($message)
{
$message->to($this->to['address'], $this->to['name'], true);
$message->cc(null, null, true);
$message->bcc(null, null, true);
} | php | protected function setGlobalToAndRemoveCcAndBcc($message)
{
$message->to($this->to['address'], $this->to['name'], true);
$message->cc(null, null, true);
$message->bcc(null, null, true);
} | [
"protected",
"function",
"setGlobalToAndRemoveCcAndBcc",
"(",
"$",
"message",
")",
"{",
"$",
"message",
"->",
"to",
"(",
"$",
"this",
"->",
"to",
"[",
"'address'",
"]",
",",
"$",
"this",
"->",
"to",
"[",
"'name'",
"]",
",",
"true",
")",
";",
"$",
"me... | Set the global "to" address on the given message.
@param \Illuminate\Mail\Message $message
@return void | [
"Set",
"the",
"global",
"to",
"address",
"on",
"the",
"given",
"message",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Mail/Mailer.php#L362-L367 |
206,466 | laravel/framework | src/Illuminate/Mail/Mailer.php | Mailer.shouldSendMessage | protected function shouldSendMessage($message, $data = [])
{
if (! $this->events) {
return true;
}
return $this->events->until(
new Events\MessageSending($message, $data)
) !== false;
} | php | protected function shouldSendMessage($message, $data = [])
{
if (! $this->events) {
return true;
}
return $this->events->until(
new Events\MessageSending($message, $data)
) !== false;
} | [
"protected",
"function",
"shouldSendMessage",
"(",
"$",
"message",
",",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"events",
")",
"{",
"return",
"true",
";",
"}",
"return",
"$",
"this",
"->",
"events",
"->",
"until",
"... | Determines if the message can be sent.
@param \Swift_Message $message
@param array $data
@return bool | [
"Determines",
"if",
"the",
"message",
"can",
"be",
"sent",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Mail/Mailer.php#L497-L506 |
206,467 | laravel/framework | src/Illuminate/Mail/Mailer.php | Mailer.dispatchSentEvent | protected function dispatchSentEvent($message, $data = [])
{
if ($this->events) {
$this->events->dispatch(
new Events\MessageSent($message->getSwiftMessage(), $data)
);
}
} | php | protected function dispatchSentEvent($message, $data = [])
{
if ($this->events) {
$this->events->dispatch(
new Events\MessageSent($message->getSwiftMessage(), $data)
);
}
} | [
"protected",
"function",
"dispatchSentEvent",
"(",
"$",
"message",
",",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"events",
")",
"{",
"$",
"this",
"->",
"events",
"->",
"dispatch",
"(",
"new",
"Events",
"\\",
"MessageSent",
... | Dispatch the message sent event.
@param \Illuminate\Mail\Message $message
@param array $data
@return void | [
"Dispatch",
"the",
"message",
"sent",
"event",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Mail/Mailer.php#L515-L522 |
206,468 | laravel/framework | src/Illuminate/Notifications/Messages/SimpleMessage.php | SimpleMessage.action | public function action($text, $url)
{
$this->actionText = $text;
$this->actionUrl = $url;
return $this;
} | php | public function action($text, $url)
{
$this->actionText = $text;
$this->actionUrl = $url;
return $this;
} | [
"public",
"function",
"action",
"(",
"$",
"text",
",",
"$",
"url",
")",
"{",
"$",
"this",
"->",
"actionText",
"=",
"$",
"text",
";",
"$",
"this",
"->",
"actionUrl",
"=",
"$",
"url",
";",
"return",
"$",
"this",
";",
"}"
] | Configure the "call to action" button.
@param string $text
@param string $url
@return $this | [
"Configure",
"the",
"call",
"to",
"action",
"button",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Notifications/Messages/SimpleMessage.php#L198-L204 |
206,469 | laravel/framework | src/Illuminate/Notifications/Messages/SimpleMessage.php | SimpleMessage.toArray | public function toArray()
{
return [
'level' => $this->level,
'subject' => $this->subject,
'greeting' => $this->greeting,
'salutation' => $this->salutation,
'introLines' => $this->introLines,
'outroLines' => $this->outroLines,
... | php | public function toArray()
{
return [
'level' => $this->level,
'subject' => $this->subject,
'greeting' => $this->greeting,
'salutation' => $this->salutation,
'introLines' => $this->introLines,
'outroLines' => $this->outroLines,
... | [
"public",
"function",
"toArray",
"(",
")",
"{",
"return",
"[",
"'level'",
"=>",
"$",
"this",
"->",
"level",
",",
"'subject'",
"=>",
"$",
"this",
"->",
"subject",
",",
"'greeting'",
"=>",
"$",
"this",
"->",
"greeting",
",",
"'salutation'",
"=>",
"$",
"t... | Get an array representation of the message.
@return array | [
"Get",
"an",
"array",
"representation",
"of",
"the",
"message",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Notifications/Messages/SimpleMessage.php#L211-L223 |
206,470 | laravel/framework | src/Illuminate/Database/Console/Migrations/TableGuesser.php | TableGuesser.guess | public static function guess($migration)
{
foreach (self::CREATE_PATTERNS as $pattern) {
if (preg_match($pattern, $migration, $matches)) {
return [$matches[1], $create = true];
}
}
foreach (self::CHANGE_PATTERNS as $pattern) {
if (preg_mat... | php | public static function guess($migration)
{
foreach (self::CREATE_PATTERNS as $pattern) {
if (preg_match($pattern, $migration, $matches)) {
return [$matches[1], $create = true];
}
}
foreach (self::CHANGE_PATTERNS as $pattern) {
if (preg_mat... | [
"public",
"static",
"function",
"guess",
"(",
"$",
"migration",
")",
"{",
"foreach",
"(",
"self",
"::",
"CREATE_PATTERNS",
"as",
"$",
"pattern",
")",
"{",
"if",
"(",
"preg_match",
"(",
"$",
"pattern",
",",
"$",
"migration",
",",
"$",
"matches",
")",
")... | Attempt to guess the table name and "creation" status of the given migration.
@param string $migration
@return array | [
"Attempt",
"to",
"guess",
"the",
"table",
"name",
"and",
"creation",
"status",
"of",
"the",
"given",
"migration",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Console/Migrations/TableGuesser.php#L23-L36 |
206,471 | laravel/framework | src/Illuminate/Pagination/UrlWindow.php | UrlWindow.getAdjacentUrlRange | public function getAdjacentUrlRange($onEachSide)
{
return $this->paginator->getUrlRange(
$this->currentPage() - $onEachSide,
$this->currentPage() + $onEachSide
);
} | php | public function getAdjacentUrlRange($onEachSide)
{
return $this->paginator->getUrlRange(
$this->currentPage() - $onEachSide,
$this->currentPage() + $onEachSide
);
} | [
"public",
"function",
"getAdjacentUrlRange",
"(",
"$",
"onEachSide",
")",
"{",
"return",
"$",
"this",
"->",
"paginator",
"->",
"getUrlRange",
"(",
"$",
"this",
"->",
"currentPage",
"(",
")",
"-",
"$",
"onEachSide",
",",
"$",
"this",
"->",
"currentPage",
"(... | Get the page range for the current page window.
@param int $onEachSide
@return array | [
"Get",
"the",
"page",
"range",
"for",
"the",
"current",
"page",
"window",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Pagination/UrlWindow.php#L158-L164 |
206,472 | laravel/framework | src/Illuminate/Support/Facades/Storage.php | Storage.persistentFake | public static function persistentFake($disk = null)
{
$disk = $disk ?: self::$app['config']->get('filesystems.default');
static::set($disk, $fake = self::createLocalDriver([
'root' => storage_path('framework/testing/disks/'.$disk),
]));
return $fake;
} | php | public static function persistentFake($disk = null)
{
$disk = $disk ?: self::$app['config']->get('filesystems.default');
static::set($disk, $fake = self::createLocalDriver([
'root' => storage_path('framework/testing/disks/'.$disk),
]));
return $fake;
} | [
"public",
"static",
"function",
"persistentFake",
"(",
"$",
"disk",
"=",
"null",
")",
"{",
"$",
"disk",
"=",
"$",
"disk",
"?",
":",
"self",
"::",
"$",
"app",
"[",
"'config'",
"]",
"->",
"get",
"(",
"'filesystems.default'",
")",
";",
"static",
"::",
"... | Replace the given disk with a persistent local testing disk.
@param string|null $disk
@return \Illuminate\Filesystem\Filesystem | [
"Replace",
"the",
"given",
"disk",
"with",
"a",
"persistent",
"local",
"testing",
"disk",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Support/Facades/Storage.php#L40-L49 |
206,473 | laravel/framework | src/Illuminate/Pagination/AbstractPaginator.php | AbstractPaginator.getUrlRange | public function getUrlRange($start, $end)
{
return collect(range($start, $end))->mapWithKeys(function ($page) {
return [$page => $this->url($page)];
})->all();
} | php | public function getUrlRange($start, $end)
{
return collect(range($start, $end))->mapWithKeys(function ($page) {
return [$page => $this->url($page)];
})->all();
} | [
"public",
"function",
"getUrlRange",
"(",
"$",
"start",
",",
"$",
"end",
")",
"{",
"return",
"collect",
"(",
"range",
"(",
"$",
"start",
",",
"$",
"end",
")",
")",
"->",
"mapWithKeys",
"(",
"function",
"(",
"$",
"page",
")",
"{",
"return",
"[",
"$"... | Create a range of pagination URLs.
@param int $start
@param int $end
@return array | [
"Create",
"a",
"range",
"of",
"pagination",
"URLs",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Pagination/AbstractPaginator.php#L147-L152 |
206,474 | laravel/framework | src/Illuminate/Pagination/AbstractPaginator.php | AbstractPaginator.appendArray | protected function appendArray(array $keys)
{
foreach ($keys as $key => $value) {
$this->addQuery($key, $value);
}
return $this;
} | php | protected function appendArray(array $keys)
{
foreach ($keys as $key => $value) {
$this->addQuery($key, $value);
}
return $this;
} | [
"protected",
"function",
"appendArray",
"(",
"array",
"$",
"keys",
")",
"{",
"foreach",
"(",
"$",
"keys",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"addQuery",
"(",
"$",
"key",
",",
"$",
"value",
")",
";",
"}",
"return",
... | Add an array of query string values.
@param array $keys
@return $this | [
"Add",
"an",
"array",
"of",
"query",
"string",
"values",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Pagination/AbstractPaginator.php#L224-L231 |
206,475 | laravel/framework | src/Illuminate/Pagination/AbstractPaginator.php | AbstractPaginator.addQuery | protected function addQuery($key, $value)
{
if ($key !== $this->pageName) {
$this->query[$key] = $value;
}
return $this;
} | php | protected function addQuery($key, $value)
{
if ($key !== $this->pageName) {
$this->query[$key] = $value;
}
return $this;
} | [
"protected",
"function",
"addQuery",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"key",
"!==",
"$",
"this",
"->",
"pageName",
")",
"{",
"$",
"this",
"->",
"query",
"[",
"$",
"key",
"]",
"=",
"$",
"value",
";",
"}",
"return",
"... | Add a query string value to the paginator.
@param string $key
@param string $value
@return $this | [
"Add",
"a",
"query",
"string",
"value",
"to",
"the",
"paginator",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Pagination/AbstractPaginator.php#L240-L247 |
206,476 | laravel/framework | src/Illuminate/Auth/Recaller.php | Recaller.hasAllSegments | protected function hasAllSegments()
{
$segments = explode('|', $this->recaller);
return count($segments) === 3 && trim($segments[0]) !== '' && trim($segments[1]) !== '';
} | php | protected function hasAllSegments()
{
$segments = explode('|', $this->recaller);
return count($segments) === 3 && trim($segments[0]) !== '' && trim($segments[1]) !== '';
} | [
"protected",
"function",
"hasAllSegments",
"(",
")",
"{",
"$",
"segments",
"=",
"explode",
"(",
"'|'",
",",
"$",
"this",
"->",
"recaller",
")",
";",
"return",
"count",
"(",
"$",
"segments",
")",
"===",
"3",
"&&",
"trim",
"(",
"$",
"segments",
"[",
"0... | Determine if the recaller has all segments.
@return bool | [
"Determine",
"if",
"the",
"recaller",
"has",
"all",
"segments",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Auth/Recaller.php#L82-L87 |
206,477 | laravel/framework | src/Illuminate/Http/Resources/ConditionallyLoadsAttributes.php | ConditionallyLoadsAttributes.removeMissingValues | protected function removeMissingValues($data)
{
$numericKeys = true;
foreach ($data as $key => $value) {
if (($value instanceof PotentiallyMissing && $value->isMissing()) ||
($value instanceof self &&
$value->resource instanceof PotentiallyMissing &&
... | php | protected function removeMissingValues($data)
{
$numericKeys = true;
foreach ($data as $key => $value) {
if (($value instanceof PotentiallyMissing && $value->isMissing()) ||
($value instanceof self &&
$value->resource instanceof PotentiallyMissing &&
... | [
"protected",
"function",
"removeMissingValues",
"(",
"$",
"data",
")",
"{",
"$",
"numericKeys",
"=",
"true",
";",
"foreach",
"(",
"$",
"data",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"(",
"$",
"value",
"instanceof",
"PotentiallyMissing... | Remove the missing values from the filtered data.
@param array $data
@return array | [
"Remove",
"the",
"missing",
"values",
"from",
"the",
"filtered",
"data",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Http/Resources/ConditionallyLoadsAttributes.php#L72-L92 |
206,478 | laravel/framework | src/Illuminate/Http/Resources/ConditionallyLoadsAttributes.php | ConditionallyLoadsAttributes.whenPivotLoadedAs | protected function whenPivotLoadedAs($accessor, $table, $value, $default = null)
{
if (func_num_args() === 3) {
$default = new MissingValue;
}
return $this->when(
$this->resource->$accessor &&
($this->resource->$accessor instanceof $table ||
$... | php | protected function whenPivotLoadedAs($accessor, $table, $value, $default = null)
{
if (func_num_args() === 3) {
$default = new MissingValue;
}
return $this->when(
$this->resource->$accessor &&
($this->resource->$accessor instanceof $table ||
$... | [
"protected",
"function",
"whenPivotLoadedAs",
"(",
"$",
"accessor",
",",
"$",
"table",
",",
"$",
"value",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"func_num_args",
"(",
")",
"===",
"3",
")",
"{",
"$",
"default",
"=",
"new",
"MissingValue"... | Execute a callback if the given pivot table with a custom accessor has been loaded.
@param string $accessor
@param string $table
@param mixed $value
@param mixed $default
@return \Illuminate\Http\Resources\MissingValue|mixed | [
"Execute",
"a",
"callback",
"if",
"the",
"given",
"pivot",
"table",
"with",
"a",
"custom",
"accessor",
"has",
"been",
"loaded",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Http/Resources/ConditionallyLoadsAttributes.php#L198-L210 |
206,479 | laravel/framework | src/Illuminate/Queue/SerializesAndRestoresModelIdentifiers.php | SerializesAndRestoresModelIdentifiers.restoreModel | public function restoreModel($value)
{
return $this->getQueryForModelRestoration(
(new $value->class)->setConnection($value->connection), $value->id
)->useWritePdo()->firstOrFail()->load($value->relations ?? []);
} | php | public function restoreModel($value)
{
return $this->getQueryForModelRestoration(
(new $value->class)->setConnection($value->connection), $value->id
)->useWritePdo()->firstOrFail()->load($value->relations ?? []);
} | [
"public",
"function",
"restoreModel",
"(",
"$",
"value",
")",
"{",
"return",
"$",
"this",
"->",
"getQueryForModelRestoration",
"(",
"(",
"new",
"$",
"value",
"->",
"class",
")",
"->",
"setConnection",
"(",
"$",
"value",
"->",
"connection",
")",
",",
"$",
... | Restore the model from the model identifier instance.
@param \Illuminate\Contracts\Database\ModelIdentifier $value
@return \Illuminate\Database\Eloquent\Model | [
"Restore",
"the",
"model",
"from",
"the",
"model",
"identifier",
"instance",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Queue/SerializesAndRestoresModelIdentifiers.php#L81-L86 |
206,480 | laravel/framework | src/Illuminate/Filesystem/FilesystemManager.php | FilesystemManager.cloud | public function cloud()
{
$name = $this->getDefaultCloudDriver();
return $this->disks[$name] = $this->get($name);
} | php | public function cloud()
{
$name = $this->getDefaultCloudDriver();
return $this->disks[$name] = $this->get($name);
} | [
"public",
"function",
"cloud",
"(",
")",
"{",
"$",
"name",
"=",
"$",
"this",
"->",
"getDefaultCloudDriver",
"(",
")",
";",
"return",
"$",
"this",
"->",
"disks",
"[",
"$",
"name",
"]",
"=",
"$",
"this",
"->",
"get",
"(",
"$",
"name",
")",
";",
"}"... | Get a default cloud filesystem instance.
@return \Illuminate\Contracts\Filesystem\Filesystem | [
"Get",
"a",
"default",
"cloud",
"filesystem",
"instance",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Filesystem/FilesystemManager.php#L88-L93 |
206,481 | laravel/framework | src/Illuminate/Support/Collection.php | Collection.times | public static function times($number, callable $callback = null)
{
if ($number < 1) {
return new static;
}
if (is_null($callback)) {
return new static(range(1, $number));
}
return (new static(range(1, $number)))->map($callback);
} | php | public static function times($number, callable $callback = null)
{
if ($number < 1) {
return new static;
}
if (is_null($callback)) {
return new static(range(1, $number));
}
return (new static(range(1, $number)))->map($callback);
} | [
"public",
"static",
"function",
"times",
"(",
"$",
"number",
",",
"callable",
"$",
"callback",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"number",
"<",
"1",
")",
"{",
"return",
"new",
"static",
";",
"}",
"if",
"(",
"is_null",
"(",
"$",
"callback",
")"... | Create a new collection by invoking the callback a given amount of times.
@param int $number
@param callable $callback
@return static | [
"Create",
"a",
"new",
"collection",
"by",
"invoking",
"the",
"callback",
"a",
"given",
"amount",
"of",
"times",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Support/Collection.php#L115-L126 |
206,482 | laravel/framework | src/Illuminate/Support/Collection.php | Collection.diffUsing | public function diffUsing($items, callable $callback)
{
return new static(array_udiff($this->items, $this->getArrayableItems($items), $callback));
} | php | public function diffUsing($items, callable $callback)
{
return new static(array_udiff($this->items, $this->getArrayableItems($items), $callback));
} | [
"public",
"function",
"diffUsing",
"(",
"$",
"items",
",",
"callable",
"$",
"callback",
")",
"{",
"return",
"new",
"static",
"(",
"array_udiff",
"(",
"$",
"this",
"->",
"items",
",",
"$",
"this",
"->",
"getArrayableItems",
"(",
"$",
"items",
")",
",",
... | Get the items in the collection that are not present in the given items.
@param mixed $items
@param callable $callback
@return static | [
"Get",
"the",
"items",
"in",
"the",
"collection",
"that",
"are",
"not",
"present",
"in",
"the",
"given",
"items",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Support/Collection.php#L357-L360 |
206,483 | laravel/framework | src/Illuminate/Support/Collection.php | Collection.diffAssocUsing | public function diffAssocUsing($items, callable $callback)
{
return new static(array_diff_uassoc($this->items, $this->getArrayableItems($items), $callback));
} | php | public function diffAssocUsing($items, callable $callback)
{
return new static(array_diff_uassoc($this->items, $this->getArrayableItems($items), $callback));
} | [
"public",
"function",
"diffAssocUsing",
"(",
"$",
"items",
",",
"callable",
"$",
"callback",
")",
"{",
"return",
"new",
"static",
"(",
"array_diff_uassoc",
"(",
"$",
"this",
"->",
"items",
",",
"$",
"this",
"->",
"getArrayableItems",
"(",
"$",
"items",
")"... | Get the items in the collection whose keys and values are not present in the given items.
@param mixed $items
@param callable $callback
@return static | [
"Get",
"the",
"items",
"in",
"the",
"collection",
"whose",
"keys",
"and",
"values",
"are",
"not",
"present",
"in",
"the",
"given",
"items",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Support/Collection.php#L380-L383 |
206,484 | laravel/framework | src/Illuminate/Support/Collection.php | Collection.diffKeysUsing | public function diffKeysUsing($items, callable $callback)
{
return new static(array_diff_ukey($this->items, $this->getArrayableItems($items), $callback));
} | php | public function diffKeysUsing($items, callable $callback)
{
return new static(array_diff_ukey($this->items, $this->getArrayableItems($items), $callback));
} | [
"public",
"function",
"diffKeysUsing",
"(",
"$",
"items",
",",
"callable",
"$",
"callback",
")",
"{",
"return",
"new",
"static",
"(",
"array_diff_ukey",
"(",
"$",
"this",
"->",
"items",
",",
"$",
"this",
"->",
"getArrayableItems",
"(",
"$",
"items",
")",
... | Get the items in the collection whose keys are not present in the given items.
@param mixed $items
@param callable $callback
@return static | [
"Get",
"the",
"items",
"in",
"the",
"collection",
"whose",
"keys",
"are",
"not",
"present",
"in",
"the",
"given",
"items",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Support/Collection.php#L403-L406 |
206,485 | laravel/framework | src/Illuminate/Support/Collection.php | Collection.duplicates | public function duplicates($callback = null, $strict = false)
{
$items = $this->map($this->valueRetriever($callback));
$uniqueItems = $items->unique(null, $strict);
$compare = $this->duplicateComparator($strict);
$duplicates = new static;
foreach ($items as $key => $value... | php | public function duplicates($callback = null, $strict = false)
{
$items = $this->map($this->valueRetriever($callback));
$uniqueItems = $items->unique(null, $strict);
$compare = $this->duplicateComparator($strict);
$duplicates = new static;
foreach ($items as $key => $value... | [
"public",
"function",
"duplicates",
"(",
"$",
"callback",
"=",
"null",
",",
"$",
"strict",
"=",
"false",
")",
"{",
"$",
"items",
"=",
"$",
"this",
"->",
"map",
"(",
"$",
"this",
"->",
"valueRetriever",
"(",
"$",
"callback",
")",
")",
";",
"$",
"uni... | Retrieve duplicate items from the collection.
@param callable|null $callback
@param bool $strict
@return static | [
"Retrieve",
"duplicate",
"items",
"from",
"the",
"collection",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Support/Collection.php#L415-L434 |
206,486 | laravel/framework | src/Illuminate/Support/Collection.php | Collection.duplicateComparator | protected function duplicateComparator($strict)
{
if ($strict) {
return function ($a, $b) {
return $a === $b;
};
}
return function ($a, $b) {
return $a == $b;
};
} | php | protected function duplicateComparator($strict)
{
if ($strict) {
return function ($a, $b) {
return $a === $b;
};
}
return function ($a, $b) {
return $a == $b;
};
} | [
"protected",
"function",
"duplicateComparator",
"(",
"$",
"strict",
")",
"{",
"if",
"(",
"$",
"strict",
")",
"{",
"return",
"function",
"(",
"$",
"a",
",",
"$",
"b",
")",
"{",
"return",
"$",
"a",
"===",
"$",
"b",
";",
"}",
";",
"}",
"return",
"fu... | Get the comparison function to detect duplicates.
@param bool $strict
@return \Closure | [
"Get",
"the",
"comparison",
"function",
"to",
"detect",
"duplicates",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Support/Collection.php#L453-L464 |
206,487 | laravel/framework | src/Illuminate/Support/Collection.php | Collection.eachSpread | public function eachSpread(callable $callback)
{
return $this->each(function ($chunk, $key) use ($callback) {
$chunk[] = $key;
return $callback(...$chunk);
});
} | php | public function eachSpread(callable $callback)
{
return $this->each(function ($chunk, $key) use ($callback) {
$chunk[] = $key;
return $callback(...$chunk);
});
} | [
"public",
"function",
"eachSpread",
"(",
"callable",
"$",
"callback",
")",
"{",
"return",
"$",
"this",
"->",
"each",
"(",
"function",
"(",
"$",
"chunk",
",",
"$",
"key",
")",
"use",
"(",
"$",
"callback",
")",
"{",
"$",
"chunk",
"[",
"]",
"=",
"$",
... | Execute a callback over each nested chunk of items.
@param callable $callback
@return static | [
"Execute",
"a",
"callback",
"over",
"each",
"nested",
"chunk",
"of",
"items",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Support/Collection.php#L489-L496 |
206,488 | laravel/framework | src/Illuminate/Support/Collection.php | Collection.whereBetween | public function whereBetween($key, $values)
{
return $this->where($key, '>=', reset($values))->where($key, '<=', end($values));
} | php | public function whereBetween($key, $values)
{
return $this->where($key, '>=', reset($values))->where($key, '<=', end($values));
} | [
"public",
"function",
"whereBetween",
"(",
"$",
"key",
",",
"$",
"values",
")",
"{",
"return",
"$",
"this",
"->",
"where",
"(",
"$",
"key",
",",
"'>='",
",",
"reset",
"(",
"$",
"values",
")",
")",
"->",
"where",
"(",
"$",
"key",
",",
"'<='",
",",... | Filter items such that the value of the given key is between the given values.
@param string $key
@param array $values
@return static | [
"Filter",
"items",
"such",
"that",
"the",
"value",
"of",
"the",
"given",
"key",
"is",
"between",
"the",
"given",
"values",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Support/Collection.php#L745-L748 |
206,489 | laravel/framework | src/Illuminate/Support/Collection.php | Collection.whereNotBetween | public function whereNotBetween($key, $values)
{
return $this->filter(function ($item) use ($key, $values) {
return data_get($item, $key) < reset($values) || data_get($item, $key) > end($values);
});
} | php | public function whereNotBetween($key, $values)
{
return $this->filter(function ($item) use ($key, $values) {
return data_get($item, $key) < reset($values) || data_get($item, $key) > end($values);
});
} | [
"public",
"function",
"whereNotBetween",
"(",
"$",
"key",
",",
"$",
"values",
")",
"{",
"return",
"$",
"this",
"->",
"filter",
"(",
"function",
"(",
"$",
"item",
")",
"use",
"(",
"$",
"key",
",",
"$",
"values",
")",
"{",
"return",
"data_get",
"(",
... | Filter items such that the value of the given key is not between the given values.
@param string $key
@param array $values
@return static | [
"Filter",
"items",
"such",
"that",
"the",
"value",
"of",
"the",
"given",
"key",
"is",
"not",
"between",
"the",
"given",
"values",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Support/Collection.php#L757-L762 |
206,490 | laravel/framework | src/Illuminate/Support/Collection.php | Collection.join | public function join($glue, $finalGlue = '')
{
if ($finalGlue === '') {
return $this->implode($glue);
}
$count = $this->count();
if ($count === 0) {
return '';
}
if ($count === 1) {
return $this->last();
}
$colle... | php | public function join($glue, $finalGlue = '')
{
if ($finalGlue === '') {
return $this->implode($glue);
}
$count = $this->count();
if ($count === 0) {
return '';
}
if ($count === 1) {
return $this->last();
}
$colle... | [
"public",
"function",
"join",
"(",
"$",
"glue",
",",
"$",
"finalGlue",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"finalGlue",
"===",
"''",
")",
"{",
"return",
"$",
"this",
"->",
"implode",
"(",
"$",
"glue",
")",
";",
"}",
"$",
"count",
"=",
"$",
"th... | Join all items from the collection using a string. The final items can use a separate glue string.
@param string $glue
@param string $finalGlue
@return string | [
"Join",
"all",
"items",
"from",
"the",
"collection",
"using",
"a",
"string",
".",
"The",
"final",
"items",
"can",
"use",
"a",
"separate",
"glue",
"string",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Support/Collection.php#L1053-L1074 |
206,491 | laravel/framework | src/Illuminate/Support/Collection.php | Collection.mapSpread | public function mapSpread(callable $callback)
{
return $this->map(function ($chunk, $key) use ($callback) {
$chunk[] = $key;
return $callback(...$chunk);
});
} | php | public function mapSpread(callable $callback)
{
return $this->map(function ($chunk, $key) use ($callback) {
$chunk[] = $key;
return $callback(...$chunk);
});
} | [
"public",
"function",
"mapSpread",
"(",
"callable",
"$",
"callback",
")",
"{",
"return",
"$",
"this",
"->",
"map",
"(",
"function",
"(",
"$",
"chunk",
",",
"$",
"key",
")",
"use",
"(",
"$",
"callback",
")",
"{",
"$",
"chunk",
"[",
"]",
"=",
"$",
... | Run a map over each nested chunk of items.
@param callable $callback
@return static | [
"Run",
"a",
"map",
"over",
"each",
"nested",
"chunk",
"of",
"items",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Support/Collection.php#L1131-L1138 |
206,492 | laravel/framework | src/Illuminate/Support/Collection.php | Collection.concat | public function concat($source)
{
$result = new static($this);
foreach ($source as $item) {
$result->push($item);
}
return $result;
} | php | public function concat($source)
{
$result = new static($this);
foreach ($source as $item) {
$result->push($item);
}
return $result;
} | [
"public",
"function",
"concat",
"(",
"$",
"source",
")",
"{",
"$",
"result",
"=",
"new",
"static",
"(",
"$",
"this",
")",
";",
"foreach",
"(",
"$",
"source",
"as",
"$",
"item",
")",
"{",
"$",
"result",
"->",
"push",
"(",
"$",
"item",
")",
";",
... | Push all of the given items onto the collection.
@param iterable $source
@return static | [
"Push",
"all",
"of",
"the",
"given",
"items",
"onto",
"the",
"collection",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Support/Collection.php#L1438-L1447 |
206,493 | laravel/framework | src/Illuminate/Support/Collection.php | Collection.random | public function random($number = null)
{
if (is_null($number)) {
return Arr::random($this->items);
}
return new static(Arr::random($this->items, $number));
} | php | public function random($number = null)
{
if (is_null($number)) {
return Arr::random($this->items);
}
return new static(Arr::random($this->items, $number));
} | [
"public",
"function",
"random",
"(",
"$",
"number",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"number",
")",
")",
"{",
"return",
"Arr",
"::",
"random",
"(",
"$",
"this",
"->",
"items",
")",
";",
"}",
"return",
"new",
"static",
"(",
"... | Get one or a specified number of items randomly from the collection.
@param int|null $number
@return static|mixed
@throws \InvalidArgumentException | [
"Get",
"one",
"or",
"a",
"specified",
"number",
"of",
"items",
"randomly",
"from",
"the",
"collection",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Support/Collection.php#L1483-L1490 |
206,494 | laravel/framework | src/Illuminate/Support/Collection.php | Collection.search | public function search($value, $strict = false)
{
if (! $this->useAsCallable($value)) {
return array_search($value, $this->items, $strict);
}
foreach ($this->items as $key => $item) {
if (call_user_func($value, $item, $key)) {
return $key;
... | php | public function search($value, $strict = false)
{
if (! $this->useAsCallable($value)) {
return array_search($value, $this->items, $strict);
}
foreach ($this->items as $key => $item) {
if (call_user_func($value, $item, $key)) {
return $key;
... | [
"public",
"function",
"search",
"(",
"$",
"value",
",",
"$",
"strict",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"useAsCallable",
"(",
"$",
"value",
")",
")",
"{",
"return",
"array_search",
"(",
"$",
"value",
",",
"$",
"this",
"->"... | Search the collection for a given value and return the corresponding key if successful.
@param mixed $value
@param bool $strict
@return mixed | [
"Search",
"the",
"collection",
"for",
"a",
"given",
"value",
"and",
"return",
"the",
"corresponding",
"key",
"if",
"successful",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Support/Collection.php#L1538-L1551 |
206,495 | laravel/framework | src/Illuminate/Support/Collection.php | Collection.sortKeys | public function sortKeys($options = SORT_REGULAR, $descending = false)
{
$items = $this->items;
$descending ? krsort($items, $options) : ksort($items, $options);
return new static($items);
} | php | public function sortKeys($options = SORT_REGULAR, $descending = false)
{
$items = $this->items;
$descending ? krsort($items, $options) : ksort($items, $options);
return new static($items);
} | [
"public",
"function",
"sortKeys",
"(",
"$",
"options",
"=",
"SORT_REGULAR",
",",
"$",
"descending",
"=",
"false",
")",
"{",
"$",
"items",
"=",
"$",
"this",
"->",
"items",
";",
"$",
"descending",
"?",
"krsort",
"(",
"$",
"items",
",",
"$",
"options",
... | Sort the collection keys.
@param int $options
@param bool $descending
@return static | [
"Sort",
"the",
"collection",
"keys",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Support/Collection.php#L1714-L1721 |
206,496 | laravel/framework | src/Illuminate/Support/Collection.php | Collection.countBy | public function countBy($callback = null)
{
if (is_null($callback)) {
$callback = function ($value) {
return $value;
};
}
return new static($this->groupBy($callback)->map(function ($value) {
return $value->count();
}));
} | php | public function countBy($callback = null)
{
if (is_null($callback)) {
$callback = function ($value) {
return $value;
};
}
return new static($this->groupBy($callback)->map(function ($value) {
return $value->count();
}));
} | [
"public",
"function",
"countBy",
"(",
"$",
"callback",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"callback",
")",
")",
"{",
"$",
"callback",
"=",
"function",
"(",
"$",
"value",
")",
"{",
"return",
"$",
"value",
";",
"}",
";",
"}",
"r... | Count the number of items in the collection using a given truth test.
@param callable|null $callback
@return static | [
"Count",
"the",
"number",
"of",
"items",
"in",
"the",
"collection",
"using",
"a",
"given",
"truth",
"test",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Support/Collection.php#L1985-L1996 |
206,497 | laravel/framework | src/Illuminate/Foundation/Console/EventListCommand.php | EventListCommand.filterEvents | protected function filterEvents(array $events)
{
if (! $eventName = $this->option('event')) {
return $events;
}
return collect($events)->filter(function ($listeners, $event) use ($eventName) {
return Str::contains($event, $eventName);
})->toArray();
} | php | protected function filterEvents(array $events)
{
if (! $eventName = $this->option('event')) {
return $events;
}
return collect($events)->filter(function ($listeners, $event) use ($eventName) {
return Str::contains($event, $eventName);
})->toArray();
} | [
"protected",
"function",
"filterEvents",
"(",
"array",
"$",
"events",
")",
"{",
"if",
"(",
"!",
"$",
"eventName",
"=",
"$",
"this",
"->",
"option",
"(",
"'event'",
")",
")",
"{",
"return",
"$",
"events",
";",
"}",
"return",
"collect",
"(",
"$",
"even... | Filter the given events using the provided event name filter.
@param array $events
@return array | [
"Filter",
"the",
"given",
"events",
"using",
"the",
"provided",
"event",
"name",
"filter",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Console/EventListCommand.php#L71-L80 |
206,498 | laravel/framework | src/Illuminate/Queue/QueueServiceProvider.php | QueueServiceProvider.registerOpisSecurityKey | protected function registerOpisSecurityKey()
{
if (Str::startsWith($key = $this->app['config']->get('app.key'), 'base64:')) {
$key = base64_decode(substr($key, 7));
}
SerializableClosure::setSecretKey($key);
} | php | protected function registerOpisSecurityKey()
{
if (Str::startsWith($key = $this->app['config']->get('app.key'), 'base64:')) {
$key = base64_decode(substr($key, 7));
}
SerializableClosure::setSecretKey($key);
} | [
"protected",
"function",
"registerOpisSecurityKey",
"(",
")",
"{",
"if",
"(",
"Str",
"::",
"startsWith",
"(",
"$",
"key",
"=",
"$",
"this",
"->",
"app",
"[",
"'config'",
"]",
"->",
"get",
"(",
"'app.key'",
")",
",",
"'base64:'",
")",
")",
"{",
"$",
"... | Configure Opis Closure signing for security.
@return void | [
"Configure",
"Opis",
"Closure",
"signing",
"for",
"security",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Queue/QueueServiceProvider.php#L216-L223 |
206,499 | laravel/framework | src/Illuminate/Mail/Message.php | Message.from | public function from($address, $name = null)
{
$this->swift->setFrom($address, $name);
return $this;
} | php | public function from($address, $name = null)
{
$this->swift->setFrom($address, $name);
return $this;
} | [
"public",
"function",
"from",
"(",
"$",
"address",
",",
"$",
"name",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"swift",
"->",
"setFrom",
"(",
"$",
"address",
",",
"$",
"name",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Add a "from" address to the message.
@param string|array $address
@param string|null $name
@return $this | [
"Add",
"a",
"from",
"address",
"to",
"the",
"message",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Mail/Message.php#L48-L53 |
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.