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,600 | symfony/symfony | src/Symfony/Component/PropertyAccess/PropertyAccessor.php | PropertyAccessor.createCache | public static function createCache($namespace, $defaultLifetime, $version, LoggerInterface $logger = null)
{
if (!class_exists('Symfony\Component\Cache\Adapter\ApcuAdapter')) {
throw new \LogicException(sprintf('The Symfony Cache component must be installed to use %s().', __METHOD__));
}... | php | public static function createCache($namespace, $defaultLifetime, $version, LoggerInterface $logger = null)
{
if (!class_exists('Symfony\Component\Cache\Adapter\ApcuAdapter')) {
throw new \LogicException(sprintf('The Symfony Cache component must be installed to use %s().', __METHOD__));
}... | [
"public",
"static",
"function",
"createCache",
"(",
"$",
"namespace",
",",
"$",
"defaultLifetime",
",",
"$",
"version",
",",
"LoggerInterface",
"$",
"logger",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"class_exists",
"(",
"'Symfony\\Component\\Cache\\Adapter\\ApcuAda... | Creates the APCu adapter if applicable.
@param string $namespace
@param int $defaultLifetime
@param string $version
@param LoggerInterface|null $logger
@return AdapterInterface
@throws RuntimeException When the Cache Component isn't available | [
"Creates",
"the",
"APCu",
"adapter",
"if",
"applicable",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/PropertyAccess/PropertyAccessor.php#L828-L846 |
206,601 | symfony/symfony | src/Symfony/Component/Console/Formatter/OutputFormatterStyleStack.php | OutputFormatterStyleStack.pop | public function pop(OutputFormatterStyleInterface $style = null)
{
if (empty($this->styles)) {
return $this->emptyStyle;
}
if (null === $style) {
return array_pop($this->styles);
}
foreach (array_reverse($this->styles, true) as $index => $stackedStyl... | php | public function pop(OutputFormatterStyleInterface $style = null)
{
if (empty($this->styles)) {
return $this->emptyStyle;
}
if (null === $style) {
return array_pop($this->styles);
}
foreach (array_reverse($this->styles, true) as $index => $stackedStyl... | [
"public",
"function",
"pop",
"(",
"OutputFormatterStyleInterface",
"$",
"style",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"styles",
")",
")",
"{",
"return",
"$",
"this",
"->",
"emptyStyle",
";",
"}",
"if",
"(",
"null",
"===",
... | Pops a style from the stack.
@return OutputFormatterStyleInterface
@throws InvalidArgumentException When style tags incorrectly nested | [
"Pops",
"a",
"style",
"from",
"the",
"stack",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Formatter/OutputFormatterStyleStack.php#L58-L77 |
206,602 | symfony/symfony | src/Symfony/Component/Console/Formatter/OutputFormatterStyleStack.php | OutputFormatterStyleStack.getCurrent | public function getCurrent()
{
if (empty($this->styles)) {
return $this->emptyStyle;
}
return $this->styles[\count($this->styles) - 1];
} | php | public function getCurrent()
{
if (empty($this->styles)) {
return $this->emptyStyle;
}
return $this->styles[\count($this->styles) - 1];
} | [
"public",
"function",
"getCurrent",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"styles",
")",
")",
"{",
"return",
"$",
"this",
"->",
"emptyStyle",
";",
"}",
"return",
"$",
"this",
"->",
"styles",
"[",
"\\",
"count",
"(",
"$",
"this"... | Computes current style with stacks top codes.
@return OutputFormatterStyle | [
"Computes",
"current",
"style",
"with",
"stacks",
"top",
"codes",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Formatter/OutputFormatterStyleStack.php#L84-L91 |
206,603 | symfony/symfony | src/Symfony/Bridge/Monolog/Logger.php | Logger.getDebugLogger | private function getDebugLogger()
{
foreach ($this->processors as $processor) {
if ($processor instanceof DebugLoggerInterface) {
return $processor;
}
}
foreach ($this->handlers as $handler) {
if ($handler instanceof DebugLoggerInterface) ... | php | private function getDebugLogger()
{
foreach ($this->processors as $processor) {
if ($processor instanceof DebugLoggerInterface) {
return $processor;
}
}
foreach ($this->handlers as $handler) {
if ($handler instanceof DebugLoggerInterface) ... | [
"private",
"function",
"getDebugLogger",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"processors",
"as",
"$",
"processor",
")",
"{",
"if",
"(",
"$",
"processor",
"instanceof",
"DebugLoggerInterface",
")",
"{",
"return",
"$",
"processor",
";",
"}",
"}... | Returns a DebugLoggerInterface instance if one is registered with this logger.
@return DebugLoggerInterface|null A DebugLoggerInterface instance or null if none is registered | [
"Returns",
"a",
"DebugLoggerInterface",
"instance",
"if",
"one",
"is",
"registered",
"with",
"this",
"logger",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bridge/Monolog/Logger.php#L103-L116 |
206,604 | symfony/symfony | src/Symfony/Component/Validator/Constraint.php | Constraint.getErrorName | public static function getErrorName($errorCode)
{
if (!isset(static::$errorNames[$errorCode])) {
throw new InvalidArgumentException(sprintf('The error code "%s" does not exist for constraint of type "%s".', $errorCode, \get_called_class()));
}
return static::$errorNames[$errorCo... | php | public static function getErrorName($errorCode)
{
if (!isset(static::$errorNames[$errorCode])) {
throw new InvalidArgumentException(sprintf('The error code "%s" does not exist for constraint of type "%s".', $errorCode, \get_called_class()));
}
return static::$errorNames[$errorCo... | [
"public",
"static",
"function",
"getErrorName",
"(",
"$",
"errorCode",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"static",
"::",
"$",
"errorNames",
"[",
"$",
"errorCode",
"]",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"sprintf",
"(",
... | Returns the name of the given error code.
@param string $errorCode The error code
@return string The name of the error code
@throws InvalidArgumentException If the error code does not exist | [
"Returns",
"the",
"name",
"of",
"the",
"given",
"error",
"code",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Validator/Constraint.php#L70-L77 |
206,605 | symfony/symfony | src/Symfony/Component/Validator/Constraint.php | Constraint.addImplicitGroupName | public function addImplicitGroupName($group)
{
if (\in_array(self::DEFAULT_GROUP, $this->groups) && !\in_array($group, $this->groups)) {
$this->groups[] = $group;
}
} | php | public function addImplicitGroupName($group)
{
if (\in_array(self::DEFAULT_GROUP, $this->groups) && !\in_array($group, $this->groups)) {
$this->groups[] = $group;
}
} | [
"public",
"function",
"addImplicitGroupName",
"(",
"$",
"group",
")",
"{",
"if",
"(",
"\\",
"in_array",
"(",
"self",
"::",
"DEFAULT_GROUP",
",",
"$",
"this",
"->",
"groups",
")",
"&&",
"!",
"\\",
"in_array",
"(",
"$",
"group",
",",
"$",
"this",
"->",
... | Adds the given group if this constraint is in the Default group.
@param string $group | [
"Adds",
"the",
"given",
"group",
"if",
"this",
"constraint",
"is",
"in",
"the",
"Default",
"group",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Validator/Constraint.php#L223-L228 |
206,606 | symfony/symfony | src/Symfony/Component/Security/Http/HttpUtils.php | HttpUtils.createRedirectResponse | public function createRedirectResponse(Request $request, $path, $status = 302)
{
if (null !== $this->secureDomainRegexp && 'https' === $this->urlMatcher->getContext()->getScheme() && preg_match('#^https?:[/\\\\]{2,}+[^/]++#i', $path, $host) && !preg_match(sprintf($this->secureDomainRegexp, preg_quote($reque... | php | public function createRedirectResponse(Request $request, $path, $status = 302)
{
if (null !== $this->secureDomainRegexp && 'https' === $this->urlMatcher->getContext()->getScheme() && preg_match('#^https?:[/\\\\]{2,}+[^/]++#i', $path, $host) && !preg_match(sprintf($this->secureDomainRegexp, preg_quote($reque... | [
"public",
"function",
"createRedirectResponse",
"(",
"Request",
"$",
"request",
",",
"$",
"path",
",",
"$",
"status",
"=",
"302",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"secureDomainRegexp",
"&&",
"'https'",
"===",
"$",
"this",
"->",
"url... | Creates a redirect Response.
@param Request $request A Request instance
@param string $path A path (an absolute path (/foo), an absolute URL (http://...), or a route name (foo))
@param int $status The status code
@return RedirectResponse A RedirectResponse instance | [
"Creates",
"a",
"redirect",
"Response",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Security/Http/HttpUtils.php#L63-L73 |
206,607 | symfony/symfony | src/Symfony/Component/Security/Http/HttpUtils.php | HttpUtils.createRequest | public function createRequest(Request $request, $path)
{
$newRequest = Request::create($this->generateUri($request, $path), 'get', [], $request->cookies->all(), [], $request->server->all());
static $setSession;
if (null === $setSession) {
$setSession = \Closure::bind(function (... | php | public function createRequest(Request $request, $path)
{
$newRequest = Request::create($this->generateUri($request, $path), 'get', [], $request->cookies->all(), [], $request->server->all());
static $setSession;
if (null === $setSession) {
$setSession = \Closure::bind(function (... | [
"public",
"function",
"createRequest",
"(",
"Request",
"$",
"request",
",",
"$",
"path",
")",
"{",
"$",
"newRequest",
"=",
"Request",
"::",
"create",
"(",
"$",
"this",
"->",
"generateUri",
"(",
"$",
"request",
",",
"$",
"path",
")",
",",
"'get'",
",",
... | Creates a Request.
@param Request $request The current Request instance
@param string $path A path (an absolute path (/foo), an absolute URL (http://...), or a route name (foo))
@return Request A Request instance | [
"Creates",
"a",
"Request",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Security/Http/HttpUtils.php#L83-L112 |
206,608 | symfony/symfony | src/Symfony/Component/Security/Http/HttpUtils.php | HttpUtils.checkRequestPath | public function checkRequestPath(Request $request, $path)
{
if ('/' !== $path[0]) {
try {
// matching a request is more powerful than matching a URL path + context, so try that first
if ($this->urlMatcher instanceof RequestMatcherInterface) {
$... | php | public function checkRequestPath(Request $request, $path)
{
if ('/' !== $path[0]) {
try {
// matching a request is more powerful than matching a URL path + context, so try that first
if ($this->urlMatcher instanceof RequestMatcherInterface) {
$... | [
"public",
"function",
"checkRequestPath",
"(",
"Request",
"$",
"request",
",",
"$",
"path",
")",
"{",
"if",
"(",
"'/'",
"!==",
"$",
"path",
"[",
"0",
"]",
")",
"{",
"try",
"{",
"// matching a request is more powerful than matching a URL path + context, so try that f... | Checks that a given path matches the Request.
@param Request $request A Request instance
@param string $path A path (an absolute path (/foo), an absolute URL (http://...), or a route name (foo))
@return bool true if the path is the same as the one from the Request, false otherwise | [
"Checks",
"that",
"a",
"given",
"path",
"matches",
"the",
"Request",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Security/Http/HttpUtils.php#L122-L142 |
206,609 | symfony/symfony | src/Symfony/Component/Security/Http/HttpUtils.php | HttpUtils.generateUri | public function generateUri($request, $path)
{
if (0 === strpos($path, 'http') || !$path) {
return $path;
}
if ('/' === $path[0]) {
return $request->getUriForPath($path);
}
if (null === $this->urlGenerator) {
throw new \LogicException('Yo... | php | public function generateUri($request, $path)
{
if (0 === strpos($path, 'http') || !$path) {
return $path;
}
if ('/' === $path[0]) {
return $request->getUriForPath($path);
}
if (null === $this->urlGenerator) {
throw new \LogicException('Yo... | [
"public",
"function",
"generateUri",
"(",
"$",
"request",
",",
"$",
"path",
")",
"{",
"if",
"(",
"0",
"===",
"strpos",
"(",
"$",
"path",
",",
"'http'",
")",
"||",
"!",
"$",
"path",
")",
"{",
"return",
"$",
"path",
";",
"}",
"if",
"(",
"'/'",
"=... | Generates a URI, based on the given path or absolute URL.
@param Request $request A Request instance
@param string $path A path (an absolute path (/foo), an absolute URL (http://...), or a route name (foo))
@return string An absolute URL
@throws \LogicException | [
"Generates",
"a",
"URI",
"based",
"on",
"the",
"given",
"path",
"or",
"absolute",
"URL",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Security/Http/HttpUtils.php#L154-L184 |
206,610 | symfony/symfony | src/Symfony/Component/HttpKernel/ControllerMetadata/ArgumentMetadata.php | ArgumentMetadata.getDefaultValue | public function getDefaultValue()
{
if (!$this->hasDefaultValue) {
throw new \LogicException(sprintf('Argument $%s does not have a default value. Use %s::hasDefaultValue() to avoid this exception.', $this->name, __CLASS__));
}
return $this->defaultValue;
} | php | public function getDefaultValue()
{
if (!$this->hasDefaultValue) {
throw new \LogicException(sprintf('Argument $%s does not have a default value. Use %s::hasDefaultValue() to avoid this exception.', $this->name, __CLASS__));
}
return $this->defaultValue;
} | [
"public",
"function",
"getDefaultValue",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasDefaultValue",
")",
"{",
"throw",
"new",
"\\",
"LogicException",
"(",
"sprintf",
"(",
"'Argument $%s does not have a default value. Use %s::hasDefaultValue() to avoid this excep... | Returns the default value of the argument.
@throws \LogicException if no default value is present; {@see self::hasDefaultValue()}
@return mixed | [
"Returns",
"the",
"default",
"value",
"of",
"the",
"argument",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/ControllerMetadata/ArgumentMetadata.php#L99-L106 |
206,611 | symfony/symfony | src/Symfony/Component/HttpKernel/HttpCache/Store.php | Store.cleanup | public function cleanup()
{
// unlock everything
foreach ($this->locks as $lock) {
flock($lock, LOCK_UN);
fclose($lock);
}
$this->locks = [];
} | php | public function cleanup()
{
// unlock everything
foreach ($this->locks as $lock) {
flock($lock, LOCK_UN);
fclose($lock);
}
$this->locks = [];
} | [
"public",
"function",
"cleanup",
"(",
")",
"{",
"// unlock everything",
"foreach",
"(",
"$",
"this",
"->",
"locks",
"as",
"$",
"lock",
")",
"{",
"flock",
"(",
"$",
"lock",
",",
"LOCK_UN",
")",
";",
"fclose",
"(",
"$",
"lock",
")",
";",
"}",
"$",
"t... | Cleanups storage. | [
"Cleanups",
"storage",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/HttpCache/Store.php#L47-L56 |
206,612 | symfony/symfony | src/Symfony/Component/HttpKernel/HttpCache/Store.php | Store.lock | public function lock(Request $request)
{
$key = $this->getCacheKey($request);
if (!isset($this->locks[$key])) {
$path = $this->getPath($key);
if (!file_exists(\dirname($path)) && false === @mkdir(\dirname($path), 0777, true) && !is_dir(\dirname($path))) {
ret... | php | public function lock(Request $request)
{
$key = $this->getCacheKey($request);
if (!isset($this->locks[$key])) {
$path = $this->getPath($key);
if (!file_exists(\dirname($path)) && false === @mkdir(\dirname($path), 0777, true) && !is_dir(\dirname($path))) {
ret... | [
"public",
"function",
"lock",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"getCacheKey",
"(",
"$",
"request",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"locks",
"[",
"$",
"key",
"]",
")",
")",
... | Tries to lock the cache for a given Request, without blocking.
@return bool|string true if the lock is acquired, the path to the current lock otherwise | [
"Tries",
"to",
"lock",
"the",
"cache",
"for",
"a",
"given",
"Request",
"without",
"blocking",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/HttpCache/Store.php#L63-L83 |
206,613 | symfony/symfony | src/Symfony/Component/HttpKernel/HttpCache/Store.php | Store.requestsMatch | private function requestsMatch($vary, $env1, $env2)
{
if (empty($vary)) {
return true;
}
foreach (preg_split('/[\s,]+/', $vary) as $header) {
$key = str_replace('_', '-', strtolower($header));
$v1 = isset($env1[$key]) ? $env1[$key] : null;
$v2... | php | private function requestsMatch($vary, $env1, $env2)
{
if (empty($vary)) {
return true;
}
foreach (preg_split('/[\s,]+/', $vary) as $header) {
$key = str_replace('_', '-', strtolower($header));
$v1 = isset($env1[$key]) ? $env1[$key] : null;
$v2... | [
"private",
"function",
"requestsMatch",
"(",
"$",
"vary",
",",
"$",
"env1",
",",
"$",
"env2",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"vary",
")",
")",
"{",
"return",
"true",
";",
"}",
"foreach",
"(",
"preg_split",
"(",
"'/[\\s,]+/'",
",",
"$",
"va... | Determines whether two Request HTTP header sets are non-varying based on
the vary response header value provided.
@param string $vary A Response vary header
@param array $env1 A Request HTTP header array
@param array $env2 A Request HTTP header array
@return bool true if the two environments match, false otherwise | [
"Determines",
"whether",
"two",
"Request",
"HTTP",
"header",
"sets",
"are",
"non",
"-",
"varying",
"based",
"on",
"the",
"vary",
"response",
"header",
"value",
"provided",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/HttpCache/Store.php#L264-L280 |
206,614 | symfony/symfony | src/Symfony/Component/HttpKernel/HttpCache/Store.php | Store.load | private function load($key)
{
$path = $this->getPath($key);
return file_exists($path) ? file_get_contents($path) : false;
} | php | private function load($key)
{
$path = $this->getPath($key);
return file_exists($path) ? file_get_contents($path) : false;
} | [
"private",
"function",
"load",
"(",
"$",
"key",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"getPath",
"(",
"$",
"key",
")",
";",
"return",
"file_exists",
"(",
"$",
"path",
")",
"?",
"file_get_contents",
"(",
"$",
"path",
")",
":",
"false",
";",... | Loads data for the given key.
@param string $key The store key
@return string The data associated with the key | [
"Loads",
"data",
"for",
"the",
"given",
"key",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/HttpCache/Store.php#L352-L357 |
206,615 | symfony/symfony | src/Symfony/Component/HttpKernel/HttpCache/Store.php | Store.save | private function save($key, $data)
{
$path = $this->getPath($key);
if (isset($this->locks[$key])) {
$fp = $this->locks[$key];
@ftruncate($fp, 0);
@fseek($fp, 0);
$len = @fwrite($fp, $data);
if (\strlen($data) !== $len) {
@f... | php | private function save($key, $data)
{
$path = $this->getPath($key);
if (isset($this->locks[$key])) {
$fp = $this->locks[$key];
@ftruncate($fp, 0);
@fseek($fp, 0);
$len = @fwrite($fp, $data);
if (\strlen($data) !== $len) {
@f... | [
"private",
"function",
"save",
"(",
"$",
"key",
",",
"$",
"data",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"getPath",
"(",
"$",
"key",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"locks",
"[",
"$",
"key",
"]",
")",
")",
"{",
... | Save data for the given key.
@param string $key The store key
@param string $data The data to store
@return bool | [
"Save",
"data",
"for",
"the",
"given",
"key",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/HttpCache/Store.php#L367-L409 |
206,616 | symfony/symfony | src/Symfony/Component/HttpKernel/HttpCache/Store.php | Store.getCacheKey | private function getCacheKey(Request $request)
{
if (isset($this->keyCache[$request])) {
return $this->keyCache[$request];
}
return $this->keyCache[$request] = $this->generateCacheKey($request);
} | php | private function getCacheKey(Request $request)
{
if (isset($this->keyCache[$request])) {
return $this->keyCache[$request];
}
return $this->keyCache[$request] = $this->generateCacheKey($request);
} | [
"private",
"function",
"getCacheKey",
"(",
"Request",
"$",
"request",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"keyCache",
"[",
"$",
"request",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"keyCache",
"[",
"$",
"request",
"]",
";",
... | Returns a cache key for the given Request.
@return string A key for the given Request | [
"Returns",
"a",
"cache",
"key",
"for",
"the",
"given",
"Request",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/HttpCache/Store.php#L438-L445 |
206,617 | symfony/symfony | src/Symfony/Component/HttpKernel/HttpCache/Store.php | Store.persistResponse | private function persistResponse(Response $response)
{
$headers = $response->headers->all();
$headers['X-Status'] = [$response->getStatusCode()];
return $headers;
} | php | private function persistResponse(Response $response)
{
$headers = $response->headers->all();
$headers['X-Status'] = [$response->getStatusCode()];
return $headers;
} | [
"private",
"function",
"persistResponse",
"(",
"Response",
"$",
"response",
")",
"{",
"$",
"headers",
"=",
"$",
"response",
"->",
"headers",
"->",
"all",
"(",
")",
";",
"$",
"headers",
"[",
"'X-Status'",
"]",
"=",
"[",
"$",
"response",
"->",
"getStatusCo... | Persists the Response HTTP headers.
@return array An array of HTTP headers | [
"Persists",
"the",
"Response",
"HTTP",
"headers",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/HttpCache/Store.php#L462-L468 |
206,618 | symfony/symfony | src/Symfony/Component/HttpKernel/HttpCache/Store.php | Store.restoreResponse | private function restoreResponse($headers, $body = null)
{
$status = $headers['X-Status'][0];
unset($headers['X-Status']);
if (null !== $body) {
$headers['X-Body-File'] = [$body];
}
return new Response($body, $status, $headers);
} | php | private function restoreResponse($headers, $body = null)
{
$status = $headers['X-Status'][0];
unset($headers['X-Status']);
if (null !== $body) {
$headers['X-Body-File'] = [$body];
}
return new Response($body, $status, $headers);
} | [
"private",
"function",
"restoreResponse",
"(",
"$",
"headers",
",",
"$",
"body",
"=",
"null",
")",
"{",
"$",
"status",
"=",
"$",
"headers",
"[",
"'X-Status'",
"]",
"[",
"0",
"]",
";",
"unset",
"(",
"$",
"headers",
"[",
"'X-Status'",
"]",
")",
";",
... | Restores a Response from the HTTP headers and body.
@param array $headers An array of HTTP headers for the Response
@param string $body The Response body
@return Response | [
"Restores",
"a",
"Response",
"from",
"the",
"HTTP",
"headers",
"and",
"body",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/HttpCache/Store.php#L478-L488 |
206,619 | symfony/symfony | src/Symfony/Component/Routing/Matcher/Dumper/StaticPrefixCollection.php | StaticPrefixCollection.addRoute | public function addRoute(string $prefix, $route)
{
list($prefix, $staticPrefix) = $this->getCommonPrefix($prefix, $prefix);
for ($i = \count($this->items) - 1; 0 <= $i; --$i) {
$item = $this->items[$i];
list($commonPrefix, $commonStaticPrefix) = $this->getCommonPrefix($pref... | php | public function addRoute(string $prefix, $route)
{
list($prefix, $staticPrefix) = $this->getCommonPrefix($prefix, $prefix);
for ($i = \count($this->items) - 1; 0 <= $i; --$i) {
$item = $this->items[$i];
list($commonPrefix, $commonStaticPrefix) = $this->getCommonPrefix($pref... | [
"public",
"function",
"addRoute",
"(",
"string",
"$",
"prefix",
",",
"$",
"route",
")",
"{",
"list",
"(",
"$",
"prefix",
",",
"$",
"staticPrefix",
")",
"=",
"$",
"this",
"->",
"getCommonPrefix",
"(",
"$",
"prefix",
",",
"$",
"prefix",
")",
";",
"for"... | Adds a route to a group.
@param array|self $route | [
"Adds",
"a",
"route",
"to",
"a",
"group",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Routing/Matcher/Dumper/StaticPrefixCollection.php#L66-L124 |
206,620 | symfony/symfony | src/Symfony/Component/Routing/Matcher/Dumper/StaticPrefixCollection.php | StaticPrefixCollection.populateCollection | public function populateCollection(RouteCollection $routes): RouteCollection
{
foreach ($this->items as $route) {
if ($route instanceof self) {
$route->populateCollection($routes);
} else {
$routes->add(...$route);
}
}
retu... | php | public function populateCollection(RouteCollection $routes): RouteCollection
{
foreach ($this->items as $route) {
if ($route instanceof self) {
$route->populateCollection($routes);
} else {
$routes->add(...$route);
}
}
retu... | [
"public",
"function",
"populateCollection",
"(",
"RouteCollection",
"$",
"routes",
")",
":",
"RouteCollection",
"{",
"foreach",
"(",
"$",
"this",
"->",
"items",
"as",
"$",
"route",
")",
"{",
"if",
"(",
"$",
"route",
"instanceof",
"self",
")",
"{",
"$",
"... | Linearizes back a set of nested routes into a collection. | [
"Linearizes",
"back",
"a",
"set",
"of",
"nested",
"routes",
"into",
"a",
"collection",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Routing/Matcher/Dumper/StaticPrefixCollection.php#L129-L140 |
206,621 | symfony/symfony | src/Symfony/Component/Mime/Encoder/QpEncoder.php | QpEncoder.encodeByteSequence | private function encodeByteSequence(array $bytes, int &$size): string
{
$ret = '';
$size = 0;
foreach ($bytes as $b) {
if (isset($this->safeMap[$b])) {
$ret .= $this->safeMap[$b];
++$size;
} else {
$ret .= self::$qpMap[$... | php | private function encodeByteSequence(array $bytes, int &$size): string
{
$ret = '';
$size = 0;
foreach ($bytes as $b) {
if (isset($this->safeMap[$b])) {
$ret .= $this->safeMap[$b];
++$size;
} else {
$ret .= self::$qpMap[$... | [
"private",
"function",
"encodeByteSequence",
"(",
"array",
"$",
"bytes",
",",
"int",
"&",
"$",
"size",
")",
":",
"string",
"{",
"$",
"ret",
"=",
"''",
";",
"$",
"size",
"=",
"0",
";",
"foreach",
"(",
"$",
"bytes",
"as",
"$",
"b",
")",
"{",
"if",
... | Encode the given byte array into a verbatim QP form. | [
"Encode",
"the",
"given",
"byte",
"array",
"into",
"a",
"verbatim",
"QP",
"form",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Mime/Encoder/QpEncoder.php#L166-L181 |
206,622 | symfony/symfony | src/Symfony/Component/PropertyInfo/PropertyInfoExtractor.php | PropertyInfoExtractor.extract | private function extract(iterable $extractors, string $method, array $arguments)
{
foreach ($extractors as $extractor) {
if (null !== $value = $extractor->{$method}(...$arguments)) {
return $value;
}
}
} | php | private function extract(iterable $extractors, string $method, array $arguments)
{
foreach ($extractors as $extractor) {
if (null !== $value = $extractor->{$method}(...$arguments)) {
return $value;
}
}
} | [
"private",
"function",
"extract",
"(",
"iterable",
"$",
"extractors",
",",
"string",
"$",
"method",
",",
"array",
"$",
"arguments",
")",
"{",
"foreach",
"(",
"$",
"extractors",
"as",
"$",
"extractor",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"value",
"... | Iterates over registered extractors and return the first value found.
@return mixed | [
"Iterates",
"over",
"registered",
"extractors",
"and",
"return",
"the",
"first",
"value",
"found",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/PropertyInfo/PropertyInfoExtractor.php#L106-L113 |
206,623 | symfony/symfony | src/Symfony/Component/Form/Extension/Csrf/Type/FormTypeCsrfExtension.php | FormTypeCsrfExtension.buildForm | public function buildForm(FormBuilderInterface $builder, array $options)
{
if (!$options['csrf_protection']) {
return;
}
$builder
->addEventSubscriber(new CsrfValidationListener(
$options['csrf_field_name'],
$options['csrf_token_manage... | php | public function buildForm(FormBuilderInterface $builder, array $options)
{
if (!$options['csrf_protection']) {
return;
}
$builder
->addEventSubscriber(new CsrfValidationListener(
$options['csrf_field_name'],
$options['csrf_token_manage... | [
"public",
"function",
"buildForm",
"(",
"FormBuilderInterface",
"$",
"builder",
",",
"array",
"$",
"options",
")",
"{",
"if",
"(",
"!",
"$",
"options",
"[",
"'csrf_protection'",
"]",
")",
"{",
"return",
";",
"}",
"$",
"builder",
"->",
"addEventSubscriber",
... | Adds a CSRF field to the form when the CSRF protection is enabled.
@param FormBuilderInterface $builder The form builder
@param array $options The options | [
"Adds",
"a",
"CSRF",
"field",
"to",
"the",
"form",
"when",
"the",
"CSRF",
"protection",
"is",
"enabled",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Extension/Csrf/Type/FormTypeCsrfExtension.php#L60-L77 |
206,624 | symfony/symfony | src/Symfony/Component/Form/Extension/Csrf/Type/FormTypeCsrfExtension.php | FormTypeCsrfExtension.finishView | public function finishView(FormView $view, FormInterface $form, array $options)
{
if ($options['csrf_protection'] && !$view->parent && $options['compound']) {
$factory = $form->getConfig()->getFormFactory();
$tokenId = $options['csrf_token_id'] ?: ($form->getName() ?: \get_class($for... | php | public function finishView(FormView $view, FormInterface $form, array $options)
{
if ($options['csrf_protection'] && !$view->parent && $options['compound']) {
$factory = $form->getConfig()->getFormFactory();
$tokenId = $options['csrf_token_id'] ?: ($form->getName() ?: \get_class($for... | [
"public",
"function",
"finishView",
"(",
"FormView",
"$",
"view",
",",
"FormInterface",
"$",
"form",
",",
"array",
"$",
"options",
")",
"{",
"if",
"(",
"$",
"options",
"[",
"'csrf_protection'",
"]",
"&&",
"!",
"$",
"view",
"->",
"parent",
"&&",
"$",
"o... | Adds a CSRF field to the root form view.
@param FormView $view The form view
@param FormInterface $form The form
@param array $options The options | [
"Adds",
"a",
"CSRF",
"field",
"to",
"the",
"root",
"form",
"view",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Extension/Csrf/Type/FormTypeCsrfExtension.php#L86-L100 |
206,625 | symfony/symfony | src/Symfony/Bridge/Monolog/Handler/ConsoleHandler.php | ConsoleHandler.onCommand | public function onCommand(ConsoleCommandEvent $event)
{
$output = $event->getOutput();
if ($output instanceof ConsoleOutputInterface) {
$output = $output->getErrorOutput();
}
$this->setOutput($output);
} | php | public function onCommand(ConsoleCommandEvent $event)
{
$output = $event->getOutput();
if ($output instanceof ConsoleOutputInterface) {
$output = $output->getErrorOutput();
}
$this->setOutput($output);
} | [
"public",
"function",
"onCommand",
"(",
"ConsoleCommandEvent",
"$",
"event",
")",
"{",
"$",
"output",
"=",
"$",
"event",
"->",
"getOutput",
"(",
")",
";",
"if",
"(",
"$",
"output",
"instanceof",
"ConsoleOutputInterface",
")",
"{",
"$",
"output",
"=",
"$",
... | Before a command is executed, the handler gets activated and the console output
is set in order to know where to write the logs. | [
"Before",
"a",
"command",
"is",
"executed",
"the",
"handler",
"gets",
"activated",
"and",
"the",
"console",
"output",
"is",
"set",
"in",
"order",
"to",
"know",
"where",
"to",
"write",
"the",
"logs",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bridge/Monolog/Handler/ConsoleHandler.php#L114-L122 |
206,626 | symfony/symfony | src/Symfony/Component/ExpressionLanguage/Compiler.php | Compiler.repr | public function repr($value)
{
if (\is_int($value) || \is_float($value)) {
if (false !== $locale = setlocale(LC_NUMERIC, 0)) {
setlocale(LC_NUMERIC, 'C');
}
$this->raw($value);
if (false !== $locale) {
setlocale(LC_NUMERIC, $l... | php | public function repr($value)
{
if (\is_int($value) || \is_float($value)) {
if (false !== $locale = setlocale(LC_NUMERIC, 0)) {
setlocale(LC_NUMERIC, 'C');
}
$this->raw($value);
if (false !== $locale) {
setlocale(LC_NUMERIC, $l... | [
"public",
"function",
"repr",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"\\",
"is_int",
"(",
"$",
"value",
")",
"||",
"\\",
"is_float",
"(",
"$",
"value",
")",
")",
"{",
"if",
"(",
"false",
"!==",
"$",
"locale",
"=",
"setlocale",
"(",
"LC_NUMERIC",
... | Returns a PHP representation of a given value.
@param mixed $value The value to convert
@return $this | [
"Returns",
"a",
"PHP",
"representation",
"of",
"a",
"given",
"value",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/ExpressionLanguage/Compiler.php#L113-L147 |
206,627 | symfony/symfony | src/Symfony/Component/EventDispatcher/EventDispatcher.php | EventDispatcher.optimizeListeners | private function optimizeListeners(string $eventName): array
{
krsort($this->listeners[$eventName]);
$this->optimized[$eventName] = [];
foreach ($this->listeners[$eventName] as &$listeners) {
foreach ($listeners as &$listener) {
$closure = &$this->optimized[$even... | php | private function optimizeListeners(string $eventName): array
{
krsort($this->listeners[$eventName]);
$this->optimized[$eventName] = [];
foreach ($this->listeners[$eventName] as &$listeners) {
foreach ($listeners as &$listener) {
$closure = &$this->optimized[$even... | [
"private",
"function",
"optimizeListeners",
"(",
"string",
"$",
"eventName",
")",
":",
"array",
"{",
"krsort",
"(",
"$",
"this",
"->",
"listeners",
"[",
"$",
"eventName",
"]",
")",
";",
"$",
"this",
"->",
"optimized",
"[",
"$",
"eventName",
"]",
"=",
"... | Optimizes the internal list of listeners for the given event by priority. | [
"Optimizes",
"the",
"internal",
"list",
"of",
"listeners",
"for",
"the",
"given",
"event",
"by",
"priority",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/EventDispatcher/EventDispatcher.php#L285-L307 |
206,628 | symfony/symfony | src/Symfony/Component/Config/Definition/Builder/EnumNodeDefinition.php | EnumNodeDefinition.instantiateNode | protected function instantiateNode()
{
if (null === $this->values) {
throw new \RuntimeException('You must call ->values() on enum nodes.');
}
return new EnumNode($this->name, $this->parent, $this->values, $this->pathSeparator);
} | php | protected function instantiateNode()
{
if (null === $this->values) {
throw new \RuntimeException('You must call ->values() on enum nodes.');
}
return new EnumNode($this->name, $this->parent, $this->values, $this->pathSeparator);
} | [
"protected",
"function",
"instantiateNode",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"values",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'You must call ->values() on enum nodes.'",
")",
";",
"}",
"return",
"new",
"EnumNode",
... | Instantiate a Node.
@return EnumNode The node
@throws \RuntimeException | [
"Instantiate",
"a",
"Node",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Config/Definition/Builder/EnumNodeDefinition.php#L48-L55 |
206,629 | symfony/symfony | src/Symfony/Component/Intl/Collator/Collator.php | Collator.asort | public function asort(&$array, $sortFlag = self::SORT_REGULAR)
{
$intlToPlainFlagMap = [
self::SORT_REGULAR => \SORT_REGULAR,
self::SORT_NUMERIC => \SORT_NUMERIC,
self::SORT_STRING => \SORT_STRING,
];
$plainSortFlag = isset($intlToPlainFlagMap[$sortFlag])... | php | public function asort(&$array, $sortFlag = self::SORT_REGULAR)
{
$intlToPlainFlagMap = [
self::SORT_REGULAR => \SORT_REGULAR,
self::SORT_NUMERIC => \SORT_NUMERIC,
self::SORT_STRING => \SORT_STRING,
];
$plainSortFlag = isset($intlToPlainFlagMap[$sortFlag])... | [
"public",
"function",
"asort",
"(",
"&",
"$",
"array",
",",
"$",
"sortFlag",
"=",
"self",
"::",
"SORT_REGULAR",
")",
"{",
"$",
"intlToPlainFlagMap",
"=",
"[",
"self",
"::",
"SORT_REGULAR",
"=>",
"\\",
"SORT_REGULAR",
",",
"self",
"::",
"SORT_NUMERIC",
"=>"... | Sort array maintaining index association.
@param array &$array Input array
@param int $sortFlag Flags for sorting, can be one of the following:
Collator::SORT_REGULAR - compare items normally (don't change types)
Collator::SORT_NUMERIC - compare items numerically
Collator::SORT_STRING - compare items as strings
@... | [
"Sort",
"array",
"maintaining",
"index",
"association",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Intl/Collator/Collator.php#L109-L120 |
206,630 | symfony/symfony | src/Symfony/Component/Intl/Data/Util/LocaleScanner.php | LocaleScanner.scanLocales | public function scanLocales($sourceDir)
{
$locales = glob($sourceDir.'/*.txt');
// Remove file extension and sort
array_walk($locales, function (&$locale) { $locale = basename($locale, '.txt'); });
// Remove non-locales
$locales = array_filter($locales, function ($locale) {... | php | public function scanLocales($sourceDir)
{
$locales = glob($sourceDir.'/*.txt');
// Remove file extension and sort
array_walk($locales, function (&$locale) { $locale = basename($locale, '.txt'); });
// Remove non-locales
$locales = array_filter($locales, function ($locale) {... | [
"public",
"function",
"scanLocales",
"(",
"$",
"sourceDir",
")",
"{",
"$",
"locales",
"=",
"glob",
"(",
"$",
"sourceDir",
".",
"'/*.txt'",
")",
";",
"// Remove file extension and sort",
"array_walk",
"(",
"$",
"locales",
",",
"function",
"(",
"&",
"$",
"loca... | Returns all locales found in the given directory.
@param string $sourceDir The directory with ICU files
@return array An array of locales. The result also contains locales that
are in fact just aliases for other locales. Use
{@link scanAliases()} to determine which of the locales
are aliases | [
"Returns",
"all",
"locales",
"found",
"in",
"the",
"given",
"directory",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Intl/Data/Util/LocaleScanner.php#L43-L58 |
206,631 | symfony/symfony | src/Symfony/Component/Intl/Data/Util/LocaleScanner.php | LocaleScanner.scanAliases | public function scanAliases($sourceDir)
{
$locales = $this->scanLocales($sourceDir);
$aliases = [];
// Delete locales that are no aliases
foreach ($locales as $locale) {
$content = file_get_contents($sourceDir.'/'.$locale.'.txt');
// Aliases contain the text... | php | public function scanAliases($sourceDir)
{
$locales = $this->scanLocales($sourceDir);
$aliases = [];
// Delete locales that are no aliases
foreach ($locales as $locale) {
$content = file_get_contents($sourceDir.'/'.$locale.'.txt');
// Aliases contain the text... | [
"public",
"function",
"scanAliases",
"(",
"$",
"sourceDir",
")",
"{",
"$",
"locales",
"=",
"$",
"this",
"->",
"scanLocales",
"(",
"$",
"sourceDir",
")",
";",
"$",
"aliases",
"=",
"[",
"]",
";",
"// Delete locales that are no aliases",
"foreach",
"(",
"$",
... | Returns all locale aliases found in the given directory.
@param string $sourceDir The directory with ICU files
@return array An array with the locale aliases as keys and the aliased
locales as values | [
"Returns",
"all",
"locale",
"aliases",
"found",
"in",
"the",
"given",
"directory",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Intl/Data/Util/LocaleScanner.php#L68-L84 |
206,632 | symfony/symfony | src/Symfony/Component/Intl/Data/Util/LocaleScanner.php | LocaleScanner.scanParents | public function scanParents(string $sourceDir): array
{
$locales = $this->scanLocales($sourceDir);
$fallbacks = [];
foreach ($locales as $locale) {
$content = \file_get_contents($sourceDir.'/'.$locale.'.txt');
// Aliases contain the text "%%PARENT" followed by the a... | php | public function scanParents(string $sourceDir): array
{
$locales = $this->scanLocales($sourceDir);
$fallbacks = [];
foreach ($locales as $locale) {
$content = \file_get_contents($sourceDir.'/'.$locale.'.txt');
// Aliases contain the text "%%PARENT" followed by the a... | [
"public",
"function",
"scanParents",
"(",
"string",
"$",
"sourceDir",
")",
":",
"array",
"{",
"$",
"locales",
"=",
"$",
"this",
"->",
"scanLocales",
"(",
"$",
"sourceDir",
")",
";",
"$",
"fallbacks",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"locales",
... | Returns all locale parents found in the given directory. | [
"Returns",
"all",
"locale",
"parents",
"found",
"in",
"the",
"given",
"directory",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Intl/Data/Util/LocaleScanner.php#L89-L104 |
206,633 | symfony/symfony | src/Symfony/Component/DependencyInjection/Loader/Configurator/ParametersConfigurator.php | ParametersConfigurator.set | final public function set(string $name, $value)
{
$this->container->setParameter($name, static::processValue($value, true));
return $this;
} | php | final public function set(string $name, $value)
{
$this->container->setParameter($name, static::processValue($value, true));
return $this;
} | [
"final",
"public",
"function",
"set",
"(",
"string",
"$",
"name",
",",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"container",
"->",
"setParameter",
"(",
"$",
"name",
",",
"static",
"::",
"processValue",
"(",
"$",
"value",
",",
"true",
")",
")",
";",... | Creates a parameter.
@return $this | [
"Creates",
"a",
"parameter",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DependencyInjection/Loader/Configurator/ParametersConfigurator.php#L35-L40 |
206,634 | symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php | ContainerDebugCommand.validateInput | protected function validateInput(InputInterface $input)
{
$options = ['tags', 'tag', 'parameters', 'parameter'];
$optionsCount = 0;
foreach ($options as $option) {
if ($input->getOption($option)) {
++$optionsCount;
}
}
$name = $input-... | php | protected function validateInput(InputInterface $input)
{
$options = ['tags', 'tag', 'parameters', 'parameter'];
$optionsCount = 0;
foreach ($options as $option) {
if ($input->getOption($option)) {
++$optionsCount;
}
}
$name = $input-... | [
"protected",
"function",
"validateInput",
"(",
"InputInterface",
"$",
"input",
")",
"{",
"$",
"options",
"=",
"[",
"'tags'",
",",
"'tag'",
",",
"'parameters'",
",",
"'parameter'",
"]",
";",
"$",
"optionsCount",
"=",
"0",
";",
"foreach",
"(",
"$",
"options"... | Validates input arguments and options.
@throws \InvalidArgumentException | [
"Validates",
"input",
"arguments",
"and",
"options",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php#L189-L206 |
206,635 | symfony/symfony | src/Symfony/Component/Console/Helper/FormatterHelper.php | FormatterHelper.truncate | public function truncate($message, $length, $suffix = '...')
{
$computedLength = $length - $this->strlen($suffix);
if ($computedLength > $this->strlen($message)) {
return $message;
}
if (false === $encoding = mb_detect_encoding($message, null, true)) {
retur... | php | public function truncate($message, $length, $suffix = '...')
{
$computedLength = $length - $this->strlen($suffix);
if ($computedLength > $this->strlen($message)) {
return $message;
}
if (false === $encoding = mb_detect_encoding($message, null, true)) {
retur... | [
"public",
"function",
"truncate",
"(",
"$",
"message",
",",
"$",
"length",
",",
"$",
"suffix",
"=",
"'...'",
")",
"{",
"$",
"computedLength",
"=",
"$",
"length",
"-",
"$",
"this",
"->",
"strlen",
"(",
"$",
"suffix",
")",
";",
"if",
"(",
"$",
"compu... | Truncates a message to the given length.
@param string $message
@param int $length
@param string $suffix
@return string | [
"Truncates",
"a",
"message",
"to",
"the",
"given",
"length",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Helper/FormatterHelper.php#L84-L97 |
206,636 | symfony/symfony | src/Symfony/Component/Routing/Loader/Configurator/CollectionConfigurator.php | CollectionConfigurator.collection | final public function collection($name = '')
{
return new self($this->collection, $this->name.$name, $this, $this->prefixes);
} | php | final public function collection($name = '')
{
return new self($this->collection, $this->name.$name, $this, $this->prefixes);
} | [
"final",
"public",
"function",
"collection",
"(",
"$",
"name",
"=",
"''",
")",
"{",
"return",
"new",
"self",
"(",
"$",
"this",
"->",
"collection",
",",
"$",
"this",
"->",
"name",
".",
"$",
"name",
",",
"$",
"this",
",",
"$",
"this",
"->",
"prefixes... | Creates a sub-collection.
@return self | [
"Creates",
"a",
"sub",
"-",
"collection",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Routing/Loader/Configurator/CollectionConfigurator.php#L53-L56 |
206,637 | symfony/symfony | src/Symfony/Component/HttpKernel/Bundle/Bundle.php | Bundle.getContainerExtension | public function getContainerExtension()
{
if (null === $this->extension) {
$extension = $this->createContainerExtension();
if (null !== $extension) {
if (!$extension instanceof ExtensionInterface) {
throw new \LogicException(sprintf('Extension %s ... | php | public function getContainerExtension()
{
if (null === $this->extension) {
$extension = $this->createContainerExtension();
if (null !== $extension) {
if (!$extension instanceof ExtensionInterface) {
throw new \LogicException(sprintf('Extension %s ... | [
"public",
"function",
"getContainerExtension",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"extension",
")",
"{",
"$",
"extension",
"=",
"$",
"this",
"->",
"createContainerExtension",
"(",
")",
";",
"if",
"(",
"null",
"!==",
"$",
"extensi... | Returns the bundle's container extension.
@return ExtensionInterface|null The container extension
@throws \LogicException | [
"Returns",
"the",
"bundle",
"s",
"container",
"extension",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/Bundle/Bundle.php#L66-L93 |
206,638 | symfony/symfony | src/Symfony/Component/Serializer/Serializer.php | Serializer.getNormalizer | private function getNormalizer($data, ?string $format, array $context)
{
if ($this->cachedNormalizers !== $this->normalizers) {
$this->cachedNormalizers = $this->normalizers;
$this->denormalizerCache = $this->normalizerCache = [];
}
$type = \is_object($data) ? \get_cl... | php | private function getNormalizer($data, ?string $format, array $context)
{
if ($this->cachedNormalizers !== $this->normalizers) {
$this->cachedNormalizers = $this->normalizers;
$this->denormalizerCache = $this->normalizerCache = [];
}
$type = \is_object($data) ? \get_cl... | [
"private",
"function",
"getNormalizer",
"(",
"$",
"data",
",",
"?",
"string",
"$",
"format",
",",
"array",
"$",
"context",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"cachedNormalizers",
"!==",
"$",
"this",
"->",
"normalizers",
")",
"{",
"$",
"this",
"->"... | Returns a matching normalizer.
@param mixed $data Data to get the serializer for
@param string $format Format name, present to give the option to normalizers to act differently based on formats
@param array $context Options available to the normalizer
@return NormalizerInterface|null | [
"Returns",
"a",
"matching",
"normalizer",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Serializer/Serializer.php#L222-L253 |
206,639 | symfony/symfony | src/Symfony/Component/Serializer/Serializer.php | Serializer.getDenormalizer | private function getDenormalizer($data, string $class, ?string $format, array $context)
{
if ($this->cachedNormalizers !== $this->normalizers) {
$this->cachedNormalizers = $this->normalizers;
$this->denormalizerCache = $this->normalizerCache = [];
}
if (!isset($this->... | php | private function getDenormalizer($data, string $class, ?string $format, array $context)
{
if ($this->cachedNormalizers !== $this->normalizers) {
$this->cachedNormalizers = $this->normalizers;
$this->denormalizerCache = $this->normalizerCache = [];
}
if (!isset($this->... | [
"private",
"function",
"getDenormalizer",
"(",
"$",
"data",
",",
"string",
"$",
"class",
",",
"?",
"string",
"$",
"format",
",",
"array",
"$",
"context",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"cachedNormalizers",
"!==",
"$",
"this",
"->",
"normalizers"... | Returns a matching denormalizer.
@param mixed $data Data to restore
@param string $class The expected class to instantiate
@param string $format Format name, present to give the option to normalizers to act differently based on formats
@param array $context Options available to the denormalizer
@return Denorm... | [
"Returns",
"a",
"matching",
"denormalizer",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Serializer/Serializer.php#L265-L294 |
206,640 | symfony/symfony | src/Symfony/Component/Messenger/Envelope.php | Envelope.wrap | public static function wrap($message, array $stamps = []): self
{
$envelope = $message instanceof self ? $message : new self($message);
return $envelope->with(...$stamps);
} | php | public static function wrap($message, array $stamps = []): self
{
$envelope = $message instanceof self ? $message : new self($message);
return $envelope->with(...$stamps);
} | [
"public",
"static",
"function",
"wrap",
"(",
"$",
"message",
",",
"array",
"$",
"stamps",
"=",
"[",
"]",
")",
":",
"self",
"{",
"$",
"envelope",
"=",
"$",
"message",
"instanceof",
"self",
"?",
"$",
"message",
":",
"new",
"self",
"(",
"$",
"message",
... | Makes sure the message is in an Envelope and adds the given stamps.
@param object|Envelope $message
@param StampInterface[] $stamps | [
"Makes",
"sure",
"the",
"message",
"is",
"in",
"an",
"Envelope",
"and",
"adds",
"the",
"given",
"stamps",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Messenger/Envelope.php#L50-L55 |
206,641 | symfony/symfony | src/Symfony/Component/Serializer/Normalizer/DateTimeNormalizer.php | DateTimeNormalizer.formatDateTimeErrors | private function formatDateTimeErrors(array $errors)
{
$formattedErrors = [];
foreach ($errors as $pos => $message) {
$formattedErrors[] = sprintf('at position %d: %s', $pos, $message);
}
return $formattedErrors;
} | php | private function formatDateTimeErrors(array $errors)
{
$formattedErrors = [];
foreach ($errors as $pos => $message) {
$formattedErrors[] = sprintf('at position %d: %s', $pos, $message);
}
return $formattedErrors;
} | [
"private",
"function",
"formatDateTimeErrors",
"(",
"array",
"$",
"errors",
")",
"{",
"$",
"formattedErrors",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"errors",
"as",
"$",
"pos",
"=>",
"$",
"message",
")",
"{",
"$",
"formattedErrors",
"[",
"]",
"=",
"s... | Formats datetime errors.
@return string[] | [
"Formats",
"datetime",
"errors",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Serializer/Normalizer/DateTimeNormalizer.php#L146-L155 |
206,642 | symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Templating/DelegatingEngine.php | DelegatingEngine.resolveEngines | private function resolveEngines()
{
foreach ($this->engines as $i => $engine) {
if (\is_string($engine)) {
$this->engines[$i] = $this->container->get($engine);
}
}
} | php | private function resolveEngines()
{
foreach ($this->engines as $i => $engine) {
if (\is_string($engine)) {
$this->engines[$i] = $this->container->get($engine);
}
}
} | [
"private",
"function",
"resolveEngines",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"engines",
"as",
"$",
"i",
"=>",
"$",
"engine",
")",
"{",
"if",
"(",
"\\",
"is_string",
"(",
"$",
"engine",
")",
")",
"{",
"$",
"this",
"->",
"engines",
"[",... | Resolved engine ids to their real engine instances from the container. | [
"Resolved",
"engine",
"ids",
"to",
"their",
"real",
"engine",
"instances",
"from",
"the",
"container",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/FrameworkBundle/Templating/DelegatingEngine.php#L70-L77 |
206,643 | symfony/symfony | src/Symfony/Component/DependencyInjection/Compiler/Compiler.php | Compiler.addPass | public function addPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION, int $priority = 0)
{
$this->passConfig->addPass($pass, $type, $priority);
} | php | public function addPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION, int $priority = 0)
{
$this->passConfig->addPass($pass, $type, $priority);
} | [
"public",
"function",
"addPass",
"(",
"CompilerPassInterface",
"$",
"pass",
",",
"$",
"type",
"=",
"PassConfig",
"::",
"TYPE_BEFORE_OPTIMIZATION",
",",
"int",
"$",
"priority",
"=",
"0",
")",
"{",
"$",
"this",
"->",
"passConfig",
"->",
"addPass",
"(",
"$",
... | Adds a pass to the PassConfig.
@param CompilerPassInterface $pass A compiler pass
@param string $type The type of the pass
@param int $priority Used to sort the passes | [
"Adds",
"a",
"pass",
"to",
"the",
"PassConfig",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DependencyInjection/Compiler/Compiler.php#L61-L64 |
206,644 | symfony/symfony | src/Symfony/Component/DependencyInjection/Compiler/Compiler.php | Compiler.compile | public function compile(ContainerBuilder $container)
{
try {
foreach ($this->passConfig->getPasses() as $pass) {
$pass->process($container);
}
} catch (\Exception $e) {
$usedEnvs = [];
$prev = $e;
do {
$msg ... | php | public function compile(ContainerBuilder $container)
{
try {
foreach ($this->passConfig->getPasses() as $pass) {
$pass->process($container);
}
} catch (\Exception $e) {
$usedEnvs = [];
$prev = $e;
do {
$msg ... | [
"public",
"function",
"compile",
"(",
"ContainerBuilder",
"$",
"container",
")",
"{",
"try",
"{",
"foreach",
"(",
"$",
"this",
"->",
"passConfig",
"->",
"getPasses",
"(",
")",
"as",
"$",
"pass",
")",
"{",
"$",
"pass",
"->",
"process",
"(",
"$",
"contai... | Run the Compiler and process all Passes. | [
"Run",
"the",
"Compiler",
"and",
"process",
"all",
"Passes",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DependencyInjection/Compiler/Compiler.php#L91-L119 |
206,645 | symfony/symfony | src/Symfony/Component/Translation/MessageCatalogue.php | MessageCatalogue.addMetadata | private function addMetadata(array $values)
{
foreach ($values as $domain => $keys) {
foreach ($keys as $key => $value) {
$this->setMetadata($key, $value, $domain);
}
}
} | php | private function addMetadata(array $values)
{
foreach ($values as $domain => $keys) {
foreach ($keys as $key => $value) {
$this->setMetadata($key, $value, $domain);
}
}
} | [
"private",
"function",
"addMetadata",
"(",
"array",
"$",
"values",
")",
"{",
"foreach",
"(",
"$",
"values",
"as",
"$",
"domain",
"=>",
"$",
"keys",
")",
"{",
"foreach",
"(",
"$",
"keys",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"this",
... | Adds current values with the new values.
@param array $values Values to add | [
"Adds",
"current",
"values",
"with",
"the",
"new",
"values",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Translation/MessageCatalogue.php#L293-L300 |
206,646 | symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Controller/RedirectController.php | RedirectController.redirectAction | public function redirectAction(Request $request, string $route, bool $permanent = false, $ignoreAttributes = false, bool $keepRequestMethod = false, bool $keepQueryParams = false): Response
{
if ('' == $route) {
throw new HttpException($permanent ? 410 : 404);
}
$attributes = []... | php | public function redirectAction(Request $request, string $route, bool $permanent = false, $ignoreAttributes = false, bool $keepRequestMethod = false, bool $keepQueryParams = false): Response
{
if ('' == $route) {
throw new HttpException($permanent ? 410 : 404);
}
$attributes = []... | [
"public",
"function",
"redirectAction",
"(",
"Request",
"$",
"request",
",",
"string",
"$",
"route",
",",
"bool",
"$",
"permanent",
"=",
"false",
",",
"$",
"ignoreAttributes",
"=",
"false",
",",
"bool",
"$",
"keepRequestMethod",
"=",
"false",
",",
"bool",
... | Redirects to another route with the given name.
The response status code is 302 if the permanent parameter is false (default),
and 301 if the redirection is permanent.
In case the route name is empty, the status code will be 404 when permanent is false
and 410 otherwise.
@param Request $request The requ... | [
"Redirects",
"to",
"another",
"route",
"with",
"the",
"given",
"name",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/FrameworkBundle/Controller/RedirectController.php#L57-L80 |
206,647 | symfony/symfony | src/Symfony/Component/Templating/DelegatingEngine.php | DelegatingEngine.getEngine | public function getEngine($name)
{
foreach ($this->engines as $engine) {
if ($engine->supports($name)) {
return $engine;
}
}
throw new \RuntimeException(sprintf('No engine is able to work with the template "%s".', $name));
} | php | public function getEngine($name)
{
foreach ($this->engines as $engine) {
if ($engine->supports($name)) {
return $engine;
}
}
throw new \RuntimeException(sprintf('No engine is able to work with the template "%s".', $name));
} | [
"public",
"function",
"getEngine",
"(",
"$",
"name",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"engines",
"as",
"$",
"engine",
")",
"{",
"if",
"(",
"$",
"engine",
"->",
"supports",
"(",
"$",
"name",
")",
")",
"{",
"return",
"$",
"engine",
";",
... | Get an engine able to render the given template.
@param string|TemplateReferenceInterface $name A template name or a TemplateReferenceInterface instance
@return EngineInterface The engine
@throws \RuntimeException if no engine able to work with the template is found | [
"Get",
"an",
"engine",
"able",
"to",
"render",
"the",
"given",
"template",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Templating/DelegatingEngine.php#L93-L102 |
206,648 | symfony/symfony | src/Symfony/Component/BrowserKit/Response.php | Response.buildHeader | protected function buildHeader($name, $value)
{
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.3.', __METHOD__), E_USER_DEPRECATED);
return sprintf("%s: %s\n", $name, $value);
} | php | protected function buildHeader($name, $value)
{
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.3.', __METHOD__), E_USER_DEPRECATED);
return sprintf("%s: %s\n", $name, $value);
} | [
"protected",
"function",
"buildHeader",
"(",
"$",
"name",
",",
"$",
"value",
")",
"{",
"@",
"trigger_error",
"(",
"sprintf",
"(",
"'The \"%s()\" method is deprecated since Symfony 4.3.'",
",",
"__METHOD__",
")",
",",
"E_USER_DEPRECATED",
")",
";",
"return",
"sprintf... | Returns the build header line.
@param string $name The header name
@param string $value The header value
@return string The built header line
@deprecated since Symfony 4.3 | [
"Returns",
"the",
"build",
"header",
"line",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/BrowserKit/Response.php#L74-L79 |
206,649 | symfony/symfony | src/Symfony/Component/Config/Definition/Exception/InvalidConfigurationException.php | InvalidConfigurationException.addHint | public function addHint($hint)
{
if (!$this->containsHints) {
$this->message .= "\nHint: ".$hint;
$this->containsHints = true;
} else {
$this->message .= ', '.$hint;
}
} | php | public function addHint($hint)
{
if (!$this->containsHints) {
$this->message .= "\nHint: ".$hint;
$this->containsHints = true;
} else {
$this->message .= ', '.$hint;
}
} | [
"public",
"function",
"addHint",
"(",
"$",
"hint",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"containsHints",
")",
"{",
"$",
"this",
"->",
"message",
".=",
"\"\\nHint: \"",
".",
"$",
"hint",
";",
"$",
"this",
"->",
"containsHints",
"=",
"true",
";... | Adds extra information that is suffixed to the original exception message.
@param string $hint | [
"Adds",
"extra",
"information",
"that",
"is",
"suffixed",
"to",
"the",
"original",
"exception",
"message",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Config/Definition/Exception/InvalidConfigurationException.php#L40-L48 |
206,650 | symfony/symfony | src/Symfony/Component/Config/Definition/ArrayNode.php | ArrayNode.preNormalize | protected function preNormalize($value)
{
if (!$this->normalizeKeys || !\is_array($value)) {
return $value;
}
$normalized = [];
foreach ($value as $k => $v) {
if (false !== strpos($k, '-') && false === strpos($k, '_') && !\array_key_exists($normalizedKey = s... | php | protected function preNormalize($value)
{
if (!$this->normalizeKeys || !\is_array($value)) {
return $value;
}
$normalized = [];
foreach ($value as $k => $v) {
if (false !== strpos($k, '-') && false === strpos($k, '_') && !\array_key_exists($normalizedKey = s... | [
"protected",
"function",
"preNormalize",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"normalizeKeys",
"||",
"!",
"\\",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"return",
"$",
"value",
";",
"}",
"$",
"normalized",
"=",
"[",
... | Normalizes keys between the different configuration formats.
Namely, you mostly have foo_bar in YAML while you have foo-bar in XML.
After running this method, all keys are normalized to foo_bar.
If you have a mixed key like foo-bar_moo, it will not be altered.
The key will also not be altered if the target key alread... | [
"Normalizes",
"keys",
"between",
"the",
"different",
"configuration",
"formats",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Config/Definition/ArrayNode.php#L53-L70 |
206,651 | symfony/symfony | src/Symfony/Component/Config/Definition/ArrayNode.php | ArrayNode.setIgnoreExtraKeys | public function setIgnoreExtraKeys($boolean, $remove = true)
{
$this->ignoreExtraKeys = (bool) $boolean;
$this->removeExtraKeys = $this->ignoreExtraKeys && $remove;
} | php | public function setIgnoreExtraKeys($boolean, $remove = true)
{
$this->ignoreExtraKeys = (bool) $boolean;
$this->removeExtraKeys = $this->ignoreExtraKeys && $remove;
} | [
"public",
"function",
"setIgnoreExtraKeys",
"(",
"$",
"boolean",
",",
"$",
"remove",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"ignoreExtraKeys",
"=",
"(",
"bool",
")",
"$",
"boolean",
";",
"$",
"this",
"->",
"removeExtraKeys",
"=",
"$",
"this",
"->",
... | Whether extra keys should just be ignore without an exception.
@param bool $boolean To allow extra keys
@param bool $remove To remove extra keys | [
"Whether",
"extra",
"keys",
"should",
"just",
"be",
"ignore",
"without",
"an",
"exception",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Config/Definition/ArrayNode.php#L149-L153 |
206,652 | symfony/symfony | src/Symfony/Component/Config/Definition/ArrayNode.php | ArrayNode.addChild | public function addChild(NodeInterface $node)
{
$name = $node->getName();
if (!\strlen($name)) {
throw new \InvalidArgumentException('Child nodes must be named.');
}
if (isset($this->children[$name])) {
throw new \InvalidArgumentException(sprintf('A child node... | php | public function addChild(NodeInterface $node)
{
$name = $node->getName();
if (!\strlen($name)) {
throw new \InvalidArgumentException('Child nodes must be named.');
}
if (isset($this->children[$name])) {
throw new \InvalidArgumentException(sprintf('A child node... | [
"public",
"function",
"addChild",
"(",
"NodeInterface",
"$",
"node",
")",
"{",
"$",
"name",
"=",
"$",
"node",
"->",
"getName",
"(",
")",
";",
"if",
"(",
"!",
"\\",
"strlen",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentExcep... | Adds a child node.
@throws \InvalidArgumentException when the child node has no name
@throws \InvalidArgumentException when the child node's name is not unique | [
"Adds",
"a",
"child",
"node",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Config/Definition/ArrayNode.php#L196-L207 |
206,653 | symfony/symfony | src/Symfony/Component/Config/Definition/ArrayNode.php | ArrayNode.remapXml | protected function remapXml($value)
{
foreach ($this->xmlRemappings as list($singular, $plural)) {
if (!isset($value[$singular])) {
continue;
}
$value[$plural] = Processor::normalizeConfig($value, $singular, $plural);
unset($value[$singular]);... | php | protected function remapXml($value)
{
foreach ($this->xmlRemappings as list($singular, $plural)) {
if (!isset($value[$singular])) {
continue;
}
$value[$plural] = Processor::normalizeConfig($value, $singular, $plural);
unset($value[$singular]);... | [
"protected",
"function",
"remapXml",
"(",
"$",
"value",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"xmlRemappings",
"as",
"list",
"(",
"$",
"singular",
",",
"$",
"plural",
")",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"value",
"[",
"$",
"sing... | Remaps multiple singular values to a single plural value.
@param array $value The source values
@return array The remapped values | [
"Remaps",
"multiple",
"singular",
"values",
"to",
"a",
"single",
"plural",
"value",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Config/Definition/ArrayNode.php#L347-L359 |
206,654 | symfony/symfony | src/Symfony/Component/Form/ChoiceList/ArrayChoiceList.php | ArrayChoiceList.castableToString | private function castableToString(array $choices, array &$cache = [])
{
foreach ($choices as $choice) {
if (\is_array($choice)) {
if (!$this->castableToString($choice, $cache)) {
return false;
}
continue;
} elseif (... | php | private function castableToString(array $choices, array &$cache = [])
{
foreach ($choices as $choice) {
if (\is_array($choice)) {
if (!$this->castableToString($choice, $cache)) {
return false;
}
continue;
} elseif (... | [
"private",
"function",
"castableToString",
"(",
"array",
"$",
"choices",
",",
"array",
"&",
"$",
"cache",
"=",
"[",
"]",
")",
"{",
"foreach",
"(",
"$",
"choices",
"as",
"$",
"choice",
")",
"{",
"if",
"(",
"\\",
"is_array",
"(",
"$",
"choice",
")",
... | Checks whether the given choices can be cast to strings without
generating duplicates.
This method is responsible for preventing conflict between scalar values
and the empty value.
@param array $choices The choices
@param array|null $cache The cache for previously checked entries. Internal
@return bool returns... | [
"Checks",
"whether",
"the",
"given",
"choices",
"can",
"be",
"cast",
"to",
"strings",
"without",
"generating",
"duplicates",
".",
"This",
"method",
"is",
"responsible",
"for",
"preventing",
"conflict",
"between",
"scalar",
"values",
"and",
"the",
"empty",
"value... | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/ChoiceList/ArrayChoiceList.php#L219-L243 |
206,655 | symfony/symfony | src/Symfony/Component/Routing/Route.php | Route.setPath | public function setPath($pattern)
{
if (false !== strpbrk($pattern, '?<')) {
$pattern = preg_replace_callback('#\{(\w++)(<.*?>)?(\?[^\}]*+)?\}#', function ($m) {
if (isset($m[3][0])) {
$this->setDefault($m[1], '?' !== $m[3] ? substr($m[3], 1) : null);
... | php | public function setPath($pattern)
{
if (false !== strpbrk($pattern, '?<')) {
$pattern = preg_replace_callback('#\{(\w++)(<.*?>)?(\?[^\}]*+)?\}#', function ($m) {
if (isset($m[3][0])) {
$this->setDefault($m[1], '?' !== $m[3] ? substr($m[3], 1) : null);
... | [
"public",
"function",
"setPath",
"(",
"$",
"pattern",
")",
"{",
"if",
"(",
"false",
"!==",
"strpbrk",
"(",
"$",
"pattern",
",",
"'?<'",
")",
")",
"{",
"$",
"pattern",
"=",
"preg_replace_callback",
"(",
"'#\\{(\\w++)(<.*?>)?(\\?[^\\}]*+)?\\}#'",
",",
"function"... | Sets the pattern for the path.
This method implements a fluent interface.
@param string $pattern The path pattern
@return $this | [
"Sets",
"the",
"pattern",
"for",
"the",
"path",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Routing/Route.php#L133-L154 |
206,656 | symfony/symfony | src/Symfony/Component/Routing/Route.php | Route.setHost | public function setHost($pattern)
{
$this->host = (string) $pattern;
$this->compiled = null;
return $this;
} | php | public function setHost($pattern)
{
$this->host = (string) $pattern;
$this->compiled = null;
return $this;
} | [
"public",
"function",
"setHost",
"(",
"$",
"pattern",
")",
"{",
"$",
"this",
"->",
"host",
"=",
"(",
"string",
")",
"$",
"pattern",
";",
"$",
"this",
"->",
"compiled",
"=",
"null",
";",
"return",
"$",
"this",
";",
"}"
] | Sets the pattern for the host.
This method implements a fluent interface.
@param string $pattern The host pattern
@return $this | [
"Sets",
"the",
"pattern",
"for",
"the",
"host",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Routing/Route.php#L175-L181 |
206,657 | symfony/symfony | src/Symfony/Component/Routing/Route.php | Route.setOption | public function setOption($name, $value)
{
$this->options[$name] = $value;
$this->compiled = null;
return $this;
} | php | public function setOption($name, $value)
{
$this->options[$name] = $value;
$this->compiled = null;
return $this;
} | [
"public",
"function",
"setOption",
"(",
"$",
"name",
",",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"options",
"[",
"$",
"name",
"]",
"=",
"$",
"value",
";",
"$",
"this",
"->",
"compiled",
"=",
"null",
";",
"return",
"$",
"this",
";",
"}"
] | Sets an option value.
This method implements a fluent interface.
@param string $name An option name
@param mixed $value The option value
@return $this | [
"Sets",
"an",
"option",
"value",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Routing/Route.php#L310-L316 |
206,658 | symfony/symfony | src/Symfony/Component/Routing/Route.php | Route.getDefault | public function getDefault($name)
{
return isset($this->defaults[$name]) ? $this->defaults[$name] : null;
} | php | public function getDefault($name)
{
return isset($this->defaults[$name]) ? $this->defaults[$name] : null;
} | [
"public",
"function",
"getDefault",
"(",
"$",
"name",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"defaults",
"[",
"$",
"name",
"]",
")",
"?",
"$",
"this",
"->",
"defaults",
"[",
"$",
"name",
"]",
":",
"null",
";",
"}"
] | Gets a default value.
@param string $name A variable name
@return mixed The default value or null when not given | [
"Gets",
"a",
"default",
"value",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Routing/Route.php#L394-L397 |
206,659 | symfony/symfony | src/Symfony/Component/Routing/Route.php | Route.addRequirements | public function addRequirements(array $requirements)
{
foreach ($requirements as $key => $regex) {
$this->requirements[$key] = $this->sanitizeRequirement($key, $regex);
}
$this->compiled = null;
return $this;
} | php | public function addRequirements(array $requirements)
{
foreach ($requirements as $key => $regex) {
$this->requirements[$key] = $this->sanitizeRequirement($key, $regex);
}
$this->compiled = null;
return $this;
} | [
"public",
"function",
"addRequirements",
"(",
"array",
"$",
"requirements",
")",
"{",
"foreach",
"(",
"$",
"requirements",
"as",
"$",
"key",
"=>",
"$",
"regex",
")",
"{",
"$",
"this",
"->",
"requirements",
"[",
"$",
"key",
"]",
"=",
"$",
"this",
"->",
... | Adds requirements.
This method implements a fluent interface.
@param array $requirements The requirements
@return $this | [
"Adds",
"requirements",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Routing/Route.php#L462-L470 |
206,660 | symfony/symfony | src/Symfony/Component/Routing/Route.php | Route.getRequirement | public function getRequirement($key)
{
return isset($this->requirements[$key]) ? $this->requirements[$key] : null;
} | php | public function getRequirement($key)
{
return isset($this->requirements[$key]) ? $this->requirements[$key] : null;
} | [
"public",
"function",
"getRequirement",
"(",
"$",
"key",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"requirements",
"[",
"$",
"key",
"]",
")",
"?",
"$",
"this",
"->",
"requirements",
"[",
"$",
"key",
"]",
":",
"null",
";",
"}"
] | Returns the requirement for the given key.
@param string $key The key
@return string|null The regex or null when not given | [
"Returns",
"the",
"requirement",
"for",
"the",
"given",
"key",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Routing/Route.php#L479-L482 |
206,661 | symfony/symfony | src/Symfony/Component/Routing/Route.php | Route.setRequirement | public function setRequirement($key, $regex)
{
$this->requirements[$key] = $this->sanitizeRequirement($key, $regex);
$this->compiled = null;
return $this;
} | php | public function setRequirement($key, $regex)
{
$this->requirements[$key] = $this->sanitizeRequirement($key, $regex);
$this->compiled = null;
return $this;
} | [
"public",
"function",
"setRequirement",
"(",
"$",
"key",
",",
"$",
"regex",
")",
"{",
"$",
"this",
"->",
"requirements",
"[",
"$",
"key",
"]",
"=",
"$",
"this",
"->",
"sanitizeRequirement",
"(",
"$",
"key",
",",
"$",
"regex",
")",
";",
"$",
"this",
... | Sets a requirement for the given key.
@param string $key The key
@param string $regex The regex
@return $this | [
"Sets",
"a",
"requirement",
"for",
"the",
"given",
"key",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Routing/Route.php#L504-L510 |
206,662 | symfony/symfony | src/Symfony/Component/Routing/Route.php | Route.setCondition | public function setCondition($condition)
{
$this->condition = (string) $condition;
$this->compiled = null;
return $this;
} | php | public function setCondition($condition)
{
$this->condition = (string) $condition;
$this->compiled = null;
return $this;
} | [
"public",
"function",
"setCondition",
"(",
"$",
"condition",
")",
"{",
"$",
"this",
"->",
"condition",
"=",
"(",
"string",
")",
"$",
"condition",
";",
"$",
"this",
"->",
"compiled",
"=",
"null",
";",
"return",
"$",
"this",
";",
"}"
] | Sets the condition.
This method implements a fluent interface.
@param string $condition The condition
@return $this | [
"Sets",
"the",
"condition",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Routing/Route.php#L531-L537 |
206,663 | symfony/symfony | src/Symfony/Component/Routing/Route.php | Route.compile | public function compile()
{
if (null !== $this->compiled) {
return $this->compiled;
}
$class = $this->getOption('compiler_class');
return $this->compiled = $class::compile($this);
} | php | public function compile()
{
if (null !== $this->compiled) {
return $this->compiled;
}
$class = $this->getOption('compiler_class');
return $this->compiled = $class::compile($this);
} | [
"public",
"function",
"compile",
"(",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"compiled",
")",
"{",
"return",
"$",
"this",
"->",
"compiled",
";",
"}",
"$",
"class",
"=",
"$",
"this",
"->",
"getOption",
"(",
"'compiler_class'",
")",
";"... | Compiles the route.
@return CompiledRoute A CompiledRoute instance
@throws \LogicException If the Route cannot be compiled because the
path or host pattern is invalid
@see RouteCompiler which is responsible for the compilation process | [
"Compiles",
"the",
"route",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Routing/Route.php#L549-L558 |
206,664 | symfony/symfony | src/Symfony/Component/Translation/Extractor/PhpStringTokenParser.php | PhpStringTokenParser.parse | public static function parse($str)
{
$bLength = 0;
if ('b' === $str[0]) {
$bLength = 1;
}
if ('\'' === $str[$bLength]) {
return str_replace(
['\\\\', '\\\''],
['\\', '\''],
substr($str, $bLength + 1, -1)
... | php | public static function parse($str)
{
$bLength = 0;
if ('b' === $str[0]) {
$bLength = 1;
}
if ('\'' === $str[$bLength]) {
return str_replace(
['\\\\', '\\\''],
['\\', '\''],
substr($str, $bLength + 1, -1)
... | [
"public",
"static",
"function",
"parse",
"(",
"$",
"str",
")",
"{",
"$",
"bLength",
"=",
"0",
";",
"if",
"(",
"'b'",
"===",
"$",
"str",
"[",
"0",
"]",
")",
"{",
"$",
"bLength",
"=",
"1",
";",
"}",
"if",
"(",
"'\\''",
"===",
"$",
"str",
"[",
... | Parses a string token.
@param string $str String token content
@return string The parsed string | [
"Parses",
"a",
"string",
"token",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Translation/Extractor/PhpStringTokenParser.php#L70-L86 |
206,665 | symfony/symfony | src/Symfony/Component/Translation/Extractor/PhpStringTokenParser.php | PhpStringTokenParser.parseDocString | public static function parseDocString($startToken, $str)
{
// strip last newline (thanks tokenizer for sticking it into the string!)
$str = preg_replace('~(\r\n|\n|\r)$~', '', $str);
// nowdoc string
if (false !== strpos($startToken, '\'')) {
return $str;
}
... | php | public static function parseDocString($startToken, $str)
{
// strip last newline (thanks tokenizer for sticking it into the string!)
$str = preg_replace('~(\r\n|\n|\r)$~', '', $str);
// nowdoc string
if (false !== strpos($startToken, '\'')) {
return $str;
}
... | [
"public",
"static",
"function",
"parseDocString",
"(",
"$",
"startToken",
",",
"$",
"str",
")",
"{",
"// strip last newline (thanks tokenizer for sticking it into the string!)",
"$",
"str",
"=",
"preg_replace",
"(",
"'~(\\r\\n|\\n|\\r)$~'",
",",
"''",
",",
"$",
"str",
... | Parses a constant doc string.
@param string $startToken Doc string start token content (<<<SMTHG)
@param string $str String token content
@return string Parsed string | [
"Parses",
"a",
"constant",
"doc",
"string",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Translation/Extractor/PhpStringTokenParser.php#L130-L141 |
206,666 | symfony/symfony | src/Symfony/Component/Mailer/Transport/Smtp/SmtpTransport.php | SmtpTransport.setRestartThreshold | public function setRestartThreshold(int $threshold, int $sleep = 0): self
{
$this->restartThreshold = $threshold;
$this->restartThresholdSleep = $sleep;
return $this;
} | php | public function setRestartThreshold(int $threshold, int $sleep = 0): self
{
$this->restartThreshold = $threshold;
$this->restartThresholdSleep = $sleep;
return $this;
} | [
"public",
"function",
"setRestartThreshold",
"(",
"int",
"$",
"threshold",
",",
"int",
"$",
"sleep",
"=",
"0",
")",
":",
"self",
"{",
"$",
"this",
"->",
"restartThreshold",
"=",
"$",
"threshold",
";",
"$",
"this",
"->",
"restartThresholdSleep",
"=",
"$",
... | Sets the maximum number of messages to send before re-starting the transport.
By default, the threshold is set to 100 (and no sleep at restart).
@param int $threshold The maximum number of messages (0 to disable)
@param int $sleep The number of seconds to sleep between stopping and re-starting the transport | [
"Sets",
"the",
"maximum",
"number",
"of",
"messages",
"to",
"send",
"before",
"re",
"-",
"starting",
"the",
"transport",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Mailer/Transport/Smtp/SmtpTransport.php#L63-L69 |
206,667 | symfony/symfony | src/Symfony/Component/Mailer/Transport/Smtp/SmtpTransport.php | SmtpTransport.setLocalDomain | public function setLocalDomain(string $domain): self
{
if ('' !== $domain && '[' !== $domain[0]) {
if (filter_var($domain, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
$domain = '['.$domain.']';
} elseif (filter_var($domain, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
... | php | public function setLocalDomain(string $domain): self
{
if ('' !== $domain && '[' !== $domain[0]) {
if (filter_var($domain, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
$domain = '['.$domain.']';
} elseif (filter_var($domain, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
... | [
"public",
"function",
"setLocalDomain",
"(",
"string",
"$",
"domain",
")",
":",
"self",
"{",
"if",
"(",
"''",
"!==",
"$",
"domain",
"&&",
"'['",
"!==",
"$",
"domain",
"[",
"0",
"]",
")",
"{",
"if",
"(",
"filter_var",
"(",
"$",
"domain",
",",
"FILTE... | Sets the name of the local domain that will be used in HELO.
This should be a fully-qualified domain name and should be truly the domain
you're using.
If your server does not have a domain name, use the IP address. This will
automatically be wrapped in square brackets as described in RFC 5321,
section 4.1.3. | [
"Sets",
"the",
"name",
"of",
"the",
"local",
"domain",
"that",
"will",
"be",
"used",
"in",
"HELO",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Mailer/Transport/Smtp/SmtpTransport.php#L81-L94 |
206,668 | symfony/symfony | src/Symfony/Component/Mailer/Transport/Smtp/SmtpTransport.php | SmtpTransport.executeCommand | public function executeCommand(string $command, array $codes): string
{
$this->getLogger()->debug(sprintf('Email transport "%s" sent command "%s"', __CLASS__, trim($command)));
$this->stream->write($command);
$response = $this->getFullResponse();
$this->assertResponseCode($response, ... | php | public function executeCommand(string $command, array $codes): string
{
$this->getLogger()->debug(sprintf('Email transport "%s" sent command "%s"', __CLASS__, trim($command)));
$this->stream->write($command);
$response = $this->getFullResponse();
$this->assertResponseCode($response, ... | [
"public",
"function",
"executeCommand",
"(",
"string",
"$",
"command",
",",
"array",
"$",
"codes",
")",
":",
"string",
"{",
"$",
"this",
"->",
"getLogger",
"(",
")",
"->",
"debug",
"(",
"sprintf",
"(",
"'Email transport \"%s\" sent command \"%s\"'",
",",
"__CL... | Runs a command against the stream, expecting the given response codes.
@param int[] $codes
@return string The server response
@throws TransportException when an invalid response if received
@internal | [
"Runs",
"a",
"command",
"against",
"the",
"stream",
"expecting",
"the",
"given",
"response",
"codes",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Mailer/Transport/Smtp/SmtpTransport.php#L138-L146 |
206,669 | symfony/symfony | src/Symfony/Component/HttpKernel/Fragment/RoutableFragmentRenderer.php | RoutableFragmentRenderer.generateFragmentUri | protected function generateFragmentUri(ControllerReference $reference, Request $request, $absolute = false, $strict = true)
{
if ($strict) {
$this->checkNonScalar($reference->attributes);
}
// We need to forward the current _format and _locale values as we don't have
// ... | php | protected function generateFragmentUri(ControllerReference $reference, Request $request, $absolute = false, $strict = true)
{
if ($strict) {
$this->checkNonScalar($reference->attributes);
}
// We need to forward the current _format and _locale values as we don't have
// ... | [
"protected",
"function",
"generateFragmentUri",
"(",
"ControllerReference",
"$",
"reference",
",",
"Request",
"$",
"request",
",",
"$",
"absolute",
"=",
"false",
",",
"$",
"strict",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"strict",
")",
"{",
"$",
"this",
... | Generates a fragment URI for a given controller.
@param ControllerReference $reference A ControllerReference instance
@param Request $request A Request instance
@param bool $absolute Whether to generate an absolute URL or not
@param bool $strict Whether to allow non-scal... | [
"Generates",
"a",
"fragment",
"URI",
"for",
"a",
"given",
"controller",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/Fragment/RoutableFragmentRenderer.php#L49-L78 |
206,670 | symfony/symfony | src/Symfony/Component/Cache/Traits/ArrayTrait.php | ArrayTrait.getValues | public function getValues()
{
if (!$this->storeSerialized) {
return $this->values;
}
$values = $this->values;
foreach ($values as $k => $v) {
if (null === $v || 'N;' === $v) {
continue;
}
if (!\is_string($v) || !isset($... | php | public function getValues()
{
if (!$this->storeSerialized) {
return $this->values;
}
$values = $this->values;
foreach ($values as $k => $v) {
if (null === $v || 'N;' === $v) {
continue;
}
if (!\is_string($v) || !isset($... | [
"public",
"function",
"getValues",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"storeSerialized",
")",
"{",
"return",
"$",
"this",
"->",
"values",
";",
"}",
"$",
"values",
"=",
"$",
"this",
"->",
"values",
";",
"foreach",
"(",
"$",
"values",
... | Returns all cached values, with cache miss as null.
@return array | [
"Returns",
"all",
"cached",
"values",
"with",
"cache",
"miss",
"as",
"null",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Cache/Traits/ArrayTrait.php#L35-L52 |
206,671 | symfony/symfony | src/Symfony/Component/Security/Http/Firewall/LogoutListener.php | LogoutListener.requiresLogout | protected function requiresLogout(Request $request)
{
return isset($this->options['logout_path']) && $this->httpUtils->checkRequestPath($request, $this->options['logout_path']);
} | php | protected function requiresLogout(Request $request)
{
return isset($this->options['logout_path']) && $this->httpUtils->checkRequestPath($request, $this->options['logout_path']);
} | [
"protected",
"function",
"requiresLogout",
"(",
"Request",
"$",
"request",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"options",
"[",
"'logout_path'",
"]",
")",
"&&",
"$",
"this",
"->",
"httpUtils",
"->",
"checkRequestPath",
"(",
"$",
"request",
... | Whether this request is asking for logout.
The default implementation only processed requests to a specific path,
but a subclass could change this to logout requests where
certain parameters is present.
@return bool | [
"Whether",
"this",
"request",
"is",
"asking",
"for",
"logout",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Security/Http/Firewall/LogoutListener.php#L121-L124 |
206,672 | symfony/symfony | src/Symfony/Component/Console/Helper/Table.php | Table.getStyleDefinition | public static function getStyleDefinition($name)
{
if (!self::$styles) {
self::$styles = self::initStyles();
}
if (isset(self::$styles[$name])) {
return self::$styles[$name];
}
throw new InvalidArgumentException(sprintf('Style "%s" is not defined.', ... | php | public static function getStyleDefinition($name)
{
if (!self::$styles) {
self::$styles = self::initStyles();
}
if (isset(self::$styles[$name])) {
return self::$styles[$name];
}
throw new InvalidArgumentException(sprintf('Style "%s" is not defined.', ... | [
"public",
"static",
"function",
"getStyleDefinition",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"$",
"styles",
")",
"{",
"self",
"::",
"$",
"styles",
"=",
"self",
"::",
"initStyles",
"(",
")",
";",
"}",
"if",
"(",
"isset",
"(",
"sel... | Gets a style definition by name.
@param string $name The style name
@return TableStyle | [
"Gets",
"a",
"style",
"definition",
"by",
"name",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Helper/Table.php#L124-L135 |
206,673 | symfony/symfony | src/Symfony/Component/Console/Helper/Table.php | Table.setColumnStyle | public function setColumnStyle($columnIndex, $name)
{
$columnIndex = (int) $columnIndex;
$this->columnStyles[$columnIndex] = $this->resolveStyle($name);
return $this;
} | php | public function setColumnStyle($columnIndex, $name)
{
$columnIndex = (int) $columnIndex;
$this->columnStyles[$columnIndex] = $this->resolveStyle($name);
return $this;
} | [
"public",
"function",
"setColumnStyle",
"(",
"$",
"columnIndex",
",",
"$",
"name",
")",
"{",
"$",
"columnIndex",
"=",
"(",
"int",
")",
"$",
"columnIndex",
";",
"$",
"this",
"->",
"columnStyles",
"[",
"$",
"columnIndex",
"]",
"=",
"$",
"this",
"->",
"re... | Sets table column style.
@param int $columnIndex Column index
@param TableStyle|string $name The style name or a TableStyle instance
@return $this | [
"Sets",
"table",
"column",
"style",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Helper/Table.php#L169-L176 |
206,674 | symfony/symfony | src/Symfony/Component/Console/Helper/Table.php | Table.setColumnWidth | public function setColumnWidth($columnIndex, $width)
{
$this->columnWidths[(int) $columnIndex] = (int) $width;
return $this;
} | php | public function setColumnWidth($columnIndex, $width)
{
$this->columnWidths[(int) $columnIndex] = (int) $width;
return $this;
} | [
"public",
"function",
"setColumnWidth",
"(",
"$",
"columnIndex",
",",
"$",
"width",
")",
"{",
"$",
"this",
"->",
"columnWidths",
"[",
"(",
"int",
")",
"$",
"columnIndex",
"]",
"=",
"(",
"int",
")",
"$",
"width",
";",
"return",
"$",
"this",
";",
"}"
] | Sets the minimum width of a column.
@param int $columnIndex Column index
@param int $width Minimum column width in characters
@return $this | [
"Sets",
"the",
"minimum",
"width",
"of",
"a",
"column",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Helper/Table.php#L200-L205 |
206,675 | symfony/symfony | src/Symfony/Component/Console/Helper/Table.php | Table.setColumnWidths | public function setColumnWidths(array $widths)
{
$this->columnWidths = [];
foreach ($widths as $index => $width) {
$this->setColumnWidth($index, $width);
}
return $this;
} | php | public function setColumnWidths(array $widths)
{
$this->columnWidths = [];
foreach ($widths as $index => $width) {
$this->setColumnWidth($index, $width);
}
return $this;
} | [
"public",
"function",
"setColumnWidths",
"(",
"array",
"$",
"widths",
")",
"{",
"$",
"this",
"->",
"columnWidths",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"widths",
"as",
"$",
"index",
"=>",
"$",
"width",
")",
"{",
"$",
"this",
"->",
"setColumnWidth",... | Sets the minimum width of all columns.
@param array $widths
@return $this | [
"Sets",
"the",
"minimum",
"width",
"of",
"all",
"columns",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Helper/Table.php#L214-L222 |
206,676 | symfony/symfony | src/Symfony/Component/Console/Helper/Table.php | Table.setColumnMaxWidth | public function setColumnMaxWidth(int $columnIndex, int $width): self
{
if (!$this->output->getFormatter() instanceof WrappableOutputFormatterInterface) {
throw new \LogicException(sprintf('Setting a maximum column width is only supported when using a "%s" formatter, got "%s".', WrappableOutputF... | php | public function setColumnMaxWidth(int $columnIndex, int $width): self
{
if (!$this->output->getFormatter() instanceof WrappableOutputFormatterInterface) {
throw new \LogicException(sprintf('Setting a maximum column width is only supported when using a "%s" formatter, got "%s".', WrappableOutputF... | [
"public",
"function",
"setColumnMaxWidth",
"(",
"int",
"$",
"columnIndex",
",",
"int",
"$",
"width",
")",
":",
"self",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"output",
"->",
"getFormatter",
"(",
")",
"instanceof",
"WrappableOutputFormatterInterface",
")",
"... | Sets the maximum width of a column.
Any cell within this column which contents exceeds the specified width will be wrapped into multiple lines, while
formatted strings are preserved.
@return $this | [
"Sets",
"the",
"maximum",
"width",
"of",
"a",
"column",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Helper/Table.php#L232-L241 |
206,677 | symfony/symfony | src/Symfony/Component/Console/Helper/Table.php | Table.appendRow | public function appendRow($row): self
{
if (!$this->output instanceof ConsoleSectionOutput) {
throw new RuntimeException(sprintf('Output should be an instance of "%s" when calling "%s".', ConsoleSectionOutput::class, __METHOD__));
}
if ($this->rendered) {
$this->outp... | php | public function appendRow($row): self
{
if (!$this->output instanceof ConsoleSectionOutput) {
throw new RuntimeException(sprintf('Output should be an instance of "%s" when calling "%s".', ConsoleSectionOutput::class, __METHOD__));
}
if ($this->rendered) {
$this->outp... | [
"public",
"function",
"appendRow",
"(",
"$",
"row",
")",
":",
"self",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"output",
"instanceof",
"ConsoleSectionOutput",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"sprintf",
"(",
"'Output should be an instance of \"%... | Adds a row to the table, and re-renders the table. | [
"Adds",
"a",
"row",
"to",
"the",
"table",
"and",
"re",
"-",
"renders",
"the",
"table",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Helper/Table.php#L291-L305 |
206,678 | symfony/symfony | src/Symfony/Component/Console/Helper/Table.php | Table.renderColumnSeparator | private function renderColumnSeparator($type = self::BORDER_OUTSIDE)
{
$borders = $this->style->getBorderChars();
return sprintf($this->style->getBorderFormat(), self::BORDER_OUTSIDE === $type ? $borders[1] : $borders[3]);
} | php | private function renderColumnSeparator($type = self::BORDER_OUTSIDE)
{
$borders = $this->style->getBorderChars();
return sprintf($this->style->getBorderFormat(), self::BORDER_OUTSIDE === $type ? $borders[1] : $borders[3]);
} | [
"private",
"function",
"renderColumnSeparator",
"(",
"$",
"type",
"=",
"self",
"::",
"BORDER_OUTSIDE",
")",
"{",
"$",
"borders",
"=",
"$",
"this",
"->",
"style",
"->",
"getBorderChars",
"(",
")",
";",
"return",
"sprintf",
"(",
"$",
"this",
"->",
"style",
... | Renders vertical column separator. | [
"Renders",
"vertical",
"column",
"separator",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Helper/Table.php#L442-L447 |
206,679 | symfony/symfony | src/Symfony/Component/Console/Helper/Table.php | Table.fillCells | private function fillCells($row)
{
$newRow = [];
foreach ($row as $column => $cell) {
$newRow[] = $cell;
if ($cell instanceof TableCell && $cell->getColspan() > 1) {
foreach (range($column + 1, $column + $cell->getColspan() - 1) as $position) {
... | php | private function fillCells($row)
{
$newRow = [];
foreach ($row as $column => $cell) {
$newRow[] = $cell;
if ($cell instanceof TableCell && $cell->getColspan() > 1) {
foreach (range($column + 1, $column + $cell->getColspan() - 1) as $position) {
... | [
"private",
"function",
"fillCells",
"(",
"$",
"row",
")",
"{",
"$",
"newRow",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"row",
"as",
"$",
"column",
"=>",
"$",
"cell",
")",
"{",
"$",
"newRow",
"[",
"]",
"=",
"$",
"cell",
";",
"if",
"(",
"$",
"c... | fill cells for a row that contains colspan > 1. | [
"fill",
"cells",
"for",
"a",
"row",
"that",
"contains",
"colspan",
">",
"1",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Helper/Table.php#L635-L649 |
206,680 | symfony/symfony | src/Symfony/Bridge/Doctrine/Form/ChoiceList/IdReader.php | IdReader.getIdValue | public function getIdValue($object)
{
if (!$object) {
return;
}
if (!$this->om->contains($object)) {
throw new RuntimeException(sprintf('Entity of type "%s" passed to the choice field must be managed. Maybe you forget to persist it in the entity manager?', \get_class... | php | public function getIdValue($object)
{
if (!$object) {
return;
}
if (!$this->om->contains($object)) {
throw new RuntimeException(sprintf('Entity of type "%s" passed to the choice field must be managed. Maybe you forget to persist it in the entity manager?', \get_class... | [
"public",
"function",
"getIdValue",
"(",
"$",
"object",
")",
"{",
"if",
"(",
"!",
"$",
"object",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"$",
"this",
"->",
"om",
"->",
"contains",
"(",
"$",
"object",
")",
")",
"{",
"throw",
"new",
"RuntimeE... | Returns the ID value for an object.
This method assumes that the object has a single-column ID.
@param object $object The object
@return mixed The ID value | [
"Returns",
"the",
"ID",
"value",
"for",
"an",
"object",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bridge/Doctrine/Form/ChoiceList/IdReader.php#L91-L110 |
206,681 | symfony/symfony | src/Symfony/Component/ExpressionLanguage/ExpressionLanguage.php | ExpressionLanguage.register | public function register($name, callable $compiler, callable $evaluator)
{
if (null !== $this->parser) {
throw new \LogicException('Registering functions after calling evaluate(), compile() or parse() is not supported.');
}
$this->functions[$name] = ['compiler' => $compiler, 'ev... | php | public function register($name, callable $compiler, callable $evaluator)
{
if (null !== $this->parser) {
throw new \LogicException('Registering functions after calling evaluate(), compile() or parse() is not supported.');
}
$this->functions[$name] = ['compiler' => $compiler, 'ev... | [
"public",
"function",
"register",
"(",
"$",
"name",
",",
"callable",
"$",
"compiler",
",",
"callable",
"$",
"evaluator",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"parser",
")",
"{",
"throw",
"new",
"\\",
"LogicException",
"(",
"'Registering... | Registers a function.
@param string $name The function name
@param callable $compiler A callable able to compile the function
@param callable $evaluator A callable able to evaluate the function
@throws \LogicException when registering a function after calling evaluate(), compile() or parse()
@see ExpressionF... | [
"Registers",
"a",
"function",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/ExpressionLanguage/ExpressionLanguage.php#L115-L122 |
206,682 | symfony/symfony | src/Symfony/Component/Mime/Header/MailboxListHeader.php | MailboxListHeader.getAddressStrings | public function getAddressStrings(): array
{
$strings = [];
foreach ($this->addresses as $address) {
$str = $address->getEncodedAddress();
if ($address instanceof NamedAddress && $name = $address->getName()) {
$str = $this->createPhrase($this, $name, $this->ge... | php | public function getAddressStrings(): array
{
$strings = [];
foreach ($this->addresses as $address) {
$str = $address->getEncodedAddress();
if ($address instanceof NamedAddress && $name = $address->getName()) {
$str = $this->createPhrase($this, $name, $this->ge... | [
"public",
"function",
"getAddressStrings",
"(",
")",
":",
"array",
"{",
"$",
"strings",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"addresses",
"as",
"$",
"address",
")",
"{",
"$",
"str",
"=",
"$",
"address",
"->",
"getEncodedAddress",
"(",... | Gets the full mailbox list of this Header as an array of valid RFC 2822 strings.
@throws RfcComplianceException
@return string[] | [
"Gets",
"the",
"full",
"mailbox",
"list",
"of",
"this",
"Header",
"as",
"an",
"array",
"of",
"valid",
"RFC",
"2822",
"strings",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Mime/Header/MailboxListHeader.php#L109-L121 |
206,683 | symfony/symfony | src/Symfony/Component/Form/Exception/TransformationFailedException.php | TransformationFailedException.setInvalidMessage | public function setInvalidMessage(string $invalidMessage = null, array $invalidMessageParameters = []): void
{
$this->invalidMessage = $invalidMessage;
$this->invalidMessageParameters = $invalidMessageParameters;
} | php | public function setInvalidMessage(string $invalidMessage = null, array $invalidMessageParameters = []): void
{
$this->invalidMessage = $invalidMessage;
$this->invalidMessageParameters = $invalidMessageParameters;
} | [
"public",
"function",
"setInvalidMessage",
"(",
"string",
"$",
"invalidMessage",
"=",
"null",
",",
"array",
"$",
"invalidMessageParameters",
"=",
"[",
"]",
")",
":",
"void",
"{",
"$",
"this",
"->",
"invalidMessage",
"=",
"$",
"invalidMessage",
";",
"$",
"thi... | Sets the message that will be shown to the user.
@param string|null $invalidMessage The message or message key
@param array $invalidMessageParameters Data to be passed into the translator | [
"Sets",
"the",
"message",
"that",
"will",
"be",
"shown",
"to",
"the",
"user",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Exception/TransformationFailedException.php#L37-L41 |
206,684 | symfony/symfony | src/Symfony/Component/OptionsResolver/OptionsResolver.php | OptionsResolver.setDefault | public function setDefault($option, $value)
{
// Setting is not possible once resolving starts, because then lazy
// options could manipulate the state of the object, leading to
// inconsistent results.
if ($this->locked) {
throw new AccessException('Default values cannot... | php | public function setDefault($option, $value)
{
// Setting is not possible once resolving starts, because then lazy
// options could manipulate the state of the object, leading to
// inconsistent results.
if ($this->locked) {
throw new AccessException('Default values cannot... | [
"public",
"function",
"setDefault",
"(",
"$",
"option",
",",
"$",
"value",
")",
"{",
"// Setting is not possible once resolving starts, because then lazy",
"// options could manipulate the state of the object, leading to",
"// inconsistent results.",
"if",
"(",
"$",
"this",
"->",... | Sets the default value of a given option.
If the default value should be set based on other options, you can pass
a closure with the following signature:
function (Options $options) {
// ...
}
The closure will be evaluated when {@link resolve()} is called. The
closure has access to the resolved values of other optio... | [
"Sets",
"the",
"default",
"value",
"of",
"a",
"given",
"option",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/OptionsResolver/OptionsResolver.php#L166-L230 |
206,685 | symfony/symfony | src/Symfony/Component/OptionsResolver/OptionsResolver.php | OptionsResolver.setDefaults | public function setDefaults(array $defaults)
{
foreach ($defaults as $option => $value) {
$this->setDefault($option, $value);
}
return $this;
} | php | public function setDefaults(array $defaults)
{
foreach ($defaults as $option => $value) {
$this->setDefault($option, $value);
}
return $this;
} | [
"public",
"function",
"setDefaults",
"(",
"array",
"$",
"defaults",
")",
"{",
"foreach",
"(",
"$",
"defaults",
"as",
"$",
"option",
"=>",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"setDefault",
"(",
"$",
"option",
",",
"$",
"value",
")",
";",
"}",
... | Sets a list of default values.
@param array $defaults The default values to set
@return $this
@throws AccessException If called from a lazy option or normalizer | [
"Sets",
"a",
"list",
"of",
"default",
"values",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/OptionsResolver/OptionsResolver.php#L241-L248 |
206,686 | symfony/symfony | src/Symfony/Component/OptionsResolver/OptionsResolver.php | OptionsResolver.setRequired | public function setRequired($optionNames)
{
if ($this->locked) {
throw new AccessException('Options cannot be made required from a lazy option or normalizer.');
}
foreach ((array) $optionNames as $option) {
$this->defined[$option] = true;
$this->required[... | php | public function setRequired($optionNames)
{
if ($this->locked) {
throw new AccessException('Options cannot be made required from a lazy option or normalizer.');
}
foreach ((array) $optionNames as $option) {
$this->defined[$option] = true;
$this->required[... | [
"public",
"function",
"setRequired",
"(",
"$",
"optionNames",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"locked",
")",
"{",
"throw",
"new",
"AccessException",
"(",
"'Options cannot be made required from a lazy option or normalizer.'",
")",
";",
"}",
"foreach",
"(",
... | Marks one or more options as required.
@param string|string[] $optionNames One or more option names
@return $this
@throws AccessException If called from a lazy option or normalizer | [
"Marks",
"one",
"or",
"more",
"options",
"as",
"required",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/OptionsResolver/OptionsResolver.php#L274-L286 |
206,687 | symfony/symfony | src/Symfony/Component/OptionsResolver/OptionsResolver.php | OptionsResolver.isMissing | public function isMissing($option)
{
return isset($this->required[$option]) && !\array_key_exists($option, $this->defaults);
} | php | public function isMissing($option)
{
return isset($this->required[$option]) && !\array_key_exists($option, $this->defaults);
} | [
"public",
"function",
"isMissing",
"(",
"$",
"option",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"required",
"[",
"$",
"option",
"]",
")",
"&&",
"!",
"\\",
"array_key_exists",
"(",
"$",
"option",
",",
"$",
"this",
"->",
"defaults",
")",
";... | Returns whether an option is missing a default value.
An option is missing if it was passed to {@link setRequired()}, but not
to {@link setDefault()}. This option must be passed explicitly to
{@link resolve()}, otherwise an exception will be thrown.
@param string $option The name of the option
@return bool Whether t... | [
"Returns",
"whether",
"an",
"option",
"is",
"missing",
"a",
"default",
"value",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/OptionsResolver/OptionsResolver.php#L325-L328 |
206,688 | symfony/symfony | src/Symfony/Component/OptionsResolver/OptionsResolver.php | OptionsResolver.setDefined | public function setDefined($optionNames)
{
if ($this->locked) {
throw new AccessException('Options cannot be defined from a lazy option or normalizer.');
}
foreach ((array) $optionNames as $option) {
$this->defined[$option] = true;
}
return $this;
... | php | public function setDefined($optionNames)
{
if ($this->locked) {
throw new AccessException('Options cannot be defined from a lazy option or normalizer.');
}
foreach ((array) $optionNames as $option) {
$this->defined[$option] = true;
}
return $this;
... | [
"public",
"function",
"setDefined",
"(",
"$",
"optionNames",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"locked",
")",
"{",
"throw",
"new",
"AccessException",
"(",
"'Options cannot be defined from a lazy option or normalizer.'",
")",
";",
"}",
"foreach",
"(",
"(",
... | Defines a valid option name.
Defines an option name without setting a default value. The option will
be accepted when passed to {@link resolve()}. When not passed, the
option will not be included in the resolved options.
@param string|string[] $optionNames One or more option names
@return $this
@throws AccessExcept... | [
"Defines",
"a",
"valid",
"option",
"name",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/OptionsResolver/OptionsResolver.php#L355-L366 |
206,689 | symfony/symfony | src/Symfony/Component/OptionsResolver/OptionsResolver.php | OptionsResolver.setDeprecated | public function setDeprecated(string $option, $deprecationMessage = 'The option "%name%" is deprecated.'): self
{
if ($this->locked) {
throw new AccessException('Options cannot be deprecated from a lazy option or normalizer.');
}
if (!isset($this->defined[$option])) {
... | php | public function setDeprecated(string $option, $deprecationMessage = 'The option "%name%" is deprecated.'): self
{
if ($this->locked) {
throw new AccessException('Options cannot be deprecated from a lazy option or normalizer.');
}
if (!isset($this->defined[$option])) {
... | [
"public",
"function",
"setDeprecated",
"(",
"string",
"$",
"option",
",",
"$",
"deprecationMessage",
"=",
"'The option \"%name%\" is deprecated.'",
")",
":",
"self",
"{",
"if",
"(",
"$",
"this",
"->",
"locked",
")",
"{",
"throw",
"new",
"AccessException",
"(",
... | Deprecates an option, allowed types or values.
Instead of passing the message, you may also pass a closure with the
following signature:
function (Options $options, $value): string {
// ...
}
The closure receives the value as argument and should return a string.
Return an empty string to ignore the option deprecatio... | [
"Deprecates",
"an",
"option",
"allowed",
"types",
"or",
"values",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/OptionsResolver/OptionsResolver.php#L419-L444 |
206,690 | symfony/symfony | src/Symfony/Component/OptionsResolver/OptionsResolver.php | OptionsResolver.setNormalizer | public function setNormalizer($option, \Closure $normalizer)
{
if ($this->locked) {
throw new AccessException('Normalizers cannot be set from a lazy option or normalizer.');
}
if (!isset($this->defined[$option])) {
throw new UndefinedOptionsException(sprintf('The opt... | php | public function setNormalizer($option, \Closure $normalizer)
{
if ($this->locked) {
throw new AccessException('Normalizers cannot be set from a lazy option or normalizer.');
}
if (!isset($this->defined[$option])) {
throw new UndefinedOptionsException(sprintf('The opt... | [
"public",
"function",
"setNormalizer",
"(",
"$",
"option",
",",
"\\",
"Closure",
"$",
"normalizer",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"locked",
")",
"{",
"throw",
"new",
"AccessException",
"(",
"'Normalizers cannot be set from a lazy option or normalizer.'",
... | Sets the normalizer for an option.
The normalizer should be a closure with the following signature:
function (Options $options, $value) {
// ...
}
The closure is invoked when {@link resolve()} is called. The closure
has access to the resolved values of other options through the passed
{@link Options} instance.
The ... | [
"Sets",
"the",
"normalizer",
"for",
"an",
"option",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/OptionsResolver/OptionsResolver.php#L477-L493 |
206,691 | symfony/symfony | src/Symfony/Component/OptionsResolver/OptionsResolver.php | OptionsResolver.addNormalizer | public function addNormalizer(string $option, \Closure $normalizer, bool $forcePrepend = false): self
{
if ($this->locked) {
throw new AccessException('Normalizers cannot be set from a lazy option or normalizer.');
}
if (!isset($this->defined[$option])) {
throw new U... | php | public function addNormalizer(string $option, \Closure $normalizer, bool $forcePrepend = false): self
{
if ($this->locked) {
throw new AccessException('Normalizers cannot be set from a lazy option or normalizer.');
}
if (!isset($this->defined[$option])) {
throw new U... | [
"public",
"function",
"addNormalizer",
"(",
"string",
"$",
"option",
",",
"\\",
"Closure",
"$",
"normalizer",
",",
"bool",
"$",
"forcePrepend",
"=",
"false",
")",
":",
"self",
"{",
"if",
"(",
"$",
"this",
"->",
"locked",
")",
"{",
"throw",
"new",
"Acce... | Adds a normalizer for an option.
The normalizer should be a closure with the following signature:
function (Options $options, $value): mixed {
// ...
}
The closure is invoked when {@link resolve()} is called. The closure
has access to the resolved values of other options through the passed
{@link Options} instance.
... | [
"Adds",
"a",
"normalizer",
"for",
"an",
"option",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/OptionsResolver/OptionsResolver.php#L522-L542 |
206,692 | symfony/symfony | src/Symfony/Component/OptionsResolver/OptionsResolver.php | OptionsResolver.setAllowedValues | public function setAllowedValues($option, $allowedValues)
{
if ($this->locked) {
throw new AccessException('Allowed values cannot be set from a lazy option or normalizer.');
}
if (!isset($this->defined[$option])) {
throw new UndefinedOptionsException(sprintf('The opt... | php | public function setAllowedValues($option, $allowedValues)
{
if ($this->locked) {
throw new AccessException('Allowed values cannot be set from a lazy option or normalizer.');
}
if (!isset($this->defined[$option])) {
throw new UndefinedOptionsException(sprintf('The opt... | [
"public",
"function",
"setAllowedValues",
"(",
"$",
"option",
",",
"$",
"allowedValues",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"locked",
")",
"{",
"throw",
"new",
"AccessException",
"(",
"'Allowed values cannot be set from a lazy option or normalizer.'",
")",
";",... | Sets allowed values for an option.
Instead of passing values, you may also pass a closures with the
following signature:
function ($value) {
// return true or false
}
The closure receives the value as argument and should return true to
accept the value and false to reject the value.
@param string $option The... | [
"Sets",
"allowed",
"values",
"for",
"an",
"option",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/OptionsResolver/OptionsResolver.php#L565-L581 |
206,693 | symfony/symfony | src/Symfony/Component/OptionsResolver/OptionsResolver.php | OptionsResolver.addAllowedValues | public function addAllowedValues($option, $allowedValues)
{
if ($this->locked) {
throw new AccessException('Allowed values cannot be added from a lazy option or normalizer.');
}
if (!isset($this->defined[$option])) {
throw new UndefinedOptionsException(sprintf('The o... | php | public function addAllowedValues($option, $allowedValues)
{
if ($this->locked) {
throw new AccessException('Allowed values cannot be added from a lazy option or normalizer.');
}
if (!isset($this->defined[$option])) {
throw new UndefinedOptionsException(sprintf('The o... | [
"public",
"function",
"addAllowedValues",
"(",
"$",
"option",
",",
"$",
"allowedValues",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"locked",
")",
"{",
"throw",
"new",
"AccessException",
"(",
"'Allowed values cannot be added from a lazy option or normalizer.'",
")",
";... | Adds allowed values for an option.
The values are merged with the allowed values defined previously.
Instead of passing values, you may also pass a closures with the
following signature:
function ($value) {
// return true or false
}
The closure receives the value as argument and should return true to
accept the val... | [
"Adds",
"allowed",
"values",
"for",
"an",
"option",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/OptionsResolver/OptionsResolver.php#L606-L630 |
206,694 | symfony/symfony | src/Symfony/Component/OptionsResolver/OptionsResolver.php | OptionsResolver.setAllowedTypes | public function setAllowedTypes($option, $allowedTypes)
{
if ($this->locked) {
throw new AccessException('Allowed types cannot be set from a lazy option or normalizer.');
}
if (!isset($this->defined[$option])) {
throw new UndefinedOptionsException(sprintf('The option... | php | public function setAllowedTypes($option, $allowedTypes)
{
if ($this->locked) {
throw new AccessException('Allowed types cannot be set from a lazy option or normalizer.');
}
if (!isset($this->defined[$option])) {
throw new UndefinedOptionsException(sprintf('The option... | [
"public",
"function",
"setAllowedTypes",
"(",
"$",
"option",
",",
"$",
"allowedTypes",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"locked",
")",
"{",
"throw",
"new",
"AccessException",
"(",
"'Allowed types cannot be set from a lazy option or normalizer.'",
")",
";",
... | Sets allowed types for an option.
Any type for which a corresponding is_<type>() function exists is
acceptable. Additionally, fully-qualified class or interface names may
be passed.
@param string $option The option name
@param string|string[] $allowedTypes One or more accepted types
@return $this
@th... | [
"Sets",
"allowed",
"types",
"for",
"an",
"option",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/OptionsResolver/OptionsResolver.php#L647-L663 |
206,695 | symfony/symfony | src/Symfony/Component/OptionsResolver/OptionsResolver.php | OptionsResolver.addAllowedTypes | public function addAllowedTypes($option, $allowedTypes)
{
if ($this->locked) {
throw new AccessException('Allowed types cannot be added from a lazy option or normalizer.');
}
if (!isset($this->defined[$option])) {
throw new UndefinedOptionsException(sprintf('The opti... | php | public function addAllowedTypes($option, $allowedTypes)
{
if ($this->locked) {
throw new AccessException('Allowed types cannot be added from a lazy option or normalizer.');
}
if (!isset($this->defined[$option])) {
throw new UndefinedOptionsException(sprintf('The opti... | [
"public",
"function",
"addAllowedTypes",
"(",
"$",
"option",
",",
"$",
"allowedTypes",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"locked",
")",
"{",
"throw",
"new",
"AccessException",
"(",
"'Allowed types cannot be added from a lazy option or normalizer.'",
")",
";",
... | Adds allowed types for an option.
The types are merged with the allowed types defined previously.
Any type for which a corresponding is_<type>() function exists is
acceptable. Additionally, fully-qualified class or interface names may
be passed.
@param string $option The option name
@param string|stri... | [
"Adds",
"allowed",
"types",
"for",
"an",
"option",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/OptionsResolver/OptionsResolver.php#L682-L702 |
206,696 | symfony/symfony | src/Symfony/Component/OptionsResolver/OptionsResolver.php | OptionsResolver.remove | public function remove($optionNames)
{
if ($this->locked) {
throw new AccessException('Options cannot be removed from a lazy option or normalizer.');
}
foreach ((array) $optionNames as $option) {
unset($this->defined[$option], $this->defaults[$option], $this->require... | php | public function remove($optionNames)
{
if ($this->locked) {
throw new AccessException('Options cannot be removed from a lazy option or normalizer.');
}
foreach ((array) $optionNames as $option) {
unset($this->defined[$option], $this->defaults[$option], $this->require... | [
"public",
"function",
"remove",
"(",
"$",
"optionNames",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"locked",
")",
"{",
"throw",
"new",
"AccessException",
"(",
"'Options cannot be removed from a lazy option or normalizer.'",
")",
";",
"}",
"foreach",
"(",
"(",
"arr... | Removes the option with the given name.
Undefined options are ignored.
@param string|string[] $optionNames One or more option names
@return $this
@throws AccessException If called from a lazy option or normalizer | [
"Removes",
"the",
"option",
"with",
"the",
"given",
"name",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/OptionsResolver/OptionsResolver.php#L715-L727 |
206,697 | symfony/symfony | src/Symfony/Component/OptionsResolver/OptionsResolver.php | OptionsResolver.clear | public function clear()
{
if ($this->locked) {
throw new AccessException('Options cannot be cleared from a lazy option or normalizer.');
}
$this->defined = [];
$this->defaults = [];
$this->nested = [];
$this->required = [];
$this->resolved = [];
... | php | public function clear()
{
if ($this->locked) {
throw new AccessException('Options cannot be cleared from a lazy option or normalizer.');
}
$this->defined = [];
$this->defaults = [];
$this->nested = [];
$this->required = [];
$this->resolved = [];
... | [
"public",
"function",
"clear",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"locked",
")",
"{",
"throw",
"new",
"AccessException",
"(",
"'Options cannot be cleared from a lazy option or normalizer.'",
")",
";",
"}",
"$",
"this",
"->",
"defined",
"=",
"[",
"]",... | Removes all options.
@return $this
@throws AccessException If called from a lazy option or normalizer | [
"Removes",
"all",
"options",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/OptionsResolver/OptionsResolver.php#L736-L754 |
206,698 | symfony/symfony | src/Symfony/Component/OptionsResolver/OptionsResolver.php | OptionsResolver.resolve | public function resolve(array $options = [])
{
if ($this->locked) {
throw new AccessException('Options cannot be resolved from a lazy option or normalizer.');
}
// Allow this method to be called multiple times
$clone = clone $this;
// Make sure that no unknown o... | php | public function resolve(array $options = [])
{
if ($this->locked) {
throw new AccessException('Options cannot be resolved from a lazy option or normalizer.');
}
// Allow this method to be called multiple times
$clone = clone $this;
// Make sure that no unknown o... | [
"public",
"function",
"resolve",
"(",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"locked",
")",
"{",
"throw",
"new",
"AccessException",
"(",
"'Options cannot be resolved from a lazy option or normalizer.'",
")",
";",
"}",
"... | Merges options with the default values stored in the container and
validates them.
Exceptions are thrown if:
- Undefined options are passed;
- Required options are missing;
- Options have invalid types;
- Options have invalid values.
@param array $options A map of option names to values
@return array The merged and... | [
"Merges",
"options",
"with",
"the",
"default",
"values",
"stored",
"in",
"the",
"container",
"and",
"validates",
"them",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/OptionsResolver/OptionsResolver.php#L780-L825 |
206,699 | symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php | Descriptor.write | protected function write($content, $decorated = false)
{
$this->output->write($content, false, $decorated ? OutputInterface::OUTPUT_NORMAL : OutputInterface::OUTPUT_RAW);
} | php | protected function write($content, $decorated = false)
{
$this->output->write($content, false, $decorated ? OutputInterface::OUTPUT_NORMAL : OutputInterface::OUTPUT_RAW);
} | [
"protected",
"function",
"write",
"(",
"$",
"content",
",",
"$",
"decorated",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"output",
"->",
"write",
"(",
"$",
"content",
",",
"false",
",",
"$",
"decorated",
"?",
"OutputInterface",
"::",
"OUTPUT_NORMAL",
":"... | Writes content to output.
@param string $content
@param bool $decorated | [
"Writes",
"content",
"to",
"output",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php#L103-L106 |
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.