repo stringclasses 21
values | path stringlengths 10 105 | func_name stringlengths 6 64 | original_string stringlengths 105 15.6k | language stringclasses 1
value | code stringlengths 105 15.6k | code_tokens listlengths 29 2.15k | docstring stringlengths 11 2.85k | docstring_tokens listlengths 1 290 | sha stringclasses 21
values | url stringlengths 100 194 | partition stringclasses 1
value | summary stringlengths 8 319 | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
symfony/symfony | src/Symfony/Component/Config/Loader/DelegatingLoader.php | DelegatingLoader.load | public function load($resource, $type = null)
{
if (false === $loader = $this->resolver->resolve($resource, $type)) {
throw new LoaderLoadException($resource, null, null, null, $type);
}
return $loader->load($resource, $type);
} | php | public function load($resource, $type = null)
{
if (false === $loader = $this->resolver->resolve($resource, $type)) {
throw new LoaderLoadException($resource, null, null, null, $type);
}
return $loader->load($resource, $type);
} | [
"public",
"function",
"load",
"(",
"$",
"resource",
",",
"$",
"type",
"=",
"null",
")",
"{",
"if",
"(",
"false",
"===",
"$",
"loader",
"=",
"$",
"this",
"->",
"resolver",
"->",
"resolve",
"(",
"$",
"resource",
",",
"$",
"type",
")",
")",
"{",
"th... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Config/Loader/DelegatingLoader.php#L34-L41 | train | Load a resource and type | [
30522,
2270,
3853,
7170,
1006,
1002,
7692,
1010,
1002,
2828,
1027,
19701,
1007,
1063,
2065,
1006,
6270,
1027,
1027,
1027,
1002,
7170,
2121,
1027,
1002,
2023,
1011,
1028,
10663,
2099,
1011,
1028,
10663,
1006,
1002,
7692,
1010,
1002,
2828,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/PostgresConnector.php | PostgresConnector.connect | public function connect(array $config)
{
// First we'll create the basic DSN and connection instance connecting to the
// using the configuration option specified by the developer. We will also
// set the default character set on the connections to UTF-8 by default.
$connection = $th... | php | public function connect(array $config)
{
// First we'll create the basic DSN and connection instance connecting to the
// using the configuration option specified by the developer. We will also
// set the default character set on the connections to UTF-8 by default.
$connection = $th... | [
"public",
"function",
"connect",
"(",
"array",
"$",
"config",
")",
"{",
"// First we'll create the basic DSN and connection instance connecting to the",
"// using the configuration option specified by the developer. We will also",
"// set the default character set on the connections to UTF-8 b... | Establish a database connection.
@param array $config
@return \PDO | [
"Establish",
"a",
"database",
"connection",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Connectors/PostgresConnector.php#L27-L51 | train | Connects to the database and sets the character set on the connection. | [
30522,
2270,
3853,
7532,
1006,
9140,
1002,
9530,
8873,
2290,
1007,
1063,
1013,
1013,
2034,
2057,
1005,
2222,
3443,
1996,
3937,
16233,
2078,
1998,
4434,
6013,
7176,
2000,
1996,
1013,
1013,
2478,
1996,
9563,
5724,
9675,
2011,
1996,
9722,
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... |
matomo-org/matomo | libs/HTML/QuickForm2/Controller/Page.php | HTML_QuickForm2_Controller_Page.populateFormOnce | final public function populateFormOnce()
{
if (!$this->_formPopulated) {
if (!empty($this->controller) && $this->controller->propagateId()) {
$this->form->addElement(
'hidden', HTML_QuickForm2_Controller::KEY_ID,
array('id' => HTML_QuickFor... | php | final public function populateFormOnce()
{
if (!$this->_formPopulated) {
if (!empty($this->controller) && $this->controller->propagateId()) {
$this->form->addElement(
'hidden', HTML_QuickForm2_Controller::KEY_ID,
array('id' => HTML_QuickFor... | [
"final",
"public",
"function",
"populateFormOnce",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_formPopulated",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"controller",
")",
"&&",
"$",
"this",
"->",
"controller",
"->",
"propagate... | Wrapper around populateForm() ensuring that it is only called once | [
"Wrapper",
"around",
"populateForm",
"()",
"ensuring",
"that",
"it",
"is",
"only",
"called",
"once"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Controller/Page.php#L215-L227 | train | Populates the form only if the controller has been set | [
30522,
2345,
2270,
3853,
3769,
9869,
14192,
2239,
3401,
1006,
1007,
1063,
2065,
1006,
999,
1002,
2023,
1011,
1028,
1035,
2433,
16340,
8898,
1007,
1063,
2065,
1006,
999,
4064,
1006,
1002,
2023,
1011,
1028,
11486,
1007,
1004,
1004,
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... |
matomo-org/matomo | core/API/DataTableManipulator.php | DataTableManipulator.getApiMethodForSubtable | protected function getApiMethodForSubtable($request)
{
if (!$this->apiMethodForSubtable) {
if (!empty($request['idSite'])) {
$idSite = $request['idSite'];
} else {
$idSite = 'all';
}
$apiParameters = array();
$entit... | php | protected function getApiMethodForSubtable($request)
{
if (!$this->apiMethodForSubtable) {
if (!empty($request['idSite'])) {
$idSite = $request['idSite'];
} else {
$idSite = 'all';
}
$apiParameters = array();
$entit... | [
"protected",
"function",
"getApiMethodForSubtable",
"(",
"$",
"request",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"apiMethodForSubtable",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"request",
"[",
"'idSite'",
"]",
")",
")",
"{",
"$",
"idSite",
"=... | Extract the API method for loading subtables from the meta data
@throws Exception
@return string | [
"Extract",
"the",
"API",
"method",
"for",
"loading",
"subtables",
"from",
"the",
"meta",
"data"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/API/DataTableManipulator.php#L146-L184 | train | Returns the api method for subtable | [
30522,
5123,
3853,
2131,
9331,
14428,
2705,
7716,
29278,
6342,
19279,
3085,
1006,
1002,
5227,
1007,
1063,
2065,
1006,
999,
1002,
2023,
1011,
1028,
17928,
11368,
6806,
20952,
5668,
12083,
10880,
1007,
1063,
2065,
1006,
999,
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... |
symfony/symfony | src/Symfony/Component/Security/Core/Authorization/AccessDecisionManager.php | AccessDecisionManager.decideUnanimous | private function decideUnanimous(TokenInterface $token, array $attributes, $object = null)
{
$grant = 0;
foreach ($this->voters as $voter) {
foreach ($attributes as $attribute) {
$result = $voter->vote($token, $object, [$attribute]);
switch ($result) {
... | php | private function decideUnanimous(TokenInterface $token, array $attributes, $object = null)
{
$grant = 0;
foreach ($this->voters as $voter) {
foreach ($attributes as $attribute) {
$result = $voter->vote($token, $object, [$attribute]);
switch ($result) {
... | [
"private",
"function",
"decideUnanimous",
"(",
"TokenInterface",
"$",
"token",
",",
"array",
"$",
"attributes",
",",
"$",
"object",
"=",
"null",
")",
"{",
"$",
"grant",
"=",
"0",
";",
"foreach",
"(",
"$",
"this",
"->",
"voters",
"as",
"$",
"voter",
")"... | Grants access if only grant (or abstain) votes were received.
If all voters abstained from voting, the decision will be based on the
allowIfAllAbstainDecisions property value (defaults to false). | [
"Grants",
"access",
"if",
"only",
"grant",
"(",
"or",
"abstain",
")",
"votes",
"were",
"received",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Security/Core/Authorization/AccessDecisionManager.php#L150-L178 | train | Decides whether a token has unanimous access | [
30522,
2797,
3853,
5630,
9521,
3490,
27711,
1006,
19204,
18447,
2121,
12172,
1002,
19204,
1010,
9140,
1002,
12332,
1010,
1002,
4874,
1027,
19701,
1007,
1063,
1002,
3946,
1027,
1014,
1025,
18921,
6776,
1006,
1002,
2023,
1011,
1028,
7206,
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... |
symfony/symfony | src/Symfony/Component/Security/Http/Authentication/DefaultAuthenticationSuccessHandler.php | DefaultAuthenticationSuccessHandler.onAuthenticationSuccess | public function onAuthenticationSuccess(Request $request, TokenInterface $token)
{
return $this->httpUtils->createRedirectResponse($request, $this->determineTargetUrl($request));
} | php | public function onAuthenticationSuccess(Request $request, TokenInterface $token)
{
return $this->httpUtils->createRedirectResponse($request, $this->determineTargetUrl($request));
} | [
"public",
"function",
"onAuthenticationSuccess",
"(",
"Request",
"$",
"request",
",",
"TokenInterface",
"$",
"token",
")",
"{",
"return",
"$",
"this",
"->",
"httpUtils",
"->",
"createRedirectResponse",
"(",
"$",
"request",
",",
"$",
"this",
"->",
"determineTarge... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Security/Http/Authentication/DefaultAuthenticationSuccessHandler.php#L55-L58 | train | This method is called when an authentication is successful. It returns a redirect response to the target URL. | [
30522,
2270,
3853,
2006,
4887,
10760,
16778,
10719,
6342,
9468,
7971,
1006,
5227,
1002,
5227,
1010,
19204,
18447,
2121,
12172,
1002,
19204,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
8299,
21823,
4877,
1011,
1028,
3443,
5596,
7442,
6593,
607... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
guzzle/guzzle | src/Cookie/CookieJar.php | CookieJar.removeCookieIfEmpty | private function removeCookieIfEmpty(SetCookie $cookie)
{
$cookieValue = $cookie->getValue();
if ($cookieValue === null || $cookieValue === '') {
$this->clear(
$cookie->getDomain(),
$cookie->getPath(),
$cookie->getName()
);
... | php | private function removeCookieIfEmpty(SetCookie $cookie)
{
$cookieValue = $cookie->getValue();
if ($cookieValue === null || $cookieValue === '') {
$this->clear(
$cookie->getDomain(),
$cookie->getPath(),
$cookie->getName()
);
... | [
"private",
"function",
"removeCookieIfEmpty",
"(",
"SetCookie",
"$",
"cookie",
")",
"{",
"$",
"cookieValue",
"=",
"$",
"cookie",
"->",
"getValue",
"(",
")",
";",
"if",
"(",
"$",
"cookieValue",
"===",
"null",
"||",
"$",
"cookieValue",
"===",
"''",
")",
"{... | If a cookie already exists and the server asks to set it again with a
null value, the cookie must be deleted.
@param SetCookie $cookie | [
"If",
"a",
"cookie",
"already",
"exists",
"and",
"the",
"server",
"asks",
"to",
"set",
"it",
"again",
"with",
"a",
"null",
"value",
"the",
"cookie",
"must",
"be",
"deleted",
"."
] | bf595424e4d442a190582e088985dc835a789071 | https://github.com/guzzle/guzzle/blob/bf595424e4d442a190582e088985dc835a789071/src/Cookie/CookieJar.php#L303-L313 | train | Remove cookie if value is null or empty | [
30522,
2797,
3853,
6366,
3597,
23212,
7416,
7959,
27718,
2100,
1006,
2275,
3597,
23212,
2063,
1002,
17387,
1007,
1063,
1002,
17387,
10175,
5657,
30524,
2065,
1006,
1002,
17387,
10175,
5657,
1027,
1027,
1027,
19701,
1064,
1064,
1002,
17387,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Rule.php | Rule.in | public static function in($values)
{
if ($values instanceof Arrayable) {
$values = $values->toArray();
}
return new Rules\In(is_array($values) ? $values : func_get_args());
} | php | public static function in($values)
{
if ($values instanceof Arrayable) {
$values = $values->toArray();
}
return new Rules\In(is_array($values) ? $values : func_get_args());
} | [
"public",
"static",
"function",
"in",
"(",
"$",
"values",
")",
"{",
"if",
"(",
"$",
"values",
"instanceof",
"Arrayable",
")",
"{",
"$",
"values",
"=",
"$",
"values",
"->",
"toArray",
"(",
")",
";",
"}",
"return",
"new",
"Rules",
"\\",
"In",
"(",
"i... | Get an in constraint builder instance.
@param \Illuminate\Contracts\Support\Arrayable|array|string $values
@return \Illuminate\Validation\Rules\In | [
"Get",
"an",
"in",
"constraint",
"builder",
"instance",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Validation/Rule.php#L41-L48 | train | Returns a new RuleSet containing only the values that are in the array | [
30522,
2270,
10763,
3853,
1999,
1006,
1002,
5300,
1007,
1063,
2065,
1006,
1002,
5300,
6013,
11253,
9140,
3085,
1007,
1063,
1002,
5300,
1027,
1002,
5300,
1011,
1028,
2000,
2906,
9447,
1006,
1007,
1025,
1065,
2709,
2047,
3513,
1032,
1999,
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/Zend/Db/Statement/Db2.php | Zend_Db_Statement_Db2._prepare | public function _prepare($sql)
{
$connection = $this->_adapter->getConnection();
// db2_prepare on i5 emits errors, these need to be
// suppressed so that proper exceptions can be thrown
$this->_stmt = @db2_prepare($connection, $sql);
if (!$this->_stmt) {
/**
... | php | public function _prepare($sql)
{
$connection = $this->_adapter->getConnection();
// db2_prepare on i5 emits errors, these need to be
// suppressed so that proper exceptions can be thrown
$this->_stmt = @db2_prepare($connection, $sql);
if (!$this->_stmt) {
/**
... | [
"public",
"function",
"_prepare",
"(",
"$",
"sql",
")",
"{",
"$",
"connection",
"=",
"$",
"this",
"->",
"_adapter",
"->",
"getConnection",
"(",
")",
";",
"// db2_prepare on i5 emits errors, these need to be",
"// suppressed so that proper exceptions can be thrown",
"$",
... | Prepare a statement handle.
@param string $sql
@return void
@throws Zend_Db_Statement_Db2_Exception | [
"Prepare",
"a",
"statement",
"handle",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Statement/Db2.php#L56-L74 | train | Prepare statement for execution | [
30522,
2270,
3853,
1035,
7374,
1006,
1002,
29296,
1007,
1063,
1002,
4434,
1027,
1002,
2023,
1011,
1028,
1035,
15581,
2121,
1011,
1028,
2131,
8663,
2638,
7542,
1006,
1007,
1025,
1013,
1013,
16962,
2475,
1035,
7374,
2006,
1045,
2629,
12495,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/RouteCollectionBuilder.php | RouteCollectionBuilder.build | public function build()
{
$routeCollection = new RouteCollection();
foreach ($this->routes as $name => $route) {
if ($route instanceof Route) {
$route->setDefaults(array_merge($this->defaults, $route->getDefaults()));
$route->setOptions(array_merge($this-... | php | public function build()
{
$routeCollection = new RouteCollection();
foreach ($this->routes as $name => $route) {
if ($route instanceof Route) {
$route->setDefaults(array_merge($this->defaults, $route->getDefaults()));
$route->setOptions(array_merge($this-... | [
"public",
"function",
"build",
"(",
")",
"{",
"$",
"routeCollection",
"=",
"new",
"RouteCollection",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"routes",
"as",
"$",
"name",
"=>",
"$",
"route",
")",
"{",
"if",
"(",
"$",
"route",
"instanceof",
"... | Creates the final RouteCollection and returns it.
@return RouteCollection | [
"Creates",
"the",
"final",
"RouteCollection",
"and",
"returns",
"it",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Routing/RouteCollectionBuilder.php#L268-L323 | train | Build the route collection | [
30522,
2270,
3853,
3857,
1006,
1007,
1063,
1002,
2799,
26895,
18491,
1027,
2047,
2799,
26895,
18491,
1006,
1007,
1025,
18921,
6776,
1006,
1002,
2023,
1011,
1028,
5847,
2004,
1002,
2171,
1027,
1028,
1002,
2799,
1007,
1063,
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... |
symfony/symfony | src/Symfony/Component/Form/AbstractTypeExtension.php | AbstractTypeExtension.getExtendedType | public function getExtendedType()
{
if (!method_exists($this, 'getExtendedTypes')) {
throw new LogicException(sprintf('You need to implement the static getExtendedTypes() method when implementing the %s in %s.', FormTypeExtensionInterface::class, static::class));
}
@trigger_erro... | php | public function getExtendedType()
{
if (!method_exists($this, 'getExtendedTypes')) {
throw new LogicException(sprintf('You need to implement the static getExtendedTypes() method when implementing the %s in %s.', FormTypeExtensionInterface::class, static::class));
}
@trigger_erro... | [
"public",
"function",
"getExtendedType",
"(",
")",
"{",
"if",
"(",
"!",
"method_exists",
"(",
"$",
"this",
",",
"'getExtendedTypes'",
")",
")",
"{",
"throw",
"new",
"LogicException",
"(",
"sprintf",
"(",
"'You need to implement the static getExtendedTypes() method whe... | {@inheritdoc}
@deprecated since Symfony 4.2, use getExtendedTypes() instead. | [
"{",
"@inheritdoc",
"}"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/AbstractTypeExtension.php#L55-L66 | train | Returns the extended type of the form type | [
30522,
2270,
3853,
2131,
10288,
6528,
5732,
13874,
1006,
1007,
1063,
2065,
1006,
999,
4118,
1035,
6526,
1006,
1002,
2023,
1010,
1005,
2131,
10288,
6528,
5732,
13874,
2015,
1005,
1007,
1007,
1063,
5466,
2047,
7961,
10288,
24422,
1006,
9043,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Insights/InsightReport.php | InsightReport.generateInsight | public function generateInsight($reportMetadata, $period, $date, $lastDate, $metric, $currentReport, $lastReport, $totalValue, $minMoversPercent, $minNewPercent, $minDisappearedPercent, $minGrowthPercentPositive, $minGrowthPercentNegative, $orderBy, $limitIncreaser, $limitDecreaser)
{
$minChangeMovers = $th... | php | public function generateInsight($reportMetadata, $period, $date, $lastDate, $metric, $currentReport, $lastReport, $totalValue, $minMoversPercent, $minNewPercent, $minDisappearedPercent, $minGrowthPercentPositive, $minGrowthPercentNegative, $orderBy, $limitIncreaser, $limitDecreaser)
{
$minChangeMovers = $th... | [
"public",
"function",
"generateInsight",
"(",
"$",
"reportMetadata",
",",
"$",
"period",
",",
"$",
"date",
",",
"$",
"lastDate",
",",
"$",
"metric",
",",
"$",
"currentReport",
",",
"$",
"lastReport",
",",
"$",
"totalValue",
",",
"$",
"minMoversPercent",
",... | @param array $reportMetadata
@param string $period
@param string $date
@param string $lastDate
@param string $metric
@param DataTable $currentReport
@param DataTable $lastReport
@param int $totalValue
@param int $minMoversPercent Exclude rows who moved and the difference is not at least min percent
visits of total... | [
"@param",
"array",
"$reportMetadata",
"@param",
"string",
"$period",
"@param",
"string",
"$date",
"@param",
"string",
"$lastDate",
"@param",
"string",
"$metric",
"@param",
"DataTable",
"$currentReport",
"@param",
"DataTable",
"$lastReport",
"@param",
"int",
"$totalValue... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Insights/InsightReport.php#L142-L247 | train | Generate Insight Data | [
30522,
2270,
3853,
9699,
7076,
18743,
1006,
1002,
3189,
11368,
8447,
2696,
1010,
1002,
2558,
1010,
1002,
3058,
1010,
1002,
2197,
13701,
1010,
1002,
12046,
1010,
1002,
2783,
2890,
6442,
1010,
1002,
2197,
2890,
6442,
1010,
1002,
2561,
10175,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Concerns/HasRelationships.php | HasRelationships.morphMany | public function morphMany($related, $name, $type = null, $id = null, $localKey = null)
{
$instance = $this->newRelatedInstance($related);
// Here we will gather up the morph type and ID for the relationship so that we
// can properly query the intermediate table of a relation. Finally, we w... | php | public function morphMany($related, $name, $type = null, $id = null, $localKey = null)
{
$instance = $this->newRelatedInstance($related);
// Here we will gather up the morph type and ID for the relationship so that we
// can properly query the intermediate table of a relation. Finally, we w... | [
"public",
"function",
"morphMany",
"(",
"$",
"related",
",",
"$",
"name",
",",
"$",
"type",
"=",
"null",
",",
"$",
"id",
"=",
"null",
",",
"$",
"localKey",
"=",
"null",
")",
"{",
"$",
"instance",
"=",
"$",
"this",
"->",
"newRelatedInstance",
"(",
"... | Define a polymorphic one-to-many relationship.
@param string $related
@param string $name
@param string $type
@param string $id
@param string $localKey
@return \Illuminate\Database\Eloquent\Relations\MorphMany | [
"Define",
"a",
"polymorphic",
"one",
"-",
"to",
"-",
"many",
"relationship",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php#L405-L419 | train | Return a new morphMany relationship | [
30522,
2270,
3853,
22822,
8458,
2386,
2100,
1006,
1002,
3141,
1010,
1002,
2171,
1010,
1002,
2828,
1027,
19701,
1010,
1002,
8909,
1027,
19701,
1010,
1002,
2334,
14839,
1027,
19701,
1007,
1063,
1002,
6013,
1027,
1002,
2023,
1011,
1028,
2047,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Controller.php | Controller.initViewAnonymousUserSettings | protected function initViewAnonymousUserSettings($view)
{
if (!Piwik::hasUserSuperUserAccess()) {
return;
}
$userLogin = 'anonymous';
// Which websites are available to the anonymous users?
$anonymousSitesAccess = Request::processRequest('UsersManager.getSitesA... | php | protected function initViewAnonymousUserSettings($view)
{
if (!Piwik::hasUserSuperUserAccess()) {
return;
}
$userLogin = 'anonymous';
// Which websites are available to the anonymous users?
$anonymousSitesAccess = Request::processRequest('UsersManager.getSitesA... | [
"protected",
"function",
"initViewAnonymousUserSettings",
"(",
"$",
"view",
")",
"{",
"if",
"(",
"!",
"Piwik",
"::",
"hasUserSuperUserAccess",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"userLogin",
"=",
"'anonymous'",
";",
"// Which websites are available to th... | The Super User can modify Anonymous user settings
@param View $view | [
"The",
"Super",
"User",
"can",
"modify",
"Anonymous",
"user",
"settings"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UsersManager/Controller.php#L275-L334 | train | Initializes the view object with the anonymous user settings | [
30522,
5123,
3853,
1999,
4183,
8584,
6761,
4890,
27711,
20330,
21678,
8613,
1006,
1002,
3193,
1007,
1063,
2065,
1006,
999,
14255,
9148,
2243,
1024,
1024,
2038,
20330,
6342,
4842,
20330,
6305,
9623,
2015,
1006,
1007,
1007,
1063,
2709,
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... |
barryvdh/laravel-debugbar | src/DataCollector/QueryCollector.php | QueryCollector.collectTransactionEvent | public function collectTransactionEvent($event, $connection)
{
$source = [];
if ($this->findSource) {
try {
$source = $this->findSource();
} catch (\Exception $e) {
}
}
$this->queries[] = [
'query' => $event,
... | php | public function collectTransactionEvent($event, $connection)
{
$source = [];
if ($this->findSource) {
try {
$source = $this->findSource();
} catch (\Exception $e) {
}
}
$this->queries[] = [
'query' => $event,
... | [
"public",
"function",
"collectTransactionEvent",
"(",
"$",
"event",
",",
"$",
"connection",
")",
"{",
"$",
"source",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"this",
"->",
"findSource",
")",
"{",
"try",
"{",
"$",
"source",
"=",
"$",
"this",
"->",
"findSou... | Collect a database transaction event.
@param string $event
@param \Illuminate\Database\Connection $connection
@return array | [
"Collect",
"a",
"database",
"transaction",
"event",
"."
] | 2d195779ea4f809f69764a795e2ec371dbb76a96 | https://github.com/barryvdh/laravel-debugbar/blob/2d195779ea4f809f69764a795e2ec371dbb76a96/src/DataCollector/QueryCollector.php#L376-L397 | train | Collects transaction event data | [
30522,
2270,
3853,
8145,
6494,
3619,
18908,
3258,
18697,
3372,
1006,
1002,
2724,
1010,
1002,
4434,
1007,
1063,
1002,
3120,
1027,
1031,
1033,
1025,
2065,
1006,
1002,
2023,
1011,
1028,
4858,
8162,
3401,
1007,
1063,
3046,
1063,
1002,
3120,
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/Zend/Mail.php | Zend_Mail.setHeaderEncoding | public function setHeaderEncoding($encoding)
{
$allowed = array(
Zend_Mime::ENCODING_BASE64,
Zend_Mime::ENCODING_QUOTEDPRINTABLE
);
if (!in_array($encoding, $allowed)) {
/**
* @see Zend_Mail_Exception
*/
// require_onc... | php | public function setHeaderEncoding($encoding)
{
$allowed = array(
Zend_Mime::ENCODING_BASE64,
Zend_Mime::ENCODING_QUOTEDPRINTABLE
);
if (!in_array($encoding, $allowed)) {
/**
* @see Zend_Mail_Exception
*/
// require_onc... | [
"public",
"function",
"setHeaderEncoding",
"(",
"$",
"encoding",
")",
"{",
"$",
"allowed",
"=",
"array",
"(",
"Zend_Mime",
"::",
"ENCODING_BASE64",
",",
"Zend_Mime",
"::",
"ENCODING_QUOTEDPRINTABLE",
")",
";",
"if",
"(",
"!",
"in_array",
"(",
"$",
"encoding",
... | Set the encoding of mail headers
@param string $encoding Zend_Mime::ENCODING_QUOTEDPRINTABLE or Zend_Mime::ENCODING_BASE64
@return Zend_Mail Provides fluent interface | [
"Set",
"the",
"encoding",
"of",
"mail",
"headers"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail.php#L335-L351 | train | Set the encoding of the header | [
30522,
2270,
3853,
6662,
13775,
7869,
15305,
4667,
1006,
1002,
17181,
1007,
1063,
1002,
3039,
1027,
9140,
1006,
16729,
2094,
1035,
2771,
4168,
1024,
1024,
17181,
1035,
2918,
21084,
1010,
16729,
2094,
1035,
2771,
4168,
1024,
1024,
17181,
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... |
octobercms/october | modules/system/classes/PluginBase.php | PluginBase.getConfigurationFromYaml | protected function getConfigurationFromYaml($exceptionMessage = null)
{
if ($this->loadedYamlConfiguration !== false) {
return $this->loadedYamlConfiguration;
}
$reflection = new ReflectionClass(get_class($this));
$yamlFilePath = dirname($reflection->getFileName()).'/plu... | php | protected function getConfigurationFromYaml($exceptionMessage = null)
{
if ($this->loadedYamlConfiguration !== false) {
return $this->loadedYamlConfiguration;
}
$reflection = new ReflectionClass(get_class($this));
$yamlFilePath = dirname($reflection->getFileName()).'/plu... | [
"protected",
"function",
"getConfigurationFromYaml",
"(",
"$",
"exceptionMessage",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"loadedYamlConfiguration",
"!==",
"false",
")",
"{",
"return",
"$",
"this",
"->",
"loadedYamlConfiguration",
";",
"}",
"$",
... | Read configuration from YAML file
@param string|null $exceptionMessage
@return array|bool
@throws SystemException | [
"Read",
"configuration",
"from",
"YAML",
"file"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/PluginBase.php#L278-L302 | train | Get the plugin configuration from the YAML file | [
30522,
5123,
3853,
2131,
8663,
8873,
27390,
3370,
19699,
16940,
3286,
2140,
1006,
1002,
6453,
7834,
3736,
3351,
1027,
19701,
1007,
1063,
2065,
1006,
1002,
2023,
1011,
1028,
8209,
14852,
22499,
2078,
8873,
27390,
3370,
999,
1027,
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... |
symfony/symfony | src/Symfony/Component/Routing/RouteCompiler.php | RouteCompiler.computeRegexp | private static function computeRegexp(array $tokens, int $index, int $firstOptional): string
{
$token = $tokens[$index];
if ('text' === $token[0]) {
// Text tokens
return preg_quote($token[1], self::REGEX_DELIMITER);
} else {
// Variable tokens
... | php | private static function computeRegexp(array $tokens, int $index, int $firstOptional): string
{
$token = $tokens[$index];
if ('text' === $token[0]) {
// Text tokens
return preg_quote($token[1], self::REGEX_DELIMITER);
} else {
// Variable tokens
... | [
"private",
"static",
"function",
"computeRegexp",
"(",
"array",
"$",
"tokens",
",",
"int",
"$",
"index",
",",
"int",
"$",
"firstOptional",
")",
":",
"string",
"{",
"$",
"token",
"=",
"$",
"tokens",
"[",
"$",
"index",
"]",
";",
"if",
"(",
"'text'",
"=... | Computes the regexp used to match a specific token. It can be static text or a subpattern.
@param array $tokens The route tokens
@param int $index The index of the current token
@param int $firstOptional The index of the first optional token
@return string The regexp pattern for a single token | [
"Computes",
"the",
"regexp",
"used",
"to",
"match",
"a",
"specific",
"token",
".",
"It",
"can",
"be",
"static",
"text",
"or",
"a",
"subpattern",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Routing/RouteCompiler.php#L287-L315 | train | Compute the regexp for the token at the given index | [
30522,
2797,
10763,
3853,
3274,
24746,
2595,
2361,
1006,
9140,
1002,
19204,
2015,
1010,
20014,
1002,
5950,
1010,
20014,
1002,
2034,
7361,
3508,
2389,
1007,
1024,
5164,
1063,
1002,
19204,
1027,
1002,
19204,
2015,
1031,
1002,
5950,
1033,
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... |
symfony/symfony | src/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php | FileProfilerStorage.purge | public function purge()
{
$flags = \FilesystemIterator::SKIP_DOTS;
$iterator = new \RecursiveDirectoryIterator($this->folder, $flags);
$iterator = new \RecursiveIteratorIterator($iterator, \RecursiveIteratorIterator::CHILD_FIRST);
foreach ($iterator as $file) {
if (is_fi... | php | public function purge()
{
$flags = \FilesystemIterator::SKIP_DOTS;
$iterator = new \RecursiveDirectoryIterator($this->folder, $flags);
$iterator = new \RecursiveIteratorIterator($iterator, \RecursiveIteratorIterator::CHILD_FIRST);
foreach ($iterator as $file) {
if (is_fi... | [
"public",
"function",
"purge",
"(",
")",
"{",
"$",
"flags",
"=",
"\\",
"FilesystemIterator",
"::",
"SKIP_DOTS",
";",
"$",
"iterator",
"=",
"new",
"\\",
"RecursiveDirectoryIterator",
"(",
"$",
"this",
"->",
"folder",
",",
"$",
"flags",
")",
";",
"$",
"ite... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php#L98-L111 | train | Purges all files in the folder | [
30522,
2270,
3853,
24694,
1006,
1007,
1063,
1002,
9245,
1027,
1032,
6764,
27268,
23238,
14621,
4263,
1024,
1024,
13558,
1035,
14981,
1025,
1002,
2009,
6906,
4263,
1027,
2047,
1032,
28667,
9236,
3512,
4305,
2890,
16761,
10139,
14621,
4263,
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/Rule/Callback.php | HTML_QuickForm2_Rule_Callback.mergeConfig | public static function mergeConfig($localConfig, $globalConfig)
{
if (!isset($globalConfig)) {
$config = $localConfig;
} else {
if (!is_array($globalConfig) ||
!isset($globalConfig['callback']) && !isset($globalConfig['arguments'])
) {
... | php | public static function mergeConfig($localConfig, $globalConfig)
{
if (!isset($globalConfig)) {
$config = $localConfig;
} else {
if (!is_array($globalConfig) ||
!isset($globalConfig['callback']) && !isset($globalConfig['arguments'])
) {
... | [
"public",
"static",
"function",
"mergeConfig",
"(",
"$",
"localConfig",
",",
"$",
"globalConfig",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"globalConfig",
")",
")",
"{",
"$",
"config",
"=",
"$",
"localConfig",
";",
"}",
"else",
"{",
"if",
"(",
"!... | Merges local configuration with that provided for registerRule()
"Global" configuration may be passed to
{@link HTML_QuickForm2_Factory::registerRule()} in either of the
following formats
- callback
- array(['callback' => callback, ]['arguments' => array(...)])
"Local" configuration may be passed to the constructor i... | [
"Merges",
"local",
"configuration",
"with",
"that",
"provided",
"for",
"registerRule",
"()"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Rule/Callback.php#L126-L148 | train | Merge local and global config | [
30522,
2270,
10763,
3853,
13590,
8663,
8873,
2290,
1006,
1002,
2334,
8663,
8873,
2290,
1010,
1002,
3795,
8663,
8873,
2290,
1007,
1063,
2065,
1006,
999,
26354,
3388,
1006,
1002,
3795,
8663,
8873,
2290,
1007,
1007,
1063,
1002,
9530,
8873,
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... |
matomo-org/matomo | libs/HTML/QuickForm2/Rule/Each.php | HTML_QuickForm2_Rule_Each.validateOwner | protected function validateOwner()
{
$rule = clone $this->getConfig();
foreach ($this->owner->getRecursiveIterator(RecursiveIteratorIterator::LEAVES_ONLY) as $child) {
$rule->setOwner($child);
if (!$rule->validateOwner()) {
return false;
}
... | php | protected function validateOwner()
{
$rule = clone $this->getConfig();
foreach ($this->owner->getRecursiveIterator(RecursiveIteratorIterator::LEAVES_ONLY) as $child) {
$rule->setOwner($child);
if (!$rule->validateOwner()) {
return false;
}
... | [
"protected",
"function",
"validateOwner",
"(",
")",
"{",
"$",
"rule",
"=",
"clone",
"$",
"this",
"->",
"getConfig",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"owner",
"->",
"getRecursiveIterator",
"(",
"RecursiveIteratorIterator",
"::",
"LEAVES_ONLY",
... | Validates the owner's children using the template Rule
@return bool Whether all children are valid according to a template Rule | [
"Validates",
"the",
"owner",
"s",
"children",
"using",
"the",
"template",
"Rule"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Rule/Each.php#L81-L91 | train | Validate owner of this node | [
30522,
5123,
3853,
9398,
3686,
12384,
2121,
1006,
1007,
1063,
1002,
3627,
1027,
17598,
1002,
2023,
1011,
1028,
2131,
8663,
8873,
2290,
1006,
1007,
1025,
18921,
6776,
1006,
1002,
2023,
1011,
1028,
3954,
1011,
1028,
2131,
2890,
10841,
2869,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.children | public function children($path)
{
$children = $this->children[(string)$path] ?? [];
return new Collection($children, [], $this);
} | php | public function children($path)
{
$children = $this->children[(string)$path] ?? [];
return new Collection($children, [], $this);
} | [
"public",
"function",
"children",
"(",
"$",
"path",
")",
"{",
"$",
"children",
"=",
"$",
"this",
"->",
"children",
"[",
"(",
"string",
")",
"$",
"path",
"]",
"??",
"[",
"]",
";",
"return",
"new",
"Collection",
"(",
"$",
"children",
",",
"[",
"]",
... | Get children of the path.
@param string $path
@return Collection | [
"Get",
"children",
"of",
"the",
"path",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Page/Pages.php#L404-L409 | train | Get children of path | [
30522,
2270,
3853,
2336,
1006,
1002,
4130,
1007,
1063,
1002,
2336,
1027,
1002,
2023,
1011,
1028,
2336,
1031,
1006,
5164,
1007,
1002,
4130,
1033,
1029,
1029,
1031,
1033,
1025,
2709,
2047,
3074,
1006,
1002,
2336,
1010,
1031,
1033,
1010,
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... |
octobercms/october | modules/cms/twig/DebugExtension.php | DebugExtension.getDataCss | protected function getDataCss($variable)
{
$css = [
'padding' => '7px',
'background-color' => $this->zebra ? '#D8D9DB' : '#FFF',
'color' => '#405261',
];
$type = gettype($variable);
if ($type == 'NULL') {
... | php | protected function getDataCss($variable)
{
$css = [
'padding' => '7px',
'background-color' => $this->zebra ? '#D8D9DB' : '#FFF',
'color' => '#405261',
];
$type = gettype($variable);
if ($type == 'NULL') {
... | [
"protected",
"function",
"getDataCss",
"(",
"$",
"variable",
")",
"{",
"$",
"css",
"=",
"[",
"'padding'",
"=>",
"'7px'",
",",
"'background-color'",
"=>",
"$",
"this",
"->",
"zebra",
"?",
"'#D8D9DB'",
":",
"'#FFF'",
",",
"'color'",
"=>",
"'#405261'",
",",
... | Get the CSS string for the output data
@param mixed $variable
@return string | [
"Get",
"the",
"CSS",
"string",
"for",
"the",
"output",
"data"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/twig/DebugExtension.php#L532-L546 | train | Get data css | [
30522,
5123,
3853,
2131,
2850,
2696,
6169,
2015,
1006,
1002,
8023,
1007,
1063,
1002,
20116,
2015,
1027,
1031,
1005,
11687,
4667,
1005,
1027,
1028,
1005,
1021,
2361,
2595,
1005,
1010,
1005,
4281,
1011,
3609,
1005,
1027,
1028,
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... |
z-song/laravel-admin | src/Grid.php | Grid.addColumn | protected function addColumn($column = '', $label = '')
{
$column = new Column($column, $label);
$column->setGrid($this);
return tap($column, function ($value) {
$this->columns->push($value);
});
} | php | protected function addColumn($column = '', $label = '')
{
$column = new Column($column, $label);
$column->setGrid($this);
return tap($column, function ($value) {
$this->columns->push($value);
});
} | [
"protected",
"function",
"addColumn",
"(",
"$",
"column",
"=",
"''",
",",
"$",
"label",
"=",
"''",
")",
"{",
"$",
"column",
"=",
"new",
"Column",
"(",
"$",
"column",
",",
"$",
"label",
")",
";",
"$",
"column",
"->",
"setGrid",
"(",
"$",
"this",
"... | Add column to grid.
@param string $column
@param string $label
@return Column | [
"Add",
"column",
"to",
"grid",
"."
] | 3e65086f806b54699145f58af53843e5dbbb7994 | https://github.com/z-song/laravel-admin/blob/3e65086f806b54699145f58af53843e5dbbb7994/src/Grid.php#L398-L406 | train | Add column to grid | [
30522,
5123,
3853,
5587,
25778,
2819,
2078,
1006,
1002,
5930,
1027,
1005,
1005,
1010,
1002,
3830,
1027,
1005,
1005,
1007,
1063,
1002,
5930,
1027,
2047,
5930,
1006,
1002,
5930,
1010,
1002,
3830,
1007,
1025,
1002,
5930,
1011,
1028,
2275,
16... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/backend/behaviors/RelationController.php | RelationController.findExistingRelationIds | protected function findExistingRelationIds($checkIds = null)
{
$foreignKeyName = $this->relationModel->getQualifiedKeyName();
$results = $this->relationObject
->getBaseQuery()
->select($foreignKeyName);
if ($checkIds !== null && is_array($checkIds) && count($checkId... | php | protected function findExistingRelationIds($checkIds = null)
{
$foreignKeyName = $this->relationModel->getQualifiedKeyName();
$results = $this->relationObject
->getBaseQuery()
->select($foreignKeyName);
if ($checkIds !== null && is_array($checkIds) && count($checkId... | [
"protected",
"function",
"findExistingRelationIds",
"(",
"$",
"checkIds",
"=",
"null",
")",
"{",
"$",
"foreignKeyName",
"=",
"$",
"this",
"->",
"relationModel",
"->",
"getQualifiedKeyName",
"(",
")",
";",
"$",
"results",
"=",
"$",
"this",
"->",
"relationObject... | Returns the existing record IDs for the relation. | [
"Returns",
"the",
"existing",
"record",
"IDs",
"for",
"the",
"relation",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/behaviors/RelationController.php#L1354-L1367 | train | Find existing relation ids | [
30522,
5123,
3853,
2424,
10288,
2923,
2075,
16570,
3370,
9821,
1006,
1002,
4638,
9821,
1027,
19701,
1007,
1063,
1002,
3097,
14839,
18442,
1027,
1002,
2023,
1011,
1028,
7189,
5302,
9247,
1011,
1028,
2131,
26426,
7810,
14839,
18442,
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... |
matomo-org/matomo | core/CronArchive.php | CronArchive.findInvalidatedSitesToReprocess | private function findInvalidatedSitesToReprocess()
{
$this->updateIdSitesInvalidatedOldReports();
if (count($this->idSitesInvalidatedOldReports) > 0) {
$ids = ", IDs: " . implode(", ", $this->idSitesInvalidatedOldReports);
$this->logger->info("- Will process " . count($this-... | php | private function findInvalidatedSitesToReprocess()
{
$this->updateIdSitesInvalidatedOldReports();
if (count($this->idSitesInvalidatedOldReports) > 0) {
$ids = ", IDs: " . implode(", ", $this->idSitesInvalidatedOldReports);
$this->logger->info("- Will process " . count($this-... | [
"private",
"function",
"findInvalidatedSitesToReprocess",
"(",
")",
"{",
"$",
"this",
"->",
"updateIdSitesInvalidatedOldReports",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"idSitesInvalidatedOldReports",
")",
">",
"0",
")",
"{",
"$",
"ids",
"=... | Return All websites that had reports in the past which were invalidated recently
(see API CoreAdminHome.invalidateArchivedReports)
eg. when using Python log import script
@return array | [
"Return",
"All",
"websites",
"that",
"had",
"reports",
"in",
"the",
"past",
"which",
"were",
"invalidated",
"recently",
"(",
"see",
"API",
"CoreAdminHome",
".",
"invalidateArchivedReports",
")",
"eg",
".",
"when",
"using",
"Python",
"log",
"import",
"script"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/CronArchive.php#L1252-L1264 | train | Find invalid websites to reprocess | [
30522,
2797,
3853,
2424,
2378,
10175,
8524,
3064,
28032,
4355,
5686,
21572,
9623,
2015,
1006,
1007,
1063,
1002,
2023,
1011,
1028,
10651,
9821,
7616,
2378,
10175,
8524,
3064,
11614,
2890,
25378,
1006,
1007,
1025,
2065,
1006,
4175,
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/Form/Console/Descriptor/Descriptor.php | Descriptor.describe | public function describe(OutputInterface $output, $object, array $options = [])
{
$this->output = $output instanceof OutputStyle ? $output : new SymfonyStyle(new ArrayInput([]), $output);
switch (true) {
case null === $object:
$this->describeDefaults($options);
... | php | public function describe(OutputInterface $output, $object, array $options = [])
{
$this->output = $output instanceof OutputStyle ? $output : new SymfonyStyle(new ArrayInput([]), $output);
switch (true) {
case null === $object:
$this->describeDefaults($options);
... | [
"public",
"function",
"describe",
"(",
"OutputInterface",
"$",
"output",
",",
"$",
"object",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"output",
"=",
"$",
"output",
"instanceof",
"OutputStyle",
"?",
"$",
"output",
":",
"... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Console/Descriptor/Descriptor.php#L46-L63 | train | Describes the given object. | [
30522,
2270,
3853,
6235,
1006,
6434,
18447,
2121,
12172,
1002,
6434,
1010,
1002,
4874,
1010,
9140,
1002,
7047,
1027,
1031,
1033,
1007,
1063,
1002,
2023,
1011,
1028,
6434,
1027,
1002,
6434,
6013,
11253,
27852,
27983,
1029,
1002,
6434,
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... |
symfony/symfony | src/Symfony/Component/HttpKernel/Kernel.php | Kernel.getBundle | public function getBundle($name)
{
if (!isset($this->bundles[$name])) {
$class = \get_class($this);
$class = 'c' === $class[0] && 0 === strpos($class, "class@anonymous\0") ? get_parent_class($class).'@anonymous' : $class;
throw new \InvalidArgumentException(sprintf('Bund... | php | public function getBundle($name)
{
if (!isset($this->bundles[$name])) {
$class = \get_class($this);
$class = 'c' === $class[0] && 0 === strpos($class, "class@anonymous\0") ? get_parent_class($class).'@anonymous' : $class;
throw new \InvalidArgumentException(sprintf('Bund... | [
"public",
"function",
"getBundle",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"bundles",
"[",
"$",
"name",
"]",
")",
")",
"{",
"$",
"class",
"=",
"\\",
"get_class",
"(",
"$",
"this",
")",
";",
"$",
"class",
"="... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/Kernel.php#L225-L235 | train | Get bundle by name | [
30522,
2270,
3853,
2131,
27265,
2571,
1006,
1002,
2171,
1007,
1063,
2065,
1006,
999,
26354,
3388,
1006,
1002,
2023,
1011,
1028,
26825,
1031,
1002,
2171,
1033,
1007,
1007,
1063,
1002,
2465,
1027,
1032,
2131,
1035,
2465,
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/Messenger/Command/ConsumeMessagesCommand.php | ConsumeMessagesCommand.interact | protected function interact(InputInterface $input, OutputInterface $output)
{
$io = new SymfonyStyle($input, $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output);
if ($this->receiverNames && 0 === \count($input->getArgument('receivers'))) {
$io->block('Which ... | php | protected function interact(InputInterface $input, OutputInterface $output)
{
$io = new SymfonyStyle($input, $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output);
if ($this->receiverNames && 0 === \count($input->getArgument('receivers'))) {
$io->block('Which ... | [
"protected",
"function",
"interact",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"io",
"=",
"new",
"SymfonyStyle",
"(",
"$",
"input",
",",
"$",
"output",
"instanceof",
"ConsoleOutputInterface",
"?",
"$",
"output",... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Messenger/Command/ConsumeMessagesCommand.php#L126-L147 | train | Interacts with the user to select which transports to consume messages from | [
30522,
5123,
3853,
11835,
1006,
7953,
18447,
2121,
12172,
1002,
7953,
1010,
6434,
18447,
2121,
12172,
1002,
6434,
1007,
1063,
1002,
22834,
1027,
2047,
25353,
2213,
14876,
4890,
21756,
2571,
1006,
1002,
7953,
1010,
1002,
6434,
6013,
11253,
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/Bundle/FrameworkBundle/Console/Descriptor/JsonDescriptor.php | JsonDescriptor.describeContainerServices | protected function describeContainerServices(ContainerBuilder $builder, array $options = [])
{
$serviceIds = isset($options['tag']) && $options['tag'] ? array_keys($builder->findTaggedServiceIds($options['tag'])) : $builder->getServiceIds();
$showHidden = isset($options['show_hidden']) && $options['... | php | protected function describeContainerServices(ContainerBuilder $builder, array $options = [])
{
$serviceIds = isset($options['tag']) && $options['tag'] ? array_keys($builder->findTaggedServiceIds($options['tag'])) : $builder->getServiceIds();
$showHidden = isset($options['show_hidden']) && $options['... | [
"protected",
"function",
"describeContainerServices",
"(",
"ContainerBuilder",
"$",
"builder",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"serviceIds",
"=",
"isset",
"(",
"$",
"options",
"[",
"'tag'",
"]",
")",
"&&",
"$",
"options",
"[",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/JsonDescriptor.php#L101-L130 | train | Describes the container services | [
30522,
5123,
3853,
6235,
8663,
18249,
2545,
2121,
7903,
2229,
1006,
11661,
8569,
23891,
2099,
1002,
12508,
1010,
9140,
1002,
7047,
1027,
1031,
1033,
1007,
1063,
1002,
2326,
9821,
1027,
26354,
3388,
1006,
1002,
7047,
1031,
1005,
6415,
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... |
laravel/framework | src/Illuminate/Console/Scheduling/ManagesFrequencies.php | ManagesFrequencies.inTimeInterval | private function inTimeInterval($startTime, $endTime)
{
return function () use ($startTime, $endTime) {
return Carbon::now($this->timezone)->between(
Carbon::parse($startTime, $this->timezone),
Carbon::parse($endTime, $this->timezone),
true
... | php | private function inTimeInterval($startTime, $endTime)
{
return function () use ($startTime, $endTime) {
return Carbon::now($this->timezone)->between(
Carbon::parse($startTime, $this->timezone),
Carbon::parse($endTime, $this->timezone),
true
... | [
"private",
"function",
"inTimeInterval",
"(",
"$",
"startTime",
",",
"$",
"endTime",
")",
"{",
"return",
"function",
"(",
")",
"use",
"(",
"$",
"startTime",
",",
"$",
"endTime",
")",
"{",
"return",
"Carbon",
"::",
"now",
"(",
"$",
"this",
"->",
"timezo... | Schedule the event to run between start and end time.
@param string $startTime
@param string $endTime
@return \Closure | [
"Schedule",
"the",
"event",
"to",
"run",
"between",
"start",
"and",
"end",
"time",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Console/Scheduling/ManagesFrequencies.php#L53-L62 | train | Returns a closure that will check if the time interval is between the start and end time | [
30522,
2797,
3853,
20014,
14428,
18447,
2121,
10175,
1006,
1002,
2707,
7292,
1010,
1002,
2203,
7292,
1007,
1063,
2709,
3853,
1006,
1007,
2224,
1006,
1002,
2707,
7292,
1010,
1002,
2203,
7292,
1007,
1063,
2709,
6351,
1024,
1024,
2085,
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/CronArchive.php | CronArchive.end | public function end()
{
/**
* This event is triggered after archiving.
*
* @param CronArchive $this
*/
Piwik::postEvent('CronArchive.end', array($this));
if (empty($this->errors)) {
// No error -> Logs the successful script execution until com... | php | public function end()
{
/**
* This event is triggered after archiving.
*
* @param CronArchive $this
*/
Piwik::postEvent('CronArchive.end', array($this));
if (empty($this->errors)) {
// No error -> Logs the successful script execution until com... | [
"public",
"function",
"end",
"(",
")",
"{",
"/**\n * This event is triggered after archiving.\n *\n * @param CronArchive $this\n */",
"Piwik",
"::",
"postEvent",
"(",
"'CronArchive.end'",
",",
"array",
"(",
"$",
"this",
")",
")",
";",
"if",
"... | End of the script | [
"End",
"of",
"the",
"script"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/CronArchive.php#L548-L571 | train | End archiving the script | [
30522,
2270,
3853,
2203,
1006,
1007,
1063,
1013,
1008,
1008,
1008,
2023,
2724,
2003,
13330,
2044,
7905,
14966,
1012,
1008,
1008,
1030,
11498,
2213,
13675,
7856,
11140,
3512,
1002,
2023,
1008,
1013,
14255,
9148,
2243,
1024,
1024,
2695,
18697... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Normalizer/DateTimeNormalizer.php | DateTimeNormalizer.formatDateTimeErrors | private function formatDateTimeErrors(array $errors)
{
$formattedErrors = [];
foreach ($errors as $pos => $message) {
$formattedErrors[] = sprintf('at position %d: %s', $pos, $message);
}
return $formattedErrors;
} | php | private function formatDateTimeErrors(array $errors)
{
$formattedErrors = [];
foreach ($errors as $pos => $message) {
$formattedErrors[] = sprintf('at position %d: %s', $pos, $message);
}
return $formattedErrors;
} | [
"private",
"function",
"formatDateTimeErrors",
"(",
"array",
"$",
"errors",
")",
"{",
"$",
"formattedErrors",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"errors",
"as",
"$",
"pos",
"=>",
"$",
"message",
")",
"{",
"$",
"formattedErrors",
"[",
"]",
"=",
"s... | Formats datetime errors.
@return string[] | [
"Formats",
"datetime",
"errors",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Serializer/Normalizer/DateTimeNormalizer.php#L146-L155 | train | Formats DateTime errors | [
30522,
2797,
3853,
4289,
13701,
7292,
2121,
29165,
2015,
1006,
9140,
1002,
10697,
1007,
1063,
1002,
4289,
3064,
2121,
29165,
2015,
1027,
1031,
1033,
1025,
18921,
6776,
1006,
1002,
10697,
2004,
1002,
13433,
2015,
1027,
1028,
1002,
4471,
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... |
laravel/framework | src/Illuminate/View/Factory.php | Factory.renderEach | public function renderEach($view, $data, $iterator, $empty = 'raw|')
{
$result = '';
// If is actually data in the array, we will loop through the data and append
// an instance of the partial view to the final result HTML passing in the
// iterated value of this data array, allowin... | php | public function renderEach($view, $data, $iterator, $empty = 'raw|')
{
$result = '';
// If is actually data in the array, we will loop through the data and append
// an instance of the partial view to the final result HTML passing in the
// iterated value of this data array, allowin... | [
"public",
"function",
"renderEach",
"(",
"$",
"view",
",",
"$",
"data",
",",
"$",
"iterator",
",",
"$",
"empty",
"=",
"'raw|'",
")",
"{",
"$",
"result",
"=",
"''",
";",
"// If is actually data in the array, we will loop through the data and append",
"// an instance ... | Get the rendered contents of a partial from a loop.
@param string $view
@param array $data
@param string $iterator
@param string $empty
@return string | [
"Get",
"the",
"rendered",
"contents",
"of",
"a",
"partial",
"from",
"a",
"loop",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/View/Factory.php#L193-L218 | train | Render each partial view | [
30522,
2270,
3853,
17552,
5243,
2818,
1006,
1002,
3193,
1010,
1002,
2951,
1010,
1002,
2009,
6906,
4263,
1010,
1002,
4064,
1027,
1005,
6315,
1064,
1005,
1007,
1063,
1002,
2765,
1027,
1005,
1005,
1025,
1013,
1013,
2065,
2003,
2941,
2951,
19... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Console/Cli/CleanCommand.php | CleanCommand.setupConsole | public function setupConsole(InputInterface $input, OutputInterface $output)
{
$this->input = $input;
$this->output = $output;
$this->output->getFormatter()->setStyle('normal', new OutputFormatterStyle('white'));
$this->output->getFormatter()->setStyle('yellow', new OutputFormatterS... | php | public function setupConsole(InputInterface $input, OutputInterface $output)
{
$this->input = $input;
$this->output = $output;
$this->output->getFormatter()->setStyle('normal', new OutputFormatterStyle('white'));
$this->output->getFormatter()->setStyle('yellow', new OutputFormatterS... | [
"public",
"function",
"setupConsole",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"this",
"->",
"input",
"=",
"$",
"input",
";",
"$",
"this",
"->",
"output",
"=",
"$",
"output",
";",
"$",
"this",
"->",
"ou... | Set colors style definition for the formatter.
@param InputInterface $input
@param OutputInterface $output | [
"Set",
"colors",
"style",
"definition",
"for",
"the",
"formatter",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Console/Cli/CleanCommand.php#L309-L321 | train | Setup Console. | [
30522,
2270,
3853,
16437,
8663,
19454,
2063,
1006,
7953,
18447,
2121,
12172,
1002,
7953,
1010,
6434,
18447,
2121,
12172,
1002,
6434,
1007,
1063,
1002,
2023,
1011,
1028,
7953,
1027,
1002,
7953,
1025,
1002,
30524,
2047,
6434,
14192,
20097,
21... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Loader/AnnotationClassLoader.php | AnnotationClassLoader.getDefaultRouteName | protected function getDefaultRouteName(\ReflectionClass $class, \ReflectionMethod $method)
{
$name = strtolower(str_replace('\\', '_', $class->name).'_'.$method->name);
if ($this->defaultRouteIndex > 0) {
$name .= '_'.$this->defaultRouteIndex;
}
++$this->defaultRouteIndex... | php | protected function getDefaultRouteName(\ReflectionClass $class, \ReflectionMethod $method)
{
$name = strtolower(str_replace('\\', '_', $class->name).'_'.$method->name);
if ($this->defaultRouteIndex > 0) {
$name .= '_'.$this->defaultRouteIndex;
}
++$this->defaultRouteIndex... | [
"protected",
"function",
"getDefaultRouteName",
"(",
"\\",
"ReflectionClass",
"$",
"class",
",",
"\\",
"ReflectionMethod",
"$",
"method",
")",
"{",
"$",
"name",
"=",
"strtolower",
"(",
"str_replace",
"(",
"'\\\\'",
",",
"'_'",
",",
"$",
"class",
"->",
"name"... | Gets the default route name for a class method.
@param \ReflectionClass $class
@param \ReflectionMethod $method
@return string | [
"Gets",
"the",
"default",
"route",
"name",
"for",
"a",
"class",
"method",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Routing/Loader/AnnotationClassLoader.php#L249-L258 | train | Get default route name | [
30522,
5123,
3853,
2131,
3207,
7011,
11314,
22494,
6528,
14074,
1006,
1032,
9185,
26266,
1002,
2465,
1010,
1032,
9185,
11368,
6806,
2094,
1002,
4118,
1007,
1063,
1002,
2171,
1027,
2358,
5339,
12898,
13777,
1006,
2358,
2099,
1035,
5672,
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/ViewDataTable/Request.php | Request.getDefaultOrCurrent | protected function getDefaultOrCurrent($nameVar)
{
if (isset($_GET[$nameVar])) {
return Common::sanitizeInputValue($_GET[$nameVar]);
}
return $this->getDefault($nameVar);
} | php | protected function getDefaultOrCurrent($nameVar)
{
if (isset($_GET[$nameVar])) {
return Common::sanitizeInputValue($_GET[$nameVar]);
}
return $this->getDefault($nameVar);
} | [
"protected",
"function",
"getDefaultOrCurrent",
"(",
"$",
"nameVar",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"_GET",
"[",
"$",
"nameVar",
"]",
")",
")",
"{",
"return",
"Common",
"::",
"sanitizeInputValue",
"(",
"$",
"_GET",
"[",
"$",
"nameVar",
"]",
")... | Returns, for a given parameter, the value of this parameter in the REQUEST array.
If not set, returns the default value for this parameter @see getDefault()
@param string $nameVar
@return string|mixed Value of this parameter | [
"Returns",
"for",
"a",
"given",
"parameter",
"the",
"value",
"of",
"this",
"parameter",
"in",
"the",
"REQUEST",
"array",
".",
"If",
"not",
"set",
"returns",
"the",
"default",
"value",
"for",
"this",
"parameter",
"@see",
"getDefault",
"()"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/ViewDataTable/Request.php#L123-L130 | train | Returns the default value or the current value if it is set | [
30522,
5123,
3853,
2131,
3207,
7011,
11314,
2953,
10841,
14343,
3372,
1006,
1002,
2171,
10755,
1007,
1063,
2065,
1006,
26354,
3388,
1006,
1002,
1035,
2131,
1031,
1002,
2171,
10755,
1033,
1007,
1007,
1063,
2709,
2691,
1024,
1024,
2624,
25090... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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_table_rules | static protected function _set_table_rules(\DOMElement $node, $value)
{
$new_style = "; border-collapse: collapse;";
switch ($value) {
case "none":
$new_style .= "border-style: none;";
break;
case "groups":
// FIXME: unsupport... | php | static protected function _set_table_rules(\DOMElement $node, $value)
{
$new_style = "; border-collapse: collapse;";
switch ($value) {
case "none":
$new_style .= "border-style: none;";
break;
case "groups":
// FIXME: unsupport... | [
"static",
"protected",
"function",
"_set_table_rules",
"(",
"\\",
"DOMElement",
"$",
"node",
",",
"$",
"value",
")",
"{",
"$",
"new_style",
"=",
"\"; border-collapse: collapse;\"",
";",
"switch",
"(",
"$",
"value",
")",
"{",
"case",
"\"none\"",
":",
"$",
"ne... | @param \DOMElement $node
@param string $value
@return null|string | [
"@param",
"\\",
"DOMElement",
"$node",
"@param",
"string",
"$value"
] | 75f13c700009be21a1965dc2c5b68a8708c22ba2 | https://github.com/dompdf/dompdf/blob/75f13c700009be21a1965dc2c5b68a8708c22ba2/src/Css/AttributeTranslator.php#L420-L462 | train | Set table rules | [
30522,
10763,
5123,
3853,
1035,
2275,
1035,
2795,
1035,
3513,
1006,
1032,
8514,
16930,
4765,
1002,
13045,
1010,
1002,
3643,
1007,
1063,
1002,
2047,
1035,
2806,
1027,
1000,
1025,
3675,
1011,
7859,
1024,
7859,
1025,
1000,
1025,
6942,
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/Templating/PhpEngine.php | PhpEngine.set | public function set(HelperInterface $helper, $alias = null)
{
$this->helpers[$helper->getName()] = $helper;
if (null !== $alias) {
$this->helpers[$alias] = $helper;
}
$helper->setCharset($this->charset);
} | php | public function set(HelperInterface $helper, $alias = null)
{
$this->helpers[$helper->getName()] = $helper;
if (null !== $alias) {
$this->helpers[$alias] = $helper;
}
$helper->setCharset($this->charset);
} | [
"public",
"function",
"set",
"(",
"HelperInterface",
"$",
"helper",
",",
"$",
"alias",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"helpers",
"[",
"$",
"helper",
"->",
"getName",
"(",
")",
"]",
"=",
"$",
"helper",
";",
"if",
"(",
"null",
"!==",
"$",
... | Sets a helper.
@param HelperInterface $helper The helper instance
@param string $alias An alias | [
"Sets",
"a",
"helper",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Templating/PhpEngine.php#L248-L256 | train | Set a helper | [
30522,
2270,
3853,
2275,
1006,
2393,
23282,
3334,
12172,
1002,
2393,
2121,
1010,
1002,
14593,
1027,
19701,
30524,
1027,
1002,
2393,
2121,
1025,
2065,
1006,
19701,
999,
1027,
1027,
1002,
14593,
1007,
1063,
1002,
2023,
1011,
1028,
2393,
2545,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/JsonResponse.php | JsonResponse.setCallback | public function setCallback($callback = null)
{
if (null !== $callback) {
// partially taken from http://www.geekality.net/2011/08/03/valid-javascript-identifier/
// partially taken from https://github.com/willdurand/JsonpCallbackValidator
// JsonpCallbackValidator i... | php | public function setCallback($callback = null)
{
if (null !== $callback) {
// partially taken from http://www.geekality.net/2011/08/03/valid-javascript-identifier/
// partially taken from https://github.com/willdurand/JsonpCallbackValidator
// JsonpCallbackValidator i... | [
"public",
"function",
"setCallback",
"(",
"$",
"callback",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"callback",
")",
"{",
"// partially taken from http://www.geekality.net/2011/08/03/valid-javascript-identifier/",
"// partially taken from https://github.com/willdur... | Sets the JSONP callback.
@param string|null $callback The JSONP callback or null to use none
@return $this
@throws \InvalidArgumentException When the callback name is not valid | [
"Sets",
"the",
"JSONP",
"callback",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpFoundation/JsonResponse.php#L89-L113 | train | Set the callback name | [
30522,
2270,
3853,
2275,
9289,
20850,
8684,
1006,
1002,
2655,
5963,
1027,
19701,
1007,
1063,
2065,
1006,
19701,
999,
1027,
1027,
1002,
2655,
5963,
1007,
1063,
1013,
1013,
6822,
2579,
2013,
30524,
1012,
29294,
23732,
1012,
5658,
1013,
2249,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Console/PolicyMakeCommand.php | PolicyMakeCommand.buildClass | protected function buildClass($name)
{
$stub = $this->replaceUserNamespace(
parent::buildClass($name)
);
$model = $this->option('model');
return $model ? $this->replaceModel($stub, $model) : $stub;
} | php | protected function buildClass($name)
{
$stub = $this->replaceUserNamespace(
parent::buildClass($name)
);
$model = $this->option('model');
return $model ? $this->replaceModel($stub, $model) : $stub;
} | [
"protected",
"function",
"buildClass",
"(",
"$",
"name",
")",
"{",
"$",
"stub",
"=",
"$",
"this",
"->",
"replaceUserNamespace",
"(",
"parent",
"::",
"buildClass",
"(",
"$",
"name",
")",
")",
";",
"$",
"model",
"=",
"$",
"this",
"->",
"option",
"(",
"... | Build the class with the given name.
@param string $name
@return string | [
"Build",
"the",
"class",
"with",
"the",
"given",
"name",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Console/PolicyMakeCommand.php#L38-L47 | train | Build the class with the user namespace and the model | [
30522,
5123,
3853,
3857,
26266,
1006,
1002,
2171,
1007,
1063,
1002,
24646,
2497,
1027,
1002,
2023,
1011,
1028,
5672,
20330,
18442,
23058,
1006,
6687,
1024,
1024,
3857,
26266,
1006,
1002,
2171,
1007,
1007,
1025,
1002,
2944,
1027,
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... |
matomo-org/matomo | plugins/UserCountry/LocationProvider.php | LocationProvider.getAllProviders | public static function getAllProviders()
{
if (is_null(self::$providers)) {
self::$providers = array();
$plugins = PluginManager::getInstance()->getPluginsLoadedAndActivated();
foreach ($plugins as $plugin) {
foreach (self::getLocationProviders($plugin) ... | php | public static function getAllProviders()
{
if (is_null(self::$providers)) {
self::$providers = array();
$plugins = PluginManager::getInstance()->getPluginsLoadedAndActivated();
foreach ($plugins as $plugin) {
foreach (self::getLocationProviders($plugin) ... | [
"public",
"static",
"function",
"getAllProviders",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"self",
"::",
"$",
"providers",
")",
")",
"{",
"self",
"::",
"$",
"providers",
"=",
"array",
"(",
")",
";",
"$",
"plugins",
"=",
"PluginManager",
"::",
"getIns... | Returns every available provider instance.
@return LocationProvider[] | [
"Returns",
"every",
"available",
"provider",
"instance",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UserCountry/LocationProvider.php#L166-L179 | train | Get all location providers | [
30522,
2270,
10763,
3853,
2131,
8095,
21572,
17258,
2545,
1006,
1007,
1063,
2065,
1006,
2003,
1035,
19701,
1006,
2969,
1024,
1024,
1002,
11670,
1007,
1007,
1063,
2969,
1024,
1024,
1002,
11670,
1027,
9140,
1006,
1007,
1025,
1002,
13354,
7076... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/IgnoreCookie.php | IgnoreCookie.getTrackingCookie | private static function getTrackingCookie()
{
$cookie_name = @Config::getInstance()->Tracker['cookie_name'];
$cookie_path = @Config::getInstance()->Tracker['cookie_path'];
return new Cookie($cookie_name, null, $cookie_path);
} | php | private static function getTrackingCookie()
{
$cookie_name = @Config::getInstance()->Tracker['cookie_name'];
$cookie_path = @Config::getInstance()->Tracker['cookie_path'];
return new Cookie($cookie_name, null, $cookie_path);
} | [
"private",
"static",
"function",
"getTrackingCookie",
"(",
")",
"{",
"$",
"cookie_name",
"=",
"@",
"Config",
"::",
"getInstance",
"(",
")",
"->",
"Tracker",
"[",
"'cookie_name'",
"]",
";",
"$",
"cookie_path",
"=",
"@",
"Config",
"::",
"getInstance",
"(",
"... | Get tracking cookie
@return Cookie | [
"Get",
"tracking",
"cookie"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/IgnoreCookie.php#L25-L31 | train | Get tracking cookie | [
30522,
2797,
10763,
3853,
2131,
6494,
23177,
30524,
1006,
1007,
1011,
1028,
27080,
1031,
1005,
17387,
1035,
4130,
1005,
1033,
1025,
2709,
2047,
17387,
1006,
1002,
17387,
1035,
2171,
1010,
19701,
1010,
1002,
17387,
1035,
4130,
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... |
laravel/framework | src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php | HasRelationships.newHasManyThrough | protected function newHasManyThrough(Builder $query, Model $farParent, Model $throughParent, $firstKey, $secondKey, $localKey, $secondLocalKey)
{
return new HasManyThrough($query, $farParent, $throughParent, $firstKey, $secondKey, $localKey, $secondLocalKey);
} | php | protected function newHasManyThrough(Builder $query, Model $farParent, Model $throughParent, $firstKey, $secondKey, $localKey, $secondLocalKey)
{
return new HasManyThrough($query, $farParent, $throughParent, $firstKey, $secondKey, $localKey, $secondLocalKey);
} | [
"protected",
"function",
"newHasManyThrough",
"(",
"Builder",
"$",
"query",
",",
"Model",
"$",
"farParent",
",",
"Model",
"$",
"throughParent",
",",
"$",
"firstKey",
",",
"$",
"secondKey",
",",
"$",
"localKey",
",",
"$",
"secondLocalKey",
")",
"{",
"return",... | Instantiate a new HasManyThrough relationship.
@param \Illuminate\Database\Eloquent\Builder $query
@param \Illuminate\Database\Eloquent\Model $farParent
@param \Illuminate\Database\Eloquent\Model $throughParent
@param string $firstKey
@param string $secondKey
@param string $localKey
@param string $second... | [
"Instantiate",
"a",
"new",
"HasManyThrough",
"relationship",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php#L390-L393 | train | Creates a HasManyThrough object | [
30522,
5123,
3853,
2047,
14949,
2386,
22123,
8093,
10593,
1006,
12508,
1002,
23032,
1010,
2944,
1002,
2521,
19362,
4765,
1010,
2944,
1002,
2083,
19362,
4765,
1010,
1002,
2034,
14839,
1010,
1002,
2117,
14839,
1010,
1002,
2334,
14839,
1010,
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/Element.php | HTML_QuickForm2_Element.getPersistentContent | protected function getPersistentContent()
{
if (!$this->persistent || null === ($value = $this->getValue())) {
return '';
}
return '<input type="hidden"' . self::getAttributesString(array(
'name' => $this->getName(),
'value' => $value,
'id' ... | php | protected function getPersistentContent()
{
if (!$this->persistent || null === ($value = $this->getValue())) {
return '';
}
return '<input type="hidden"' . self::getAttributesString(array(
'name' => $this->getName(),
'value' => $value,
'id' ... | [
"protected",
"function",
"getPersistentContent",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"persistent",
"||",
"null",
"===",
"(",
"$",
"value",
"=",
"$",
"this",
"->",
"getValue",
"(",
")",
")",
")",
"{",
"return",
"''",
";",
"}",
"return",
... | Generates hidden form field containing the element's value
This is used to pass the frozen element's value if 'persistent freeze'
feature is on
@return string | [
"Generates",
"hidden",
"form",
"field",
"containing",
"the",
"element",
"s",
"value"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Element.php#L77-L87 | train | Get persistent content | [
30522,
5123,
3853,
2131,
7347,
27870,
3372,
8663,
6528,
2102,
1006,
1007,
1063,
2065,
1006,
999,
1002,
2023,
1011,
1028,
14516,
1064,
1064,
19701,
1027,
1027,
1027,
1006,
1002,
3643,
1027,
1002,
2023,
1011,
1028,
2131,
10175,
5657,
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... |
opencart/opencart | upload/system/engine/loader.php | Loader.helper | public function helper($route) {
$file = DIR_SYSTEM . 'helper/' . preg_replace('/[^a-zA-Z0-9_\/]/', '', (string)$route) . '.php';
if (is_file($file)) {
include_once($file);
} else {
throw new \Exception('Error: Could not load helper ' . $route . '!');
}
} | php | public function helper($route) {
$file = DIR_SYSTEM . 'helper/' . preg_replace('/[^a-zA-Z0-9_\/]/', '', (string)$route) . '.php';
if (is_file($file)) {
include_once($file);
} else {
throw new \Exception('Error: Could not load helper ' . $route . '!');
}
} | [
"public",
"function",
"helper",
"(",
"$",
"route",
")",
"{",
"$",
"file",
"=",
"DIR_SYSTEM",
".",
"'helper/'",
".",
"preg_replace",
"(",
"'/[^a-zA-Z0-9_\\/]/'",
",",
"''",
",",
"(",
"string",
")",
"$",
"route",
")",
".",
"'.php'",
";",
"if",
"(",
"is_f... | Helper
@param string $route | [
"Helper"
] | e7933b56ba05aafb3655c6b490c9733cd18b5c69 | https://github.com/opencart/opencart/blob/e7933b56ba05aafb3655c6b490c9733cd18b5c69/upload/system/engine/loader.php#L169-L177 | train | Load the helper file | [
30522,
2270,
3853,
2393,
2121,
1006,
1002,
2799,
1007,
1063,
1002,
5371,
1027,
16101,
1035,
2291,
1012,
1005,
2393,
2121,
1013,
1005,
1012,
3653,
2290,
1035,
5672,
1006,
1005,
1013,
1031,
1034,
1037,
1011,
23564,
1011,
1062,
2692,
1011,
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/Routing/Route.php | Route.setCondition | public function setCondition($condition)
{
$this->condition = (string) $condition;
$this->compiled = null;
return $this;
} | php | public function setCondition($condition)
{
$this->condition = (string) $condition;
$this->compiled = null;
return $this;
} | [
"public",
"function",
"setCondition",
"(",
"$",
"condition",
")",
"{",
"$",
"this",
"->",
"condition",
"=",
"(",
"string",
")",
"$",
"condition",
";",
"$",
"this",
"->",
"compiled",
"=",
"null",
";",
"return",
"$",
"this",
";",
"}"
] | Sets the condition.
This method implements a fluent interface.
@param string $condition The condition
@return $this | [
"Sets",
"the",
"condition",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Routing/Route.php#L531-L537 | train | Set the condition for this page | [
30522,
2270,
3853,
2275,
8663,
20562,
1006,
1002,
4650,
1007,
1063,
1002,
2023,
1011,
1028,
4650,
1027,
1006,
5164,
1007,
1002,
4650,
1025,
1002,
2023,
1011,
1028,
9227,
1027,
19701,
1025,
2709,
1002,
2023,
1025,
1065,
102,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Request.php | Request.getBaseUrl | public function getBaseUrl()
{
if (null === $this->baseUrl) {
$this->baseUrl = $this->prepareBaseUrl();
}
return $this->baseUrl;
} | php | public function getBaseUrl()
{
if (null === $this->baseUrl) {
$this->baseUrl = $this->prepareBaseUrl();
}
return $this->baseUrl;
} | [
"public",
"function",
"getBaseUrl",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"baseUrl",
")",
"{",
"$",
"this",
"->",
"baseUrl",
"=",
"$",
"this",
"->",
"prepareBaseUrl",
"(",
")",
";",
"}",
"return",
"$",
"this",
"->",
"baseUrl",
... | Returns the root URL from which this request is executed.
The base URL never ends with a /.
This is similar to getBasePath(), except that it also includes the
script filename (e.g. index.php) if one exists.
@return string The raw URL (i.e. not urldecoded) | [
"Returns",
"the",
"root",
"URL",
"from",
"which",
"this",
"request",
"is",
"executed",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpFoundation/Request.php#L871-L878 | train | Get Base Url | [
30522,
2270,
3853,
2131,
15058,
3126,
2140,
1006,
1007,
1063,
2065,
1006,
19701,
1027,
1027,
1027,
1002,
2023,
1011,
1028,
2918,
3126,
2140,
1007,
1063,
1002,
2023,
1011,
1028,
2918,
3126,
2140,
1027,
1002,
2023,
1011,
1028,
7374,
15058,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Auth/Listeners/SendEmailVerificationNotification.php | SendEmailVerificationNotification.handle | public function handle(Registered $event)
{
if ($event->user instanceof MustVerifyEmail && ! $event->user->hasVerifiedEmail()) {
$event->user->sendEmailVerificationNotification();
}
} | php | public function handle(Registered $event)
{
if ($event->user instanceof MustVerifyEmail && ! $event->user->hasVerifiedEmail()) {
$event->user->sendEmailVerificationNotification();
}
} | [
"public",
"function",
"handle",
"(",
"Registered",
"$",
"event",
")",
"{",
"if",
"(",
"$",
"event",
"->",
"user",
"instanceof",
"MustVerifyEmail",
"&&",
"!",
"$",
"event",
"->",
"user",
"->",
"hasVerifiedEmail",
"(",
")",
")",
"{",
"$",
"event",
"->",
... | Handle the event.
@param \Illuminate\Auth\Events\Registered $event
@return void | [
"Handle",
"the",
"event",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Auth/Listeners/SendEmailVerificationNotification.php#L16-L21 | train | Handle the Registration event. | [
30522,
2270,
3853,
5047,
1006,
5068,
1002,
2724,
1007,
1063,
2065,
1006,
1002,
2724,
1011,
1028,
5310,
6013,
11253,
2442,
6299,
8757,
14545,
4014,
1004,
1004,
999,
1002,
2724,
1011,
1028,
5310,
1011,
1028,
2038,
6299,
7810,
14545,
4014,
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.php | Renderer.shouldWrapArrayBeforeRendering | protected static function shouldWrapArrayBeforeRendering(
$array, $wrapSingleValues = true, $isAssociativeArray = null)
{
if (empty($array)) {
return false;
}
if ($isAssociativeArray === null) {
$isAssociativeArray = Piwik::isAssociativeArray($array);
... | php | protected static function shouldWrapArrayBeforeRendering(
$array, $wrapSingleValues = true, $isAssociativeArray = null)
{
if (empty($array)) {
return false;
}
if ($isAssociativeArray === null) {
$isAssociativeArray = Piwik::isAssociativeArray($array);
... | [
"protected",
"static",
"function",
"shouldWrapArrayBeforeRendering",
"(",
"$",
"array",
",",
"$",
"wrapSingleValues",
"=",
"true",
",",
"$",
"isAssociativeArray",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"array",
")",
")",
"{",
"return",
"false",... | Returns true if an array should be wrapped before rendering. This is used to
mimic quirks in the old rendering logic (for backwards compatibility). The
specific meaning of 'wrap' is left up to the Renderer. For XML, this means a
new <row> node. For JSON, this means wrapping in an array.
In the old code, arrays were ad... | [
"Returns",
"true",
"if",
"an",
"array",
"should",
"be",
"wrapped",
"before",
"rendering",
".",
"This",
"is",
"used",
"to",
"mimic",
"quirks",
"in",
"the",
"old",
"rendering",
"logic",
"(",
"for",
"backwards",
"compatibility",
")",
".",
"The",
"specific",
"... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Renderer.php#L346-L382 | train | Returns true if the array should be wrapped before rendering | [
30522,
5123,
10763,
3853,
2323,
13088,
22068,
11335,
2100,
4783,
29278,
7869,
11563,
2075,
1006,
1002,
9140,
1010,
1002,
19735,
2075,
20414,
2389,
15808,
1027,
2995,
1010,
1002,
18061,
24137,
7405,
6024,
2906,
9447,
1027,
19701,
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... |
octobercms/october | modules/cms/twig/PlaceholderNode.php | PlaceholderNode.compile | public function compile(Twig_Compiler $compiler)
{
$hasBody = $this->hasNode('default');
$varId = '__placeholder_'.$this->getAttribute('name').'_default_contents';
$compiler
->addDebugInfo($this)
->write("\$context[")
->raw("'".$varId."'")
->ra... | php | public function compile(Twig_Compiler $compiler)
{
$hasBody = $this->hasNode('default');
$varId = '__placeholder_'.$this->getAttribute('name').'_default_contents';
$compiler
->addDebugInfo($this)
->write("\$context[")
->raw("'".$varId."'")
->ra... | [
"public",
"function",
"compile",
"(",
"Twig_Compiler",
"$",
"compiler",
")",
"{",
"$",
"hasBody",
"=",
"$",
"this",
"->",
"hasNode",
"(",
"'default'",
")",
";",
"$",
"varId",
"=",
"'__placeholder_'",
".",
"$",
"this",
"->",
"getAttribute",
"(",
"'name'",
... | Compiles the node to PHP.
@param Twig_Compiler $compiler A Twig_Compiler instance | [
"Compiles",
"the",
"node",
"to",
"PHP",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/twig/PlaceholderNode.php#L33-L82 | train | Compiles the placeholder content into the Twig code | [
30522,
2270,
3853,
4012,
22090,
1006,
1056,
16279,
1035,
21624,
1002,
21624,
1007,
1063,
1002,
2038,
23684,
1027,
1002,
2023,
1011,
1028,
8440,
10244,
1006,
1005,
12398,
1005,
1007,
1025,
1002,
13075,
3593,
1027,
1005,
1035,
1035,
2173,
145... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/RouteCollectionBuilder.php | RouteCollectionBuilder.add | public function add($path, $controller, $name = null)
{
$route = new Route($path);
$route->setDefault('_controller', $controller);
$this->addRoute($route, $name);
return $route;
} | php | public function add($path, $controller, $name = null)
{
$route = new Route($path);
$route->setDefault('_controller', $controller);
$this->addRoute($route, $name);
return $route;
} | [
"public",
"function",
"add",
"(",
"$",
"path",
",",
"$",
"controller",
",",
"$",
"name",
"=",
"null",
")",
"{",
"$",
"route",
"=",
"new",
"Route",
"(",
"$",
"path",
")",
";",
"$",
"route",
"->",
"setDefault",
"(",
"'_controller'",
",",
"$",
"contro... | Adds a route and returns it for future modification.
@param string $path The route path
@param string $controller The route's controller
@param string|null $name The name to give this route
@return Route | [
"Adds",
"a",
"route",
"and",
"returns",
"it",
"for",
"future",
"modification",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Routing/RouteCollectionBuilder.php#L96-L103 | train | Add route to the route list | [
30522,
2270,
3853,
5587,
1006,
1002,
4130,
1010,
1002,
11486,
1010,
1002,
2171,
1027,
19701,
1007,
1063,
1002,
2799,
1027,
2047,
2799,
1006,
1002,
4130,
1007,
1025,
1002,
2799,
1011,
1028,
2275,
3207,
7011,
11314,
1006,
1005,
1035,
11486,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Cache/Traits/ContractsTrait.php | ContractsTrait.setCallbackWrapper | public function setCallbackWrapper(?callable $callbackWrapper): callable
{
$previousWrapper = $this->callbackWrapper;
$this->callbackWrapper = $callbackWrapper ?? function (callable $callback, ItemInterface $item, bool &$save, CacheInterface $pool, \Closure $setMetadata, ?LoggerInterface $logger) {
... | php | public function setCallbackWrapper(?callable $callbackWrapper): callable
{
$previousWrapper = $this->callbackWrapper;
$this->callbackWrapper = $callbackWrapper ?? function (callable $callback, ItemInterface $item, bool &$save, CacheInterface $pool, \Closure $setMetadata, ?LoggerInterface $logger) {
... | [
"public",
"function",
"setCallbackWrapper",
"(",
"?",
"callable",
"$",
"callbackWrapper",
")",
":",
"callable",
"{",
"$",
"previousWrapper",
"=",
"$",
"this",
"->",
"callbackWrapper",
";",
"$",
"this",
"->",
"callbackWrapper",
"=",
"$",
"callbackWrapper",
"??",
... | Wraps the callback passed to ->get() in a callable.
@return callable the previous callback wrapper | [
"Wraps",
"the",
"callback",
"passed",
"to",
"-",
">",
"get",
"()",
"in",
"a",
"callable",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Cache/Traits/ContractsTrait.php#L41-L49 | train | Set the callback wrapper | [
30522,
2270,
3853,
2275,
9289,
20850,
8684,
13088,
29098,
2121,
1006,
1029,
2655,
3085,
1002,
2655,
5963,
13088,
29098,
2121,
1007,
1024,
2655,
3085,
1063,
1002,
3025,
13088,
29098,
2121,
1027,
1002,
2023,
1011,
1028,
2655,
5963,
13088,
290... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/controllers/Index.php | Index.makeTemplateFormWidget | protected function makeTemplateFormWidget($type, $template, $alias = null)
{
$formConfigs = [
'page' => '~/modules/cms/classes/page/fields.yaml',
'partial' => '~/modules/cms/classes/partial/fields.yaml',
'layout' => '~/modules/cms/classes/layout/fields.yaml',
... | php | protected function makeTemplateFormWidget($type, $template, $alias = null)
{
$formConfigs = [
'page' => '~/modules/cms/classes/page/fields.yaml',
'partial' => '~/modules/cms/classes/partial/fields.yaml',
'layout' => '~/modules/cms/classes/layout/fields.yaml',
... | [
"protected",
"function",
"makeTemplateFormWidget",
"(",
"$",
"type",
",",
"$",
"template",
",",
"$",
"alias",
"=",
"null",
")",
"{",
"$",
"formConfigs",
"=",
"[",
"'page'",
"=>",
"'~/modules/cms/classes/page/fields.yaml'",
",",
"'partial'",
"=>",
"'~/modules/cms/c... | Returns a form widget for a specified template type.
@param string $type
@param string $template
@param string $alias
@return Backend\Widgets\Form | [
"Returns",
"a",
"form",
"widget",
"for",
"a",
"specified",
"template",
"type",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/cms/controllers/Index.php#L525-L544 | train | Make template form widget | [
30522,
5123,
3853,
2191,
18532,
15725,
14192,
9148,
24291,
1006,
1002,
2828,
1010,
1002,
23561,
1010,
1002,
14593,
1027,
19701,
1007,
1063,
1002,
2433,
8663,
8873,
5620,
1027,
1031,
1005,
3931,
1005,
1027,
1028,
1005,
1066,
1013,
14184,
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... |
getgrav/grav | system/src/Grav/Framework/File/DataFile.php | DataFile.save | public function save($data): void
{
if (\is_string($data)) {
// Make sure that the string is valid data.
try {
$this->formatter->decode($data);
} catch (RuntimeException $e) {
throw new RuntimeException(sprintf("Failed to save file '%s': %s... | php | public function save($data): void
{
if (\is_string($data)) {
// Make sure that the string is valid data.
try {
$this->formatter->decode($data);
} catch (RuntimeException $e) {
throw new RuntimeException(sprintf("Failed to save file '%s': %s... | [
"public",
"function",
"save",
"(",
"$",
"data",
")",
":",
"void",
"{",
"if",
"(",
"\\",
"is_string",
"(",
"$",
"data",
")",
")",
"{",
"// Make sure that the string is valid data.",
"try",
"{",
"$",
"this",
"->",
"formatter",
"->",
"decode",
"(",
"$",
"da... | {@inheritdoc}
@see FileInterface::save() | [
"{"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Framework/File/DataFile.php#L53-L68 | train | Save the data to the file | [
30522,
2270,
3853,
3828,
1006,
1002,
2951,
1007,
1024,
11675,
1063,
2065,
1006,
1032,
2003,
1035,
5164,
1006,
1002,
2951,
1007,
1007,
1063,
1013,
1013,
2191,
2469,
2008,
1996,
5164,
2003,
9398,
2951,
1012,
3046,
1063,
1002,
2023,
1011,
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... |
matomo-org/matomo | core/Piwik.php | Piwik.postEvent | public static function postEvent($eventName, $params = array(), $pending = false, $plugins = null)
{
EventDispatcher::getInstance()->postEvent($eventName, $params, $pending, $plugins);
} | php | public static function postEvent($eventName, $params = array(), $pending = false, $plugins = null)
{
EventDispatcher::getInstance()->postEvent($eventName, $params, $pending, $plugins);
} | [
"public",
"static",
"function",
"postEvent",
"(",
"$",
"eventName",
",",
"$",
"params",
"=",
"array",
"(",
")",
",",
"$",
"pending",
"=",
"false",
",",
"$",
"plugins",
"=",
"null",
")",
"{",
"EventDispatcher",
"::",
"getInstance",
"(",
")",
"->",
"post... | Post an event to Piwik's event dispatcher which will execute the event's observers.
@param string $eventName The event name.
@param array $params The parameter array to forward to observer callbacks.
@param bool $pending If true, plugins that are loaded after this event is fired will
have their observers for this even... | [
"Post",
"an",
"event",
"to",
"Piwik",
"s",
"event",
"dispatcher",
"which",
"will",
"execute",
"the",
"event",
"s",
"observers",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Piwik.php#L778-L781 | train | Post an event to the current page | [
30522,
2270,
10763,
3853,
2695,
18697,
3372,
1006,
1002,
2724,
18442,
1010,
1002,
11498,
5244,
1027,
9140,
1006,
1007,
1010,
1002,
14223,
1027,
6270,
1010,
1002,
13354,
7076,
1027,
19701,
1007,
1063,
2724,
10521,
4502,
10649,
2121,
1024,
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... |
matomo-org/matomo | libs/HTML/QuickForm2/Node.php | HTML_QuickForm2_Node.applyFilters | protected function applyFilters($value)
{
foreach ($this->filters as $filter) {
if (is_array($value) && !empty($filter['recursive'])) {
array_walk_recursive($value,
array('HTML_QuickForm2_Node', 'applyFilter'), $filter);
} else {
s... | php | protected function applyFilters($value)
{
foreach ($this->filters as $filter) {
if (is_array($value) && !empty($filter['recursive'])) {
array_walk_recursive($value,
array('HTML_QuickForm2_Node', 'applyFilter'), $filter);
} else {
s... | [
"protected",
"function",
"applyFilters",
"(",
"$",
"value",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"filters",
"as",
"$",
"filter",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
"&&",
"!",
"empty",
"(",
"$",
"filter",
"[",
"'recursive... | Applies element filters on element value
@param mixed Element value
@return mixed Filtered value | [
"Applies",
"element",
"filters",
"on",
"element",
"value"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Node.php#L668-L679 | train | Apply all filters to the value | [
30522,
5123,
3853,
6611,
8873,
21928,
2015,
1006,
1002,
3643,
1007,
1063,
18921,
6776,
1006,
1002,
2023,
1011,
1028,
17736,
2004,
1002,
11307,
1007,
1063,
2065,
1006,
2003,
1035,
9140,
1006,
1002,
3643,
1007,
1004,
1004,
999,
4064,
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/Validator/Validator/TraceableValidator.php | TraceableValidator.validate | public function validate($value, $constraints = null, $groups = null)
{
$violations = $this->validator->validate($value, $constraints, $groups);
$trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 7);
$file = $trace[0]['file'];
$line = $trace[0]['line'];
for ($i = 1; $i ... | php | public function validate($value, $constraints = null, $groups = null)
{
$violations = $this->validator->validate($value, $constraints, $groups);
$trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 7);
$file = $trace[0]['file'];
$line = $trace[0]['line'];
for ($i = 1; $i ... | [
"public",
"function",
"validate",
"(",
"$",
"value",
",",
"$",
"constraints",
"=",
"null",
",",
"$",
"groups",
"=",
"null",
")",
"{",
"$",
"violations",
"=",
"$",
"this",
"->",
"validator",
"->",
"validate",
"(",
"$",
"value",
",",
"$",
"constraints",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Validator/Validator/TraceableValidator.php#L64-L103 | train | Validate the value using the validator | [
30522,
2270,
3853,
9398,
3686,
1006,
1002,
3643,
1010,
1002,
14679,
1027,
19701,
1010,
1002,
2967,
1027,
19701,
1007,
1063,
1002,
13302,
1027,
1002,
2023,
1011,
1028,
9398,
8844,
1011,
1028,
9398,
3686,
1006,
1002,
3643,
1010,
1002,
14679,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Transport/AmqpExt/AmqpReceiver.php | AmqpReceiver.getMessageCount | public function getMessageCount(): int
{
try {
return $this->connection->countMessagesInQueues();
} catch (\AMQPException $exception) {
throw new TransportException($exception->getMessage(), 0, $exception);
}
} | php | public function getMessageCount(): int
{
try {
return $this->connection->countMessagesInQueues();
} catch (\AMQPException $exception) {
throw new TransportException($exception->getMessage(), 0, $exception);
}
} | [
"public",
"function",
"getMessageCount",
"(",
")",
":",
"int",
"{",
"try",
"{",
"return",
"$",
"this",
"->",
"connection",
"->",
"countMessagesInQueues",
"(",
")",
";",
"}",
"catch",
"(",
"\\",
"AMQPException",
"$",
"exception",
")",
"{",
"throw",
"new",
... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Messenger/Transport/AmqpExt/AmqpReceiver.php#L111-L118 | train | Returns the number of messages in the queues | [
30522,
2270,
3853,
2131,
7834,
3736,
3351,
3597,
16671,
1006,
1007,
1024,
20014,
1063,
3046,
1063,
2709,
1002,
2023,
1011,
1028,
4434,
1011,
1028,
4175,
7834,
3736,
8449,
2378,
4226,
15808,
1006,
1007,
1025,
1065,
4608,
1006,
1032,
2572,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Resources/ConditionallyLoadsAttributes.php | ConditionallyLoadsAttributes.whenPivotLoadedAs | protected function whenPivotLoadedAs($accessor, $table, $value, $default = null)
{
if (func_num_args() === 3) {
$default = new MissingValue;
}
return $this->when(
$this->resource->$accessor &&
($this->resource->$accessor instanceof $table ||
$... | php | protected function whenPivotLoadedAs($accessor, $table, $value, $default = null)
{
if (func_num_args() === 3) {
$default = new MissingValue;
}
return $this->when(
$this->resource->$accessor &&
($this->resource->$accessor instanceof $table ||
$... | [
"protected",
"function",
"whenPivotLoadedAs",
"(",
"$",
"accessor",
",",
"$",
"table",
",",
"$",
"value",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"func_num_args",
"(",
")",
"===",
"3",
")",
"{",
"$",
"default",
"=",
"new",
"MissingValue"... | Execute a callback if the given pivot table with a custom accessor has been loaded.
@param string $accessor
@param string $table
@param mixed $value
@param mixed $default
@return \Illuminate\Http\Resources\MissingValue|mixed | [
"Execute",
"a",
"callback",
"if",
"the",
"given",
"pivot",
"table",
"with",
"a",
"custom",
"accessor",
"has",
"been",
"loaded",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Http/Resources/ConditionallyLoadsAttributes.php#L198-L210 | train | When the pivot table has been loaded as the specified table and the value has been set as the specified value | [
30522,
5123,
3853,
2043,
8197,
22994,
17468,
3022,
1006,
1002,
3229,
2953,
1010,
1002,
2795,
1010,
1002,
3643,
1010,
1002,
12398,
1027,
19701,
1007,
1063,
2065,
1006,
4569,
2278,
1035,
16371,
2213,
1035,
12098,
5620,
1006,
1007,
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... |
symfony/symfony | src/Symfony/Component/Serializer/Normalizer/ArrayDenormalizer.php | ArrayDenormalizer.supportsDenormalization | public function supportsDenormalization($data, $type, $format = null, array $context = [])
{
return '[]' === substr($type, -2)
&& $this->serializer->supportsDenormalization($data, substr($type, 0, -2), $format, $context);
} | php | public function supportsDenormalization($data, $type, $format = null, array $context = [])
{
return '[]' === substr($type, -2)
&& $this->serializer->supportsDenormalization($data, substr($type, 0, -2), $format, $context);
} | [
"public",
"function",
"supportsDenormalization",
"(",
"$",
"data",
",",
"$",
"type",
",",
"$",
"format",
"=",
"null",
",",
"array",
"$",
"context",
"=",
"[",
"]",
")",
"{",
"return",
"'[]'",
"===",
"substr",
"(",
"$",
"type",
",",
"-",
"2",
")",
"&... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Serializer/Normalizer/ArrayDenormalizer.php#L69-L73 | train | Returns true if the serializer supports denormalization | [
30522,
2270,
3853,
6753,
4181,
2953,
9067,
3989,
1006,
1002,
2951,
1010,
1002,
2828,
1010,
1002,
4289,
1027,
19701,
1010,
9140,
1002,
6123,
1027,
1031,
1033,
1007,
1063,
2709,
1005,
1031,
1033,
1005,
1027,
1027,
1027,
4942,
3367,
2099,
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... |
octobercms/october | modules/backend/traits/ErrorMaker.php | ErrorMaker.handleError | public function handleError($exception)
{
$errorMessage = ErrorHandler::getDetailedMessage($exception);
$this->fatalError = $errorMessage;
$this->vars['fatalError'] = $errorMessage;
} | php | public function handleError($exception)
{
$errorMessage = ErrorHandler::getDetailedMessage($exception);
$this->fatalError = $errorMessage;
$this->vars['fatalError'] = $errorMessage;
} | [
"public",
"function",
"handleError",
"(",
"$",
"exception",
")",
"{",
"$",
"errorMessage",
"=",
"ErrorHandler",
"::",
"getDetailedMessage",
"(",
"$",
"exception",
")",
";",
"$",
"this",
"->",
"fatalError",
"=",
"$",
"errorMessage",
";",
"$",
"this",
"->",
... | Sets standard page variables in the case of a controller error. | [
"Sets",
"standard",
"page",
"variables",
"in",
"the",
"case",
"of",
"a",
"controller",
"error",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/traits/ErrorMaker.php#L22-L27 | train | This method is called by the error handler to display the error message. | [
30522,
2270,
3853,
5047,
2121,
29165,
1006,
1002,
6453,
1007,
1063,
1002,
7561,
7834,
3736,
3351,
1027,
7561,
11774,
3917,
1024,
1024,
2131,
3207,
14162,
2098,
7834,
3736,
3351,
1006,
1002,
6453,
1007,
1025,
1002,
2023,
1011,
1028,
10611,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Filesystem/Folder.php | Folder.delete | public static function delete($target, $include_target = true)
{
if (!is_dir($target)) {
return false;
}
$success = self::doDelete($target, $include_target);
if (!$success) {
$error = error_get_last();
throw new \RuntimeException($error['message'... | php | public static function delete($target, $include_target = true)
{
if (!is_dir($target)) {
return false;
}
$success = self::doDelete($target, $include_target);
if (!$success) {
$error = error_get_last();
throw new \RuntimeException($error['message'... | [
"public",
"static",
"function",
"delete",
"(",
"$",
"target",
",",
"$",
"include_target",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"target",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"success",
"=",
"self",
"::",
"doDelete",
... | Recursively delete directory from filesystem.
@param string $target
@param bool $include_target
@return bool
@throws \RuntimeException | [
"Recursively",
"delete",
"directory",
"from",
"filesystem",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Filesystem/Folder.php#L383-L404 | train | Delete a directory and all of its contents | [
30522,
2270,
10763,
3853,
3972,
12870,
1006,
1002,
4539,
1010,
1002,
2421,
1035,
4539,
1027,
2995,
1007,
1063,
2065,
1006,
999,
2003,
1035,
16101,
1006,
1002,
4539,
1007,
1007,
1063,
2709,
6270,
1025,
1065,
1002,
3112,
1027,
2969,
1024,
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/HttpFoundation/AcceptHeaderItem.php | AcceptHeaderItem.setAttribute | public function setAttribute($name, $value)
{
if ('q' === $name) {
$this->quality = (float) $value;
} else {
$this->attributes[$name] = (string) $value;
}
return $this;
} | php | public function setAttribute($name, $value)
{
if ('q' === $name) {
$this->quality = (float) $value;
} else {
$this->attributes[$name] = (string) $value;
}
return $this;
} | [
"public",
"function",
"setAttribute",
"(",
"$",
"name",
",",
"$",
"value",
")",
"{",
"if",
"(",
"'q'",
"===",
"$",
"name",
")",
"{",
"$",
"this",
"->",
"quality",
"=",
"(",
"float",
")",
"$",
"value",
";",
"}",
"else",
"{",
"$",
"this",
"->",
"... | Set an attribute.
@param string $name
@param string $value
@return $this | [
"Set",
"an",
"attribute",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpFoundation/AcceptHeaderItem.php#L181-L190 | train | Set attribute value | [
30522,
2270,
3853,
2275,
19321,
3089,
8569,
2618,
1006,
1002,
2171,
1010,
1002,
3643,
1007,
1063,
2065,
1006,
1005,
1053,
1005,
1027,
1027,
1027,
1002,
2171,
1007,
1063,
1002,
2023,
1011,
1028,
3737,
30524,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Middleware/ThrottleRequests.php | ThrottleRequests.addHeaders | protected function addHeaders(Response $response, $maxAttempts, $remainingAttempts, $retryAfter = null)
{
$response->headers->add(
$this->getHeaders($maxAttempts, $remainingAttempts, $retryAfter)
);
return $response;
} | php | protected function addHeaders(Response $response, $maxAttempts, $remainingAttempts, $retryAfter = null)
{
$response->headers->add(
$this->getHeaders($maxAttempts, $remainingAttempts, $retryAfter)
);
return $response;
} | [
"protected",
"function",
"addHeaders",
"(",
"Response",
"$",
"response",
",",
"$",
"maxAttempts",
",",
"$",
"remainingAttempts",
",",
"$",
"retryAfter",
"=",
"null",
")",
"{",
"$",
"response",
"->",
"headers",
"->",
"add",
"(",
"$",
"this",
"->",
"getHeade... | Add the limit header information to the given response.
@param \Symfony\Component\HttpFoundation\Response $response
@param int $maxAttempts
@param int $remainingAttempts
@param int|null $retryAfter
@return \Symfony\Component\HttpFoundation\Response | [
"Add",
"the",
"limit",
"header",
"information",
"to",
"the",
"given",
"response",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/Middleware/ThrottleRequests.php#L149-L156 | train | Add headers to the response | [
30522,
5123,
3853,
5587,
4974,
2545,
1006,
3433,
1002,
3433,
1010,
1002,
4098,
19321,
6633,
22798,
1010,
1002,
3588,
19321,
6633,
22798,
1010,
1002,
2128,
11129,
10354,
3334,
1027,
19701,
30524,
1011,
1028,
5587,
1006,
1002,
2023,
1011,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/API/API.php | API.isPluginActivated | public function isPluginActivated($pluginName)
{
Piwik::checkUserHasSomeViewAccess();
return \Piwik\Plugin\Manager::getInstance()->isPluginActivated($pluginName);
} | php | public function isPluginActivated($pluginName)
{
Piwik::checkUserHasSomeViewAccess();
return \Piwik\Plugin\Manager::getInstance()->isPluginActivated($pluginName);
} | [
"public",
"function",
"isPluginActivated",
"(",
"$",
"pluginName",
")",
"{",
"Piwik",
"::",
"checkUserHasSomeViewAccess",
"(",
")",
";",
"return",
"\\",
"Piwik",
"\\",
"Plugin",
"\\",
"Manager",
"::",
"getInstance",
"(",
")",
"->",
"isPluginActivated",
"(",
"$... | Return true if plugin is activated, false otherwise
@param string $pluginName
@return bool | [
"Return",
"true",
"if",
"plugin",
"is",
"activated",
"false",
"otherwise"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/API/API.php#L553-L557 | train | Returns true if the plugin is activated. | [
30522,
2270,
3853,
2003,
24759,
15916,
3981,
6593,
21967,
1006,
1002,
13354,
23111,
14074,
1007,
1063,
14255,
9148,
2243,
1024,
1024,
4638,
20330,
14949,
14045,
8584,
6305,
9623,
2015,
1006,
1007,
1025,
2709,
1032,
14255,
9148,
2243,
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/Validation/Rules/DatabaseRule.php | DatabaseRule.whereNot | public function whereNot($column, $value)
{
if (is_array($value)) {
return $this->whereNotIn($column, $value);
}
return $this->where($column, '!'.$value);
} | php | public function whereNot($column, $value)
{
if (is_array($value)) {
return $this->whereNotIn($column, $value);
}
return $this->where($column, '!'.$value);
} | [
"public",
"function",
"whereNot",
"(",
"$",
"column",
",",
"$",
"value",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"return",
"$",
"this",
"->",
"whereNotIn",
"(",
"$",
"column",
",",
"$",
"value",
")",
";",
"}",
"return",
... | Set a "where not" constraint on the query.
@param string $column
@param array|string $value
@return $this | [
"Set",
"a",
"where",
"not",
"constraint",
"on",
"the",
"query",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Validation/Rules/DatabaseRule.php#L79-L86 | train | Devuelve el where not de la consulta | [
30522,
2270,
3853,
2073,
17048,
1006,
1002,
5930,
1010,
1002,
3643,
1007,
1063,
2065,
1006,
2003,
1035,
9140,
1006,
1002,
3643,
1007,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
2073,
17048,
2378,
1006,
1002,
5930,
1010,
1002,
3643,
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... |
laravel/framework | src/Illuminate/Mail/Mailable.php | Mailable.with | public function with($key, $value = null)
{
if (is_array($key)) {
$this->viewData = array_merge($this->viewData, $key);
} else {
$this->viewData[$key] = $value;
}
return $this;
} | php | public function with($key, $value = null)
{
if (is_array($key)) {
$this->viewData = array_merge($this->viewData, $key);
} else {
$this->viewData[$key] = $value;
}
return $this;
} | [
"public",
"function",
"with",
"(",
"$",
"key",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"key",
")",
")",
"{",
"$",
"this",
"->",
"viewData",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"viewData",
",",
"$",
"key"... | Set the view data for the message.
@param string|array $key
@param mixed $value
@return $this | [
"Set",
"the",
"view",
"data",
"for",
"the",
"message",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Mail/Mailable.php#L730-L739 | train | Add a view data to the viewData array | [
30522,
2270,
3853,
2007,
1006,
1002,
3145,
1010,
1002,
3643,
1027,
19701,
1007,
1063,
2065,
1006,
2003,
1035,
9140,
1006,
1002,
3145,
1007,
1007,
1063,
1002,
2023,
1011,
1028,
3193,
2850,
2696,
1027,
9140,
1035,
13590,
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... |
laravel/framework | src/Illuminate/Database/Schema/PostgresBuilder.php | PostgresBuilder.dropAllTables | public function dropAllTables()
{
$tables = [];
$excludedTables = ['spatial_ref_sys'];
foreach ($this->getAllTables() as $row) {
$row = (array) $row;
$table = reset($row);
if (! in_array($table, $excludedTables)) {
$tables[] = $table;
... | php | public function dropAllTables()
{
$tables = [];
$excludedTables = ['spatial_ref_sys'];
foreach ($this->getAllTables() as $row) {
$row = (array) $row;
$table = reset($row);
if (! in_array($table, $excludedTables)) {
$tables[] = $table;
... | [
"public",
"function",
"dropAllTables",
"(",
")",
"{",
"$",
"tables",
"=",
"[",
"]",
";",
"$",
"excludedTables",
"=",
"[",
"'spatial_ref_sys'",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"getAllTables",
"(",
")",
"as",
"$",
"row",
")",
"{",
"$",
"ro... | Drop all tables from the database.
@return void | [
"Drop",
"all",
"tables",
"from",
"the",
"database",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Schema/PostgresBuilder.php#L29-L52 | train | Drop all tables in the database | [
30522,
2270,
3853,
4530,
8095,
10880,
2015,
1006,
1007,
1063,
1002,
7251,
1027,
1031,
1033,
1025,
1002,
12421,
10880,
2015,
1027,
1031,
1005,
13589,
1035,
25416,
1035,
25353,
2015,
1005,
1033,
1025,
18921,
6776,
1006,
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/Tracker/IgnoreCookie.php | IgnoreCookie.setIgnoreCookie | public static function setIgnoreCookie()
{
$ignoreCookie = self::getIgnoreCookie();
if ($ignoreCookie->isCookieFound()) {
$ignoreCookie->delete();
} else {
$ignoreCookie->set('ignore', '*');
$ignoreCookie->save();
}
self::deleteThirdPartyC... | php | public static function setIgnoreCookie()
{
$ignoreCookie = self::getIgnoreCookie();
if ($ignoreCookie->isCookieFound()) {
$ignoreCookie->delete();
} else {
$ignoreCookie->set('ignore', '*');
$ignoreCookie->save();
}
self::deleteThirdPartyC... | [
"public",
"static",
"function",
"setIgnoreCookie",
"(",
")",
"{",
"$",
"ignoreCookie",
"=",
"self",
"::",
"getIgnoreCookie",
"(",
")",
";",
"if",
"(",
"$",
"ignoreCookie",
"->",
"isCookieFound",
"(",
")",
")",
"{",
"$",
"ignoreCookie",
"->",
"delete",
"(",... | Set ignore (visit) cookie or deletes it if already present | [
"Set",
"ignore",
"(",
"visit",
")",
"cookie",
"or",
"deletes",
"it",
"if",
"already",
"present"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/IgnoreCookie.php#L57-L68 | train | Set Ignore Cookie | [
30522,
2270,
10763,
3853,
2275,
23773,
5686,
3597,
23212,
2063,
1006,
1007,
1063,
1002,
8568,
3597,
23212,
2063,
1027,
2969,
1024,
1024,
2131,
23773,
5686,
3597,
23212,
2063,
1006,
1007,
1025,
2065,
1006,
1002,
8568,
3597,
23212,
2063,
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... |
laravel/framework | src/Illuminate/View/Factory.php | Factory.share | public function share($key, $value = null)
{
$keys = is_array($key) ? $key : [$key => $value];
foreach ($keys as $key => $value) {
$this->shared[$key] = $value;
}
return $value;
} | php | public function share($key, $value = null)
{
$keys = is_array($key) ? $key : [$key => $value];
foreach ($keys as $key => $value) {
$this->shared[$key] = $value;
}
return $value;
} | [
"public",
"function",
"share",
"(",
"$",
"key",
",",
"$",
"value",
"=",
"null",
")",
"{",
"$",
"keys",
"=",
"is_array",
"(",
"$",
"key",
")",
"?",
"$",
"key",
":",
"[",
"$",
"key",
"=>",
"$",
"value",
"]",
";",
"foreach",
"(",
"$",
"keys",
"a... | Add a piece of shared data to the environment.
@param array|string $key
@param mixed $value
@return mixed | [
"Add",
"a",
"piece",
"of",
"shared",
"data",
"to",
"the",
"environment",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/View/Factory.php#L313-L322 | train | Share a key with a value | [
30522,
2270,
3853,
3745,
1006,
1002,
3145,
1010,
1002,
3643,
1027,
19701,
1007,
1063,
1002,
6309,
1027,
2003,
1035,
9140,
1006,
1002,
3145,
1007,
1029,
1002,
3145,
1024,
1031,
1002,
3145,
1027,
1028,
1002,
3643,
1033,
1025,
18921,
6776,
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... |
laravel/framework | src/Illuminate/Validation/Validator.php | Validator.replaceAsterisksInParameters | protected function replaceAsterisksInParameters(array $parameters, array $keys)
{
return array_map(function ($field) use ($keys) {
return vsprintf(str_replace('*', '%s', $field), $keys);
}, $parameters);
} | php | protected function replaceAsterisksInParameters(array $parameters, array $keys)
{
return array_map(function ($field) use ($keys) {
return vsprintf(str_replace('*', '%s', $field), $keys);
}, $parameters);
} | [
"protected",
"function",
"replaceAsterisksInParameters",
"(",
"array",
"$",
"parameters",
",",
"array",
"$",
"keys",
")",
"{",
"return",
"array_map",
"(",
"function",
"(",
"$",
"field",
")",
"use",
"(",
"$",
"keys",
")",
"{",
"return",
"vsprintf",
"(",
"st... | Replace each field parameter which has asterisks with the given keys.
@param array $parameters
@param array $keys
@return array | [
"Replace",
"each",
"field",
"parameter",
"which",
"has",
"asterisks",
"with",
"the",
"given",
"keys",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Validation/Validator.php#L461-L466 | train | Replace asterisks in parameters with the values in the parameters array | [
30522,
5123,
3853,
5672,
24268,
20573,
11493,
28689,
22828,
2015,
1006,
9140,
1002,
11709,
1010,
9140,
1002,
6309,
1007,
1063,
2709,
9140,
1035,
4949,
1006,
3853,
1006,
1002,
2492,
1007,
2224,
1006,
1002,
6309,
1007,
1063,
2709,
5443,
16550... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Filter/BeautifyTimeRangeLabels.php | BeautifyTimeRangeLabels.getRangeLabel | public function getRangeLabel($oldLabel, $lowerBound, $upperBound)
{
if ($lowerBound < 60) {
return sprintf($this->labelSecondsPlural, $lowerBound, $upperBound);
} else {
return sprintf($this->labelPlural, ceil($lowerBound / 60) . "-" . ceil($upperBound / 60));
}
... | php | public function getRangeLabel($oldLabel, $lowerBound, $upperBound)
{
if ($lowerBound < 60) {
return sprintf($this->labelSecondsPlural, $lowerBound, $upperBound);
} else {
return sprintf($this->labelPlural, ceil($lowerBound / 60) . "-" . ceil($upperBound / 60));
}
... | [
"public",
"function",
"getRangeLabel",
"(",
"$",
"oldLabel",
",",
"$",
"lowerBound",
",",
"$",
"upperBound",
")",
"{",
"if",
"(",
"$",
"lowerBound",
"<",
"60",
")",
"{",
"return",
"sprintf",
"(",
"$",
"this",
"->",
"labelSecondsPlural",
",",
"$",
"lowerB... | Beautifies and returns a range label whose range is bounded and spans over
more than one unit, ie 1-5, 5-10 but NOT 11+.
If the lower bound of the range is less than 60 the pretty range label
will be in seconds. Otherwise, it will be in minutes.
@param string $oldLabel The original label value.
@param int $lowerBound... | [
"Beautifies",
"and",
"returns",
"a",
"range",
"label",
"whose",
"range",
"is",
"bounded",
"and",
"spans",
"over",
"more",
"than",
"one",
"unit",
"ie",
"1",
"-",
"5",
"5",
"-",
"10",
"but",
"NOT",
"11",
"+",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Filter/BeautifyTimeRangeLabels.php#L92-L99 | train | Returns range label | [
30522,
2270,
3853,
2131,
24388,
10581,
8671,
1006,
1002,
2214,
20470,
2884,
1010,
1002,
2896,
15494,
1010,
1002,
3356,
15494,
1007,
1063,
2065,
1006,
1002,
2896,
15494,
1026,
3438,
1007,
1063,
2709,
9043,
2546,
1006,
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 | libs/Zend/Cache/Backend/Static.php | Zend_Cache_Backend_Static.load | public function load($id, $doNotTestCacheValidity = false)
{
if (($id = (string)$id) === '') {
$id = $this->_detectId();
} else {
$id = $this->_decodeId($id);
}
if (!$this->_verifyPath($id)) {
Zend_Cache::throwException('Invalid cache id: does not ... | php | public function load($id, $doNotTestCacheValidity = false)
{
if (($id = (string)$id) === '') {
$id = $this->_detectId();
} else {
$id = $this->_decodeId($id);
}
if (!$this->_verifyPath($id)) {
Zend_Cache::throwException('Invalid cache id: does not ... | [
"public",
"function",
"load",
"(",
"$",
"id",
",",
"$",
"doNotTestCacheValidity",
"=",
"false",
")",
"{",
"if",
"(",
"(",
"$",
"id",
"=",
"(",
"string",
")",
"$",
"id",
")",
"===",
"''",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"_detectId",
... | Test if a cache is available for the given id and (if yes) return it (false else)
Note : return value is always "string" (unserialization is done by the core not by the backend)
@param string $id Cache id
@param boolean $doNotTestCacheValidity If set to true, the cache validity won't be tested
... | [
"Test",
"if",
"a",
"cache",
"is",
"available",
"for",
"the",
"given",
"id",
"and",
"(",
"if",
"yes",
")",
"return",
"it",
"(",
"false",
"else",
")"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Backend/Static.php#L124-L150 | train | Load a cache from the file system | [
30522,
2270,
3853,
7170,
1006,
1002,
8909,
1010,
1002,
2123,
28495,
3367,
3540,
16179,
11475,
25469,
1027,
6270,
1007,
1063,
2065,
1006,
1006,
1002,
8909,
1027,
1006,
5164,
1007,
1002,
8909,
1007,
1027,
1027,
1027,
1005,
1005,
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... |
laravel/framework | src/Illuminate/Http/Concerns/InteractsWithInput.php | InteractsWithInput.bearerToken | public function bearerToken()
{
$header = $this->header('Authorization', '');
if (Str::startsWith($header, 'Bearer ')) {
return Str::substr($header, 7);
}
} | php | public function bearerToken()
{
$header = $this->header('Authorization', '');
if (Str::startsWith($header, 'Bearer ')) {
return Str::substr($header, 7);
}
} | [
"public",
"function",
"bearerToken",
"(",
")",
"{",
"$",
"header",
"=",
"$",
"this",
"->",
"header",
"(",
"'Authorization'",
",",
"''",
")",
";",
"if",
"(",
"Str",
"::",
"startsWith",
"(",
"$",
"header",
",",
"'Bearer '",
")",
")",
"{",
"return",
"St... | Get the bearer token from the request headers.
@return string|null | [
"Get",
"the",
"bearer",
"token",
"from",
"the",
"request",
"headers",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Http/Concerns/InteractsWithInput.php#L53-L60 | train | Get bearer token | [
30522,
2270,
3853,
20905,
18715,
2368,
1006,
1007,
1063,
1002,
20346,
1027,
1002,
2023,
1011,
1028,
20346,
1006,
1005,
20104,
1005,
1010,
1005,
1005,
1007,
1025,
2065,
1006,
2358,
2099,
1024,
1024,
4627,
24415,
1006,
1002,
20346,
1010,
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... |
laravel/framework | src/Illuminate/Support/Collection.php | Collection.where | public function where($key, $operator = null, $value = null)
{
return $this->filter($this->operatorForWhere(...func_get_args()));
} | php | public function where($key, $operator = null, $value = null)
{
return $this->filter($this->operatorForWhere(...func_get_args()));
} | [
"public",
"function",
"where",
"(",
"$",
"key",
",",
"$",
"operator",
"=",
"null",
",",
"$",
"value",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"filter",
"(",
"$",
"this",
"->",
"operatorForWhere",
"(",
"...",
"func_get_args",
"(",
")",
")"... | Filter items by the given key value pair.
@param string $key
@param mixed $operator
@param mixed $value
@return static | [
"Filter",
"items",
"by",
"the",
"given",
"key",
"value",
"pair",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Support/Collection.php#L643-L646 | train | Filters the result by a given key value pair using the given operator. | [
30522,
2270,
3853,
2073,
1006,
1002,
3145,
1010,
1002,
6872,
1027,
19701,
1010,
1002,
3643,
1027,
19701,
1007,
1063,
2709,
1002,
2023,
1011,
1028,
11307,
1006,
1002,
2023,
1011,
1028,
6872,
29278,
2860,
5886,
2063,
1006,
1012,
1012,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Fragment/FragmentHandler.php | FragmentHandler.deliver | protected function deliver(Response $response)
{
if (!$response->isSuccessful()) {
throw new \RuntimeException(sprintf('Error when rendering "%s" (Status code is %s).', $this->requestStack->getCurrentRequest()->getUri(), $response->getStatusCode()));
}
if (!$response instanceof ... | php | protected function deliver(Response $response)
{
if (!$response->isSuccessful()) {
throw new \RuntimeException(sprintf('Error when rendering "%s" (Status code is %s).', $this->requestStack->getCurrentRequest()->getUri(), $response->getStatusCode()));
}
if (!$response instanceof ... | [
"protected",
"function",
"deliver",
"(",
"Response",
"$",
"response",
")",
"{",
"if",
"(",
"!",
"$",
"response",
"->",
"isSuccessful",
"(",
")",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"sprintf",
"(",
"'Error when rendering \"%s\" (Status code i... | Delivers the Response as a string.
When the Response is a StreamedResponse, the content is streamed immediately
instead of being returned.
@return string|null The Response content or null when the Response is streamed
@throws \RuntimeException when the Response is not successful | [
"Delivers",
"the",
"Response",
"as",
"a",
"string",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/Fragment/FragmentHandler.php#L100-L111 | train | Deliver the response to the browser | [
30522,
5123,
3853,
8116,
1006,
3433,
1002,
3433,
1007,
1063,
2065,
1006,
999,
1002,
3433,
1011,
1028,
26354,
14194,
9623,
22747,
5313,
1006,
1007,
1007,
1063,
5466,
2047,
1032,
2448,
7292,
10288,
24422,
1006,
9043,
2546,
1006,
1005,
7561,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Scheduler.php | Scheduler.addFunction | public function addFunction(callable $fn, $args = [], $id = null)
{
$job = new Job($fn, $args, $id);
$this->queueJob($job->configure($this->config));
return $job;
} | php | public function addFunction(callable $fn, $args = [], $id = null)
{
$job = new Job($fn, $args, $id);
$this->queueJob($job->configure($this->config));
return $job;
} | [
"public",
"function",
"addFunction",
"(",
"callable",
"$",
"fn",
",",
"$",
"args",
"=",
"[",
"]",
",",
"$",
"id",
"=",
"null",
")",
"{",
"$",
"job",
"=",
"new",
"Job",
"(",
"$",
"fn",
",",
"$",
"args",
",",
"$",
"id",
")",
";",
"$",
"this",
... | Queues a PHP function execution.
@param callable $fn The function to execute
@param array $args Optional arguments to pass to the php script
@param string $id Optional custom identifier
@return Job | [
"Queues",
"a",
"PHP",
"function",
"execution",
"."
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Common/Scheduler/Scheduler.php#L126-L132 | train | Add a function to the queue | [
30522,
2270,
3853,
5587,
11263,
27989,
1006,
2655,
3085,
1002,
1042,
2078,
1010,
1002,
12098,
5620,
1027,
1031,
1033,
1010,
1002,
8909,
1027,
19701,
1007,
1063,
1002,
3105,
1027,
2047,
3105,
1006,
1002,
30524,
1002,
3105,
1025,
1065,
102,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Model.php | Model.withoutTouchingOn | public static function withoutTouchingOn(array $models, callable $callback)
{
static::$ignoreOnTouch = array_values(array_merge(static::$ignoreOnTouch, $models));
try {
call_user_func($callback);
} finally {
static::$ignoreOnTouch = array_values(array_diff(static::$i... | php | public static function withoutTouchingOn(array $models, callable $callback)
{
static::$ignoreOnTouch = array_values(array_merge(static::$ignoreOnTouch, $models));
try {
call_user_func($callback);
} finally {
static::$ignoreOnTouch = array_values(array_diff(static::$i... | [
"public",
"static",
"function",
"withoutTouchingOn",
"(",
"array",
"$",
"models",
",",
"callable",
"$",
"callback",
")",
"{",
"static",
"::",
"$",
"ignoreOnTouch",
"=",
"array_values",
"(",
"array_merge",
"(",
"static",
"::",
"$",
"ignoreOnTouch",
",",
"$",
... | Disables relationship model touching for the given model classes during given callback scope.
@param array $models
@param callable $callback
@return void | [
"Disables",
"relationship",
"model",
"touching",
"for",
"the",
"given",
"model",
"classes",
"during",
"given",
"callback",
"scope",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Model.php#L276-L285 | train | Exclude the given models from the ignore - on - touch list. | [
30522,
2270,
10763,
3853,
2302,
24826,
8450,
2239,
1006,
9140,
1002,
4275,
1010,
2655,
3085,
1002,
2655,
5963,
1007,
1063,
10763,
1024,
1024,
1002,
8568,
12162,
7140,
2818,
1027,
9140,
1035,
5300,
1006,
9140,
1035,
13590,
1006,
10763,
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/backend/classes/WidgetManager.php | WidgetManager.resolveFormWidget | public function resolveFormWidget($name)
{
if ($this->formWidgets === null) {
$this->listFormWidgets();
}
$hints = $this->formWidgetHints;
if (isset($hints[$name])) {
return $hints[$name];
}
$_name = Str::normalizeClassName($name);
i... | php | public function resolveFormWidget($name)
{
if ($this->formWidgets === null) {
$this->listFormWidgets();
}
$hints = $this->formWidgetHints;
if (isset($hints[$name])) {
return $hints[$name];
}
$_name = Str::normalizeClassName($name);
i... | [
"public",
"function",
"resolveFormWidget",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"formWidgets",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"listFormWidgets",
"(",
")",
";",
"}",
"$",
"hints",
"=",
"$",
"this",
"->",
"formWidgetHint... | Returns a class name from a form widget code
Normalizes a class name or converts an code to its class name.
@param string $name Class name or form widget code.
@return string The class name resolved, or the original name. | [
"Returns",
"a",
"class",
"name",
"from",
"a",
"form",
"widget",
"code",
"Normalizes",
"a",
"class",
"name",
"or",
"converts",
"an",
"code",
"to",
"its",
"class",
"name",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/classes/WidgetManager.php#L136-L154 | train | Resolves form widget name | [
30522,
30524,
1006,
1007,
1025,
1065,
1002,
20385,
1027,
1002,
2023,
1011,
1028,
2433,
9148,
24291,
10606,
3215,
1025,
2065,
1006,
26354,
3388,
1006,
1002,
20385,
1031,
1002,
2171,
1033,
1007,
1007,
1063,
2709,
1002,
20385,
1031,
1002,
2171... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Queue/Listener.php | Listener.createCommand | protected function createCommand($connection, $queue, ListenerOptions $options)
{
return array_filter([
$this->phpBinary(),
$this->artisanBinary(),
'queue:work',
$connection,
'--once',
"--queue={$queue}",
"--delay={$options-... | php | protected function createCommand($connection, $queue, ListenerOptions $options)
{
return array_filter([
$this->phpBinary(),
$this->artisanBinary(),
'queue:work',
$connection,
'--once',
"--queue={$queue}",
"--delay={$options-... | [
"protected",
"function",
"createCommand",
"(",
"$",
"connection",
",",
"$",
"queue",
",",
"ListenerOptions",
"$",
"options",
")",
"{",
"return",
"array_filter",
"(",
"[",
"$",
"this",
"->",
"phpBinary",
"(",
")",
",",
"$",
"this",
"->",
"artisanBinary",
"(... | Create the command with the listener options.
@param string $connection
@param string $queue
@param \Illuminate\Queue\ListenerOptions $options
@return array | [
"Create",
"the",
"command",
"with",
"the",
"listener",
"options",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Queue/Listener.php#L146-L162 | train | Create command for listener | [
30522,
5123,
3853,
3443,
9006,
2386,
2094,
1006,
1002,
4434,
1010,
1002,
24240,
1010,
19373,
7361,
9285,
1002,
7047,
1007,
1063,
2709,
9140,
1035,
11307,
1006,
1031,
1002,
2023,
1011,
1028,
25718,
21114,
2854,
1006,
1007,
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... |
getgrav/grav | system/src/Grav/Framework/Flex/FlexObject.php | FlexObject.search | public function search(string $search, $properties = null, array $options = null): float
{
$options = $options ?? $this->getFlexDirectory()->getConfig('data.search.options', []);
$properties = $properties ?? $this->getFlexDirectory()->getConfig('data.search.fields', []);
if (!$properties) {
... | php | public function search(string $search, $properties = null, array $options = null): float
{
$options = $options ?? $this->getFlexDirectory()->getConfig('data.search.options', []);
$properties = $properties ?? $this->getFlexDirectory()->getConfig('data.search.fields', []);
if (!$properties) {
... | [
"public",
"function",
"search",
"(",
"string",
"$",
"search",
",",
"$",
"properties",
"=",
"null",
",",
"array",
"$",
"options",
"=",
"null",
")",
":",
"float",
"{",
"$",
"options",
"=",
"$",
"options",
"??",
"$",
"this",
"->",
"getFlexDirectory",
"(",... | {@inheritdoc}
@see FlexObjectInterface::search() | [
"{"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Framework/Flex/FlexObject.php#L161-L179 | train | Search for a given search string in the flex directory | [
30522,
2270,
3853,
3945,
1006,
5164,
1002,
3945,
1010,
1002,
5144,
1027,
19701,
1010,
9140,
1002,
7047,
1027,
30524,
2023,
1011,
1028,
2131,
21031,
2595,
4305,
2890,
16761,
2100,
1006,
1007,
1011,
1028,
2131,
8663,
8873,
2290,
1006,
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... |
laravel/framework | src/Illuminate/Auth/EloquentUserProvider.php | EloquentUserProvider.retrieveByCredentials | public function retrieveByCredentials(array $credentials)
{
if (empty($credentials) ||
(count($credentials) === 1 &&
array_key_exists('password', $credentials))) {
return;
}
// First we will add each credential element to the query as a where clause.
... | php | public function retrieveByCredentials(array $credentials)
{
if (empty($credentials) ||
(count($credentials) === 1 &&
array_key_exists('password', $credentials))) {
return;
}
// First we will add each credential element to the query as a where clause.
... | [
"public",
"function",
"retrieveByCredentials",
"(",
"array",
"$",
"credentials",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"credentials",
")",
"||",
"(",
"count",
"(",
"$",
"credentials",
")",
"===",
"1",
"&&",
"array_key_exists",
"(",
"'password'",
",",
"$"... | Retrieve a user by the given credentials.
@param array $credentials
@return \Illuminate\Contracts\Auth\Authenticatable|null | [
"Retrieve",
"a",
"user",
"by",
"the",
"given",
"credentials",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Auth/EloquentUserProvider.php#L106-L132 | train | Retrieve a user by the given credentials | [
30522,
2270,
3853,
12850,
3762,
16748,
16454,
26340,
1006,
9140,
1002,
22496,
1007,
1063,
2065,
1006,
4064,
1006,
1002,
22496,
1007,
1064,
1064,
1006,
4175,
1006,
1002,
22496,
1007,
1027,
1027,
1027,
1015,
1004,
1004,
9140,
1035,
3145,
1035... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.getUsersSitesFromAccess | public function getUsersSitesFromAccess($access)
{
Piwik::checkUserHasSuperUserAccess();
$this->checkAccessType($access);
$userSites = $this->model->getUsersSitesFromAccess($access);
$userSites = $this->userFilter->filterLoginIndexedArray($userSites);
return $userSites;
... | php | public function getUsersSitesFromAccess($access)
{
Piwik::checkUserHasSuperUserAccess();
$this->checkAccessType($access);
$userSites = $this->model->getUsersSitesFromAccess($access);
$userSites = $this->userFilter->filterLoginIndexedArray($userSites);
return $userSites;
... | [
"public",
"function",
"getUsersSitesFromAccess",
"(",
"$",
"access",
")",
"{",
"Piwik",
"::",
"checkUserHasSuperUserAccess",
"(",
")",
";",
"$",
"this",
"->",
"checkAccessType",
"(",
"$",
"access",
")",
";",
"$",
"userSites",
"=",
"$",
"this",
"->",
"model",... | For each user, returns the list of website IDs where the user has the supplied $access level.
If a user doesn't have the given $access to any website IDs,
the user will not be in the returned array.
@param string Access can have the following values : 'view' or 'admin'
@return array The returned array has the form... | [
"For",
"each",
"user",
"returns",
"the",
"list",
"of",
"website",
"IDs",
"where",
"the",
"user",
"has",
"the",
"supplied",
"$access",
"level",
".",
"If",
"a",
"user",
"doesn",
"t",
"have",
"the",
"given",
"$access",
"to",
"any",
"website",
"IDs",
"the",
... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UsersManager/API.php#L408-L418 | train | Returns the list of all the sites that the user has the specified access. | [
30522,
2270,
3853,
2131,
20330,
18719,
4570,
19699,
9626,
9468,
7971,
1006,
1002,
3229,
1007,
1063,
14255,
9148,
2243,
1024,
1024,
4638,
20330,
14949,
6342,
4842,
20330,
6305,
9623,
2015,
1006,
1007,
1025,
1002,
2023,
1011,
1028,
4638,
6305... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/MediaLibrary.php | MediaLibrary.moveFile | public function moveFile($oldPath, $newPath, $isRename = false)
{
$oldPath = self::validatePath($oldPath);
$fullOldPath = $this->getMediaPath($oldPath);
$newPath = self::validatePath($newPath);
$fullNewPath = $this->getMediaPath($newPath);
return $this->getStorageDisk()->mo... | php | public function moveFile($oldPath, $newPath, $isRename = false)
{
$oldPath = self::validatePath($oldPath);
$fullOldPath = $this->getMediaPath($oldPath);
$newPath = self::validatePath($newPath);
$fullNewPath = $this->getMediaPath($newPath);
return $this->getStorageDisk()->mo... | [
"public",
"function",
"moveFile",
"(",
"$",
"oldPath",
",",
"$",
"newPath",
",",
"$",
"isRename",
"=",
"false",
")",
"{",
"$",
"oldPath",
"=",
"self",
"::",
"validatePath",
"(",
"$",
"oldPath",
")",
";",
"$",
"fullOldPath",
"=",
"$",
"this",
"->",
"g... | Moves a file to another location.
@param string $oldPath Specifies the original path of the file.
@param string $newPath Specifies the new path of the file.
@return boolean | [
"Moves",
"a",
"file",
"to",
"another",
"location",
"."
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/system/classes/MediaLibrary.php#L335-L344 | train | Moves a file from one location to another location. | [
30522,
2270,
3853,
2693,
8873,
2571,
1006,
1002,
2214,
15069,
1010,
1002,
2047,
15069,
1010,
1002,
2003,
7389,
14074,
1027,
6270,
1007,
1063,
1002,
2214,
15069,
1027,
2969,
1024,
1024,
9398,
3686,
15069,
1006,
1002,
2214,
15069,
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... |
symfony/symfony | src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php | NumberFormatter.parse | public function parse($value, $type = self::TYPE_DOUBLE, &$position = 0)
{
if (self::TYPE_DEFAULT == $type || self::TYPE_CURRENCY == $type) {
trigger_error(__METHOD__.'(): Unsupported format type '.$type, \E_USER_WARNING);
return false;
}
// Any invalid number at th... | php | public function parse($value, $type = self::TYPE_DOUBLE, &$position = 0)
{
if (self::TYPE_DEFAULT == $type || self::TYPE_CURRENCY == $type) {
trigger_error(__METHOD__.'(): Unsupported format type '.$type, \E_USER_WARNING);
return false;
}
// Any invalid number at th... | [
"public",
"function",
"parse",
"(",
"$",
"value",
",",
"$",
"type",
"=",
"self",
"::",
"TYPE_DOUBLE",
",",
"&",
"$",
"position",
"=",
"0",
")",
"{",
"if",
"(",
"self",
"::",
"TYPE_DEFAULT",
"==",
"$",
"type",
"||",
"self",
"::",
"TYPE_CURRENCY",
"=="... | Parse a number.
@param string $value The value to parse
@param int $type Type of the formatting, one of the format type constants. NumberFormatter::TYPE_DOUBLE by default.
@param int $position Offset to begin the parsing on return this value will hold the offset at which the parsing ended
@return int|flo... | [
"Parse",
"a",
"number",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php#L509-L549 | train | Parse the value and return the result | [
30522,
2270,
3853,
11968,
3366,
1006,
1002,
3643,
1010,
1002,
2828,
1027,
2969,
1024,
1024,
2828,
1035,
3313,
1010,
1004,
1002,
2597,
1027,
1014,
1007,
1063,
2065,
1006,
2969,
1024,
1024,
2828,
1035,
12398,
1027,
1027,
1002,
2828,
1064,
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/Console/Gpm/InstallCommand.php | InstallCommand.installPackage | private function installPackage($package, $is_update = false)
{
$type = $package->package_type;
Installer::install($this->file, $this->destination, ['install_path' => $package->install_path, 'theme' => $type === 'themes', 'is_update' => $is_update]);
$error_code = Installer::lastErrorCode()... | php | private function installPackage($package, $is_update = false)
{
$type = $package->package_type;
Installer::install($this->file, $this->destination, ['install_path' => $package->install_path, 'theme' => $type === 'themes', 'is_update' => $is_update]);
$error_code = Installer::lastErrorCode()... | [
"private",
"function",
"installPackage",
"(",
"$",
"package",
",",
"$",
"is_update",
"=",
"false",
")",
"{",
"$",
"type",
"=",
"$",
"package",
"->",
"package_type",
";",
"Installer",
"::",
"install",
"(",
"$",
"this",
"->",
"file",
",",
"$",
"this",
"-... | Install a package
@param Package $package
@param bool $is_update True if it's an update. False if it's an install
@return bool | [
"Install",
"a",
"package"
] | 1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72 | https://github.com/getgrav/grav/blob/1a41e00a4f0f5d17b6c0ce5150a5d656a8c5be72/system/src/Grav/Console/Gpm/InstallCommand.php#L651-L680 | train | Installs a package | [
30522,
2797,
3853,
16500,
23947,
4270,
1006,
1002,
7427,
1010,
1002,
2003,
1035,
10651,
1027,
6270,
1007,
1063,
1002,
2828,
1027,
1002,
7427,
1011,
1028,
7427,
1035,
2828,
1025,
16500,
2121,
1024,
1024,
16500,
1006,
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... |
laravel/framework | src/Illuminate/Validation/Concerns/ReplacesAttributes.php | ReplacesAttributes.replaceRequiredWithoutAll | protected function replaceRequiredWithoutAll($message, $attribute, $rule, $parameters)
{
return $this->replaceRequiredWith($message, $attribute, $rule, $parameters);
} | php | protected function replaceRequiredWithoutAll($message, $attribute, $rule, $parameters)
{
return $this->replaceRequiredWith($message, $attribute, $rule, $parameters);
} | [
"protected",
"function",
"replaceRequiredWithoutAll",
"(",
"$",
"message",
",",
"$",
"attribute",
",",
"$",
"rule",
",",
"$",
"parameters",
")",
"{",
"return",
"$",
"this",
"->",
"replaceRequiredWith",
"(",
"$",
"message",
",",
"$",
"attribute",
",",
"$",
... | Replace all place-holders for the required_without_all rule.
@param string $message
@param string $attribute
@param string $rule
@param array $parameters
@return string | [
"Replace",
"all",
"place",
"-",
"holders",
"for",
"the",
"required_without_all",
"rule",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Validation/Concerns/ReplacesAttributes.php#L232-L235 | train | Replace all place - holders for the required_without_all rule. | [
30522,
5123,
3853,
5672,
2890,
15549,
5596,
24415,
5833,
8095,
1006,
1002,
4471,
1010,
1002,
17961,
1010,
1002,
3627,
1010,
30524,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Mail/Protocol/Imap.php | Zend_Mail_Protocol_Imap.escapeString | public function escapeString($string)
{
if (func_num_args() < 2) {
if (strpos($string, "\n") !== false) {
return array('{' . strlen($string) . '}', $string);
} else {
return '"' . str_replace(array('\\', '"'), array('\\\\', '\\"'), $string) . '"';
... | php | public function escapeString($string)
{
if (func_num_args() < 2) {
if (strpos($string, "\n") !== false) {
return array('{' . strlen($string) . '}', $string);
} else {
return '"' . str_replace(array('\\', '"'), array('\\\\', '\\"'), $string) . '"';
... | [
"public",
"function",
"escapeString",
"(",
"$",
"string",
")",
"{",
"if",
"(",
"func_num_args",
"(",
")",
"<",
"2",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"string",
",",
"\"\\n\"",
")",
"!==",
"false",
")",
"{",
"return",
"array",
"(",
"'{'",
"."... | escape one or more literals i.e. for sendRequest
@param string|array $string the literal/-s
@return string|array escape literals, literals with newline ar returned
as array('{size}', 'string'); | [
"escape",
"one",
"or",
"more",
"literals",
"i",
".",
"e",
".",
"for",
"sendRequest"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Protocol/Imap.php#L400-L414 | train | Escape string for use in the context of the current context | [
30522,
2270,
3853,
12976,
18886,
3070,
1006,
1002,
5164,
1007,
1063,
2065,
1006,
4569,
2278,
1035,
16371,
2213,
1035,
12098,
5620,
1006,
1007,
1026,
1016,
1007,
1063,
2065,
1006,
2358,
14536,
2891,
1006,
1002,
5164,
1010,
1000,
1032,
1050,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/FileHelpers.php | FileHelpers.hashName | public function hashName($path = null)
{
if ($path) {
$path = rtrim($path, '/').'/';
}
$hash = $this->hashName ?: $this->hashName = Str::random(40);
if ($extension = $this->guessExtension()) {
$extension = '.'.$extension;
}
return $path.$has... | php | public function hashName($path = null)
{
if ($path) {
$path = rtrim($path, '/').'/';
}
$hash = $this->hashName ?: $this->hashName = Str::random(40);
if ($extension = $this->guessExtension()) {
$extension = '.'.$extension;
}
return $path.$has... | [
"public",
"function",
"hashName",
"(",
"$",
"path",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"path",
")",
"{",
"$",
"path",
"=",
"rtrim",
"(",
"$",
"path",
",",
"'/'",
")",
".",
"'/'",
";",
"}",
"$",
"hash",
"=",
"$",
"this",
"->",
"hashName",
... | Get a filename for the file.
@param string $path
@return string | [
"Get",
"a",
"filename",
"for",
"the",
"file",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Http/FileHelpers.php#L42-L55 | train | Returns a unique name for the current file | [
30522,
2270,
3853,
23325,
18442,
1006,
1002,
4130,
1027,
19701,
1007,
1063,
2065,
1006,
1002,
4130,
1007,
1063,
1002,
4130,
1027,
19387,
20026,
1006,
1002,
4130,
1010,
1005,
1013,
1005,
1007,
1012,
1005,
1013,
1005,
1025,
1065,
1002,
23325,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Installation/Controller.php | Controller.firstWebsiteSetup | public function firstWebsiteSetup()
{
$this->checkPiwikIsNotInstalled();
ServerFilesGenerator::createFilesForSecurity();
$siteIdsCount = Access::doAsSuperUser(function () {
return count(APISitesManager::getInstance()->getAllSitesId());
});
if ($siteIdsCount > 0... | php | public function firstWebsiteSetup()
{
$this->checkPiwikIsNotInstalled();
ServerFilesGenerator::createFilesForSecurity();
$siteIdsCount = Access::doAsSuperUser(function () {
return count(APISitesManager::getInstance()->getAllSitesId());
});
if ($siteIdsCount > 0... | [
"public",
"function",
"firstWebsiteSetup",
"(",
")",
"{",
"$",
"this",
"->",
"checkPiwikIsNotInstalled",
"(",
")",
";",
"ServerFilesGenerator",
"::",
"createFilesForSecurity",
"(",
")",
";",
"$",
"siteIdsCount",
"=",
"Access",
"::",
"doAsSuperUser",
"(",
"function... | Installation Step 6: Configure first web-site | [
"Installation",
"Step",
"6",
":",
"Configure",
"first",
"web",
"-",
"site"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Installation/Controller.php#L300-L352 | train | Displays the first website setup screen | [
30522,
2270,
3853,
2034,
8545,
5910,
7616,
3388,
6279,
1006,
1007,
1063,
1002,
2023,
1011,
1028,
4638,
8197,
9148,
14270,
17048,
7076,
9080,
3709,
1006,
1007,
1025,
8241,
8873,
4244,
6914,
6906,
4263,
1024,
1024,
3443,
8873,
4244,
29278,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
guzzle/guzzle | src/Cookie/SessionCookieJar.php | SessionCookieJar.load | protected function load()
{
if (!isset($_SESSION[$this->sessionKey])) {
return;
}
$data = json_decode($_SESSION[$this->sessionKey], true);
if (is_array($data)) {
foreach ($data as $cookie) {
$this->setCookie(new SetCookie($cookie));
... | php | protected function load()
{
if (!isset($_SESSION[$this->sessionKey])) {
return;
}
$data = json_decode($_SESSION[$this->sessionKey], true);
if (is_array($data)) {
foreach ($data as $cookie) {
$this->setCookie(new SetCookie($cookie));
... | [
"protected",
"function",
"load",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"_SESSION",
"[",
"$",
"this",
"->",
"sessionKey",
"]",
")",
")",
"{",
"return",
";",
"}",
"$",
"data",
"=",
"json_decode",
"(",
"$",
"_SESSION",
"[",
"$",
"this",
... | Load the contents of the client session into the data array | [
"Load",
"the",
"contents",
"of",
"the",
"client",
"session",
"into",
"the",
"data",
"array"
] | bf595424e4d442a190582e088985dc835a789071 | https://github.com/guzzle/guzzle/blob/bf595424e4d442a190582e088985dc835a789071/src/Cookie/SessionCookieJar.php#L57-L70 | train | Load session data | [
30522,
5123,
3853,
7170,
1006,
1007,
1063,
2065,
1006,
999,
26354,
3388,
1006,
1002,
1035,
5219,
1031,
1002,
2023,
1011,
1028,
5219,
14839,
1033,
1007,
1007,
1063,
2709,
1025,
1065,
1002,
2951,
1027,
1046,
3385,
1035,
21933,
3207,
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... |
symfony/symfony | src/Symfony/Component/Console/Helper/QuestionHelper.php | QuestionHelper.ask | public function ask(InputInterface $input, OutputInterface $output, Question $question)
{
if ($output instanceof ConsoleOutputInterface) {
$output = $output->getErrorOutput();
}
if (!$input->isInteractive()) {
$default = $question->getDefault();
if (null... | php | public function ask(InputInterface $input, OutputInterface $output, Question $question)
{
if ($output instanceof ConsoleOutputInterface) {
$output = $output->getErrorOutput();
}
if (!$input->isInteractive()) {
$default = $question->getDefault();
if (null... | [
"public",
"function",
"ask",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
",",
"Question",
"$",
"question",
")",
"{",
"if",
"(",
"$",
"output",
"instanceof",
"ConsoleOutputInterface",
")",
"{",
"$",
"output",
"=",
"$",
"output"... | Asks a question to the user.
@return mixed The user answer
@throws RuntimeException If there is no data to read in the input stream | [
"Asks",
"a",
"question",
"to",
"the",
"user",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Helper/QuestionHelper.php#L43-L88 | train | Ask the user for a question. | [
30522,
2270,
3853,
3198,
1006,
7953,
18447,
2121,
12172,
1002,
7953,
1010,
6434,
18447,
2121,
12172,
1002,
6434,
1010,
3160,
1002,
3160,
1007,
1063,
2065,
1006,
1002,
6434,
6013,
11253,
10122,
5833,
18780,
18447,
2121,
12172,
1007,
1063,
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... |
dompdf/dompdf | src/FrameDecorator/AbstractFrameDecorator.php | AbstractFrameDecorator.remove_child | function remove_child(Frame $child, $update_node = true)
{
while ($child instanceof AbstractFrameDecorator) {
$child = $child->_frame;
}
return $this->_frame->remove_child($child, $update_node);
} | php | function remove_child(Frame $child, $update_node = true)
{
while ($child instanceof AbstractFrameDecorator) {
$child = $child->_frame;
}
return $this->_frame->remove_child($child, $update_node);
} | [
"function",
"remove_child",
"(",
"Frame",
"$",
"child",
",",
"$",
"update_node",
"=",
"true",
")",
"{",
"while",
"(",
"$",
"child",
"instanceof",
"AbstractFrameDecorator",
")",
"{",
"$",
"child",
"=",
"$",
"child",
"->",
"_frame",
";",
"}",
"return",
"$"... | @param Frame $child
@param bool $update_node
@return Frame | [
"@param",
"Frame",
"$child",
"@param",
"bool",
"$update_node"
] | 75f13c700009be21a1965dc2c5b68a8708c22ba2 | https://github.com/dompdf/dompdf/blob/75f13c700009be21a1965dc2c5b68a8708c22ba2/src/FrameDecorator/AbstractFrameDecorator.php#L431-L438 | train | Remove a child frame | [
30522,
3853,
6366,
1035,
2775,
1006,
4853,
1002,
2775,
1010,
1002,
10651,
1035,
13045,
1027,
2995,
1007,
1063,
2096,
1006,
1002,
2775,
6013,
11253,
10061,
15643,
3207,
27108,
8844,
1007,
1063,
1002,
2775,
1027,
1002,
2775,
1011,
1028,
1035,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/SegmentEditor/Model.php | Model.getAllSegmentsForSite | public function getAllSegmentsForSite($idSite, $userLogin)
{
$bind = array($idSite, $userLogin);
$sql = $this->buildQuerySortedByName('(enable_only_idsite = ? OR enable_only_idsite = 0)
AND deleted = 0
AND... | php | public function getAllSegmentsForSite($idSite, $userLogin)
{
$bind = array($idSite, $userLogin);
$sql = $this->buildQuerySortedByName('(enable_only_idsite = ? OR enable_only_idsite = 0)
AND deleted = 0
AND... | [
"public",
"function",
"getAllSegmentsForSite",
"(",
"$",
"idSite",
",",
"$",
"userLogin",
")",
"{",
"$",
"bind",
"=",
"array",
"(",
"$",
"idSite",
",",
"$",
"userLogin",
")",
";",
"$",
"sql",
"=",
"$",
"this",
"->",
"buildQuerySortedByName",
"(",
"'(enab... | Returns all stored segments that are available for the given site and login.
@param string $userLogin
@param int $idSite Whether to return stored segments for a specific idSite, or all of them. If supplied, must be a valid site ID.
@return array | [
"Returns",
"all",
"stored",
"segments",
"that",
"are",
"available",
"for",
"the",
"given",
"site",
"and",
"login",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SegmentEditor/Model.php#L90-L99 | train | Get all segments for a site and a user | [
30522,
2270,
3853,
2131,
8095,
3366,
21693,
11187,
29278,
28032,
2063,
1006,
1002,
8909,
28032,
2063,
1010,
1002,
5310,
21197,
2378,
1007,
1063,
1002,
14187,
1027,
9140,
1006,
1002,
8909,
28032,
2063,
1010,
1002,
5310,
21197,
2378,
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/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php | TextDescriptor.describeContainerTags | protected function describeContainerTags(ContainerBuilder $builder, array $options = [])
{
$showHidden = isset($options['show_hidden']) && $options['show_hidden'];
if ($showHidden) {
$options['output']->title('Symfony Container Hidden Tags');
} else {
$options['outpu... | php | protected function describeContainerTags(ContainerBuilder $builder, array $options = [])
{
$showHidden = isset($options['show_hidden']) && $options['show_hidden'];
if ($showHidden) {
$options['output']->title('Symfony Container Hidden Tags');
} else {
$options['outpu... | [
"protected",
"function",
"describeContainerTags",
"(",
"ContainerBuilder",
"$",
"builder",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"showHidden",
"=",
"isset",
"(",
"$",
"options",
"[",
"'show_hidden'",
"]",
")",
"&&",
"$",
"options",
"[... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php#L133-L147 | train | Describes the container tags | [
30522,
5123,
3853,
6235,
8663,
18249,
8743,
26454,
1006,
11661,
8569,
23891,
2099,
1002,
12508,
1010,
9140,
1002,
7047,
1027,
1031,
1033,
1007,
1063,
1002,
2265,
27511,
4181,
1027,
26354,
3388,
1006,
1002,
7047,
1031,
1005,
2265,
1035,
5023... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Loader/YamlFileLoader.php | YamlFileLoader.load | public function load($file, $type = null)
{
$path = $this->locator->locate($file);
if (!stream_is_local($path)) {
throw new \InvalidArgumentException(sprintf('This is not a local file "%s".', $path));
}
if (!file_exists($path)) {
throw new \InvalidArgumentEx... | php | public function load($file, $type = null)
{
$path = $this->locator->locate($file);
if (!stream_is_local($path)) {
throw new \InvalidArgumentException(sprintf('This is not a local file "%s".', $path));
}
if (!file_exists($path)) {
throw new \InvalidArgumentEx... | [
"public",
"function",
"load",
"(",
"$",
"file",
",",
"$",
"type",
"=",
"null",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"locator",
"->",
"locate",
"(",
"$",
"file",
")",
";",
"if",
"(",
"!",
"stream_is_local",
"(",
"$",
"path",
")",
")",
... | Loads a Yaml file.
@param string $file A Yaml file path
@param string|null $type The resource type
@return RouteCollection A RouteCollection instance
@throws \InvalidArgumentException When a route can't be parsed because YAML is invalid | [
"Loads",
"a",
"Yaml",
"file",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Routing/Loader/YamlFileLoader.php#L45-L91 | train | Load a YAML file into a RouteCollection | [
30522,
2270,
3853,
7170,
1006,
1002,
5371,
1010,
1002,
2828,
1027,
19701,
1007,
1063,
1002,
4130,
1027,
1002,
2023,
1011,
1028,
8840,
11266,
2953,
1011,
1028,
12453,
1006,
1002,
5371,
1007,
1025,
2065,
1006,
999,
5460,
1035,
2003,
1035,
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/HttpKernel/DependencyInjection/ResettableServicePass.php | ResettableServicePass.process | public function process(ContainerBuilder $container)
{
if (!$container->has('services_resetter')) {
return;
}
$services = $methods = [];
foreach ($container->findTaggedServiceIds($this->tagName, true) as $id => $tags) {
$services[$id] = new Reference($id, Co... | php | public function process(ContainerBuilder $container)
{
if (!$container->has('services_resetter')) {
return;
}
$services = $methods = [];
foreach ($container->findTaggedServiceIds($this->tagName, true) as $id => $tags) {
$services[$id] = new Reference($id, Co... | [
"public",
"function",
"process",
"(",
"ContainerBuilder",
"$",
"container",
")",
"{",
"if",
"(",
"!",
"$",
"container",
"->",
"has",
"(",
"'services_resetter'",
")",
")",
"{",
"return",
";",
"}",
"$",
"services",
"=",
"$",
"methods",
"=",
"[",
"]",
";"... | {@inheritdoc} | [
"{"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/DependencyInjection/ResettableServicePass.php#L36-L65 | train | Adds services resetter to the container | [
30522,
2270,
3853,
2832,
1006,
11661,
8569,
23891,
2099,
1002,
11661,
1007,
1063,
2065,
1006,
999,
1002,
11661,
1011,
1028,
2038,
1006,
1005,
2578,
1035,
25141,
3334,
1005,
1007,
1007,
1063,
2709,
1025,
1065,
1002,
2578,
1027,
1002,
4725,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Debug/TraceableEventDispatcher.php | TraceableEventDispatcher.getNotCalledListeners | public function getNotCalledListeners(/* Request $request = null */)
{
try {
$allListeners = $this->getListeners();
} catch (\Exception $e) {
if (null !== $this->logger) {
$this->logger->info('An exception was thrown while getting the uncalled listeners.', ['e... | php | public function getNotCalledListeners(/* Request $request = null */)
{
try {
$allListeners = $this->getListeners();
} catch (\Exception $e) {
if (null !== $this->logger) {
$this->logger->info('An exception was thrown while getting the uncalled listeners.', ['e... | [
"public",
"function",
"getNotCalledListeners",
"(",
"/* Request $request = null */",
")",
"{",
"try",
"{",
"$",
"allListeners",
"=",
"$",
"this",
"->",
"getListeners",
"(",
")",
";",
"}",
"catch",
"(",
"\\",
"Exception",
"$",
"e",
")",
"{",
"if",
"(",
"nul... | {@inheritdoc}
@param Request|null $request The request to get listeners for | [
"{",
"@inheritdoc",
"}"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php#L213-L254 | train | Returns all not called listeners | [
30522,
2270,
3853,
2131,
17048,
9289,
3709,
9863,
24454,
2015,
1006,
1013,
1008,
5227,
1002,
5227,
1027,
19701,
1008,
1013,
1007,
1063,
3046,
1063,
1002,
2035,
9863,
24454,
2015,
1027,
1002,
2023,
1011,
1028,
2131,
9863,
24454,
2015,
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/backend/ServiceProvider.php | ServiceProvider.registerBackendWidgets | protected function registerBackendWidgets()
{
WidgetManager::instance()->registerFormWidgets(function ($manager) {
$manager->registerFormWidget('Backend\FormWidgets\CodeEditor', 'codeeditor');
$manager->registerFormWidget('Backend\FormWidgets\RichEditor', 'richeditor');
$... | php | protected function registerBackendWidgets()
{
WidgetManager::instance()->registerFormWidgets(function ($manager) {
$manager->registerFormWidget('Backend\FormWidgets\CodeEditor', 'codeeditor');
$manager->registerFormWidget('Backend\FormWidgets\RichEditor', 'richeditor');
$... | [
"protected",
"function",
"registerBackendWidgets",
"(",
")",
"{",
"WidgetManager",
"::",
"instance",
"(",
")",
"->",
"registerFormWidgets",
"(",
"function",
"(",
"$",
"manager",
")",
"{",
"$",
"manager",
"->",
"registerFormWidget",
"(",
"'Backend\\FormWidgets\\CodeE... | /*
Register widgets | [
"/",
"*",
"Register",
"widgets"
] | 3118660d834f161d513da08477be92281a2eb96a | https://github.com/octobercms/october/blob/3118660d834f161d513da08477be92281a2eb96a/modules/backend/ServiceProvider.php#L171-L189 | train | Register backend widgets | [
30522,
5123,
3853,
4236,
5963,
10497,
9148,
28682,
1006,
1007,
1063,
15536,
24291,
24805,
4590,
1024,
1024,
6013,
1006,
1007,
1011,
1028,
4236,
14192,
9148,
28682,
1006,
3853,
1006,
1002,
3208,
1007,
1063,
1002,
3208,
1011,
1028,
4236,
1419... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.