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,900 | symfony/symfony | src/Symfony/Component/Form/Extension/Core/DataTransformer/DateIntervalToStringTransformer.php | DateIntervalToStringTransformer.transform | public function transform($value)
{
if (null === $value) {
return '';
}
if (!$value instanceof \DateInterval) {
throw new UnexpectedTypeException($value, '\DateInterval');
}
return $value->format($this->format);
} | php | public function transform($value)
{
if (null === $value) {
return '';
}
if (!$value instanceof \DateInterval) {
throw new UnexpectedTypeException($value, '\DateInterval');
}
return $value->format($this->format);
} | [
"public",
"function",
"transform",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"value",
")",
"{",
"return",
"''",
";",
"}",
"if",
"(",
"!",
"$",
"value",
"instanceof",
"\\",
"DateInterval",
")",
"{",
"throw",
"new",
"UnexpectedTypeExcep... | Transforms a DateInterval object into a date string with the configured format.
@param \DateInterval $value A DateInterval object
@return string An ISO 8601 or relative date string like date interval presentation
@throws UnexpectedTypeException if the given value is not a \DateInterval instance | [
"Transforms",
"a",
"DateInterval",
"object",
"into",
"a",
"date",
"string",
"with",
"the",
"configured",
"format",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateIntervalToStringTransformer.php#L48-L58 |
206,901 | symfony/symfony | src/Symfony/Component/Form/Extension/Core/DataTransformer/DateIntervalToStringTransformer.php | DateIntervalToStringTransformer.reverseTransform | public function reverseTransform($value)
{
if (null === $value) {
return;
}
if (!\is_string($value)) {
throw new UnexpectedTypeException($value, 'string');
}
if ('' === $value) {
return;
}
if (!$this->isISO8601($value)) {
... | php | public function reverseTransform($value)
{
if (null === $value) {
return;
}
if (!\is_string($value)) {
throw new UnexpectedTypeException($value, 'string');
}
if ('' === $value) {
return;
}
if (!$this->isISO8601($value)) {
... | [
"public",
"function",
"reverseTransform",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"value",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"\\",
"is_string",
"(",
"$",
"value",
")",
")",
"{",
"throw",
"new",
"UnexpectedTypeException",... | Transforms a date string in the configured format into a DateInterval object.
@param string $value An ISO 8601 or date string like date interval presentation
@return \DateInterval An instance of \DateInterval
@throws UnexpectedTypeException if the given value is not a string
@throws TransformationFailedExcepti... | [
"Transforms",
"a",
"date",
"string",
"in",
"the",
"configured",
"format",
"into",
"a",
"DateInterval",
"object",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateIntervalToStringTransformer.php#L70-L95 |
206,902 | symfony/symfony | src/Symfony/Component/Console/Output/ConsoleSectionOutput.php | ConsoleSectionOutput.clear | public function clear(int $lines = null)
{
if (empty($this->content) || !$this->isDecorated()) {
return;
}
if ($lines) {
\array_splice($this->content, -($lines * 2)); // Multiply lines by 2 to cater for each new line added between content
} else {
... | php | public function clear(int $lines = null)
{
if (empty($this->content) || !$this->isDecorated()) {
return;
}
if ($lines) {
\array_splice($this->content, -($lines * 2)); // Multiply lines by 2 to cater for each new line added between content
} else {
... | [
"public",
"function",
"clear",
"(",
"int",
"$",
"lines",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"content",
")",
"||",
"!",
"$",
"this",
"->",
"isDecorated",
"(",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"$",
"li... | Clears previous output for this section.
@param int $lines Number of lines to clear. If null, then the entire output of this section is cleared | [
"Clears",
"previous",
"output",
"for",
"this",
"section",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Output/ConsoleSectionOutput.php#L46-L62 |
206,903 | symfony/symfony | src/Symfony/Component/Console/Output/ConsoleSectionOutput.php | ConsoleSectionOutput.popStreamContentUntilCurrentSection | private function popStreamContentUntilCurrentSection(int $numberOfLinesToClearFromCurrentSection = 0): string
{
$numberOfLinesToClear = $numberOfLinesToClearFromCurrentSection;
$erasedContent = [];
foreach ($this->sections as $section) {
if ($section === $this) {
... | php | private function popStreamContentUntilCurrentSection(int $numberOfLinesToClearFromCurrentSection = 0): string
{
$numberOfLinesToClear = $numberOfLinesToClearFromCurrentSection;
$erasedContent = [];
foreach ($this->sections as $section) {
if ($section === $this) {
... | [
"private",
"function",
"popStreamContentUntilCurrentSection",
"(",
"int",
"$",
"numberOfLinesToClearFromCurrentSection",
"=",
"0",
")",
":",
"string",
"{",
"$",
"numberOfLinesToClear",
"=",
"$",
"numberOfLinesToClearFromCurrentSection",
";",
"$",
"erasedContent",
"=",
"["... | At initial stage, cursor is at the end of stream output. This method makes cursor crawl upwards until it hits
current section. Then it erases content it crawled through. Optionally, it erases part of current section too. | [
"At",
"initial",
"stage",
"cursor",
"is",
"at",
"the",
"end",
"of",
"stream",
"output",
".",
"This",
"method",
"makes",
"cursor",
"crawl",
"upwards",
"until",
"it",
"hits",
"current",
"section",
".",
"Then",
"it",
"erases",
"content",
"it",
"crawled",
"thr... | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Output/ConsoleSectionOutput.php#L113-L135 |
206,904 | symfony/symfony | src/Symfony/Component/Translation/Dumper/FileDumper.php | FileDumper.getRelativePath | private function getRelativePath(string $domain, string $locale): string
{
return strtr($this->relativePathTemplate, [
'%domain%' => $domain,
'%locale%' => $locale,
'%extension%' => $this->getExtension(),
]);
} | php | private function getRelativePath(string $domain, string $locale): string
{
return strtr($this->relativePathTemplate, [
'%domain%' => $domain,
'%locale%' => $locale,
'%extension%' => $this->getExtension(),
]);
} | [
"private",
"function",
"getRelativePath",
"(",
"string",
"$",
"domain",
",",
"string",
"$",
"locale",
")",
":",
"string",
"{",
"return",
"strtr",
"(",
"$",
"this",
"->",
"relativePathTemplate",
",",
"[",
"'%domain%'",
"=>",
"$",
"domain",
",",
"'%locale%'",
... | Gets the relative file path using the template. | [
"Gets",
"the",
"relative",
"file",
"path",
"using",
"the",
"template",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Translation/Dumper/FileDumper.php#L124-L131 |
206,905 | symfony/symfony | src/Symfony/Component/Finder/Gitignore.php | Gitignore.toRegex | public static function toRegex(string $gitignoreFileContent): string
{
$gitignoreFileContent = preg_replace('/^[^\\\\]*#.*/', '', $gitignoreFileContent);
$gitignoreLines = preg_split('/\r\n|\r|\n/', $gitignoreFileContent);
$gitignoreLines = array_map('trim', $gitignoreLines);
$gitign... | php | public static function toRegex(string $gitignoreFileContent): string
{
$gitignoreFileContent = preg_replace('/^[^\\\\]*#.*/', '', $gitignoreFileContent);
$gitignoreLines = preg_split('/\r\n|\r|\n/', $gitignoreFileContent);
$gitignoreLines = array_map('trim', $gitignoreLines);
$gitign... | [
"public",
"static",
"function",
"toRegex",
"(",
"string",
"$",
"gitignoreFileContent",
")",
":",
"string",
"{",
"$",
"gitignoreFileContent",
"=",
"preg_replace",
"(",
"'/^[^\\\\\\\\]*#.*/'",
",",
"''",
",",
"$",
"gitignoreFileContent",
")",
";",
"$",
"gitignoreLin... | Returns a regexp which is the equivalent of the gitignore pattern.
@param string $gitignoreFileContent
@return string The regexp | [
"Returns",
"a",
"regexp",
"which",
"is",
"the",
"equivalent",
"of",
"the",
"gitignore",
"pattern",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Finder/Gitignore.php#L28-L58 |
206,906 | symfony/symfony | src/Symfony/Component/Console/Input/ArgvInput.php | ArgvInput.parseShortOptionSet | private function parseShortOptionSet($name)
{
$len = \strlen($name);
for ($i = 0; $i < $len; ++$i) {
if (!$this->definition->hasShortcut($name[$i])) {
$encoding = mb_detect_encoding($name, null, true);
throw new RuntimeException(sprintf('The "-%s" option d... | php | private function parseShortOptionSet($name)
{
$len = \strlen($name);
for ($i = 0; $i < $len; ++$i) {
if (!$this->definition->hasShortcut($name[$i])) {
$encoding = mb_detect_encoding($name, null, true);
throw new RuntimeException(sprintf('The "-%s" option d... | [
"private",
"function",
"parseShortOptionSet",
"(",
"$",
"name",
")",
"{",
"$",
"len",
"=",
"\\",
"strlen",
"(",
"$",
"name",
")",
";",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"$",
"len",
";",
"++",
"$",
"i",
")",
"{",
"if",
"(",
... | Parses a short option set.
@param string $name The current token
@throws RuntimeException When option given doesn't exist | [
"Parses",
"a",
"short",
"option",
"set",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Input/ArgvInput.php#L119-L137 |
206,907 | symfony/symfony | src/Symfony/Component/Console/Input/ArgvInput.php | ArgvInput.parseLongOption | private function parseLongOption($token)
{
$name = substr($token, 2);
if (false !== $pos = strpos($name, '=')) {
if (0 === \strlen($value = substr($name, $pos + 1))) {
array_unshift($this->parsed, $value);
}
$this->addLongOption(substr($name, 0, $... | php | private function parseLongOption($token)
{
$name = substr($token, 2);
if (false !== $pos = strpos($name, '=')) {
if (0 === \strlen($value = substr($name, $pos + 1))) {
array_unshift($this->parsed, $value);
}
$this->addLongOption(substr($name, 0, $... | [
"private",
"function",
"parseLongOption",
"(",
"$",
"token",
")",
"{",
"$",
"name",
"=",
"substr",
"(",
"$",
"token",
",",
"2",
")",
";",
"if",
"(",
"false",
"!==",
"$",
"pos",
"=",
"strpos",
"(",
"$",
"name",
",",
"'='",
")",
")",
"{",
"if",
"... | Parses a long option.
@param string $token The current token | [
"Parses",
"a",
"long",
"option",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Input/ArgvInput.php#L144-L156 |
206,908 | symfony/symfony | src/Symfony/Component/Console/Input/ArgvInput.php | ArgvInput.parseArgument | private function parseArgument($token)
{
$c = \count($this->arguments);
// if input is expecting another argument, add it
if ($this->definition->hasArgument($c)) {
$arg = $this->definition->getArgument($c);
$this->arguments[$arg->getName()] = $arg->isArray() ? [$toke... | php | private function parseArgument($token)
{
$c = \count($this->arguments);
// if input is expecting another argument, add it
if ($this->definition->hasArgument($c)) {
$arg = $this->definition->getArgument($c);
$this->arguments[$arg->getName()] = $arg->isArray() ? [$toke... | [
"private",
"function",
"parseArgument",
"(",
"$",
"token",
")",
"{",
"$",
"c",
"=",
"\\",
"count",
"(",
"$",
"this",
"->",
"arguments",
")",
";",
"// if input is expecting another argument, add it",
"if",
"(",
"$",
"this",
"->",
"definition",
"->",
"hasArgumen... | Parses an argument.
@param string $token The current token
@throws RuntimeException When too many arguments are given | [
"Parses",
"an",
"argument",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Input/ArgvInput.php#L165-L188 |
206,909 | symfony/symfony | src/Symfony/Component/Intl/Locale/Locale.php | Locale.canonicalize | public static function canonicalize($locale)
{
$locale = (string) $locale;
if ('' === $locale || '.' === $locale[0]) {
return self::getDefault();
}
if (!preg_match('/^([a-z]{2})[-_]([a-z]{2})(?:([a-z]{2})(?:[-_]([a-z]{2}))?)?(?:\..*)?$/i', $locale, $m)) {
re... | php | public static function canonicalize($locale)
{
$locale = (string) $locale;
if ('' === $locale || '.' === $locale[0]) {
return self::getDefault();
}
if (!preg_match('/^([a-z]{2})[-_]([a-z]{2})(?:([a-z]{2})(?:[-_]([a-z]{2}))?)?(?:\..*)?$/i', $locale, $m)) {
re... | [
"public",
"static",
"function",
"canonicalize",
"(",
"$",
"locale",
")",
"{",
"$",
"locale",
"=",
"(",
"string",
")",
"$",
"locale",
";",
"if",
"(",
"''",
"===",
"$",
"locale",
"||",
"'.'",
"===",
"$",
"locale",
"[",
"0",
"]",
")",
"{",
"return",
... | Returns a canonicalized locale string.
This polyfill doesn't implement the full-spec algorithm. It only
canonicalizes locale strings handled by the `LocaleBundle` class.
@param string $locale
@return string | [
"Returns",
"a",
"canonicalized",
"locale",
"string",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Intl/Locale/Locale.php#L70-L91 |
206,910 | symfony/symfony | src/Symfony/Component/Console/Question/ChoiceQuestion.php | ChoiceQuestion.setMultiselect | public function setMultiselect($multiselect)
{
$this->multiselect = $multiselect;
$this->setValidator($this->getDefaultValidator());
return $this;
} | php | public function setMultiselect($multiselect)
{
$this->multiselect = $multiselect;
$this->setValidator($this->getDefaultValidator());
return $this;
} | [
"public",
"function",
"setMultiselect",
"(",
"$",
"multiselect",
")",
"{",
"$",
"this",
"->",
"multiselect",
"=",
"$",
"multiselect",
";",
"$",
"this",
"->",
"setValidator",
"(",
"$",
"this",
"->",
"getDefaultValidator",
"(",
")",
")",
";",
"return",
"$",
... | Sets multiselect option.
When multiselect is set to true, multiple choices can be answered.
@param bool $multiselect
@return $this | [
"Sets",
"multiselect",
"option",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Question/ChoiceQuestion.php#L65-L71 |
206,911 | symfony/symfony | src/Symfony/Component/Console/Question/ChoiceQuestion.php | ChoiceQuestion.setErrorMessage | public function setErrorMessage($errorMessage)
{
$this->errorMessage = $errorMessage;
$this->setValidator($this->getDefaultValidator());
return $this;
} | php | public function setErrorMessage($errorMessage)
{
$this->errorMessage = $errorMessage;
$this->setValidator($this->getDefaultValidator());
return $this;
} | [
"public",
"function",
"setErrorMessage",
"(",
"$",
"errorMessage",
")",
"{",
"$",
"this",
"->",
"errorMessage",
"=",
"$",
"errorMessage",
";",
"$",
"this",
"->",
"setValidator",
"(",
"$",
"this",
"->",
"getDefaultValidator",
"(",
")",
")",
";",
"return",
"... | Sets the error message for invalid values.
The error message has a string placeholder (%s) for the invalid value.
@param string $errorMessage
@return $this | [
"Sets",
"the",
"error",
"message",
"for",
"invalid",
"values",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Question/ChoiceQuestion.php#L116-L122 |
206,912 | symfony/symfony | src/Symfony/Component/Routing/Matcher/Dumper/CompiledUrlMatcherDumper.php | CompiledUrlMatcherDumper.getCompiledRoutes | public function getCompiledRoutes(bool $forDump = false): array
{
// Group hosts by same-suffix, re-order when possible
$matchHost = false;
$routes = new StaticPrefixCollection();
foreach ($this->getRoutes()->all() as $name => $route) {
if ($host = $route->getHost()) {
... | php | public function getCompiledRoutes(bool $forDump = false): array
{
// Group hosts by same-suffix, re-order when possible
$matchHost = false;
$routes = new StaticPrefixCollection();
foreach ($this->getRoutes()->all() as $name => $route) {
if ($host = $route->getHost()) {
... | [
"public",
"function",
"getCompiledRoutes",
"(",
"bool",
"$",
"forDump",
"=",
"false",
")",
":",
"array",
"{",
"// Group hosts by same-suffix, re-order when possible",
"$",
"matchHost",
"=",
"false",
";",
"$",
"routes",
"=",
"new",
"StaticPrefixCollection",
"(",
")",... | Generates the arrays for CompiledUrlMatcher's constructor. | [
"Generates",
"the",
"arrays",
"for",
"CompiledUrlMatcher",
"s",
"constructor",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Routing/Matcher/Dumper/CompiledUrlMatcherDumper.php#L64-L130 |
206,913 | symfony/symfony | src/Symfony/Component/Cache/Traits/PdoTrait.php | PdoTrait.createTable | public function createTable()
{
// connect if we are not yet
$conn = $this->getConnection();
if ($conn instanceof Connection) {
$types = [
'mysql' => 'binary',
'sqlite' => 'text',
'pgsql' => 'string',
'oci' => 'stri... | php | public function createTable()
{
// connect if we are not yet
$conn = $this->getConnection();
if ($conn instanceof Connection) {
$types = [
'mysql' => 'binary',
'sqlite' => 'text',
'pgsql' => 'string',
'oci' => 'stri... | [
"public",
"function",
"createTable",
"(",
")",
"{",
"// connect if we are not yet",
"$",
"conn",
"=",
"$",
"this",
"->",
"getConnection",
"(",
")",
";",
"if",
"(",
"$",
"conn",
"instanceof",
"Connection",
")",
"{",
"$",
"types",
"=",
"[",
"'mysql'",
"=>",
... | Creates the table to store cache items which can be called once for setup.
Cache ID are saved in a column of maximum length 255. Cache data is
saved in a BLOB.
@throws \PDOException When the table already exists
@throws DBALException When the table already exists
@throws \DomainException When an unsupported PDO... | [
"Creates",
"the",
"table",
"to",
"store",
"cache",
"items",
"which",
"can",
"be",
"called",
"once",
"for",
"setup",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Cache/Traits/PdoTrait.php#L87-L145 |
206,914 | symfony/symfony | src/Symfony/Bridge/Monolog/Handler/ChromePhpHandler.php | ChromePhpHandler.onKernelResponse | public function onKernelResponse(FilterResponseEvent $event)
{
if (!$event->isMasterRequest()) {
return;
}
if (!preg_match(static::USER_AGENT_REGEX, $event->getRequest()->headers->get('User-Agent'))) {
$this->sendHeaders = false;
$this->headers = [];
... | php | public function onKernelResponse(FilterResponseEvent $event)
{
if (!$event->isMasterRequest()) {
return;
}
if (!preg_match(static::USER_AGENT_REGEX, $event->getRequest()->headers->get('User-Agent'))) {
$this->sendHeaders = false;
$this->headers = [];
... | [
"public",
"function",
"onKernelResponse",
"(",
"FilterResponseEvent",
"$",
"event",
")",
"{",
"if",
"(",
"!",
"$",
"event",
"->",
"isMasterRequest",
"(",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"preg_match",
"(",
"static",
"::",
"USER_AGENT_REGE... | Adds the headers to the response once it's created. | [
"Adds",
"the",
"headers",
"to",
"the",
"response",
"once",
"it",
"s",
"created",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bridge/Monolog/Handler/ChromePhpHandler.php#L37-L55 |
206,915 | symfony/symfony | src/Symfony/Component/Intl/Data/Bundle/Writer/TextBundleWriter.php | TextBundleWriter.writeResourceBundle | private function writeResourceBundle($file, $bundleName, $value, $fallback)
{
fwrite($file, $bundleName);
$this->writeTable($file, $value, 0, $fallback);
fwrite($file, "\n");
} | php | private function writeResourceBundle($file, $bundleName, $value, $fallback)
{
fwrite($file, $bundleName);
$this->writeTable($file, $value, 0, $fallback);
fwrite($file, "\n");
} | [
"private",
"function",
"writeResourceBundle",
"(",
"$",
"file",
",",
"$",
"bundleName",
",",
"$",
"value",
",",
"$",
"fallback",
")",
"{",
"fwrite",
"(",
"$",
"file",
",",
"$",
"bundleName",
")",
";",
"$",
"this",
"->",
"writeTable",
"(",
"$",
"file",
... | Writes a "resourceBundle" node.
@param resource $file The file handle to write to
@param string $bundleName The name of the bundle
@param mixed $value The value of the node
@param bool $fallback Whether the resource bundle should be merged
with the fallback locale
@see http://source.icu-project.... | [
"Writes",
"a",
"resourceBundle",
"node",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Intl/Data/Bundle/Writer/TextBundleWriter.php#L54-L61 |
206,916 | symfony/symfony | src/Symfony/Component/Intl/Data/Bundle/Writer/TextBundleWriter.php | TextBundleWriter.writeResource | private function writeResource($file, $value, $indentation, $requireBraces = true)
{
if (\is_int($value)) {
$this->writeInteger($file, $value);
return;
}
if ($value instanceof \Traversable) {
$value = iterator_to_array($value);
}
if (\is... | php | private function writeResource($file, $value, $indentation, $requireBraces = true)
{
if (\is_int($value)) {
$this->writeInteger($file, $value);
return;
}
if ($value instanceof \Traversable) {
$value = iterator_to_array($value);
}
if (\is... | [
"private",
"function",
"writeResource",
"(",
"$",
"file",
",",
"$",
"value",
",",
"$",
"indentation",
",",
"$",
"requireBraces",
"=",
"true",
")",
"{",
"if",
"(",
"\\",
"is_int",
"(",
"$",
"value",
")",
")",
"{",
"$",
"this",
"->",
"writeInteger",
"(... | Writes a "resource" node.
@param resource $file The file handle to write to
@param mixed $value The value of the node
@param int $indentation The number of levels to indent
@param bool $requireBraces Whether to require braces to be printedaround the value
@see http://source.icu-project.... | [
"Writes",
"a",
"resource",
"node",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Intl/Data/Bundle/Writer/TextBundleWriter.php#L73-L115 |
206,917 | symfony/symfony | src/Symfony/Component/Intl/Data/Bundle/Writer/TextBundleWriter.php | TextBundleWriter.writeIntVector | private function writeIntVector($file, array $value, $indentation)
{
fwrite($file, ":intvector{\n");
foreach ($value as $int) {
fprintf($file, "%s%d,\n", str_repeat(' ', $indentation + 1), $int);
}
fprintf($file, '%s}', str_repeat(' ', $indentation));
} | php | private function writeIntVector($file, array $value, $indentation)
{
fwrite($file, ":intvector{\n");
foreach ($value as $int) {
fprintf($file, "%s%d,\n", str_repeat(' ', $indentation + 1), $int);
}
fprintf($file, '%s}', str_repeat(' ', $indentation));
} | [
"private",
"function",
"writeIntVector",
"(",
"$",
"file",
",",
"array",
"$",
"value",
",",
"$",
"indentation",
")",
"{",
"fwrite",
"(",
"$",
"file",
",",
"\":intvector{\\n\"",
")",
";",
"foreach",
"(",
"$",
"value",
"as",
"$",
"int",
")",
"{",
"fprint... | Writes an "intvector" node.
@param resource $file The file handle to write to
@param array $value The value of the node
@param int $indentation The number of levels to indent
@see http://source.icu-project.org/repos/icu/icuhtml/trunk/design/bnf_rb.txt | [
"Writes",
"an",
"intvector",
"node",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Intl/Data/Bundle/Writer/TextBundleWriter.php#L139-L148 |
206,918 | symfony/symfony | src/Symfony/Component/Intl/Data/Bundle/Writer/TextBundleWriter.php | TextBundleWriter.writeString | private function writeString($file, $value, $requireBraces = true)
{
if ($requireBraces) {
fprintf($file, '{"%s"}', $value);
return;
}
fprintf($file, '"%s"', $value);
} | php | private function writeString($file, $value, $requireBraces = true)
{
if ($requireBraces) {
fprintf($file, '{"%s"}', $value);
return;
}
fprintf($file, '"%s"', $value);
} | [
"private",
"function",
"writeString",
"(",
"$",
"file",
",",
"$",
"value",
",",
"$",
"requireBraces",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"requireBraces",
")",
"{",
"fprintf",
"(",
"$",
"file",
",",
"'{\"%s\"}'",
",",
"$",
"value",
")",
";",
"retu... | Writes a "string" node.
@param resource $file The file handle to write to
@param string $value The value of the node
@param bool $requireBraces Whether to require braces to be printed
around the value
@see http://source.icu-project.org/repos/icu/icuhtml/trunk/design/bnf_rb.txt | [
"Writes",
"a",
"string",
"node",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Intl/Data/Bundle/Writer/TextBundleWriter.php#L160-L169 |
206,919 | symfony/symfony | src/Symfony/Component/Intl/Data/Bundle/Writer/TextBundleWriter.php | TextBundleWriter.writeArray | private function writeArray($file, array $value, $indentation)
{
fwrite($file, "{\n");
foreach ($value as $entry) {
fwrite($file, str_repeat(' ', $indentation + 1));
$this->writeResource($file, $entry, $indentation + 1, false);
fwrite($file, ",\n");
... | php | private function writeArray($file, array $value, $indentation)
{
fwrite($file, "{\n");
foreach ($value as $entry) {
fwrite($file, str_repeat(' ', $indentation + 1));
$this->writeResource($file, $entry, $indentation + 1, false);
fwrite($file, ",\n");
... | [
"private",
"function",
"writeArray",
"(",
"$",
"file",
",",
"array",
"$",
"value",
",",
"$",
"indentation",
")",
"{",
"fwrite",
"(",
"$",
"file",
",",
"\"{\\n\"",
")",
";",
"foreach",
"(",
"$",
"value",
"as",
"$",
"entry",
")",
"{",
"fwrite",
"(",
... | Writes an "array" node.
@param resource $file The file handle to write to
@param array $value The value of the node
@param int $indentation The number of levels to indent
@see http://source.icu-project.org/repos/icu/icuhtml/trunk/design/bnf_rb.txt | [
"Writes",
"an",
"array",
"node",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Intl/Data/Bundle/Writer/TextBundleWriter.php#L180-L193 |
206,920 | symfony/symfony | src/Symfony/Component/Intl/Data/Bundle/Writer/TextBundleWriter.php | TextBundleWriter.writeTable | private function writeTable($file, $value, $indentation, $fallback = true)
{
if (!\is_array($value) && !$value instanceof \Traversable) {
throw new UnexpectedTypeException($value, 'array or \Traversable');
}
if (!$fallback) {
fwrite($file, ':table(nofallback)');
... | php | private function writeTable($file, $value, $indentation, $fallback = true)
{
if (!\is_array($value) && !$value instanceof \Traversable) {
throw new UnexpectedTypeException($value, 'array or \Traversable');
}
if (!$fallback) {
fwrite($file, ':table(nofallback)');
... | [
"private",
"function",
"writeTable",
"(",
"$",
"file",
",",
"$",
"value",
",",
"$",
"indentation",
",",
"$",
"fallback",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"\\",
"is_array",
"(",
"$",
"value",
")",
"&&",
"!",
"$",
"value",
"instanceof",
"\\",
"... | Writes a "table" node.
@param resource $file The file handle to write to
@param iterable $value The value of the node
@param int $indentation The number of levels to indent
@param bool $fallback Whether the table should be merged
with the fallback locale
@throws UnexpectedTypeException when $... | [
"Writes",
"a",
"table",
"node",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Intl/Data/Bundle/Writer/TextBundleWriter.php#L207-L235 |
206,921 | symfony/symfony | src/Symfony/Bridge/Twig/Extension/WorkflowExtension.php | WorkflowExtension.canTransition | public function canTransition($subject, $transitionName, $name = null)
{
return $this->workflowRegistry->get($subject, $name)->can($subject, $transitionName);
} | php | public function canTransition($subject, $transitionName, $name = null)
{
return $this->workflowRegistry->get($subject, $name)->can($subject, $transitionName);
} | [
"public",
"function",
"canTransition",
"(",
"$",
"subject",
",",
"$",
"transitionName",
",",
"$",
"name",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"workflowRegistry",
"->",
"get",
"(",
"$",
"subject",
",",
"$",
"name",
")",
"->",
"can",
"(",... | Returns true if the transition is enabled.
@param object $subject A subject
@param string $transitionName A transition
@param string $name A workflow name
@return bool true if the transition is enabled | [
"Returns",
"true",
"if",
"the",
"transition",
"is",
"enabled",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bridge/Twig/Extension/WorkflowExtension.php#L55-L58 |
206,922 | symfony/symfony | src/Symfony/Bridge/Twig/Extension/WorkflowExtension.php | WorkflowExtension.getEnabledTransitions | public function getEnabledTransitions($subject, $name = null)
{
return $this->workflowRegistry->get($subject, $name)->getEnabledTransitions($subject);
} | php | public function getEnabledTransitions($subject, $name = null)
{
return $this->workflowRegistry->get($subject, $name)->getEnabledTransitions($subject);
} | [
"public",
"function",
"getEnabledTransitions",
"(",
"$",
"subject",
",",
"$",
"name",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"workflowRegistry",
"->",
"get",
"(",
"$",
"subject",
",",
"$",
"name",
")",
"->",
"getEnabledTransitions",
"(",
"$",
... | Returns all enabled transitions.
@param object $subject A subject
@param string $name A workflow name
@return Transition[] All enabled transitions | [
"Returns",
"all",
"enabled",
"transitions",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bridge/Twig/Extension/WorkflowExtension.php#L68-L71 |
206,923 | symfony/symfony | src/Symfony/Bridge/Twig/Extension/WorkflowExtension.php | WorkflowExtension.hasMarkedPlace | public function hasMarkedPlace($subject, $placeName, $name = null)
{
return $this->workflowRegistry->get($subject, $name)->getMarking($subject)->has($placeName);
} | php | public function hasMarkedPlace($subject, $placeName, $name = null)
{
return $this->workflowRegistry->get($subject, $name)->getMarking($subject)->has($placeName);
} | [
"public",
"function",
"hasMarkedPlace",
"(",
"$",
"subject",
",",
"$",
"placeName",
",",
"$",
"name",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"workflowRegistry",
"->",
"get",
"(",
"$",
"subject",
",",
"$",
"name",
")",
"->",
"getMarking",
"... | Returns true if the place is marked.
@param object $subject A subject
@param string $placeName A place name
@param string $name A workflow name
@return bool true if the transition is enabled | [
"Returns",
"true",
"if",
"the",
"place",
"is",
"marked",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bridge/Twig/Extension/WorkflowExtension.php#L82-L85 |
206,924 | symfony/symfony | src/Symfony/Bridge/Twig/Extension/WorkflowExtension.php | WorkflowExtension.getMarkedPlaces | public function getMarkedPlaces($subject, $placesNameOnly = true, $name = null)
{
$places = $this->workflowRegistry->get($subject, $name)->getMarking($subject)->getPlaces();
if ($placesNameOnly) {
return array_keys($places);
}
return $places;
} | php | public function getMarkedPlaces($subject, $placesNameOnly = true, $name = null)
{
$places = $this->workflowRegistry->get($subject, $name)->getMarking($subject)->getPlaces();
if ($placesNameOnly) {
return array_keys($places);
}
return $places;
} | [
"public",
"function",
"getMarkedPlaces",
"(",
"$",
"subject",
",",
"$",
"placesNameOnly",
"=",
"true",
",",
"$",
"name",
"=",
"null",
")",
"{",
"$",
"places",
"=",
"$",
"this",
"->",
"workflowRegistry",
"->",
"get",
"(",
"$",
"subject",
",",
"$",
"name... | Returns marked places.
@param object $subject A subject
@param bool $placesNameOnly If true, returns only places name. If false returns the raw representation
@param string $name A workflow name
@return string[]|int[] | [
"Returns",
"marked",
"places",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bridge/Twig/Extension/WorkflowExtension.php#L96-L105 |
206,925 | symfony/symfony | src/Symfony/Bridge/Twig/Extension/WorkflowExtension.php | WorkflowExtension.getMetadata | public function getMetadata($subject, string $key, $metadataSubject = null, string $name = null): ?string
{
return $this
->workflowRegistry
->get($subject, $name)
->getMetadataStore()
->getMetadata($key, $metadataSubject)
;
} | php | public function getMetadata($subject, string $key, $metadataSubject = null, string $name = null): ?string
{
return $this
->workflowRegistry
->get($subject, $name)
->getMetadataStore()
->getMetadata($key, $metadataSubject)
;
} | [
"public",
"function",
"getMetadata",
"(",
"$",
"subject",
",",
"string",
"$",
"key",
",",
"$",
"metadataSubject",
"=",
"null",
",",
"string",
"$",
"name",
"=",
"null",
")",
":",
"?",
"string",
"{",
"return",
"$",
"this",
"->",
"workflowRegistry",
"->",
... | Returns the metadata for a specific subject.
@param object $subject A subject
@param string|Transition|null $metadataSubject Use null to get workflow metadata
Use a string (the place name) to get place metadata
Use a Transition instance to get transition metadata | [
"Returns",
"the",
"metadata",
"for",
"a",
"specific",
"subject",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bridge/Twig/Extension/WorkflowExtension.php#L115-L123 |
206,926 | symfony/symfony | src/Symfony/Component/Ldap/Adapter/ExtLdap/ConnectionOptions.php | ConnectionOptions.getOption | public static function getOption($name)
{
// Convert
$constantName = self::getOptionName($name);
if (!\defined($constantName)) {
throw new LdapException(sprintf('Unknown option "%s".', $name));
}
return \constant($constantName);
} | php | public static function getOption($name)
{
// Convert
$constantName = self::getOptionName($name);
if (!\defined($constantName)) {
throw new LdapException(sprintf('Unknown option "%s".', $name));
}
return \constant($constantName);
} | [
"public",
"static",
"function",
"getOption",
"(",
"$",
"name",
")",
"{",
"// Convert",
"$",
"constantName",
"=",
"self",
"::",
"getOptionName",
"(",
"$",
"name",
")",
";",
"if",
"(",
"!",
"\\",
"defined",
"(",
"$",
"constantName",
")",
")",
"{",
"throw... | Fetches an option's corresponding constant value from an option name.
The option name can either be in snake or camel case.
@param string $name
@return int
@throws LdapException | [
"Fetches",
"an",
"option",
"s",
"corresponding",
"constant",
"value",
"from",
"an",
"option",
"name",
".",
"The",
"option",
"name",
"can",
"either",
"be",
"in",
"snake",
"or",
"camel",
"case",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Ldap/Adapter/ExtLdap/ConnectionOptions.php#L63-L73 |
206,927 | symfony/symfony | src/Symfony/Component/Security/Core/Role/SwitchUserRole.php | SwitchUserRole.getSource | public function getSource()
{
if (!$this->deprecationTriggered && (\func_num_args() < 1 || func_get_arg(0))) {
@trigger_error(sprintf('The "%s" class is deprecated since version 4.3 and will be removed in 5.0. Use strings as roles instead.', __CLASS__), E_USER_DEPRECATED);
$this->de... | php | public function getSource()
{
if (!$this->deprecationTriggered && (\func_num_args() < 1 || func_get_arg(0))) {
@trigger_error(sprintf('The "%s" class is deprecated since version 4.3 and will be removed in 5.0. Use strings as roles instead.', __CLASS__), E_USER_DEPRECATED);
$this->de... | [
"public",
"function",
"getSource",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"deprecationTriggered",
"&&",
"(",
"\\",
"func_num_args",
"(",
")",
"<",
"1",
"||",
"func_get_arg",
"(",
"0",
")",
")",
")",
"{",
"@",
"trigger_error",
"(",
"sprintf",... | Returns the original Token.
@return TokenInterface The original TokenInterface instance | [
"Returns",
"the",
"original",
"Token",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Security/Core/Role/SwitchUserRole.php#L51-L60 |
206,928 | symfony/symfony | src/Symfony/Component/Security/Core/User/InMemoryUserProvider.php | InMemoryUserProvider.createUser | public function createUser(UserInterface $user)
{
if (isset($this->users[strtolower($user->getUsername())])) {
throw new \LogicException('Another user with the same username already exists.');
}
$this->users[strtolower($user->getUsername())] = $user;
} | php | public function createUser(UserInterface $user)
{
if (isset($this->users[strtolower($user->getUsername())])) {
throw new \LogicException('Another user with the same username already exists.');
}
$this->users[strtolower($user->getUsername())] = $user;
} | [
"public",
"function",
"createUser",
"(",
"UserInterface",
"$",
"user",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"users",
"[",
"strtolower",
"(",
"$",
"user",
"->",
"getUsername",
"(",
")",
")",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
... | Adds a new User to the provider.
@throws \LogicException | [
"Adds",
"a",
"new",
"User",
"to",
"the",
"provider",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Security/Core/User/InMemoryUserProvider.php#L52-L59 |
206,929 | symfony/symfony | src/Symfony/Component/Security/Core/User/InMemoryUserProvider.php | InMemoryUserProvider.getUser | private function getUser($username)
{
if (!isset($this->users[strtolower($username)])) {
$ex = new UsernameNotFoundException(sprintf('Username "%s" does not exist.', $username));
$ex->setUsername($username);
throw $ex;
}
return $this->users[strtolower($u... | php | private function getUser($username)
{
if (!isset($this->users[strtolower($username)])) {
$ex = new UsernameNotFoundException(sprintf('Username "%s" does not exist.', $username));
$ex->setUsername($username);
throw $ex;
}
return $this->users[strtolower($u... | [
"private",
"function",
"getUser",
"(",
"$",
"username",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"users",
"[",
"strtolower",
"(",
"$",
"username",
")",
"]",
")",
")",
"{",
"$",
"ex",
"=",
"new",
"UsernameNotFoundException",
"(",
"sp... | Returns the user by given username.
@param string $username The username
@return User
@throws UsernameNotFoundException if user whose given username does not exist | [
"Returns",
"the",
"user",
"by",
"given",
"username",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Security/Core/User/InMemoryUserProvider.php#L102-L112 |
206,930 | symfony/symfony | src/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php | FileProfilerStorage.getFilename | protected function getFilename($token)
{
// Uses 4 last characters, because first are mostly the same.
$folderA = substr($token, -2, 2);
$folderB = substr($token, -4, 2);
return $this->folder.'/'.$folderA.'/'.$folderB.'/'.$token;
} | php | protected function getFilename($token)
{
// Uses 4 last characters, because first are mostly the same.
$folderA = substr($token, -2, 2);
$folderB = substr($token, -4, 2);
return $this->folder.'/'.$folderA.'/'.$folderB.'/'.$token;
} | [
"protected",
"function",
"getFilename",
"(",
"$",
"token",
")",
"{",
"// Uses 4 last characters, because first are mostly the same.",
"$",
"folderA",
"=",
"substr",
"(",
"$",
"token",
",",
"-",
"2",
",",
"2",
")",
";",
"$",
"folderB",
"=",
"substr",
"(",
"$",
... | Gets filename to store data, associated to the token.
@param string $token
@return string The profile filename | [
"Gets",
"filename",
"to",
"store",
"data",
"associated",
"to",
"the",
"token",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php#L196-L203 |
206,931 | symfony/symfony | src/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php | FileProfilerStorage.readLineFromFile | protected function readLineFromFile($file)
{
$line = '';
$position = ftell($file);
if (0 === $position) {
return;
}
while (true) {
$chunkSize = min($position, 1024);
$position -= $chunkSize;
fseek($file, $position);
... | php | protected function readLineFromFile($file)
{
$line = '';
$position = ftell($file);
if (0 === $position) {
return;
}
while (true) {
$chunkSize = min($position, 1024);
$position -= $chunkSize;
fseek($file, $position);
... | [
"protected",
"function",
"readLineFromFile",
"(",
"$",
"file",
")",
"{",
"$",
"line",
"=",
"''",
";",
"$",
"position",
"=",
"ftell",
"(",
"$",
"file",
")",
";",
"if",
"(",
"0",
"===",
"$",
"position",
")",
"{",
"return",
";",
"}",
"while",
"(",
"... | Reads a line in the file, backward.
This function automatically skips the empty lines and do not include the line return in result value.
@param resource $file The file resource, with the pointer placed at the end of the line to read
@return mixed A string representing the line or null if beginning of file is reache... | [
"Reads",
"a",
"line",
"in",
"the",
"file",
"backward",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php#L224-L260 |
206,932 | symfony/symfony | src/Symfony/Component/Validator/Mapping/Loader/XmlFileLoader.php | XmlFileLoader.parseConstraints | protected function parseConstraints(\SimpleXMLElement $nodes)
{
$constraints = [];
foreach ($nodes as $node) {
if (\count($node) > 0) {
if (\count($node->value) > 0) {
$options = $this->parseValues($node->value);
} elseif (\count($node... | php | protected function parseConstraints(\SimpleXMLElement $nodes)
{
$constraints = [];
foreach ($nodes as $node) {
if (\count($node) > 0) {
if (\count($node->value) > 0) {
$options = $this->parseValues($node->value);
} elseif (\count($node... | [
"protected",
"function",
"parseConstraints",
"(",
"\\",
"SimpleXMLElement",
"$",
"nodes",
")",
"{",
"$",
"constraints",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"nodes",
"as",
"$",
"node",
")",
"{",
"if",
"(",
"\\",
"count",
"(",
"$",
"node",
")",
">... | Parses a collection of "constraint" XML nodes.
@param \SimpleXMLElement $nodes The XML nodes
@return array The Constraint instances | [
"Parses",
"a",
"collection",
"of",
"constraint",
"XML",
"nodes",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Validator/Mapping/Loader/XmlFileLoader.php#L73-L98 |
206,933 | symfony/symfony | src/Symfony/Component/Validator/ConstraintValidator.php | ConstraintValidator.formatValues | protected function formatValues(array $values, $format = 0)
{
foreach ($values as $key => $value) {
$values[$key] = $this->formatValue($value, $format);
}
return implode(', ', $values);
} | php | protected function formatValues(array $values, $format = 0)
{
foreach ($values as $key => $value) {
$values[$key] = $this->formatValue($value, $format);
}
return implode(', ', $values);
} | [
"protected",
"function",
"formatValues",
"(",
"array",
"$",
"values",
",",
"$",
"format",
"=",
"0",
")",
"{",
"foreach",
"(",
"$",
"values",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"values",
"[",
"$",
"key",
"]",
"=",
"$",
"this",
"-... | Returns a string representation of a list of values.
Each of the values is converted to a string using
{@link formatValue()}. The values are then concatenated with commas.
@param array $values A list of values
@param int $format A bitwise combination of the format
constants in this class
@return string The string ... | [
"Returns",
"a",
"string",
"representation",
"of",
"a",
"list",
"of",
"values",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Validator/ConstraintValidator.php#L159-L166 |
206,934 | symfony/symfony | src/Symfony/Component/Validator/Mapping/ClassMetadata.php | ClassMetadata.addPropertyConstraint | public function addPropertyConstraint($property, Constraint $constraint)
{
if (!isset($this->properties[$property])) {
$this->properties[$property] = new PropertyMetadata($this->getClassName(), $property);
$this->addPropertyMetadata($this->properties[$property]);
}
... | php | public function addPropertyConstraint($property, Constraint $constraint)
{
if (!isset($this->properties[$property])) {
$this->properties[$property] = new PropertyMetadata($this->getClassName(), $property);
$this->addPropertyMetadata($this->properties[$property]);
}
... | [
"public",
"function",
"addPropertyConstraint",
"(",
"$",
"property",
",",
"Constraint",
"$",
"constraint",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"properties",
"[",
"$",
"property",
"]",
")",
")",
"{",
"$",
"this",
"->",
"properties",... | Adds a constraint to the given property.
@param string $property The name of the property
@param Constraint $constraint The constraint
@return $this | [
"Adds",
"a",
"constraint",
"to",
"the",
"given",
"property",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Validator/Mapping/ClassMetadata.php#L213-L226 |
206,935 | symfony/symfony | src/Symfony/Component/Validator/Mapping/ClassMetadata.php | ClassMetadata.addGetterConstraint | public function addGetterConstraint($property, Constraint $constraint)
{
if (!isset($this->getters[$property])) {
$this->getters[$property] = new GetterMetadata($this->getClassName(), $property);
$this->addPropertyMetadata($this->getters[$property]);
}
$constraint->... | php | public function addGetterConstraint($property, Constraint $constraint)
{
if (!isset($this->getters[$property])) {
$this->getters[$property] = new GetterMetadata($this->getClassName(), $property);
$this->addPropertyMetadata($this->getters[$property]);
}
$constraint->... | [
"public",
"function",
"addGetterConstraint",
"(",
"$",
"property",
",",
"Constraint",
"$",
"constraint",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"getters",
"[",
"$",
"property",
"]",
")",
")",
"{",
"$",
"this",
"->",
"getters",
"[",
... | Adds a constraint to the getter of the given property.
The name of the getter is assumed to be the name of the property with an
uppercased first letter and either the prefix "get" or "is".
@param string $property The name of the property
@param Constraint $constraint The constraint
@return $this | [
"Adds",
"a",
"constraint",
"to",
"the",
"getter",
"of",
"the",
"given",
"property",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Validator/Mapping/ClassMetadata.php#L254-L267 |
206,936 | symfony/symfony | src/Symfony/Component/Validator/Mapping/ClassMetadata.php | ClassMetadata.mergeConstraints | public function mergeConstraints(self $source)
{
if ($source->isGroupSequenceProvider()) {
$this->setGroupSequenceProvider(true);
}
foreach ($source->getConstraints() as $constraint) {
$this->addConstraint(clone $constraint);
}
foreach ($source->getC... | php | public function mergeConstraints(self $source)
{
if ($source->isGroupSequenceProvider()) {
$this->setGroupSequenceProvider(true);
}
foreach ($source->getConstraints() as $constraint) {
$this->addConstraint(clone $constraint);
}
foreach ($source->getC... | [
"public",
"function",
"mergeConstraints",
"(",
"self",
"$",
"source",
")",
"{",
"if",
"(",
"$",
"source",
"->",
"isGroupSequenceProvider",
"(",
")",
")",
"{",
"$",
"this",
"->",
"setGroupSequenceProvider",
"(",
"true",
")",
";",
"}",
"foreach",
"(",
"$",
... | Merges the constraints of the given metadata into this object. | [
"Merges",
"the",
"constraints",
"of",
"the",
"given",
"metadata",
"into",
"this",
"object",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Validator/Mapping/ClassMetadata.php#L327-L362 |
206,937 | symfony/symfony | src/Symfony/Component/Validator/Mapping/ClassMetadata.php | ClassMetadata.setGroupSequence | public function setGroupSequence($groupSequence)
{
if ($this->isGroupSequenceProvider()) {
throw new GroupDefinitionException('Defining a static group sequence is not allowed with a group sequence provider');
}
if (\is_array($groupSequence)) {
$groupSequence = new Gr... | php | public function setGroupSequence($groupSequence)
{
if ($this->isGroupSequenceProvider()) {
throw new GroupDefinitionException('Defining a static group sequence is not allowed with a group sequence provider');
}
if (\is_array($groupSequence)) {
$groupSequence = new Gr... | [
"public",
"function",
"setGroupSequence",
"(",
"$",
"groupSequence",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isGroupSequenceProvider",
"(",
")",
")",
"{",
"throw",
"new",
"GroupDefinitionException",
"(",
"'Defining a static group sequence is not allowed with a group sequ... | Sets the default group sequence for this class.
@param string[]|GroupSequence $groupSequence An array of group names
@return $this
@throws GroupDefinitionException | [
"Sets",
"the",
"default",
"group",
"sequence",
"for",
"this",
"class",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Validator/Mapping/ClassMetadata.php#L401-L422 |
206,938 | symfony/symfony | src/Symfony/Component/Validator/Mapping/ClassMetadata.php | ClassMetadata.getReflectionClass | public function getReflectionClass()
{
if (!$this->reflClass) {
$this->reflClass = new \ReflectionClass($this->getClassName());
}
return $this->reflClass;
} | php | public function getReflectionClass()
{
if (!$this->reflClass) {
$this->reflClass = new \ReflectionClass($this->getClassName());
}
return $this->reflClass;
} | [
"public",
"function",
"getReflectionClass",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"reflClass",
")",
"{",
"$",
"this",
"->",
"reflClass",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"this",
"->",
"getClassName",
"(",
")",
")",
";",
"}",
... | Returns a ReflectionClass instance for this class.
@return \ReflectionClass | [
"Returns",
"a",
"ReflectionClass",
"instance",
"for",
"this",
"class",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Validator/Mapping/ClassMetadata.php#L445-L452 |
206,939 | symfony/symfony | src/Symfony/Component/Validator/Mapping/ClassMetadata.php | ClassMetadata.setGroupSequenceProvider | public function setGroupSequenceProvider($active)
{
if ($this->hasGroupSequence()) {
throw new GroupDefinitionException('Defining a group sequence provider is not allowed with a static group sequence');
}
if (!$this->getReflectionClass()->implementsInterface('Symfony\Component\V... | php | public function setGroupSequenceProvider($active)
{
if ($this->hasGroupSequence()) {
throw new GroupDefinitionException('Defining a group sequence provider is not allowed with a static group sequence');
}
if (!$this->getReflectionClass()->implementsInterface('Symfony\Component\V... | [
"public",
"function",
"setGroupSequenceProvider",
"(",
"$",
"active",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasGroupSequence",
"(",
")",
")",
"{",
"throw",
"new",
"GroupDefinitionException",
"(",
"'Defining a group sequence provider is not allowed with a static group s... | Sets whether a group sequence provider should be used.
@param bool $active
@throws GroupDefinitionException | [
"Sets",
"whether",
"a",
"group",
"sequence",
"provider",
"should",
"be",
"used",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Validator/Mapping/ClassMetadata.php#L461-L472 |
206,940 | symfony/symfony | src/Symfony/Component/HttpClient/HttpClientTrait.php | HttpClientTrait.normalizeHeaders | private static function normalizeHeaders(array $headers): array
{
$normalizedHeaders = [];
foreach ($headers as $name => $values) {
if (\is_int($name)) {
[$name, $values] = explode(':', $values, 2);
$values = [ltrim($values)];
} elseif (!\is_i... | php | private static function normalizeHeaders(array $headers): array
{
$normalizedHeaders = [];
foreach ($headers as $name => $values) {
if (\is_int($name)) {
[$name, $values] = explode(':', $values, 2);
$values = [ltrim($values)];
} elseif (!\is_i... | [
"private",
"static",
"function",
"normalizeHeaders",
"(",
"array",
"$",
"headers",
")",
":",
"array",
"{",
"$",
"normalizedHeaders",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"headers",
"as",
"$",
"name",
"=>",
"$",
"values",
")",
"{",
"if",
"(",
"\\",
... | Normalizes headers by putting their names as lowercased keys.
@return string[][] | [
"Normalizes",
"headers",
"by",
"putting",
"their",
"names",
"as",
"lowercased",
"keys",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpClient/HttpClientTrait.php#L195-L215 |
206,941 | symfony/symfony | src/Symfony/Component/HttpClient/HttpClientTrait.php | HttpClientTrait.resolveUrl | private static function resolveUrl(array $url, ?array $base, array $queryDefaults = []): array
{
if (null !== $base && '' === ($base['scheme'] ?? '').($base['authority'] ?? '')) {
throw new InvalidArgumentException(sprintf('Invalid "base_uri" option: host or scheme is missing in "%s".', implode(... | php | private static function resolveUrl(array $url, ?array $base, array $queryDefaults = []): array
{
if (null !== $base && '' === ($base['scheme'] ?? '').($base['authority'] ?? '')) {
throw new InvalidArgumentException(sprintf('Invalid "base_uri" option: host or scheme is missing in "%s".', implode(... | [
"private",
"static",
"function",
"resolveUrl",
"(",
"array",
"$",
"url",
",",
"?",
"array",
"$",
"base",
",",
"array",
"$",
"queryDefaults",
"=",
"[",
"]",
")",
":",
"array",
"{",
"if",
"(",
"null",
"!==",
"$",
"base",
"&&",
"''",
"===",
"(",
"$",
... | Resolves a URL against a base URI.
@see https://tools.ietf.org/html/rfc3986#section-5.2.2
@throws InvalidArgumentException When an invalid URL is passed | [
"Resolves",
"a",
"URL",
"against",
"a",
"base",
"URI",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpClient/HttpClientTrait.php#L323-L371 |
206,942 | symfony/symfony | src/Symfony/Component/HttpClient/HttpClientTrait.php | HttpClientTrait.removeDotSegments | private static function removeDotSegments(string $path)
{
$result = '';
while (!\in_array($path, ['', '.', '..'], true)) {
if ('.' === $path[0] && (0 === strpos($path, $p = '../') || 0 === strpos($path, $p = './'))) {
$path = substr($path, \strlen($p));
} els... | php | private static function removeDotSegments(string $path)
{
$result = '';
while (!\in_array($path, ['', '.', '..'], true)) {
if ('.' === $path[0] && (0 === strpos($path, $p = '../') || 0 === strpos($path, $p = './'))) {
$path = substr($path, \strlen($p));
} els... | [
"private",
"static",
"function",
"removeDotSegments",
"(",
"string",
"$",
"path",
")",
"{",
"$",
"result",
"=",
"''",
";",
"while",
"(",
"!",
"\\",
"in_array",
"(",
"$",
"path",
",",
"[",
"''",
",",
"'.'",
",",
"'..'",
"]",
",",
"true",
")",
")",
... | Removes dot-segments from a path.
@see https://tools.ietf.org/html/rfc3986#section-5.2.4 | [
"Removes",
"dot",
"-",
"segments",
"from",
"a",
"path",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpClient/HttpClientTrait.php#L439-L460 |
206,943 | symfony/symfony | src/Symfony/Component/HttpClient/HttpClientTrait.php | HttpClientTrait.mergeQueryString | private static function mergeQueryString(?string $queryString, array $queryArray, bool $replace): ?string
{
if (!$queryArray) {
return $queryString;
}
$query = [];
if (null !== $queryString) {
foreach (explode('&', $queryString) as $v) {
if (... | php | private static function mergeQueryString(?string $queryString, array $queryArray, bool $replace): ?string
{
if (!$queryArray) {
return $queryString;
}
$query = [];
if (null !== $queryString) {
foreach (explode('&', $queryString) as $v) {
if (... | [
"private",
"static",
"function",
"mergeQueryString",
"(",
"?",
"string",
"$",
"queryString",
",",
"array",
"$",
"queryArray",
",",
"bool",
"$",
"replace",
")",
":",
"?",
"string",
"{",
"if",
"(",
"!",
"$",
"queryArray",
")",
"{",
"return",
"$",
"queryStr... | Merges and encodes a query array with a query string.
@throws InvalidArgumentException When an invalid query-string value is passed | [
"Merges",
"and",
"encodes",
"a",
"query",
"array",
"with",
"a",
"query",
"string",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpClient/HttpClientTrait.php#L467-L499 |
206,944 | symfony/symfony | src/Symfony/Component/Console/Helper/QuestionHelper.php | QuestionHelper.writeError | protected function writeError(OutputInterface $output, \Exception $error)
{
if (null !== $this->getHelperSet() && $this->getHelperSet()->has('formatter')) {
$message = $this->getHelperSet()->get('formatter')->formatBlock($error->getMessage(), 'error');
} else {
$message = '<e... | php | protected function writeError(OutputInterface $output, \Exception $error)
{
if (null !== $this->getHelperSet() && $this->getHelperSet()->has('formatter')) {
$message = $this->getHelperSet()->get('formatter')->formatBlock($error->getMessage(), 'error');
} else {
$message = '<e... | [
"protected",
"function",
"writeError",
"(",
"OutputInterface",
"$",
"output",
",",
"\\",
"Exception",
"$",
"error",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"getHelperSet",
"(",
")",
"&&",
"$",
"this",
"->",
"getHelperSet",
"(",
")",
"->",
... | Outputs an error message. | [
"Outputs",
"an",
"error",
"message",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Helper/QuestionHelper.php#L183-L192 |
206,945 | symfony/symfony | src/Symfony/Component/Console/Helper/QuestionHelper.php | QuestionHelper.hasSttyAvailable | private function hasSttyAvailable(): bool
{
if (null !== self::$stty) {
return self::$stty;
}
exec('stty 2>&1', $output, $exitcode);
return self::$stty = 0 === $exitcode;
} | php | private function hasSttyAvailable(): bool
{
if (null !== self::$stty) {
return self::$stty;
}
exec('stty 2>&1', $output, $exitcode);
return self::$stty = 0 === $exitcode;
} | [
"private",
"function",
"hasSttyAvailable",
"(",
")",
":",
"bool",
"{",
"if",
"(",
"null",
"!==",
"self",
"::",
"$",
"stty",
")",
"{",
"return",
"self",
"::",
"$",
"stty",
";",
"}",
"exec",
"(",
"'stty 2>&1'",
",",
"$",
"output",
",",
"$",
"exitcode",... | Returns whether Stty is available or not. | [
"Returns",
"whether",
"Stty",
"is",
"available",
"or",
"not",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Helper/QuestionHelper.php#L442-L451 |
206,946 | symfony/symfony | src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php | ParameterBag.add | public function add(array $parameters)
{
foreach ($parameters as $key => $value) {
$this->set($key, $value);
}
} | php | public function add(array $parameters)
{
foreach ($parameters as $key => $value) {
$this->set($key, $value);
}
} | [
"public",
"function",
"add",
"(",
"array",
"$",
"parameters",
")",
"{",
"foreach",
"(",
"$",
"parameters",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"set",
"(",
"$",
"key",
",",
"$",
"value",
")",
";",
"}",
"}"
] | Adds parameters to the service container parameters.
@param array $parameters An array of parameters | [
"Adds",
"parameters",
"to",
"the",
"service",
"container",
"parameters",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php#L49-L54 |
206,947 | symfony/symfony | src/Symfony/Component/Serializer/Encoder/CsvEncoder.php | CsvEncoder.flatten | private function flatten(array $array, array &$result, string $keySeparator, string $parentKey = '', bool $escapeFormulas = false)
{
foreach ($array as $key => $value) {
if (\is_array($value)) {
$this->flatten($value, $result, $keySeparator, $parentKey.$key.$keySeparator, $escape... | php | private function flatten(array $array, array &$result, string $keySeparator, string $parentKey = '', bool $escapeFormulas = false)
{
foreach ($array as $key => $value) {
if (\is_array($value)) {
$this->flatten($value, $result, $keySeparator, $parentKey.$key.$keySeparator, $escape... | [
"private",
"function",
"flatten",
"(",
"array",
"$",
"array",
",",
"array",
"&",
"$",
"result",
",",
"string",
"$",
"keySeparator",
",",
"string",
"$",
"parentKey",
"=",
"''",
",",
"bool",
"$",
"escapeFormulas",
"=",
"false",
")",
"{",
"foreach",
"(",
... | Flattens an array and generates keys including the path. | [
"Flattens",
"an",
"array",
"and",
"generates",
"keys",
"including",
"the",
"path",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Serializer/Encoder/CsvEncoder.php#L213-L226 |
206,948 | symfony/symfony | src/Symfony/Component/Translation/Util/XliffUtils.php | XliffUtils.validateSchema | public static function validateSchema(\DOMDocument $dom): array
{
$xliffVersion = static::getVersionNumber($dom);
$internalErrors = libxml_use_internal_errors(true);
$disableEntities = libxml_disable_entity_loader(false);
$isValid = @$dom->schemaValidateSource(self::getSchema($xliff... | php | public static function validateSchema(\DOMDocument $dom): array
{
$xliffVersion = static::getVersionNumber($dom);
$internalErrors = libxml_use_internal_errors(true);
$disableEntities = libxml_disable_entity_loader(false);
$isValid = @$dom->schemaValidateSource(self::getSchema($xliff... | [
"public",
"static",
"function",
"validateSchema",
"(",
"\\",
"DOMDocument",
"$",
"dom",
")",
":",
"array",
"{",
"$",
"xliffVersion",
"=",
"static",
"::",
"getVersionNumber",
"(",
"$",
"dom",
")",
";",
"$",
"internalErrors",
"=",
"libxml_use_internal_errors",
"... | Validates and parses the given file into a DOMDocument.
@throws InvalidResourceException | [
"Validates",
"and",
"parses",
"the",
"given",
"file",
"into",
"a",
"DOMDocument",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Translation/Util/XliffUtils.php#L60-L81 |
206,949 | symfony/symfony | src/Symfony/Component/Translation/Util/XliffUtils.php | XliffUtils.fixXmlLocation | private static function fixXmlLocation(string $schemaSource, string $xmlUri): string
{
$newPath = str_replace('\\', '/', __DIR__).'/../Resources/schemas/xml.xsd';
$parts = explode('/', $newPath);
$locationstart = 'file:///';
if (0 === stripos($newPath, 'phar://')) {
$tmpf... | php | private static function fixXmlLocation(string $schemaSource, string $xmlUri): string
{
$newPath = str_replace('\\', '/', __DIR__).'/../Resources/schemas/xml.xsd';
$parts = explode('/', $newPath);
$locationstart = 'file:///';
if (0 === stripos($newPath, 'phar://')) {
$tmpf... | [
"private",
"static",
"function",
"fixXmlLocation",
"(",
"string",
"$",
"schemaSource",
",",
"string",
"$",
"xmlUri",
")",
":",
"string",
"{",
"$",
"newPath",
"=",
"str_replace",
"(",
"'\\\\'",
",",
"'/'",
",",
"__DIR__",
")",
".",
"'/../Resources/schemas/xml.x... | Internally changes the URI of a dependent xsd to be loaded locally. | [
"Internally",
"changes",
"the",
"URI",
"of",
"a",
"dependent",
"xsd",
"to",
"be",
"loaded",
"locally",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Translation/Util/XliffUtils.php#L119-L139 |
206,950 | symfony/symfony | src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php | NumberFormatter.formatCurrency | public function formatCurrency($value, $currency)
{
if (self::DECIMAL == $this->style) {
return $this->format($value);
}
$symbol = Currencies::getSymbol($currency, 'en');
$fractionDigits = Currencies::getFractionDigits($currency);
$value = $this->roundCurrency($... | php | public function formatCurrency($value, $currency)
{
if (self::DECIMAL == $this->style) {
return $this->format($value);
}
$symbol = Currencies::getSymbol($currency, 'en');
$fractionDigits = Currencies::getFractionDigits($currency);
$value = $this->roundCurrency($... | [
"public",
"function",
"formatCurrency",
"(",
"$",
"value",
",",
"$",
"currency",
")",
"{",
"if",
"(",
"self",
"::",
"DECIMAL",
"==",
"$",
"this",
"->",
"style",
")",
"{",
"return",
"$",
"this",
"->",
"format",
"(",
"$",
"value",
")",
";",
"}",
"$",... | Format a currency value.
@param float $value The numeric currency value
@param string $currency The 3-letter ISO 4217 currency code indicating the currency to use
@return string The formatted currency value
@see http://www.php.net/manual/en/numberformatter.formatcurrency.php
@see https://en.wikipedia.org/wiki/IS... | [
"Format",
"a",
"currency",
"value",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php#L315-L338 |
206,951 | symfony/symfony | src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php | NumberFormatter.getSymbol | public function getSymbol($attr)
{
return \array_key_exists($this->style, self::$enSymbols) && \array_key_exists($attr, self::$enSymbols[$this->style]) ? self::$enSymbols[$this->style][$attr] : false;
} | php | public function getSymbol($attr)
{
return \array_key_exists($this->style, self::$enSymbols) && \array_key_exists($attr, self::$enSymbols[$this->style]) ? self::$enSymbols[$this->style][$attr] : false;
} | [
"public",
"function",
"getSymbol",
"(",
"$",
"attr",
")",
"{",
"return",
"\\",
"array_key_exists",
"(",
"$",
"this",
"->",
"style",
",",
"self",
"::",
"$",
"enSymbols",
")",
"&&",
"\\",
"array_key_exists",
"(",
"$",
"attr",
",",
"self",
"::",
"$",
"enS... | Not supported. Returns a formatter symbol value.
@param int $attr A symbol specifier, one of the format symbol constants
@return bool|string The symbol value or false on error
@see http://www.php.net/manual/en/numberformatter.getsymbol.php | [
"Not",
"supported",
".",
"Returns",
"a",
"formatter",
"symbol",
"value",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php#L461-L464 |
206,952 | symfony/symfony | src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php | NumberFormatter.getTextAttribute | public function getTextAttribute($attr)
{
return \array_key_exists($this->style, self::$enTextAttributes) && \array_key_exists($attr, self::$enTextAttributes[$this->style]) ? self::$enTextAttributes[$this->style][$attr] : false;
} | php | public function getTextAttribute($attr)
{
return \array_key_exists($this->style, self::$enTextAttributes) && \array_key_exists($attr, self::$enTextAttributes[$this->style]) ? self::$enTextAttributes[$this->style][$attr] : false;
} | [
"public",
"function",
"getTextAttribute",
"(",
"$",
"attr",
")",
"{",
"return",
"\\",
"array_key_exists",
"(",
"$",
"this",
"->",
"style",
",",
"self",
"::",
"$",
"enTextAttributes",
")",
"&&",
"\\",
"array_key_exists",
"(",
"$",
"attr",
",",
"self",
"::",... | Not supported. Returns a formatter text attribute value.
@param int $attr An attribute specifier, one of the text attribute constants
@return bool|string The attribute value or false on error
@see http://www.php.net/manual/en/numberformatter.gettextattribute.php | [
"Not",
"supported",
".",
"Returns",
"a",
"formatter",
"text",
"attribute",
"value",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php#L475-L478 |
206,953 | symfony/symfony | src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php | NumberFormatter.parse | public function parse($value, $type = self::TYPE_DOUBLE, &$position = 0)
{
if (self::TYPE_DEFAULT == $type || self::TYPE_CURRENCY == $type) {
trigger_error(__METHOD__.'(): Unsupported format type '.$type, \E_USER_WARNING);
return false;
}
// Any invalid number at th... | php | public function parse($value, $type = self::TYPE_DOUBLE, &$position = 0)
{
if (self::TYPE_DEFAULT == $type || self::TYPE_CURRENCY == $type) {
trigger_error(__METHOD__.'(): Unsupported format type '.$type, \E_USER_WARNING);
return false;
}
// Any invalid number at th... | [
"public",
"function",
"parse",
"(",
"$",
"value",
",",
"$",
"type",
"=",
"self",
"::",
"TYPE_DOUBLE",
",",
"&",
"$",
"position",
"=",
"0",
")",
"{",
"if",
"(",
"self",
"::",
"TYPE_DEFAULT",
"==",
"$",
"type",
"||",
"self",
"::",
"TYPE_CURRENCY",
"=="... | Parse a number.
@param string $value The value to parse
@param int $type Type of the formatting, one of the format type constants. NumberFormatter::TYPE_DOUBLE by default.
@param int $position Offset to begin the parsing on return this value will hold the offset at which the parsing ended
@return int|flo... | [
"Parse",
"a",
"number",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php#L509-L549 |
206,954 | symfony/symfony | src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php | NumberFormatter.resetError | protected function resetError()
{
IntlGlobals::setError(IntlGlobals::U_ZERO_ERROR);
$this->errorCode = IntlGlobals::getErrorCode();
$this->errorMessage = IntlGlobals::getErrorMessage();
} | php | protected function resetError()
{
IntlGlobals::setError(IntlGlobals::U_ZERO_ERROR);
$this->errorCode = IntlGlobals::getErrorCode();
$this->errorMessage = IntlGlobals::getErrorMessage();
} | [
"protected",
"function",
"resetError",
"(",
")",
"{",
"IntlGlobals",
"::",
"setError",
"(",
"IntlGlobals",
"::",
"U_ZERO_ERROR",
")",
";",
"$",
"this",
"->",
"errorCode",
"=",
"IntlGlobals",
"::",
"getErrorCode",
"(",
")",
";",
"$",
"this",
"->",
"errorMessa... | Set the error to the default U_ZERO_ERROR. | [
"Set",
"the",
"error",
"to",
"the",
"default",
"U_ZERO_ERROR",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php#L658-L663 |
206,955 | symfony/symfony | src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php | NumberFormatter.roundCurrency | private function roundCurrency($value, $currency)
{
$fractionDigits = Currencies::getFractionDigits($currency);
$roundingIncrement = Currencies::getRoundingIncrement($currency);
// Round with the formatter rounding mode
$value = $this->round($value, $fractionDigits);
// Swi... | php | private function roundCurrency($value, $currency)
{
$fractionDigits = Currencies::getFractionDigits($currency);
$roundingIncrement = Currencies::getRoundingIncrement($currency);
// Round with the formatter rounding mode
$value = $this->round($value, $fractionDigits);
// Swi... | [
"private",
"function",
"roundCurrency",
"(",
"$",
"value",
",",
"$",
"currency",
")",
"{",
"$",
"fractionDigits",
"=",
"Currencies",
"::",
"getFractionDigits",
"(",
"$",
"currency",
")",
";",
"$",
"roundingIncrement",
"=",
"Currencies",
"::",
"getRoundingIncreme... | Rounds a currency value, applying increment rounding if applicable.
When a currency have a rounding increment, an extra round is made after the first one. The rounding factor is
determined in the ICU data and is explained as of:
"the rounding increment is given in units of 10^(-fraction_digits)"
The only actual roun... | [
"Rounds",
"a",
"currency",
"value",
"applying",
"increment",
"rounding",
"if",
"applicable",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php#L683-L698 |
206,956 | symfony/symfony | src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php | NumberFormatter.round | private function round($value, $precision)
{
$precision = $this->getUninitializedPrecision($value, $precision);
$roundingModeAttribute = $this->getAttribute(self::ROUNDING_MODE);
if (isset(self::$phpRoundingMap[$roundingModeAttribute])) {
$value = round($value, $precision, self:... | php | private function round($value, $precision)
{
$precision = $this->getUninitializedPrecision($value, $precision);
$roundingModeAttribute = $this->getAttribute(self::ROUNDING_MODE);
if (isset(self::$phpRoundingMap[$roundingModeAttribute])) {
$value = round($value, $precision, self:... | [
"private",
"function",
"round",
"(",
"$",
"value",
",",
"$",
"precision",
")",
"{",
"$",
"precision",
"=",
"$",
"this",
"->",
"getUninitializedPrecision",
"(",
"$",
"value",
",",
"$",
"precision",
")",
";",
"$",
"roundingModeAttribute",
"=",
"$",
"this",
... | Rounds a value.
@param int|float $value The value to round
@param int $precision The number of decimal digits to round to
@return int|float The rounded value | [
"Rounds",
"a",
"value",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php#L708-L739 |
206,957 | symfony/symfony | src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php | NumberFormatter.getUninitializedPrecision | private function getUninitializedPrecision($value, $precision)
{
if (self::CURRENCY == $this->style) {
return $precision;
}
if (!$this->isInitializedAttribute(self::FRACTION_DIGITS)) {
preg_match('/.*\.(.*)/', (string) $value, $digits);
if (isset($digits[... | php | private function getUninitializedPrecision($value, $precision)
{
if (self::CURRENCY == $this->style) {
return $precision;
}
if (!$this->isInitializedAttribute(self::FRACTION_DIGITS)) {
preg_match('/.*\.(.*)/', (string) $value, $digits);
if (isset($digits[... | [
"private",
"function",
"getUninitializedPrecision",
"(",
"$",
"value",
",",
"$",
"precision",
")",
"{",
"if",
"(",
"self",
"::",
"CURRENCY",
"==",
"$",
"this",
"->",
"style",
")",
"{",
"return",
"$",
"precision",
";",
"}",
"if",
"(",
"!",
"$",
"this",
... | Returns the precision value if the DECIMAL style is being used and the FRACTION_DIGITS attribute is uninitialized.
@param int|float $value The value to get the precision from if the FRACTION_DIGITS attribute is uninitialized
@param int $precision The precision value to returns if the FRACTION_DIGITS attribut... | [
"Returns",
"the",
"precision",
"value",
"if",
"the",
"DECIMAL",
"style",
"is",
"being",
"used",
"and",
"the",
"FRACTION_DIGITS",
"attribute",
"is",
"uninitialized",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php#L764-L778 |
206,958 | symfony/symfony | src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php | XmlFileLoader.parseImports | private function parseImports(\DOMDocument $xml, $file)
{
$xpath = new \DOMXPath($xml);
$xpath->registerNamespace('container', self::NS);
if (false === $imports = $xpath->query('//container:imports/container:import')) {
return;
}
$defaultDirectory = \dirname($fi... | php | private function parseImports(\DOMDocument $xml, $file)
{
$xpath = new \DOMXPath($xml);
$xpath->registerNamespace('container', self::NS);
if (false === $imports = $xpath->query('//container:imports/container:import')) {
return;
}
$defaultDirectory = \dirname($fi... | [
"private",
"function",
"parseImports",
"(",
"\\",
"DOMDocument",
"$",
"xml",
",",
"$",
"file",
")",
"{",
"$",
"xpath",
"=",
"new",
"\\",
"DOMXPath",
"(",
"$",
"xml",
")",
";",
"$",
"xpath",
"->",
"registerNamespace",
"(",
"'container'",
",",
"self",
":... | Parses imports.
@param \DOMDocument $xml
@param string $file | [
"Parses",
"imports",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php#L107-L121 |
206,959 | symfony/symfony | src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php | XmlFileLoader.validateAlias | private function validateAlias(\DOMElement $alias, $file)
{
foreach ($alias->attributes as $name => $node) {
if (!\in_array($name, ['alias', 'id', 'public'])) {
throw new InvalidArgumentException(sprintf('Invalid attribute "%s" defined for alias "%s" in "%s".', $name, $alias->get... | php | private function validateAlias(\DOMElement $alias, $file)
{
foreach ($alias->attributes as $name => $node) {
if (!\in_array($name, ['alias', 'id', 'public'])) {
throw new InvalidArgumentException(sprintf('Invalid attribute "%s" defined for alias "%s" in "%s".', $name, $alias->get... | [
"private",
"function",
"validateAlias",
"(",
"\\",
"DOMElement",
"$",
"alias",
",",
"$",
"file",
")",
"{",
"foreach",
"(",
"$",
"alias",
"->",
"attributes",
"as",
"$",
"name",
"=>",
"$",
"node",
")",
"{",
"if",
"(",
"!",
"\\",
"in_array",
"(",
"$",
... | Validates an alias.
@param \DOMElement $alias
@param string $file | [
"Validates",
"an",
"alias",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php#L687-L703 |
206,960 | symfony/symfony | src/Symfony/Component/Debug/DebugClassLoader.php | DebugClassLoader.enable | public static function enable()
{
// Ensures we don't hit https://bugs.php.net/42098
class_exists('Symfony\Component\Debug\ErrorHandler');
class_exists('Psr\Log\LogLevel');
if (!\is_array($functions = spl_autoload_functions())) {
return;
}
foreach ($func... | php | public static function enable()
{
// Ensures we don't hit https://bugs.php.net/42098
class_exists('Symfony\Component\Debug\ErrorHandler');
class_exists('Psr\Log\LogLevel');
if (!\is_array($functions = spl_autoload_functions())) {
return;
}
foreach ($func... | [
"public",
"static",
"function",
"enable",
"(",
")",
"{",
"// Ensures we don't hit https://bugs.php.net/42098",
"class_exists",
"(",
"'Symfony\\Component\\Debug\\ErrorHandler'",
")",
";",
"class_exists",
"(",
"'Psr\\Log\\LogLevel'",
")",
";",
"if",
"(",
"!",
"\\",
"is_arra... | Wraps all autoloaders. | [
"Wraps",
"all",
"autoloaders",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Debug/DebugClassLoader.php#L86-L107 |
206,961 | symfony/symfony | src/Symfony/Component/Debug/DebugClassLoader.php | DebugClassLoader.disable | public static function disable()
{
if (!\is_array($functions = spl_autoload_functions())) {
return;
}
foreach ($functions as $function) {
spl_autoload_unregister($function);
}
foreach ($functions as $function) {
if (\is_array($function) &... | php | public static function disable()
{
if (!\is_array($functions = spl_autoload_functions())) {
return;
}
foreach ($functions as $function) {
spl_autoload_unregister($function);
}
foreach ($functions as $function) {
if (\is_array($function) &... | [
"public",
"static",
"function",
"disable",
"(",
")",
"{",
"if",
"(",
"!",
"\\",
"is_array",
"(",
"$",
"functions",
"=",
"spl_autoload_functions",
"(",
")",
")",
")",
"{",
"return",
";",
"}",
"foreach",
"(",
"$",
"functions",
"as",
"$",
"function",
")",... | Disables the wrapping. | [
"Disables",
"the",
"wrapping",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Debug/DebugClassLoader.php#L112-L129 |
206,962 | symfony/symfony | src/Symfony/Component/Debug/DebugClassLoader.php | DebugClassLoader.darwinRealpath | private function darwinRealpath($real)
{
$i = 1 + strrpos($real, '/');
$file = substr($real, $i);
$real = substr($real, 0, $i);
if (isset(self::$darwinCache[$real])) {
$kDir = $real;
} else {
$kDir = strtolower($real);
if (isset(self::$da... | php | private function darwinRealpath($real)
{
$i = 1 + strrpos($real, '/');
$file = substr($real, $i);
$real = substr($real, 0, $i);
if (isset(self::$darwinCache[$real])) {
$kDir = $real;
} else {
$kDir = strtolower($real);
if (isset(self::$da... | [
"private",
"function",
"darwinRealpath",
"(",
"$",
"real",
")",
"{",
"$",
"i",
"=",
"1",
"+",
"strrpos",
"(",
"$",
"real",
",",
"'/'",
")",
";",
"$",
"file",
"=",
"substr",
"(",
"$",
"real",
",",
"$",
"i",
")",
";",
"$",
"real",
"=",
"substr",
... | `realpath` on MacOSX doesn't normalize the case of characters. | [
"realpath",
"on",
"MacOSX",
"doesn",
"t",
"normalize",
"the",
"case",
"of",
"characters",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Debug/DebugClassLoader.php#L435-L497 |
206,963 | symfony/symfony | src/Symfony/Component/Debug/DebugClassLoader.php | DebugClassLoader.getOwnInterfaces | private function getOwnInterfaces($class, $parent)
{
$ownInterfaces = class_implements($class, false);
if ($parent) {
foreach (class_implements($parent, false) as $interface) {
unset($ownInterfaces[$interface]);
}
}
foreach ($ownInterfaces as... | php | private function getOwnInterfaces($class, $parent)
{
$ownInterfaces = class_implements($class, false);
if ($parent) {
foreach (class_implements($parent, false) as $interface) {
unset($ownInterfaces[$interface]);
}
}
foreach ($ownInterfaces as... | [
"private",
"function",
"getOwnInterfaces",
"(",
"$",
"class",
",",
"$",
"parent",
")",
"{",
"$",
"ownInterfaces",
"=",
"class_implements",
"(",
"$",
"class",
",",
"false",
")",
";",
"if",
"(",
"$",
"parent",
")",
"{",
"foreach",
"(",
"class_implements",
... | `class_implements` includes interfaces from the parents so we have to manually exclude them.
@param string $class
@param string|false $parent
@return string[] | [
"class_implements",
"includes",
"interfaces",
"from",
"the",
"parents",
"so",
"we",
"have",
"to",
"manually",
"exclude",
"them",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Debug/DebugClassLoader.php#L507-L524 |
206,964 | symfony/symfony | src/Symfony/Component/VarDumper/Caster/Caster.php | Caster.castObject | public static function castObject($obj, $class, $hasDebugInfo = false)
{
if ($hasDebugInfo) {
$a = $obj->__debugInfo();
} elseif ($obj instanceof \Closure) {
$a = [];
} else {
$a = (array) $obj;
}
if ($obj instanceof \__PHP_Incomplete_Class... | php | public static function castObject($obj, $class, $hasDebugInfo = false)
{
if ($hasDebugInfo) {
$a = $obj->__debugInfo();
} elseif ($obj instanceof \Closure) {
$a = [];
} else {
$a = (array) $obj;
}
if ($obj instanceof \__PHP_Incomplete_Class... | [
"public",
"static",
"function",
"castObject",
"(",
"$",
"obj",
",",
"$",
"class",
",",
"$",
"hasDebugInfo",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"hasDebugInfo",
")",
"{",
"$",
"a",
"=",
"$",
"obj",
"->",
"__debugInfo",
"(",
")",
";",
"}",
"elsei... | Casts objects to arrays and adds the dynamic property prefix.
@param object $obj The object to cast
@param string $class The class of the object
@param bool $hasDebugInfo Whether the __debugInfo method exists on $obj or not
@return array The array-cast of the object, with prefixed dynamic properties | [
"Casts",
"objects",
"to",
"arrays",
"and",
"adds",
"the",
"dynamic",
"property",
"prefix",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/VarDumper/Caster/Caster.php#L49-L92 |
206,965 | symfony/symfony | src/Symfony/Component/VarDumper/Caster/Caster.php | Caster.filter | public static function filter(array $a, $filter, array $listedProperties = [], &$count = 0)
{
$count = 0;
foreach ($a as $k => $v) {
$type = self::EXCLUDE_STRICT & $filter;
if (null === $v) {
$type |= self::EXCLUDE_NULL & $filter;
$type |= se... | php | public static function filter(array $a, $filter, array $listedProperties = [], &$count = 0)
{
$count = 0;
foreach ($a as $k => $v) {
$type = self::EXCLUDE_STRICT & $filter;
if (null === $v) {
$type |= self::EXCLUDE_NULL & $filter;
$type |= se... | [
"public",
"static",
"function",
"filter",
"(",
"array",
"$",
"a",
",",
"$",
"filter",
",",
"array",
"$",
"listedProperties",
"=",
"[",
"]",
",",
"&",
"$",
"count",
"=",
"0",
")",
"{",
"$",
"count",
"=",
"0",
";",
"foreach",
"(",
"$",
"a",
"as",
... | Filters out the specified properties.
By default, a single match in the $filter bit field filters properties out, following an "or" logic.
When EXCLUDE_STRICT is set, an "and" logic is applied: all bits must match for a property to be removed.
@param array $a The array containing the properties to f... | [
"Filters",
"out",
"the",
"specified",
"properties",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/VarDumper/Caster/Caster.php#L107-L146 |
206,966 | symfony/symfony | src/Symfony/Component/Console/Formatter/OutputFormatter.php | OutputFormatter.applyCurrentStyle | private function applyCurrentStyle(string $text, string $current, int $width, int &$currentLineLength): string
{
if ('' === $text) {
return '';
}
if (!$width) {
return $this->isDecorated() ? $this->styleStack->getCurrent()->apply($text) : $text;
}
if... | php | private function applyCurrentStyle(string $text, string $current, int $width, int &$currentLineLength): string
{
if ('' === $text) {
return '';
}
if (!$width) {
return $this->isDecorated() ? $this->styleStack->getCurrent()->apply($text) : $text;
}
if... | [
"private",
"function",
"applyCurrentStyle",
"(",
"string",
"$",
"text",
",",
"string",
"$",
"current",
",",
"int",
"$",
"width",
",",
"int",
"&",
"$",
"currentLineLength",
")",
":",
"string",
"{",
"if",
"(",
"''",
"===",
"$",
"text",
")",
"{",
"return"... | Applies current style from stack to text, if must be applied. | [
"Applies",
"current",
"style",
"from",
"stack",
"to",
"text",
"if",
"must",
"be",
"applied",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Formatter/OutputFormatter.php#L238-L283 |
206,967 | symfony/symfony | src/Symfony/Component/Filesystem/Filesystem.php | Filesystem.chmod | public function chmod($files, $mode, $umask = 0000, $recursive = false)
{
foreach ($this->toIterable($files) as $file) {
if (true !== @chmod($file, $mode & ~$umask)) {
throw new IOException(sprintf('Failed to chmod file "%s".', $file), 0, null, $file);
}
i... | php | public function chmod($files, $mode, $umask = 0000, $recursive = false)
{
foreach ($this->toIterable($files) as $file) {
if (true !== @chmod($file, $mode & ~$umask)) {
throw new IOException(sprintf('Failed to chmod file "%s".', $file), 0, null, $file);
}
i... | [
"public",
"function",
"chmod",
"(",
"$",
"files",
",",
"$",
"mode",
",",
"$",
"umask",
"=",
"0000",
",",
"$",
"recursive",
"=",
"false",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"toIterable",
"(",
"$",
"files",
")",
"as",
"$",
"file",
")",
"{... | Change mode for an array of files or directories.
@param string|iterable $files A filename, an array of files, or a \Traversable instance to change mode
@param int $mode The new mode (octal)
@param int $umask The mode mask (octal)
@param bool $recursive Whether change th... | [
"Change",
"mode",
"for",
"an",
"array",
"of",
"files",
"or",
"directories",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Filesystem/Filesystem.php#L199-L209 |
206,968 | symfony/symfony | src/Symfony/Component/Filesystem/Filesystem.php | Filesystem.chown | public function chown($files, $user, $recursive = false)
{
foreach ($this->toIterable($files) as $file) {
if ($recursive && is_dir($file) && !is_link($file)) {
$this->chown(new \FilesystemIterator($file), $user, true);
}
if (is_link($file) && \function_exi... | php | public function chown($files, $user, $recursive = false)
{
foreach ($this->toIterable($files) as $file) {
if ($recursive && is_dir($file) && !is_link($file)) {
$this->chown(new \FilesystemIterator($file), $user, true);
}
if (is_link($file) && \function_exi... | [
"public",
"function",
"chown",
"(",
"$",
"files",
",",
"$",
"user",
",",
"$",
"recursive",
"=",
"false",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"toIterable",
"(",
"$",
"files",
")",
"as",
"$",
"file",
")",
"{",
"if",
"(",
"$",
"recursive",
... | Change the owner of an array of files or directories.
@param string|iterable $files A filename, an array of files, or a \Traversable instance to change owner
@param string $user The new owner user name
@param bool $recursive Whether change the owner recursively or not
@throws IOException ... | [
"Change",
"the",
"owner",
"of",
"an",
"array",
"of",
"files",
"or",
"directories",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Filesystem/Filesystem.php#L220-L236 |
206,969 | symfony/symfony | src/Symfony/Component/Filesystem/Filesystem.php | Filesystem.chgrp | public function chgrp($files, $group, $recursive = false)
{
foreach ($this->toIterable($files) as $file) {
if ($recursive && is_dir($file) && !is_link($file)) {
$this->chgrp(new \FilesystemIterator($file), $group, true);
}
if (is_link($file) && \function_e... | php | public function chgrp($files, $group, $recursive = false)
{
foreach ($this->toIterable($files) as $file) {
if ($recursive && is_dir($file) && !is_link($file)) {
$this->chgrp(new \FilesystemIterator($file), $group, true);
}
if (is_link($file) && \function_e... | [
"public",
"function",
"chgrp",
"(",
"$",
"files",
",",
"$",
"group",
",",
"$",
"recursive",
"=",
"false",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"toIterable",
"(",
"$",
"files",
")",
"as",
"$",
"file",
")",
"{",
"if",
"(",
"$",
"recursive",
... | Change the group of an array of files or directories.
@param string|iterable $files A filename, an array of files, or a \Traversable instance to change group
@param string $group The group name
@param bool $recursive Whether change the group recursively or not
@throws IOException When the ... | [
"Change",
"the",
"group",
"of",
"an",
"array",
"of",
"files",
"or",
"directories",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Filesystem/Filesystem.php#L247-L263 |
206,970 | symfony/symfony | src/Symfony/Component/Filesystem/Filesystem.php | Filesystem.readlink | public function readlink($path, $canonicalize = false)
{
if (!$canonicalize && !is_link($path)) {
return;
}
if ($canonicalize) {
if (!$this->exists($path)) {
return;
}
if ('\\' === \DIRECTORY_SEPARATOR) {
$path... | php | public function readlink($path, $canonicalize = false)
{
if (!$canonicalize && !is_link($path)) {
return;
}
if ($canonicalize) {
if (!$this->exists($path)) {
return;
}
if ('\\' === \DIRECTORY_SEPARATOR) {
$path... | [
"public",
"function",
"readlink",
"(",
"$",
"path",
",",
"$",
"canonicalize",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"canonicalize",
"&&",
"!",
"is_link",
"(",
"$",
"path",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"$",
"canonicalize",
")... | Resolves links in paths.
With $canonicalize = false (default)
- if $path does not exist or is not a link, returns null
- if $path is a link, returns the next direct target of the link without considering the existence of the target
With $canonicalize = true
- if $path does not exist, returns null
- if $path exists, r... | [
"Resolves",
"links",
"in",
"paths",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Filesystem/Filesystem.php#L414-L437 |
206,971 | symfony/symfony | src/Symfony/Component/Filesystem/Filesystem.php | Filesystem.tempnam | public function tempnam($dir, $prefix)
{
list($scheme, $hierarchy) = $this->getSchemeAndHierarchy($dir);
// If no scheme or scheme is "file" or "gs" (Google Cloud) create temp file in local filesystem
if (null === $scheme || 'file' === $scheme || 'gs' === $scheme) {
$tmpFile = @... | php | public function tempnam($dir, $prefix)
{
list($scheme, $hierarchy) = $this->getSchemeAndHierarchy($dir);
// If no scheme or scheme is "file" or "gs" (Google Cloud) create temp file in local filesystem
if (null === $scheme || 'file' === $scheme || 'gs' === $scheme) {
$tmpFile = @... | [
"public",
"function",
"tempnam",
"(",
"$",
"dir",
",",
"$",
"prefix",
")",
"{",
"list",
"(",
"$",
"scheme",
",",
"$",
"hierarchy",
")",
"=",
"$",
"this",
"->",
"getSchemeAndHierarchy",
"(",
"$",
"dir",
")",
";",
"// If no scheme or scheme is \"file\" or \"gs... | Creates a temporary file with support for custom stream wrappers.
@param string $dir The directory where the temporary filename will be created
@param string $prefix The prefix of the generated temporary filename
Note: Windows uses only the first three characters of prefix
@return string The new temporary filename... | [
"Creates",
"a",
"temporary",
"file",
"with",
"support",
"for",
"custom",
"stream",
"wrappers",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Filesystem/Filesystem.php#L620-L661 |
206,972 | symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Templating/TemplateReference.php | TemplateReference.getPath | public function getPath()
{
$controller = str_replace('\\', '/', $this->get('controller'));
$path = (empty($controller) ? '' : $controller.'/').$this->get('name').'.'.$this->get('format').'.'.$this->get('engine');
return empty($this->parameters['bundle']) ? 'views/'.$path : '@'.$this->get(... | php | public function getPath()
{
$controller = str_replace('\\', '/', $this->get('controller'));
$path = (empty($controller) ? '' : $controller.'/').$this->get('name').'.'.$this->get('format').'.'.$this->get('engine');
return empty($this->parameters['bundle']) ? 'views/'.$path : '@'.$this->get(... | [
"public",
"function",
"getPath",
"(",
")",
"{",
"$",
"controller",
"=",
"str_replace",
"(",
"'\\\\'",
",",
"'/'",
",",
"$",
"this",
"->",
"get",
"(",
"'controller'",
")",
")",
";",
"$",
"path",
"=",
"(",
"empty",
"(",
"$",
"controller",
")",
"?",
"... | Returns the path to the template
- as a path when the template is not part of a bundle
- as a resource when the template is part of a bundle.
@return string A path to the template or a resource | [
"Returns",
"the",
"path",
"to",
"the",
"template",
"-",
"as",
"a",
"path",
"when",
"the",
"template",
"is",
"not",
"part",
"of",
"a",
"bundle",
"-",
"as",
"a",
"resource",
"when",
"the",
"template",
"is",
"part",
"of",
"a",
"bundle",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/FrameworkBundle/Templating/TemplateReference.php#L45-L52 |
206,973 | symfony/symfony | src/Symfony/Component/DomCrawler/Field/FormField.php | FormField.getLabel | public function getLabel()
{
$xpath = new \DOMXPath($this->node->ownerDocument);
if ($this->node->hasAttribute('id')) {
$labels = $xpath->query(sprintf('descendant::label[@for="%s"]', $this->node->getAttribute('id')));
if ($labels->length > 0) {
return $label... | php | public function getLabel()
{
$xpath = new \DOMXPath($this->node->ownerDocument);
if ($this->node->hasAttribute('id')) {
$labels = $xpath->query(sprintf('descendant::label[@for="%s"]', $this->node->getAttribute('id')));
if ($labels->length > 0) {
return $label... | [
"public",
"function",
"getLabel",
"(",
")",
"{",
"$",
"xpath",
"=",
"new",
"\\",
"DOMXPath",
"(",
"$",
"this",
"->",
"node",
"->",
"ownerDocument",
")",
";",
"if",
"(",
"$",
"this",
"->",
"node",
"->",
"hasAttribute",
"(",
"'id'",
")",
")",
"{",
"$... | Returns the label tag associated to the field or null if none.
@return \DOMElement|null | [
"Returns",
"the",
"label",
"tag",
"associated",
"to",
"the",
"field",
"or",
"null",
"if",
"none",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DomCrawler/Field/FormField.php#L63-L78 |
206,974 | symfony/symfony | src/Symfony/Component/Form/Extension/Core/DataTransformer/NumberToLocalizedStringTransformer.php | NumberToLocalizedStringTransformer.round | private function round($number)
{
if (null !== $this->scale && null !== $this->roundingMode) {
// shift number to maintain the correct scale during rounding
$roundingCoef = pow(10, $this->scale);
// string representation to avoid rounding errors, similar to bcmul()
... | php | private function round($number)
{
if (null !== $this->scale && null !== $this->roundingMode) {
// shift number to maintain the correct scale during rounding
$roundingCoef = pow(10, $this->scale);
// string representation to avoid rounding errors, similar to bcmul()
... | [
"private",
"function",
"round",
"(",
"$",
"number",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"scale",
"&&",
"null",
"!==",
"$",
"this",
"->",
"roundingMode",
")",
"{",
"// shift number to maintain the correct scale during rounding",
"$",
"roundingC... | Rounds a number according to the configured scale and rounding mode.
@param int|float $number A number
@return int|float The rounded number | [
"Rounds",
"a",
"number",
"according",
"to",
"the",
"configured",
"scale",
"and",
"rounding",
"mode",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Extension/Core/DataTransformer/NumberToLocalizedStringTransformer.php#L250-L286 |
206,975 | symfony/symfony | src/Symfony/Bridge/Doctrine/PropertyInfo/DoctrineExtractor.php | DoctrineExtractor.isAssociationNullable | private function isAssociationNullable(array $associationMapping): bool
{
if (isset($associationMapping['id']) && $associationMapping['id']) {
return false;
}
if (!isset($associationMapping['joinColumns'])) {
return true;
}
$joinColumns = $associatio... | php | private function isAssociationNullable(array $associationMapping): bool
{
if (isset($associationMapping['id']) && $associationMapping['id']) {
return false;
}
if (!isset($associationMapping['joinColumns'])) {
return true;
}
$joinColumns = $associatio... | [
"private",
"function",
"isAssociationNullable",
"(",
"array",
"$",
"associationMapping",
")",
":",
"bool",
"{",
"if",
"(",
"isset",
"(",
"$",
"associationMapping",
"[",
"'id'",
"]",
")",
"&&",
"$",
"associationMapping",
"[",
"'id'",
"]",
")",
"{",
"return",
... | Determines whether an association is nullable.
@see https://github.com/doctrine/doctrine2/blob/v2.5.4/lib/Doctrine/ORM/Tools/EntityGenerator.php#L1221-L1246 | [
"Determines",
"whether",
"an",
"association",
"is",
"nullable",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bridge/Doctrine/PropertyInfo/DoctrineExtractor.php#L184-L202 |
206,976 | symfony/symfony | src/Symfony/Component/Form/Extension/Validator/ViolationMapper/MappingRule.php | MappingRule.isPrefix | public function isPrefix($propertyPath)
{
$length = \strlen($propertyPath);
$prefix = substr($this->propertyPath, 0, $length);
$next = isset($this->propertyPath[$length]) ? $this->propertyPath[$length] : null;
return $prefix === $propertyPath && ('[' === $next || '.' === $next);
... | php | public function isPrefix($propertyPath)
{
$length = \strlen($propertyPath);
$prefix = substr($this->propertyPath, 0, $length);
$next = isset($this->propertyPath[$length]) ? $this->propertyPath[$length] : null;
return $prefix === $propertyPath && ('[' === $next || '.' === $next);
... | [
"public",
"function",
"isPrefix",
"(",
"$",
"propertyPath",
")",
"{",
"$",
"length",
"=",
"\\",
"strlen",
"(",
"$",
"propertyPath",
")",
";",
"$",
"prefix",
"=",
"substr",
"(",
"$",
"this",
"->",
"propertyPath",
",",
"0",
",",
"$",
"length",
")",
";"... | Matches a property path against a prefix of the rule path.
@param string $propertyPath The property path to match against the rule
@return bool Whether the property path is a prefix of the rule or not | [
"Matches",
"a",
"property",
"path",
"against",
"a",
"prefix",
"of",
"the",
"rule",
"path",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/MappingRule.php#L65-L72 |
206,977 | symfony/symfony | src/Symfony/Component/Finder/Comparator/Comparator.php | Comparator.setOperator | public function setOperator($operator)
{
if (!$operator) {
$operator = '==';
}
if (!\in_array($operator, ['>', '<', '>=', '<=', '==', '!='])) {
throw new \InvalidArgumentException(sprintf('Invalid operator "%s".', $operator));
}
$this->operator = $op... | php | public function setOperator($operator)
{
if (!$operator) {
$operator = '==';
}
if (!\in_array($operator, ['>', '<', '>=', '<=', '==', '!='])) {
throw new \InvalidArgumentException(sprintf('Invalid operator "%s".', $operator));
}
$this->operator = $op... | [
"public",
"function",
"setOperator",
"(",
"$",
"operator",
")",
"{",
"if",
"(",
"!",
"$",
"operator",
")",
"{",
"$",
"operator",
"=",
"'=='",
";",
"}",
"if",
"(",
"!",
"\\",
"in_array",
"(",
"$",
"operator",
",",
"[",
"'>'",
",",
"'<'",
",",
"'>=... | Sets the comparison operator.
@param string $operator A valid operator
@throws \InvalidArgumentException | [
"Sets",
"the",
"comparison",
"operator",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Finder/Comparator/Comparator.php#L61-L72 |
206,978 | symfony/symfony | src/Symfony/Component/Cache/CacheItem.php | CacheItem.log | public static function log(LoggerInterface $logger = null, $message, $context = [])
{
if ($logger) {
$logger->warning($message, $context);
} else {
$replace = [];
foreach ($context as $k => $v) {
if (is_scalar($v)) {
$replace['{... | php | public static function log(LoggerInterface $logger = null, $message, $context = [])
{
if ($logger) {
$logger->warning($message, $context);
} else {
$replace = [];
foreach ($context as $k => $v) {
if (is_scalar($v)) {
$replace['{... | [
"public",
"static",
"function",
"log",
"(",
"LoggerInterface",
"$",
"logger",
"=",
"null",
",",
"$",
"message",
",",
"$",
"context",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"logger",
")",
"{",
"$",
"logger",
"->",
"warning",
"(",
"$",
"message",
"... | Internal logging helper.
@internal | [
"Internal",
"logging",
"helper",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Cache/CacheItem.php#L186-L199 |
206,979 | symfony/symfony | src/Symfony/Component/HttpKernel/UriSigner.php | UriSigner.check | public function check($uri)
{
$url = parse_url($uri);
if (isset($url['query'])) {
parse_str($url['query'], $params);
} else {
$params = [];
}
if (empty($params[$this->parameter])) {
return false;
}
$hash = $params[$this->p... | php | public function check($uri)
{
$url = parse_url($uri);
if (isset($url['query'])) {
parse_str($url['query'], $params);
} else {
$params = [];
}
if (empty($params[$this->parameter])) {
return false;
}
$hash = $params[$this->p... | [
"public",
"function",
"check",
"(",
"$",
"uri",
")",
"{",
"$",
"url",
"=",
"parse_url",
"(",
"$",
"uri",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"url",
"[",
"'query'",
"]",
")",
")",
"{",
"parse_str",
"(",
"$",
"url",
"[",
"'query'",
"]",
",",
... | Checks that a URI contains the correct hash.
@param string $uri A signed URI
@return bool True if the URI is signed correctly, false otherwise | [
"Checks",
"that",
"a",
"URI",
"contains",
"the",
"correct",
"hash",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/UriSigner.php#L66-L83 |
206,980 | symfony/symfony | src/Symfony/Component/Config/Definition/Builder/NumericNodeDefinition.php | NumericNodeDefinition.max | public function max($max)
{
if (isset($this->min) && $this->min > $max) {
throw new \InvalidArgumentException(sprintf('You cannot define a max(%s) as you already have a min(%s)', $max, $this->min));
}
$this->max = $max;
return $this;
} | php | public function max($max)
{
if (isset($this->min) && $this->min > $max) {
throw new \InvalidArgumentException(sprintf('You cannot define a max(%s) as you already have a min(%s)', $max, $this->min));
}
$this->max = $max;
return $this;
} | [
"public",
"function",
"max",
"(",
"$",
"max",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"min",
")",
"&&",
"$",
"this",
"->",
"min",
">",
"$",
"max",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'You ... | Ensures that the value is smaller than the given reference.
@param mixed $max
@return $this
@throws \InvalidArgumentException when the constraint is inconsistent | [
"Ensures",
"that",
"the",
"value",
"is",
"smaller",
"than",
"the",
"given",
"reference",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Config/Definition/Builder/NumericNodeDefinition.php#L35-L43 |
206,981 | symfony/symfony | src/Symfony/Component/Messenger/Transport/AmqpExt/Connection.php | Connection.countMessagesInQueues | public function countMessagesInQueues(): int
{
return array_sum(array_map(function ($queueName) {
return $this->queue($queueName)->declareQueue();
}, $this->getQueueNames()));
} | php | public function countMessagesInQueues(): int
{
return array_sum(array_map(function ($queueName) {
return $this->queue($queueName)->declareQueue();
}, $this->getQueueNames()));
} | [
"public",
"function",
"countMessagesInQueues",
"(",
")",
":",
"int",
"{",
"return",
"array_sum",
"(",
"array_map",
"(",
"function",
"(",
"$",
"queueName",
")",
"{",
"return",
"$",
"this",
"->",
"queue",
"(",
"$",
"queueName",
")",
"->",
"declareQueue",
"("... | Returns an approximate count of the messages in defined queues. | [
"Returns",
"an",
"approximate",
"count",
"of",
"the",
"messages",
"in",
"defined",
"queues",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Messenger/Transport/AmqpExt/Connection.php#L200-L205 |
206,982 | symfony/symfony | src/Symfony/Component/Messenger/Transport/AmqpExt/Connection.php | Connection.createDelayQueue | private function createDelayQueue(int $delay, ?string $routingKey)
{
$queue = $this->amqpFactory->createQueue($this->channel());
$queue->setName(str_replace('%delay%', $delay, $this->connectionOptions['delay']['queue_name_pattern']));
$queue->setArguments([
'x-message-ttl' => $de... | php | private function createDelayQueue(int $delay, ?string $routingKey)
{
$queue = $this->amqpFactory->createQueue($this->channel());
$queue->setName(str_replace('%delay%', $delay, $this->connectionOptions['delay']['queue_name_pattern']));
$queue->setArguments([
'x-message-ttl' => $de... | [
"private",
"function",
"createDelayQueue",
"(",
"int",
"$",
"delay",
",",
"?",
"string",
"$",
"routingKey",
")",
"{",
"$",
"queue",
"=",
"$",
"this",
"->",
"amqpFactory",
"->",
"createQueue",
"(",
"$",
"this",
"->",
"channel",
"(",
")",
")",
";",
"$",
... | Creates a delay queue that will delay for a certain amount of time.
This works by setting message TTL for the delay and pointing
the dead letter exchange to the original exchange. The result
is that after the TTL, the message is sent to the dead-letter-exchange,
which is the original exchange, resulting on it being pu... | [
"Creates",
"a",
"delay",
"queue",
"that",
"will",
"delay",
"for",
"a",
"certain",
"amount",
"of",
"time",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Messenger/Transport/AmqpExt/Connection.php#L271-L287 |
206,983 | symfony/symfony | src/Symfony/Component/Messenger/Transport/AmqpExt/Connection.php | Connection.get | public function get(string $queueName): ?\AMQPEnvelope
{
if ($this->shouldSetup()) {
$this->setup();
}
try {
if (false !== $message = $this->queue($queueName)->get()) {
return $message;
}
} catch (\AMQPQueueException $e) {
... | php | public function get(string $queueName): ?\AMQPEnvelope
{
if ($this->shouldSetup()) {
$this->setup();
}
try {
if (false !== $message = $this->queue($queueName)->get()) {
return $message;
}
} catch (\AMQPQueueException $e) {
... | [
"public",
"function",
"get",
"(",
"string",
"$",
"queueName",
")",
":",
"?",
"\\",
"AMQPEnvelope",
"{",
"if",
"(",
"$",
"this",
"->",
"shouldSetup",
"(",
")",
")",
"{",
"$",
"this",
"->",
"setup",
"(",
")",
";",
"}",
"try",
"{",
"if",
"(",
"false... | Gets a message from the specified queue.
@throws \AMQPException | [
"Gets",
"a",
"message",
"from",
"the",
"specified",
"queue",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Messenger/Transport/AmqpExt/Connection.php#L299-L321 |
206,984 | symfony/symfony | src/Symfony/Component/Form/NativeRequestHandler.php | NativeRequestHandler.getRequestMethod | private static function getRequestMethod()
{
$method = isset($_SERVER['REQUEST_METHOD'])
? strtoupper($_SERVER['REQUEST_METHOD'])
: 'GET';
if ('POST' === $method && isset($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'])) {
$method = strtoupper($_SERVER['HTTP_X_HTTP_METHO... | php | private static function getRequestMethod()
{
$method = isset($_SERVER['REQUEST_METHOD'])
? strtoupper($_SERVER['REQUEST_METHOD'])
: 'GET';
if ('POST' === $method && isset($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'])) {
$method = strtoupper($_SERVER['HTTP_X_HTTP_METHO... | [
"private",
"static",
"function",
"getRequestMethod",
"(",
")",
"{",
"$",
"method",
"=",
"isset",
"(",
"$",
"_SERVER",
"[",
"'REQUEST_METHOD'",
"]",
")",
"?",
"strtoupper",
"(",
"$",
"_SERVER",
"[",
"'REQUEST_METHOD'",
"]",
")",
":",
"'GET'",
";",
"if",
"... | Returns the method used to submit the request to the server.
@return string The request method | [
"Returns",
"the",
"method",
"used",
"to",
"submit",
"the",
"request",
"to",
"the",
"server",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/NativeRequestHandler.php#L167-L178 |
206,985 | symfony/symfony | src/Symfony/Component/Form/NativeRequestHandler.php | NativeRequestHandler.stripEmptyFiles | private static function stripEmptyFiles($data)
{
if (!\is_array($data)) {
return $data;
}
$keys = array_keys($data);
sort($keys);
if (self::$fileKeys === $keys) {
if (UPLOAD_ERR_NO_FILE === $data['error']) {
return null;
}... | php | private static function stripEmptyFiles($data)
{
if (!\is_array($data)) {
return $data;
}
$keys = array_keys($data);
sort($keys);
if (self::$fileKeys === $keys) {
if (UPLOAD_ERR_NO_FILE === $data['error']) {
return null;
}... | [
"private",
"static",
"function",
"stripEmptyFiles",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"!",
"\\",
"is_array",
"(",
"$",
"data",
")",
")",
"{",
"return",
"$",
"data",
";",
"}",
"$",
"keys",
"=",
"array_keys",
"(",
"$",
"data",
")",
";",
"sort",
... | Sets empty uploaded files to NULL in the given uploaded files array.
@param mixed $data The file upload data
@return array|null Returns the stripped upload data | [
"Sets",
"empty",
"uploaded",
"files",
"to",
"NULL",
"in",
"the",
"given",
"uploaded",
"files",
"array",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/NativeRequestHandler.php#L235-L257 |
206,986 | symfony/symfony | src/Symfony/Component/Form/ResolvedFormType.php | ResolvedFormType.buildForm | public function buildForm(FormBuilderInterface $builder, array $options)
{
if (null !== $this->parent) {
$this->parent->buildForm($builder, $options);
}
$this->innerType->buildForm($builder, $options);
foreach ($this->typeExtensions as $extension) {
$extensi... | php | public function buildForm(FormBuilderInterface $builder, array $options)
{
if (null !== $this->parent) {
$this->parent->buildForm($builder, $options);
}
$this->innerType->buildForm($builder, $options);
foreach ($this->typeExtensions as $extension) {
$extensi... | [
"public",
"function",
"buildForm",
"(",
"FormBuilderInterface",
"$",
"builder",
",",
"array",
"$",
"options",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"parent",
")",
"{",
"$",
"this",
"->",
"parent",
"->",
"buildForm",
"(",
"$",
"builder",
... | Configures a form builder for the type hierarchy.
@param FormBuilderInterface $builder The builder to configure
@param array $options The options used for the configuration | [
"Configures",
"a",
"form",
"builder",
"for",
"the",
"type",
"hierarchy",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/ResolvedFormType.php#L120-L131 |
206,987 | symfony/symfony | src/Symfony/Component/Form/ResolvedFormType.php | ResolvedFormType.buildView | public function buildView(FormView $view, FormInterface $form, array $options)
{
if (null !== $this->parent) {
$this->parent->buildView($view, $form, $options);
}
$this->innerType->buildView($view, $form, $options);
foreach ($this->typeExtensions as $extension) {
... | php | public function buildView(FormView $view, FormInterface $form, array $options)
{
if (null !== $this->parent) {
$this->parent->buildView($view, $form, $options);
}
$this->innerType->buildView($view, $form, $options);
foreach ($this->typeExtensions as $extension) {
... | [
"public",
"function",
"buildView",
"(",
"FormView",
"$",
"view",
",",
"FormInterface",
"$",
"form",
",",
"array",
"$",
"options",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"parent",
")",
"{",
"$",
"this",
"->",
"parent",
"->",
"buildView",... | Configures a form view for the type hierarchy.
This method is called before the children of the view are built.
@param FormView $view The form view to configure
@param FormInterface $form The form corresponding to the view
@param array $options The options used for the configuration | [
"Configures",
"a",
"form",
"view",
"for",
"the",
"type",
"hierarchy",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/ResolvedFormType.php#L142-L153 |
206,988 | symfony/symfony | src/Symfony/Component/Translation/Loader/CsvFileLoader.php | CsvFileLoader.setCsvControl | public function setCsvControl($delimiter = ';', $enclosure = '"', $escape = '\\')
{
$this->delimiter = $delimiter;
$this->enclosure = $enclosure;
$this->escape = $escape;
} | php | public function setCsvControl($delimiter = ';', $enclosure = '"', $escape = '\\')
{
$this->delimiter = $delimiter;
$this->enclosure = $enclosure;
$this->escape = $escape;
} | [
"public",
"function",
"setCsvControl",
"(",
"$",
"delimiter",
"=",
"';'",
",",
"$",
"enclosure",
"=",
"'\"'",
",",
"$",
"escape",
"=",
"'\\\\'",
")",
"{",
"$",
"this",
"->",
"delimiter",
"=",
"$",
"delimiter",
";",
"$",
"this",
"->",
"enclosure",
"=",
... | Sets the delimiter, enclosure, and escape character for CSV.
@param string $delimiter Delimiter character
@param string $enclosure Enclosure character
@param string $escape Escape character | [
"Sets",
"the",
"delimiter",
"enclosure",
"and",
"escape",
"character",
"for",
"CSV",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Translation/Loader/CsvFileLoader.php#L59-L64 |
206,989 | symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php | AssetsInstallCommand.relativeSymlinkWithFallback | private function relativeSymlinkWithFallback(string $originDir, string $targetDir): string
{
try {
$this->symlink($originDir, $targetDir, true);
$method = self::METHOD_RELATIVE_SYMLINK;
} catch (IOException $e) {
$method = $this->absoluteSymlinkWithFallback($origi... | php | private function relativeSymlinkWithFallback(string $originDir, string $targetDir): string
{
try {
$this->symlink($originDir, $targetDir, true);
$method = self::METHOD_RELATIVE_SYMLINK;
} catch (IOException $e) {
$method = $this->absoluteSymlinkWithFallback($origi... | [
"private",
"function",
"relativeSymlinkWithFallback",
"(",
"string",
"$",
"originDir",
",",
"string",
"$",
"targetDir",
")",
":",
"string",
"{",
"try",
"{",
"$",
"this",
"->",
"symlink",
"(",
"$",
"originDir",
",",
"$",
"targetDir",
",",
"true",
")",
";",
... | Try to create relative symlink.
Falling back to absolute symlink and finally hard copy. | [
"Try",
"to",
"create",
"relative",
"symlink",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php#L206-L216 |
206,990 | symfony/symfony | src/Symfony/Component/HttpKernel/Profiler/Profiler.php | Profiler.loadProfileFromResponse | public function loadProfileFromResponse(Response $response)
{
if (!$token = $response->headers->get('X-Debug-Token')) {
return false;
}
return $this->loadProfile($token);
} | php | public function loadProfileFromResponse(Response $response)
{
if (!$token = $response->headers->get('X-Debug-Token')) {
return false;
}
return $this->loadProfile($token);
} | [
"public",
"function",
"loadProfileFromResponse",
"(",
"Response",
"$",
"response",
")",
"{",
"if",
"(",
"!",
"$",
"token",
"=",
"$",
"response",
"->",
"headers",
"->",
"get",
"(",
"'X-Debug-Token'",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"... | Loads the Profile for the given Response.
@return Profile|false A Profile instance | [
"Loads",
"the",
"Profile",
"for",
"the",
"given",
"Response",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/Profiler/Profiler.php#L68-L75 |
206,991 | symfony/symfony | src/Symfony/Component/HttpKernel/Profiler/Profiler.php | Profiler.saveProfile | public function saveProfile(Profile $profile)
{
// late collect
foreach ($profile->getCollectors() as $collector) {
if ($collector instanceof LateDataCollectorInterface) {
$collector->lateCollect();
}
}
if (!($ret = $this->storage->write($prof... | php | public function saveProfile(Profile $profile)
{
// late collect
foreach ($profile->getCollectors() as $collector) {
if ($collector instanceof LateDataCollectorInterface) {
$collector->lateCollect();
}
}
if (!($ret = $this->storage->write($prof... | [
"public",
"function",
"saveProfile",
"(",
"Profile",
"$",
"profile",
")",
"{",
"// late collect",
"foreach",
"(",
"$",
"profile",
"->",
"getCollectors",
"(",
")",
"as",
"$",
"collector",
")",
"{",
"if",
"(",
"$",
"collector",
"instanceof",
"LateDataCollectorIn... | Saves a Profile.
@return bool | [
"Saves",
"a",
"Profile",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/Profiler/Profiler.php#L94-L108 |
206,992 | symfony/symfony | src/Symfony/Component/HttpKernel/Profiler/Profiler.php | Profiler.find | public function find($ip, $url, $limit, $method, $start, $end, $statusCode = null)
{
return $this->storage->find($ip, $url, $limit, $method, $this->getTimestamp($start), $this->getTimestamp($end), $statusCode);
} | php | public function find($ip, $url, $limit, $method, $start, $end, $statusCode = null)
{
return $this->storage->find($ip, $url, $limit, $method, $this->getTimestamp($start), $this->getTimestamp($end), $statusCode);
} | [
"public",
"function",
"find",
"(",
"$",
"ip",
",",
"$",
"url",
",",
"$",
"limit",
",",
"$",
"method",
",",
"$",
"start",
",",
"$",
"end",
",",
"$",
"statusCode",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"storage",
"->",
"find",
"(",
... | Finds profiler tokens for the given criteria.
@param string $ip The IP
@param string $url The URL
@param string $limit The maximum number of tokens to return
@param string $method The request method
@param string $start The start date to search from
@param string $end The end date t... | [
"Finds",
"profiler",
"tokens",
"for",
"the",
"given",
"criteria",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/Profiler/Profiler.php#L133-L136 |
206,993 | symfony/symfony | src/Symfony/Component/HttpKernel/Profiler/Profiler.php | Profiler.set | public function set(array $collectors = [])
{
$this->collectors = [];
foreach ($collectors as $collector) {
$this->add($collector);
}
} | php | public function set(array $collectors = [])
{
$this->collectors = [];
foreach ($collectors as $collector) {
$this->add($collector);
}
} | [
"public",
"function",
"set",
"(",
"array",
"$",
"collectors",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"collectors",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"collectors",
"as",
"$",
"collector",
")",
"{",
"$",
"this",
"->",
"add",
"(",
"$",
"... | Sets the Collectors associated with this profiler.
@param DataCollectorInterface[] $collectors An array of collectors | [
"Sets",
"the",
"Collectors",
"associated",
"with",
"this",
"profiler",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/Profiler/Profiler.php#L199-L205 |
206,994 | symfony/symfony | src/Symfony/Component/Console/Helper/ProcessHelper.php | ProcessHelper.wrapCallback | public function wrapCallback(OutputInterface $output, Process $process, callable $callback = null)
{
if ($output instanceof ConsoleOutputInterface) {
$output = $output->getErrorOutput();
}
$formatter = $this->getHelperSet()->get('debug_formatter');
return function ($typ... | php | public function wrapCallback(OutputInterface $output, Process $process, callable $callback = null)
{
if ($output instanceof ConsoleOutputInterface) {
$output = $output->getErrorOutput();
}
$formatter = $this->getHelperSet()->get('debug_formatter');
return function ($typ... | [
"public",
"function",
"wrapCallback",
"(",
"OutputInterface",
"$",
"output",
",",
"Process",
"$",
"process",
",",
"callable",
"$",
"callback",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"output",
"instanceof",
"ConsoleOutputInterface",
")",
"{",
"$",
"output",
"... | Wraps a Process callback to add debugging output.
@param OutputInterface $output An OutputInterface interface
@param Process $process The Process
@param callable|null $callback A PHP callable
@return callable | [
"Wraps",
"a",
"Process",
"callback",
"to",
"add",
"debugging",
"output",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Helper/ProcessHelper.php#L127-L142 |
206,995 | symfony/symfony | src/Symfony/Component/Stopwatch/Stopwatch.php | Stopwatch.openSection | public function openSection($id = null)
{
$current = end($this->activeSections);
if (null !== $id && null === $current->get($id)) {
throw new \LogicException(sprintf('The section "%s" has been started at an other level and can not be opened.', $id));
}
$this->start('__s... | php | public function openSection($id = null)
{
$current = end($this->activeSections);
if (null !== $id && null === $current->get($id)) {
throw new \LogicException(sprintf('The section "%s" has been started at an other level and can not be opened.', $id));
}
$this->start('__s... | [
"public",
"function",
"openSection",
"(",
"$",
"id",
"=",
"null",
")",
"{",
"$",
"current",
"=",
"end",
"(",
"$",
"this",
"->",
"activeSections",
")",
";",
"if",
"(",
"null",
"!==",
"$",
"id",
"&&",
"null",
"===",
"$",
"current",
"->",
"get",
"(",
... | Creates a new section or re-opens an existing section.
@param string|null $id The id of the session to re-open, null to create a new one
@throws \LogicException When the section to re-open is not reachable | [
"Creates",
"a",
"new",
"section",
"or",
"re",
"-",
"opens",
"an",
"existing",
"section",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Stopwatch/Stopwatch.php#L62-L73 |
206,996 | symfony/symfony | src/Symfony/Component/Stopwatch/Stopwatch.php | Stopwatch.stopSection | public function stopSection($id)
{
$this->stop('__section__');
if (1 == \count($this->activeSections)) {
throw new \LogicException('There is no started section to stop.');
}
$this->sections[$id] = array_pop($this->activeSections)->setId($id);
$this->stop('__sect... | php | public function stopSection($id)
{
$this->stop('__section__');
if (1 == \count($this->activeSections)) {
throw new \LogicException('There is no started section to stop.');
}
$this->sections[$id] = array_pop($this->activeSections)->setId($id);
$this->stop('__sect... | [
"public",
"function",
"stopSection",
"(",
"$",
"id",
")",
"{",
"$",
"this",
"->",
"stop",
"(",
"'__section__'",
")",
";",
"if",
"(",
"1",
"==",
"\\",
"count",
"(",
"$",
"this",
"->",
"activeSections",
")",
")",
"{",
"throw",
"new",
"\\",
"LogicExcept... | Stops the last started section.
The id parameter is used to retrieve the events from this section.
@see getSectionEvents()
@param string $id The identifier of the section
@throws \LogicException When there's no started section to be stopped | [
"Stops",
"the",
"last",
"started",
"section",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Stopwatch/Stopwatch.php#L86-L96 |
206,997 | symfony/symfony | src/Symfony/Component/Stopwatch/Stopwatch.php | Stopwatch.getSectionEvents | public function getSectionEvents($id)
{
return isset($this->sections[$id]) ? $this->sections[$id]->getEvents() : [];
} | php | public function getSectionEvents($id)
{
return isset($this->sections[$id]) ? $this->sections[$id]->getEvents() : [];
} | [
"public",
"function",
"getSectionEvents",
"(",
"$",
"id",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"sections",
"[",
"$",
"id",
"]",
")",
"?",
"$",
"this",
"->",
"sections",
"[",
"$",
"id",
"]",
"->",
"getEvents",
"(",
")",
":",
"[",
"... | Gets all events for a given section.
@param string $id A section identifier
@return StopwatchEvent[] | [
"Gets",
"all",
"events",
"for",
"a",
"given",
"section",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Stopwatch/Stopwatch.php#L166-L169 |
206,998 | symfony/symfony | src/Symfony/Component/WebLink/HttpHeaderSerializer.php | HttpHeaderSerializer.serialize | public function serialize(iterable $links)
{
$elements = [];
foreach ($links as $link) {
if ($link->isTemplated()) {
continue;
}
$attributesParts = ['', sprintf('rel="%s"', implode(' ', $link->getRels()))];
foreach ($link->getAttribute... | php | public function serialize(iterable $links)
{
$elements = [];
foreach ($links as $link) {
if ($link->isTemplated()) {
continue;
}
$attributesParts = ['', sprintf('rel="%s"', implode(' ', $link->getRels()))];
foreach ($link->getAttribute... | [
"public",
"function",
"serialize",
"(",
"iterable",
"$",
"links",
")",
"{",
"$",
"elements",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"links",
"as",
"$",
"link",
")",
"{",
"if",
"(",
"$",
"link",
"->",
"isTemplated",
"(",
")",
")",
"{",
"continue",... | Builds the value of the "Link" HTTP header.
@param LinkInterface[]|\Traversable $links
@return string|null | [
"Builds",
"the",
"value",
"of",
"the",
"Link",
"HTTP",
"header",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/WebLink/HttpHeaderSerializer.php#L32-L65 |
206,999 | symfony/symfony | src/Symfony/Component/Finder/Finder.php | Finder.depth | public function depth($levels)
{
foreach ((array) $levels as $level) {
$this->depths[] = new Comparator\NumberComparator($level);
}
return $this;
} | php | public function depth($levels)
{
foreach ((array) $levels as $level) {
$this->depths[] = new Comparator\NumberComparator($level);
}
return $this;
} | [
"public",
"function",
"depth",
"(",
"$",
"levels",
")",
"{",
"foreach",
"(",
"(",
"array",
")",
"$",
"levels",
"as",
"$",
"level",
")",
"{",
"$",
"this",
"->",
"depths",
"[",
"]",
"=",
"new",
"Comparator",
"\\",
"NumberComparator",
"(",
"$",
"level",... | Adds tests for the directory depth.
Usage:
$finder->depth('> 1') // the Finder will start matching at level 1.
$finder->depth('< 3') // the Finder will descend at most 3 levels of directories below the starting point.
$finder->depth(['>= 1', '< 3'])
@param string|int|string[]|int[] $levels The depth level expression... | [
"Adds",
"tests",
"for",
"the",
"directory",
"depth",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Finder/Finder.php#L122-L129 |
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.