repo
stringclasses
21 values
path
stringlengths
10
100
func_name
stringlengths
6
71
original_string
stringlengths
115
97k
language
stringclasses
1 value
code
stringlengths
115
97k
code_tokens
listlengths
27
7.5k
docstring
stringlengths
6
1.88k
docstring_tokens
listlengths
1
177
sha
stringclasses
21 values
url
stringlengths
100
189
partition
stringclasses
1 value
summary
stringlengths
9
340
input_ids
listlengths
502
502
token_type_ids
listlengths
502
502
attention_mask
listlengths
502
502
labels
listlengths
502
502
matomo-org/matomo
plugins/Marketplace/Api/Service.php
Service.fetch
public function fetch($action, $params) { $endpoint = sprintf('%s/api/%s/', $this->domain, $this->version); $query = Http::buildQuery($params); $url = sprintf('%s%s?%s', $endpoint, $action, $query); $response = $this->download($url); $result = json_decode($response, true); if (is_null($result)) { $message = sprintf('There was an error reading the response from the Marketplace: Please try again later.'); throw new Service\Exception($message, Service\Exception::HTTP_ERROR); } if (!empty($result['error'])) { throw new Service\Exception($result['error'], Service\Exception::API_ERROR); } return $result; }
php
public function fetch($action, $params) { $endpoint = sprintf('%s/api/%s/', $this->domain, $this->version); $query = Http::buildQuery($params); $url = sprintf('%s%s?%s', $endpoint, $action, $query); $response = $this->download($url); $result = json_decode($response, true); if (is_null($result)) { $message = sprintf('There was an error reading the response from the Marketplace: Please try again later.'); throw new Service\Exception($message, Service\Exception::HTTP_ERROR); } if (!empty($result['error'])) { throw new Service\Exception($result['error'], Service\Exception::API_ERROR); } return $result; }
[ "public", "function", "fetch", "(", "$", "action", ",", "$", "params", ")", "{", "$", "endpoint", "=", "sprintf", "(", "'%s/api/%s/'", ",", "$", "this", "->", "domain", ",", "$", "this", "->", "version", ")", ";", "$", "query", "=", "Http", "::", "...
Executes the given API action on the Marketplace using the given params and returns the result. Make sure to call {@link authenticate()} to download paid plugins. @param string $action eg 'plugins', 'plugins/$pluginName/info', ... @param array $params eg array('sort' => 'alpha') @return mixed @throws Service\Exception
[ "Executes", "the", "given", "API", "action", "on", "the", "Marketplace", "using", "the", "given", "params", "and", "returns", "the", "result", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Marketplace/Api/Service.php#L126-L147
train
Fetch the result of the API call
[ 30522, 2270, 3853, 18584, 1006, 1002, 2895, 1010, 1002, 11498, 5244, 1007, 1063, 1002, 2203, 8400, 1027, 9043, 2546, 1006, 1005, 1003, 1055, 1013, 17928, 1013, 1003, 1055, 1013, 1005, 1010, 1002, 2023, 1011, 1028, 5884, 1010, 1002, 2023, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
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)) { return $locale; } if (!empty($m[4])) { return strtolower($m[1]).'_'.ucfirst(strtolower($m[2].$m[3])).'_'.strtoupper($m[4]); } if (!empty($m[3])) { return strtolower($m[1]).'_'.ucfirst(strtolower($m[2].$m[3])); } return strtolower($m[1]).'_'.strtoupper($m[2]); }
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)) { return $locale; } if (!empty($m[4])) { return strtolower($m[1]).'_'.ucfirst(strtolower($m[2].$m[3])).'_'.strtoupper($m[4]); } if (!empty($m[3])) { return strtolower($m[1]).'_'.ucfirst(strtolower($m[2].$m[3])); } return strtolower($m[1]).'_'.strtoupper($m[2]); }
[ "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
train
Canonicalizes the locale
[ 30522, 2270, 10763, 3853, 18562, 4697, 1006, 1002, 2334, 2063, 1007, 1063, 1002, 2334, 2063, 1027, 1006, 5164, 1007, 1002, 2334, 2063, 1025, 2065, 1006, 1005, 1005, 1027, 1027, 1027, 1002, 2334, 2063, 1064, 1064, 1005, 1012, 1005, 1027, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/Messenger/Command/DebugCommand.php
DebugCommand.configure
protected function configure() { $this ->addArgument('bus', InputArgument::OPTIONAL, sprintf('The bus id (one of %s)', implode(', ', array_keys($this->mapping)))) ->setDescription('Lists messages you can dispatch using the message buses') ->setHelp(<<<'EOF' The <info>%command.name%</info> command displays all messages that can be dispatched using the message buses: <info>php %command.full_name%</info> Or for a specific bus only: <info>php %command.full_name% command_bus</info> EOF ) ; }
php
protected function configure() { $this ->addArgument('bus', InputArgument::OPTIONAL, sprintf('The bus id (one of %s)', implode(', ', array_keys($this->mapping)))) ->setDescription('Lists messages you can dispatch using the message buses') ->setHelp(<<<'EOF' The <info>%command.name%</info> command displays all messages that can be dispatched using the message buses: <info>php %command.full_name%</info> Or for a specific bus only: <info>php %command.full_name% command_bus</info> EOF ) ; }
[ "protected", "function", "configure", "(", ")", "{", "$", "this", "->", "addArgument", "(", "'bus'", ",", "InputArgument", "::", "OPTIONAL", ",", "sprintf", "(", "'The bus id (one of %s)'", ",", "implode", "(", "', '", ",", "array_keys", "(", "$", "this", "-...
{@inheritdoc}
[ "{" ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Messenger/Command/DebugCommand.php#L44-L62
train
Configure the verbosity and help
[ 30522, 5123, 3853, 9530, 8873, 27390, 2063, 1006, 1007, 1063, 1002, 2023, 1011, 1028, 5587, 2906, 22850, 4765, 1006, 1005, 3902, 1005, 1010, 7953, 2906, 22850, 4765, 1024, 1024, 11887, 1010, 9043, 2546, 1006, 1005, 1996, 3902, 8909, 1006, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/DependencyInjection/ContainerBuilder.php
ContainerBuilder.removeAlias
public function removeAlias($alias) { if (isset($this->aliasDefinitions[$alias = (string) $alias])) { unset($this->aliasDefinitions[$alias]); $this->removedIds[$alias] = true; } }
php
public function removeAlias($alias) { if (isset($this->aliasDefinitions[$alias = (string) $alias])) { unset($this->aliasDefinitions[$alias]); $this->removedIds[$alias] = true; } }
[ "public", "function", "removeAlias", "(", "$", "alias", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "aliasDefinitions", "[", "$", "alias", "=", "(", "string", ")", "$", "alias", "]", ")", ")", "{", "unset", "(", "$", "this", "->", "aliasD...
Removes an alias. @param string $alias The alias to remove
[ "Removes", "an", "alias", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DependencyInjection/ContainerBuilder.php#L861-L867
train
Removes an alias from the alias list
[ 30522, 2270, 3853, 6366, 22786, 2015, 1006, 1002, 14593, 1007, 1063, 2065, 1006, 26354, 3388, 1006, 1002, 2023, 1011, 1028, 14593, 3207, 16294, 22753, 2015, 1031, 1002, 14593, 1027, 1006, 5164, 1007, 1002, 14593, 1033, 1007, 1007, 1063, 489...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
getgrav/grav
system/src/Grav/Common/Uri.php
Uri.addNonce
public static function addNonce($url, $action, $nonceParamName = 'nonce') { $fake = $url && strpos($url, '/') === 0; if ($fake) { $url = 'http://domain.com' . $url; } $uri = new static($url); $parts = $uri->toArray(); $nonce = Utils::getNonce($action); $parts['params'] = ($parts['params'] ?? []) + [$nonceParamName => $nonce]; if ($fake) { unset($parts['scheme'], $parts['host']); } return static::buildUrl($parts); }
php
public static function addNonce($url, $action, $nonceParamName = 'nonce') { $fake = $url && strpos($url, '/') === 0; if ($fake) { $url = 'http://domain.com' . $url; } $uri = new static($url); $parts = $uri->toArray(); $nonce = Utils::getNonce($action); $parts['params'] = ($parts['params'] ?? []) + [$nonceParamName => $nonce]; if ($fake) { unset($parts['scheme'], $parts['host']); } return static::buildUrl($parts); }
[ "public", "static", "function", "addNonce", "(", "$", "url", ",", "$", "action", ",", "$", "nonceParamName", "=", "'nonce'", ")", "{", "$", "fake", "=", "$", "url", "&&", "strpos", "(", "$", "url", ",", "'/'", ")", "===", "0", ";", "if", "(", "$"...
Adds the nonce to a URL for a specific action @param string $url the url @param string $action the action @param string $nonceParamName the param name to use @return string the url with the nonce
[ "Adds", "the", "nonce", "to", "a", "URL", "for", "a", "specific", "action" ]
1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72
https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Uri.php#L1056-L1073
train
Add a nonce to the url
[ 30522, 2270, 10763, 3853, 5587, 8540, 30524, 14536, 2891, 1006, 1002, 24471, 2140, 1010, 1005, 1013, 1005, 1007, 1027, 1027, 1027, 1014, 1025, 2065, 1006, 1002, 8275, 1007, 1063, 1002, 24471, 2140, 1027, 1005, 8299, 1024, 1013, 1013, 5884, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
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->getAttributes() as $key => $value) { if (\is_array($value)) { foreach ($value as $v) { $attributesParts[] = sprintf('%s="%s"', $key, $v); } continue; } if (!\is_bool($value)) { $attributesParts[] = sprintf('%s="%s"', $key, $value); continue; } if (true === $value) { $attributesParts[] = $key; } } $elements[] = sprintf('<%s>%s', $link->getHref(), implode('; ', $attributesParts)); } return $elements ? implode(',', $elements) : null; }
php
public function serialize(iterable $links) { $elements = []; foreach ($links as $link) { if ($link->isTemplated()) { continue; } $attributesParts = ['', sprintf('rel="%s"', implode(' ', $link->getRels()))]; foreach ($link->getAttributes() as $key => $value) { if (\is_array($value)) { foreach ($value as $v) { $attributesParts[] = sprintf('%s="%s"', $key, $v); } continue; } if (!\is_bool($value)) { $attributesParts[] = sprintf('%s="%s"', $key, $value); continue; } if (true === $value) { $attributesParts[] = $key; } } $elements[] = sprintf('<%s>%s', $link->getHref(), implode('; ', $attributesParts)); } return $elements ? implode(',', $elements) : null; }
[ "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
train
Serializes links into a string
[ 30522, 2270, 3853, 7642, 4697, 1006, 2009, 6906, 3468, 1002, 6971, 1007, 1063, 1002, 3787, 1027, 1031, 1033, 1025, 18921, 6776, 1006, 1002, 6971, 2004, 1002, 4957, 1007, 1063, 2065, 1006, 1002, 4957, 1011, 1028, 21541, 6633, 15725, 2094, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/Form/Extension/Validator/Type/FormTypeValidatorExtension.php
FormTypeValidatorExtension.buildForm
public function buildForm(FormBuilderInterface $builder, array $options) { $builder->addEventSubscriber(new ValidationListener($this->validator, $this->violationMapper)); }
php
public function buildForm(FormBuilderInterface $builder, array $options) { $builder->addEventSubscriber(new ValidationListener($this->validator, $this->violationMapper)); }
[ "public", "function", "buildForm", "(", "FormBuilderInterface", "$", "builder", ",", "array", "$", "options", ")", "{", "$", "builder", "->", "addEventSubscriber", "(", "new", "ValidationListener", "(", "$", "this", "->", "validator", ",", "$", "this", "->", ...
{@inheritdoc}
[ "{" ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Extension/Validator/Type/FormTypeValidatorExtension.php#L39-L42
train
Adds the validation listener to the form builder
[ 30522, 2270, 3853, 3857, 14192, 1006, 2433, 8569, 23891, 6657, 3334, 12172, 1002, 12508, 1010, 9140, 1002, 7047, 1007, 1063, 1002, 12508, 1011, 1028, 5587, 18697, 7666, 12083, 29234, 2099, 1006, 2047, 27354, 9863, 24454, 1006, 1002, 2023, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/Config/Definition/PrototypedArrayNode.php
PrototypedArrayNode.getDefaultValue
public function getDefaultValue() { if (null !== $this->defaultChildren) { $default = $this->prototype->hasDefaultValue() ? $this->prototype->getDefaultValue() : []; $defaults = []; foreach (array_values($this->defaultChildren) as $i => $name) { $defaults[null === $this->keyAttribute ? $i : $name] = $default; } return $defaults; } return $this->defaultValue; }
php
public function getDefaultValue() { if (null !== $this->defaultChildren) { $default = $this->prototype->hasDefaultValue() ? $this->prototype->getDefaultValue() : []; $defaults = []; foreach (array_values($this->defaultChildren) as $i => $name) { $defaults[null === $this->keyAttribute ? $i : $name] = $default; } return $defaults; } return $this->defaultValue; }
[ "public", "function", "getDefaultValue", "(", ")", "{", "if", "(", "null", "!==", "$", "this", "->", "defaultChildren", ")", "{", "$", "default", "=", "$", "this", "->", "prototype", "->", "hasDefaultValue", "(", ")", "?", "$", "this", "->", "prototype",...
{@inheritdoc} The default value could be either explicited or derived from the prototype default value.
[ "{", "@inheritdoc", "}" ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Config/Definition/PrototypedArrayNode.php#L132-L145
train
Get Default Value
[ 30522, 2270, 3853, 2131, 3207, 7011, 11314, 10175, 5657, 1006, 1007, 1063, 2065, 1006, 19701, 999, 1027, 1027, 1002, 2023, 1011, 1028, 12398, 19339, 7389, 1007, 1063, 1002, 12398, 1027, 1002, 2023, 1011, 1028, 8773, 1011, 1028, 2038, 3207, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
core/Access.php
Access.getSqlAccessSite
public static function getSqlAccessSite($select) { $access = Common::prefixTable('access'); $siteTable = Common::prefixTable('site'); return "SELECT " . $select . " FROM " . $access . " as t1 JOIN " . $siteTable . " as t2 USING (idsite) WHERE login = ?"; }
php
public static function getSqlAccessSite($select) { $access = Common::prefixTable('access'); $siteTable = Common::prefixTable('site'); return "SELECT " . $select . " FROM " . $access . " as t1 JOIN " . $siteTable . " as t2 USING (idsite) WHERE login = ?"; }
[ "public", "static", "function", "getSqlAccessSite", "(", "$", "select", ")", "{", "$", "access", "=", "Common", "::", "prefixTable", "(", "'access'", ")", ";", "$", "siteTable", "=", "Common", "::", "prefixTable", "(", "'site'", ")", ";", "return", "\"SELE...
Returns the SQL query joining sites and access table for a given login @param string $select Columns or expression to SELECT FROM table, eg. "MIN(ts_created)" @return string SQL query
[ "Returns", "the", "SQL", "query", "joining", "sites", "and", "access", "table", "for", "a", "given", "login" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Access.php#L187-L194
train
Returns the SQL query for a specific site in the access section
[ 30522, 2270, 10763, 3853, 4152, 4160, 2721, 9468, 7971, 28032, 2063, 1006, 1002, 7276, 1007, 1063, 1002, 3229, 1027, 2691, 1024, 1024, 17576, 10880, 1006, 1005, 3229, 1005, 1007, 1025, 1002, 2609, 10880, 1027, 2691, 1024, 1024, 17576, 10880...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
libs/HTML/QuickForm2/Node.php
HTML_QuickForm2_Node.createRule
public function createRule($type, $message = '', $options = null) { return HTML_QuickForm2_Factory::createRule($type, $this, $message, $options); }
php
public function createRule($type, $message = '', $options = null) { return HTML_QuickForm2_Factory::createRule($type, $this, $message, $options); }
[ "public", "function", "createRule", "(", "$", "type", ",", "$", "message", "=", "''", ",", "$", "options", "=", "null", ")", "{", "return", "HTML_QuickForm2_Factory", "::", "createRule", "(", "$", "type", ",", "$", "this", ",", "$", "message", ",", "$"...
Creates a validation rule This method is mostly useful when when chaining several rules together via {@link HTML_QuickForm2_Rule::and_()} and {@link HTML_QuickForm2_Rule::or_()} methods: <code> $first->addRule('nonempty', 'Fill in either first or second field') ->or_($second->createRule('nonempty')); </code> @param string Rule type @param string Message to display if validation fails @param mixed Additional data for the rule @return HTML_QuickForm2_Rule The created rule @throws HTML_QuickForm2_InvalidArgumentException If rule type is unknown @throws HTML_QuickForm2_NotFoundException If class for the rule can't be found and/or loaded from file
[ "Creates", "a", "validation", "rule" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Node.php#L558-L561
train
Creates a validation rule for the given type
[ 30522, 2270, 3853, 3443, 6820, 2571, 1006, 1002, 2828, 1010, 1002, 4471, 1027, 1005, 1005, 1010, 1002, 7047, 1027, 19701, 1007, 1063, 2709, 16129, 1035, 4248, 14192, 2475, 1035, 4713, 1024, 1024, 3443, 6820, 2571, 1006, 1002, 2828, 1010, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Bridge/Twig/AppVariable.php
AppVariable.getFlashes
public function getFlashes($types = null) { try { $session = $this->getSession(); if (null === $session) { return []; } } catch (\RuntimeException $e) { return []; } if (null === $types || '' === $types || [] === $types) { return $session->getFlashBag()->all(); } if (\is_string($types)) { return $session->getFlashBag()->get($types); } $result = []; foreach ($types as $type) { $result[$type] = $session->getFlashBag()->get($type); } return $result; }
php
public function getFlashes($types = null) { try { $session = $this->getSession(); if (null === $session) { return []; } } catch (\RuntimeException $e) { return []; } if (null === $types || '' === $types || [] === $types) { return $session->getFlashBag()->all(); } if (\is_string($types)) { return $session->getFlashBag()->get($types); } $result = []; foreach ($types as $type) { $result[$type] = $session->getFlashBag()->get($type); } return $result; }
[ "public", "function", "getFlashes", "(", "$", "types", "=", "null", ")", "{", "try", "{", "$", "session", "=", "$", "this", "->", "getSession", "(", ")", ";", "if", "(", "null", "===", "$", "session", ")", "{", "return", "[", "]", ";", "}", "}", ...
Returns some or all the existing flash messages: * getFlashes() returns all the flash messages * getFlashes('notice') returns a simple array with flash messages of that type * getFlashes(['notice', 'error']) returns a nested array of type => messages. @return array
[ "Returns", "some", "or", "all", "the", "existing", "flash", "messages", ":", "*", "getFlashes", "()", "returns", "all", "the", "flash", "messages", "*", "getFlashes", "(", "notice", ")", "returns", "a", "simple", "array", "with", "flash", "messages", "of", ...
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bridge/Twig/AppVariable.php#L157-L182
train
Get Flashes.
[ 30522, 2270, 3853, 2131, 10258, 11823, 2229, 1006, 1002, 4127, 1027, 19701, 1007, 1063, 3046, 1063, 1002, 5219, 1027, 1002, 2023, 1011, 1028, 4152, 7971, 3258, 1006, 1007, 1025, 2065, 1006, 19701, 1027, 1027, 1027, 1002, 5219, 1007, 1063, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
getgrav/grav
system/src/Grav/Common/Page/Pages.php
Pages.pageTypes
public static function pageTypes() { if (isset(Grav::instance()['admin'])) { /** @var Admin $admin */ $admin = Grav::instance()['admin']; /** @var PageInterface $page */ $page = $admin->getPage($admin->route); if ($page && $page->modular()) { return static::modularTypes(); } return static::types(); } return []; }
php
public static function pageTypes() { if (isset(Grav::instance()['admin'])) { /** @var Admin $admin */ $admin = Grav::instance()['admin']; /** @var PageInterface $page */ $page = $admin->getPage($admin->route); if ($page && $page->modular()) { return static::modularTypes(); } return static::types(); } return []; }
[ "public", "static", "function", "pageTypes", "(", ")", "{", "if", "(", "isset", "(", "Grav", "::", "instance", "(", ")", "[", "'admin'", "]", ")", ")", "{", "/** @var Admin $admin */", "$", "admin", "=", "Grav", "::", "instance", "(", ")", "[", "'admin...
Get template types based on page type (standard or modular) @return array
[ "Get", "template", "types", "based", "on", "page", "type", "(", "standard", "or", "modular", ")" ]
1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72
https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Pages.php#L821-L838
train
Return an array of page types
[ 30522, 2270, 10763, 3853, 3931, 13874, 2015, 1006, 1007, 1063, 2065, 1006, 26354, 3388, 1006, 24665, 11431, 1024, 1024, 6013, 1006, 1007, 1031, 1005, 4748, 10020, 1005, 1033, 1007, 1007, 1063, 1013, 1008, 1008, 1030, 13075, 4748, 10020, 100...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
libs/HTML/QuickForm2/Controller.php
HTML_QuickForm2_Controller.getActionName
public function getActionName() { if (is_array($this->actionName)) { return $this->actionName; } if (empty($this->pages)) { throw new HTML_QuickForm2_NotFoundException('No pages added to the form'); } $names = array_map('preg_quote', array_keys($this->pages)); $regex = '/^_qf_(' . implode('|', $names) . ')_(.+?)(_x)?$/'; foreach (array_keys($_REQUEST) as $key) { if (preg_match($regex, $key, $matches)) { $this->actionName = array($matches[1], $matches[2]); break; } } if (!is_array($this->actionName)) { reset($this->pages); $this->actionName = array(key($this->pages), 'display'); } return $this->actionName; }
php
public function getActionName() { if (is_array($this->actionName)) { return $this->actionName; } if (empty($this->pages)) { throw new HTML_QuickForm2_NotFoundException('No pages added to the form'); } $names = array_map('preg_quote', array_keys($this->pages)); $regex = '/^_qf_(' . implode('|', $names) . ')_(.+?)(_x)?$/'; foreach (array_keys($_REQUEST) as $key) { if (preg_match($regex, $key, $matches)) { $this->actionName = array($matches[1], $matches[2]); break; } } if (!is_array($this->actionName)) { reset($this->pages); $this->actionName = array(key($this->pages), 'display'); } return $this->actionName; }
[ "public", "function", "getActionName", "(", ")", "{", "if", "(", "is_array", "(", "$", "this", "->", "actionName", ")", ")", "{", "return", "$", "this", "->", "actionName", ";", "}", "if", "(", "empty", "(", "$", "this", "->", "pages", ")", ")", "{...
Extracts the name of the page and the action to perform with it from HTTP request data @return array first element is page name, second is action name
[ "Extracts", "the", "name", "of", "the", "page", "and", "the", "action", "to", "perform", "with", "it", "from", "HTTP", "request", "data" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Controller.php#L233-L254
train
Get the name of the action
[ 30522, 2270, 3853, 2131, 18908, 3258, 18442, 1006, 1007, 1063, 2065, 1006, 2003, 1035, 9140, 1006, 1002, 2023, 1011, 1028, 2895, 18442, 1007, 1007, 1063, 2709, 1002, 2023, 1011, 1028, 2895, 18442, 1025, 1065, 2065, 1006, 4064, 1006, 1002, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
laravel/framework
src/Illuminate/Routing/Router.php
Router.gatherRouteMiddleware
public function gatherRouteMiddleware(Route $route) { $middleware = collect($route->gatherMiddleware())->map(function ($name) { return (array) MiddlewareNameResolver::resolve($name, $this->middleware, $this->middlewareGroups); })->flatten(); return $this->sortMiddleware($middleware); }
php
public function gatherRouteMiddleware(Route $route) { $middleware = collect($route->gatherMiddleware())->map(function ($name) { return (array) MiddlewareNameResolver::resolve($name, $this->middleware, $this->middlewareGroups); })->flatten(); return $this->sortMiddleware($middleware); }
[ "public", "function", "gatherRouteMiddleware", "(", "Route", "$", "route", ")", "{", "$", "middleware", "=", "collect", "(", "$", "route", "->", "gatherMiddleware", "(", ")", ")", "->", "map", "(", "function", "(", "$", "name", ")", "{", "return", "(", ...
Gather the middleware for the given route with resolved class names. @param \Illuminate\Routing\Route $route @return array
[ "Gather", "the", "middleware", "for", "the", "given", "route", "with", "resolved", "class", "names", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/Router.php#L691-L698
train
Gather all the middleware for the route and return them sorted by priority
[ 30522, 2270, 3853, 8587, 22494, 18532, 3593, 10362, 8059, 1006, 2799, 1002, 2799, 1007, 1063, 1002, 2690, 8059, 1027, 8145, 1006, 1002, 2799, 1011, 1028, 8587, 4328, 20338, 8059, 1006, 1007, 1007, 1011, 1028, 4949, 1006, 3853, 1006, 1002, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
walkor/Workerman
Worker.php
Worker.unlisten
public function unlisten() { $this->pauseAccept(); if ($this->_mainSocket) { set_error_handler(function(){}); fclose($this->_mainSocket); restore_error_handler(); $this->_mainSocket = null; } }
php
public function unlisten() { $this->pauseAccept(); if ($this->_mainSocket) { set_error_handler(function(){}); fclose($this->_mainSocket); restore_error_handler(); $this->_mainSocket = null; } }
[ "public", "function", "unlisten", "(", ")", "{", "$", "this", "->", "pauseAccept", "(", ")", ";", "if", "(", "$", "this", "->", "_mainSocket", ")", "{", "set_error_handler", "(", "function", "(", ")", "{", "}", ")", ";", "fclose", "(", "$", "this", ...
Unlisten. @return void
[ "Unlisten", "." ]
13649907f05014fcfffcfccaef01e63ad3339351
https://github.com/walkor/Workerman/blob/13649907f05014fcfffcfccaef01e63ad3339351/Worker.php#L2252-L2260
train
Unlisten from the main socket
[ 30522, 2270, 3853, 4895, 9863, 2368, 1006, 1007, 1063, 1002, 2023, 1011, 1028, 8724, 6305, 3401, 13876, 1006, 1007, 1025, 2065, 1006, 1002, 2023, 1011, 1028, 1035, 2364, 6499, 19869, 2102, 1007, 1063, 2275, 1035, 7561, 1035, 28213, 1006, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
getgrav/grav
system/src/Grav/Common/Scheduler/Job.php
Job.exec
private function exec() { $return_data = ''; ob_start(); try { $return_data = call_user_func_array($this->command, $this->args); $this->successful = true; } catch (\RuntimeException $e) { $this->successful = false; } $this->output = ob_get_clean() . (is_string($return_data) ? $return_data : ''); $this->postRun(); }
php
private function exec() { $return_data = ''; ob_start(); try { $return_data = call_user_func_array($this->command, $this->args); $this->successful = true; } catch (\RuntimeException $e) { $this->successful = false; } $this->output = ob_get_clean() . (is_string($return_data) ? $return_data : ''); $this->postRun(); }
[ "private", "function", "exec", "(", ")", "{", "$", "return_data", "=", "''", ";", "ob_start", "(", ")", ";", "try", "{", "$", "return_data", "=", "call_user_func_array", "(", "$", "this", "->", "command", ",", "$", "this", "->", "args", ")", ";", "$"...
Execute a callable job. @throws \RuntimeException @return string
[ "Execute", "a", "callable", "job", "." ]
1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72
https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Scheduler/Job.php#L402-L415
train
Execute the command and store the output
[ 30522, 2797, 3853, 4654, 8586, 1006, 1007, 1063, 1002, 2709, 1035, 2951, 1027, 1005, 1005, 1025, 27885, 1035, 2707, 1006, 1007, 1025, 3046, 1063, 1002, 2709, 1035, 2951, 1027, 2655, 1035, 5310, 1035, 4569, 2278, 1035, 9140, 1006, 1002, 20...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
laravel/framework
src/Illuminate/Database/Eloquent/Builder.php
Builder.enforceOrderBy
protected function enforceOrderBy() { if (empty($this->query->orders) && empty($this->query->unionOrders)) { $this->orderBy($this->model->getQualifiedKeyName(), 'asc'); } }
php
protected function enforceOrderBy() { if (empty($this->query->orders) && empty($this->query->unionOrders)) { $this->orderBy($this->model->getQualifiedKeyName(), 'asc'); } }
[ "protected", "function", "enforceOrderBy", "(", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "query", "->", "orders", ")", "&&", "empty", "(", "$", "this", "->", "query", "->", "unionOrders", ")", ")", "{", "$", "this", "->", "orderBy", "(",...
Add a generic "order by" clause if the query doesn't already have one. @return void
[ "Add", "a", "generic", "order", "by", "clause", "if", "the", "query", "doesn", "t", "already", "have", "one", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Builder.php#L699-L704
train
Enforce the order by clause if there is no order by clause.
[ 30522, 5123, 3853, 16306, 8551, 2121, 3762, 1006, 1007, 1063, 2065, 1006, 4064, 1006, 1002, 2023, 1011, 1028, 23032, 1011, 1028, 4449, 1007, 1004, 1004, 4064, 1006, 1002, 2023, 1011, 1028, 23032, 1011, 1028, 2586, 8551, 2545, 1007, 1007, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
octobercms/october
modules/system/classes/CombineAssets.php
CombineAssets.getAliases
public function getAliases($extension = null) { if ($extension === null) { return $this->aliases; } elseif (isset($this->aliases[$extension])) { return $this->aliases[$extension]; } else { return null; } }
php
public function getAliases($extension = null) { if ($extension === null) { return $this->aliases; } elseif (isset($this->aliases[$extension])) { return $this->aliases[$extension]; } else { return null; } }
[ "public", "function", "getAliases", "(", "$", "extension", "=", "null", ")", "{", "if", "(", "$", "extension", "===", "null", ")", "{", "return", "$", "this", "->", "aliases", ";", "}", "elseif", "(", "isset", "(", "$", "this", "->", "aliases", "[", ...
Returns aliases. @param string $extension Extension name. Eg: css @return self
[ "Returns", "aliases", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/CombineAssets.php#L738-L749
train
Get aliases.
[ 30522, 2270, 3853, 2131, 22786, 8583, 1006, 1002, 5331, 1027, 19701, 1007, 1063, 2065, 1006, 1002, 5331, 1027, 1027, 1027, 19701, 1007, 1063, 2709, 1002, 2023, 1011, 1028, 14593, 2229, 1025, 1065, 2842, 10128, 1006, 26354, 3388, 1006, 1002,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/Security/Core/Encoder/BasePasswordEncoder.php
BasePasswordEncoder.mergePasswordAndSalt
protected function mergePasswordAndSalt($password, $salt) { if (empty($salt)) { return $password; } if (false !== strrpos($salt, '{') || false !== strrpos($salt, '}')) { throw new \InvalidArgumentException('Cannot use { or } in salt.'); } return $password.'{'.$salt.'}'; }
php
protected function mergePasswordAndSalt($password, $salt) { if (empty($salt)) { return $password; } if (false !== strrpos($salt, '{') || false !== strrpos($salt, '}')) { throw new \InvalidArgumentException('Cannot use { or } in salt.'); } return $password.'{'.$salt.'}'; }
[ "protected", "function", "mergePasswordAndSalt", "(", "$", "password", ",", "$", "salt", ")", "{", "if", "(", "empty", "(", "$", "salt", ")", ")", "{", "return", "$", "password", ";", "}", "if", "(", "false", "!==", "strrpos", "(", "$", "salt", ",", ...
Merges a password and a salt. @param string $password The password to be used @param string $salt The salt to be used @return string a merged password and salt @throws \InvalidArgumentException
[ "Merges", "a", "password", "and", "a", "salt", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Security/Core/Encoder/BasePasswordEncoder.php#L58-L69
train
Merge password and salt
[ 30522, 5123, 3853, 13590, 15194, 18351, 29560, 2389, 2102, 1006, 1002, 20786, 1010, 1002, 5474, 1007, 1063, 2065, 1006, 4064, 1006, 1002, 5474, 1007, 1007, 1063, 2709, 1002, 20786, 1025, 1065, 2065, 1006, 6270, 999, 1027, 1027, 2358, 12171,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
getgrav/grav
system/src/Grav/Common/Page/Page.php
Page.expires
public function expires($var = null) { if ($var !== null) { $this->expires = $var; } return $this->expires ?? Grav::instance()['config']->get('system.pages.expires'); }
php
public function expires($var = null) { if ($var !== null) { $this->expires = $var; } return $this->expires ?? Grav::instance()['config']->get('system.pages.expires'); }
[ "public", "function", "expires", "(", "$", "var", "=", "null", ")", "{", "if", "(", "$", "var", "!==", "null", ")", "{", "$", "this", "->", "expires", "=", "$", "var", ";", "}", "return", "$", "this", "->", "expires", "??", "Grav", "::", "instanc...
Gets and sets the expires field. If not set will return the default @param int $var The new expires value. @return int The expires value
[ "Gets", "and", "sets", "the", "expires", "field", ".", "If", "not", "set", "will", "return", "the", "default" ]
1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72
https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Page.php#L1467-L1474
train
Get expires - page
[ 30522, 2270, 3853, 4654, 20781, 2015, 1006, 1002, 13075, 1027, 19701, 1007, 1063, 2065, 1006, 1002, 13075, 999, 1027, 1027, 19701, 1007, 1063, 1002, 2023, 1011, 1028, 4654, 20781, 2015, 1027, 1002, 13075, 1025, 1065, 2709, 1002, 2023, 1011,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
core/CronArchive.php
CronArchive.hadWebsiteTrafficSinceMidnightInTimezone
private function hadWebsiteTrafficSinceMidnightInTimezone($idSite) { $timezone = Site::getTimezoneFor($idSite); $nowInTimezone = Date::factory('now', $timezone); $midnightInTimezone = $nowInTimezone->setTime('00:00:00'); $secondsSinceMidnight = $nowInTimezone->getTimestamp() - $midnightInTimezone->getTimestamp(); $secondsSinceLastArchive = $this->getSecondsSinceLastArchive(); if ($secondsSinceLastArchive < $secondsSinceMidnight) { $secondsBackToLookForVisits = $secondsSinceLastArchive; $sinceInfo = "(since the last successful archiving)"; } else { $secondsBackToLookForVisits = $secondsSinceMidnight; $sinceInfo = "(since midnight)"; } $from = Date::now()->subSeconds($secondsBackToLookForVisits)->getDatetime(); $to = Date::now()->addHour(1)->getDatetime(); $dao = new RawLogDao(); $hasVisits = $dao->hasSiteVisitsBetweenTimeframe($from, $to, $idSite); if ($hasVisits) { $this->logger->info("- tracking data found for website id $idSite since $from UTC $sinceInfo"); } else { $this->logger->info("- no new tracking data for website id $idSite since $from UTC $sinceInfo"); } return $hasVisits; }
php
private function hadWebsiteTrafficSinceMidnightInTimezone($idSite) { $timezone = Site::getTimezoneFor($idSite); $nowInTimezone = Date::factory('now', $timezone); $midnightInTimezone = $nowInTimezone->setTime('00:00:00'); $secondsSinceMidnight = $nowInTimezone->getTimestamp() - $midnightInTimezone->getTimestamp(); $secondsSinceLastArchive = $this->getSecondsSinceLastArchive(); if ($secondsSinceLastArchive < $secondsSinceMidnight) { $secondsBackToLookForVisits = $secondsSinceLastArchive; $sinceInfo = "(since the last successful archiving)"; } else { $secondsBackToLookForVisits = $secondsSinceMidnight; $sinceInfo = "(since midnight)"; } $from = Date::now()->subSeconds($secondsBackToLookForVisits)->getDatetime(); $to = Date::now()->addHour(1)->getDatetime(); $dao = new RawLogDao(); $hasVisits = $dao->hasSiteVisitsBetweenTimeframe($from, $to, $idSite); if ($hasVisits) { $this->logger->info("- tracking data found for website id $idSite since $from UTC $sinceInfo"); } else { $this->logger->info("- no new tracking data for website id $idSite since $from UTC $sinceInfo"); } return $hasVisits; }
[ "private", "function", "hadWebsiteTrafficSinceMidnightInTimezone", "(", "$", "idSite", ")", "{", "$", "timezone", "=", "Site", "::", "getTimezoneFor", "(", "$", "idSite", ")", ";", "$", "nowInTimezone", "=", "Date", "::", "factory", "(", "'now'", ",", "$", "...
Detects whether a site had visits since midnight in the websites timezone @param $idSite @return bool
[ "Detects", "whether", "a", "site", "had", "visits", "since", "midnight", "in", "the", "websites", "timezone" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/CronArchive.php#L1272-L1303
train
Checks if website had visits since midnight in timezone
[ 30522, 2797, 3853, 2018, 8545, 5910, 4221, 6494, 26989, 6169, 2378, 3401, 4328, 2094, 15864, 18447, 14428, 15975, 1006, 1002, 8909, 28032, 2063, 1007, 1063, 1002, 2051, 15975, 1027, 2609, 1024, 1024, 2131, 7292, 15975, 29278, 1006, 1002, 89...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
getgrav/grav
system/src/Grav/Common/Iterator.php
Iterator.indexOf
public function indexOf($needle) { foreach (array_values($this->items) as $key => $value) { if ($value === $needle) { return $key; } } return false; }
php
public function indexOf($needle) { foreach (array_values($this->items) as $key => $value) { if ($value === $needle) { return $key; } } return false; }
[ "public", "function", "indexOf", "(", "$", "needle", ")", "{", "foreach", "(", "array_values", "(", "$", "this", "->", "items", ")", "as", "$", "key", "=>", "$", "value", ")", "{", "if", "(", "$", "value", "===", "$", "needle", ")", "{", "return", ...
@param mixed $needle Searched value. @return string|bool Key if found, otherwise false.
[ "@param", "mixed", "$needle", "Searched", "value", "." ]
1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72
https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Iterator.php#L138-L147
train
Return the index of the item in the list
[ 30522, 2270, 3853, 5950, 11253, 1006, 1002, 12201, 1007, 1063, 18921, 6776, 1006, 9140, 1035, 5300, 1006, 1002, 2023, 1011, 1028, 5167, 1007, 2004, 1002, 3145, 1027, 1028, 1002, 3643, 1007, 1063, 2065, 1006, 1002, 3643, 1027, 1027, 1027, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
dompdf/dompdf
src/Frame.php
Frame.dispose
public function dispose($recursive = false) { if ($recursive) { while ($child = $this->_first_child) { $child->dispose(true); } } // Remove this frame from the tree if ($this->_prev_sibling) { $this->_prev_sibling->_next_sibling = $this->_next_sibling; } if ($this->_next_sibling) { $this->_next_sibling->_prev_sibling = $this->_prev_sibling; } if ($this->_parent && $this->_parent->_first_child === $this) { $this->_parent->_first_child = $this->_next_sibling; } if ($this->_parent && $this->_parent->_last_child === $this) { $this->_parent->_last_child = $this->_prev_sibling; } if ($this->_parent) { $this->_parent->get_node()->removeChild($this->_node); } $this->_style->dispose(); $this->_style = null; unset($this->_style); $this->_original_style->dispose(); $this->_original_style = null; unset($this->_original_style); }
php
public function dispose($recursive = false) { if ($recursive) { while ($child = $this->_first_child) { $child->dispose(true); } } // Remove this frame from the tree if ($this->_prev_sibling) { $this->_prev_sibling->_next_sibling = $this->_next_sibling; } if ($this->_next_sibling) { $this->_next_sibling->_prev_sibling = $this->_prev_sibling; } if ($this->_parent && $this->_parent->_first_child === $this) { $this->_parent->_first_child = $this->_next_sibling; } if ($this->_parent && $this->_parent->_last_child === $this) { $this->_parent->_last_child = $this->_prev_sibling; } if ($this->_parent) { $this->_parent->get_node()->removeChild($this->_node); } $this->_style->dispose(); $this->_style = null; unset($this->_style); $this->_original_style->dispose(); $this->_original_style = null; unset($this->_original_style); }
[ "public", "function", "dispose", "(", "$", "recursive", "=", "false", ")", "{", "if", "(", "$", "recursive", ")", "{", "while", "(", "$", "child", "=", "$", "this", "->", "_first_child", ")", "{", "$", "child", "->", "dispose", "(", "true", ")", ";...
"Destructor": forcibly free all references held by this frame @param bool $recursive if true, call dispose on all children
[ "Destructor", ":", "forcibly", "free", "all", "references", "held", "by", "this", "frame" ]
75f13c700009be21a1965dc2c5b68a8708c22ba2
https://github.com/dompdf/dompdf/blob/75f13c700009be21a1965dc2c5b68a8708c22ba2/src/Frame.php#L273-L310
train
Dispose this frame
[ 30522, 2270, 3853, 27764, 1006, 1002, 28667, 9236, 3512, 1027, 6270, 1007, 1063, 2065, 1006, 1002, 28667, 9236, 3512, 1007, 1063, 2096, 1006, 1002, 2775, 1027, 1002, 2023, 1011, 1028, 1035, 2034, 1035, 2775, 1007, 1063, 1002, 2775, 1011, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
plugins/CoreConsole/Commands/GeneratePluginBase.php
GeneratePluginBase.copyTemplateMethodToExisitingClass
protected function copyTemplateMethodToExisitingClass($sourceClassName, $methodName, $replace) { $targetClassName = $this->replaceContent($replace, $sourceClassName); if (Development::methodExists($targetClassName, $methodName)) { // we do not want to add the same method twice return; } Development::checkMethodExists($sourceClassName, $methodName, 'Cannot copy template method: '); $targetClass = new \ReflectionClass($targetClassName); $file = new \SplFileObject($targetClass->getFileName()); $methodCode = Development::getMethodSourceCode($sourceClassName, $methodName); $methodCode = $this->replaceContent($replace, $methodCode); $methodLine = $targetClass->getEndLine() - 1; $sourceUses = Development::getUseStatements($sourceClassName); $targetUses = Development::getUseStatements($targetClassName); $usesToAdd = array_diff($sourceUses, $targetUses); if (empty($usesToAdd)) { $useCode = ''; } else { $useCode = "\nuse " . implode("\nuse ", $usesToAdd) . "\n"; } // search for namespace line before the class starts $useLine = 0; foreach (new \LimitIterator($file, 0, $targetClass->getStartLine()) as $index => $line) { if (0 === strpos(trim($line), 'namespace ')) { $useLine = $index + 1; break; } } $newClassCode = ''; foreach(new \LimitIterator($file) as $index => $line) { if ($index == $methodLine) { $newClassCode .= $methodCode; } if (0 !== $useLine && $index == $useLine) { $newClassCode .= $useCode; } $newClassCode .= $line; } file_put_contents($targetClass->getFileName(), $newClassCode); }
php
protected function copyTemplateMethodToExisitingClass($sourceClassName, $methodName, $replace) { $targetClassName = $this->replaceContent($replace, $sourceClassName); if (Development::methodExists($targetClassName, $methodName)) { // we do not want to add the same method twice return; } Development::checkMethodExists($sourceClassName, $methodName, 'Cannot copy template method: '); $targetClass = new \ReflectionClass($targetClassName); $file = new \SplFileObject($targetClass->getFileName()); $methodCode = Development::getMethodSourceCode($sourceClassName, $methodName); $methodCode = $this->replaceContent($replace, $methodCode); $methodLine = $targetClass->getEndLine() - 1; $sourceUses = Development::getUseStatements($sourceClassName); $targetUses = Development::getUseStatements($targetClassName); $usesToAdd = array_diff($sourceUses, $targetUses); if (empty($usesToAdd)) { $useCode = ''; } else { $useCode = "\nuse " . implode("\nuse ", $usesToAdd) . "\n"; } // search for namespace line before the class starts $useLine = 0; foreach (new \LimitIterator($file, 0, $targetClass->getStartLine()) as $index => $line) { if (0 === strpos(trim($line), 'namespace ')) { $useLine = $index + 1; break; } } $newClassCode = ''; foreach(new \LimitIterator($file) as $index => $line) { if ($index == $methodLine) { $newClassCode .= $methodCode; } if (0 !== $useLine && $index == $useLine) { $newClassCode .= $useCode; } $newClassCode .= $line; } file_put_contents($targetClass->getFileName(), $newClassCode); }
[ "protected", "function", "copyTemplateMethodToExisitingClass", "(", "$", "sourceClassName", ",", "$", "methodName", ",", "$", "replace", ")", "{", "$", "targetClassName", "=", "$", "this", "->", "replaceContent", "(", "$", "replace", ",", "$", "sourceClassName", ...
Copies the given method and all needed use statements into an existing class. The target class name will be built based on the given $replace argument. @param string $sourceClassName @param string $methodName @param array $replace
[ "Copies", "the", "given", "method", "and", "all", "needed", "use", "statements", "into", "an", "existing", "class", ".", "The", "target", "class", "name", "will", "be", "built", "based", "on", "the", "given", "$replace", "argument", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CoreConsole/Commands/GeneratePluginBase.php#L232-L282
train
Copy a template method to an excliting class
[ 30522, 5123, 3853, 6100, 18532, 15725, 11368, 6806, 11927, 8913, 9048, 28032, 2075, 26266, 1006, 1002, 3120, 26266, 18442, 1010, 1002, 4118, 18442, 1010, 1002, 5672, 1007, 1063, 1002, 4539, 26266, 18442, 1027, 1002, 2023, 1011, 1028, 5672, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
core/AssetManager/UIAssetMerger/StylesheetUIAssetMerger.php
StylesheetUIAssetMerger.getCssPathsRewriter
private function getCssPathsRewriter($uiAsset) { $baseDirectory = dirname($uiAsset->getRelativeLocation()); $webDirs = Manager::getAlternativeWebRootDirectories(); return function ($matches) use ($baseDirectory, $webDirs) { $absolutePath = PIWIK_DOCUMENT_ROOT . "/$baseDirectory/" . $matches[2]; // Allow to import extension less file if (strpos($matches[2], '.') === false) { $absolutePath .= '.less'; } // Prevent from rewriting full path $absolutePathReal = realpath($absolutePath); if ($absolutePathReal) { $relativePath = $baseDirectory . "/" . $matches[2]; $relativePath = str_replace('\\', '/', $relativePath); $publicPath = $matches[1] . $relativePath; } else { foreach ($webDirs as $absPath => $relativePath) { if (strpos($baseDirectory, $relativePath) === 0) { if (strpos($matches[2], '.') === 0) { // eg ../images/ok.png $fileRelative = $baseDirectory . '/' . $matches[2]; $fileAbsolute = $absPath . str_replace($relativePath, '', $fileRelative); if (file_exists($fileAbsolute)) { return $matches[1] . $fileRelative; } } elseif (strpos($matches[2], 'plugins/') === 0) { // eg plugins/Foo/images/ok.png $fileRelative = substr($matches[2], strlen('plugins/')); $fileAbsolute = $absPath . $fileRelative; if (file_exists($fileAbsolute)) { return $matches[1] . $relativePath . $fileRelative; } } elseif ($matches[1] === '@import "') { $fileRelative = $baseDirectory . '/' . $matches[2]; $fileAbsolute = $absPath . str_replace($relativePath, '', $fileRelative); if (file_exists($fileAbsolute)) { return $matches[1] . $baseDirectory . '/' . $matches[2]; } } } } $publicPath = $matches[1] . $matches[2]; } return $publicPath; }; }
php
private function getCssPathsRewriter($uiAsset) { $baseDirectory = dirname($uiAsset->getRelativeLocation()); $webDirs = Manager::getAlternativeWebRootDirectories(); return function ($matches) use ($baseDirectory, $webDirs) { $absolutePath = PIWIK_DOCUMENT_ROOT . "/$baseDirectory/" . $matches[2]; // Allow to import extension less file if (strpos($matches[2], '.') === false) { $absolutePath .= '.less'; } // Prevent from rewriting full path $absolutePathReal = realpath($absolutePath); if ($absolutePathReal) { $relativePath = $baseDirectory . "/" . $matches[2]; $relativePath = str_replace('\\', '/', $relativePath); $publicPath = $matches[1] . $relativePath; } else { foreach ($webDirs as $absPath => $relativePath) { if (strpos($baseDirectory, $relativePath) === 0) { if (strpos($matches[2], '.') === 0) { // eg ../images/ok.png $fileRelative = $baseDirectory . '/' . $matches[2]; $fileAbsolute = $absPath . str_replace($relativePath, '', $fileRelative); if (file_exists($fileAbsolute)) { return $matches[1] . $fileRelative; } } elseif (strpos($matches[2], 'plugins/') === 0) { // eg plugins/Foo/images/ok.png $fileRelative = substr($matches[2], strlen('plugins/')); $fileAbsolute = $absPath . $fileRelative; if (file_exists($fileAbsolute)) { return $matches[1] . $relativePath . $fileRelative; } } elseif ($matches[1] === '@import "') { $fileRelative = $baseDirectory . '/' . $matches[2]; $fileAbsolute = $absPath . str_replace($relativePath, '', $fileRelative); if (file_exists($fileAbsolute)) { return $matches[1] . $baseDirectory . '/' . $matches[2]; } } } } $publicPath = $matches[1] . $matches[2]; } return $publicPath; }; }
[ "private", "function", "getCssPathsRewriter", "(", "$", "uiAsset", ")", "{", "$", "baseDirectory", "=", "dirname", "(", "$", "uiAsset", "->", "getRelativeLocation", "(", ")", ")", ";", "$", "webDirs", "=", "Manager", "::", "getAlternativeWebRootDirectories", "("...
Rewrite CSS url directives - rewrites paths defined relatively to their css/less definition file - rewrite windows directory separator \\ to / @param UIAsset $uiAsset @return \Closure
[ "Rewrite", "CSS", "url", "directives", "-", "rewrites", "paths", "defined", "relatively", "to", "their", "css", "/", "less", "definition", "file", "-", "rewrite", "windows", "directory", "separator", "\\\\", "to", "/" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/AssetManager/UIAssetMerger/StylesheetUIAssetMerger.php#L192-L243
train
Get the path rewriting function for css files
[ 30522, 2797, 3853, 2131, 6169, 13102, 8988, 21338, 7974, 17625, 2099, 1006, 1002, 21318, 27241, 2102, 1007, 1063, 1002, 2241, 7442, 16761, 2100, 1027, 16101, 18442, 1006, 1002, 21318, 27241, 2102, 1011, 1028, 2131, 16570, 8082, 4135, 10719, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
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, $escapeFormulas); } else { if ($escapeFormulas && \in_array(substr($value, 0, 1), $this->formulasStartCharacters, true)) { $result[$parentKey.$key] = "\t".$value; } else { $result[$parentKey.$key] = $value; } } } }
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, $escapeFormulas); } else { if ($escapeFormulas && \in_array(substr($value, 0, 1), $this->formulasStartCharacters, true)) { $result[$parentKey.$key] = "\t".$value; } else { $result[$parentKey.$key] = $value; } } } }
[ "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
train
Flattens an array into a single level
[ 30522, 2797, 3853, 4257, 6528, 1006, 9140, 1002, 9140, 1010, 9140, 1004, 1002, 2765, 1010, 5164, 1002, 6309, 13699, 25879, 2953, 1010, 5164, 1002, 6687, 14839, 1027, 1005, 1005, 1010, 22017, 2140, 1002, 4019, 14192, 7068, 2015, 1027, 6270, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
laravel/framework
src/Illuminate/Http/UploadedFile.php
UploadedFile.storeAs
public function storeAs($path, $name, $options = []) { $options = $this->parseOptions($options); $disk = Arr::pull($options, 'disk'); return Container::getInstance()->make(FilesystemFactory::class)->disk($disk)->putFileAs( $path, $this, $name, $options ); }
php
public function storeAs($path, $name, $options = []) { $options = $this->parseOptions($options); $disk = Arr::pull($options, 'disk'); return Container::getInstance()->make(FilesystemFactory::class)->disk($disk)->putFileAs( $path, $this, $name, $options ); }
[ "public", "function", "storeAs", "(", "$", "path", ",", "$", "name", ",", "$", "options", "=", "[", "]", ")", "{", "$", "options", "=", "$", "this", "->", "parseOptions", "(", "$", "options", ")", ";", "$", "disk", "=", "Arr", "::", "pull", "(", ...
Store the uploaded file on a filesystem disk. @param string $path @param string $name @param array|string $options @return string|false
[ "Store", "the", "uploaded", "file", "on", "a", "filesystem", "disk", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Http/UploadedFile.php#L79-L88
train
Store the file to the specified path and name.
[ 30522, 2270, 3853, 3573, 3022, 1006, 1002, 4130, 1010, 1002, 2171, 1010, 1002, 7047, 1027, 1031, 1033, 1007, 1063, 1002, 7047, 1027, 1002, 2023, 1011, 1028, 11968, 3366, 7361, 9285, 1006, 1002, 7047, 1007, 1025, 1002, 9785, 1027, 12098, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
laravel/framework
src/Illuminate/Database/Connectors/MySqlConnector.php
MySqlConnector.configureEncoding
protected function configureEncoding($connection, array $config) { if (! isset($config['charset'])) { return $connection; } $connection->prepare( "set names '{$config['charset']}'".$this->getCollation($config) )->execute(); }
php
protected function configureEncoding($connection, array $config) { if (! isset($config['charset'])) { return $connection; } $connection->prepare( "set names '{$config['charset']}'".$this->getCollation($config) )->execute(); }
[ "protected", "function", "configureEncoding", "(", "$", "connection", ",", "array", "$", "config", ")", "{", "if", "(", "!", "isset", "(", "$", "config", "[", "'charset'", "]", ")", ")", "{", "return", "$", "connection", ";", "}", "$", "connection", "-...
Set the connection character set and collation. @param \PDO $connection @param array $config @return void
[ "Set", "the", "connection", "character", "set", "and", "collation", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Connectors/MySqlConnector.php#L49-L58
train
Configure the charset of the connection
[ 30522, 5123, 3853, 9530, 8873, 27390, 12129, 3597, 4667, 1006, 1002, 4434, 1010, 9140, 1002, 9530, 8873, 2290, 1007, 1063, 2065, 1006, 999, 26354, 3388, 1006, 1002, 9530, 8873, 2290, 1031, 1005, 25869, 13462, 1005, 1033, 1007, 1007, 1063, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
PHPMailer/PHPMailer
src/PHPMailer.php
PHPMailer.DKIM_HeaderC
public function DKIM_HeaderC($signHeader) { //Unfold all header continuation lines //Also collapses folded whitespace. //Note PCRE \s is too broad a definition of whitespace; RFC5322 defines it as `[ \t]` //@see https://tools.ietf.org/html/rfc5322#section-2.2 //That means this may break if you do something daft like put vertical tabs in your headers. $signHeader = preg_replace('/\r\n[ \t]+/', ' ', $signHeader); $lines = explode("\r\n", $signHeader); foreach ($lines as $key => $line) { //If the header is missing a :, skip it as it's invalid //This is likely to happen because the explode() above will also split //on the trailing LE, leaving an empty line if (strpos($line, ':') === false) { continue; } list($heading, $value) = explode(':', $line, 2); //Lower-case header name $heading = strtolower($heading); //Collapse white space within the value $value = preg_replace('/[ \t]{2,}/', ' ', $value); //RFC6376 is slightly unclear here - it says to delete space at the *end* of each value //But then says to delete space before and after the colon. //Net result is the same as trimming both ends of the value. //by elimination, the same applies to the field name $lines[$key] = trim($heading, " \t") . ':' . trim($value, " \t"); } return implode("\r\n", $lines); }
php
public function DKIM_HeaderC($signHeader) { //Unfold all header continuation lines //Also collapses folded whitespace. //Note PCRE \s is too broad a definition of whitespace; RFC5322 defines it as `[ \t]` //@see https://tools.ietf.org/html/rfc5322#section-2.2 //That means this may break if you do something daft like put vertical tabs in your headers. $signHeader = preg_replace('/\r\n[ \t]+/', ' ', $signHeader); $lines = explode("\r\n", $signHeader); foreach ($lines as $key => $line) { //If the header is missing a :, skip it as it's invalid //This is likely to happen because the explode() above will also split //on the trailing LE, leaving an empty line if (strpos($line, ':') === false) { continue; } list($heading, $value) = explode(':', $line, 2); //Lower-case header name $heading = strtolower($heading); //Collapse white space within the value $value = preg_replace('/[ \t]{2,}/', ' ', $value); //RFC6376 is slightly unclear here - it says to delete space at the *end* of each value //But then says to delete space before and after the colon. //Net result is the same as trimming both ends of the value. //by elimination, the same applies to the field name $lines[$key] = trim($heading, " \t") . ':' . trim($value, " \t"); } return implode("\r\n", $lines); }
[ "public", "function", "DKIM_HeaderC", "(", "$", "signHeader", ")", "{", "//Unfold all header continuation lines", "//Also collapses folded whitespace.", "//Note PCRE \\s is too broad a definition of whitespace; RFC5322 defines it as `[ \\t]`", "//@see https://tools.ietf.org/html/rfc5322#sectio...
Generate a DKIM canonicalization header. Uses the 'relaxed' algorithm from RFC6376 section 3.4.2. Canonicalized headers should *always* use CRLF, regardless of mailer setting. @see https://tools.ietf.org/html/rfc6376#section-3.4.2 @param string $signHeader Header @return string
[ "Generate", "a", "DKIM", "canonicalization", "header", ".", "Uses", "the", "relaxed", "algorithm", "from", "RFC6376", "section", "3", ".", "4", ".", "2", ".", "Canonicalized", "headers", "should", "*", "always", "*", "use", "CRLF", "regardless", "of", "maile...
3d7132341659a8a201adbc3ba11b1e202ee2857c
https://github.com/PHPMailer/PHPMailer/blob/3d7132341659a8a201adbc3ba11b1e202ee2857c/src/PHPMailer.php#L4258-L4287
train
This function is used to convert a DKIM header into a DKIM header string
[ 30522, 2270, 3853, 1040, 21138, 1035, 20346, 2278, 1006, 1002, 3696, 4974, 2121, 1007, 1063, 1013, 1013, 4895, 10371, 2035, 20346, 13633, 3210, 1013, 1013, 2036, 25938, 6999, 12461, 15327, 1012, 1013, 1013, 3602, 7473, 2890, 1032, 1055, 200...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
dompdf/dompdf
src/LineBox.php
LineBox.recalculate_width
public function recalculate_width() { $width = 0; foreach ($this->get_frames() as $frame) { $width += $frame->calculate_auto_width(); } return $this->w = $width; }
php
public function recalculate_width() { $width = 0; foreach ($this->get_frames() as $frame) { $width += $frame->calculate_auto_width(); } return $this->w = $width; }
[ "public", "function", "recalculate_width", "(", ")", "{", "$", "width", "=", "0", ";", "foreach", "(", "$", "this", "->", "get_frames", "(", ")", "as", "$", "frame", ")", "{", "$", "width", "+=", "$", "frame", "->", "calculate_auto_width", "(", ")", ...
Recalculate LineBox width based on the contained frames total width. @return float
[ "Recalculate", "LineBox", "width", "based", "on", "the", "contained", "frames", "total", "width", "." ]
75f13c700009be21a1965dc2c5b68a8708c22ba2
https://github.com/dompdf/dompdf/blob/75f13c700009be21a1965dc2c5b68a8708c22ba2/src/LineBox.php#L266-L275
train
Recalculate the width of the main frame
[ 30522, 2270, 3853, 28667, 2389, 19879, 2618, 1035, 9381, 1006, 1007, 1063, 1002, 9381, 1027, 1014, 1025, 18921, 6776, 1006, 1002, 2023, 1011, 1028, 2131, 1035, 11048, 1006, 1007, 2004, 1002, 4853, 1007, 1063, 1002, 9381, 1009, 1027, 1002, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
core/AssetManager.php
AssetManager.removeMergedAssets
public function removeMergedAssets($pluginName = false) { $assetsToRemove = array($this->getMergedStylesheetAsset()); if ($pluginName) { if ($this->pluginContainsJScriptAssets($pluginName)) { if (Manager::getInstance()->isPluginBundledWithCore($pluginName)) { $assetsToRemove[] = $this->getMergedCoreJSAsset(); } else { $assetsToRemove[] = $this->getMergedNonCoreJSAsset(); } } } else { $assetsToRemove[] = $this->getMergedCoreJSAsset(); $assetsToRemove[] = $this->getMergedNonCoreJSAsset(); } $this->removeAssets($assetsToRemove); }
php
public function removeMergedAssets($pluginName = false) { $assetsToRemove = array($this->getMergedStylesheetAsset()); if ($pluginName) { if ($this->pluginContainsJScriptAssets($pluginName)) { if (Manager::getInstance()->isPluginBundledWithCore($pluginName)) { $assetsToRemove[] = $this->getMergedCoreJSAsset(); } else { $assetsToRemove[] = $this->getMergedNonCoreJSAsset(); } } } else { $assetsToRemove[] = $this->getMergedCoreJSAsset(); $assetsToRemove[] = $this->getMergedNonCoreJSAsset(); } $this->removeAssets($assetsToRemove); }
[ "public", "function", "removeMergedAssets", "(", "$", "pluginName", "=", "false", ")", "{", "$", "assetsToRemove", "=", "array", "(", "$", "this", "->", "getMergedStylesheetAsset", "(", ")", ")", ";", "if", "(", "$", "pluginName", ")", "{", "if", "(", "$...
Remove previous merged assets
[ "Remove", "previous", "merged", "assets" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/AssetManager.php#L216-L234
train
Remove merged assets
[ 30522, 2270, 3853, 6366, 5017, 5999, 27241, 3215, 1006, 1002, 13354, 23111, 14074, 1027, 6270, 1007, 1063, 1002, 7045, 19277, 5302, 3726, 1027, 9140, 1006, 1002, 2023, 1011, 1028, 2131, 5017, 5999, 21756, 4244, 21030, 10230, 13462, 1006, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
walkor/Workerman
Connection/AsyncTcpConnection.php
AsyncTcpConnection.emitError
protected function emitError($code, $msg) { $this->_status = self::STATUS_CLOSING; if ($this->onError) { try { call_user_func($this->onError, $this, $code, $msg); } catch (\Exception $e) { Worker::log($e); exit(250); } catch (\Error $e) { Worker::log($e); exit(250); } } }
php
protected function emitError($code, $msg) { $this->_status = self::STATUS_CLOSING; if ($this->onError) { try { call_user_func($this->onError, $this, $code, $msg); } catch (\Exception $e) { Worker::log($e); exit(250); } catch (\Error $e) { Worker::log($e); exit(250); } } }
[ "protected", "function", "emitError", "(", "$", "code", ",", "$", "msg", ")", "{", "$", "this", "->", "_status", "=", "self", "::", "STATUS_CLOSING", ";", "if", "(", "$", "this", "->", "onError", ")", "{", "try", "{", "call_user_func", "(", "$", "thi...
Try to emit onError callback. @param int $code @param string $msg @return void
[ "Try", "to", "emit", "onError", "callback", "." ]
13649907f05014fcfffcfccaef01e63ad3339351
https://github.com/walkor/Workerman/blob/13649907f05014fcfffcfccaef01e63ad3339351/Connection/AsyncTcpConnection.php#L267-L281
train
Emit error message
[ 30522, 5123, 3853, 12495, 3334, 29165, 1006, 1002, 3642, 1010, 1002, 5796, 2290, 1007, 1063, 1002, 2023, 1011, 1028, 1035, 3570, 1027, 2969, 1024, 1024, 3570, 1035, 5494, 1025, 2065, 1006, 1002, 2023, 1011, 1028, 2028, 18933, 2099, 1007, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
z-song/laravel-admin
src/Grid/Concerns/HasFooter.php
HasFooter.footer
public function footer(Closure $closure = null) { if (!$closure) { return $this->footer; } $this->footer = $closure; return $this; }
php
public function footer(Closure $closure = null) { if (!$closure) { return $this->footer; } $this->footer = $closure; return $this; }
[ "public", "function", "footer", "(", "Closure", "$", "closure", "=", "null", ")", "{", "if", "(", "!", "$", "closure", ")", "{", "return", "$", "this", "->", "footer", ";", "}", "$", "this", "->", "footer", "=", "$", "closure", ";", "return", "$", ...
Set grid footer. @param Closure|null $closure @return $this|Closure
[ "Set", "grid", "footer", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Concerns/HasFooter.php#L22-L31
train
Get or set the footer
[ 30522, 2270, 3853, 3329, 2121, 1006, 8503, 1002, 8503, 1027, 19701, 1007, 1063, 2065, 1006, 999, 1002, 8503, 1007, 1063, 2709, 1002, 2023, 1011, 1028, 3329, 2121, 1025, 1065, 1002, 2023, 1011, 1028, 3329, 2121, 1027, 1002, 8503, 1025, 270...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/PropertyAccess/PropertyPathBuilder.php
PropertyPathBuilder.replace
public function replace($offset, $length, $path, $pathOffset = 0, $pathLength = 0) { if (\is_string($path)) { $path = new PropertyPath($path); } if ($offset < 0 && abs($offset) <= $this->getLength()) { $offset = $this->getLength() + $offset; } elseif (!isset($this->elements[$offset])) { throw new OutOfBoundsException('The offset '.$offset.' is not within the property path'); } if (0 === $pathLength) { $pathLength = $path->getLength() - $pathOffset; } $this->resize($offset, $length, $pathLength); for ($i = 0; $i < $pathLength; ++$i) { $this->elements[$offset + $i] = $path->getElement($pathOffset + $i); $this->isIndex[$offset + $i] = $path->isIndex($pathOffset + $i); } ksort($this->elements); }
php
public function replace($offset, $length, $path, $pathOffset = 0, $pathLength = 0) { if (\is_string($path)) { $path = new PropertyPath($path); } if ($offset < 0 && abs($offset) <= $this->getLength()) { $offset = $this->getLength() + $offset; } elseif (!isset($this->elements[$offset])) { throw new OutOfBoundsException('The offset '.$offset.' is not within the property path'); } if (0 === $pathLength) { $pathLength = $path->getLength() - $pathOffset; } $this->resize($offset, $length, $pathLength); for ($i = 0; $i < $pathLength; ++$i) { $this->elements[$offset + $i] = $path->getElement($pathOffset + $i); $this->isIndex[$offset + $i] = $path->isIndex($pathOffset + $i); } ksort($this->elements); }
[ "public", "function", "replace", "(", "$", "offset", ",", "$", "length", ",", "$", "path", ",", "$", "pathOffset", "=", "0", ",", "$", "pathLength", "=", "0", ")", "{", "if", "(", "\\", "is_string", "(", "$", "path", ")", ")", "{", "$", "path", ...
Replaces a sub-path by a different (sub-) path. @param int $offset The offset at which to replace @param int $length The length of the piece to replace @param PropertyPathInterface|string $path The path to insert @param int $pathOffset The offset where the inserted piece starts in $path @param int $pathLength The length of the inserted piece If 0, the full path is inserted @throws OutOfBoundsException If the offset is invalid
[ "Replaces", "a", "sub", "-", "path", "by", "a", "different", "(", "sub", "-", ")", "path", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/PropertyAccess/PropertyPathBuilder.php#L116-L139
train
Replace the property path with the new value
[ 30522, 2270, 3853, 5672, 1006, 1002, 16396, 1010, 1002, 3091, 1010, 1002, 4130, 1010, 1002, 4130, 27475, 3388, 1027, 1014, 1010, 1002, 4130, 7770, 13512, 2232, 1027, 1014, 1007, 1063, 2065, 1006, 1032, 2003, 1035, 5164, 1006, 1002, 4130, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
core/DataTable.php
DataTable.getRowFromLabel
public function getRowFromLabel($label) { $rowId = $this->getRowIdFromLabel($label); if (is_int($rowId) && isset($this->rows[$rowId])) { return $this->rows[$rowId]; } if ($rowId == self::ID_SUMMARY_ROW && !empty($this->summaryRow) ) { return $this->summaryRow; } if ($rowId instanceof Row) { return $rowId; } return false; }
php
public function getRowFromLabel($label) { $rowId = $this->getRowIdFromLabel($label); if (is_int($rowId) && isset($this->rows[$rowId])) { return $this->rows[$rowId]; } if ($rowId == self::ID_SUMMARY_ROW && !empty($this->summaryRow) ) { return $this->summaryRow; } if ($rowId instanceof Row) { return $rowId; } return false; }
[ "public", "function", "getRowFromLabel", "(", "$", "label", ")", "{", "$", "rowId", "=", "$", "this", "->", "getRowIdFromLabel", "(", "$", "label", ")", ";", "if", "(", "is_int", "(", "$", "rowId", ")", "&&", "isset", "(", "$", "this", "->", "rows", ...
Returns the Row whose `'label'` column is equal to `$label`. This method executes in constant time except for the first call which caches row label => row ID mappings. @param string $label `'label'` column value to look for. @return Row|false The row if found, `false` if otherwise.
[ "Returns", "the", "Row", "whose", "label", "column", "is", "equal", "to", "$label", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable.php#L656-L671
train
Get Row from Label
[ 30522, 2270, 3853, 2131, 10524, 19699, 5358, 20470, 2884, 1006, 1002, 3830, 1007, 1063, 1002, 5216, 3593, 1027, 1002, 2023, 1011, 1028, 2131, 10524, 3593, 19699, 5358, 20470, 2884, 1006, 1002, 3830, 1007, 1025, 2065, 1006, 2003, 1035, 20014...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/Routing/Router.php
Router.getOption
public function getOption($key) { if (!\array_key_exists($key, $this->options)) { throw new \InvalidArgumentException(sprintf('The Router does not support the "%s" option.', $key)); } $this->checkDeprecatedOption($key); return $this->options[$key]; }
php
public function getOption($key) { if (!\array_key_exists($key, $this->options)) { throw new \InvalidArgumentException(sprintf('The Router does not support the "%s" option.', $key)); } $this->checkDeprecatedOption($key); return $this->options[$key]; }
[ "public", "function", "getOption", "(", "$", "key", ")", "{", "if", "(", "!", "\\", "array_key_exists", "(", "$", "key", ",", "$", "this", "->", "options", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "sprintf", "(", "'The Router...
Gets an option value. @param string $key The key @return mixed The value @throws \InvalidArgumentException
[ "Gets", "an", "option", "value", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Routing/Router.php#L195-L204
train
Get an option value
[ 30522, 2270, 3853, 2131, 7361, 3508, 1006, 1002, 3145, 1007, 1063, 2065, 1006, 999, 1032, 9140, 1035, 3145, 1035, 6526, 1006, 1002, 3145, 1010, 1002, 2023, 1011, 1028, 7047, 1007, 1007, 1063, 5466, 2047, 1032, 19528, 2906, 22850, 15781, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
getgrav/grav
system/src/Grav/Framework/File/Formatter/CsvFormatter.php
CsvFormatter.decode
public function decode($data, $delimiter = null): array { $delimiter = $delimiter ?? $this->getDelimiter(); $lines = preg_split('/\r\n|\r|\n/', $data); if ($lines === false) { throw new \RuntimeException('Decoding CSV failed'); } // Get the field names $header = str_getcsv(array_shift($lines), $delimiter); // Get the data $list = []; foreach ($lines as $line) { $list[] = array_combine($header, str_getcsv($line, $delimiter)); } return $list; }
php
public function decode($data, $delimiter = null): array { $delimiter = $delimiter ?? $this->getDelimiter(); $lines = preg_split('/\r\n|\r|\n/', $data); if ($lines === false) { throw new \RuntimeException('Decoding CSV failed'); } // Get the field names $header = str_getcsv(array_shift($lines), $delimiter); // Get the data $list = []; foreach ($lines as $line) { $list[] = array_combine($header, str_getcsv($line, $delimiter)); } return $list; }
[ "public", "function", "decode", "(", "$", "data", ",", "$", "delimiter", "=", "null", ")", ":", "array", "{", "$", "delimiter", "=", "$", "delimiter", "??", "$", "this", "->", "getDelimiter", "(", ")", ";", "$", "lines", "=", "preg_split", "(", "'/\\...
{@inheritdoc} @see FileFormatterInterface::decode()
[ "{" ]
1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72
https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Framework/File/Formatter/CsvFormatter.php#L70-L89
train
Decode CSV data into array of array of terms
[ 30522, 2270, 3853, 21933, 3207, 1006, 1002, 2951, 1010, 1002, 3972, 27605, 3334, 1027, 19701, 1007, 1024, 9140, 1063, 1002, 3972, 27605, 3334, 1027, 1002, 3972, 27605, 3334, 1029, 1029, 1002, 2023, 1011, 1028, 2131, 9247, 27605, 3334, 1006,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/PropertyAccess/PropertyPathBuilder.php
PropertyPathBuilder.append
public function append($path, $offset = 0, $length = 0) { if (\is_string($path)) { $path = new PropertyPath($path); } if (0 === $length) { $end = $path->getLength(); } else { $end = $offset + $length; } for (; $offset < $end; ++$offset) { $this->elements[] = $path->getElement($offset); $this->isIndex[] = $path->isIndex($offset); } }
php
public function append($path, $offset = 0, $length = 0) { if (\is_string($path)) { $path = new PropertyPath($path); } if (0 === $length) { $end = $path->getLength(); } else { $end = $offset + $length; } for (; $offset < $end; ++$offset) { $this->elements[] = $path->getElement($offset); $this->isIndex[] = $path->isIndex($offset); } }
[ "public", "function", "append", "(", "$", "path", ",", "$", "offset", "=", "0", ",", "$", "length", "=", "0", ")", "{", "if", "(", "\\", "is_string", "(", "$", "path", ")", ")", "{", "$", "path", "=", "new", "PropertyPath", "(", "$", "path", ")...
Appends a (sub-) path to the current path. @param PropertyPathInterface|string $path The path to append @param int $offset The offset where the appended piece starts in $path @param int $length The length of the appended piece If 0, the full path is appended
[ "Appends", "a", "(", "sub", "-", ")", "path", "to", "the", "current", "path", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/PropertyAccess/PropertyPathBuilder.php#L46-L62
train
Append a property path to the list
[ 30522, 2270, 3853, 10439, 10497, 1006, 1002, 4130, 1010, 1002, 16396, 1027, 1014, 1010, 1002, 3091, 1027, 1014, 1007, 1063, 2065, 1006, 1032, 2003, 1035, 5164, 1006, 1002, 4130, 1007, 1007, 1063, 1002, 4130, 1027, 2047, 3200, 15069, 1006, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
core/Menu/MenuAbstract.php
MenuAbstract.applyOrdering
private function applyOrdering() { if (empty($this->menu) || $this->orderingApplied ) { return; } uasort($this->menu, array($this, 'menuCompare')); foreach ($this->menu as $key => &$element) { if (is_null($element)) { unset($this->menu[$key]); } elseif ($element['_hasSubmenu']) { uasort($element, array($this, 'menuCompare')); } } $this->orderingApplied = true; }
php
private function applyOrdering() { if (empty($this->menu) || $this->orderingApplied ) { return; } uasort($this->menu, array($this, 'menuCompare')); foreach ($this->menu as $key => &$element) { if (is_null($element)) { unset($this->menu[$key]); } elseif ($element['_hasSubmenu']) { uasort($element, array($this, 'menuCompare')); } } $this->orderingApplied = true; }
[ "private", "function", "applyOrdering", "(", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "menu", ")", "||", "$", "this", "->", "orderingApplied", ")", "{", "return", ";", "}", "uasort", "(", "$", "this", "->", "menu", ",", "array", "(", "...
Orders the menu according to their order.
[ "Orders", "the", "menu", "according", "to", "their", "order", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Menu/MenuAbstract.php#L305-L323
train
Apply the menu ordering
[ 30522, 2797, 3853, 6611, 8551, 7999, 1006, 1007, 1063, 2065, 1006, 4064, 1006, 1002, 2023, 1011, 1028, 12183, 1007, 1064, 1064, 1002, 2023, 1011, 1028, 13063, 29098, 8751, 2094, 1007, 1063, 2709, 1025, 1065, 25423, 21748, 2102, 1006, 1002, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/Console/Application.php
Application.setDefaultCommand
public function setDefaultCommand($commandName, $isSingleCommand = false) { $this->defaultCommand = $commandName; if ($isSingleCommand) { // Ensure the command exist $this->find($commandName); $this->singleCommand = true; } return $this; }
php
public function setDefaultCommand($commandName, $isSingleCommand = false) { $this->defaultCommand = $commandName; if ($isSingleCommand) { // Ensure the command exist $this->find($commandName); $this->singleCommand = true; } return $this; }
[ "public", "function", "setDefaultCommand", "(", "$", "commandName", ",", "$", "isSingleCommand", "=", "false", ")", "{", "$", "this", "->", "defaultCommand", "=", "$", "commandName", ";", "if", "(", "$", "isSingleCommand", ")", "{", "// Ensure the command exist"...
Sets the default Command name. @param string $commandName The Command name @param bool $isSingleCommand Set to true if there is only one command in this application @return self
[ "Sets", "the", "default", "Command", "name", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Application.php#L1098-L1110
train
Set Default Command
[ 30522, 2270, 3853, 2275, 3207, 7011, 11314, 9006, 2386, 2094, 1006, 1002, 3094, 18442, 1010, 1002, 26354, 2075, 2571, 9006, 2386, 2094, 1027, 6270, 1007, 1063, 1002, 2023, 1011, 1028, 12398, 9006, 2386, 2094, 1027, 1002, 3094, 18442, 1025, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
laravel/framework
src/Illuminate/Foundation/Application.php
Application.environment
public function environment(...$environments) { if (count($environments) > 0) { $patterns = is_array($environments[0]) ? $environments[0] : $environments; return Str::is($patterns, $this['env']); } return $this['env']; }
php
public function environment(...$environments) { if (count($environments) > 0) { $patterns = is_array($environments[0]) ? $environments[0] : $environments; return Str::is($patterns, $this['env']); } return $this['env']; }
[ "public", "function", "environment", "(", "...", "$", "environments", ")", "{", "if", "(", "count", "(", "$", "environments", ")", ">", "0", ")", "{", "$", "patterns", "=", "is_array", "(", "$", "environments", "[", "0", "]", ")", "?", "$", "environm...
Get or check the current application environment. @param string|array $environments @return string|bool
[ "Get", "or", "check", "the", "current", "application", "environment", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Application.php#L501-L510
train
Return true if the environment matches the given string
[ 30522, 2270, 3853, 4044, 1006, 1012, 1012, 1012, 1002, 10058, 1007, 1063, 2065, 1006, 4175, 1006, 1002, 10058, 1007, 1028, 1014, 1007, 1063, 1002, 7060, 1027, 2003, 1035, 9140, 1006, 1002, 10058, 1031, 1014, 1033, 1007, 1029, 1002, 10058, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
dompdf/dompdf
src/Helpers.php
Helpers.parse_data_uri
public static function parse_data_uri($data_uri) { if (!preg_match('/^data:(?P<mime>[a-z0-9\/+-.]+)(;charset=(?P<charset>[a-z0-9-])+)?(?P<base64>;base64)?\,(?P<data>.*)?/is', $data_uri, $match)) { return false; } $match['data'] = rawurldecode($match['data']); $result = array( 'charset' => $match['charset'] ? $match['charset'] : 'US-ASCII', 'mime' => $match['mime'] ? $match['mime'] : 'text/plain', 'data' => $match['base64'] ? base64_decode($match['data']) : $match['data'], ); return $result; }
php
public static function parse_data_uri($data_uri) { if (!preg_match('/^data:(?P<mime>[a-z0-9\/+-.]+)(;charset=(?P<charset>[a-z0-9-])+)?(?P<base64>;base64)?\,(?P<data>.*)?/is', $data_uri, $match)) { return false; } $match['data'] = rawurldecode($match['data']); $result = array( 'charset' => $match['charset'] ? $match['charset'] : 'US-ASCII', 'mime' => $match['mime'] ? $match['mime'] : 'text/plain', 'data' => $match['base64'] ? base64_decode($match['data']) : $match['data'], ); return $result; }
[ "public", "static", "function", "parse_data_uri", "(", "$", "data_uri", ")", "{", "if", "(", "!", "preg_match", "(", "'/^data:(?P<mime>[a-z0-9\\/+-.]+)(;charset=(?P<charset>[a-z0-9-])+)?(?P<base64>;base64)?\\,(?P<data>.*)?/is'", ",", "$", "data_uri", ",", "$", "match", ")",...
Parses a data URI scheme http://en.wikipedia.org/wiki/Data_URI_scheme @param string $data_uri The data URI to parse @return array|bool The result with charset, mime type and decoded data
[ "Parses", "a", "data", "URI", "scheme", "http", ":", "//", "en", ".", "wikipedia", ".", "org", "/", "wiki", "/", "Data_URI_scheme" ]
75f13c700009be21a1965dc2c5b68a8708c22ba2
https://github.com/dompdf/dompdf/blob/75f13c700009be21a1965dc2c5b68a8708c22ba2/src/Helpers.php#L196-L210
train
Parse the data - uri into an array
[ 30522, 2270, 10763, 3853, 11968, 3366, 1035, 2951, 1035, 24471, 2072, 1006, 1002, 2951, 1035, 24471, 2072, 1007, 1063, 2065, 1006, 999, 3653, 2290, 1035, 2674, 1006, 1005, 1013, 1034, 2951, 1024, 1006, 1029, 1052, 1026, 2771, 4168, 1028, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
dompdf/dompdf
src/Css/Style.php
Style.get_prop
function get_prop($prop) { if (!isset(self::$_defaults[$prop])) { throw new Exception("'$prop' is not a valid CSS2 property."); } $method = "get_$prop"; // Fall back on defaults if property is not set if (!isset($this->_props[$prop])) { return self::$_defaults[$prop]; } if (method_exists($this, $method)) { return $this->$method(); } return $this->_props[$prop]; }
php
function get_prop($prop) { if (!isset(self::$_defaults[$prop])) { throw new Exception("'$prop' is not a valid CSS2 property."); } $method = "get_$prop"; // Fall back on defaults if property is not set if (!isset($this->_props[$prop])) { return self::$_defaults[$prop]; } if (method_exists($this, $method)) { return $this->$method(); } return $this->_props[$prop]; }
[ "function", "get_prop", "(", "$", "prop", ")", "{", "if", "(", "!", "isset", "(", "self", "::", "$", "_defaults", "[", "$", "prop", "]", ")", ")", "{", "throw", "new", "Exception", "(", "\"'$prop' is not a valid CSS2 property.\"", ")", ";", "}", "$", "...
Similar to __get() without storing the result. Useful for accessing properties while loading stylesheets. @param $prop @return string @throws Exception
[ "Similar", "to", "__get", "()", "without", "storing", "the", "result", ".", "Useful", "for", "accessing", "properties", "while", "loading", "stylesheets", "." ]
75f13c700009be21a1965dc2c5b68a8708c22ba2
https://github.com/dompdf/dompdf/blob/75f13c700009be21a1965dc2c5b68a8708c22ba2/src/Css/Style.php#L865-L883
train
Get the value of a CSS2 property
[ 30522, 3853, 2131, 1035, 17678, 1006, 1002, 17678, 1007, 1063, 2065, 1006, 999, 26354, 3388, 1006, 2969, 1024, 1024, 1002, 1035, 12398, 2015, 1031, 1002, 17678, 1033, 1007, 1007, 1063, 5466, 2047, 6453, 1006, 1000, 1005, 1002, 17678, 1005, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/Yaml/Inline.php
Inline.isHash
public static function isHash($value): bool { if ($value instanceof \stdClass || $value instanceof \ArrayObject) { return true; } $expectedKey = 0; foreach ($value as $key => $val) { if ($key !== $expectedKey++) { return true; } } return false; }
php
public static function isHash($value): bool { if ($value instanceof \stdClass || $value instanceof \ArrayObject) { return true; } $expectedKey = 0; foreach ($value as $key => $val) { if ($key !== $expectedKey++) { return true; } } return false; }
[ "public", "static", "function", "isHash", "(", "$", "value", ")", ":", "bool", "{", "if", "(", "$", "value", "instanceof", "\\", "stdClass", "||", "$", "value", "instanceof", "\\", "ArrayObject", ")", "{", "return", "true", ";", "}", "$", "expectedKey", ...
Check if given array is hash or just normal indexed array. @param array|\ArrayObject|\stdClass $value The PHP array or array-like object to check @return bool true if value is hash array, false otherwise
[ "Check", "if", "given", "array", "is", "hash", "or", "just", "normal", "indexed", "array", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Yaml/Inline.php#L213-L228
train
Checks if the value is a hash
[ 30522, 2270, 10763, 3853, 2003, 14949, 2232, 1006, 1002, 3643, 1007, 1024, 22017, 2140, 1063, 2065, 1006, 1002, 3643, 6013, 11253, 1032, 2358, 16409, 27102, 1064, 1064, 1002, 3643, 6013, 11253, 1032, 9140, 16429, 30524, 1009, 1009, 1007, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/DomCrawler/Crawler.php
Crawler.previousAll
public function previousAll() { if (!$this->nodes) { throw new \InvalidArgumentException('The current node list is empty.'); } return $this->createSubCrawler($this->sibling($this->getNode(0), 'previousSibling')); }
php
public function previousAll() { if (!$this->nodes) { throw new \InvalidArgumentException('The current node list is empty.'); } return $this->createSubCrawler($this->sibling($this->getNode(0), 'previousSibling')); }
[ "public", "function", "previousAll", "(", ")", "{", "if", "(", "!", "$", "this", "->", "nodes", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "'The current node list is empty.'", ")", ";", "}", "return", "$", "this", "->", "createSubCrawler"...
Returns the previous sibling nodes of the current selection. @return self @throws \InvalidArgumentException
[ "Returns", "the", "previous", "sibling", "nodes", "of", "the", "current", "selection", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DomCrawler/Crawler.php#L458-L465
train
Returns the previous sibling nodes of the current node list.
[ 30522, 2270, 3853, 3025, 8095, 1006, 1007, 1063, 2065, 1006, 999, 1002, 2023, 1011, 1028, 14164, 1007, 1063, 5466, 2047, 1032, 19528, 2906, 22850, 15781, 2595, 24422, 1006, 1005, 1996, 2783, 13045, 2862, 2003, 4064, 1012, 1005, 1007, 1025, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
plugins/DevicesDetection/API.php
API.mergeDataTables
protected function mergeDataTables(DataTable\DataTableInterface $dataTable, DataTable\DataTableInterface $dataTable2) { if ($dataTable instanceof DataTable\Map) { $dataTables = $dataTable->getDataTables(); foreach ($dataTables as $label => $table) { $versionDataTables = $dataTable2->getDataTables(); if (!array_key_exists($label, $versionDataTables)) { continue; } $newDataTable = $this->mergeDataTables($table, $versionDataTables[$label]); $dataTable->addTable($newDataTable, $label); } } else if (!$dataTable->getRowsCount() && $dataTable2->getRowsCount()) { $dataTable2->filter('GroupBy', array('label', function ($label) { if (preg_match("/(.+) [0-9]+(?:\.[0-9]+)?$/", $label, $matches)) { return $matches[1]; // should match for browsers } if (strpos($label, ';')) { return substr($label, 0, 3); // should match for os } return $label; })); return $dataTable2; } return $dataTable; }
php
protected function mergeDataTables(DataTable\DataTableInterface $dataTable, DataTable\DataTableInterface $dataTable2) { if ($dataTable instanceof DataTable\Map) { $dataTables = $dataTable->getDataTables(); foreach ($dataTables as $label => $table) { $versionDataTables = $dataTable2->getDataTables(); if (!array_key_exists($label, $versionDataTables)) { continue; } $newDataTable = $this->mergeDataTables($table, $versionDataTables[$label]); $dataTable->addTable($newDataTable, $label); } } else if (!$dataTable->getRowsCount() && $dataTable2->getRowsCount()) { $dataTable2->filter('GroupBy', array('label', function ($label) { if (preg_match("/(.+) [0-9]+(?:\.[0-9]+)?$/", $label, $matches)) { return $matches[1]; // should match for browsers } if (strpos($label, ';')) { return substr($label, 0, 3); // should match for os } return $label; })); return $dataTable2; } return $dataTable; }
[ "protected", "function", "mergeDataTables", "(", "DataTable", "\\", "DataTableInterface", "$", "dataTable", ",", "DataTable", "\\", "DataTableInterface", "$", "dataTable2", ")", "{", "if", "(", "$", "dataTable", "instanceof", "DataTable", "\\", "Map", ")", "{", ...
That methods handles the fallback to version datatables to calculate those without versions. Unlike DevicesDetection plugin now, the UserSettings plugin did not store archives holding the os and browser data without their version number. The "version-less" reports were always generated out of the "version-containing" archives . For big archives (month/year) that ment that some of the data was truncated, due to the datatable entry limit. To avoid that data loss / inaccuracy in the future, DevicesDetection plugin will also store archives without the version. For data archived before DevicesDetection plugin was enabled, those archives do not exist, so we try to calculate them here from the "version-containing" reports if possible. @param DataTable\DataTableInterface $dataTable @param DataTable\DataTableInterface $dataTable2 @return DataTable\DataTableInterface
[ "That", "methods", "handles", "the", "fallback", "to", "version", "datatables", "to", "calculate", "those", "without", "versions", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/DevicesDetection/API.php#L176-L206
train
Merges two data tables and returns the new one
[ 30522, 5123, 3853, 5314, 6790, 10880, 2015, 1006, 2951, 10880, 1032, 2951, 10880, 18447, 2121, 12172, 1002, 2951, 10880, 1010, 2951, 10880, 1032, 2951, 10880, 18447, 2121, 12172, 1002, 2951, 10880, 2475, 1007, 1063, 2065, 1006, 1002, 2951, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
octobercms/october
modules/system/controllers/Updates.php
Updates.onRemoveTheme
public function onRemoveTheme() { if ($themeCode = post('code')) { ThemeManager::instance()->deleteTheme($themeCode); Flash::success(trans('cms::lang.theme.delete_theme_success')); } return Redirect::refresh(); }
php
public function onRemoveTheme() { if ($themeCode = post('code')) { ThemeManager::instance()->deleteTheme($themeCode); Flash::success(trans('cms::lang.theme.delete_theme_success')); } return Redirect::refresh(); }
[ "public", "function", "onRemoveTheme", "(", ")", "{", "if", "(", "$", "themeCode", "=", "post", "(", "'code'", ")", ")", "{", "ThemeManager", "::", "instance", "(", ")", "->", "deleteTheme", "(", "$", "themeCode", ")", ";", "Flash", "::", "success", "(...
Deletes a single theme from the system. @return void
[ "Deletes", "a", "single", "theme", "from", "the", "system", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/controllers/Updates.php#L873-L883
train
Removes the theme
[ 30522, 2270, 3853, 2006, 28578, 21818, 10760, 4168, 1006, 1007, 1063, 2065, 1006, 1002, 4323, 16044, 1027, 2695, 1006, 1005, 3642, 1005, 1007, 1007, 1063, 4323, 24805, 4590, 1024, 1024, 6013, 1006, 1007, 1011, 1028, 3972, 12870, 10760, 4168...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
libs/HTML/QuickForm2/Container/Group.php
HTML_QuickForm2_Container_Group.insertBefore
public function insertBefore(HTML_QuickForm2_Node $element, HTML_QuickForm2_Node $reference = null) { if (null === $reference) { return $this->appendChild($element); } return parent::insertBefore($this->renameChild($element), $reference); }
php
public function insertBefore(HTML_QuickForm2_Node $element, HTML_QuickForm2_Node $reference = null) { if (null === $reference) { return $this->appendChild($element); } return parent::insertBefore($this->renameChild($element), $reference); }
[ "public", "function", "insertBefore", "(", "HTML_QuickForm2_Node", "$", "element", ",", "HTML_QuickForm2_Node", "$", "reference", "=", "null", ")", "{", "if", "(", "null", "===", "$", "reference", ")", "{", "return", "$", "this", "->", "appendChild", "(", "$...
Inserts an element in the container If the reference object is not given, the element will be appended. @param HTML_QuickForm2_Node Element to insert @param HTML_QuickForm2_Node Reference to insert before @return HTML_QuickForm2_Node Inserted element
[ "Inserts", "an", "element", "in", "the", "container" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Container/Group.php#L271-L277
train
Inserts an element before another element
[ 30522, 2270, 3853, 19274, 4783, 29278, 2063, 1006, 16129, 1035, 4248, 14192, 2475, 1035, 13045, 1002, 5783, 1010, 16129, 1035, 4248, 14192, 2475, 1035, 13045, 1002, 4431, 1027, 19701, 1007, 30524, 1007, 1063, 2709, 1002, 2023, 1011, 1028, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
libs/HTML/QuickForm2/Node.php
HTML_QuickForm2_Node.persistentFreeze
public function persistentFreeze($persistent = null) { $old = $this->persistent; if (null !== $persistent) { $this->persistent = (bool)$persistent; } return $old; }
php
public function persistentFreeze($persistent = null) { $old = $this->persistent; if (null !== $persistent) { $this->persistent = (bool)$persistent; } return $old; }
[ "public", "function", "persistentFreeze", "(", "$", "persistent", "=", "null", ")", "{", "$", "old", "=", "$", "this", "->", "persistent", ";", "if", "(", "null", "!==", "$", "persistent", ")", "{", "$", "this", "->", "persistent", "=", "(", "bool", ...
Changes the element's persistent freeze behaviour If persistent freeze is on, the element's value will be kept (and submitted) in a hidden field when the element is frozen. @param bool New value for "persistent freeze". If omitted, the method will not set anything, just return the current value of the flag. @return bool Old value of "persistent freeze" flag
[ "Changes", "the", "element", "s", "persistent", "freeze", "behaviour" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Node.php#L413-L420
train
Freeze the local variable
[ 30522, 2270, 3853, 14516, 23301, 4371, 1006, 1002, 14516, 1027, 19701, 1007, 1063, 1002, 2214, 1027, 1002, 2023, 1011, 1028, 14516, 1025, 2065, 1006, 19701, 999, 1027, 1027, 1002, 14516, 1007, 1063, 1002, 2023, 1011, 1028, 14516, 1027, 1006...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
laravel/framework
src/Illuminate/Routing/Route.php
Route.controllerDispatcher
public function controllerDispatcher() { if ($this->container->bound(ControllerDispatcherContract::class)) { return $this->container->make(ControllerDispatcherContract::class); } return new ControllerDispatcher($this->container); }
php
public function controllerDispatcher() { if ($this->container->bound(ControllerDispatcherContract::class)) { return $this->container->make(ControllerDispatcherContract::class); } return new ControllerDispatcher($this->container); }
[ "public", "function", "controllerDispatcher", "(", ")", "{", "if", "(", "$", "this", "->", "container", "->", "bound", "(", "ControllerDispatcherContract", "::", "class", ")", ")", "{", "return", "$", "this", "->", "container", "->", "make", "(", "Controller...
Get the dispatcher for the route's controller. @return \Illuminate\Routing\Contracts\ControllerDispatcher
[ "Get", "the", "dispatcher", "for", "the", "route", "s", "controller", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/Route.php#L842-L849
train
Return the controller dispatcher
[ 30522, 2270, 3853, 11486, 10521, 4502, 10649, 2121, 1006, 1007, 1063, 2065, 1006, 1002, 2023, 1011, 1028, 11661, 1011, 1028, 5391, 1006, 11486, 10521, 4502, 10649, 2121, 8663, 6494, 6593, 1024, 1024, 2465, 1007, 1007, 1063, 2709, 1002, 2023...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
laravel/framework
src/Illuminate/Database/Schema/Grammars/ChangeColumn.php
ChangeColumn.getDoctrineColumnChangeOptions
protected static function getDoctrineColumnChangeOptions(Fluent $fluent) { $options = ['type' => static::getDoctrineColumnType($fluent['type'])]; if (in_array($fluent['type'], ['text', 'mediumText', 'longText'])) { $options['length'] = static::calculateDoctrineTextLength($fluent['type']); } if ($fluent['type'] === 'json') { $options['customSchemaOptions'] = [ 'collation' => '', ]; } return $options; }
php
protected static function getDoctrineColumnChangeOptions(Fluent $fluent) { $options = ['type' => static::getDoctrineColumnType($fluent['type'])]; if (in_array($fluent['type'], ['text', 'mediumText', 'longText'])) { $options['length'] = static::calculateDoctrineTextLength($fluent['type']); } if ($fluent['type'] === 'json') { $options['customSchemaOptions'] = [ 'collation' => '', ]; } return $options; }
[ "protected", "static", "function", "getDoctrineColumnChangeOptions", "(", "Fluent", "$", "fluent", ")", "{", "$", "options", "=", "[", "'type'", "=>", "static", "::", "getDoctrineColumnType", "(", "$", "fluent", "[", "'type'", "]", ")", "]", ";", "if", "(", ...
Get the Doctrine column change options. @param \Illuminate\Support\Fluent $fluent @return array
[ "Get", "the", "Doctrine", "column", "change", "options", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Schema/Grammars/ChangeColumn.php#L113-L128
train
Returns the doctrine column change options for the given fluent array
[ 30522, 5123, 10763, 3853, 2131, 3527, 6593, 11467, 25778, 2819, 12680, 22043, 7361, 9285, 1006, 19376, 1002, 19376, 1007, 1063, 1002, 7047, 1027, 1031, 1005, 2828, 1005, 1027, 1028, 10763, 1024, 1024, 2131, 3527, 6593, 11467, 25778, 2819, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/Lock/Store/PdoStore.php
PdoStore.putOffExpiration
public function putOffExpiration(Key $key, $ttl) { if ($ttl < 1) { throw new InvalidArgumentException(sprintf('%s() expects a TTL greater or equals to 1 second. Got %s.', __METHOD__, $ttl)); } $key->reduceLifetime($ttl); $sql = "UPDATE $this->table SET $this->expirationCol = {$this->getCurrentTimestampStatement()} + $ttl, $this->tokenCol = :token1 WHERE $this->idCol = :id AND ($this->tokenCol = :token2 OR $this->expirationCol <= {$this->getCurrentTimestampStatement()})"; $stmt = $this->getConnection()->prepare($sql); $uniqueToken = $this->getUniqueToken($key); $stmt->bindValue(':id', $this->getHashedKey($key)); $stmt->bindValue(':token1', $uniqueToken); $stmt->bindValue(':token2', $uniqueToken); $stmt->execute(); // If this method is called twice in the same second, the row wouldn't be updated. We have to call exists to know if we are the owner if (!$stmt->rowCount() && !$this->exists($key)) { throw new LockConflictedException(); } if ($key->isExpired()) { throw new LockExpiredException(sprintf('Failed to put off the expiration of the "%s" lock within the specified time.', $key)); } }
php
public function putOffExpiration(Key $key, $ttl) { if ($ttl < 1) { throw new InvalidArgumentException(sprintf('%s() expects a TTL greater or equals to 1 second. Got %s.', __METHOD__, $ttl)); } $key->reduceLifetime($ttl); $sql = "UPDATE $this->table SET $this->expirationCol = {$this->getCurrentTimestampStatement()} + $ttl, $this->tokenCol = :token1 WHERE $this->idCol = :id AND ($this->tokenCol = :token2 OR $this->expirationCol <= {$this->getCurrentTimestampStatement()})"; $stmt = $this->getConnection()->prepare($sql); $uniqueToken = $this->getUniqueToken($key); $stmt->bindValue(':id', $this->getHashedKey($key)); $stmt->bindValue(':token1', $uniqueToken); $stmt->bindValue(':token2', $uniqueToken); $stmt->execute(); // If this method is called twice in the same second, the row wouldn't be updated. We have to call exists to know if we are the owner if (!$stmt->rowCount() && !$this->exists($key)) { throw new LockConflictedException(); } if ($key->isExpired()) { throw new LockExpiredException(sprintf('Failed to put off the expiration of the "%s" lock within the specified time.', $key)); } }
[ "public", "function", "putOffExpiration", "(", "Key", "$", "key", ",", "$", "ttl", ")", "{", "if", "(", "$", "ttl", "<", "1", ")", "{", "throw", "new", "InvalidArgumentException", "(", "sprintf", "(", "'%s() expects a TTL greater or equals to 1 second. Got %s.'", ...
{@inheritdoc}
[ "{" ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Lock/Store/PdoStore.php#L159-L184
train
Puts off the expiration of a lock on the specified time.
[ 30522, 2270, 3853, 2404, 7245, 10288, 16781, 1006, 3145, 1002, 3145, 1010, 1002, 23746, 2140, 1007, 1063, 2065, 1006, 1002, 23746, 2140, 1026, 1015, 1007, 1063, 5466, 2047, 19528, 2906, 22850, 15781, 2595, 24422, 1006, 9043, 2546, 1006, 100...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/Mime/MimeTypes.php
MimeTypes.getMimeTypes
public function getMimeTypes(string $ext): array { if ($this->mimeTypes) { $mimeTypes = $this->mimeTypes[$ext] ?? $this->mimeTypes[$lcExt = strtolower($ext)] ?? null; } return $mimeTypes ?? self::$reverseMap[$ext] ?? self::$reverseMap[$lcExt ?? strtolower($ext)] ?? []; }
php
public function getMimeTypes(string $ext): array { if ($this->mimeTypes) { $mimeTypes = $this->mimeTypes[$ext] ?? $this->mimeTypes[$lcExt = strtolower($ext)] ?? null; } return $mimeTypes ?? self::$reverseMap[$ext] ?? self::$reverseMap[$lcExt ?? strtolower($ext)] ?? []; }
[ "public", "function", "getMimeTypes", "(", "string", "$", "ext", ")", ":", "array", "{", "if", "(", "$", "this", "->", "mimeTypes", ")", "{", "$", "mimeTypes", "=", "$", "this", "->", "mimeTypes", "[", "$", "ext", "]", "??", "$", "this", "->", "mim...
{@inheritdoc}
[ "{" ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Mime/MimeTypes.php#L98-L105
train
Returns the mime types of a file extension.
[ 30522, 2270, 3853, 2131, 4328, 11368, 18863, 2015, 1006, 5164, 1002, 4654, 2102, 1007, 1024, 9140, 1063, 2065, 1006, 1002, 2023, 1011, 1028, 2771, 11368, 18863, 2015, 1007, 1063, 1002, 2771, 11368, 18863, 2015, 1027, 1002, 2023, 1011, 1028,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
php-ai/php-ml
src/Math/Matrix.php
Matrix.frobeniusNorm
public function frobeniusNorm(): float { $squareSum = 0; for ($i = 0; $i < $this->rows; ++$i) { for ($j = 0; $j < $this->columns; ++$j) { $squareSum += $this->matrix[$i][$j] ** 2; } } return $squareSum ** .5; }
php
public function frobeniusNorm(): float { $squareSum = 0; for ($i = 0; $i < $this->rows; ++$i) { for ($j = 0; $j < $this->columns; ++$j) { $squareSum += $this->matrix[$i][$j] ** 2; } } return $squareSum ** .5; }
[ "public", "function", "frobeniusNorm", "(", ")", ":", "float", "{", "$", "squareSum", "=", "0", ";", "for", "(", "$", "i", "=", "0", ";", "$", "i", "<", "$", "this", "->", "rows", ";", "++", "$", "i", ")", "{", "for", "(", "$", "j", "=", "0...
Frobenius norm (Hilbert–Schmidt norm, Euclidean norm) (‖A‖F) Square root of the sum of the square of all elements. https://en.wikipedia.org/wiki/Matrix_norm#Frobenius_norm _____________ /ᵐ ⁿ ‖A‖F = √ Σ Σ |aᵢⱼ|² ᵢ₌₁ ᵢ₌₁
[ "Frobenius", "norm", "(", "Hilbert–Schmidt", "norm", "Euclidean", "norm", ")", "(", "‖A‖F", ")", "Square", "root", "of", "the", "sum", "of", "the", "square", "of", "all", "elements", "." ]
f6aa1a59b0525b8fca3d2786d661ab3e70904016
https://github.com/php-ai/php-ml/blob/f6aa1a59b0525b8fca3d2786d661ab3e70904016/src/Math/Matrix.php#L265-L275
train
Frobenius norm - Returns the frobenius norm of the matrix
[ 30522, 2270, 3853, 10424, 20891, 20447, 12131, 2213, 1006, 1007, 1024, 14257, 1063, 1002, 14320, 2819, 1027, 1014, 1025, 2005, 1006, 1002, 1045, 1027, 1014, 1025, 1002, 1045, 1026, 1002, 2023, 1011, 1028, 10281, 1025, 1009, 1009, 1002, 1045...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
laravel/framework
src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php
BelongsToMany.createMany
public function createMany(array $records, array $joinings = []) { $instances = []; foreach ($records as $key => $record) { $instances[] = $this->create($record, (array) ($joinings[$key] ?? []), false); } $this->touchIfTouching(); return $instances; }
php
public function createMany(array $records, array $joinings = []) { $instances = []; foreach ($records as $key => $record) { $instances[] = $this->create($record, (array) ($joinings[$key] ?? []), false); } $this->touchIfTouching(); return $instances; }
[ "public", "function", "createMany", "(", "array", "$", "records", ",", "array", "$", "joinings", "=", "[", "]", ")", "{", "$", "instances", "=", "[", "]", ";", "foreach", "(", "$", "records", "as", "$", "key", "=>", "$", "record", ")", "{", "$", ...
Create an array of new instances of the related models. @param array $records @param array $joinings @return array
[ "Create", "an", "array", "of", "new", "instances", "of", "the", "related", "models", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php#L927-L938
train
Create many new objects from array of records
[ 30522, 2270, 3853, 3443, 2386, 2100, 1006, 9140, 1002, 2636, 1010, 9140, 1002, 5241, 2015, 1027, 1031, 1033, 1007, 1063, 1002, 12107, 1027, 1031, 1033, 1025, 18921, 6776, 1006, 1002, 2636, 2004, 1002, 3145, 1027, 1028, 1002, 2501, 1007, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
overtrue/wechat
src/Work/Invoice/Client.php
Client.update
public function update(string $cardId, string $encryptCode, string $status) { $params = [ 'card_id' => $cardId, 'encrypt_code' => $encryptCode, 'reimburse_status' => $status, ]; return $this->httpPostJson('cgi-bin/card/invoice/reimburse/updateinvoicestatus', $params); }
php
public function update(string $cardId, string $encryptCode, string $status) { $params = [ 'card_id' => $cardId, 'encrypt_code' => $encryptCode, 'reimburse_status' => $status, ]; return $this->httpPostJson('cgi-bin/card/invoice/reimburse/updateinvoicestatus', $params); }
[ "public", "function", "update", "(", "string", "$", "cardId", ",", "string", "$", "encryptCode", ",", "string", "$", "status", ")", "{", "$", "params", "=", "[", "'card_id'", "=>", "$", "cardId", ",", "'encrypt_code'", "=>", "$", "encryptCode", ",", "'re...
@param string $cardId @param string $encryptCode @param string $status @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException
[ "@param", "string", "$cardId", "@param", "string", "$encryptCode", "@param", "string", "$status" ]
120c72faaa93c270365bc75c73c362d5fd583209
https://github.com/overtrue/wechat/blob/120c72faaa93c270365bc75c73c362d5fd583209/src/Work/Invoice/Client.php#L66-L75
train
Update invoice status
[ 30522, 2270, 3853, 10651, 1006, 5164, 1002, 4003, 3593, 1010, 5164, 1002, 4372, 26775, 22571, 13535, 10244, 1010, 5164, 1002, 3570, 1007, 1063, 1002, 11498, 5244, 1027, 1031, 1005, 4003, 1035, 8909, 1005, 1027, 1028, 1002, 4003, 3593, 1010,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
laravel/framework
src/Illuminate/Routing/Router.php
Router.runRoute
protected function runRoute(Request $request, Route $route) { $request->setRouteResolver(function () use ($route) { return $route; }); $this->events->dispatch(new Events\RouteMatched($route, $request)); return $this->prepareResponse($request, $this->runRouteWithinStack($route, $request) ); }
php
protected function runRoute(Request $request, Route $route) { $request->setRouteResolver(function () use ($route) { return $route; }); $this->events->dispatch(new Events\RouteMatched($route, $request)); return $this->prepareResponse($request, $this->runRouteWithinStack($route, $request) ); }
[ "protected", "function", "runRoute", "(", "Request", "$", "request", ",", "Route", "$", "route", ")", "{", "$", "request", "->", "setRouteResolver", "(", "function", "(", ")", "use", "(", "$", "route", ")", "{", "return", "$", "route", ";", "}", ")", ...
Return the response for the given route. @param \Illuminate\Http\Request $request @param \Illuminate\Routing\Route $route @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse
[ "Return", "the", "response", "for", "the", "given", "route", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/Router.php#L648-L659
train
Runs the route and returns the response
[ 30522, 5123, 3853, 2448, 22494, 2618, 1006, 5227, 1002, 5227, 1010, 2799, 1002, 2799, 1007, 1063, 1002, 5227, 1011, 1028, 2275, 22494, 3334, 2229, 4747, 6299, 1006, 3853, 1006, 1007, 2224, 1006, 1002, 2799, 1007, 1063, 2709, 1002, 2799, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/Console/Helper/Table.php
Table.fillCells
private function fillCells($row) { $newRow = []; foreach ($row as $column => $cell) { $newRow[] = $cell; if ($cell instanceof TableCell && $cell->getColspan() > 1) { foreach (range($column + 1, $column + $cell->getColspan() - 1) as $position) { // insert empty value at column position $newRow[] = ''; } } } return $newRow ?: $row; }
php
private function fillCells($row) { $newRow = []; foreach ($row as $column => $cell) { $newRow[] = $cell; if ($cell instanceof TableCell && $cell->getColspan() > 1) { foreach (range($column + 1, $column + $cell->getColspan() - 1) as $position) { // insert empty value at column position $newRow[] = ''; } } } return $newRow ?: $row; }
[ "private", "function", "fillCells", "(", "$", "row", ")", "{", "$", "newRow", "=", "[", "]", ";", "foreach", "(", "$", "row", "as", "$", "column", "=>", "$", "cell", ")", "{", "$", "newRow", "[", "]", "=", "$", "cell", ";", "if", "(", "$", "c...
fill cells for a row that contains colspan > 1.
[ "fill", "cells", "for", "a", "row", "that", "contains", "colspan", ">", "1", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Helper/Table.php#L635-L649
train
Fill cells in row
[ 30522, 2797, 3853, 6039, 29109, 4877, 1006, 1002, 5216, 1007, 1063, 1002, 2047, 10524, 1027, 1031, 1033, 1025, 18921, 6776, 1006, 1002, 5216, 2004, 1002, 5930, 1027, 1028, 1002, 3526, 1007, 1063, 1002, 2047, 10524, 1031, 1033, 1027, 1002, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
core/Tracker/RequestSet.php
RequestSet.shouldPerformRedirectToUrl
public function shouldPerformRedirectToUrl() { if (!$this->hasRedirectUrl()) { return false; } if (!$this->hasRequests()) { return false; } $redirectUrl = $this->getRedirectUrl(); $host = Url::getHostFromUrl($redirectUrl); if (empty($host)) { return false; } $urls = new SiteUrls(); $siteUrls = $urls->getAllCachedSiteUrls(); $siteIds = $this->getAllSiteIdsWithinRequest(); foreach ($siteIds as $siteId) { if (empty($siteUrls[$siteId])) { $siteUrls[$siteId] = array(); } if (Url::isHostInUrls($host, $siteUrls[$siteId])) { return $redirectUrl; } } return false; }
php
public function shouldPerformRedirectToUrl() { if (!$this->hasRedirectUrl()) { return false; } if (!$this->hasRequests()) { return false; } $redirectUrl = $this->getRedirectUrl(); $host = Url::getHostFromUrl($redirectUrl); if (empty($host)) { return false; } $urls = new SiteUrls(); $siteUrls = $urls->getAllCachedSiteUrls(); $siteIds = $this->getAllSiteIdsWithinRequest(); foreach ($siteIds as $siteId) { if (empty($siteUrls[$siteId])) { $siteUrls[$siteId] = array(); } if (Url::isHostInUrls($host, $siteUrls[$siteId])) { return $redirectUrl; } } return false; }
[ "public", "function", "shouldPerformRedirectToUrl", "(", ")", "{", "if", "(", "!", "$", "this", "->", "hasRedirectUrl", "(", ")", ")", "{", "return", "false", ";", "}", "if", "(", "!", "$", "this", "->", "hasRequests", "(", ")", ")", "{", "return", "...
TODO maybe move to response? or somewhere else? not sure where!
[ "TODO", "maybe", "move", "to", "response?", "or", "somewhere", "else?", "not", "sure", "where!" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/RequestSet.php#L149-L181
train
Returns the redirect url if the request should be redirected to the same host as the redirect url if it is in the site list
[ 30522, 2270, 3853, 2323, 4842, 14192, 5596, 7442, 6593, 21163, 2140, 1006, 1007, 1063, 2065, 1006, 999, 1002, 2023, 1011, 1028, 2038, 5596, 7442, 6593, 3126, 2140, 1006, 1007, 1007, 1063, 2709, 6270, 1025, 1065, 2065, 1006, 999, 1002, 202...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
dompdf/dompdf
src/Css/AttributeTranslator.php
AttributeTranslator._set_font_size
static protected function _set_font_size(\DOMElement $node, $value) { $style = $node->getAttribute(self::$_style_attr); if ($value[0] === "-" || $value[0] === "+") { $value = self::$_last_basefont_size + (int)$value; } if (isset(self::$_font_size_lookup[$value])) { $style .= "; font-size: " . self::$_font_size_lookup[$value] . ";"; } else { $style .= "; font-size: $value;"; } return ltrim($style, "; "); }
php
static protected function _set_font_size(\DOMElement $node, $value) { $style = $node->getAttribute(self::$_style_attr); if ($value[0] === "-" || $value[0] === "+") { $value = self::$_last_basefont_size + (int)$value; } if (isset(self::$_font_size_lookup[$value])) { $style .= "; font-size: " . self::$_font_size_lookup[$value] . ";"; } else { $style .= "; font-size: $value;"; } return ltrim($style, "; "); }
[ "static", "protected", "function", "_set_font_size", "(", "\\", "DOMElement", "$", "node", ",", "$", "value", ")", "{", "$", "style", "=", "$", "node", "->", "getAttribute", "(", "self", "::", "$", "_style_attr", ")", ";", "if", "(", "$", "value", "[",...
@param \DOMElement $node @param string $value @return string
[ "@param", "\\", "DOMElement", "$node", "@param", "string", "$value" ]
75f13c700009be21a1965dc2c5b68a8708c22ba2
https://github.com/dompdf/dompdf/blob/75f13c700009be21a1965dc2c5b68a8708c22ba2/src/Css/AttributeTranslator.php#L623-L638
train
Set the font size
[ 30522, 10763, 5123, 3853, 1035, 2275, 1035, 15489, 1035, 2946, 1006, 1032, 8514, 16930, 4765, 1002, 13045, 1010, 1002, 3643, 1007, 1063, 1002, 2806, 1027, 1002, 13045, 1011, 1028, 2131, 19321, 3089, 8569, 2618, 1006, 2969, 1024, 1024, 1002,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
laravel/framework
src/Illuminate/Validation/Validator.php
Validator.addFailure
public function addFailure($attribute, $rule, $parameters = []) { if (! $this->messages) { $this->passes(); } $this->messages->add($attribute, $this->makeReplacements( $this->getMessage($attribute, $rule), $attribute, $rule, $parameters )); $this->failedRules[$attribute][$rule] = $parameters; }
php
public function addFailure($attribute, $rule, $parameters = []) { if (! $this->messages) { $this->passes(); } $this->messages->add($attribute, $this->makeReplacements( $this->getMessage($attribute, $rule), $attribute, $rule, $parameters )); $this->failedRules[$attribute][$rule] = $parameters; }
[ "public", "function", "addFailure", "(", "$", "attribute", ",", "$", "rule", ",", "$", "parameters", "=", "[", "]", ")", "{", "if", "(", "!", "$", "this", "->", "messages", ")", "{", "$", "this", "->", "passes", "(", ")", ";", "}", "$", "this", ...
Add a failed rule and error message to the collection. @param string $attribute @param string $rule @param array $parameters @return void
[ "Add", "a", "failed", "rule", "and", "error", "message", "to", "the", "collection", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Validation/Validator.php#L618-L629
train
Add a failure to the list of failed rules.
[ 30522, 2270, 3853, 5587, 7011, 4014, 5397, 1006, 1002, 17961, 1010, 1002, 3627, 1010, 1002, 11709, 1027, 1031, 1033, 1007, 1063, 2065, 1006, 999, 1002, 2023, 1011, 1028, 7696, 1007, 1063, 1002, 2023, 1011, 1028, 5235, 1006, 1007, 1025, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/BrowserKit/Client.php
Client.back
public function back() { do { $request = $this->history->back(); } while (\array_key_exists(serialize($request), $this->redirects)); return $this->requestFromRequest($request, false); }
php
public function back() { do { $request = $this->history->back(); } while (\array_key_exists(serialize($request), $this->redirects)); return $this->requestFromRequest($request, false); }
[ "public", "function", "back", "(", ")", "{", "do", "{", "$", "request", "=", "$", "this", "->", "history", "->", "back", "(", ")", ";", "}", "while", "(", "\\", "array_key_exists", "(", "serialize", "(", "$", "request", ")", ",", "$", "this", "->",...
Goes back in the browser history. @return Crawler
[ "Goes", "back", "in", "the", "browser", "history", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/BrowserKit/Client.php#L549-L556
train
Back to the next redirect
[ 30522, 2270, 3853, 2067, 1006, 1007, 1063, 2079, 1063, 1002, 5227, 1027, 1002, 2023, 1011, 1028, 2381, 1011, 1028, 2067, 1006, 1007, 1025, 1065, 2096, 1006, 1032, 9140, 1035, 3145, 1035, 6526, 1006, 7642, 4697, 1006, 1002, 5227, 1007, 101...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
z-song/laravel-admin
src/Console/ExportSeedCommand.php
ExportSeedCommand.varExport
protected function varExport($var, $indent = '') { switch (gettype($var)) { case 'string': return '"'.addcslashes($var, "\\\$\"\r\n\t\v\f").'"'; case 'array': $indexed = array_keys($var) === range(0, count($var) - 1); $r = []; foreach ($var as $key => $value) { $r[] = "$indent " .($indexed ? '' : $this->varExport($key).' => ') .$this->varExport($value, "{$indent} "); } return "[\n".implode(",\n", $r)."\n".$indent.']'; case 'boolean': return $var ? 'true' : 'false'; case 'integer': case 'double': return $var; default: return var_export($var, true); } }
php
protected function varExport($var, $indent = '') { switch (gettype($var)) { case 'string': return '"'.addcslashes($var, "\\\$\"\r\n\t\v\f").'"'; case 'array': $indexed = array_keys($var) === range(0, count($var) - 1); $r = []; foreach ($var as $key => $value) { $r[] = "$indent " .($indexed ? '' : $this->varExport($key).' => ') .$this->varExport($value, "{$indent} "); } return "[\n".implode(",\n", $r)."\n".$indent.']'; case 'boolean': return $var ? 'true' : 'false'; case 'integer': case 'double': return $var; default: return var_export($var, true); } }
[ "protected", "function", "varExport", "(", "$", "var", ",", "$", "indent", "=", "''", ")", "{", "switch", "(", "gettype", "(", "$", "var", ")", ")", "{", "case", "'string'", ":", "return", "'\"'", ".", "addcslashes", "(", "$", "var", ",", "\"\\\\\\$\...
Custom var_export for correct work with \r\n. @param $var @param string $indent @return string
[ "Custom", "var_export", "for", "correct", "work", "with", "\\", "r", "\\", "n", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Console/ExportSeedCommand.php#L119-L149
train
Exports a variable to the output format
[ 30522, 5123, 3853, 13075, 10288, 6442, 1006, 1002, 13075, 1010, 1002, 27427, 4765, 1027, 1005, 1005, 1007, 1063, 6942, 1006, 2131, 13874, 1006, 1002, 13075, 1007, 1007, 1063, 2553, 1005, 5164, 1005, 1024, 2709, 1005, 1000, 1005, 1012, 5587,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
core/Development.php
Development.isCallableMethod
public static function isCallableMethod($classOrObject, $method) { if (!self::methodExists($classOrObject, $method)) { return false; } $reflection = new \ReflectionMethod($classOrObject, $method); return $reflection->isPublic(); }
php
public static function isCallableMethod($classOrObject, $method) { if (!self::methodExists($classOrObject, $method)) { return false; } $reflection = new \ReflectionMethod($classOrObject, $method); return $reflection->isPublic(); }
[ "public", "static", "function", "isCallableMethod", "(", "$", "classOrObject", ",", "$", "method", ")", "{", "if", "(", "!", "self", "::", "methodExists", "(", "$", "classOrObject", ",", "$", "method", ")", ")", "{", "return", "false", ";", "}", "$", "...
Verify whether the given method actually exists and is callable (public). @param string|object $classOrObject @param string $method @return bool
[ "Verify", "whether", "the", "given", "method", "actually", "exists", "and", "is", "callable", "(", "public", ")", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Development.php#L129-L137
train
Checks if a method is public
[ 30522, 2270, 10763, 3853, 2003, 9289, 20470, 16930, 11031, 7716, 1006, 1002, 2465, 14604, 2497, 20614, 1010, 1002, 4118, 1007, 1063, 2065, 1006, 999, 2969, 1024, 1024, 4118, 10288, 5130, 1006, 1002, 2465, 14604, 2497, 20614, 1010, 1002, 411...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
core/ErrorHandler.php
ErrorHandler.pushFatalErrorBreadcrumb
public static function pushFatalErrorBreadcrumb($className = null, $importantArgs = null) { $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, $limit = 2); $backtrace[1]['class'] = $className; // knowing the derived class name is far more useful $backtrace[1]['args'] = empty($importantArgs) ? [] : array_map('json_encode', $importantArgs); array_unshift(self::$fatalErrorStackTrace, $backtrace[1]); }
php
public static function pushFatalErrorBreadcrumb($className = null, $importantArgs = null) { $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, $limit = 2); $backtrace[1]['class'] = $className; // knowing the derived class name is far more useful $backtrace[1]['args'] = empty($importantArgs) ? [] : array_map('json_encode', $importantArgs); array_unshift(self::$fatalErrorStackTrace, $backtrace[1]); }
[ "public", "static", "function", "pushFatalErrorBreadcrumb", "(", "$", "className", "=", "null", ",", "$", "importantArgs", "=", "null", ")", "{", "$", "backtrace", "=", "debug_backtrace", "(", "DEBUG_BACKTRACE_IGNORE_ARGS", ",", "$", "limit", "=", "2", ")", ";...
Fatal errors in PHP do not leave behind backtraces, which can make it impossible to determine the exact cause of one. We can, however, save a partial stack trace by remembering certain execution points. This method and popFatalErrorBreadcrumb() are used for that purpose. To use this method, surround a function call w/ pushFatalErrorBreadcrumb() & popFatalErrorBreadcrumb() like so: public function theMethodIWantToAppearInFatalErrorStackTraces() { try { ErrorHandler::pushFatalErrorBreadcrumb(static::class); // ... } finally { ErrorHandler::popFatalErrorBreadcrumb(); } } If a fatal error occurs, theMethodIWantToAppearInFatalErrorStackTraces will appear in the stack trace, if PIWIK_PRINT_ERROR_BACKTRACE is true.
[ "Fatal", "errors", "in", "PHP", "do", "not", "leave", "behind", "backtraces", "which", "can", "make", "it", "impossible", "to", "determine", "the", "exact", "cause", "of", "one", ".", "We", "can", "however", "save", "a", "partial", "stack", "trace", "by", ...
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/ErrorHandler.php#L44-L50
train
Push the backtrace to the front of the stack trace
[ 30522, 2270, 10763, 3853, 5245, 27753, 9453, 18933, 15185, 16416, 16409, 6824, 2497, 1006, 1002, 2465, 18442, 1027, 19701, 1010, 1002, 2590, 2906, 5620, 1027, 19701, 1007, 1063, 1002, 2067, 6494, 3401, 1027, 2139, 8569, 2290, 1035, 2067, 64...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
laravel/framework
src/Illuminate/Database/Query/Builder.php
Builder.orWhereColumn
public function orWhereColumn($first, $operator = null, $second = null) { return $this->whereColumn($first, $operator, $second, 'or'); }
php
public function orWhereColumn($first, $operator = null, $second = null) { return $this->whereColumn($first, $operator, $second, 'or'); }
[ "public", "function", "orWhereColumn", "(", "$", "first", ",", "$", "operator", "=", "null", ",", "$", "second", "=", "null", ")", "{", "return", "$", "this", "->", "whereColumn", "(", "$", "first", ",", "$", "operator", ",", "$", "second", ",", "'or...
Add an "or where" clause comparing two columns to the query. @param string|array $first @param string|null $operator @param string|null $second @return \Illuminate\Database\Query\Builder|static
[ "Add", "an", "or", "where", "clause", "comparing", "two", "columns", "to", "the", "query", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Query/Builder.php#L798-L801
train
or where column
[ 30522, 2270, 3853, 2030, 2860, 5886, 8586, 4747, 2819, 2078, 1006, 1002, 2034, 1010, 1002, 6872, 1027, 19701, 1010, 1002, 2117, 1027, 19701, 1007, 1063, 2709, 1002, 2023, 1011, 1028, 2073, 25778, 2819, 2078, 1006, 1002, 2034, 1010, 1002, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
plugins/LanguagesManager/TranslationWriter/Filter/EncodedEntities.php
EncodedEntities.filter
public function filter($translations) { foreach ($translations as $pluginName => $pluginTranslations) { foreach ($pluginTranslations as $key => $translation) { if (isset($this->baseTranslations[$pluginName][$key]) && $this->baseTranslations[$pluginName][$key] != Translate::clean($this->baseTranslations[$pluginName][$key])) { continue; // skip if base translation already contains encoded entities } // remove encoded entities $decoded = Translate::clean($translation); if ($translation != $decoded) { $this->filteredData[$pluginName][$key] = $translation; $translations[$pluginName][$key] = $decoded; continue; } } } return $translations; }
php
public function filter($translations) { foreach ($translations as $pluginName => $pluginTranslations) { foreach ($pluginTranslations as $key => $translation) { if (isset($this->baseTranslations[$pluginName][$key]) && $this->baseTranslations[$pluginName][$key] != Translate::clean($this->baseTranslations[$pluginName][$key])) { continue; // skip if base translation already contains encoded entities } // remove encoded entities $decoded = Translate::clean($translation); if ($translation != $decoded) { $this->filteredData[$pluginName][$key] = $translation; $translations[$pluginName][$key] = $decoded; continue; } } } return $translations; }
[ "public", "function", "filter", "(", "$", "translations", ")", "{", "foreach", "(", "$", "translations", "as", "$", "pluginName", "=>", "$", "pluginTranslations", ")", "{", "foreach", "(", "$", "pluginTranslations", "as", "$", "key", "=>", "$", "translation"...
Decodes all encoded entities in the given translations @param array $translations @return array filtered translations
[ "Decodes", "all", "encoded", "entities", "in", "the", "given", "translations" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/LanguagesManager/TranslationWriter/Filter/EncodedEntities.php#L35-L57
train
Filter translations to base entities
[ 30522, 2270, 3853, 11307, 1006, 1002, 11913, 1007, 1063, 18921, 6776, 1006, 1002, 11913, 2004, 1002, 13354, 23111, 14074, 1027, 1028, 1002, 13354, 18447, 5521, 14540, 10708, 1007, 1063, 18921, 6776, 1006, 1002, 13354, 18447, 5521, 14540, 1070...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
laravel/framework
src/Illuminate/Filesystem/FilesystemAdapter.php
FilesystemAdapter.setVisibility
public function setVisibility($path, $visibility) { return $this->driver->setVisibility($path, $this->parseVisibility($visibility)); }
php
public function setVisibility($path, $visibility) { return $this->driver->setVisibility($path, $this->parseVisibility($visibility)); }
[ "public", "function", "setVisibility", "(", "$", "path", ",", "$", "visibility", ")", "{", "return", "$", "this", "->", "driver", "->", "setVisibility", "(", "$", "path", ",", "$", "this", "->", "parseVisibility", "(", "$", "visibility", ")", ")", ";", ...
Set the visibility for the given path. @param string $path @param string $visibility @return bool
[ "Set", "the", "visibility", "for", "the", "given", "path", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Filesystem/FilesystemAdapter.php#L260-L263
train
Set visibility of a file or directory
[ 30522, 2270, 3853, 2275, 11365, 13464, 1006, 1002, 4130, 1010, 1002, 16476, 1007, 1063, 2709, 1002, 2023, 1011, 1028, 4062, 1011, 1028, 2275, 11365, 13464, 1006, 1002, 4130, 1010, 1002, 2023, 1011, 1028, 11968, 3366, 11365, 13464, 1006, 100...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/HttpFoundation/File/UploadedFile.php
UploadedFile.getErrorMessage
public function getErrorMessage() { static $errors = [ UPLOAD_ERR_INI_SIZE => 'The file "%s" exceeds your upload_max_filesize ini directive (limit is %d KiB).', UPLOAD_ERR_FORM_SIZE => 'The file "%s" exceeds the upload limit defined in your form.', UPLOAD_ERR_PARTIAL => 'The file "%s" was only partially uploaded.', UPLOAD_ERR_NO_FILE => 'No file was uploaded.', UPLOAD_ERR_CANT_WRITE => 'The file "%s" could not be written on disk.', UPLOAD_ERR_NO_TMP_DIR => 'File could not be uploaded: missing temporary directory.', UPLOAD_ERR_EXTENSION => 'File upload was stopped by a PHP extension.', ]; $errorCode = $this->error; $maxFilesize = UPLOAD_ERR_INI_SIZE === $errorCode ? self::getMaxFilesize() / 1024 : 0; $message = isset($errors[$errorCode]) ? $errors[$errorCode] : 'The file "%s" was not uploaded due to an unknown error.'; return sprintf($message, $this->getClientOriginalName(), $maxFilesize); }
php
public function getErrorMessage() { static $errors = [ UPLOAD_ERR_INI_SIZE => 'The file "%s" exceeds your upload_max_filesize ini directive (limit is %d KiB).', UPLOAD_ERR_FORM_SIZE => 'The file "%s" exceeds the upload limit defined in your form.', UPLOAD_ERR_PARTIAL => 'The file "%s" was only partially uploaded.', UPLOAD_ERR_NO_FILE => 'No file was uploaded.', UPLOAD_ERR_CANT_WRITE => 'The file "%s" could not be written on disk.', UPLOAD_ERR_NO_TMP_DIR => 'File could not be uploaded: missing temporary directory.', UPLOAD_ERR_EXTENSION => 'File upload was stopped by a PHP extension.', ]; $errorCode = $this->error; $maxFilesize = UPLOAD_ERR_INI_SIZE === $errorCode ? self::getMaxFilesize() / 1024 : 0; $message = isset($errors[$errorCode]) ? $errors[$errorCode] : 'The file "%s" was not uploaded due to an unknown error.'; return sprintf($message, $this->getClientOriginalName(), $maxFilesize); }
[ "public", "function", "getErrorMessage", "(", ")", "{", "static", "$", "errors", "=", "[", "UPLOAD_ERR_INI_SIZE", "=>", "'The file \"%s\" exceeds your upload_max_filesize ini directive (limit is %d KiB).'", ",", "UPLOAD_ERR_FORM_SIZE", "=>", "'The file \"%s\" exceeds the upload lim...
Returns an informative upload error message. @return string The error message regarding the specified error code
[ "Returns", "an", "informative", "upload", "error", "message", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpFoundation/File/UploadedFile.php#L279-L296
train
Returns the error message
[ 30522, 2270, 3853, 2131, 2121, 29165, 7834, 3736, 3351, 1006, 1007, 1063, 10763, 1002, 10697, 1027, 1031, 2039, 11066, 1035, 9413, 2099, 1035, 1999, 2072, 1035, 2946, 1027, 1028, 1005, 1996, 5371, 1000, 1003, 1055, 1000, 23651, 2115, 2039, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/HttpKernel/HttpCache/Esi.php
Esi.addSurrogateControl
public function addSurrogateControl(Response $response) { if (false !== strpos($response->getContent(), '<esi:include')) { $response->headers->set('Surrogate-Control', 'content="ESI/1.0"'); } }
php
public function addSurrogateControl(Response $response) { if (false !== strpos($response->getContent(), '<esi:include')) { $response->headers->set('Surrogate-Control', 'content="ESI/1.0"'); } }
[ "public", "function", "addSurrogateControl", "(", "Response", "$", "response", ")", "{", "if", "(", "false", "!==", "strpos", "(", "$", "response", "->", "getContent", "(", ")", ",", "'<esi:include'", ")", ")", "{", "$", "response", "->", "headers", "->", ...
{@inheritdoc}
[ "{" ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/HttpCache/Esi.php#L38-L43
train
Add Surrogate - Control header if ESI includes
[ 30522, 2270, 3853, 9909, 3126, 21799, 8663, 13181, 2140, 1006, 3433, 1002, 3433, 1007, 1063, 2065, 1006, 6270, 999, 1027, 1027, 2358, 14536, 2891, 1006, 1002, 3433, 1011, 1028, 2131, 8663, 6528, 2102, 1006, 1007, 1010, 1005, 1026, 9686, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/HttpFoundation/AcceptHeader.php
AcceptHeader.add
public function add(AcceptHeaderItem $item) { $this->items[$item->getValue()] = $item; $this->sorted = false; return $this; }
php
public function add(AcceptHeaderItem $item) { $this->items[$item->getValue()] = $item; $this->sorted = false; return $this; }
[ "public", "function", "add", "(", "AcceptHeaderItem", "$", "item", ")", "{", "$", "this", "->", "items", "[", "$", "item", "->", "getValue", "(", ")", "]", "=", "$", "item", ";", "$", "this", "->", "sorted", "=", "false", ";", "return", "$", "this"...
Adds an item. @return $this
[ "Adds", "an", "item", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpFoundation/AcceptHeader.php#L107-L113
train
Add accept header item
[ 30522, 2270, 3853, 5587, 1006, 5138, 4974, 11124, 18532, 1002, 8875, 1007, 1063, 1002, 2023, 1011, 1028, 5167, 1031, 1002, 8875, 1011, 1028, 2131, 10175, 5657, 1006, 1007, 1033, 1027, 1002, 8875, 1025, 1002, 2023, 1011, 1028, 19616, 1027, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
libs/Zend/Session/Exception.php
Zend_Session_Exception.handleSessionStartError
static public function handleSessionStartError($errno, $errstr, $errfile, $errline, $errcontext) { self::$sessionStartError = $errfile . '(Line:' . $errline . '): Error #' . $errno . ' ' . $errstr; }
php
static public function handleSessionStartError($errno, $errstr, $errfile, $errline, $errcontext) { self::$sessionStartError = $errfile . '(Line:' . $errline . '): Error #' . $errno . ' ' . $errstr; }
[ "static", "public", "function", "handleSessionStartError", "(", "$", "errno", ",", "$", "errstr", ",", "$", "errfile", ",", "$", "errline", ",", "$", "errcontext", ")", "{", "self", "::", "$", "sessionStartError", "=", "$", "errfile", ".", "'(Line:'", ".",...
handleSessionStartError() - interface for set_error_handler() @see http://framework.zend.com/issues/browse/ZF-1325 @param int $errno @param string $errstr @return void
[ "handleSessionStartError", "()", "-", "interface", "for", "set_error_handler", "()" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Session/Exception.php#L56-L59
train
Handle session start error
[ 30522, 10763, 2270, 3853, 16024, 7971, 8496, 7559, 3334, 29165, 1006, 1002, 9413, 19139, 1010, 1002, 9413, 12096, 2099, 1010, 1002, 9413, 12881, 9463, 1010, 1002, 9413, 19403, 2063, 1010, 1002, 9413, 30524, 12881, 9463, 1012, 1005, 1006, 22...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
laravel/framework
src/Illuminate/View/ViewServiceProvider.php
ViewServiceProvider.registerBladeEngine
public function registerBladeEngine($resolver) { // The Compiler engine requires an instance of the CompilerInterface, which in // this case will be the Blade compiler, so we'll first create the compiler // instance to pass into the engine so it can compile the views properly. $this->app->singleton('blade.compiler', function () { return new BladeCompiler( $this->app['files'], $this->app['config']['view.compiled'] ); }); $resolver->register('blade', function () { return new CompilerEngine($this->app['blade.compiler']); }); }
php
public function registerBladeEngine($resolver) { // The Compiler engine requires an instance of the CompilerInterface, which in // this case will be the Blade compiler, so we'll first create the compiler // instance to pass into the engine so it can compile the views properly. $this->app->singleton('blade.compiler', function () { return new BladeCompiler( $this->app['files'], $this->app['config']['view.compiled'] ); }); $resolver->register('blade', function () { return new CompilerEngine($this->app['blade.compiler']); }); }
[ "public", "function", "registerBladeEngine", "(", "$", "resolver", ")", "{", "// The Compiler engine requires an instance of the CompilerInterface, which in", "// this case will be the Blade compiler, so we'll first create the compiler", "// instance to pass into the engine so it can compile the...
Register the Blade engine implementation. @param \Illuminate\View\Engines\EngineResolver $resolver @return void
[ "Register", "the", "Blade", "engine", "implementation", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/View/ViewServiceProvider.php#L134-L148
train
Register the Compiler Engine
[ 30522, 2270, 3853, 4236, 28522, 26095, 3070, 3170, 1006, 1002, 10663, 2099, 1007, 1063, 1013, 1013, 1996, 21624, 3194, 5942, 2019, 6013, 1997, 1996, 21624, 18447, 2121, 12172, 1010, 2029, 1999, 1013, 1013, 2023, 2553, 2097, 2022, 1996, 6085...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
octobercms/october
modules/cms/models/ThemeData.php
ThemeData.getCombinerCacheKey
public static function getCombinerCacheKey() { $theme = CmsTheme::getActiveTheme(); if (!$theme->hasCustomData()) { return ''; } $customData = $theme->getCustomData(); return (string) $customData->updated_at ?: ''; }
php
public static function getCombinerCacheKey() { $theme = CmsTheme::getActiveTheme(); if (!$theme->hasCustomData()) { return ''; } $customData = $theme->getCustomData(); return (string) $customData->updated_at ?: ''; }
[ "public", "static", "function", "getCombinerCacheKey", "(", ")", "{", "$", "theme", "=", "CmsTheme", "::", "getActiveTheme", "(", ")", ";", "if", "(", "!", "$", "theme", "->", "hasCustomData", "(", ")", ")", "{", "return", "''", ";", "}", "$", "customD...
Generate a cache key for the combiner, this allows variables to bust the cache. @return string
[ "Generate", "a", "cache", "key", "for", "the", "combiner", "this", "allows", "variables", "to", "bust", "the", "cache", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/models/ThemeData.php#L251-L261
train
Returns the combiner cache key.
[ 30522, 2270, 10763, 3853, 2131, 18274, 26455, 3540, 5403, 14839, 1006, 1007, 1063, 1002, 4323, 1027, 4642, 3367, 29122, 2063, 1024, 1024, 2131, 19620, 10760, 4168, 1006, 1007, 1025, 2065, 1006, 999, 1002, 4323, 1011, 1028, 2038, 7874, 20389...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/Console/Application.php
Application.getDefinition
public function getDefinition() { if (!$this->definition) { $this->definition = $this->getDefaultInputDefinition(); } if ($this->singleCommand) { $inputDefinition = $this->definition; $inputDefinition->setArguments(); return $inputDefinition; } return $this->definition; }
php
public function getDefinition() { if (!$this->definition) { $this->definition = $this->getDefaultInputDefinition(); } if ($this->singleCommand) { $inputDefinition = $this->definition; $inputDefinition->setArguments(); return $inputDefinition; } return $this->definition; }
[ "public", "function", "getDefinition", "(", ")", "{", "if", "(", "!", "$", "this", "->", "definition", ")", "{", "$", "this", "->", "definition", "=", "$", "this", "->", "getDefaultInputDefinition", "(", ")", ";", "}", "if", "(", "$", "this", "->", "...
Gets the InputDefinition related to this Application. @return InputDefinition The InputDefinition instance
[ "Gets", "the", "InputDefinition", "related", "to", "this", "Application", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Application.php#L308-L322
train
Get the definition of the input
[ 30522, 2270, 3853, 2131, 3207, 16294, 22753, 1006, 1007, 1063, 2065, 1006, 999, 1002, 2023, 1011, 1028, 6210, 1007, 1063, 1002, 2023, 1011, 1028, 6210, 1027, 1002, 2023, 1011, 1028, 2131, 3207, 7011, 11314, 30524, 2386, 2094, 1007, 1063, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
z-song/laravel-admin
src/Grid/Concerns/HasFilter.php
HasFilter.processFilter
public function processFilter($toArray = true) { if ($this->builder) { call_user_func($this->builder, $this); } return $this->filter->execute($toArray); }
php
public function processFilter($toArray = true) { if ($this->builder) { call_user_func($this->builder, $this); } return $this->filter->execute($toArray); }
[ "public", "function", "processFilter", "(", "$", "toArray", "=", "true", ")", "{", "if", "(", "$", "this", "->", "builder", ")", "{", "call_user_func", "(", "$", "this", "->", "builder", ",", "$", "this", ")", ";", "}", "return", "$", "this", "->", ...
Process the grid filter. @param bool $toArray @return array|Collection|mixed
[ "Process", "the", "grid", "filter", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Concerns/HasFilter.php#L57-L64
train
Process the filter and return the result
[ 30522, 2270, 3853, 2832, 8873, 21928, 1006, 1002, 2000, 2906, 9447, 1027, 2995, 1007, 1063, 2065, 1006, 1002, 2023, 1011, 1028, 12508, 1007, 1063, 2655, 1035, 5310, 1035, 4569, 2278, 1006, 1002, 2023, 1011, 1028, 12508, 1010, 1002, 2023, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
php-ai/php-ml
src/Helper/Optimizer/ConjugateGradient.php
ConjugateGradient.getBeta
protected function getBeta(array $newTheta): float { $gNew = $this->gradient($newTheta); $gOld = $this->gradient($this->theta); $dNew = 0; $dOld = 1e-100; for ($i = 0; $i <= $this->dimensions; ++$i) { $dNew += $gNew[$i] ** 2; $dOld += $gOld[$i] ** 2; } return $dNew / $dOld; }
php
protected function getBeta(array $newTheta): float { $gNew = $this->gradient($newTheta); $gOld = $this->gradient($this->theta); $dNew = 0; $dOld = 1e-100; for ($i = 0; $i <= $this->dimensions; ++$i) { $dNew += $gNew[$i] ** 2; $dOld += $gOld[$i] ** 2; } return $dNew / $dOld; }
[ "protected", "function", "getBeta", "(", "array", "$", "newTheta", ")", ":", "float", "{", "$", "gNew", "=", "$", "this", "->", "gradient", "(", "$", "newTheta", ")", ";", "$", "gOld", "=", "$", "this", "->", "gradient", "(", "$", "this", "->", "th...
Calculates new beta (β) for given set of solutions by using Fletcher–Reeves method. β = ||f(x(k+1))||² ∕ ||f(x(k))||² See: R. Fletcher and C. M. Reeves, "Function minimization by conjugate gradients", Comput. J. 7 (1964), 149–154.
[ "Calculates", "new", "beta", "(", "β", ")", "for", "given", "set", "of", "solutions", "by", "using", "Fletcher–Reeves", "method", "." ]
f6aa1a59b0525b8fca3d2786d661ab3e70904016
https://github.com/php-ai/php-ml/blob/f6aa1a59b0525b8fca3d2786d661ab3e70904016/src/Helper/Optimizer/ConjugateGradient.php#L178-L190
train
Return the Beta of the gradient of the new theta
[ 30522, 5123, 3853, 2131, 20915, 2050, 1006, 9140, 1002, 25597, 27065, 2050, 1007, 1024, 14257, 1063, 1002, 1043, 2638, 2860, 1027, 1002, 2023, 1011, 1028, 17978, 1006, 1002, 25597, 27065, 2050, 1007, 1025, 1002, 2751, 1027, 1002, 2023, 1011...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/Asset/UrlPackage.php
UrlPackage.getBaseUrl
public function getBaseUrl($path) { if (1 === \count($this->baseUrls)) { return $this->baseUrls[0]; } return $this->baseUrls[$this->chooseBaseUrl($path)]; }
php
public function getBaseUrl($path) { if (1 === \count($this->baseUrls)) { return $this->baseUrls[0]; } return $this->baseUrls[$this->chooseBaseUrl($path)]; }
[ "public", "function", "getBaseUrl", "(", "$", "path", ")", "{", "if", "(", "1", "===", "\\", "count", "(", "$", "this", "->", "baseUrls", ")", ")", "{", "return", "$", "this", "->", "baseUrls", "[", "0", "]", ";", "}", "return", "$", "this", "->"...
Returns the base URL for a path. @param string $path @return string The base URL
[ "Returns", "the", "base", "URL", "for", "a", "path", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Asset/UrlPackage.php#L102-L109
train
Get Base Url
[ 30522, 2270, 3853, 2131, 15058, 3126, 2140, 1006, 1002, 4130, 1007, 1063, 2065, 1006, 1015, 1027, 1027, 1027, 1032, 4175, 1006, 1002, 2023, 1011, 1028, 2918, 3126, 4877, 1007, 1007, 1063, 2709, 1002, 2023, 1011, 1028, 2918, 3126, 4877, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/HttpFoundation/Session/Storage/Handler/RedisSessionHandler.php
RedisSessionHandler.doWrite
protected function doWrite($sessionId, $data): bool { $result = $this->redis->setEx($this->prefix.$sessionId, (int) ini_get('session.gc_maxlifetime'), $data); return $result && !$result instanceof ErrorInterface; }
php
protected function doWrite($sessionId, $data): bool { $result = $this->redis->setEx($this->prefix.$sessionId, (int) ini_get('session.gc_maxlifetime'), $data); return $result && !$result instanceof ErrorInterface; }
[ "protected", "function", "doWrite", "(", "$", "sessionId", ",", "$", "data", ")", ":", "bool", "{", "$", "result", "=", "$", "this", "->", "redis", "->", "setEx", "(", "$", "this", "->", "prefix", ".", "$", "sessionId", ",", "(", "int", ")", "ini_g...
{@inheritdoc}
[ "{" ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/RedisSessionHandler.php#L74-L79
train
Write session data to redis
[ 30522, 5123, 3853, 23268, 17625, 1006, 1002, 5219, 3593, 1010, 1002, 2951, 1007, 1024, 22017, 2140, 1063, 1002, 2765, 1027, 1002, 2023, 1011, 1028, 2417, 2483, 1011, 1028, 2275, 10288, 1006, 1002, 2023, 1011, 1028, 17576, 1012, 1002, 5219, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
plugins/Referrers/Social.php
Social.isSocialUrl
public function isSocialUrl($url, $socialName = false) { foreach ($this->getDefinitions() as $domain => $name) { if (preg_match('/(^|[\.\/])'.$domain.'([\.\/]|$)/', $url) && ($socialName === false || $name == $socialName)) { return true; } } return false; }
php
public function isSocialUrl($url, $socialName = false) { foreach ($this->getDefinitions() as $domain => $name) { if (preg_match('/(^|[\.\/])'.$domain.'([\.\/]|$)/', $url) && ($socialName === false || $name == $socialName)) { return true; } } return false; }
[ "public", "function", "isSocialUrl", "(", "$", "url", ",", "$", "socialName", "=", "false", ")", "{", "foreach", "(", "$", "this", "->", "getDefinitions", "(", ")", "as", "$", "domain", "=>", "$", "name", ")", "{", "if", "(", "preg_match", "(", "'/(^...
Returns true if a URL belongs to a social network, false if otherwise. @param string $url The URL to check. @param string|bool $socialName The social network's name to check for, or false to check for any. @return bool
[ "Returns", "true", "if", "a", "URL", "belongs", "to", "a", "social", "network", "false", "if", "otherwise", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Referrers/Social.php#L107-L118
train
Check if a given URL is a social url
[ 30522, 2270, 3853, 26354, 10085, 4818, 3126, 2140, 1006, 1002, 24471, 2140, 1010, 1002, 2591, 18442, 1027, 6270, 1007, 1063, 18921, 6776, 1006, 1002, 2023, 1011, 1028, 2131, 3207, 16294, 22753, 2015, 1006, 1007, 2004, 1002, 5884, 1027, 1028...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
core/Plugin/Controller.php
Controller.setMinDateView
protected function setMinDateView(Date $minDate, $view) { $view->minDateYear = $minDate->toString('Y'); $view->minDateMonth = $minDate->toString('m'); $view->minDateDay = $minDate->toString('d'); }
php
protected function setMinDateView(Date $minDate, $view) { $view->minDateYear = $minDate->toString('Y'); $view->minDateMonth = $minDate->toString('m'); $view->minDateDay = $minDate->toString('d'); }
[ "protected", "function", "setMinDateView", "(", "Date", "$", "minDate", ",", "$", "view", ")", "{", "$", "view", "->", "minDateYear", "=", "$", "minDate", "->", "toString", "(", "'Y'", ")", ";", "$", "view", "->", "minDateMonth", "=", "$", "minDate", "...
Sets the first date available in the period selector's calendar. @param Date $minDate The min date. @param View $view The view that contains the period selector. @api
[ "Sets", "the", "first", "date", "available", "in", "the", "period", "selector", "s", "calendar", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/Controller.php#L534-L539
train
Set Minimum Date View
[ 30522, 5123, 3853, 2275, 23356, 3686, 8584, 1006, 3058, 1002, 2568, 3686, 1010, 1002, 3193, 1007, 1063, 1002, 3193, 1011, 1028, 2568, 3686, 29100, 1027, 1002, 2568, 3686, 1011, 1028, 2000, 3367, 4892, 1006, 1005, 1061, 1005, 1007, 1025, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
core/DataTable/Renderer/Csv.php
Csv.renderTable
protected function renderTable($table, &$allColumns = array()) { if (is_array($table)) { // convert array to DataTable $table = DataTable::makeFromSimpleArray($table); } if ($table instanceof DataTable\Map) { $str = $this->renderDataTableMap($table, $allColumns); } else { $str = $this->renderDataTable($table, $allColumns); } return $str; }
php
protected function renderTable($table, &$allColumns = array()) { if (is_array($table)) { // convert array to DataTable $table = DataTable::makeFromSimpleArray($table); } if ($table instanceof DataTable\Map) { $str = $this->renderDataTableMap($table, $allColumns); } else { $str = $this->renderDataTable($table, $allColumns); } return $str; }
[ "protected", "function", "renderTable", "(", "$", "table", ",", "&", "$", "allColumns", "=", "array", "(", ")", ")", "{", "if", "(", "is_array", "(", "$", "table", ")", ")", "{", "// convert array to DataTable", "$", "table", "=", "DataTable", "::", "mak...
Computes the output of the given data table @param DataTable|array $table @param array $allColumns @return string
[ "Computes", "the", "output", "of", "the", "given", "data", "table" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Renderer/Csv.php#L119-L132
train
Render a DataTable
[ 30522, 5123, 3853, 17552, 10880, 1006, 1002, 2795, 1010, 1004, 1002, 2035, 25778, 2819, 3619, 1027, 9140, 1006, 1007, 1007, 1063, 2065, 1006, 2003, 1035, 9140, 1006, 1002, 2795, 1007, 1007, 1063, 1013, 1013, 10463, 9140, 2000, 2951, 10880, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
z-song/laravel-admin
src/Grid/Filter.php
Filter.removeFilterByID
protected function removeFilterByID($id) { $this->filters = array_filter($this->filters, function (AbstractFilter $filter) use ($id) { return $filter->getId() != $id; }); }
php
protected function removeFilterByID($id) { $this->filters = array_filter($this->filters, function (AbstractFilter $filter) use ($id) { return $filter->getId() != $id; }); }
[ "protected", "function", "removeFilterByID", "(", "$", "id", ")", "{", "$", "this", "->", "filters", "=", "array_filter", "(", "$", "this", "->", "filters", ",", "function", "(", "AbstractFilter", "$", "filter", ")", "use", "(", "$", "id", ")", "{", "r...
Remove filter by filter id. @param mixed $id
[ "Remove", "filter", "by", "filter", "id", "." ]
3e65086f806b54699145f58af53843e5dbbb7994
https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid/Filter.php#L280-L285
train
Remove filter by ID
[ 30522, 5123, 3853, 6366, 8873, 21928, 3762, 3593, 1006, 1002, 8909, 1007, 1063, 1002, 2023, 1011, 1028, 17736, 1027, 9140, 1035, 11307, 1006, 1002, 2023, 1011, 1028, 17736, 1010, 3853, 1006, 10061, 8873, 21928, 1002, 11307, 1007, 2224, 1006...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
octobercms/october
modules/system/console/OctoberInstall.php
OctoberInstall.getConfigFile
protected function getConfigFile($name = 'app') { $env = $this->option('env') ? $this->option('env').'/' : ''; $name .= '.php'; $contents = File::get($path = $this->laravel['path.config']."/{$env}{$name}"); return $path; }
php
protected function getConfigFile($name = 'app') { $env = $this->option('env') ? $this->option('env').'/' : ''; $name .= '.php'; $contents = File::get($path = $this->laravel['path.config']."/{$env}{$name}"); return $path; }
[ "protected", "function", "getConfigFile", "(", "$", "name", "=", "'app'", ")", "{", "$", "env", "=", "$", "this", "->", "option", "(", "'env'", ")", "?", "$", "this", "->", "option", "(", "'env'", ")", ".", "'/'", ":", "''", ";", "$", "name", ".=...
Get a config file and contents. @return array
[ "Get", "a", "config", "file", "and", "contents", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/console/OctoberInstall.php#L372-L381
train
Get config file
[ 30522, 5123, 3853, 2131, 8663, 8873, 25708, 9463, 1006, 1002, 2171, 1027, 1005, 10439, 1005, 1007, 1063, 1002, 4372, 2615, 1027, 1002, 2023, 1011, 1028, 5724, 1006, 1005, 4372, 2615, 1005, 1007, 1029, 1002, 2023, 1011, 1028, 5724, 1006, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
getgrav/grav
system/src/Grav/Common/Data/Blueprint.php
Blueprint.processForm
public function processForm(array $data, array $toggles = []) { $this->initInternals(); return $this->blueprintSchema->processForm($data, $toggles); }
php
public function processForm(array $data, array $toggles = []) { $this->initInternals(); return $this->blueprintSchema->processForm($data, $toggles); }
[ "public", "function", "processForm", "(", "array", "$", "data", ",", "array", "$", "toggles", "=", "[", "]", ")", "{", "$", "this", "->", "initInternals", "(", ")", ";", "return", "$", "this", "->", "blueprintSchema", "->", "processForm", "(", "$", "da...
Process data coming from a form. @param array $data @param array $toggles @return array
[ "Process", "data", "coming", "from", "a", "form", "." ]
1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72
https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Data/Blueprint.php#L150-L155
train
Process form data
[ 30522, 2270, 3853, 2832, 14192, 1006, 9140, 1002, 2951, 1010, 9140, 1002, 2000, 24989, 1027, 1031, 1033, 1007, 1063, 1002, 2023, 1011, 1028, 1999, 25090, 10111, 12789, 4877, 1006, 1007, 1025, 2709, 1002, 2023, 1011, 1028, 2630, 16550, 22842...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
libs/HTML/QuickForm2/Element/Select.php
HTML_QuickForm2_Element_Select.addOption
public function addOption($text, $value, $attributes = null) { return $this->optionContainer->addOption($text, $value, $attributes); }
php
public function addOption($text, $value, $attributes = null) { return $this->optionContainer->addOption($text, $value, $attributes); }
[ "public", "function", "addOption", "(", "$", "text", ",", "$", "value", ",", "$", "attributes", "=", "null", ")", "{", "return", "$", "this", "->", "optionContainer", "->", "addOption", "(", "$", "text", ",", "$", "value", ",", "$", "attributes", ")", ...
Adds a new option Please note that if you pass 'selected' attribute in the $attributes parameter then this option's value will be added to <select>'s values. @param string Option text @param string 'value' attribute for <option> tag @param mixed Additional attributes for <option> tag (either as a string or as an associative array)
[ "Adds", "a", "new", "option" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Element/Select.php#L540-L543
train
Add option to the option container
[ 30522, 2270, 3853, 5587, 7361, 3508, 1006, 1002, 3793, 1010, 1002, 3643, 1010, 1002, 12332, 1027, 19701, 1007, 1063, 2709, 1002, 2023, 1011, 1028, 5724, 8663, 18249, 2121, 1011, 1028, 5587, 7361, 3508, 1006, 1002, 3793, 1010, 1002, 3643, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
octobercms/october
modules/system/models/PluginVersion.php
PluginVersion.getVersion
public static function getVersion($pluginCode) { if (self::$versionCache === null) { self::$versionCache = self::lists('version', 'code'); } return self::$versionCache[$pluginCode] ?? null; }
php
public static function getVersion($pluginCode) { if (self::$versionCache === null) { self::$versionCache = self::lists('version', 'code'); } return self::$versionCache[$pluginCode] ?? null; }
[ "public", "static", "function", "getVersion", "(", "$", "pluginCode", ")", "{", "if", "(", "self", "::", "$", "versionCache", "===", "null", ")", "{", "self", "::", "$", "versionCache", "=", "self", "::", "lists", "(", "'version'", ",", "'code'", ")", ...
Returns the current version for a plugin @param string $pluginCode Plugin code. Eg: Acme.Blog @return string
[ "Returns", "the", "current", "version", "for", "a", "plugin" ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/models/PluginVersion.php#L143-L150
train
Get the version of a plugin
[ 30522, 2270, 10763, 3853, 2131, 27774, 1006, 1002, 13354, 2378, 16044, 1007, 1063, 2065, 1006, 2969, 1024, 1024, 1002, 2544, 3540, 5403, 1027, 1027, 1027, 19701, 1007, 1063, 2969, 1024, 1024, 1002, 2544, 3540, 5403, 1027, 2969, 1024, 1024, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
octobercms/october
modules/system/classes/UpdateManager.php
UpdateManager.downloadTheme
public function downloadTheme($name, $hash) { $fileCode = $name . $hash; $this->requestServerFile('theme/get', $fileCode, $hash, ['name' => $name]); }
php
public function downloadTheme($name, $hash) { $fileCode = $name . $hash; $this->requestServerFile('theme/get', $fileCode, $hash, ['name' => $name]); }
[ "public", "function", "downloadTheme", "(", "$", "name", ",", "$", "hash", ")", "{", "$", "fileCode", "=", "$", "name", ".", "$", "hash", ";", "$", "this", "->", "requestServerFile", "(", "'theme/get'", ",", "$", "fileCode", ",", "$", "hash", ",", "[...
Downloads a theme from the update server. @param string $name Theme name. @param string $hash Expected file hash. @return self
[ "Downloads", "a", "theme", "from", "the", "update", "server", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/UpdateManager.php#L613-L618
train
Download a theme from the remote server
[ 30522, 2270, 3853, 8816, 10760, 4168, 1006, 1002, 2171, 1010, 1002, 23325, 1007, 1063, 1002, 5371, 16044, 1027, 1002, 2171, 1012, 1002, 23325, 1025, 1002, 2023, 1011, 1028, 11186, 2121, 6299, 8873, 2571, 1006, 1005, 4323, 1013, 2131, 1005, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
octobercms/october
modules/system/classes/VersionManager.php
VersionManager.setDatabaseVersion
protected function setDatabaseVersion($code, $version = null) { $currentVersion = $this->getDatabaseVersion($code); if ($version && !$currentVersion) { Db::table('system_plugin_versions')->insert([ 'code' => $code, 'version' => $version, 'created_at' => new Carbon ]); } elseif ($version && $currentVersion) { Db::table('system_plugin_versions')->where('code', $code)->update([ 'version' => $version, 'created_at' => new Carbon ]); } elseif ($currentVersion) { Db::table('system_plugin_versions')->where('code', $code)->delete(); } $this->databaseVersions[$code] = $version; }
php
protected function setDatabaseVersion($code, $version = null) { $currentVersion = $this->getDatabaseVersion($code); if ($version && !$currentVersion) { Db::table('system_plugin_versions')->insert([ 'code' => $code, 'version' => $version, 'created_at' => new Carbon ]); } elseif ($version && $currentVersion) { Db::table('system_plugin_versions')->where('code', $code)->update([ 'version' => $version, 'created_at' => new Carbon ]); } elseif ($currentVersion) { Db::table('system_plugin_versions')->where('code', $code)->delete(); } $this->databaseVersions[$code] = $version; }
[ "protected", "function", "setDatabaseVersion", "(", "$", "code", ",", "$", "version", "=", "null", ")", "{", "$", "currentVersion", "=", "$", "this", "->", "getDatabaseVersion", "(", "$", "code", ")", ";", "if", "(", "$", "version", "&&", "!", "$", "cu...
Updates a plugin version in the database.
[ "Updates", "a", "plugin", "version", "in", "the", "database", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/VersionManager.php#L334-L356
train
Set the database version
[ 30522, 5123, 3853, 2275, 2850, 2696, 15058, 27774, 1006, 1002, 3642, 1010, 1002, 2544, 1027, 19701, 1007, 1063, 1002, 2783, 27774, 1027, 1002, 2023, 1011, 1028, 2131, 2850, 2696, 15058, 27774, 1006, 1002, 3642, 1007, 1025, 2065, 1006, 1002,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
dompdf/dompdf
src/Frame/Factory.php
Factory.getPositionerInstance
protected static function getPositionerInstance($type) { if (!isset(self::$_positioners[$type])) { $class = '\\Dompdf\\Positioner\\'.$type; self::$_positioners[$type] = new $class(); } return self::$_positioners[$type]; }
php
protected static function getPositionerInstance($type) { if (!isset(self::$_positioners[$type])) { $class = '\\Dompdf\\Positioner\\'.$type; self::$_positioners[$type] = new $class(); } return self::$_positioners[$type]; }
[ "protected", "static", "function", "getPositionerInstance", "(", "$", "type", ")", "{", "if", "(", "!", "isset", "(", "self", "::", "$", "_positioners", "[", "$", "type", "]", ")", ")", "{", "$", "class", "=", "'\\\\Dompdf\\\\Positioner\\\\'", ".", "$", ...
Creates Positioners @param string $type type of positioner to use @return AbstractPositioner
[ "Creates", "Positioners" ]
75f13c700009be21a1965dc2c5b68a8708c22ba2
https://github.com/dompdf/dompdf/blob/75f13c700009be21a1965dc2c5b68a8708c22ba2/src/Frame/Factory.php#L279-L286
train
Get Positioner Instance
[ 30522, 5123, 10763, 3853, 2131, 26994, 23282, 12693, 3401, 1006, 1002, 2828, 1007, 1063, 2065, 1006, 999, 26354, 3388, 1006, 2969, 1024, 1024, 1002, 1035, 2597, 2545, 1031, 1002, 2828, 1033, 1007, 1007, 1063, 1002, 2465, 1027, 1005, 1032, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/BrowserKit/Client.php
Client.submitForm
public function submitForm(string $button, array $fieldValues = [], string $method = 'POST', array $serverParameters = []): Crawler { if (null === $this->crawler) { throw new BadMethodCallException(sprintf('The "request()" method must be called before "%s()".', __METHOD__)); } $buttonNode = $this->crawler->selectButton($button); $form = $buttonNode->form($fieldValues, $method); return $this->submit($form, [], $serverParameters); }
php
public function submitForm(string $button, array $fieldValues = [], string $method = 'POST', array $serverParameters = []): Crawler { if (null === $this->crawler) { throw new BadMethodCallException(sprintf('The "request()" method must be called before "%s()".', __METHOD__)); } $buttonNode = $this->crawler->selectButton($button); $form = $buttonNode->form($fieldValues, $method); return $this->submit($form, [], $serverParameters); }
[ "public", "function", "submitForm", "(", "string", "$", "button", ",", "array", "$", "fieldValues", "=", "[", "]", ",", "string", "$", "method", "=", "'POST'", ",", "array", "$", "serverParameters", "=", "[", "]", ")", ":", "Crawler", "{", "if", "(", ...
Finds the first form that contains a button with the given content and uses it to submit the given form field values. @param string $button The text content, id, value or name of the form <button> or <input type="submit"> @param array $fieldValues Use this syntax: ['my_form[name]' => '...', 'my_form[email]' => '...'] @param string $method The HTTP method used to submit the form @param array $serverParameters These values override the ones stored in $_SERVER (HTTP headers must include a HTTP_ prefix as PHP does)
[ "Finds", "the", "first", "form", "that", "contains", "a", "button", "with", "the", "given", "content", "and", "uses", "it", "to", "submit", "the", "given", "form", "field", "values", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/BrowserKit/Client.php#L339-L349
train
Submit a form with a select button
[ 30522, 2270, 3853, 12040, 14192, 1006, 5164, 1002, 6462, 1010, 9140, 1002, 2492, 10175, 15808, 1027, 1031, 1033, 1010, 5164, 1002, 4118, 1027, 1005, 2695, 1005, 1010, 9140, 1002, 8241, 28689, 22828, 2015, 1027, 1031, 1033, 1007, 1024, 13529...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
core/Archive/ArchivePurger.php
ArchivePurger.deleteArchiveIds
protected function deleteArchiveIds(Date $date, $idArchivesToDelete) { $batches = array_chunk($idArchivesToDelete, 1000); $numericTable = ArchiveTableCreator::getNumericTable($date); $blobTable = ArchiveTableCreator::getBlobTable($date); $deletedCount = 0; foreach ($batches as $idsToDelete) { $deletedCount += $this->model->deleteArchiveIds($numericTable, $blobTable, $idsToDelete); } return $deletedCount; }
php
protected function deleteArchiveIds(Date $date, $idArchivesToDelete) { $batches = array_chunk($idArchivesToDelete, 1000); $numericTable = ArchiveTableCreator::getNumericTable($date); $blobTable = ArchiveTableCreator::getBlobTable($date); $deletedCount = 0; foreach ($batches as $idsToDelete) { $deletedCount += $this->model->deleteArchiveIds($numericTable, $blobTable, $idsToDelete); } return $deletedCount; }
[ "protected", "function", "deleteArchiveIds", "(", "Date", "$", "date", ",", "$", "idArchivesToDelete", ")", "{", "$", "batches", "=", "array_chunk", "(", "$", "idArchivesToDelete", ",", "1000", ")", ";", "$", "numericTable", "=", "ArchiveTableCreator", "::", "...
Deletes by batches Archive IDs in the specified month, @param Date $date @param $idArchivesToDelete @return int Number of rows deleted from both numeric + blob table.
[ "Deletes", "by", "batches", "Archive", "IDs", "in", "the", "specified", "month" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Archive/ArchivePurger.php#L279-L290
train
Delete archive ids
[ 30522, 5123, 3853, 3972, 12870, 2906, 5428, 3726, 9821, 1006, 3058, 1002, 3058, 1010, 1002, 16096, 11140, 24653, 3406, 9247, 12870, 1007, 1063, 1002, 14108, 2229, 1027, 9140, 1035, 20000, 1006, 1002, 16096, 11140, 24653, 3406, 9247, 12870, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
laravel/framework
src/Illuminate/Encryption/Encrypter.php
Encrypter.calculateMac
protected function calculateMac($payload, $bytes) { return hash_hmac( 'sha256', $this->hash($payload['iv'], $payload['value']), $bytes, true ); }
php
protected function calculateMac($payload, $bytes) { return hash_hmac( 'sha256', $this->hash($payload['iv'], $payload['value']), $bytes, true ); }
[ "protected", "function", "calculateMac", "(", "$", "payload", ",", "$", "bytes", ")", "{", "return", "hash_hmac", "(", "'sha256'", ",", "$", "this", "->", "hash", "(", "$", "payload", "[", "'iv'", "]", ",", "$", "payload", "[", "'value'", "]", ")", "...
Calculate the hash of the given payload. @param array $payload @param string $bytes @return string
[ "Calculate", "the", "hash", "of", "the", "given", "payload", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Encryption/Encrypter.php#L239-L244
train
Calculate MAC of payload
[ 30522, 5123, 3853, 18422, 22911, 1006, 1002, 18093, 1010, 1002, 27507, 1007, 1063, 2709, 23325, 1035, 20287, 6305, 1006, 1005, 21146, 17788, 2575, 1005, 1010, 1002, 2023, 1011, 1028, 23325, 1006, 1002, 18093, 1031, 1005, 4921, 1005, 1033, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
plugins/UsersManager/API.php
API.getInstance
public static function getInstance() { try { $instance = StaticContainer::get('UsersManager_API'); if (!($instance instanceof API)) { // Exception is caught below and corrected throw new Exception('UsersManager_API must inherit API'); } self::$instance = $instance; } catch (Exception $e) { self::$instance = StaticContainer::get('Piwik\Plugins\UsersManager\API'); StaticContainer::getContainer()->set('UsersManager_API', self::$instance); } return self::$instance; }
php
public static function getInstance() { try { $instance = StaticContainer::get('UsersManager_API'); if (!($instance instanceof API)) { // Exception is caught below and corrected throw new Exception('UsersManager_API must inherit API'); } self::$instance = $instance; } catch (Exception $e) { self::$instance = StaticContainer::get('Piwik\Plugins\UsersManager\API'); StaticContainer::getContainer()->set('UsersManager_API', self::$instance); } return self::$instance; }
[ "public", "static", "function", "getInstance", "(", ")", "{", "try", "{", "$", "instance", "=", "StaticContainer", "::", "get", "(", "'UsersManager_API'", ")", ";", "if", "(", "!", "(", "$", "instance", "instanceof", "API", ")", ")", "{", "// Exception is ...
You can create your own Users Plugin to override this class. Example of how you would overwrite the UsersManager_API with your own class: Call the following in your plugin __construct() for example: StaticContainer::getContainer()->set('UsersManager_API', \Piwik\Plugins\MyCustomUsersManager\API::getInstance()); @throws Exception @return \Piwik\Plugins\UsersManager\API
[ "You", "can", "create", "your", "own", "Users", "Plugin", "to", "override", "this", "class", ".", "Example", "of", "how", "you", "would", "overwrite", "the", "UsersManager_API", "with", "your", "own", "class", ":", "Call", "the", "following", "in", "your", ...
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UsersManager/API.php#L115-L131
train
Get the users manager API
[ 30522, 2270, 10763, 3853, 2131, 7076, 26897, 1006, 1007, 1063, 3046, 1063, 1002, 6013, 1027, 10763, 8663, 18249, 2121, 1024, 1024, 2131, 1006, 1005, 5198, 24805, 4590, 1035, 17928, 1005, 1007, 1025, 2065, 1006, 999, 1006, 1002, 6013, 6013, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
laravel/framework
src/Illuminate/Pagination/AbstractPaginator.php
AbstractPaginator.appendArray
protected function appendArray(array $keys) { foreach ($keys as $key => $value) { $this->addQuery($key, $value); } return $this; }
php
protected function appendArray(array $keys) { foreach ($keys as $key => $value) { $this->addQuery($key, $value); } return $this; }
[ "protected", "function", "appendArray", "(", "array", "$", "keys", ")", "{", "foreach", "(", "$", "keys", "as", "$", "key", "=>", "$", "value", ")", "{", "$", "this", "->", "addQuery", "(", "$", "key", ",", "$", "value", ")", ";", "}", "return", ...
Add an array of query string values. @param array $keys @return $this
[ "Add", "an", "array", "of", "query", "string", "values", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Pagination/AbstractPaginator.php#L224-L231
train
Append array to query string
[ 30522, 5123, 3853, 10439, 10497, 2906, 9447, 1006, 9140, 1002, 6309, 1007, 1063, 18921, 6776, 1006, 1002, 6309, 2004, 1002, 3145, 1027, 1028, 1002, 3643, 1007, 1063, 1002, 2023, 1011, 1028, 5587, 4226, 2854, 1006, 1002, 3145, 1010, 1002, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
octobercms/october
modules/system/traits/AssetMaker.php
AssetMaker.getAssetPaths
public function getAssetPaths() { $this->removeDuplicates(); $assets = []; foreach ($this->assets as $type => $collection) { $assets[$type] = []; foreach ($collection as $asset) { $assets[$type][] = $this->getAssetEntryBuildPath($asset); } } return $assets; }
php
public function getAssetPaths() { $this->removeDuplicates(); $assets = []; foreach ($this->assets as $type => $collection) { $assets[$type] = []; foreach ($collection as $asset) { $assets[$type][] = $this->getAssetEntryBuildPath($asset); } } return $assets; }
[ "public", "function", "getAssetPaths", "(", ")", "{", "$", "this", "->", "removeDuplicates", "(", ")", ";", "$", "assets", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "assets", "as", "$", "type", "=>", "$", "collection", ")", "{", "$", "...
Returns an array of all registered asset paths. @return array
[ "Returns", "an", "array", "of", "all", "registered", "asset", "paths", "." ]
3118660d834f161d513da08477be92281a2eb96a
https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/traits/AssetMaker.php#L212-L225
train
Get asset paths
[ 30522, 2270, 3853, 2131, 27241, 25856, 8988, 2015, 1006, 1007, 1063, 1002, 2023, 1011, 1028, 3718, 6279, 19341, 30524, 1002, 3074, 2004, 1002, 11412, 1007, 1063, 1002, 7045, 1031, 1002, 2828, 1033, 1031, 1033, 1027, 1002, 2023, 1011, 1028, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
matomo-org/matomo
core/Filesystem.php
Filesystem.copyRecursive
public static function copyRecursive($source, $target, $excludePhp = false) { if (is_dir($source)) { self::mkdir($target); $d = dir($source); while (false !== ($entry = $d->read())) { if ($entry == '.' || $entry == '..') { continue; } $sourcePath = $source . '/' . $entry; if (is_dir($sourcePath)) { self::copyRecursive($sourcePath, $target . '/' . $entry, $excludePhp); continue; } $destPath = $target . '/' . $entry; self::copy($sourcePath, $destPath, $excludePhp); } $d->close(); } else { self::copy($source, $target, $excludePhp); } }
php
public static function copyRecursive($source, $target, $excludePhp = false) { if (is_dir($source)) { self::mkdir($target); $d = dir($source); while (false !== ($entry = $d->read())) { if ($entry == '.' || $entry == '..') { continue; } $sourcePath = $source . '/' . $entry; if (is_dir($sourcePath)) { self::copyRecursive($sourcePath, $target . '/' . $entry, $excludePhp); continue; } $destPath = $target . '/' . $entry; self::copy($sourcePath, $destPath, $excludePhp); } $d->close(); } else { self::copy($source, $target, $excludePhp); } }
[ "public", "static", "function", "copyRecursive", "(", "$", "source", ",", "$", "target", ",", "$", "excludePhp", "=", "false", ")", "{", "if", "(", "is_dir", "(", "$", "source", ")", ")", "{", "self", "::", "mkdir", "(", "$", "target", ")", ";", "$...
Copies the contents of a directory recursively from `$source` to `$target`. @param string $source A directory or file to copy, eg. './tmp/latest'. @param string $target A directory to copy to, eg. '.'. @param bool $excludePhp Whether to avoid copying files if the file is related to PHP (includes .php, .tpl, .twig files). @throws Exception If a file cannot be copied. @api
[ "Copies", "the", "contents", "of", "a", "directory", "recursively", "from", "$source", "to", "$target", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Filesystem.php#L362-L384
train
Copy all files and folders recursively
[ 30522, 2270, 10763, 3853, 6100, 2890, 10841, 2869, 3512, 1006, 1002, 3120, 1010, 1002, 4539, 1010, 1002, 23329, 8458, 2361, 1027, 6270, 1007, 1063, 2065, 1006, 2003, 1035, 16101, 1006, 1002, 3120, 1007, 1007, 1063, 2969, 1024, 1024, 12395, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/DependencyInjection/ContainerBuilder.php
ContainerBuilder.merge
public function merge(self $container) { if ($this->isCompiled()) { throw new BadMethodCallException('Cannot merge on a compiled container.'); } $this->addDefinitions($container->getDefinitions()); $this->addAliases($container->getAliases()); $this->getParameterBag()->add($container->getParameterBag()->all()); if ($this->trackResources) { foreach ($container->getResources() as $resource) { $this->addResource($resource); } } foreach ($this->extensions as $name => $extension) { if (!isset($this->extensionConfigs[$name])) { $this->extensionConfigs[$name] = []; } $this->extensionConfigs[$name] = array_merge($this->extensionConfigs[$name], $container->getExtensionConfig($name)); } if ($this->getParameterBag() instanceof EnvPlaceholderParameterBag && $container->getParameterBag() instanceof EnvPlaceholderParameterBag) { $envPlaceholders = $container->getParameterBag()->getEnvPlaceholders(); $this->getParameterBag()->mergeEnvPlaceholders($container->getParameterBag()); } else { $envPlaceholders = []; } foreach ($container->envCounters as $env => $count) { if (!$count && !isset($envPlaceholders[$env])) { continue; } if (!isset($this->envCounters[$env])) { $this->envCounters[$env] = $count; } else { $this->envCounters[$env] += $count; } } foreach ($container->getAutoconfiguredInstanceof() as $interface => $childDefinition) { if (isset($this->autoconfiguredInstanceof[$interface])) { throw new InvalidArgumentException(sprintf('"%s" has already been autoconfigured and merge() does not support merging autoconfiguration for the same class/interface.', $interface)); } $this->autoconfiguredInstanceof[$interface] = $childDefinition; } }
php
public function merge(self $container) { if ($this->isCompiled()) { throw new BadMethodCallException('Cannot merge on a compiled container.'); } $this->addDefinitions($container->getDefinitions()); $this->addAliases($container->getAliases()); $this->getParameterBag()->add($container->getParameterBag()->all()); if ($this->trackResources) { foreach ($container->getResources() as $resource) { $this->addResource($resource); } } foreach ($this->extensions as $name => $extension) { if (!isset($this->extensionConfigs[$name])) { $this->extensionConfigs[$name] = []; } $this->extensionConfigs[$name] = array_merge($this->extensionConfigs[$name], $container->getExtensionConfig($name)); } if ($this->getParameterBag() instanceof EnvPlaceholderParameterBag && $container->getParameterBag() instanceof EnvPlaceholderParameterBag) { $envPlaceholders = $container->getParameterBag()->getEnvPlaceholders(); $this->getParameterBag()->mergeEnvPlaceholders($container->getParameterBag()); } else { $envPlaceholders = []; } foreach ($container->envCounters as $env => $count) { if (!$count && !isset($envPlaceholders[$env])) { continue; } if (!isset($this->envCounters[$env])) { $this->envCounters[$env] = $count; } else { $this->envCounters[$env] += $count; } } foreach ($container->getAutoconfiguredInstanceof() as $interface => $childDefinition) { if (isset($this->autoconfiguredInstanceof[$interface])) { throw new InvalidArgumentException(sprintf('"%s" has already been autoconfigured and merge() does not support merging autoconfiguration for the same class/interface.', $interface)); } $this->autoconfiguredInstanceof[$interface] = $childDefinition; } }
[ "public", "function", "merge", "(", "self", "$", "container", ")", "{", "if", "(", "$", "this", "->", "isCompiled", "(", ")", ")", "{", "throw", "new", "BadMethodCallException", "(", "'Cannot merge on a compiled container.'", ")", ";", "}", "$", "this", "->"...
Merges a ContainerBuilder with the current ContainerBuilder configuration. Service definitions overrides the current defined ones. But for parameters, they are overridden by the current ones. It allows the parameters passed to the container constructor to have precedence over the loaded ones. $container = new ContainerBuilder(new ParameterBag(['foo' => 'bar'])); $loader = new LoaderXXX($container); $loader->load('resource_name'); $container->register('foo', 'stdClass'); In the above example, even if the loaded resource defines a foo parameter, the value will still be 'bar' as defined in the ContainerBuilder constructor. @throws BadMethodCallException When this ContainerBuilder is compiled
[ "Merges", "a", "ContainerBuilder", "with", "the", "current", "ContainerBuilder", "configuration", "." ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/DependencyInjection/ContainerBuilder.php#L640-L689
train
Merge another container into this one.
[ 30522, 2270, 3853, 13590, 1006, 2969, 1002, 11661, 1007, 1063, 2065, 1006, 1002, 2023, 1011, 1028, 2003, 9006, 22090, 2094, 1006, 1007, 1007, 1063, 5466, 2047, 2919, 11368, 6806, 16409, 24164, 2595, 24422, 1006, 1005, 3685, 13590, 2006, 103...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
symfony/symfony
src/Symfony/Component/EventDispatcher/LegacyEventDispatcherProxy.php
LegacyEventDispatcherProxy.dispatch
public function dispatch($event/*, string $eventName = null*/) { $eventName = 1 < \func_num_args() ? \func_get_arg(1) : null; if (\is_object($event)) { $eventName = $eventName ?? \get_class($event); } else { @trigger_error(sprintf('Calling the "%s::dispatch()" method with the event name as first argument is deprecated since Symfony 4.3, pass it second and provide the event object first instead.', EventDispatcherInterface::class), E_USER_DEPRECATED); $swap = $event; $event = $eventName ?? new Event(); $eventName = $swap; if (!$event instanceof Event) { throw new \TypeError(sprintf('Argument 1 passed to "%s::dispatch()" must be an instance of %s, %s given.', EventDispatcherInterface::class, Event::class, \is_object($event) ? \get_class($event) : \gettype($event))); } } $listeners = $this->getListeners($eventName); $stoppable = $event instanceof Event || $event instanceof ContractsEvent || $event instanceof StoppableEventInterface; foreach ($listeners as $listener) { if ($stoppable && $event->isPropagationStopped()) { break; } $listener($event, $eventName, $this); } return $event; }
php
public function dispatch($event/*, string $eventName = null*/) { $eventName = 1 < \func_num_args() ? \func_get_arg(1) : null; if (\is_object($event)) { $eventName = $eventName ?? \get_class($event); } else { @trigger_error(sprintf('Calling the "%s::dispatch()" method with the event name as first argument is deprecated since Symfony 4.3, pass it second and provide the event object first instead.', EventDispatcherInterface::class), E_USER_DEPRECATED); $swap = $event; $event = $eventName ?? new Event(); $eventName = $swap; if (!$event instanceof Event) { throw new \TypeError(sprintf('Argument 1 passed to "%s::dispatch()" must be an instance of %s, %s given.', EventDispatcherInterface::class, Event::class, \is_object($event) ? \get_class($event) : \gettype($event))); } } $listeners = $this->getListeners($eventName); $stoppable = $event instanceof Event || $event instanceof ContractsEvent || $event instanceof StoppableEventInterface; foreach ($listeners as $listener) { if ($stoppable && $event->isPropagationStopped()) { break; } $listener($event, $eventName, $this); } return $event; }
[ "public", "function", "dispatch", "(", "$", "event", "/*, string $eventName = null*/", ")", "{", "$", "eventName", "=", "1", "<", "\\", "func_num_args", "(", ")", "?", "\\", "func_get_arg", "(", "1", ")", ":", "null", ";", "if", "(", "\\", "is_object", "...
{@inheritdoc} @param string|null $eventName
[ "{", "@inheritdoc", "}" ]
b82b09eefb084e487997f4af753400d721edd0a8
https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/EventDispatcher/LegacyEventDispatcherProxy.php#L54-L82
train
Dispatches an event to all listeners
[ 30522, 2270, 3853, 18365, 1006, 1002, 2724, 1013, 1008, 1010, 5164, 1002, 2724, 18442, 1027, 19701, 1008, 1013, 1007, 1063, 1002, 2724, 18442, 1027, 1015, 1026, 1032, 4569, 2278, 1035, 16371, 2213, 1035, 12098, 5620, 1006, 1007, 1029, 1032,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
laravel/framework
src/Illuminate/Database/Query/Grammars/MySqlGrammar.php
MySqlGrammar.compileJsonContains
protected function compileJsonContains($column, $value) { [$field, $path] = $this->wrapJsonFieldAndPath($column); return 'json_contains('.$field.', '.$value.$path.')'; }
php
protected function compileJsonContains($column, $value) { [$field, $path] = $this->wrapJsonFieldAndPath($column); return 'json_contains('.$field.', '.$value.$path.')'; }
[ "protected", "function", "compileJsonContains", "(", "$", "column", ",", "$", "value", ")", "{", "[", "$", "field", ",", "$", "path", "]", "=", "$", "this", "->", "wrapJsonFieldAndPath", "(", "$", "column", ")", ";", "return", "'json_contains('", ".", "$...
Compile a "JSON contains" statement into SQL. @param string $column @param string $value @return string
[ "Compile", "a", "JSON", "contains", "statement", "into", "SQL", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Query/Grammars/MySqlGrammar.php#L65-L70
train
Compiles JSON contains statement into valid PHP.
[ 30522, 5123, 3853, 4012, 22090, 22578, 2239, 8663, 18249, 2015, 1006, 1002, 5930, 1010, 1002, 3643, 1007, 1063, 1031, 1002, 2492, 1010, 1002, 4130, 1033, 1027, 1002, 2023, 1011, 1028, 10236, 22578, 2239, 3790, 5685, 15069, 1006, 1002, 5930,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...