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,800 | symfony/symfony | src/Symfony/Component/HttpFoundation/HeaderUtils.php | HeaderUtils.combine | public static function combine(array $parts): array
{
$assoc = [];
foreach ($parts as $part) {
$name = strtolower($part[0]);
$value = $part[1] ?? true;
$assoc[$name] = $value;
}
return $assoc;
} | php | public static function combine(array $parts): array
{
$assoc = [];
foreach ($parts as $part) {
$name = strtolower($part[0]);
$value = $part[1] ?? true;
$assoc[$name] = $value;
}
return $assoc;
} | [
"public",
"static",
"function",
"combine",
"(",
"array",
"$",
"parts",
")",
":",
"array",
"{",
"$",
"assoc",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"parts",
"as",
"$",
"part",
")",
"{",
"$",
"name",
"=",
"strtolower",
"(",
"$",
"part",
"[",
"0"... | Combines an array of arrays into one associative array.
Each of the nested arrays should have one or two elements. The first
value will be used as the keys in the associative array, and the second
will be used as the values, or true if the nested array only contains one
element. Array keys are lowercased.
Example:
H... | [
"Combines",
"an",
"array",
"of",
"arrays",
"into",
"one",
"associative",
"array",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpFoundation/HeaderUtils.php#L84-L94 |
206,801 | symfony/symfony | src/Symfony/Component/HttpFoundation/HeaderUtils.php | HeaderUtils.toString | public static function toString(array $assoc, string $separator): string
{
$parts = [];
foreach ($assoc as $name => $value) {
if (true === $value) {
$parts[] = $name;
} else {
$parts[] = $name.'='.self::quote($value);
}
}
... | php | public static function toString(array $assoc, string $separator): string
{
$parts = [];
foreach ($assoc as $name => $value) {
if (true === $value) {
$parts[] = $name;
} else {
$parts[] = $name.'='.self::quote($value);
}
}
... | [
"public",
"static",
"function",
"toString",
"(",
"array",
"$",
"assoc",
",",
"string",
"$",
"separator",
")",
":",
"string",
"{",
"$",
"parts",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"assoc",
"as",
"$",
"name",
"=>",
"$",
"value",
")",
"{",
"if",... | Joins an associative array into a string for use in an HTTP header.
The key and value of each entry are joined with "=", and all entries
are joined with the specified separator and an additional space (for
readability). Values are quoted if necessary.
Example:
HeaderUtils::toString(["foo" => "abc", "bar" => true, "b... | [
"Joins",
"an",
"associative",
"array",
"into",
"a",
"string",
"for",
"use",
"in",
"an",
"HTTP",
"header",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpFoundation/HeaderUtils.php#L108-L120 |
206,802 | symfony/symfony | src/Symfony/Component/HttpClient/CurlHttpClient.php | CurlHttpClient.readRequestBody | private static function readRequestBody(int $length, \Closure $body, string &$buffer, bool &$eof): string
{
if (!$eof && \strlen($buffer) < $length) {
if (!\is_string($data = $body($length))) {
throw new TransportException(sprintf('The return value of the "body" option callback m... | php | private static function readRequestBody(int $length, \Closure $body, string &$buffer, bool &$eof): string
{
if (!$eof && \strlen($buffer) < $length) {
if (!\is_string($data = $body($length))) {
throw new TransportException(sprintf('The return value of the "body" option callback m... | [
"private",
"static",
"function",
"readRequestBody",
"(",
"int",
"$",
"length",
",",
"\\",
"Closure",
"$",
"body",
",",
"string",
"&",
"$",
"buffer",
",",
"bool",
"&",
"$",
"eof",
")",
":",
"string",
"{",
"if",
"(",
"!",
"$",
"eof",
"&&",
"\\",
"str... | Wraps the request's body callback to allow it to return strings longer than curl requested. | [
"Wraps",
"the",
"request",
"s",
"body",
"callback",
"to",
"allow",
"it",
"to",
"return",
"strings",
"longer",
"than",
"curl",
"requested",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpClient/CurlHttpClient.php#L354-L369 |
206,803 | symfony/symfony | src/Symfony/Component/HttpClient/CurlHttpClient.php | CurlHttpClient.createRedirectResolver | private static function createRedirectResolver(array $options, string $host): \Closure
{
$redirectHeaders = [];
if (0 < $options['max_redirects']) {
$redirectHeaders['host'] = $host;
$redirectHeaders['with_auth'] = $redirectHeaders['no_auth'] = array_filter($options['request_... | php | private static function createRedirectResolver(array $options, string $host): \Closure
{
$redirectHeaders = [];
if (0 < $options['max_redirects']) {
$redirectHeaders['host'] = $host;
$redirectHeaders['with_auth'] = $redirectHeaders['no_auth'] = array_filter($options['request_... | [
"private",
"static",
"function",
"createRedirectResolver",
"(",
"array",
"$",
"options",
",",
"string",
"$",
"host",
")",
":",
"\\",
"Closure",
"{",
"$",
"redirectHeaders",
"=",
"[",
"]",
";",
"if",
"(",
"0",
"<",
"$",
"options",
"[",
"'max_redirects'",
... | Resolves relative URLs on redirects and deals with authentication headers.
Work around CVE-2018-1000007: Authorization and Cookie headers should not follow redirects - fixed in Curl 7.64 | [
"Resolves",
"relative",
"URLs",
"on",
"redirects",
"and",
"deals",
"with",
"authentication",
"headers",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpClient/CurlHttpClient.php#L376-L402 |
206,804 | symfony/symfony | src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionController.php | ExceptionController.showAction | public function showAction($token)
{
if (null === $this->profiler) {
throw new NotFoundHttpException('The profiler must be enabled.');
}
$this->profiler->disable();
$exception = $this->profiler->loadProfile($token)->getCollector('exception')->getException();
$te... | php | public function showAction($token)
{
if (null === $this->profiler) {
throw new NotFoundHttpException('The profiler must be enabled.');
}
$this->profiler->disable();
$exception = $this->profiler->loadProfile($token)->getCollector('exception')->getException();
$te... | [
"public",
"function",
"showAction",
"(",
"$",
"token",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"profiler",
")",
"{",
"throw",
"new",
"NotFoundHttpException",
"(",
"'The profiler must be enabled.'",
")",
";",
"}",
"$",
"this",
"->",
"profiler",... | Renders the exception panel for the given token.
@param string $token The profiler token
@return Response A Response instance
@throws NotFoundHttpException | [
"Renders",
"the",
"exception",
"panel",
"for",
"the",
"given",
"token",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionController.php#L52-L81 |
206,805 | symfony/symfony | src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionController.php | ExceptionController.cssAction | public function cssAction($token)
{
if (null === $this->profiler) {
throw new NotFoundHttpException('The profiler must be enabled.');
}
$this->profiler->disable();
$exception = $this->profiler->loadProfile($token)->getCollector('exception')->getException();
$tem... | php | public function cssAction($token)
{
if (null === $this->profiler) {
throw new NotFoundHttpException('The profiler must be enabled.');
}
$this->profiler->disable();
$exception = $this->profiler->loadProfile($token)->getCollector('exception')->getException();
$tem... | [
"public",
"function",
"cssAction",
"(",
"$",
"token",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"profiler",
")",
"{",
"throw",
"new",
"NotFoundHttpException",
"(",
"'The profiler must be enabled.'",
")",
";",
"}",
"$",
"this",
"->",
"profiler",
... | Renders the exception panel stylesheet for the given token.
@param string $token The profiler token
@return Response A Response instance
@throws NotFoundHttpException | [
"Renders",
"the",
"exception",
"panel",
"stylesheet",
"for",
"the",
"given",
"token",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionController.php#L92-L110 |
206,806 | symfony/symfony | src/Symfony/Component/Console/Command/Command.php | Command.getProcessedHelp | public function getProcessedHelp()
{
$name = $this->name;
$isSingleCommand = $this->application && $this->application->isSingleCommand();
$placeholders = [
'%command.name%',
'%command.full_name%',
];
$replacements = [
$name,
$i... | php | public function getProcessedHelp()
{
$name = $this->name;
$isSingleCommand = $this->application && $this->application->isSingleCommand();
$placeholders = [
'%command.name%',
'%command.full_name%',
];
$replacements = [
$name,
$i... | [
"public",
"function",
"getProcessedHelp",
"(",
")",
"{",
"$",
"name",
"=",
"$",
"this",
"->",
"name",
";",
"$",
"isSingleCommand",
"=",
"$",
"this",
"->",
"application",
"&&",
"$",
"this",
"->",
"application",
"->",
"isSingleCommand",
"(",
")",
";",
"$",... | Returns the processed help for the command replacing the %command.name% and
%command.full_name% patterns with the real values dynamically.
@return string The processed help for the command | [
"Returns",
"the",
"processed",
"help",
"for",
"the",
"command",
"replacing",
"the",
"%command",
".",
"name%",
"and",
"%command",
".",
"full_name%",
"patterns",
"with",
"the",
"real",
"values",
"dynamically",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Command/Command.php#L525-L540 |
206,807 | symfony/symfony | src/Symfony/Component/Console/Command/Command.php | Command.getSynopsis | public function getSynopsis($short = false)
{
$key = $short ? 'short' : 'long';
if (!isset($this->synopsis[$key])) {
$this->synopsis[$key] = trim(sprintf('%s %s', $this->name, $this->definition->getSynopsis($short)));
}
return $this->synopsis[$key];
} | php | public function getSynopsis($short = false)
{
$key = $short ? 'short' : 'long';
if (!isset($this->synopsis[$key])) {
$this->synopsis[$key] = trim(sprintf('%s %s', $this->name, $this->definition->getSynopsis($short)));
}
return $this->synopsis[$key];
} | [
"public",
"function",
"getSynopsis",
"(",
"$",
"short",
"=",
"false",
")",
"{",
"$",
"key",
"=",
"$",
"short",
"?",
"'short'",
":",
"'long'",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"synopsis",
"[",
"$",
"key",
"]",
")",
")",
"{",
... | Returns the synopsis for the command.
@param bool $short Whether to show the short version of the synopsis (with options folded) or not
@return string The synopsis | [
"Returns",
"the",
"synopsis",
"for",
"the",
"command",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Command/Command.php#L583-L592 |
206,808 | symfony/symfony | src/Symfony/Component/Console/Command/Command.php | Command.addUsage | public function addUsage($usage)
{
if (0 !== strpos($usage, $this->name)) {
$usage = sprintf('%s %s', $this->name, $usage);
}
$this->usages[] = $usage;
return $this;
} | php | public function addUsage($usage)
{
if (0 !== strpos($usage, $this->name)) {
$usage = sprintf('%s %s', $this->name, $usage);
}
$this->usages[] = $usage;
return $this;
} | [
"public",
"function",
"addUsage",
"(",
"$",
"usage",
")",
"{",
"if",
"(",
"0",
"!==",
"strpos",
"(",
"$",
"usage",
",",
"$",
"this",
"->",
"name",
")",
")",
"{",
"$",
"usage",
"=",
"sprintf",
"(",
"'%s %s'",
",",
"$",
"this",
"->",
"name",
",",
... | Add a command usage example.
@param string $usage The usage, it'll be prefixed with the command name
@return $this | [
"Add",
"a",
"command",
"usage",
"example",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Command/Command.php#L601-L610 |
206,809 | symfony/symfony | src/Symfony/Component/Console/Command/Command.php | Command.getHelper | public function getHelper($name)
{
if (null === $this->helperSet) {
throw new LogicException(sprintf('Cannot retrieve helper "%s" because there is no HelperSet defined. Did you forget to add your command to the application or to set the application on the command using the setApplication() metho... | php | public function getHelper($name)
{
if (null === $this->helperSet) {
throw new LogicException(sprintf('Cannot retrieve helper "%s" because there is no HelperSet defined. Did you forget to add your command to the application or to set the application on the command using the setApplication() metho... | [
"public",
"function",
"getHelper",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"helperSet",
")",
"{",
"throw",
"new",
"LogicException",
"(",
"sprintf",
"(",
"'Cannot retrieve helper \"%s\" because there is no HelperSet defined. Did you for... | Gets a helper instance by name.
@param string $name The helper name
@return mixed The helper value
@throws LogicException if no HelperSet is defined
@throws InvalidArgumentException if the helper is not defined | [
"Gets",
"a",
"helper",
"instance",
"by",
"name",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Command/Command.php#L632-L639 |
206,810 | symfony/symfony | src/Symfony/Component/HttpFoundation/RedirectResponse.php | RedirectResponse.setTargetUrl | public function setTargetUrl($url)
{
if (empty($url)) {
throw new \InvalidArgumentException('Cannot redirect to an empty URL.');
}
$this->targetUrl = $url;
$this->setContent(
sprintf('<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
... | php | public function setTargetUrl($url)
{
if (empty($url)) {
throw new \InvalidArgumentException('Cannot redirect to an empty URL.');
}
$this->targetUrl = $url;
$this->setContent(
sprintf('<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
... | [
"public",
"function",
"setTargetUrl",
"(",
"$",
"url",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"url",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Cannot redirect to an empty URL.'",
")",
";",
"}",
"$",
"this",
"->",
"targetUrl",
... | Sets the redirect target of this response.
@param string $url The URL to redirect to
@return $this
@throws \InvalidArgumentException | [
"Sets",
"the",
"redirect",
"target",
"of",
"this",
"response",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpFoundation/RedirectResponse.php#L83-L108 |
206,811 | symfony/symfony | src/Symfony/Component/HttpKernel/HttpCache/AbstractSurrogate.php | AbstractSurrogate.removeFromControl | protected function removeFromControl(Response $response)
{
if (!$response->headers->has('Surrogate-Control')) {
return;
}
$value = $response->headers->get('Surrogate-Control');
$upperName = strtoupper($this->getName());
if (sprintf('content="%s/1.0"', $upperName... | php | protected function removeFromControl(Response $response)
{
if (!$response->headers->has('Surrogate-Control')) {
return;
}
$value = $response->headers->get('Surrogate-Control');
$upperName = strtoupper($this->getName());
if (sprintf('content="%s/1.0"', $upperName... | [
"protected",
"function",
"removeFromControl",
"(",
"Response",
"$",
"response",
")",
"{",
"if",
"(",
"!",
"$",
"response",
"->",
"headers",
"->",
"has",
"(",
"'Surrogate-Control'",
")",
")",
"{",
"return",
";",
"}",
"$",
"value",
"=",
"$",
"response",
"-... | Remove the Surrogate from the Surrogate-Control header. | [
"Remove",
"the",
"Surrogate",
"from",
"the",
"Surrogate",
"-",
"Control",
"header",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/HttpCache/AbstractSurrogate.php#L117-L133 |
206,812 | symfony/symfony | src/Symfony/Component/Form/Extension/Core/DataTransformer/DateIntervalToArrayTransformer.php | DateIntervalToArrayTransformer.transform | public function transform($dateInterval)
{
if (null === $dateInterval) {
return array_intersect_key(
[
'years' => '',
'months' => '',
'weeks' => '',
'days' => '',
'hours' => '',
... | php | public function transform($dateInterval)
{
if (null === $dateInterval) {
return array_intersect_key(
[
'years' => '',
'months' => '',
'weeks' => '',
'days' => '',
'hours' => '',
... | [
"public",
"function",
"transform",
"(",
"$",
"dateInterval",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"dateInterval",
")",
"{",
"return",
"array_intersect_key",
"(",
"[",
"'years'",
"=>",
"''",
",",
"'months'",
"=>",
"''",
",",
"'weeks'",
"=>",
"''",
","... | Transforms a normalized date interval into an interval array.
@param \DateInterval $dateInterval Normalized date interval
@return array Interval array
@throws UnexpectedTypeException if the given value is not a \DateInterval instance | [
"Transforms",
"a",
"normalized",
"date",
"interval",
"into",
"an",
"interval",
"array",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateIntervalToArrayTransformer.php#L67-L102 |
206,813 | symfony/symfony | src/Symfony/Component/Form/Extension/Validator/EventListener/ValidationListener.php | ValidationListener.validateForm | public function validateForm(FormEvent $event)
{
$form = $event->getForm();
if ($form->isRoot()) {
// Form groups are validated internally (FormValidator). Here we don't set groups as they are retrieved into the validator.
foreach ($this->validator->validate($form) as $viola... | php | public function validateForm(FormEvent $event)
{
$form = $event->getForm();
if ($form->isRoot()) {
// Form groups are validated internally (FormValidator). Here we don't set groups as they are retrieved into the validator.
foreach ($this->validator->validate($form) as $viola... | [
"public",
"function",
"validateForm",
"(",
"FormEvent",
"$",
"event",
")",
"{",
"$",
"form",
"=",
"$",
"event",
"->",
"getForm",
"(",
")",
";",
"if",
"(",
"$",
"form",
"->",
"isRoot",
"(",
")",
")",
"{",
"// Form groups are validated internally (FormValidato... | Validates the form and its domain object.
@param FormEvent $event The event object | [
"Validates",
"the",
"form",
"and",
"its",
"domain",
"object",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Extension/Validator/EventListener/ValidationListener.php#L49-L64 |
206,814 | symfony/symfony | src/Symfony/Component/HttpKernel/Fragment/HIncludeFragmentRenderer.php | HIncludeFragmentRenderer.setTemplating | public function setTemplating($templating)
{
if (null !== $templating && !$templating instanceof EngineInterface && !$templating instanceof Environment) {
throw new \InvalidArgumentException('The hinclude rendering strategy needs an instance of Twig\Environment or Symfony\Component\Templating\En... | php | public function setTemplating($templating)
{
if (null !== $templating && !$templating instanceof EngineInterface && !$templating instanceof Environment) {
throw new \InvalidArgumentException('The hinclude rendering strategy needs an instance of Twig\Environment or Symfony\Component\Templating\En... | [
"public",
"function",
"setTemplating",
"(",
"$",
"templating",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"templating",
"&&",
"!",
"$",
"templating",
"instanceof",
"EngineInterface",
"&&",
"!",
"$",
"templating",
"instanceof",
"Environment",
")",
"{",
"throw",
... | Sets the templating engine to use to render the default content.
@param EngineInterface|Environment|null $templating An EngineInterface or an Environment instance
@throws \InvalidArgumentException | [
"Sets",
"the",
"templating",
"engine",
"to",
"use",
"to",
"render",
"the",
"default",
"content",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/Fragment/HIncludeFragmentRenderer.php#L56-L67 |
206,815 | symfony/symfony | src/Symfony/Component/Config/Definition/Dumper/XmlReferenceDumper.php | XmlReferenceDumper.writeValue | private function writeValue($value): string
{
if ('%%%%not_defined%%%%' === $value) {
return '';
}
if (\is_string($value) || is_numeric($value)) {
return $value;
}
if (false === $value) {
return 'false';
}
if (true === $v... | php | private function writeValue($value): string
{
if ('%%%%not_defined%%%%' === $value) {
return '';
}
if (\is_string($value) || is_numeric($value)) {
return $value;
}
if (false === $value) {
return 'false';
}
if (true === $v... | [
"private",
"function",
"writeValue",
"(",
"$",
"value",
")",
":",
"string",
"{",
"if",
"(",
"'%%%%not_defined%%%%'",
"===",
"$",
"value",
")",
"{",
"return",
"''",
";",
"}",
"if",
"(",
"\\",
"is_string",
"(",
"$",
"value",
")",
"||",
"is_numeric",
"(",... | Renders the string conversion of the value.
@param mixed $value | [
"Renders",
"the",
"string",
"conversion",
"of",
"the",
"value",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Config/Definition/Dumper/XmlReferenceDumper.php#L270-L299 |
206,816 | symfony/symfony | src/Symfony/Component/DependencyInjection/Loader/Configurator/DefaultsConfigurator.php | DefaultsConfigurator.tag | final public function tag(string $name, array $attributes = [])
{
if ('' === $name) {
throw new InvalidArgumentException('The tag name in "_defaults" must be a non-empty string.');
}
foreach ($attributes as $attribute => $value) {
if (null !== $value && !is_scalar($v... | php | final public function tag(string $name, array $attributes = [])
{
if ('' === $name) {
throw new InvalidArgumentException('The tag name in "_defaults" must be a non-empty string.');
}
foreach ($attributes as $attribute => $value) {
if (null !== $value && !is_scalar($v... | [
"final",
"public",
"function",
"tag",
"(",
"string",
"$",
"name",
",",
"array",
"$",
"attributes",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"''",
"===",
"$",
"name",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'The tag name in \"_defaults\" must b... | Adds a tag for this definition.
@return $this
@throws InvalidArgumentException when an invalid tag name or attribute is provided | [
"Adds",
"a",
"tag",
"for",
"this",
"definition",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DependencyInjection/Loader/Configurator/DefaultsConfigurator.php#L45-L60 |
206,817 | symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php | ControllerTrait.json | protected function json($data, int $status = 200, array $headers = [], array $context = []): JsonResponse
{
if ($this->container->has('serializer')) {
$json = $this->container->get('serializer')->serialize($data, 'json', array_merge([
'json_encode_options' => JsonResponse::DEFAUL... | php | protected function json($data, int $status = 200, array $headers = [], array $context = []): JsonResponse
{
if ($this->container->has('serializer')) {
$json = $this->container->get('serializer')->serialize($data, 'json', array_merge([
'json_encode_options' => JsonResponse::DEFAUL... | [
"protected",
"function",
"json",
"(",
"$",
"data",
",",
"int",
"$",
"status",
"=",
"200",
",",
"array",
"$",
"headers",
"=",
"[",
"]",
",",
"array",
"$",
"context",
"=",
"[",
"]",
")",
":",
"JsonResponse",
"{",
"if",
"(",
"$",
"this",
"->",
"cont... | Returns a JsonResponse that uses the serializer component if enabled, or json_encode.
@final | [
"Returns",
"a",
"JsonResponse",
"that",
"uses",
"the",
"serializer",
"component",
"if",
"enabled",
"or",
"json_encode",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php#L122-L133 |
206,818 | symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php | ControllerTrait.file | protected function file($file, string $fileName = null, string $disposition = ResponseHeaderBag::DISPOSITION_ATTACHMENT): BinaryFileResponse
{
$response = new BinaryFileResponse($file);
$response->setContentDisposition($disposition, null === $fileName ? $response->getFile()->getFilename() : $fileNam... | php | protected function file($file, string $fileName = null, string $disposition = ResponseHeaderBag::DISPOSITION_ATTACHMENT): BinaryFileResponse
{
$response = new BinaryFileResponse($file);
$response->setContentDisposition($disposition, null === $fileName ? $response->getFile()->getFilename() : $fileNam... | [
"protected",
"function",
"file",
"(",
"$",
"file",
",",
"string",
"$",
"fileName",
"=",
"null",
",",
"string",
"$",
"disposition",
"=",
"ResponseHeaderBag",
"::",
"DISPOSITION_ATTACHMENT",
")",
":",
"BinaryFileResponse",
"{",
"$",
"response",
"=",
"new",
"Bina... | Returns a BinaryFileResponse object with original or customized file name and disposition header.
@param \SplFileInfo|string $file File object or path to file to be sent as response
@final | [
"Returns",
"a",
"BinaryFileResponse",
"object",
"with",
"original",
"or",
"customized",
"file",
"name",
"and",
"disposition",
"header",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php#L142-L148 |
206,819 | symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php | ControllerTrait.addFlash | protected function addFlash(string $type, string $message)
{
if (!$this->container->has('session')) {
throw new \LogicException('You can not use the addFlash method if sessions are disabled. Enable them in "config/packages/framework.yaml".');
}
$this->container->get('session')->... | php | protected function addFlash(string $type, string $message)
{
if (!$this->container->has('session')) {
throw new \LogicException('You can not use the addFlash method if sessions are disabled. Enable them in "config/packages/framework.yaml".');
}
$this->container->get('session')->... | [
"protected",
"function",
"addFlash",
"(",
"string",
"$",
"type",
",",
"string",
"$",
"message",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"container",
"->",
"has",
"(",
"'session'",
")",
")",
"{",
"throw",
"new",
"\\",
"LogicException",
"(",
"'You c... | Adds a flash message to the current session for type.
@throws \LogicException
@final | [
"Adds",
"a",
"flash",
"message",
"to",
"the",
"current",
"session",
"for",
"type",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php#L157-L164 |
206,820 | symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php | ControllerTrait.denyAccessUnlessGranted | protected function denyAccessUnlessGranted($attributes, $subject = null, string $message = 'Access Denied.')
{
if (!$this->isGranted($attributes, $subject)) {
$exception = $this->createAccessDeniedException($message);
$exception->setAttributes($attributes);
$exception->se... | php | protected function denyAccessUnlessGranted($attributes, $subject = null, string $message = 'Access Denied.')
{
if (!$this->isGranted($attributes, $subject)) {
$exception = $this->createAccessDeniedException($message);
$exception->setAttributes($attributes);
$exception->se... | [
"protected",
"function",
"denyAccessUnlessGranted",
"(",
"$",
"attributes",
",",
"$",
"subject",
"=",
"null",
",",
"string",
"$",
"message",
"=",
"'Access Denied.'",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isGranted",
"(",
"$",
"attributes",
",",
"$"... | Throws an exception unless the attributes are granted against the current authentication token and optionally
supplied subject.
@throws AccessDeniedException
@final | [
"Throws",
"an",
"exception",
"unless",
"the",
"attributes",
"are",
"granted",
"against",
"the",
"current",
"authentication",
"token",
"and",
"optionally",
"supplied",
"subject",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php#L190-L199 |
206,821 | symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php | ControllerTrait.dispatchMessage | protected function dispatchMessage($message): Envelope
{
if (!$this->container->has('messenger.default_bus')) {
$message = class_exists(Envelope::class) ? 'You need to define the "messenger.default_bus" configuration option.' : 'Try running "composer require symfony/messenger".';
thr... | php | protected function dispatchMessage($message): Envelope
{
if (!$this->container->has('messenger.default_bus')) {
$message = class_exists(Envelope::class) ? 'You need to define the "messenger.default_bus" configuration option.' : 'Try running "composer require symfony/messenger".';
thr... | [
"protected",
"function",
"dispatchMessage",
"(",
"$",
"message",
")",
":",
"Envelope",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"container",
"->",
"has",
"(",
"'messenger.default_bus'",
")",
")",
"{",
"$",
"message",
"=",
"class_exists",
"(",
"Envelope",
":... | Dispatches a message to the bus.
@param object|Envelope $message The message or the message pre-wrapped in an envelope
@final | [
"Dispatches",
"a",
"message",
"to",
"the",
"bus",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php#L404-L412 |
206,822 | symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php | ControllerTrait.addLink | protected function addLink(Request $request, Link $link)
{
if (!class_exists(AddLinkHeaderListener::class)) {
throw new \LogicException('You can not use the "addLink" method if the WebLink component is not available. Try running "composer require symfony/web-link".');
}
if (null... | php | protected function addLink(Request $request, Link $link)
{
if (!class_exists(AddLinkHeaderListener::class)) {
throw new \LogicException('You can not use the "addLink" method if the WebLink component is not available. Try running "composer require symfony/web-link".');
}
if (null... | [
"protected",
"function",
"addLink",
"(",
"Request",
"$",
"request",
",",
"Link",
"$",
"link",
")",
"{",
"if",
"(",
"!",
"class_exists",
"(",
"AddLinkHeaderListener",
"::",
"class",
")",
")",
"{",
"throw",
"new",
"\\",
"LogicException",
"(",
"'You can not use... | Adds a Link HTTP header to the current response.
@see https://tools.ietf.org/html/rfc5988
@final | [
"Adds",
"a",
"Link",
"HTTP",
"header",
"to",
"the",
"current",
"response",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php#L421-L434 |
206,823 | symfony/symfony | src/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeGuesser.php | MimeTypeGuesser.guess | public function guess($path)
{
if (!is_file($path)) {
throw new FileNotFoundException($path);
}
if (!is_readable($path)) {
throw new AccessDeniedException($path);
}
foreach ($this->guessers as $guesser) {
if (null !== $mimeType = $guesser... | php | public function guess($path)
{
if (!is_file($path)) {
throw new FileNotFoundException($path);
}
if (!is_readable($path)) {
throw new AccessDeniedException($path);
}
foreach ($this->guessers as $guesser) {
if (null !== $mimeType = $guesser... | [
"public",
"function",
"guess",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"!",
"is_file",
"(",
"$",
"path",
")",
")",
"{",
"throw",
"new",
"FileNotFoundException",
"(",
"$",
"path",
")",
";",
"}",
"if",
"(",
"!",
"is_readable",
"(",
"$",
"path",
")",
... | Tries to guess the mime type of the given file.
The file is passed to each registered mime type guesser in reverse order
of their registration (last registered is queried first). Once a guesser
returns a value that is not NULL, this method terminates and returns the
value.
@param string $path The path to the file
@r... | [
"Tries",
"to",
"guess",
"the",
"mime",
"type",
"of",
"the",
"given",
"file",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeGuesser.php#L116-L135 |
206,824 | symfony/symfony | src/Symfony/Component/Serializer/Encoder/JsonEncode.php | JsonEncode.encode | public function encode($data, $format, array $context = [])
{
$jsonEncodeOptions = $context[self::OPTIONS] ?? $this->defaultContext[self::OPTIONS];
$encodedJson = json_encode($data, $jsonEncodeOptions);
if (JSON_ERROR_NONE !== json_last_error() && (false === $encodedJson || !($jsonEncodeOpt... | php | public function encode($data, $format, array $context = [])
{
$jsonEncodeOptions = $context[self::OPTIONS] ?? $this->defaultContext[self::OPTIONS];
$encodedJson = json_encode($data, $jsonEncodeOptions);
if (JSON_ERROR_NONE !== json_last_error() && (false === $encodedJson || !($jsonEncodeOpt... | [
"public",
"function",
"encode",
"(",
"$",
"data",
",",
"$",
"format",
",",
"array",
"$",
"context",
"=",
"[",
"]",
")",
"{",
"$",
"jsonEncodeOptions",
"=",
"$",
"context",
"[",
"self",
"::",
"OPTIONS",
"]",
"??",
"$",
"this",
"->",
"defaultContext",
... | Encodes PHP data to a JSON string.
{@inheritdoc} | [
"Encodes",
"PHP",
"data",
"to",
"a",
"JSON",
"string",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Serializer/Encoder/JsonEncode.php#L48-L58 |
206,825 | symfony/symfony | src/Symfony/Bundle/WebProfilerBundle/DependencyInjection/WebProfilerExtension.php | WebProfilerExtension.load | public function load(array $configs, ContainerBuilder $container)
{
$configuration = $this->getConfiguration($configs, $container);
$config = $this->processConfiguration($configuration, $configs);
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
... | php | public function load(array $configs, ContainerBuilder $container)
{
$configuration = $this->getConfiguration($configs, $container);
$config = $this->processConfiguration($configuration, $configs);
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
... | [
"public",
"function",
"load",
"(",
"array",
"$",
"configs",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"configuration",
"=",
"$",
"this",
"->",
"getConfiguration",
"(",
"$",
"configs",
",",
"$",
"container",
")",
";",
"$",
"config",
"=",
"... | Loads the web profiler configuration.
@param array $configs An array of configuration settings
@param ContainerBuilder $container A ContainerBuilder instance | [
"Loads",
"the",
"web",
"profiler",
"configuration",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/WebProfilerBundle/DependencyInjection/WebProfilerExtension.php#L43-L62 |
206,826 | symfony/symfony | src/Symfony/Component/Serializer/Normalizer/PropertyNormalizer.php | PropertyNormalizer.supports | private function supports(string $class): bool
{
$class = new \ReflectionClass($class);
// We look for at least one non-static property
do {
foreach ($class->getProperties() as $property) {
if (!$property->isStatic()) {
return true;
... | php | private function supports(string $class): bool
{
$class = new \ReflectionClass($class);
// We look for at least one non-static property
do {
foreach ($class->getProperties() as $property) {
if (!$property->isStatic()) {
return true;
... | [
"private",
"function",
"supports",
"(",
"string",
"$",
"class",
")",
":",
"bool",
"{",
"$",
"class",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"class",
")",
";",
"// We look for at least one non-static property",
"do",
"{",
"foreach",
"(",
"$",
"class",
... | Checks if the given class has any non-static property. | [
"Checks",
"if",
"the",
"given",
"class",
"has",
"any",
"non",
"-",
"static",
"property",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Serializer/Normalizer/PropertyNormalizer.php#L60-L74 |
206,827 | symfony/symfony | src/Symfony/Component/Form/FormConfigBuilder.php | FormConfigBuilder.validateName | public static function validateName($name)
{
if (null !== $name && !\is_string($name) && !\is_int($name)) {
throw new UnexpectedTypeException($name, 'string, integer or null');
}
if (!self::isValidName($name)) {
throw new InvalidArgumentException(sprintf('The name "%... | php | public static function validateName($name)
{
if (null !== $name && !\is_string($name) && !\is_int($name)) {
throw new UnexpectedTypeException($name, 'string, integer or null');
}
if (!self::isValidName($name)) {
throw new InvalidArgumentException(sprintf('The name "%... | [
"public",
"static",
"function",
"validateName",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"name",
"&&",
"!",
"\\",
"is_string",
"(",
"$",
"name",
")",
"&&",
"!",
"\\",
"is_int",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"new",
"U... | Validates whether the given variable is a valid form name.
@param string|int|null $name The tested form name
@throws UnexpectedTypeException if the name is not a string or an integer
@throws InvalidArgumentException if the name contains invalid characters | [
"Validates",
"whether",
"the",
"given",
"variable",
"is",
"a",
"valid",
"form",
"name",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/FormConfigBuilder.php#L775-L784 |
206,828 | symfony/symfony | src/Symfony/Component/DependencyInjection/Loader/FileLoader.php | FileLoader.registerClasses | public function registerClasses(Definition $prototype, $namespace, $resource, $exclude = null)
{
if ('\\' !== substr($namespace, -1)) {
throw new InvalidArgumentException(sprintf('Namespace prefix must end with a "\\": %s.', $namespace));
}
if (!preg_match('/^(?:[a-zA-Z_\x7f-\xff... | php | public function registerClasses(Definition $prototype, $namespace, $resource, $exclude = null)
{
if ('\\' !== substr($namespace, -1)) {
throw new InvalidArgumentException(sprintf('Namespace prefix must end with a "\\": %s.', $namespace));
}
if (!preg_match('/^(?:[a-zA-Z_\x7f-\xff... | [
"public",
"function",
"registerClasses",
"(",
"Definition",
"$",
"prototype",
",",
"$",
"namespace",
",",
"$",
"resource",
",",
"$",
"exclude",
"=",
"null",
")",
"{",
"if",
"(",
"'\\\\'",
"!==",
"substr",
"(",
"$",
"namespace",
",",
"-",
"1",
")",
")",... | Registers a set of classes as services using PSR-4 for discovery.
@param Definition $prototype A definition to use as template
@param string $namespace The namespace prefix of classes in the scanned directory
@param string $resource The directory to look for classes, glob-pattern... | [
"Registers",
"a",
"set",
"of",
"classes",
"as",
"services",
"using",
"PSR",
"-",
"4",
"for",
"discovery",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DependencyInjection/Loader/FileLoader.php#L48-L84 |
206,829 | symfony/symfony | src/Symfony/Component/DependencyInjection/Loader/FileLoader.php | FileLoader.setDefinition | protected function setDefinition($id, Definition $definition)
{
$this->container->removeBindings($id);
if ($this->isLoadingInstanceof) {
if (!$definition instanceof ChildDefinition) {
throw new InvalidArgumentException(sprintf('Invalid type definition "%s": ChildDefiniti... | php | protected function setDefinition($id, Definition $definition)
{
$this->container->removeBindings($id);
if ($this->isLoadingInstanceof) {
if (!$definition instanceof ChildDefinition) {
throw new InvalidArgumentException(sprintf('Invalid type definition "%s": ChildDefiniti... | [
"protected",
"function",
"setDefinition",
"(",
"$",
"id",
",",
"Definition",
"$",
"definition",
")",
"{",
"$",
"this",
"->",
"container",
"->",
"removeBindings",
"(",
"$",
"id",
")",
";",
"if",
"(",
"$",
"this",
"->",
"isLoadingInstanceof",
")",
"{",
"if... | Registers a definition in the container with its instanceof-conditionals.
@param string $id
@param Definition $definition | [
"Registers",
"a",
"definition",
"in",
"the",
"container",
"with",
"its",
"instanceof",
"-",
"conditionals",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DependencyInjection/Loader/FileLoader.php#L92-L104 |
206,830 | symfony/symfony | src/Symfony/Component/Validator/Constraints/EmailValidator.php | EmailValidator.checkHost | private function checkHost(string $host): bool
{
return '' !== $host && ($this->checkMX($host) || (checkdnsrr($host, 'A') || checkdnsrr($host, 'AAAA')));
} | php | private function checkHost(string $host): bool
{
return '' !== $host && ($this->checkMX($host) || (checkdnsrr($host, 'A') || checkdnsrr($host, 'AAAA')));
} | [
"private",
"function",
"checkHost",
"(",
"string",
"$",
"host",
")",
":",
"bool",
"{",
"return",
"''",
"!==",
"$",
"host",
"&&",
"(",
"$",
"this",
"->",
"checkMX",
"(",
"$",
"host",
")",
"||",
"(",
"checkdnsrr",
"(",
"$",
"host",
",",
"'A'",
")",
... | Check if one of MX, A or AAAA DNS RR exists. | [
"Check",
"if",
"one",
"of",
"MX",
"A",
"or",
"AAAA",
"DNS",
"RR",
"exists",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Validator/Constraints/EmailValidator.php#L170-L173 |
206,831 | symfony/symfony | src/Symfony/Component/Routing/Loader/ObjectRouteLoader.php | ObjectRouteLoader.load | public function load($resource, $type = null)
{
if (!preg_match('/^[^\:]+(?:::?(?:[^\:]+))?$/', $resource)) {
throw new \InvalidArgumentException(sprintf('Invalid resource "%s" passed to the "service" route loader: use the format "service::method" or "service" if your service has an "__invoke" m... | php | public function load($resource, $type = null)
{
if (!preg_match('/^[^\:]+(?:::?(?:[^\:]+))?$/', $resource)) {
throw new \InvalidArgumentException(sprintf('Invalid resource "%s" passed to the "service" route loader: use the format "service::method" or "service" if your service has an "__invoke" m... | [
"public",
"function",
"load",
"(",
"$",
"resource",
",",
"$",
"type",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"preg_match",
"(",
"'/^[^\\:]+(?:::?(?:[^\\:]+))?$/'",
",",
"$",
"resource",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
... | Calls the service that will load the routes.
@param string $resource Some value that will resolve to a callable
@param string|null $type The resource type
@return RouteCollection | [
"Calls",
"the",
"service",
"that",
"will",
"load",
"the",
"routes",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Routing/Loader/ObjectRouteLoader.php#L45-L82 |
206,832 | symfony/symfony | src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php | RecursiveContextualValidator.validateObject | private function validateObject($object, $propertyPath, array $groups, $traversalStrategy, ExecutionContextInterface $context)
{
try {
$classMetadata = $this->metadataFactory->getMetadataFor($object);
if (!$classMetadata instanceof ClassMetadataInterface) {
throw new... | php | private function validateObject($object, $propertyPath, array $groups, $traversalStrategy, ExecutionContextInterface $context)
{
try {
$classMetadata = $this->metadataFactory->getMetadataFor($object);
if (!$classMetadata instanceof ClassMetadataInterface) {
throw new... | [
"private",
"function",
"validateObject",
"(",
"$",
"object",
",",
"$",
"propertyPath",
",",
"array",
"$",
"groups",
",",
"$",
"traversalStrategy",
",",
"ExecutionContextInterface",
"$",
"context",
")",
"{",
"try",
"{",
"$",
"classMetadata",
"=",
"$",
"this",
... | Validates an object against the constraints defined for its class.
If no metadata is available for the class, but the class is an instance
of {@link \Traversable} and the selected traversal strategy allows
traversal, the object will be iterated and each nested object will be
validated instead.
@param object ... | [
"Validates",
"an",
"object",
"against",
"the",
"constraints",
"defined",
"for",
"its",
"class",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php#L313-L350 |
206,833 | symfony/symfony | src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php | RecursiveContextualValidator.validateEachObjectIn | private function validateEachObjectIn($collection, $propertyPath, array $groups, ExecutionContextInterface $context)
{
foreach ($collection as $key => $value) {
if (\is_array($value)) {
// Also traverse nested arrays
$this->validateEachObjectIn(
... | php | private function validateEachObjectIn($collection, $propertyPath, array $groups, ExecutionContextInterface $context)
{
foreach ($collection as $key => $value) {
if (\is_array($value)) {
// Also traverse nested arrays
$this->validateEachObjectIn(
... | [
"private",
"function",
"validateEachObjectIn",
"(",
"$",
"collection",
",",
"$",
"propertyPath",
",",
"array",
"$",
"groups",
",",
"ExecutionContextInterface",
"$",
"context",
")",
"{",
"foreach",
"(",
"$",
"collection",
"as",
"$",
"key",
"=>",
"$",
"value",
... | Validates each object in a collection against the constraints defined
for their classes.
Nested arrays are also iterated.
@param iterable $collection The collection
@param string $propertyPath The current property path
@param (string|GroupSequence)[] $groups The validated ... | [
"Validates",
"each",
"object",
"in",
"a",
"collection",
"against",
"the",
"constraints",
"defined",
"for",
"their",
"classes",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php#L363-L389 |
206,834 | symfony/symfony | src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php | RecursiveContextualValidator.validateGenericNode | private function validateGenericNode($value, $object, $cacheKey, MetadataInterface $metadata = null, $propertyPath, array $groups, $cascadedGroups, $traversalStrategy, ExecutionContextInterface $context)
{
$context->setNode($value, $object, $metadata, $propertyPath);
foreach ($groups as $key => $gr... | php | private function validateGenericNode($value, $object, $cacheKey, MetadataInterface $metadata = null, $propertyPath, array $groups, $cascadedGroups, $traversalStrategy, ExecutionContextInterface $context)
{
$context->setNode($value, $object, $metadata, $propertyPath);
foreach ($groups as $key => $gr... | [
"private",
"function",
"validateGenericNode",
"(",
"$",
"value",
",",
"$",
"object",
",",
"$",
"cacheKey",
",",
"MetadataInterface",
"$",
"metadata",
"=",
"null",
",",
"$",
"propertyPath",
",",
"array",
"$",
"groups",
",",
"$",
"cascadedGroups",
",",
"$",
... | Validates a node that is not a class node.
Currently, two such node types exist:
- property nodes, which consist of the value of an object's
property together with a {@link PropertyMetadataInterface} instance
- generic nodes, which consist of a value and some arbitrary
constraints defined in a {@link MetadataInterfac... | [
"Validates",
"a",
"node",
"that",
"is",
"not",
"a",
"class",
"node",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php#L619-L702 |
206,835 | symfony/symfony | src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php | RecursiveContextualValidator.stepThroughGroupSequence | private function stepThroughGroupSequence($value, $object, $cacheKey, MetadataInterface $metadata = null, $propertyPath, $traversalStrategy, GroupSequence $groupSequence, $cascadedGroup, ExecutionContextInterface $context)
{
$violationCount = \count($context->getViolations());
$cascadedGroups = $cas... | php | private function stepThroughGroupSequence($value, $object, $cacheKey, MetadataInterface $metadata = null, $propertyPath, $traversalStrategy, GroupSequence $groupSequence, $cascadedGroup, ExecutionContextInterface $context)
{
$violationCount = \count($context->getViolations());
$cascadedGroups = $cas... | [
"private",
"function",
"stepThroughGroupSequence",
"(",
"$",
"value",
",",
"$",
"object",
",",
"$",
"cacheKey",
",",
"MetadataInterface",
"$",
"metadata",
"=",
"null",
",",
"$",
"propertyPath",
",",
"$",
"traversalStrategy",
",",
"GroupSequence",
"$",
"groupSequ... | Sequentially validates a node's value in each group of a group sequence.
If any of the constraints generates a violation, subsequent groups in the
group sequence are skipped.
@param mixed $value The validated value
@param object|null $object The current object
... | [
"Sequentially",
"validates",
"a",
"node",
"s",
"value",
"in",
"each",
"group",
"of",
"a",
"group",
"sequence",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php#L727-L765 |
206,836 | symfony/symfony | src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php | RecursiveContextualValidator.validateInGroup | private function validateInGroup($value, $cacheKey, MetadataInterface $metadata, $group, ExecutionContextInterface $context)
{
$context->setGroup($group);
foreach ($metadata->findConstraints($group) as $constraint) {
// Prevent duplicate validation of constraints, in the case
... | php | private function validateInGroup($value, $cacheKey, MetadataInterface $metadata, $group, ExecutionContextInterface $context)
{
$context->setGroup($group);
foreach ($metadata->findConstraints($group) as $constraint) {
// Prevent duplicate validation of constraints, in the case
... | [
"private",
"function",
"validateInGroup",
"(",
"$",
"value",
",",
"$",
"cacheKey",
",",
"MetadataInterface",
"$",
"metadata",
",",
"$",
"group",
",",
"ExecutionContextInterface",
"$",
"context",
")",
"{",
"$",
"context",
"->",
"setGroup",
"(",
"$",
"group",
... | Validates a node's value against all constraints in the given group.
@param mixed $value The validated value
@param string $cacheKey The key for caching the
validated value
@param MetadataInterface $metadata The metadata of the value
@param string $g... | [
"Validates",
"a",
"node",
"s",
"value",
"against",
"all",
"constraints",
"in",
"the",
"given",
"group",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php#L777-L811 |
206,837 | symfony/symfony | src/Symfony/Component/Security/Http/ParameterBagUtils.php | ParameterBagUtils.getRequestParameterValue | public static function getRequestParameterValue(Request $request, $path)
{
if (false === $pos = strpos($path, '[')) {
return $request->get($path);
}
$root = substr($path, 0, $pos);
if (null === $value = $request->get($root)) {
return;
}
if (... | php | public static function getRequestParameterValue(Request $request, $path)
{
if (false === $pos = strpos($path, '[')) {
return $request->get($path);
}
$root = substr($path, 0, $pos);
if (null === $value = $request->get($root)) {
return;
}
if (... | [
"public",
"static",
"function",
"getRequestParameterValue",
"(",
"Request",
"$",
"request",
",",
"$",
"path",
")",
"{",
"if",
"(",
"false",
"===",
"$",
"pos",
"=",
"strpos",
"(",
"$",
"path",
",",
"'['",
")",
")",
"{",
"return",
"$",
"request",
"->",
... | Returns a request "parameter" value.
Paths like foo[bar] will be evaluated to find deeper items in nested data structures.
@param Request $request The request
@param string $path The key
@return mixed
@throws InvalidArgumentException when the given path is malformed | [
"Returns",
"a",
"request",
"parameter",
"value",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Security/Http/ParameterBagUtils.php#L74-L95 |
206,838 | symfony/symfony | src/Symfony/Component/Routing/Router.php | Router.getOption | public function getOption($key)
{
if (!\array_key_exists($key, $this->options)) {
throw new \InvalidArgumentException(sprintf('The Router does not support the "%s" option.', $key));
}
$this->checkDeprecatedOption($key);
return $this->options[$key];
} | php | public function getOption($key)
{
if (!\array_key_exists($key, $this->options)) {
throw new \InvalidArgumentException(sprintf('The Router does not support the "%s" option.', $key));
}
$this->checkDeprecatedOption($key);
return $this->options[$key];
} | [
"public",
"function",
"getOption",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"!",
"\\",
"array_key_exists",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"options",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'The Router... | Gets an option value.
@param string $key The key
@return mixed The value
@throws \InvalidArgumentException | [
"Gets",
"an",
"option",
"value",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Routing/Router.php#L195-L204 |
206,839 | symfony/symfony | src/Symfony/Component/Routing/Router.php | Router.getGenerator | public function getGenerator()
{
if (null !== $this->generator) {
return $this->generator;
}
$compiled = is_a($this->options['generator_class'], CompiledUrlGenerator::class, true) && UrlGenerator::class === $this->options['generator_base_class'];
if (null === $this->opt... | php | public function getGenerator()
{
if (null !== $this->generator) {
return $this->generator;
}
$compiled = is_a($this->options['generator_class'], CompiledUrlGenerator::class, true) && UrlGenerator::class === $this->options['generator_base_class'];
if (null === $this->opt... | [
"public",
"function",
"getGenerator",
"(",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"generator",
")",
"{",
"return",
"$",
"this",
"->",
"generator",
";",
"}",
"$",
"compiled",
"=",
"is_a",
"(",
"$",
"this",
"->",
"options",
"[",
"'gener... | Gets the UrlGenerator instance associated with this Router.
@return UrlGeneratorInterface A UrlGeneratorInterface instance | [
"Gets",
"the",
"UrlGenerator",
"instance",
"associated",
"with",
"this",
"Router",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Routing/Router.php#L341-L385 |
206,840 | symfony/symfony | src/Symfony/Component/HttpKernel/DataCollector/TimeDataCollector.php | TimeDataCollector.setEvents | public function setEvents(array $events)
{
foreach ($events as $event) {
$event->ensureStopped();
}
$this->data['events'] = $events;
} | php | public function setEvents(array $events)
{
foreach ($events as $event) {
$event->ensureStopped();
}
$this->data['events'] = $events;
} | [
"public",
"function",
"setEvents",
"(",
"array",
"$",
"events",
")",
"{",
"foreach",
"(",
"$",
"events",
"as",
"$",
"event",
")",
"{",
"$",
"event",
"->",
"ensureStopped",
"(",
")",
";",
"}",
"$",
"this",
"->",
"data",
"[",
"'events'",
"]",
"=",
"$... | Sets the request events.
@param array $events The request events | [
"Sets",
"the",
"request",
"events",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/DataCollector/TimeDataCollector.php#L82-L89 |
206,841 | symfony/symfony | src/Symfony/Component/HttpKernel/DataCollector/TimeDataCollector.php | TimeDataCollector.getDuration | public function getDuration()
{
if (!isset($this->data['events']['__section__'])) {
return 0;
}
$lastEvent = $this->data['events']['__section__'];
return $lastEvent->getOrigin() + $lastEvent->getDuration() - $this->getStartTime();
} | php | public function getDuration()
{
if (!isset($this->data['events']['__section__'])) {
return 0;
}
$lastEvent = $this->data['events']['__section__'];
return $lastEvent->getOrigin() + $lastEvent->getDuration() - $this->getStartTime();
} | [
"public",
"function",
"getDuration",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"data",
"[",
"'events'",
"]",
"[",
"'__section__'",
"]",
")",
")",
"{",
"return",
"0",
";",
"}",
"$",
"lastEvent",
"=",
"$",
"this",
"->",
"data",
... | Gets the request elapsed time.
@return float The elapsed time | [
"Gets",
"the",
"request",
"elapsed",
"time",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/DataCollector/TimeDataCollector.php#L106-L115 |
206,842 | symfony/symfony | src/Symfony/Component/Ldap/Adapter/AbstractConnection.php | AbstractConnection.configureOptions | protected function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'host' => 'localhost',
'version' => 3,
'connection_string' => null,
'encryption' => 'none',
'options' => [],
]);
$resolver->setDefault('port'... | php | protected function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'host' => 'localhost',
'version' => 3,
'connection_string' => null,
'encryption' => 'none',
'options' => [],
]);
$resolver->setDefault('port'... | [
"protected",
"function",
"configureOptions",
"(",
"OptionsResolver",
"$",
"resolver",
")",
"{",
"$",
"resolver",
"->",
"setDefaults",
"(",
"[",
"'host'",
"=>",
"'localhost'",
",",
"'version'",
"=>",
"3",
",",
"'connection_string'",
"=>",
"null",
",",
"'encryptio... | Configures the adapter's options.
@param OptionsResolver $resolver An OptionsResolver instance | [
"Configures",
"the",
"adapter",
"s",
"options",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Ldap/Adapter/AbstractConnection.php#L38-L62 |
206,843 | symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Routing/AnnotatedRouteControllerLoader.php | AnnotatedRouteControllerLoader.configureRoute | protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, $annot)
{
if ('__invoke' === $method->getName()) {
$route->setDefault('_controller', $class->getName());
} else {
$route->setDefault('_controller', $class->getName().'::'.$meth... | php | protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, $annot)
{
if ('__invoke' === $method->getName()) {
$route->setDefault('_controller', $class->getName());
} else {
$route->setDefault('_controller', $class->getName().'::'.$meth... | [
"protected",
"function",
"configureRoute",
"(",
"Route",
"$",
"route",
",",
"\\",
"ReflectionClass",
"$",
"class",
",",
"\\",
"ReflectionMethod",
"$",
"method",
",",
"$",
"annot",
")",
"{",
"if",
"(",
"'__invoke'",
"===",
"$",
"method",
"->",
"getName",
"(... | Configures the _controller default parameter of a given Route instance.
@param mixed $annot The annotation class instance | [
"Configures",
"the",
"_controller",
"default",
"parameter",
"of",
"a",
"given",
"Route",
"instance",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/FrameworkBundle/Routing/AnnotatedRouteControllerLoader.php#L30-L37 |
206,844 | symfony/symfony | src/Symfony/Component/HttpKernel/ControllerMetadata/ArgumentMetadataFactory.php | ArgumentMetadataFactory.getType | private function getType(\ReflectionParameter $parameter, \ReflectionFunctionAbstract $function)
{
if (!$type = $parameter->getType()) {
return;
}
$name = $type->getName();
$lcName = strtolower($name);
if ('self' !== $lcName && 'parent' !== $lcName) {
... | php | private function getType(\ReflectionParameter $parameter, \ReflectionFunctionAbstract $function)
{
if (!$type = $parameter->getType()) {
return;
}
$name = $type->getName();
$lcName = strtolower($name);
if ('self' !== $lcName && 'parent' !== $lcName) {
... | [
"private",
"function",
"getType",
"(",
"\\",
"ReflectionParameter",
"$",
"parameter",
",",
"\\",
"ReflectionFunctionAbstract",
"$",
"function",
")",
"{",
"if",
"(",
"!",
"$",
"type",
"=",
"$",
"parameter",
"->",
"getType",
"(",
")",
")",
"{",
"return",
";"... | Returns an associated type to the given parameter if available.
@param \ReflectionParameter $parameter
@return string|null | [
"Returns",
"an",
"associated",
"type",
"to",
"the",
"given",
"parameter",
"if",
"available",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/ControllerMetadata/ArgumentMetadataFactory.php#L50-L70 |
206,845 | symfony/symfony | src/Symfony/Component/Security/Core/Authorization/AccessDecisionManager.php | AccessDecisionManager.decideAffirmative | private function decideAffirmative(TokenInterface $token, array $attributes, $object = null)
{
$deny = 0;
foreach ($this->voters as $voter) {
$result = $voter->vote($token, $object, $attributes);
switch ($result) {
case VoterInterface::ACCESS_GRANTED:
... | php | private function decideAffirmative(TokenInterface $token, array $attributes, $object = null)
{
$deny = 0;
foreach ($this->voters as $voter) {
$result = $voter->vote($token, $object, $attributes);
switch ($result) {
case VoterInterface::ACCESS_GRANTED:
... | [
"private",
"function",
"decideAffirmative",
"(",
"TokenInterface",
"$",
"token",
",",
"array",
"$",
"attributes",
",",
"$",
"object",
"=",
"null",
")",
"{",
"$",
"deny",
"=",
"0",
";",
"foreach",
"(",
"$",
"this",
"->",
"voters",
"as",
"$",
"voter",
")... | Grants access if any voter returns an affirmative response.
If all voters abstained from voting, the decision will be based on the
allowIfAllAbstainDecisions property value (defaults to false). | [
"Grants",
"access",
"if",
"any",
"voter",
"returns",
"an",
"affirmative",
"response",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Security/Core/Authorization/AccessDecisionManager.php#L69-L93 |
206,846 | symfony/symfony | src/Symfony/Component/Stopwatch/StopwatchEvent.php | StopwatchEvent.stop | public function stop()
{
if (!\count($this->started)) {
throw new \LogicException('stop() called but start() has not been called before.');
}
$this->periods[] = new StopwatchPeriod(array_pop($this->started), $this->getNow(), $this->morePrecision);
return $this;
} | php | public function stop()
{
if (!\count($this->started)) {
throw new \LogicException('stop() called but start() has not been called before.');
}
$this->periods[] = new StopwatchPeriod(array_pop($this->started), $this->getNow(), $this->morePrecision);
return $this;
} | [
"public",
"function",
"stop",
"(",
")",
"{",
"if",
"(",
"!",
"\\",
"count",
"(",
"$",
"this",
"->",
"started",
")",
")",
"{",
"throw",
"new",
"\\",
"LogicException",
"(",
"'stop() called but start() has not been called before.'",
")",
";",
"}",
"$",
"this",
... | Stops the last started event period.
@return $this
@throws \LogicException When stop() is called without a matching call to start() | [
"Stops",
"the",
"last",
"started",
"event",
"period",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Stopwatch/StopwatchEvent.php#L99-L108 |
206,847 | symfony/symfony | src/Symfony/Component/HttpKernel/Profiler/Profile.php | Profile.setCollectors | public function setCollectors(array $collectors)
{
$this->collectors = [];
foreach ($collectors as $collector) {
$this->addCollector($collector);
}
} | php | public function setCollectors(array $collectors)
{
$this->collectors = [];
foreach ($collectors as $collector) {
$this->addCollector($collector);
}
} | [
"public",
"function",
"setCollectors",
"(",
"array",
"$",
"collectors",
")",
"{",
"$",
"this",
"->",
"collectors",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"collectors",
"as",
"$",
"collector",
")",
"{",
"$",
"this",
"->",
"addCollector",
"(",
"$",
"co... | Sets the Collectors associated with this profile.
@param DataCollectorInterface[] $collectors | [
"Sets",
"the",
"Collectors",
"associated",
"with",
"this",
"profile",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/Profiler/Profile.php#L263-L269 |
206,848 | symfony/symfony | src/Symfony/Component/Intl/DateFormatter/IntlDateFormatter.php | IntlDateFormatter.setPattern | public function setPattern($pattern)
{
if (null === $pattern) {
$pattern = $this->getDefaultPattern();
}
$this->pattern = $pattern;
return true;
} | php | public function setPattern($pattern)
{
if (null === $pattern) {
$pattern = $this->getDefaultPattern();
}
$this->pattern = $pattern;
return true;
} | [
"public",
"function",
"setPattern",
"(",
"$",
"pattern",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"pattern",
")",
"{",
"$",
"pattern",
"=",
"$",
"this",
"->",
"getDefaultPattern",
"(",
")",
";",
"}",
"$",
"this",
"->",
"pattern",
"=",
"$",
"pattern",... | Set the formatter's pattern.
@param string|null $pattern A pattern string in conformance with the ICU IntlDateFormatter documentation
@return bool true on success or false on failure
@see http://www.php.net/manual/en/intldateformatter.setpattern.php
@see http://userguide.icu-project.org/formatparse/datetime | [
"Set",
"the",
"formatter",
"s",
"pattern",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Intl/DateFormatter/IntlDateFormatter.php#L495-L504 |
206,849 | symfony/symfony | src/Symfony/Component/Intl/DateFormatter/IntlDateFormatter.php | IntlDateFormatter.setTimeZoneId | public function setTimeZoneId($timeZoneId)
{
if (null === $timeZoneId) {
$timeZoneId = date_default_timezone_get();
$this->uninitializedTimeZoneId = true;
}
// Backup original passed time zone
$timeZone = $timeZoneId;
// Get an Etc/GMT time zone tha... | php | public function setTimeZoneId($timeZoneId)
{
if (null === $timeZoneId) {
$timeZoneId = date_default_timezone_get();
$this->uninitializedTimeZoneId = true;
}
// Backup original passed time zone
$timeZone = $timeZoneId;
// Get an Etc/GMT time zone tha... | [
"public",
"function",
"setTimeZoneId",
"(",
"$",
"timeZoneId",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"timeZoneId",
")",
"{",
"$",
"timeZoneId",
"=",
"date_default_timezone_get",
"(",
")",
";",
"$",
"this",
"->",
"uninitializedTimeZoneId",
"=",
"true",
";"... | Set the formatter's timezone identifier.
@param string|null $timeZoneId The time zone ID string of the time zone to use.
If NULL or the empty string, the default time zone for the
runtime is used.
@return bool true on success or false on failure
@see http://www.php.net/manual/en/intldateformatter.settimezoneid.php | [
"Set",
"the",
"formatter",
"s",
"timezone",
"identifier",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Intl/DateFormatter/IntlDateFormatter.php#L517-L550 |
206,850 | symfony/symfony | src/Symfony/Component/Intl/DateFormatter/IntlDateFormatter.php | IntlDateFormatter.createDateTime | protected function createDateTime($timestamp)
{
$dateTime = new \DateTime();
$dateTime->setTimestamp($timestamp);
$dateTime->setTimezone($this->dateTimeZone);
return $dateTime;
} | php | protected function createDateTime($timestamp)
{
$dateTime = new \DateTime();
$dateTime->setTimestamp($timestamp);
$dateTime->setTimezone($this->dateTimeZone);
return $dateTime;
} | [
"protected",
"function",
"createDateTime",
"(",
"$",
"timestamp",
")",
"{",
"$",
"dateTime",
"=",
"new",
"\\",
"DateTime",
"(",
")",
";",
"$",
"dateTime",
"->",
"setTimestamp",
"(",
"$",
"timestamp",
")",
";",
"$",
"dateTime",
"->",
"setTimezone",
"(",
"... | Create and returns a DateTime object with the specified timestamp and with the
current time zone.
@param int $timestamp
@return \DateTime | [
"Create",
"and",
"returns",
"a",
"DateTime",
"object",
"with",
"the",
"specified",
"timestamp",
"and",
"with",
"the",
"current",
"time",
"zone",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Intl/DateFormatter/IntlDateFormatter.php#L587-L594 |
206,851 | symfony/symfony | src/Symfony/Component/Intl/DateFormatter/IntlDateFormatter.php | IntlDateFormatter.getDefaultPattern | protected function getDefaultPattern()
{
$patternParts = [];
if (self::NONE !== $this->datetype) {
$patternParts[] = $this->defaultDateFormats[$this->datetype];
}
if (self::NONE !== $this->timetype) {
$patternParts[] = $this->defaultTimeFormats[$this->timetype... | php | protected function getDefaultPattern()
{
$patternParts = [];
if (self::NONE !== $this->datetype) {
$patternParts[] = $this->defaultDateFormats[$this->datetype];
}
if (self::NONE !== $this->timetype) {
$patternParts[] = $this->defaultTimeFormats[$this->timetype... | [
"protected",
"function",
"getDefaultPattern",
"(",
")",
"{",
"$",
"patternParts",
"=",
"[",
"]",
";",
"if",
"(",
"self",
"::",
"NONE",
"!==",
"$",
"this",
"->",
"datetype",
")",
"{",
"$",
"patternParts",
"[",
"]",
"=",
"$",
"this",
"->",
"defaultDateFo... | Returns a pattern string based in the datetype and timetype values.
@return string | [
"Returns",
"a",
"pattern",
"string",
"based",
"in",
"the",
"datetype",
"and",
"timetype",
"values",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Intl/DateFormatter/IntlDateFormatter.php#L601-L612 |
206,852 | symfony/symfony | src/Symfony/Component/DependencyInjection/Compiler/RepeatedPass.php | RepeatedPass.process | public function process(ContainerBuilder $container)
{
do {
$this->repeat = false;
foreach ($this->passes as $pass) {
$pass->process($container);
}
} while ($this->repeat);
} | php | public function process(ContainerBuilder $container)
{
do {
$this->repeat = false;
foreach ($this->passes as $pass) {
$pass->process($container);
}
} while ($this->repeat);
} | [
"public",
"function",
"process",
"(",
"ContainerBuilder",
"$",
"container",
")",
"{",
"do",
"{",
"$",
"this",
"->",
"repeat",
"=",
"false",
";",
"foreach",
"(",
"$",
"this",
"->",
"passes",
"as",
"$",
"pass",
")",
"{",
"$",
"pass",
"->",
"process",
"... | Process the repeatable passes that run more than once. | [
"Process",
"the",
"repeatable",
"passes",
"that",
"run",
"more",
"than",
"once",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DependencyInjection/Compiler/RepeatedPass.php#L56-L64 |
206,853 | symfony/symfony | src/Symfony/Component/Mailer/Transport/RoundRobinTransport.php | RoundRobinTransport.getNextTransport | protected function getNextTransport(): ?TransportInterface
{
$cursor = $this->cursor;
while (true) {
$transport = $this->transports[$cursor];
if (!$this->isTransportDead($transport)) {
break;
}
if ((microtime(true) - $this->deadTransp... | php | protected function getNextTransport(): ?TransportInterface
{
$cursor = $this->cursor;
while (true) {
$transport = $this->transports[$cursor];
if (!$this->isTransportDead($transport)) {
break;
}
if ((microtime(true) - $this->deadTransp... | [
"protected",
"function",
"getNextTransport",
"(",
")",
":",
"?",
"TransportInterface",
"{",
"$",
"cursor",
"=",
"$",
"this",
"->",
"cursor",
";",
"while",
"(",
"true",
")",
"{",
"$",
"transport",
"=",
"$",
"this",
"->",
"transports",
"[",
"$",
"cursor",
... | Rotates the transport list around and returns the first instance. | [
"Rotates",
"the",
"transport",
"list",
"around",
"and",
"returns",
"the",
"first",
"instance",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Mailer/Transport/RoundRobinTransport.php#L64-L88 |
206,854 | symfony/symfony | src/Symfony/Component/DomCrawler/Field/ChoiceFormField.php | ChoiceFormField.isDisabled | public function isDisabled()
{
if (parent::isDisabled() && 'select' === $this->type) {
return true;
}
foreach ($this->options as $option) {
if ($option['value'] == $this->value && $option['disabled']) {
return true;
}
}
re... | php | public function isDisabled()
{
if (parent::isDisabled() && 'select' === $this->type) {
return true;
}
foreach ($this->options as $option) {
if ($option['value'] == $this->value && $option['disabled']) {
return true;
}
}
re... | [
"public",
"function",
"isDisabled",
"(",
")",
"{",
"if",
"(",
"parent",
"::",
"isDisabled",
"(",
")",
"&&",
"'select'",
"===",
"$",
"this",
"->",
"type",
")",
"{",
"return",
"true",
";",
"}",
"foreach",
"(",
"$",
"this",
"->",
"options",
"as",
"$",
... | Check if the current selected option is disabled.
@return bool | [
"Check",
"if",
"the",
"current",
"selected",
"option",
"is",
"disabled",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DomCrawler/Field/ChoiceFormField.php#L60-L73 |
206,855 | symfony/symfony | src/Symfony/Component/DomCrawler/Field/ChoiceFormField.php | ChoiceFormField.addChoice | public function addChoice(\DOMElement $node)
{
if (!$this->multiple && 'radio' !== $this->type) {
throw new \LogicException(sprintf('Unable to add a choice for "%s" as it is not multiple or is not a radio button.', $this->name));
}
$option = $this->buildOptionValue($node);
... | php | public function addChoice(\DOMElement $node)
{
if (!$this->multiple && 'radio' !== $this->type) {
throw new \LogicException(sprintf('Unable to add a choice for "%s" as it is not multiple or is not a radio button.', $this->name));
}
$option = $this->buildOptionValue($node);
... | [
"public",
"function",
"addChoice",
"(",
"\\",
"DOMElement",
"$",
"node",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"multiple",
"&&",
"'radio'",
"!==",
"$",
"this",
"->",
"type",
")",
"{",
"throw",
"new",
"\\",
"LogicException",
"(",
"sprintf",
"(",
... | Adds a choice to the current ones.
@param \DOMElement $node
@throws \LogicException When choice provided is not multiple nor radio
@internal | [
"Adds",
"a",
"choice",
"to",
"the",
"current",
"ones",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DomCrawler/Field/ChoiceFormField.php#L164-L176 |
206,856 | symfony/symfony | src/Symfony/Component/DomCrawler/Field/ChoiceFormField.php | ChoiceFormField.containsOption | public function containsOption($optionValue, $options)
{
if ($this->validationDisabled) {
return true;
}
foreach ($options as $option) {
if ($option['value'] == $optionValue) {
return true;
}
}
return false;
} | php | public function containsOption($optionValue, $options)
{
if ($this->validationDisabled) {
return true;
}
foreach ($options as $option) {
if ($option['value'] == $optionValue) {
return true;
}
}
return false;
} | [
"public",
"function",
"containsOption",
"(",
"$",
"optionValue",
",",
"$",
"options",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"validationDisabled",
")",
"{",
"return",
"true",
";",
"}",
"foreach",
"(",
"$",
"options",
"as",
"$",
"option",
")",
"{",
"if... | Checks whether given value is in the existing options.
@param string $optionValue
@param array $options
@return bool | [
"Checks",
"whether",
"given",
"value",
"is",
"in",
"the",
"existing",
"options",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DomCrawler/Field/ChoiceFormField.php#L278-L291 |
206,857 | symfony/symfony | src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php | HtmlDumper.setDisplayOptions | public function setDisplayOptions(array $displayOptions)
{
$this->headerIsDumped = false;
$this->displayOptions = $displayOptions + $this->displayOptions;
} | php | public function setDisplayOptions(array $displayOptions)
{
$this->headerIsDumped = false;
$this->displayOptions = $displayOptions + $this->displayOptions;
} | [
"public",
"function",
"setDisplayOptions",
"(",
"array",
"$",
"displayOptions",
")",
"{",
"$",
"this",
"->",
"headerIsDumped",
"=",
"false",
";",
"$",
"this",
"->",
"displayOptions",
"=",
"$",
"displayOptions",
"+",
"$",
"this",
"->",
"displayOptions",
";",
... | Configures display options.
@param array $displayOptions A map of display options to customize the behavior | [
"Configures",
"display",
"options",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php#L111-L115 |
206,858 | symfony/symfony | src/Symfony/Component/Form/Extension/Validator/Constraints/FormValidator.php | FormValidator.getValidationGroups | private static function getValidationGroups(FormInterface $form)
{
// Determine the clicked button of the complete form tree
$clickedButton = null;
if (method_exists($form, 'getClickedButton')) {
$clickedButton = $form->getClickedButton();
}
if (null !== $clicke... | php | private static function getValidationGroups(FormInterface $form)
{
// Determine the clicked button of the complete form tree
$clickedButton = null;
if (method_exists($form, 'getClickedButton')) {
$clickedButton = $form->getClickedButton();
}
if (null !== $clicke... | [
"private",
"static",
"function",
"getValidationGroups",
"(",
"FormInterface",
"$",
"form",
")",
"{",
"// Determine the clicked button of the complete form tree",
"$",
"clickedButton",
"=",
"null",
";",
"if",
"(",
"method_exists",
"(",
"$",
"form",
",",
"'getClickedButto... | Returns the validation groups of the given form.
@return string|GroupSequence|(string|GroupSequence)[] The validation groups | [
"Returns",
"the",
"validation",
"groups",
"of",
"the",
"given",
"form",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Extension/Validator/Constraints/FormValidator.php#L153-L181 |
206,859 | symfony/symfony | src/Symfony/Component/Form/Extension/Validator/Constraints/FormValidator.php | FormValidator.resolveValidationGroups | private static function resolveValidationGroups($groups, FormInterface $form)
{
if (!\is_string($groups) && \is_callable($groups)) {
$groups = $groups($form);
}
if ($groups instanceof GroupSequence) {
return $groups;
}
return (array) $groups;
} | php | private static function resolveValidationGroups($groups, FormInterface $form)
{
if (!\is_string($groups) && \is_callable($groups)) {
$groups = $groups($form);
}
if ($groups instanceof GroupSequence) {
return $groups;
}
return (array) $groups;
} | [
"private",
"static",
"function",
"resolveValidationGroups",
"(",
"$",
"groups",
",",
"FormInterface",
"$",
"form",
")",
"{",
"if",
"(",
"!",
"\\",
"is_string",
"(",
"$",
"groups",
")",
"&&",
"\\",
"is_callable",
"(",
"$",
"groups",
")",
")",
"{",
"$",
... | Post-processes the validation groups option for a given form.
@param string|GroupSequence|(string|GroupSequence)[]|callable $groups The validation groups
@param FormInterface $form The validated form
@return (string|GroupSequence)[] The validation groups | [
"Post",
"-",
"processes",
"the",
"validation",
"groups",
"option",
"for",
"a",
"given",
"form",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Extension/Validator/Constraints/FormValidator.php#L191-L202 |
206,860 | symfony/symfony | src/Symfony/Component/Console/Descriptor/JsonDescriptor.php | JsonDescriptor.writeData | private function writeData(array $data, array $options)
{
$this->write(json_encode($data, isset($options['json_encoding']) ? $options['json_encoding'] : 0));
} | php | private function writeData(array $data, array $options)
{
$this->write(json_encode($data, isset($options['json_encoding']) ? $options['json_encoding'] : 0));
} | [
"private",
"function",
"writeData",
"(",
"array",
"$",
"data",
",",
"array",
"$",
"options",
")",
"{",
"$",
"this",
"->",
"write",
"(",
"json_encode",
"(",
"$",
"data",
",",
"isset",
"(",
"$",
"options",
"[",
"'json_encoding'",
"]",
")",
"?",
"$",
"o... | Writes data as json.
@return array|string | [
"Writes",
"data",
"as",
"json",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Descriptor/JsonDescriptor.php#L98-L101 |
206,861 | symfony/symfony | src/Symfony/Component/Routing/Loader/AnnotationFileLoader.php | AnnotationFileLoader.load | public function load($file, $type = null)
{
$path = $this->locator->locate($file);
$collection = new RouteCollection();
if ($class = $this->findClass($path)) {
$refl = new \ReflectionClass($class);
if ($refl->isAbstract()) {
return;
}
... | php | public function load($file, $type = null)
{
$path = $this->locator->locate($file);
$collection = new RouteCollection();
if ($class = $this->findClass($path)) {
$refl = new \ReflectionClass($class);
if ($refl->isAbstract()) {
return;
}
... | [
"public",
"function",
"load",
"(",
"$",
"file",
",",
"$",
"type",
"=",
"null",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"locator",
"->",
"locate",
"(",
"$",
"file",
")",
";",
"$",
"collection",
"=",
"new",
"RouteCollection",
"(",
")",
";",
... | Loads from annotations from a file.
@param string $file A PHP file path
@param string|null $type The resource type
@return RouteCollection A RouteCollection instance
@throws \InvalidArgumentException When the file does not exist or its routes cannot be parsed | [
"Loads",
"from",
"annotations",
"from",
"a",
"file",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Routing/Loader/AnnotationFileLoader.php#L53-L71 |
206,862 | symfony/symfony | src/Symfony/Component/Routing/Loader/AnnotationFileLoader.php | AnnotationFileLoader.findClass | protected function findClass($file)
{
$class = false;
$namespace = false;
$tokens = token_get_all(file_get_contents($file));
if (1 === \count($tokens) && T_INLINE_HTML === $tokens[0][0]) {
throw new \InvalidArgumentException(sprintf('The file "%s" does not contain PHP co... | php | protected function findClass($file)
{
$class = false;
$namespace = false;
$tokens = token_get_all(file_get_contents($file));
if (1 === \count($tokens) && T_INLINE_HTML === $tokens[0][0]) {
throw new \InvalidArgumentException(sprintf('The file "%s" does not contain PHP co... | [
"protected",
"function",
"findClass",
"(",
"$",
"file",
")",
"{",
"$",
"class",
"=",
"false",
";",
"$",
"namespace",
"=",
"false",
";",
"$",
"tokens",
"=",
"token_get_all",
"(",
"file_get_contents",
"(",
"$",
"file",
")",
")",
";",
"if",
"(",
"1",
"=... | Returns the full class name for the first class in the file.
@param string $file A PHP file path
@return string|false Full class name if found, false otherwise | [
"Returns",
"the",
"full",
"class",
"name",
"for",
"the",
"first",
"class",
"in",
"the",
"file",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Routing/Loader/AnnotationFileLoader.php#L88-L144 |
206,863 | symfony/symfony | src/Symfony/Component/Mime/Encoder/IdnAddressEncoder.php | IdnAddressEncoder.encodeString | public function encodeString(string $address): string
{
$i = strrpos($address, '@');
if (false !== $i) {
$local = substr($address, 0, $i);
$domain = substr($address, $i + 1);
if (preg_match('/[^\x00-\x7F]/', $local)) {
throw new AddressEncoderExce... | php | public function encodeString(string $address): string
{
$i = strrpos($address, '@');
if (false !== $i) {
$local = substr($address, 0, $i);
$domain = substr($address, $i + 1);
if (preg_match('/[^\x00-\x7F]/', $local)) {
throw new AddressEncoderExce... | [
"public",
"function",
"encodeString",
"(",
"string",
"$",
"address",
")",
":",
"string",
"{",
"$",
"i",
"=",
"strrpos",
"(",
"$",
"address",
",",
"'@'",
")",
";",
"if",
"(",
"false",
"!==",
"$",
"i",
")",
"{",
"$",
"local",
"=",
"substr",
"(",
"$... | Encodes the domain part of an address using IDN.
@throws AddressEncoderException If local-part contains non-ASCII characters | [
"Encodes",
"the",
"domain",
"part",
"of",
"an",
"address",
"using",
"IDN",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Mime/Encoder/IdnAddressEncoder.php#L38-L55 |
206,864 | symfony/symfony | src/Symfony/Component/Messenger/HandleTrait.php | HandleTrait.handle | private function handle($message)
{
if (!$this->messageBus instanceof MessageBusInterface) {
throw new LogicException(sprintf('You must provide a "%s" instance in the "%s::$messageBus" property, "%s" given.', MessageBusInterface::class, \get_class($this), \is_object($this->messageBus) ? \get_cla... | php | private function handle($message)
{
if (!$this->messageBus instanceof MessageBusInterface) {
throw new LogicException(sprintf('You must provide a "%s" instance in the "%s::$messageBus" property, "%s" given.', MessageBusInterface::class, \get_class($this), \is_object($this->messageBus) ? \get_cla... | [
"private",
"function",
"handle",
"(",
"$",
"message",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"messageBus",
"instanceof",
"MessageBusInterface",
")",
"{",
"throw",
"new",
"LogicException",
"(",
"sprintf",
"(",
"'You must provide a \"%s\" instance in the \"%s::$... | Dispatches the given message, expecting to be handled by a single handler
and returns the result from the handler returned value.
This behavior is useful for both synchronous command & query buses,
the last one usually returning the handler result.
@param object|Envelope $message The message or the message pre-wrapped... | [
"Dispatches",
"the",
"given",
"message",
"expecting",
"to",
"be",
"handled",
"by",
"a",
"single",
"handler",
"and",
"returns",
"the",
"result",
"from",
"the",
"handler",
"returned",
"value",
".",
"This",
"behavior",
"is",
"useful",
"for",
"both",
"synchronous"... | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Messenger/HandleTrait.php#L39-L62 |
206,865 | symfony/symfony | src/Symfony/Component/Routing/Loader/XmlFileLoader.php | XmlFileLoader.parseDefaultsConfig | private function parseDefaultsConfig(\DOMElement $element, $path)
{
if ($this->isElementValueNull($element)) {
return;
}
// Check for existing element nodes in the default element. There can
// only be a single element inside a default element. So this element
//... | php | private function parseDefaultsConfig(\DOMElement $element, $path)
{
if ($this->isElementValueNull($element)) {
return;
}
// Check for existing element nodes in the default element. There can
// only be a single element inside a default element. So this element
//... | [
"private",
"function",
"parseDefaultsConfig",
"(",
"\\",
"DOMElement",
"$",
"element",
",",
"$",
"path",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isElementValueNull",
"(",
"$",
"element",
")",
")",
"{",
"return",
";",
"}",
"// Check for existing element nodes ... | Parses the "default" elements.
@param \DOMElement $element The "default" element to parse
@param string $path Full path of the XML file being processed
@return array|bool|float|int|string|null The parsed value of the "default" element | [
"Parses",
"the",
"default",
"elements",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Routing/Loader/XmlFileLoader.php#L337-L362 |
206,866 | symfony/symfony | src/Symfony/Component/Routing/Loader/XmlFileLoader.php | XmlFileLoader.parseDefaultNode | private function parseDefaultNode(\DOMElement $node, $path)
{
if ($this->isElementValueNull($node)) {
return;
}
switch ($node->localName) {
case 'bool':
return 'true' === trim($node->nodeValue) || '1' === trim($node->nodeValue);
case 'int'... | php | private function parseDefaultNode(\DOMElement $node, $path)
{
if ($this->isElementValueNull($node)) {
return;
}
switch ($node->localName) {
case 'bool':
return 'true' === trim($node->nodeValue) || '1' === trim($node->nodeValue);
case 'int'... | [
"private",
"function",
"parseDefaultNode",
"(",
"\\",
"DOMElement",
"$",
"node",
",",
"$",
"path",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isElementValueNull",
"(",
"$",
"node",
")",
")",
"{",
"return",
";",
"}",
"switch",
"(",
"$",
"node",
"->",
"l... | Recursively parses the value of a "default" element.
@param \DOMElement $node The node value
@param string $path Full path of the XML file being processed
@return array|bool|float|int|string The parsed value
@throws \InvalidArgumentException when the XML is invalid | [
"Recursively",
"parses",
"the",
"value",
"of",
"a",
"default",
"element",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Routing/Loader/XmlFileLoader.php#L374-L424 |
206,867 | symfony/symfony | src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php | AbstractDoctrineExtension.setMappingDriverAlias | protected function setMappingDriverAlias($mappingConfig, $mappingName)
{
if (isset($mappingConfig['alias'])) {
$this->aliasMap[$mappingConfig['alias']] = $mappingConfig['prefix'];
} else {
$this->aliasMap[$mappingName] = $mappingConfig['prefix'];
}
} | php | protected function setMappingDriverAlias($mappingConfig, $mappingName)
{
if (isset($mappingConfig['alias'])) {
$this->aliasMap[$mappingConfig['alias']] = $mappingConfig['prefix'];
} else {
$this->aliasMap[$mappingName] = $mappingConfig['prefix'];
}
} | [
"protected",
"function",
"setMappingDriverAlias",
"(",
"$",
"mappingConfig",
",",
"$",
"mappingName",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"mappingConfig",
"[",
"'alias'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"aliasMap",
"[",
"$",
"mappingConfig",
"["... | Register the alias for this mapping driver.
Aliases can be used in the Query languages of all the Doctrine object managers to simplify writing tasks.
@param array $mappingConfig
@param string $mappingName | [
"Register",
"the",
"alias",
"for",
"this",
"mapping",
"driver",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php#L108-L115 |
206,868 | symfony/symfony | src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php | AbstractDoctrineExtension.setMappingDriverConfig | protected function setMappingDriverConfig(array $mappingConfig, $mappingName)
{
$mappingDirectory = $mappingConfig['dir'];
if (!is_dir($mappingDirectory)) {
throw new \InvalidArgumentException(sprintf('Invalid Doctrine mapping path given. Cannot load Doctrine mapping/bundle named "%s".',... | php | protected function setMappingDriverConfig(array $mappingConfig, $mappingName)
{
$mappingDirectory = $mappingConfig['dir'];
if (!is_dir($mappingDirectory)) {
throw new \InvalidArgumentException(sprintf('Invalid Doctrine mapping path given. Cannot load Doctrine mapping/bundle named "%s".',... | [
"protected",
"function",
"setMappingDriverConfig",
"(",
"array",
"$",
"mappingConfig",
",",
"$",
"mappingName",
")",
"{",
"$",
"mappingDirectory",
"=",
"$",
"mappingConfig",
"[",
"'dir'",
"]",
";",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"mappingDirectory",
")",
... | Register the mapping driver configuration for later use with the object managers metadata driver chain.
@param array $mappingConfig
@param string $mappingName
@throws \InvalidArgumentException | [
"Register",
"the",
"mapping",
"driver",
"configuration",
"for",
"later",
"use",
"with",
"the",
"object",
"managers",
"metadata",
"driver",
"chain",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php#L125-L133 |
206,869 | symfony/symfony | src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php | AbstractDoctrineExtension.registerMappingDrivers | protected function registerMappingDrivers($objectManager, ContainerBuilder $container)
{
// configure metadata driver for each bundle based on the type of mapping files found
if ($container->hasDefinition($this->getObjectManagerElementName($objectManager['name'].'_metadata_driver'))) {
$... | php | protected function registerMappingDrivers($objectManager, ContainerBuilder $container)
{
// configure metadata driver for each bundle based on the type of mapping files found
if ($container->hasDefinition($this->getObjectManagerElementName($objectManager['name'].'_metadata_driver'))) {
$... | [
"protected",
"function",
"registerMappingDrivers",
"(",
"$",
"objectManager",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"// configure metadata driver for each bundle based on the type of mapping files found",
"if",
"(",
"$",
"container",
"->",
"hasDefinition",
"(",
... | Register all the collected mapping information with the object manager by registering the appropriate mapping drivers.
@param array $objectManager
@param ContainerBuilder $container A ContainerBuilder instance | [
"Register",
"all",
"the",
"collected",
"mapping",
"information",
"with",
"the",
"object",
"manager",
"by",
"registering",
"the",
"appropriate",
"mapping",
"drivers",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php#L178-L223 |
206,870 | symfony/symfony | src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php | AbstractDoctrineExtension.assertValidMappingConfiguration | protected function assertValidMappingConfiguration(array $mappingConfig, $objectManagerName)
{
if (!$mappingConfig['type'] || !$mappingConfig['dir'] || !$mappingConfig['prefix']) {
throw new \InvalidArgumentException(sprintf('Mapping definitions for Doctrine manager "%s" require at least the "ty... | php | protected function assertValidMappingConfiguration(array $mappingConfig, $objectManagerName)
{
if (!$mappingConfig['type'] || !$mappingConfig['dir'] || !$mappingConfig['prefix']) {
throw new \InvalidArgumentException(sprintf('Mapping definitions for Doctrine manager "%s" require at least the "ty... | [
"protected",
"function",
"assertValidMappingConfiguration",
"(",
"array",
"$",
"mappingConfig",
",",
"$",
"objectManagerName",
")",
"{",
"if",
"(",
"!",
"$",
"mappingConfig",
"[",
"'type'",
"]",
"||",
"!",
"$",
"mappingConfig",
"[",
"'dir'",
"]",
"||",
"!",
... | Assertion if the specified mapping information is valid.
@param array $mappingConfig
@param string $objectManagerName
@throws \InvalidArgumentException | [
"Assertion",
"if",
"the",
"specified",
"mapping",
"information",
"is",
"valid",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php#L233-L250 |
206,871 | symfony/symfony | src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php | AbstractDoctrineExtension.detectMetadataDriver | protected function detectMetadataDriver($dir, ContainerBuilder $container)
{
$configPath = $this->getMappingResourceConfigDirectory();
$extension = $this->getMappingResourceExtension();
if (glob($dir.'/'.$configPath.'/*.'.$extension.'.xml')) {
$driver = 'xml';
} elseif (... | php | protected function detectMetadataDriver($dir, ContainerBuilder $container)
{
$configPath = $this->getMappingResourceConfigDirectory();
$extension = $this->getMappingResourceExtension();
if (glob($dir.'/'.$configPath.'/*.'.$extension.'.xml')) {
$driver = 'xml';
} elseif (... | [
"protected",
"function",
"detectMetadataDriver",
"(",
"$",
"dir",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"configPath",
"=",
"$",
"this",
"->",
"getMappingResourceConfigDirectory",
"(",
")",
";",
"$",
"extension",
"=",
"$",
"this",
"->",
"get... | Detects what metadata driver to use for the supplied directory.
@param string $dir A directory path
@param ContainerBuilder $container A ContainerBuilder instance
@return string|null A metadata driver short name, if one can be detected | [
"Detects",
"what",
"metadata",
"driver",
"to",
"use",
"for",
"the",
"supplied",
"directory",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php#L260-L284 |
206,872 | symfony/symfony | src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php | AbstractDoctrineExtension.validateAutoMapping | private function validateAutoMapping(array $managerConfigs)
{
$autoMappedManager = null;
foreach ($managerConfigs as $name => $manager) {
if (!$manager['auto_mapping']) {
continue;
}
if (null !== $autoMappedManager) {
throw new \Lo... | php | private function validateAutoMapping(array $managerConfigs)
{
$autoMappedManager = null;
foreach ($managerConfigs as $name => $manager) {
if (!$manager['auto_mapping']) {
continue;
}
if (null !== $autoMappedManager) {
throw new \Lo... | [
"private",
"function",
"validateAutoMapping",
"(",
"array",
"$",
"managerConfigs",
")",
"{",
"$",
"autoMappedManager",
"=",
"null",
";",
"foreach",
"(",
"$",
"managerConfigs",
"as",
"$",
"name",
"=>",
"$",
"manager",
")",
"{",
"if",
"(",
"!",
"$",
"manager... | Search for a manager that is declared as 'auto_mapping' = true.
@return string|null The name of the manager. If no one manager is found, returns null
@throws \LogicException | [
"Search",
"for",
"a",
"manager",
"that",
"is",
"declared",
"as",
"auto_mapping",
"=",
"true",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php#L451-L467 |
206,873 | symfony/symfony | src/Symfony/Component/Security/Http/Logout/LogoutUrlGenerator.php | LogoutUrlGenerator.registerListener | public function registerListener($key, $logoutPath, $csrfTokenId, $csrfParameter, CsrfTokenManagerInterface $csrfTokenManager = null, string $context = null)
{
$this->listeners[$key] = [$logoutPath, $csrfTokenId, $csrfParameter, $csrfTokenManager, $context];
} | php | public function registerListener($key, $logoutPath, $csrfTokenId, $csrfParameter, CsrfTokenManagerInterface $csrfTokenManager = null, string $context = null)
{
$this->listeners[$key] = [$logoutPath, $csrfTokenId, $csrfParameter, $csrfTokenManager, $context];
} | [
"public",
"function",
"registerListener",
"(",
"$",
"key",
",",
"$",
"logoutPath",
",",
"$",
"csrfTokenId",
",",
"$",
"csrfParameter",
",",
"CsrfTokenManagerInterface",
"$",
"csrfTokenManager",
"=",
"null",
",",
"string",
"$",
"context",
"=",
"null",
")",
"{",... | Registers a firewall's LogoutListener, allowing its URL to be generated.
@param string $key The firewall key
@param string $logoutPath The path that starts the logout process
@param string $csrfTokenId The ID of the CSRF to... | [
"Registers",
"a",
"firewall",
"s",
"LogoutListener",
"allowing",
"its",
"URL",
"to",
"be",
"generated",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Security/Http/Logout/LogoutUrlGenerator.php#L51-L54 |
206,874 | symfony/symfony | src/Symfony/Component/Security/Http/Logout/LogoutUrlGenerator.php | LogoutUrlGenerator.generateLogoutUrl | private function generateLogoutUrl($key, $referenceType)
{
list($logoutPath, $csrfTokenId, $csrfParameter, $csrfTokenManager) = $this->getListener($key);
if (null === $logoutPath) {
throw new \LogicException('Unable to generate the logout URL without a path.');
}
$param... | php | private function generateLogoutUrl($key, $referenceType)
{
list($logoutPath, $csrfTokenId, $csrfParameter, $csrfTokenManager) = $this->getListener($key);
if (null === $logoutPath) {
throw new \LogicException('Unable to generate the logout URL without a path.');
}
$param... | [
"private",
"function",
"generateLogoutUrl",
"(",
"$",
"key",
",",
"$",
"referenceType",
")",
"{",
"list",
"(",
"$",
"logoutPath",
",",
"$",
"csrfTokenId",
",",
"$",
"csrfParameter",
",",
"$",
"csrfTokenManager",
")",
"=",
"$",
"this",
"->",
"getListener",
... | Generates the logout URL for the firewall.
@param string|null $key The firewall key or null to use the current firewall key
@param int $referenceType The type of reference (one of the constants in UrlGeneratorInterface)
@return string The logout URL | [
"Generates",
"the",
"logout",
"URL",
"for",
"the",
"firewall",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Security/Http/Logout/LogoutUrlGenerator.php#L97-L128 |
206,875 | symfony/symfony | src/Symfony/Component/Ldap/Adapter/ExtLdap/EntryManager.php | EntryManager.addAttributeValues | public function addAttributeValues(Entry $entry, string $attribute, array $values)
{
$con = $this->getConnectionResource();
if (!@ldap_mod_add($con, $entry->getDn(), [$attribute => $values])) {
throw new LdapException(sprintf('Could not add values to entry "%s", attribute %s: %s.', $ent... | php | public function addAttributeValues(Entry $entry, string $attribute, array $values)
{
$con = $this->getConnectionResource();
if (!@ldap_mod_add($con, $entry->getDn(), [$attribute => $values])) {
throw new LdapException(sprintf('Could not add values to entry "%s", attribute %s: %s.', $ent... | [
"public",
"function",
"addAttributeValues",
"(",
"Entry",
"$",
"entry",
",",
"string",
"$",
"attribute",
",",
"array",
"$",
"values",
")",
"{",
"$",
"con",
"=",
"$",
"this",
"->",
"getConnectionResource",
"(",
")",
";",
"if",
"(",
"!",
"@",
"ldap_mod_add... | Adds values to an entry's multi-valued attribute from the LDAP server.
@throws NotBoundException
@throws LdapException | [
"Adds",
"values",
"to",
"an",
"entry",
"s",
"multi",
"-",
"valued",
"attribute",
"from",
"the",
"LDAP",
"server",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Ldap/Adapter/ExtLdap/EntryManager.php#L77-L84 |
206,876 | symfony/symfony | src/Symfony/Component/Ldap/Adapter/ExtLdap/EntryManager.php | EntryManager.removeAttributeValues | public function removeAttributeValues(Entry $entry, string $attribute, array $values)
{
$con = $this->getConnectionResource();
if (!@ldap_mod_del($con, $entry->getDn(), [$attribute => $values])) {
throw new LdapException(sprintf('Could not remove values from entry "%s", attribute %s: %s... | php | public function removeAttributeValues(Entry $entry, string $attribute, array $values)
{
$con = $this->getConnectionResource();
if (!@ldap_mod_del($con, $entry->getDn(), [$attribute => $values])) {
throw new LdapException(sprintf('Could not remove values from entry "%s", attribute %s: %s... | [
"public",
"function",
"removeAttributeValues",
"(",
"Entry",
"$",
"entry",
",",
"string",
"$",
"attribute",
",",
"array",
"$",
"values",
")",
"{",
"$",
"con",
"=",
"$",
"this",
"->",
"getConnectionResource",
"(",
")",
";",
"if",
"(",
"!",
"@",
"ldap_mod_... | Removes values from an entry's multi-valued attribute from the LDAP server.
@throws NotBoundException
@throws LdapException | [
"Removes",
"values",
"from",
"an",
"entry",
"s",
"multi",
"-",
"valued",
"attribute",
"from",
"the",
"LDAP",
"server",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Ldap/Adapter/ExtLdap/EntryManager.php#L92-L99 |
206,877 | symfony/symfony | src/Symfony/Component/Ldap/Adapter/ExtLdap/EntryManager.php | EntryManager.move | public function move(Entry $entry, string $newParent)
{
$con = $this->getConnectionResource();
$rdn = $this->parseRdnFromEntry($entry);
// deleteOldRdn does not matter here, since the Rdn will not be changing in the move.
if (!@ldap_rename($con, $entry->getDn(), $rdn, $newParent, tru... | php | public function move(Entry $entry, string $newParent)
{
$con = $this->getConnectionResource();
$rdn = $this->parseRdnFromEntry($entry);
// deleteOldRdn does not matter here, since the Rdn will not be changing in the move.
if (!@ldap_rename($con, $entry->getDn(), $rdn, $newParent, tru... | [
"public",
"function",
"move",
"(",
"Entry",
"$",
"entry",
",",
"string",
"$",
"newParent",
")",
"{",
"$",
"con",
"=",
"$",
"this",
"->",
"getConnectionResource",
"(",
")",
";",
"$",
"rdn",
"=",
"$",
"this",
"->",
"parseRdnFromEntry",
"(",
"$",
"entry",... | Moves an entry on the Ldap server.
@throws NotBoundException if the connection has not been previously bound
@throws LdapException if an error is thrown during the rename operation | [
"Moves",
"an",
"entry",
"on",
"the",
"Ldap",
"server",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Ldap/Adapter/ExtLdap/EntryManager.php#L119-L127 |
206,878 | symfony/symfony | src/Symfony/Component/Serializer/Mapping/Loader/XmlFileLoader.php | XmlFileLoader.parseFile | private function parseFile($file)
{
try {
$dom = XmlUtils::loadFile($file, __DIR__.'/schema/dic/serializer-mapping/serializer-mapping-1.0.xsd');
} catch (\Exception $e) {
throw new MappingException($e->getMessage(), $e->getCode(), $e);
}
return simplexml_impo... | php | private function parseFile($file)
{
try {
$dom = XmlUtils::loadFile($file, __DIR__.'/schema/dic/serializer-mapping/serializer-mapping-1.0.xsd');
} catch (\Exception $e) {
throw new MappingException($e->getMessage(), $e->getCode(), $e);
}
return simplexml_impo... | [
"private",
"function",
"parseFile",
"(",
"$",
"file",
")",
"{",
"try",
"{",
"$",
"dom",
"=",
"XmlUtils",
"::",
"loadFile",
"(",
"$",
"file",
",",
"__DIR__",
".",
"'/schema/dic/serializer-mapping/serializer-mapping-1.0.xsd'",
")",
";",
"}",
"catch",
"(",
"\\",
... | Parses a XML File.
@param string $file Path of file
@return \SimpleXMLElement
@throws MappingException | [
"Parses",
"a",
"XML",
"File",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Serializer/Mapping/Loader/XmlFileLoader.php#L117-L126 |
206,879 | symfony/symfony | src/Symfony/Component/HttpClient/Response/MockResponse.php | MockResponse.writeRequest | private static function writeRequest(self $response, array $options, ResponseInterface $mock)
{
$onProgress = $options['on_progress'] ?? static function () {};
$response->info += $mock->getInfo() ?: [];
// simulate "size_upload" if it is set
if (isset($response->info['size_upload'])... | php | private static function writeRequest(self $response, array $options, ResponseInterface $mock)
{
$onProgress = $options['on_progress'] ?? static function () {};
$response->info += $mock->getInfo() ?: [];
// simulate "size_upload" if it is set
if (isset($response->info['size_upload'])... | [
"private",
"static",
"function",
"writeRequest",
"(",
"self",
"$",
"response",
",",
"array",
"$",
"options",
",",
"ResponseInterface",
"$",
"mock",
")",
"{",
"$",
"onProgress",
"=",
"$",
"options",
"[",
"'on_progress'",
"]",
"??",
"static",
"function",
"(",
... | Simulates sending the request. | [
"Simulates",
"sending",
"the",
"request",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpClient/Response/MockResponse.php#L194-L232 |
206,880 | symfony/symfony | src/Symfony/Component/HttpClient/Response/MockResponse.php | MockResponse.readResponse | private static function readResponse(self $response, array $options, ResponseInterface $mock, int &$offset)
{
$onProgress = $options['on_progress'] ?? static function () {};
// populate info related to headers
$info = $mock->getInfo() ?: [];
$response->info['http_code'] = ($info['ht... | php | private static function readResponse(self $response, array $options, ResponseInterface $mock, int &$offset)
{
$onProgress = $options['on_progress'] ?? static function () {};
// populate info related to headers
$info = $mock->getInfo() ?: [];
$response->info['http_code'] = ($info['ht... | [
"private",
"static",
"function",
"readResponse",
"(",
"self",
"$",
"response",
",",
"array",
"$",
"options",
",",
"ResponseInterface",
"$",
"mock",
",",
"int",
"&",
"$",
"offset",
")",
"{",
"$",
"onProgress",
"=",
"$",
"options",
"[",
"'on_progress'",
"]",... | Simulates reading the response. | [
"Simulates",
"reading",
"the",
"response",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpClient/Response/MockResponse.php#L237-L290 |
206,881 | symfony/symfony | src/Symfony/Component/PropertyAccess/PropertyPathBuilder.php | PropertyPathBuilder.remove | public function remove($offset, $length = 1)
{
if (!isset($this->elements[$offset])) {
throw new OutOfBoundsException(sprintf('The offset %s is not within the property path', $offset));
}
$this->resize($offset, $length, 0);
} | php | public function remove($offset, $length = 1)
{
if (!isset($this->elements[$offset])) {
throw new OutOfBoundsException(sprintf('The offset %s is not within the property path', $offset));
}
$this->resize($offset, $length, 0);
} | [
"public",
"function",
"remove",
"(",
"$",
"offset",
",",
"$",
"length",
"=",
"1",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"elements",
"[",
"$",
"offset",
"]",
")",
")",
"{",
"throw",
"new",
"OutOfBoundsException",
"(",
"sprintf",
... | Removes elements from the current path.
@param int $offset The offset at which to remove
@param int $length The length of the removed piece
@throws OutOfBoundsException if offset is invalid | [
"Removes",
"elements",
"from",
"the",
"current",
"path",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/PropertyAccess/PropertyPathBuilder.php#L94-L101 |
206,882 | symfony/symfony | src/Symfony/Component/PropertyAccess/PropertyPathBuilder.php | PropertyPathBuilder.replaceByIndex | public function replaceByIndex($offset, $name = null)
{
if (!isset($this->elements[$offset])) {
throw new OutOfBoundsException(sprintf('The offset %s is not within the property path', $offset));
}
if (null !== $name) {
$this->elements[$offset] = $name;
}
... | php | public function replaceByIndex($offset, $name = null)
{
if (!isset($this->elements[$offset])) {
throw new OutOfBoundsException(sprintf('The offset %s is not within the property path', $offset));
}
if (null !== $name) {
$this->elements[$offset] = $name;
}
... | [
"public",
"function",
"replaceByIndex",
"(",
"$",
"offset",
",",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"elements",
"[",
"$",
"offset",
"]",
")",
")",
"{",
"throw",
"new",
"OutOfBoundsException",
"(",
"sp... | Replaces a property element by an index element.
@param int $offset The offset at which to replace
@param string $name The new name of the element. Optional
@throws OutOfBoundsException If the offset is invalid | [
"Replaces",
"a",
"property",
"element",
"by",
"an",
"index",
"element",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/PropertyAccess/PropertyPathBuilder.php#L149-L160 |
206,883 | symfony/symfony | src/Symfony/Component/PropertyAccess/PropertyPathBuilder.php | PropertyPathBuilder.replaceByProperty | public function replaceByProperty($offset, $name = null)
{
if (!isset($this->elements[$offset])) {
throw new OutOfBoundsException(sprintf('The offset %s is not within the property path', $offset));
}
if (null !== $name) {
$this->elements[$offset] = $name;
}
... | php | public function replaceByProperty($offset, $name = null)
{
if (!isset($this->elements[$offset])) {
throw new OutOfBoundsException(sprintf('The offset %s is not within the property path', $offset));
}
if (null !== $name) {
$this->elements[$offset] = $name;
}
... | [
"public",
"function",
"replaceByProperty",
"(",
"$",
"offset",
",",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"elements",
"[",
"$",
"offset",
"]",
")",
")",
"{",
"throw",
"new",
"OutOfBoundsException",
"(",
... | Replaces an index element by a property element.
@param int $offset The offset at which to replace
@param string $name The new name of the element. Optional
@throws OutOfBoundsException If the offset is invalid | [
"Replaces",
"an",
"index",
"element",
"by",
"a",
"property",
"element",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/PropertyAccess/PropertyPathBuilder.php#L170-L181 |
206,884 | symfony/symfony | src/Symfony/Component/DependencyInjection/ReverseContainer.php | ReverseContainer.getId | public function getId($service): ?string
{
if ($this->serviceContainer === $service) {
return 'service_container';
}
if (null === $id = ($this->getServiceId)($service)) {
return null;
}
if ($this->serviceContainer->has($id) || $this->reversibleLocato... | php | public function getId($service): ?string
{
if ($this->serviceContainer === $service) {
return 'service_container';
}
if (null === $id = ($this->getServiceId)($service)) {
return null;
}
if ($this->serviceContainer->has($id) || $this->reversibleLocato... | [
"public",
"function",
"getId",
"(",
"$",
"service",
")",
":",
"?",
"string",
"{",
"if",
"(",
"$",
"this",
"->",
"serviceContainer",
"===",
"$",
"service",
")",
"{",
"return",
"'service_container'",
";",
"}",
"if",
"(",
"null",
"===",
"$",
"id",
"=",
... | Returns the id of the passed object when it exists as a service.
To be reversible, services need to be either public or be tagged with "container.reversible".
@param object $service | [
"Returns",
"the",
"id",
"of",
"the",
"passed",
"object",
"when",
"it",
"exists",
"as",
"a",
"service",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DependencyInjection/ReverseContainer.php#L46-L61 |
206,885 | symfony/symfony | src/Symfony/Component/Finder/Iterator/RecursiveDirectoryIterator.php | RecursiveDirectoryIterator.current | public function current()
{
// the logic here avoids redoing the same work in all iterations
if (null === $subPathname = $this->subPath) {
$subPathname = $this->subPath = (string) $this->getSubPath();
}
if ('' !== $subPathname) {
$subPathname .= $this->direct... | php | public function current()
{
// the logic here avoids redoing the same work in all iterations
if (null === $subPathname = $this->subPath) {
$subPathname = $this->subPath = (string) $this->getSubPath();
}
if ('' !== $subPathname) {
$subPathname .= $this->direct... | [
"public",
"function",
"current",
"(",
")",
"{",
"// the logic here avoids redoing the same work in all iterations",
"if",
"(",
"null",
"===",
"$",
"subPathname",
"=",
"$",
"this",
"->",
"subPath",
")",
"{",
"$",
"subPathname",
"=",
"$",
"this",
"->",
"subPath",
... | Return an instance of SplFileInfo with support for relative paths.
@return SplFileInfo File information | [
"Return",
"an",
"instance",
"of",
"SplFileInfo",
"with",
"support",
"for",
"relative",
"paths",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Finder/Iterator/RecursiveDirectoryIterator.php#L61-L74 |
206,886 | symfony/symfony | src/Symfony/Component/Security/Guard/Authenticator/AbstractFormLoginAuthenticator.php | AbstractFormLoginAuthenticator.start | public function start(Request $request, AuthenticationException $authException = null)
{
$url = $this->getLoginUrl();
return new RedirectResponse($url);
} | php | public function start(Request $request, AuthenticationException $authException = null)
{
$url = $this->getLoginUrl();
return new RedirectResponse($url);
} | [
"public",
"function",
"start",
"(",
"Request",
"$",
"request",
",",
"AuthenticationException",
"$",
"authException",
"=",
"null",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"getLoginUrl",
"(",
")",
";",
"return",
"new",
"RedirectResponse",
"(",
"$",
"ur... | Override to control what happens when the user hits a secure page
but isn't logged in yet.
@return RedirectResponse | [
"Override",
"to",
"control",
"what",
"happens",
"when",
"the",
"user",
"hits",
"a",
"secure",
"page",
"but",
"isn",
"t",
"logged",
"in",
"yet",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Security/Guard/Authenticator/AbstractFormLoginAuthenticator.php#L61-L66 |
206,887 | symfony/symfony | src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPass.php | RegisterEventListenersAndSubscribersPass.findAndSortTags | private function findAndSortTags($tagName, ContainerBuilder $container)
{
$sortedTags = [];
foreach ($container->findTaggedServiceIds($tagName, true) as $serviceId => $tags) {
foreach ($tags as $attributes) {
$priority = isset($attributes['priority']) ? $attributes['prio... | php | private function findAndSortTags($tagName, ContainerBuilder $container)
{
$sortedTags = [];
foreach ($container->findTaggedServiceIds($tagName, true) as $serviceId => $tags) {
foreach ($tags as $attributes) {
$priority = isset($attributes['priority']) ? $attributes['prio... | [
"private",
"function",
"findAndSortTags",
"(",
"$",
"tagName",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"sortedTags",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"container",
"->",
"findTaggedServiceIds",
"(",
"$",
"tagName",
",",
"true",
")",
... | Finds and orders all service tags with the given name by their priority.
The order of additions must be respected for services having the same priority,
and knowing that the \SplPriorityQueue class does not respect the FIFO method,
we should not use this class.
@see https://bugs.php.net/bug.php?id=53710
@see https://... | [
"Finds",
"and",
"orders",
"all",
"service",
"tags",
"with",
"the",
"given",
"name",
"by",
"their",
"priority",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPass.php#L136-L153 |
206,888 | symfony/symfony | src/Symfony/Component/BrowserKit/CookieJar.php | CookieJar.updateFromSetCookie | public function updateFromSetCookie(array $setCookies, $uri = null)
{
$cookies = [];
foreach ($setCookies as $cookie) {
foreach (explode(',', $cookie) as $i => $part) {
if (0 === $i || preg_match('/^(?P<token>\s*[0-9A-Za-z!#\$%\&\'\*\+\-\.^_`\|~]+)=/', $part)) {
... | php | public function updateFromSetCookie(array $setCookies, $uri = null)
{
$cookies = [];
foreach ($setCookies as $cookie) {
foreach (explode(',', $cookie) as $i => $part) {
if (0 === $i || preg_match('/^(?P<token>\s*[0-9A-Za-z!#\$%\&\'\*\+\-\.^_`\|~]+)=/', $part)) {
... | [
"public",
"function",
"updateFromSetCookie",
"(",
"array",
"$",
"setCookies",
",",
"$",
"uri",
"=",
"null",
")",
"{",
"$",
"cookies",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"setCookies",
"as",
"$",
"cookie",
")",
"{",
"foreach",
"(",
"explode",
"(",
... | Updates the cookie jar from a response Set-Cookie headers.
@param array $setCookies Set-Cookie headers from an HTTP response
@param string $uri The base URL | [
"Updates",
"the",
"cookie",
"jar",
"from",
"a",
"response",
"Set",
"-",
"Cookie",
"headers",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/BrowserKit/CookieJar.php#L117-L138 |
206,889 | symfony/symfony | src/Symfony/Component/BrowserKit/CookieJar.php | CookieJar.updateFromResponse | public function updateFromResponse(Response $response, $uri = null)
{
$this->updateFromSetCookie($response->getHeader('Set-Cookie', false), $uri);
} | php | public function updateFromResponse(Response $response, $uri = null)
{
$this->updateFromSetCookie($response->getHeader('Set-Cookie', false), $uri);
} | [
"public",
"function",
"updateFromResponse",
"(",
"Response",
"$",
"response",
",",
"$",
"uri",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"updateFromSetCookie",
"(",
"$",
"response",
"->",
"getHeader",
"(",
"'Set-Cookie'",
",",
"false",
")",
",",
"$",
"uri"... | Updates the cookie jar from a Response object.
@param Response $response A Response object
@param string $uri The base URL | [
"Updates",
"the",
"cookie",
"jar",
"from",
"a",
"Response",
"object",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/BrowserKit/CookieJar.php#L146-L149 |
206,890 | symfony/symfony | src/Symfony/Component/BrowserKit/CookieJar.php | CookieJar.flushExpiredCookies | public function flushExpiredCookies()
{
foreach ($this->cookieJar as $domain => $pathCookies) {
foreach ($pathCookies as $path => $namedCookies) {
foreach ($namedCookies as $name => $cookie) {
if ($cookie->isExpired()) {
unset($this->co... | php | public function flushExpiredCookies()
{
foreach ($this->cookieJar as $domain => $pathCookies) {
foreach ($pathCookies as $path => $namedCookies) {
foreach ($namedCookies as $name => $cookie) {
if ($cookie->isExpired()) {
unset($this->co... | [
"public",
"function",
"flushExpiredCookies",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"cookieJar",
"as",
"$",
"domain",
"=>",
"$",
"pathCookies",
")",
"{",
"foreach",
"(",
"$",
"pathCookies",
"as",
"$",
"path",
"=>",
"$",
"namedCookies",
")",
"{... | Removes all expired cookies. | [
"Removes",
"all",
"expired",
"cookies",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/BrowserKit/CookieJar.php#L227-L238 |
206,891 | symfony/symfony | src/Symfony/Component/Form/Util/ServerParams.php | ServerParams.hasPostMaxSizeBeenExceeded | public function hasPostMaxSizeBeenExceeded()
{
$contentLength = $this->getContentLength();
$maxContentLength = $this->getPostMaxSize();
return $maxContentLength && $contentLength > $maxContentLength;
} | php | public function hasPostMaxSizeBeenExceeded()
{
$contentLength = $this->getContentLength();
$maxContentLength = $this->getPostMaxSize();
return $maxContentLength && $contentLength > $maxContentLength;
} | [
"public",
"function",
"hasPostMaxSizeBeenExceeded",
"(",
")",
"{",
"$",
"contentLength",
"=",
"$",
"this",
"->",
"getContentLength",
"(",
")",
";",
"$",
"maxContentLength",
"=",
"$",
"this",
"->",
"getPostMaxSize",
"(",
")",
";",
"return",
"$",
"maxContentLeng... | Returns true if the POST max size has been exceeded in the request.
@return bool | [
"Returns",
"true",
"if",
"the",
"POST",
"max",
"size",
"has",
"been",
"exceeded",
"in",
"the",
"request",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Util/ServerParams.php#L33-L39 |
206,892 | symfony/symfony | src/Symfony/Component/Form/Util/ServerParams.php | ServerParams.getPostMaxSize | public function getPostMaxSize()
{
$iniMax = strtolower($this->getNormalizedIniPostMaxSize());
if ('' === $iniMax) {
return;
}
$max = ltrim($iniMax, '+');
if (0 === strpos($max, '0x')) {
$max = \intval($max, 16);
} elseif (0 === strpos($max, ... | php | public function getPostMaxSize()
{
$iniMax = strtolower($this->getNormalizedIniPostMaxSize());
if ('' === $iniMax) {
return;
}
$max = ltrim($iniMax, '+');
if (0 === strpos($max, '0x')) {
$max = \intval($max, 16);
} elseif (0 === strpos($max, ... | [
"public",
"function",
"getPostMaxSize",
"(",
")",
"{",
"$",
"iniMax",
"=",
"strtolower",
"(",
"$",
"this",
"->",
"getNormalizedIniPostMaxSize",
"(",
")",
")",
";",
"if",
"(",
"''",
"===",
"$",
"iniMax",
")",
"{",
"return",
";",
"}",
"$",
"max",
"=",
... | Returns maximum post size in bytes.
@return int|null The maximum post size in bytes | [
"Returns",
"maximum",
"post",
"size",
"in",
"bytes",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Util/ServerParams.php#L46-L74 |
206,893 | symfony/symfony | src/Symfony/Component/Form/Util/ServerParams.php | ServerParams.getContentLength | public function getContentLength()
{
if (null !== $this->requestStack && null !== $request = $this->requestStack->getCurrentRequest()) {
return $request->server->get('CONTENT_LENGTH');
}
return isset($_SERVER['CONTENT_LENGTH'])
? (int) $_SERVER['CONTENT_LENGTH']
... | php | public function getContentLength()
{
if (null !== $this->requestStack && null !== $request = $this->requestStack->getCurrentRequest()) {
return $request->server->get('CONTENT_LENGTH');
}
return isset($_SERVER['CONTENT_LENGTH'])
? (int) $_SERVER['CONTENT_LENGTH']
... | [
"public",
"function",
"getContentLength",
"(",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"requestStack",
"&&",
"null",
"!==",
"$",
"request",
"=",
"$",
"this",
"->",
"requestStack",
"->",
"getCurrentRequest",
"(",
")",
")",
"{",
"return",
"$... | Returns the content length of the request.
@return mixed The request content length | [
"Returns",
"the",
"content",
"length",
"of",
"the",
"request",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Util/ServerParams.php#L91-L100 |
206,894 | symfony/symfony | src/Symfony/Component/Validator/Mapping/Loader/AbstractLoader.php | AbstractLoader.newConstraint | protected function newConstraint($name, $options = null)
{
if (false !== strpos($name, '\\') && class_exists($name)) {
$className = (string) $name;
} elseif (false !== strpos($name, ':')) {
list($prefix, $className) = explode(':', $name, 2);
if (!isset($this->nam... | php | protected function newConstraint($name, $options = null)
{
if (false !== strpos($name, '\\') && class_exists($name)) {
$className = (string) $name;
} elseif (false !== strpos($name, ':')) {
list($prefix, $className) = explode(':', $name, 2);
if (!isset($this->nam... | [
"protected",
"function",
"newConstraint",
"(",
"$",
"name",
",",
"$",
"options",
"=",
"null",
")",
"{",
"if",
"(",
"false",
"!==",
"strpos",
"(",
"$",
"name",
",",
"'\\\\'",
")",
"&&",
"class_exists",
"(",
"$",
"name",
")",
")",
"{",
"$",
"className"... | Creates a new constraint instance for the given constraint name.
@param string $name The constraint name. Either a constraint relative
to the default constraint namespace, or a fully
qualified class name. Alternatively, the constraint
may be preceded by a namespace alias and a colon.
The namespace alias must have b... | [
"Creates",
"a",
"new",
"constraint",
"instance",
"for",
"the",
"given",
"constraint",
"name",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Validator/Mapping/Loader/AbstractLoader.php#L70-L87 |
206,895 | symfony/symfony | src/Symfony/Component/Validator/Mapping/Loader/YamlFileLoader.php | YamlFileLoader.parseNodes | protected function parseNodes(array $nodes)
{
$values = [];
foreach ($nodes as $name => $childNodes) {
if (is_numeric($name) && \is_array($childNodes) && 1 === \count($childNodes)) {
$options = current($childNodes);
if (\is_array($options)) {
... | php | protected function parseNodes(array $nodes)
{
$values = [];
foreach ($nodes as $name => $childNodes) {
if (is_numeric($name) && \is_array($childNodes) && 1 === \count($childNodes)) {
$options = current($childNodes);
if (\is_array($options)) {
... | [
"protected",
"function",
"parseNodes",
"(",
"array",
"$",
"nodes",
")",
"{",
"$",
"values",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"nodes",
"as",
"$",
"name",
"=>",
"$",
"childNodes",
")",
"{",
"if",
"(",
"is_numeric",
"(",
"$",
"name",
")",
"&&"... | Parses a collection of YAML nodes.
@param array $nodes The YAML nodes
@return array An array of values or Constraint instances | [
"Parses",
"a",
"collection",
"of",
"YAML",
"nodes",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Validator/Mapping/Loader/YamlFileLoader.php#L81-L104 |
206,896 | symfony/symfony | src/Symfony/Component/Validator/Mapping/Loader/YamlFileLoader.php | YamlFileLoader.parseFile | private function parseFile($path)
{
try {
$classes = $this->yamlParser->parseFile($path, Yaml::PARSE_CONSTANT);
} catch (ParseException $e) {
throw new \InvalidArgumentException(sprintf('The file "%s" does not contain valid YAML.', $path), 0, $e);
}
// empty ... | php | private function parseFile($path)
{
try {
$classes = $this->yamlParser->parseFile($path, Yaml::PARSE_CONSTANT);
} catch (ParseException $e) {
throw new \InvalidArgumentException(sprintf('The file "%s" does not contain valid YAML.', $path), 0, $e);
}
// empty ... | [
"private",
"function",
"parseFile",
"(",
"$",
"path",
")",
"{",
"try",
"{",
"$",
"classes",
"=",
"$",
"this",
"->",
"yamlParser",
"->",
"parseFile",
"(",
"$",
"path",
",",
"Yaml",
"::",
"PARSE_CONSTANT",
")",
";",
"}",
"catch",
"(",
"ParseException",
"... | Loads the YAML class descriptions from the given file.
@param string $path The path of the YAML file
@return array The class descriptions
@throws \InvalidArgumentException If the file could not be loaded or did
not contain a YAML array | [
"Loads",
"the",
"YAML",
"class",
"descriptions",
"from",
"the",
"given",
"file",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Validator/Mapping/Loader/YamlFileLoader.php#L116-L135 |
206,897 | symfony/symfony | src/Symfony/Component/Validator/Mapping/GenericMetadata.php | GenericMetadata.addConstraint | public function addConstraint(Constraint $constraint)
{
if ($constraint instanceof Traverse) {
throw new ConstraintDefinitionException(sprintf('The constraint "%s" can only be put on classes. Please use "Symfony\Component\Validator\Constraints\Valid" instead.', \get_class($constraint)));
... | php | public function addConstraint(Constraint $constraint)
{
if ($constraint instanceof Traverse) {
throw new ConstraintDefinitionException(sprintf('The constraint "%s" can only be put on classes. Please use "Symfony\Component\Validator\Constraints\Valid" instead.', \get_class($constraint)));
... | [
"public",
"function",
"addConstraint",
"(",
"Constraint",
"$",
"constraint",
")",
"{",
"if",
"(",
"$",
"constraint",
"instanceof",
"Traverse",
")",
"{",
"throw",
"new",
"ConstraintDefinitionException",
"(",
"sprintf",
"(",
"'The constraint \"%s\" can only be put on clas... | Adds a constraint.
If the constraint {@link Valid} is added, the cascading strategy will be
changed to {@link CascadingStrategy::CASCADE}. Depending on the
$traverse property of that constraint, the traversal strategy
will be set to one of the following:
- {@link TraversalStrategy::IMPLICIT} if $traverse is enabled
-... | [
"Adds",
"a",
"constraint",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Validator/Mapping/GenericMetadata.php#L122-L147 |
206,898 | symfony/symfony | src/Symfony/Component/DomCrawler/AbstractUriElement.php | AbstractUriElement.cleanupQuery | private function cleanupQuery(string $uri): string
{
if (false !== $pos = strpos($uri, '?')) {
return substr($uri, 0, $pos);
}
return $uri;
} | php | private function cleanupQuery(string $uri): string
{
if (false !== $pos = strpos($uri, '?')) {
return substr($uri, 0, $pos);
}
return $uri;
} | [
"private",
"function",
"cleanupQuery",
"(",
"string",
"$",
"uri",
")",
":",
"string",
"{",
"if",
"(",
"false",
"!==",
"$",
"pos",
"=",
"strpos",
"(",
"$",
"uri",
",",
"'?'",
")",
")",
"{",
"return",
"substr",
"(",
"$",
"uri",
",",
"0",
",",
"$",
... | Remove the query string from the uri. | [
"Remove",
"the",
"query",
"string",
"from",
"the",
"uri",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DomCrawler/AbstractUriElement.php#L182-L189 |
206,899 | symfony/symfony | src/Symfony/Component/DomCrawler/AbstractUriElement.php | AbstractUriElement.cleanupAnchor | private function cleanupAnchor(string $uri): string
{
if (false !== $pos = strpos($uri, '#')) {
return substr($uri, 0, $pos);
}
return $uri;
} | php | private function cleanupAnchor(string $uri): string
{
if (false !== $pos = strpos($uri, '#')) {
return substr($uri, 0, $pos);
}
return $uri;
} | [
"private",
"function",
"cleanupAnchor",
"(",
"string",
"$",
"uri",
")",
":",
"string",
"{",
"if",
"(",
"false",
"!==",
"$",
"pos",
"=",
"strpos",
"(",
"$",
"uri",
",",
"'#'",
")",
")",
"{",
"return",
"substr",
"(",
"$",
"uri",
",",
"0",
",",
"$",... | Remove the anchor from the uri. | [
"Remove",
"the",
"anchor",
"from",
"the",
"uri",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DomCrawler/AbstractUriElement.php#L194-L201 |
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.