id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
201,800 | agentmedia/phine-core | src/Core/Modules/Backend/TemplateForm.php | TemplateForm.InitModule | private function InitModule(array $idParts)
{
if (count($idParts) < 1 || count($idParts) > 2)
{
//TODO: Message
Response::Redirect(BackendRouter::ModuleUrl(new TemplateList()));
}
$this->module = ClassFinder::CreateFrontendModule($idParts[0]);
if (!$th... | php | private function InitModule(array $idParts)
{
if (count($idParts) < 1 || count($idParts) > 2)
{
//TODO: Message
Response::Redirect(BackendRouter::ModuleUrl(new TemplateList()));
}
$this->module = ClassFinder::CreateFrontendModule($idParts[0]);
if (!$th... | [
"private",
"function",
"InitModule",
"(",
"array",
"$",
"idParts",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"idParts",
")",
"<",
"1",
"||",
"count",
"(",
"$",
"idParts",
")",
">",
"2",
")",
"{",
"//TODO: Message",
"Response",
"::",
"Redirect",
"(",
"B... | Initializes the bundle and module names
@param array $idParts | [
"Initializes",
"the",
"bundle",
"and",
"module",
"names"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/TemplateForm.php#L64-L77 |
201,801 | agentmedia/phine-core | src/Core/Modules/Backend/TemplateForm.php | TemplateForm.OnSuccess | protected function OnSuccess()
{
$newTemplate = $this->Value('Name');
$action = Action::Create();
if ($this->template)
{
$action = Action::Update();
$this->UpdateUsages($newTemplate);
$oldFile = $this->CalcFile($this->template);
if (Fil... | php | protected function OnSuccess()
{
$newTemplate = $this->Value('Name');
$action = Action::Create();
if ($this->template)
{
$action = Action::Update();
$this->UpdateUsages($newTemplate);
$oldFile = $this->CalcFile($this->template);
if (Fil... | [
"protected",
"function",
"OnSuccess",
"(",
")",
"{",
"$",
"newTemplate",
"=",
"$",
"this",
"->",
"Value",
"(",
"'Name'",
")",
";",
"$",
"action",
"=",
"Action",
"::",
"Create",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"template",
")",
"{",
"$",... | Saves the template into the given file name | [
"Saves",
"the",
"template",
"into",
"the",
"given",
"file",
"name"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/TemplateForm.php#L121-L143 |
201,802 | TiMESPLiNTER/tsfw-i18n | src/timesplinter/tsfw/i18n/common/Localizer.php | Localizer.getLocales | public function getLocales()
{
$currentLocales = array();
foreach($this->localeCategories as $category) {
if($category === LC_ALL)
continue;
$currentLocales[$category] = setlocale($category, 0);
}
return $currentLocales;
} | php | public function getLocales()
{
$currentLocales = array();
foreach($this->localeCategories as $category) {
if($category === LC_ALL)
continue;
$currentLocales[$category] = setlocale($category, 0);
}
return $currentLocales;
} | [
"public",
"function",
"getLocales",
"(",
")",
"{",
"$",
"currentLocales",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"localeCategories",
"as",
"$",
"category",
")",
"{",
"if",
"(",
"$",
"category",
"===",
"LC_ALL",
")",
"continue",
... | Get all categories with its corresponding locale set
@return array List of set locales. Category as key and its corresponding locale as value. | [
"Get",
"all",
"categories",
"with",
"its",
"corresponding",
"locale",
"set"
] | 31769efe75ecab2757911a296ad4c5a9c6158b6d | https://github.com/TiMESPLiNTER/tsfw-i18n/blob/31769efe75ecab2757911a296ad4c5a9c6158b6d/src/timesplinter/tsfw/i18n/common/Localizer.php#L118-L130 |
201,803 | recca0120/lodash-php | src/JString/PHP.php | PHP.pad | public function pad($length = 0, $chars = ' ', $type = STR_PAD_BOTH)
{
return new static(str_pad($this->subject, $length, $chars, $type));
} | php | public function pad($length = 0, $chars = ' ', $type = STR_PAD_BOTH)
{
return new static(str_pad($this->subject, $length, $chars, $type));
} | [
"public",
"function",
"pad",
"(",
"$",
"length",
"=",
"0",
",",
"$",
"chars",
"=",
"' '",
",",
"$",
"type",
"=",
"STR_PAD_BOTH",
")",
"{",
"return",
"new",
"static",
"(",
"str_pad",
"(",
"$",
"this",
"->",
"subject",
",",
"$",
"length",
",",
"$",
... | Pad a string to a certain length with another string.
@param int $length
@param string $chars
@param int $type
@return static | [
"Pad",
"a",
"string",
"to",
"a",
"certain",
"length",
"with",
"another",
"string",
"."
] | 65f8c80accfc2b087abf6d0590a5bd9fd15b467d | https://github.com/recca0120/lodash-php/blob/65f8c80accfc2b087abf6d0590a5bd9fd15b467d/src/JString/PHP.php#L239-L242 |
201,804 | stubbles/stubbles-streams | src/main/php/ResourceInputStream.php | ResourceInputStream.doRead | private function doRead(string $read, int $length): string
{
if (null === $this->handle) {
throw new \LogicException('Can not read from closed input stream.');
}
$data = @$read($this->handle, $length);
if (false === $data) {
$error = lastErrorMessage('unknown... | php | private function doRead(string $read, int $length): string
{
if (null === $this->handle) {
throw new \LogicException('Can not read from closed input stream.');
}
$data = @$read($this->handle, $length);
if (false === $data) {
$error = lastErrorMessage('unknown... | [
"private",
"function",
"doRead",
"(",
"string",
"$",
"read",
",",
"int",
"$",
"length",
")",
":",
"string",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"handle",
")",
"{",
"throw",
"new",
"\\",
"LogicException",
"(",
"'Can not read from closed input ... | do actual read
@param string $read function to use for reading from handle
@param int $length max amount of bytes to read
@return string
@throws \LogicException
@throws \stubbles\streams\StreamException | [
"do",
"actual",
"read"
] | 99b0dace5fcf71584d1456b4b5408017b896bdf5 | https://github.com/stubbles/stubbles-streams/blob/99b0dace5fcf71584d1456b4b5408017b896bdf5/src/main/php/ResourceInputStream.php#L78-L97 |
201,805 | stubbles/stubbles-streams | src/main/php/ResourceInputStream.php | ResourceInputStream.bytesLeft | public function bytesLeft(): int
{
if (null === $this->handle || !is_resource($this->handle)) {
throw new \LogicException('Can not read from closed input stream.');
}
$bytesRead = ftell($this->handle);
if (!is_int($bytesRead)) {
return 0;
}
r... | php | public function bytesLeft(): int
{
if (null === $this->handle || !is_resource($this->handle)) {
throw new \LogicException('Can not read from closed input stream.');
}
$bytesRead = ftell($this->handle);
if (!is_int($bytesRead)) {
return 0;
}
r... | [
"public",
"function",
"bytesLeft",
"(",
")",
":",
"int",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"handle",
"||",
"!",
"is_resource",
"(",
"$",
"this",
"->",
"handle",
")",
")",
"{",
"throw",
"new",
"\\",
"LogicException",
"(",
"'Can not read ... | returns the amount of bytes left to be read
@return int
@throws \LogicException | [
"returns",
"the",
"amount",
"of",
"bytes",
"left",
"to",
"be",
"read"
] | 99b0dace5fcf71584d1456b4b5408017b896bdf5 | https://github.com/stubbles/stubbles-streams/blob/99b0dace5fcf71584d1456b4b5408017b896bdf5/src/main/php/ResourceInputStream.php#L105-L117 |
201,806 | CanalTP/NavitiaIoApiComponent | src/NavitiaIoApiService.php | NavitiaIoApiService.getUser | public function getUser($id)
{
$request = $this->client->get($this->customer['url'].'/api/users/'.$id);
$request->setAuth($this->customer['username'], $this->customer['password']);
$response = $request->send();
return json_decode((string) $response->getBody(true));
} | php | public function getUser($id)
{
$request = $this->client->get($this->customer['url'].'/api/users/'.$id);
$request->setAuth($this->customer['username'], $this->customer['password']);
$response = $request->send();
return json_decode((string) $response->getBody(true));
} | [
"public",
"function",
"getUser",
"(",
"$",
"id",
")",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"client",
"->",
"get",
"(",
"$",
"this",
"->",
"customer",
"[",
"'url'",
"]",
".",
"'/api/users/'",
".",
"$",
"id",
")",
";",
"$",
"request",
"->",
... | Get a specific user
@param int $id
@return mixed | [
"Get",
"a",
"specific",
"user"
] | c44d0fd73c20e892b8a0839cf83d25b7a1412aff | https://github.com/CanalTP/NavitiaIoApiComponent/blob/c44d0fd73c20e892b8a0839cf83d25b7a1412aff/src/NavitiaIoApiService.php#L101-L109 |
201,807 | CanalTP/NavitiaIoApiComponent | src/NavitiaIoApiService.php | NavitiaIoApiService.patchUser | public function patchUser($id, array $fields)
{
$request = $this->client->patch($this->customer['url'].'/api/users/'.$id);
$request->setAuth($this->customer['username'], $this->customer['password']);
$request->setBody(json_encode($fields));
$response = $request->send();
re... | php | public function patchUser($id, array $fields)
{
$request = $this->client->patch($this->customer['url'].'/api/users/'.$id);
$request->setAuth($this->customer['username'], $this->customer['password']);
$request->setBody(json_encode($fields));
$response = $request->send();
re... | [
"public",
"function",
"patchUser",
"(",
"$",
"id",
",",
"array",
"$",
"fields",
")",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"client",
"->",
"patch",
"(",
"$",
"this",
"->",
"customer",
"[",
"'url'",
"]",
".",
"'/api/users/'",
".",
"$",
"id",
... | Edit an user fields.
@param int $id
@param array $fields
@return mixed | [
"Edit",
"an",
"user",
"fields",
"."
] | c44d0fd73c20e892b8a0839cf83d25b7a1412aff | https://github.com/CanalTP/NavitiaIoApiComponent/blob/c44d0fd73c20e892b8a0839cf83d25b7a1412aff/src/NavitiaIoApiService.php#L119-L129 |
201,808 | Wedeto/HTTP | src/Request.php | Request.setURLFromServerVars | public function setURLFromServerVars()
{
if ($this->server->get('REQUEST_SCHEME'))
{
$base = $this->server['REQUEST_SCHEME'] . '://' . $this->server['SERVER_NAME'];
$this->url = new URL($base . $this->server['REQUEST_URI']);
$this->webroot = new URL($base . rtrim(... | php | public function setURLFromServerVars()
{
if ($this->server->get('REQUEST_SCHEME'))
{
$base = $this->server['REQUEST_SCHEME'] . '://' . $this->server['SERVER_NAME'];
$this->url = new URL($base . $this->server['REQUEST_URI']);
$this->webroot = new URL($base . rtrim(... | [
"public",
"function",
"setURLFromServerVars",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"server",
"->",
"get",
"(",
"'REQUEST_SCHEME'",
")",
")",
"{",
"$",
"base",
"=",
"$",
"this",
"->",
"server",
"[",
"'REQUEST_SCHEME'",
"]",
".",
"'://'",
".",
"$... | Determine the webroot and the URL from server variables. Webroot is
based on the location of the index.php that is executing, which we
consider to be the webroot. | [
"Determine",
"the",
"webroot",
"and",
"the",
"URL",
"from",
"server",
"variables",
".",
"Webroot",
"is",
"based",
"on",
"the",
"location",
"of",
"the",
"index",
".",
"php",
"that",
"is",
"executing",
"which",
"we",
"consider",
"to",
"be",
"the",
"webroot",... | 7318eff1b81a3c103c4263466d09b7f3593b70b9 | https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Request.php#L159-L177 |
201,809 | Wedeto/HTTP | src/Request.php | Request.startSession | public function startSession(URL $domain, Dictionary $config)
{
if ($this->session === null)
{
$this->session = new Session($domain, $config, $this->server);
$this->session->start();
}
return $this;
} | php | public function startSession(URL $domain, Dictionary $config)
{
if ($this->session === null)
{
$this->session = new Session($domain, $config, $this->server);
$this->session->start();
}
return $this;
} | [
"public",
"function",
"startSession",
"(",
"URL",
"$",
"domain",
",",
"Dictionary",
"$",
"config",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"session",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"session",
"=",
"new",
"Session",
"(",
"$",
"domain",
",... | Start the HTTP Session, and initalize the session object
@param Wedeto\HTTP\Request Provides fluent interface | [
"Start",
"the",
"HTTP",
"Session",
"and",
"initalize",
"the",
"session",
"object"
] | 7318eff1b81a3c103c4263466d09b7f3593b70b9 | https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Request.php#L202-L210 |
201,810 | holyshared/file-fixture | src/container/LoaderContainer.php | LoaderContainer.register | public function register(FixtureLoader $loader)
{
$value = new Pair($loader->getName(), $loader);
$this->loaders->add($value);
return $this;
} | php | public function register(FixtureLoader $loader)
{
$value = new Pair($loader->getName(), $loader);
$this->loaders->add($value);
return $this;
} | [
"public",
"function",
"register",
"(",
"FixtureLoader",
"$",
"loader",
")",
"{",
"$",
"value",
"=",
"new",
"Pair",
"(",
"$",
"loader",
"->",
"getName",
"(",
")",
",",
"$",
"loader",
")",
";",
"$",
"this",
"->",
"loaders",
"->",
"add",
"(",
"$",
"va... | Register the loader of fixture
@param \holyshared\fixture\FixtureLoader $loader
@return holyshared\fixture\container\LoaderContainer | [
"Register",
"the",
"loader",
"of",
"fixture"
] | 65bfc8def327362392eef1bdf2f6d822b70e7c33 | https://github.com/holyshared/file-fixture/blob/65bfc8def327362392eef1bdf2f6d822b70e7c33/src/container/LoaderContainer.php#L63-L68 |
201,811 | CodeMommy/DevelopPHP | command/PHPDepend.php | PHPDepend.getBasePath | private static function getBasePath()
{
if (empty(self::$basePath)) {
self::$basePath = sprintf('%s%s%s', sys_get_temp_dir(), DIRECTORY_SEPARATOR, self::BASE_PATH_NAME);
}
return self::$basePath;
} | php | private static function getBasePath()
{
if (empty(self::$basePath)) {
self::$basePath = sprintf('%s%s%s', sys_get_temp_dir(), DIRECTORY_SEPARATOR, self::BASE_PATH_NAME);
}
return self::$basePath;
} | [
"private",
"static",
"function",
"getBasePath",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"self",
"::",
"$",
"basePath",
")",
")",
"{",
"self",
"::",
"$",
"basePath",
"=",
"sprintf",
"(",
"'%s%s%s'",
",",
"sys_get_temp_dir",
"(",
")",
",",
"DIRECTORY_SEPAR... | Get Base Path
@return string | [
"Get",
"Base",
"Path"
] | 3e6da83965fe0dd18020ce5c4c3384c62de21fff | https://github.com/CodeMommy/DevelopPHP/blob/3e6da83965fe0dd18020ce5c4c3384c62de21fff/command/PHPDepend.php#L62-L68 |
201,812 | CodeMommy/DevelopPHP | command/PHPDepend.php | PHPDepend.getWorkbenchPath | private static function getWorkbenchPath()
{
if (empty(self::$workbenchPath)) {
self::$workbenchPath = sprintf(
'%s%s%s%s',
self::getBasePath(),
DIRECTORY_SEPARATOR,
time(),
rand(100, 999)
);
}
... | php | private static function getWorkbenchPath()
{
if (empty(self::$workbenchPath)) {
self::$workbenchPath = sprintf(
'%s%s%s%s',
self::getBasePath(),
DIRECTORY_SEPARATOR,
time(),
rand(100, 999)
);
}
... | [
"private",
"static",
"function",
"getWorkbenchPath",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"self",
"::",
"$",
"workbenchPath",
")",
")",
"{",
"self",
"::",
"$",
"workbenchPath",
"=",
"sprintf",
"(",
"'%s%s%s%s'",
",",
"self",
"::",
"getBasePath",
"(",
... | Get Workbench Path
@return string | [
"Get",
"Workbench",
"Path"
] | 3e6da83965fe0dd18020ce5c4c3384c62de21fff | https://github.com/CodeMommy/DevelopPHP/blob/3e6da83965fe0dd18020ce5c4c3384c62de21fff/command/PHPDepend.php#L74-L86 |
201,813 | fridge-project/dbal | src/Fridge/DBAL/SchemaManager/AbstractSchemaManager.php | AbstractSchemaManager.getGenericDatabases | protected function getGenericDatabases(array $databases)
{
$genericDatabases = array();
foreach ($databases as $database) {
$genericDatabases[] = $this->getGenericDatabase($database);
}
return $genericDatabases;
} | php | protected function getGenericDatabases(array $databases)
{
$genericDatabases = array();
foreach ($databases as $database) {
$genericDatabases[] = $this->getGenericDatabase($database);
}
return $genericDatabases;
} | [
"protected",
"function",
"getGenericDatabases",
"(",
"array",
"$",
"databases",
")",
"{",
"$",
"genericDatabases",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"databases",
"as",
"$",
"database",
")",
"{",
"$",
"genericDatabases",
"[",
"]",
"=",
"$",
... | Gets the generic databases.
@param array $databases The databases.
@return array The generic databases. | [
"Gets",
"the",
"generic",
"databases",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/SchemaManager/AbstractSchemaManager.php#L687-L696 |
201,814 | fridge-project/dbal | src/Fridge/DBAL/SchemaManager/AbstractSchemaManager.php | AbstractSchemaManager.getGenericSequences | protected function getGenericSequences(array $sequences)
{
$genericSequences = array();
foreach ($sequences as $sequence) {
$genericSequences[] = $this->getGenericSequence($sequence);
}
return $genericSequences;
} | php | protected function getGenericSequences(array $sequences)
{
$genericSequences = array();
foreach ($sequences as $sequence) {
$genericSequences[] = $this->getGenericSequence($sequence);
}
return $genericSequences;
} | [
"protected",
"function",
"getGenericSequences",
"(",
"array",
"$",
"sequences",
")",
"{",
"$",
"genericSequences",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"sequences",
"as",
"$",
"sequence",
")",
"{",
"$",
"genericSequences",
"[",
"]",
"=",
"$",
... | Gets the generic sequences.
@param array $sequences The sequences.
@return array The generic sequences. | [
"Gets",
"the",
"generic",
"sequences",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/SchemaManager/AbstractSchemaManager.php#L720-L729 |
201,815 | fridge-project/dbal | src/Fridge/DBAL/SchemaManager/AbstractSchemaManager.php | AbstractSchemaManager.getGenericSequence | protected function getGenericSequence($sequence)
{
$name = $sequence['name'];
$initialValue = (int) $sequence['initial_value'];
$incrementSize = (int) $sequence['increment_size'];
return new Sequence($name, $initialValue, $incrementSize);
} | php | protected function getGenericSequence($sequence)
{
$name = $sequence['name'];
$initialValue = (int) $sequence['initial_value'];
$incrementSize = (int) $sequence['increment_size'];
return new Sequence($name, $initialValue, $incrementSize);
} | [
"protected",
"function",
"getGenericSequence",
"(",
"$",
"sequence",
")",
"{",
"$",
"name",
"=",
"$",
"sequence",
"[",
"'name'",
"]",
";",
"$",
"initialValue",
"=",
"(",
"int",
")",
"$",
"sequence",
"[",
"'initial_value'",
"]",
";",
"$",
"incrementSize",
... | Gets the generic sequence.
The $sequence parameter must contain:
- name
- initial_value
- increment_size
@param mixed $sequence The sequence.
@return \Fridge\DBAL\Schema\Sequence The generic sequence. | [
"Gets",
"the",
"generic",
"sequence",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/SchemaManager/AbstractSchemaManager.php#L743-L750 |
201,816 | fridge-project/dbal | src/Fridge/DBAL/SchemaManager/AbstractSchemaManager.php | AbstractSchemaManager.getGenericViews | protected function getGenericViews(array $views)
{
$genericViews = array();
foreach ($views as $view) {
$genericViews[] = $this->getGenericView($view);
}
return $genericViews;
} | php | protected function getGenericViews(array $views)
{
$genericViews = array();
foreach ($views as $view) {
$genericViews[] = $this->getGenericView($view);
}
return $genericViews;
} | [
"protected",
"function",
"getGenericViews",
"(",
"array",
"$",
"views",
")",
"{",
"$",
"genericViews",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"views",
"as",
"$",
"view",
")",
"{",
"$",
"genericViews",
"[",
"]",
"=",
"$",
"this",
"->",
"get... | Gets the generic views.
@param array $views The views.
@return array The generic views. | [
"Gets",
"the",
"generic",
"views",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/SchemaManager/AbstractSchemaManager.php#L759-L768 |
201,817 | fridge-project/dbal | src/Fridge/DBAL/SchemaManager/AbstractSchemaManager.php | AbstractSchemaManager.getGenericTableNames | protected function getGenericTableNames(array $tableNames)
{
$genericTableNames = array();
foreach ($tableNames as $tableName) {
$genericTableNames[] = $this->getGenericTableName($tableName);
}
return $genericTableNames;
} | php | protected function getGenericTableNames(array $tableNames)
{
$genericTableNames = array();
foreach ($tableNames as $tableName) {
$genericTableNames[] = $this->getGenericTableName($tableName);
}
return $genericTableNames;
} | [
"protected",
"function",
"getGenericTableNames",
"(",
"array",
"$",
"tableNames",
")",
"{",
"$",
"genericTableNames",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"tableNames",
"as",
"$",
"tableName",
")",
"{",
"$",
"genericTableNames",
"[",
"]",
"=",
... | Gets the generic table names.
@param array $tableNames The table names.
@return array The generic table names. | [
"Gets",
"the",
"generic",
"table",
"names",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/SchemaManager/AbstractSchemaManager.php#L793-L802 |
201,818 | fridge-project/dbal | src/Fridge/DBAL/SchemaManager/AbstractSchemaManager.php | AbstractSchemaManager.getGenericColumns | protected function getGenericColumns(array $columns)
{
$genericColumns = array();
foreach ($columns as $column) {
$genericColumns[] = $this->getGenericColumn($column);
}
return $genericColumns;
} | php | protected function getGenericColumns(array $columns)
{
$genericColumns = array();
foreach ($columns as $column) {
$genericColumns[] = $this->getGenericColumn($column);
}
return $genericColumns;
} | [
"protected",
"function",
"getGenericColumns",
"(",
"array",
"$",
"columns",
")",
"{",
"$",
"genericColumns",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"columns",
"as",
"$",
"column",
")",
"{",
"$",
"genericColumns",
"[",
"]",
"=",
"$",
"this",
... | Gets the generic table columns.
@param array $columns The columns.
@return array The generic columns. | [
"Gets",
"the",
"generic",
"table",
"columns",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/SchemaManager/AbstractSchemaManager.php#L826-L835 |
201,819 | fridge-project/dbal | src/Fridge/DBAL/SchemaManager/AbstractSchemaManager.php | AbstractSchemaManager.getGenericColumn | protected function getGenericColumn(array $column)
{
$name = $column['name'];
list($column['comment'], $typeName) = $this->extractTypeFromComment($column['comment']);
if ($typeName === null) {
$typeName = $this->getConnection()->getPlatform()->getMappedType($column['type']);
... | php | protected function getGenericColumn(array $column)
{
$name = $column['name'];
list($column['comment'], $typeName) = $this->extractTypeFromComment($column['comment']);
if ($typeName === null) {
$typeName = $this->getConnection()->getPlatform()->getMappedType($column['type']);
... | [
"protected",
"function",
"getGenericColumn",
"(",
"array",
"$",
"column",
")",
"{",
"$",
"name",
"=",
"$",
"column",
"[",
"'name'",
"]",
";",
"list",
"(",
"$",
"column",
"[",
"'comment'",
"]",
",",
"$",
"typeName",
")",
"=",
"$",
"this",
"->",
"extra... | Gets the generic table column.
The $column parameter must contain:
- name
- type
- length
- precision
- scale
- unisgned
- fixed
- not_null
- default
- auto_increment
- comment
@param array $column The column.
@return \Fridge\DBAL\Schema\Column The generic column. | [
"Gets",
"the",
"generic",
"table",
"column",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/SchemaManager/AbstractSchemaManager.php#L857-L886 |
201,820 | fridge-project/dbal | src/Fridge/DBAL/SchemaManager/AbstractSchemaManager.php | AbstractSchemaManager.getGenericPrimaryKey | protected function getGenericPrimaryKey(array $primaryKey)
{
$genericPrimaryKey = new PrimaryKey($primaryKey[0]['name']);
foreach ($primaryKey as $primaryKeyColumn) {
$genericPrimaryKey->addColumnName($primaryKeyColumn['column_name']);
}
return $genericPrimaryKey;
} | php | protected function getGenericPrimaryKey(array $primaryKey)
{
$genericPrimaryKey = new PrimaryKey($primaryKey[0]['name']);
foreach ($primaryKey as $primaryKeyColumn) {
$genericPrimaryKey->addColumnName($primaryKeyColumn['column_name']);
}
return $genericPrimaryKey;
} | [
"protected",
"function",
"getGenericPrimaryKey",
"(",
"array",
"$",
"primaryKey",
")",
"{",
"$",
"genericPrimaryKey",
"=",
"new",
"PrimaryKey",
"(",
"$",
"primaryKey",
"[",
"0",
"]",
"[",
"'name'",
"]",
")",
";",
"foreach",
"(",
"$",
"primaryKey",
"as",
"$... | Gets the generic table primary key.
The $primaryKey parameter must contain:
- name
- column_name
@param array $primaryKey The primary key.
@return \Fridge\DBAL\Schema\PrimaryKey|null The generic primary key. | [
"Gets",
"the",
"generic",
"table",
"primary",
"key",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/SchemaManager/AbstractSchemaManager.php#L899-L908 |
201,821 | fridge-project/dbal | src/Fridge/DBAL/SchemaManager/AbstractSchemaManager.php | AbstractSchemaManager.getGenericForeignKeys | protected function getGenericForeignKeys(array $foreignKeys)
{
$genericForeignKeys = array();
foreach ($foreignKeys as $foreignKey) {
$name = $foreignKey['name'];
if (!isset($genericForeignKeys[$name])) {
$genericForeignKeys[$name] = new ForeignKey(
... | php | protected function getGenericForeignKeys(array $foreignKeys)
{
$genericForeignKeys = array();
foreach ($foreignKeys as $foreignKey) {
$name = $foreignKey['name'];
if (!isset($genericForeignKeys[$name])) {
$genericForeignKeys[$name] = new ForeignKey(
... | [
"protected",
"function",
"getGenericForeignKeys",
"(",
"array",
"$",
"foreignKeys",
")",
"{",
"$",
"genericForeignKeys",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"foreignKeys",
"as",
"$",
"foreignKey",
")",
"{",
"$",
"name",
"=",
"$",
"foreignKey",
... | Gets the generic table foreign keys.
The $foreignKeys parameter contains:
- name
- local_column_name
- foreign_table_name
- foreign_column_name
- on_delete
- on_update
@param array $foreignKeys The foreign keys.
@return array The generic foreign keys. | [
"Gets",
"the",
"generic",
"table",
"foreign",
"keys",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/SchemaManager/AbstractSchemaManager.php#L925-L948 |
201,822 | fridge-project/dbal | src/Fridge/DBAL/SchemaManager/AbstractSchemaManager.php | AbstractSchemaManager.getGenericIndexes | protected function getGenericIndexes(array $indexes)
{
$genericIndexes = array();
foreach ($indexes as $index) {
$name = $index['name'];
if (!isset($genericIndexes[$name])) {
$genericIndexes[$name] = new Index($name, array($index['column_name']), (bool) $ind... | php | protected function getGenericIndexes(array $indexes)
{
$genericIndexes = array();
foreach ($indexes as $index) {
$name = $index['name'];
if (!isset($genericIndexes[$name])) {
$genericIndexes[$name] = new Index($name, array($index['column_name']), (bool) $ind... | [
"protected",
"function",
"getGenericIndexes",
"(",
"array",
"$",
"indexes",
")",
"{",
"$",
"genericIndexes",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"indexes",
"as",
"$",
"index",
")",
"{",
"$",
"name",
"=",
"$",
"index",
"[",
"'name'",
"]",
... | Gets the generic table indexes.
The $indexes parameter contains:
- name
- column_name
- unique
@param array $indexes The indexes.
@return array The generic indexes. | [
"Gets",
"the",
"generic",
"table",
"indexes",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/SchemaManager/AbstractSchemaManager.php#L962-L977 |
201,823 | fridge-project/dbal | src/Fridge/DBAL/SchemaManager/AbstractSchemaManager.php | AbstractSchemaManager.getGenericChecks | protected function getGenericChecks(array $checks)
{
$genericChecks = array();
foreach ($checks as $check) {
$genericChecks[] = new Check($check['name'], $check['definition']);
}
return $genericChecks;
} | php | protected function getGenericChecks(array $checks)
{
$genericChecks = array();
foreach ($checks as $check) {
$genericChecks[] = new Check($check['name'], $check['definition']);
}
return $genericChecks;
} | [
"protected",
"function",
"getGenericChecks",
"(",
"array",
"$",
"checks",
")",
"{",
"$",
"genericChecks",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"checks",
"as",
"$",
"check",
")",
"{",
"$",
"genericChecks",
"[",
"]",
"=",
"new",
"Check",
"("... | Gets the generic table checks.
The $checks parameter contains:
- name
- definition
@param array $checks The checks.
@return array The generic checks. | [
"Gets",
"the",
"generic",
"table",
"checks",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/SchemaManager/AbstractSchemaManager.php#L990-L999 |
201,824 | fridge-project/dbal | src/Fridge/DBAL/SchemaManager/AbstractSchemaManager.php | AbstractSchemaManager.extractTypeFromComment | protected function extractTypeFromComment($comment)
{
if (preg_match('/^(.*)\(FridgeType::([a-zA-Z0-9]+)\)$/', $comment, $matches)) {
if (empty($matches[1])) {
$matches[1] = null;
}
return array($matches[1], strtolower($matches[2]));
}
re... | php | protected function extractTypeFromComment($comment)
{
if (preg_match('/^(.*)\(FridgeType::([a-zA-Z0-9]+)\)$/', $comment, $matches)) {
if (empty($matches[1])) {
$matches[1] = null;
}
return array($matches[1], strtolower($matches[2]));
}
re... | [
"protected",
"function",
"extractTypeFromComment",
"(",
"$",
"comment",
")",
"{",
"if",
"(",
"preg_match",
"(",
"'/^(.*)\\(FridgeType::([a-zA-Z0-9]+)\\)$/'",
",",
"$",
"comment",
",",
"$",
"matches",
")",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"matches",
"[",... | Extracts the type from the comment if it exists.
@param string $comment The comment.
@return array 0 => The extracted comment, 1 => The extracted type. | [
"Extracts",
"the",
"type",
"from",
"the",
"comment",
"if",
"it",
"exists",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/SchemaManager/AbstractSchemaManager.php#L1008-L1019 |
201,825 | fridge-project/dbal | src/Fridge/DBAL/SchemaManager/AbstractSchemaManager.php | AbstractSchemaManager.tryMethod | protected function tryMethod($method, array $arguments = array())
{
try {
call_user_func_array(array($this, $method), $arguments);
return true;
} catch (\Exception $e) {
return false;
}
} | php | protected function tryMethod($method, array $arguments = array())
{
try {
call_user_func_array(array($this, $method), $arguments);
return true;
} catch (\Exception $e) {
return false;
}
} | [
"protected",
"function",
"tryMethod",
"(",
"$",
"method",
",",
"array",
"$",
"arguments",
"=",
"array",
"(",
")",
")",
"{",
"try",
"{",
"call_user_func_array",
"(",
"array",
"(",
"$",
"this",
",",
"$",
"method",
")",
",",
"$",
"arguments",
")",
";",
... | Tries to execute a method.
@param string $method The method name.
@param array $arguments The method arguments.
@return boolean TRUE if the method has been executed successfully else FALSE. | [
"Tries",
"to",
"execute",
"a",
"method",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/SchemaManager/AbstractSchemaManager.php#L1029-L1038 |
201,826 | fiiSoft/fiisoft-tasks-queue | src/TasksQueue/Task/AbstractTask.php | AbstractTask.restoreState | protected function restoreState(array $data)
{
if (isset($data['status'])) {
$this->status = array_merge($this->status, $data['status']);
}
if (isset($data['jobUuid'])) {
$this->jobUuid = $data['jobUuid'];
$this->logContext['jobUuid'] = $data['jobUuid... | php | protected function restoreState(array $data)
{
if (isset($data['status'])) {
$this->status = array_merge($this->status, $data['status']);
}
if (isset($data['jobUuid'])) {
$this->jobUuid = $data['jobUuid'];
$this->logContext['jobUuid'] = $data['jobUuid... | [
"protected",
"function",
"restoreState",
"(",
"array",
"$",
"data",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"data",
"[",
"'status'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"status",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"status",
",",
"$",
"d... | Restore state of task from data supplied by command
@param array $data
@return void | [
"Restore",
"state",
"of",
"task",
"from",
"data",
"supplied",
"by",
"command"
] | 0c5d03f8e6f0fbe023f45e84d3db469dbea476ae | https://github.com/fiiSoft/fiisoft-tasks-queue/blob/0c5d03f8e6f0fbe023f45e84d3db469dbea476ae/src/TasksQueue/Task/AbstractTask.php#L131-L144 |
201,827 | OpenConext/Stepup-bundle | src/EventListener/LocaleCookieListener.php | LocaleCookieListener.onKernelResponse | public function onKernelResponse(FilterResponseEvent $event)
{
$locale = $this->localeProvider->determinePreferredLocale();
// Unable to determine preferred locale? No need to hand out a cookie then.
if (empty($locale)) {
return;
}
// Did the request already con... | php | public function onKernelResponse(FilterResponseEvent $event)
{
$locale = $this->localeProvider->determinePreferredLocale();
// Unable to determine preferred locale? No need to hand out a cookie then.
if (empty($locale)) {
return;
}
// Did the request already con... | [
"public",
"function",
"onKernelResponse",
"(",
"FilterResponseEvent",
"$",
"event",
")",
"{",
"$",
"locale",
"=",
"$",
"this",
"->",
"localeProvider",
"->",
"determinePreferredLocale",
"(",
")",
";",
"// Unable to determine preferred locale? No need to hand out a cookie the... | If there is a logged in user with a preferred language, set it as a cookie.
@param FilterResponseEvent $event | [
"If",
"there",
"is",
"a",
"logged",
"in",
"user",
"with",
"a",
"preferred",
"language",
"set",
"it",
"as",
"a",
"cookie",
"."
] | 94178ddb421889df9e068109293a8da880793ed2 | https://github.com/OpenConext/Stepup-bundle/blob/94178ddb421889df9e068109293a8da880793ed2/src/EventListener/LocaleCookieListener.php#L59-L80 |
201,828 | praxigento/mobi_mod_downline | Plugin/Magento/Customer/Model/AccountManagement.php | AccountManagement.beforeAuthenticate | public function beforeAuthenticate(
\Magento\Customer\Model\AccountManagement $subject,
$username,
$password
) {
try {
$mlmId = trim($username);
$found = $this->daoDwnlCust->getByMlmId($mlmId);
if ($found) {
$custId = $found->getCus... | php | public function beforeAuthenticate(
\Magento\Customer\Model\AccountManagement $subject,
$username,
$password
) {
try {
$mlmId = trim($username);
$found = $this->daoDwnlCust->getByMlmId($mlmId);
if ($found) {
$custId = $found->getCus... | [
"public",
"function",
"beforeAuthenticate",
"(",
"\\",
"Magento",
"\\",
"Customer",
"\\",
"Model",
"\\",
"AccountManagement",
"$",
"subject",
",",
"$",
"username",
",",
"$",
"password",
")",
"{",
"try",
"{",
"$",
"mlmId",
"=",
"trim",
"(",
"$",
"username",... | Look up for customer's email by MLM ID on authentication.
@param \Magento\Customer\Model\AccountManagement $subject
@param $username
@param $password
@return array | [
"Look",
"up",
"for",
"customer",
"s",
"email",
"by",
"MLM",
"ID",
"on",
"authentication",
"."
] | 0f3c276dfff1aa029f9fd205ccfc56f207a2e75b | https://github.com/praxigento/mobi_mod_downline/blob/0f3c276dfff1aa029f9fd205ccfc56f207a2e75b/Plugin/Magento/Customer/Model/AccountManagement.php#L36-L55 |
201,829 | praxigento/mobi_mod_downline | Plugin/Magento/Customer/Model/AccountManagement.php | AccountManagement.beforeCreateAccount | public function beforeCreateAccount(
\Magento\Customer\Model\AccountManagement $subject,
\Magento\Customer\Api\Data\CustomerInterface $customer,
$password = null,
$redirectUrl = ''
) {
$addrs = $customer->getAddresses();
if (is_array($addrs)) {
foreach ($a... | php | public function beforeCreateAccount(
\Magento\Customer\Model\AccountManagement $subject,
\Magento\Customer\Api\Data\CustomerInterface $customer,
$password = null,
$redirectUrl = ''
) {
$addrs = $customer->getAddresses();
if (is_array($addrs)) {
foreach ($a... | [
"public",
"function",
"beforeCreateAccount",
"(",
"\\",
"Magento",
"\\",
"Customer",
"\\",
"Model",
"\\",
"AccountManagement",
"$",
"subject",
",",
"\\",
"Magento",
"\\",
"Customer",
"\\",
"Api",
"\\",
"Data",
"\\",
"CustomerInterface",
"$",
"customer",
",",
"... | Extract country code and save into Magento registry when customer is created through adminhtml.
@param \Magento\Customer\Model\AccountManagement $subject
@param \Magento\Customer\Api\Data\CustomerInterface $customer
@param null $password
@param string $redirectUrl
@return array | [
"Extract",
"country",
"code",
"and",
"save",
"into",
"Magento",
"registry",
"when",
"customer",
"is",
"created",
"through",
"adminhtml",
"."
] | 0f3c276dfff1aa029f9fd205ccfc56f207a2e75b | https://github.com/praxigento/mobi_mod_downline/blob/0f3c276dfff1aa029f9fd205ccfc56f207a2e75b/Plugin/Magento/Customer/Model/AccountManagement.php#L66-L82 |
201,830 | OxfordInfoLabs/kinikit-core | src/Util/NumberUtils.php | NumberUtils.formatAsMoney | public static function formatAsMoney($value, $currencySymbol = "£", $roundToInteger = false) {
if (is_numeric($value))
return $currencySymbol . number_format($value, $roundToInteger ? 0 : 2, ".", "");
else
return null;
} | php | public static function formatAsMoney($value, $currencySymbol = "£", $roundToInteger = false) {
if (is_numeric($value))
return $currencySymbol . number_format($value, $roundToInteger ? 0 : 2, ".", "");
else
return null;
} | [
"public",
"static",
"function",
"formatAsMoney",
"(",
"$",
"value",
",",
"$",
"currencySymbol",
"=",
"\"£\"",
",",
"$",
"roundToInteger",
"=",
"false",
")",
"{",
"if",
"(",
"is_numeric",
"(",
"$",
"value",
")",
")",
"return",
"$",
"currencySymbol",
"... | Convenience function for formatting a number as money using the supplied currency symbol
@param $value
@param string $currencySymbol | [
"Convenience",
"function",
"for",
"formatting",
"a",
"number",
"as",
"money",
"using",
"the",
"supplied",
"currency",
"symbol"
] | edc1b2e6ffabd595c4c7d322279b3dd1e59ef359 | https://github.com/OxfordInfoLabs/kinikit-core/blob/edc1b2e6ffabd595c4c7d322279b3dd1e59ef359/src/Util/NumberUtils.php#L16-L21 |
201,831 | bkstg/resource-bundle | Timeline/EventSubscriber/CreatedResourceLinkSubscriber.php | CreatedResourceLinkSubscriber.setCreatedResourceLink | public function setCreatedResourceLink(TimelineLinkEvent $event): void
{
$action = $event->getAction();
if ('created_resource' != $action->getVerb()) {
return;
}
$production = $action->getComponent('indirectComplement')->getData();
$resource = $action->getCompon... | php | public function setCreatedResourceLink(TimelineLinkEvent $event): void
{
$action = $event->getAction();
if ('created_resource' != $action->getVerb()) {
return;
}
$production = $action->getComponent('indirectComplement')->getData();
$resource = $action->getCompon... | [
"public",
"function",
"setCreatedResourceLink",
"(",
"TimelineLinkEvent",
"$",
"event",
")",
":",
"void",
"{",
"$",
"action",
"=",
"$",
"event",
"->",
"getAction",
"(",
")",
";",
"if",
"(",
"'created_resource'",
"!=",
"$",
"action",
"->",
"getVerb",
"(",
"... | Set the link for the created resource.
@param TimelineLinkEvent $event The timeline link event.
@return void | [
"Set",
"the",
"link",
"for",
"the",
"created",
"resource",
"."
] | 9d094366799a4df117a1dd747af9bb6debe14325 | https://github.com/bkstg/resource-bundle/blob/9d094366799a4df117a1dd747af9bb6debe14325/Timeline/EventSubscriber/CreatedResourceLinkSubscriber.php#L53-L67 |
201,832 | danielgp/common-lib | source/DomComponentsByDanielGP.php | DomComponentsByDanielGP.setTableCell | private function setTableCell($aElements, $features = null)
{
$sReturn = null;
foreach ($aElements as $key => $value) {
$value = str_replace(['& ', '\"', "\'"], ['& ', '"', "'"], $value);
if ((isset($features['grouping_cell'])) && ($features['grouping_cell'] == $key)) {
... | php | private function setTableCell($aElements, $features = null)
{
$sReturn = null;
foreach ($aElements as $key => $value) {
$value = str_replace(['& ', '\"', "\'"], ['& ', '"', "'"], $value);
if ((isset($features['grouping_cell'])) && ($features['grouping_cell'] == $key)) {
... | [
"private",
"function",
"setTableCell",
"(",
"$",
"aElements",
",",
"$",
"features",
"=",
"null",
")",
"{",
"$",
"sReturn",
"=",
"null",
";",
"foreach",
"(",
"$",
"aElements",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"value",
"=",
"str_rep... | Generates a table cell
@param array $aElements
@param array $features
@return string | [
"Generates",
"a",
"table",
"cell"
] | 627b99b4408414c7cd21a6c8016f6468dc9216b2 | https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/DomComponentsByDanielGP.php#L453-L495 |
201,833 | danielgp/common-lib | source/DomComponentsByDanielGP.php | DomComponentsByDanielGP.setTableHeader | private function setTableHeader($aElements, $bHeadersBreaked)
{
$aTableHeader = $aElements;
if ($bHeadersBreaked) {
$aTableHeader = $this->setArrayToArrayKbr($aElements);
}
$sReturn = [];
foreach (array_keys($aTableHeader) as $value) {
$sReturn[] = $th... | php | private function setTableHeader($aElements, $bHeadersBreaked)
{
$aTableHeader = $aElements;
if ($bHeadersBreaked) {
$aTableHeader = $this->setArrayToArrayKbr($aElements);
}
$sReturn = [];
foreach (array_keys($aTableHeader) as $value) {
$sReturn[] = $th... | [
"private",
"function",
"setTableHeader",
"(",
"$",
"aElements",
",",
"$",
"bHeadersBreaked",
")",
"{",
"$",
"aTableHeader",
"=",
"$",
"aElements",
";",
"if",
"(",
"$",
"bHeadersBreaked",
")",
"{",
"$",
"aTableHeader",
"=",
"$",
"this",
"->",
"setArrayToArray... | Generates a table header
@param array $aElements
@param boolean $bHeadersBreaked
@return string | [
"Generates",
"a",
"table",
"header"
] | 627b99b4408414c7cd21a6c8016f6468dc9216b2 | https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/DomComponentsByDanielGP.php#L527-L538 |
201,834 | RockPhp/Datet | src/Rock/Datet/DateUtil.php | Rock_Datet_DateUtil.setNovaData | public function setNovaData(Rock_Datet_DateObj $dateObj)
{
$this->format = $dateObj->getFormat();
$this->ts = $dateObj->getTimeStamp();
} | php | public function setNovaData(Rock_Datet_DateObj $dateObj)
{
$this->format = $dateObj->getFormat();
$this->ts = $dateObj->getTimeStamp();
} | [
"public",
"function",
"setNovaData",
"(",
"Rock_Datet_DateObj",
"$",
"dateObj",
")",
"{",
"$",
"this",
"->",
"format",
"=",
"$",
"dateObj",
"->",
"getFormat",
"(",
")",
";",
"$",
"this",
"->",
"ts",
"=",
"$",
"dateObj",
"->",
"getTimeStamp",
"(",
")",
... | Substituir data de referencia por uma nova.
@param Rock_Datet_DateObj $dateObj | [
"Substituir",
"data",
"de",
"referencia",
"por",
"uma",
"nova",
"."
] | 10eb9320efbe0a5c5acb2ffb262b514a36476bf0 | https://github.com/RockPhp/Datet/blob/10eb9320efbe0a5c5acb2ffb262b514a36476bf0/src/Rock/Datet/DateUtil.php#L42-L46 |
201,835 | RockPhp/Datet | src/Rock/Datet/DateUtil.php | Rock_Datet_DateUtil.somaDia | private function somaDia($qtdDias)
{
$somaDia = $qtdDias;
if ($qtdDias > 0) {
$somaDia = "+$qtdDias";
}
$ts = strtotime("$somaDia day", $this->ts);
return $ts;
} | php | private function somaDia($qtdDias)
{
$somaDia = $qtdDias;
if ($qtdDias > 0) {
$somaDia = "+$qtdDias";
}
$ts = strtotime("$somaDia day", $this->ts);
return $ts;
} | [
"private",
"function",
"somaDia",
"(",
"$",
"qtdDias",
")",
"{",
"$",
"somaDia",
"=",
"$",
"qtdDias",
";",
"if",
"(",
"$",
"qtdDias",
">",
"0",
")",
"{",
"$",
"somaDia",
"=",
"\"+$qtdDias\"",
";",
"}",
"$",
"ts",
"=",
"strtotime",
"(",
"\"$somaDia da... | Soma dias.
@param integer $qtdDias
@return integer Timestamp | [
"Soma",
"dias",
"."
] | 10eb9320efbe0a5c5acb2ffb262b514a36476bf0 | https://github.com/RockPhp/Datet/blob/10eb9320efbe0a5c5acb2ffb262b514a36476bf0/src/Rock/Datet/DateUtil.php#L54-L63 |
201,836 | RockPhp/Datet | src/Rock/Datet/DateUtil.php | Rock_Datet_DateUtil.ultimoDiaMes | private function ultimoDiaMes()
{
$ts = $this->ts;
$mesAtual = strftime('%m', $ts);
$mesTmp = $mesAtual;
$i = 0;
while ($mesAtual == $mesTmp) {
$ts = $this->somaDia(++ $i);
$mesTmp = strftime('%m', $ts);
}
return $this->somaDia(-- $i);... | php | private function ultimoDiaMes()
{
$ts = $this->ts;
$mesAtual = strftime('%m', $ts);
$mesTmp = $mesAtual;
$i = 0;
while ($mesAtual == $mesTmp) {
$ts = $this->somaDia(++ $i);
$mesTmp = strftime('%m', $ts);
}
return $this->somaDia(-- $i);... | [
"private",
"function",
"ultimoDiaMes",
"(",
")",
"{",
"$",
"ts",
"=",
"$",
"this",
"->",
"ts",
";",
"$",
"mesAtual",
"=",
"strftime",
"(",
"'%m'",
",",
"$",
"ts",
")",
";",
"$",
"mesTmp",
"=",
"$",
"mesAtual",
";",
"$",
"i",
"=",
"0",
";",
"whi... | Calcula ultimo dia do mes.
@return integer Timestamp | [
"Calcula",
"ultimo",
"dia",
"do",
"mes",
"."
] | 10eb9320efbe0a5c5acb2ffb262b514a36476bf0 | https://github.com/RockPhp/Datet/blob/10eb9320efbe0a5c5acb2ffb262b514a36476bf0/src/Rock/Datet/DateUtil.php#L70-L82 |
201,837 | WellCommerce/DistributionBundle | Manager/PackageManager.php | PackageManager.syncPackages | public function syncPackages($type)
{
$criteria = ['type' => $type];
$em = $this->getDoctrineHelper()->getEntityManager();
$searchResults = $this->getHelper()->getPackages($criteria);
foreach ($searchResults as $result) {
$package = $this->getHelper()->ge... | php | public function syncPackages($type)
{
$criteria = ['type' => $type];
$em = $this->getDoctrineHelper()->getEntityManager();
$searchResults = $this->getHelper()->getPackages($criteria);
foreach ($searchResults as $result) {
$package = $this->getHelper()->ge... | [
"public",
"function",
"syncPackages",
"(",
"$",
"type",
")",
"{",
"$",
"criteria",
"=",
"[",
"'type'",
"=>",
"$",
"type",
"]",
";",
"$",
"em",
"=",
"$",
"this",
"->",
"getDoctrineHelper",
"(",
")",
"->",
"getEntityManager",
"(",
")",
";",
"$",
"searc... | Searches for all packages of particular type and adds them to Smuggler | [
"Searches",
"for",
"all",
"packages",
"of",
"particular",
"type",
"and",
"adds",
"them",
"to",
"Smuggler"
] | 82b1b4c2c5a59536aaae22506b23ccd5d141cbb0 | https://github.com/WellCommerce/DistributionBundle/blob/82b1b4c2c5a59536aaae22506b23ccd5d141cbb0/Manager/PackageManager.php#L34-L46 |
201,838 | WellCommerce/DistributionBundle | Manager/PackageManager.php | PackageManager.getConsoleCommandArguments | public function getConsoleCommandArguments(Request $request)
{
$port = (int)$request->attributes->get('port');
$package = $request->attributes->get('id');
$operation = $request->attributes->get('operation');
return [
'app/console',
'wellcommerc... | php | public function getConsoleCommandArguments(Request $request)
{
$port = (int)$request->attributes->get('port');
$package = $request->attributes->get('id');
$operation = $request->attributes->get('operation');
return [
'app/console',
'wellcommerc... | [
"public",
"function",
"getConsoleCommandArguments",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"port",
"=",
"(",
"int",
")",
"$",
"request",
"->",
"attributes",
"->",
"get",
"(",
"'port'",
")",
";",
"$",
"package",
"=",
"$",
"request",
"->",
"attribu... | Returns console command arguments
@param Request $request
@return array | [
"Returns",
"console",
"command",
"arguments"
] | 82b1b4c2c5a59536aaae22506b23ccd5d141cbb0 | https://github.com/WellCommerce/DistributionBundle/blob/82b1b4c2c5a59536aaae22506b23ccd5d141cbb0/Manager/PackageManager.php#L88-L100 |
201,839 | WellCommerce/DistributionBundle | Manager/PackageManager.php | PackageManager.changePackageStatus | public function changePackageStatus(Request $request)
{
/**
* @var $package \WellCommerce\Bundle\DistributionBundle\Entity\Package
*/
$id = $request->attributes->get('id');
$em = $this->getDoctrineHelper()->getEntityManager();
$repository = $this->ge... | php | public function changePackageStatus(Request $request)
{
/**
* @var $package \WellCommerce\Bundle\DistributionBundle\Entity\Package
*/
$id = $request->attributes->get('id');
$em = $this->getDoctrineHelper()->getEntityManager();
$repository = $this->ge... | [
"public",
"function",
"changePackageStatus",
"(",
"Request",
"$",
"request",
")",
"{",
"/**\n * @var $package \\WellCommerce\\Bundle\\DistributionBundle\\Entity\\Package\n */",
"$",
"id",
"=",
"$",
"request",
"->",
"attributes",
"->",
"get",
"(",
"'id'",
")"... | Changes package info according to operation and data fetched from PackagistAPI
@param Request $request
@throws EntityNotFoundException | [
"Changes",
"package",
"info",
"according",
"to",
"operation",
"and",
"data",
"fetched",
"from",
"PackagistAPI"
] | 82b1b4c2c5a59536aaae22506b23ccd5d141cbb0 | https://github.com/WellCommerce/DistributionBundle/blob/82b1b4c2c5a59536aaae22506b23ccd5d141cbb0/Manager/PackageManager.php#L110-L127 |
201,840 | dms-org/common.structure | src/DateTime/TimezonedDateTime.php | TimezonedDateTime.fromString | public static function fromString(string $dateTimeString, string $timeZoneId) : TimezonedDateTime
{
return new self(new \DateTimeImmutable($dateTimeString, new \DateTimeZone($timeZoneId)));
} | php | public static function fromString(string $dateTimeString, string $timeZoneId) : TimezonedDateTime
{
return new self(new \DateTimeImmutable($dateTimeString, new \DateTimeZone($timeZoneId)));
} | [
"public",
"static",
"function",
"fromString",
"(",
"string",
"$",
"dateTimeString",
",",
"string",
"$",
"timeZoneId",
")",
":",
"TimezonedDateTime",
"{",
"return",
"new",
"self",
"(",
"new",
"\\",
"DateTimeImmutable",
"(",
"$",
"dateTimeString",
",",
"new",
"\... | Creates a DateTime object from the supplied date string
@param string $dateTimeString
@param string $timeZoneId
@return TimezonedDateTime | [
"Creates",
"a",
"DateTime",
"object",
"from",
"the",
"supplied",
"date",
"string"
] | 23f122182f60df5ec847047a81a39c8aab019ff1 | https://github.com/dms-org/common.structure/blob/23f122182f60df5ec847047a81a39c8aab019ff1/src/DateTime/TimezonedDateTime.php#L35-L38 |
201,841 | dms-org/common.structure | src/DateTime/TimezonedDateTime.php | TimezonedDateTime.convertTimezone | public function convertTimezone(string $timezoneId) : TimezonedDateTime
{
return new TimezonedDateTime(
(new \DateTimeImmutable('now', new \DateTimeZone($timezoneId)))
->setTimestamp($this->dateTime->getTimestamp())
);
} | php | public function convertTimezone(string $timezoneId) : TimezonedDateTime
{
return new TimezonedDateTime(
(new \DateTimeImmutable('now', new \DateTimeZone($timezoneId)))
->setTimestamp($this->dateTime->getTimestamp())
);
} | [
"public",
"function",
"convertTimezone",
"(",
"string",
"$",
"timezoneId",
")",
":",
"TimezonedDateTime",
"{",
"return",
"new",
"TimezonedDateTime",
"(",
"(",
"new",
"\\",
"DateTimeImmutable",
"(",
"'now'",
",",
"new",
"\\",
"DateTimeZone",
"(",
"$",
"timezoneId... | Returns the current date time according to the supplied timezone
@param string $timezoneId
@return TimezonedDateTime | [
"Returns",
"the",
"current",
"date",
"time",
"according",
"to",
"the",
"supplied",
"timezone"
] | 23f122182f60df5ec847047a81a39c8aab019ff1 | https://github.com/dms-org/common.structure/blob/23f122182f60df5ec847047a81a39c8aab019ff1/src/DateTime/TimezonedDateTime.php#L179-L185 |
201,842 | rzajac/phptools | src/Date/DateCalc.php | DateCalc.secondsSinceMidnightStr | public static function secondsSinceMidnightStr($time)
{
$time_a = explode(':', $time);
switch (count($time_a)) {
case 0:
case 1:
return null;
case 2:
// Add seconds
$time_a[] = 0;
break;
... | php | public static function secondsSinceMidnightStr($time)
{
$time_a = explode(':', $time);
switch (count($time_a)) {
case 0:
case 1:
return null;
case 2:
// Add seconds
$time_a[] = 0;
break;
... | [
"public",
"static",
"function",
"secondsSinceMidnightStr",
"(",
"$",
"time",
")",
"{",
"$",
"time_a",
"=",
"explode",
"(",
"':'",
",",
"$",
"time",
")",
";",
"switch",
"(",
"count",
"(",
"$",
"time_a",
")",
")",
"{",
"case",
"0",
":",
"case",
"1",
... | Return number of seconds since midnight.
@param string $time The time in format: HH:MM:SS or HH:MM
@return int|null Returns null on error | [
"Return",
"number",
"of",
"seconds",
"since",
"midnight",
"."
] | 3cbece7645942d244603c14ba897d8a676ee3088 | https://github.com/rzajac/phptools/blob/3cbece7645942d244603c14ba897d8a676ee3088/src/Date/DateCalc.php#L74-L96 |
201,843 | rzajac/phptools | src/Date/DateCalc.php | DateCalc.formatStrTime | public static function formatStrTime($time, $withSeconds = true)
{
// Pad left with 0 in case we get numbers like 123, 12, 122015
$time = str_pad($time.'', 6, '0', STR_PAD_LEFT);
$_time = array();
$_time[] = substr($time, 0, 2);
$_time[] = substr($time, 2, 2);
if (... | php | public static function formatStrTime($time, $withSeconds = true)
{
// Pad left with 0 in case we get numbers like 123, 12, 122015
$time = str_pad($time.'', 6, '0', STR_PAD_LEFT);
$_time = array();
$_time[] = substr($time, 0, 2);
$_time[] = substr($time, 2, 2);
if (... | [
"public",
"static",
"function",
"formatStrTime",
"(",
"$",
"time",
",",
"$",
"withSeconds",
"=",
"true",
")",
"{",
"// Pad left with 0 in case we get numbers like 123, 12, 122015",
"$",
"time",
"=",
"str_pad",
"(",
"$",
"time",
".",
"''",
",",
"6",
",",
"'0'",
... | Takes time in hhmmss format and returns formatted string.
@param int|string $time The time in hhmmss or hhmm format
@param bool $withSeconds Set to true to add seconds if not provided
@return string The formatted string hh:mm:ss or hh:mm | [
"Takes",
"time",
"in",
"hhmmss",
"format",
"and",
"returns",
"formatted",
"string",
"."
] | 3cbece7645942d244603c14ba897d8a676ee3088 | https://github.com/rzajac/phptools/blob/3cbece7645942d244603c14ba897d8a676ee3088/src/Date/DateCalc.php#L106-L122 |
201,844 | shgysk8zer0/core_api | traits/logger_interpolation.php | Logger_Interpolation.interpolate | final public function interpolate($message, array $context = array())
{
return strtr(
$message,
array_combine(
array_map(
function($key)
{
return "{{$key}}";
},
array_keys($context)
),
array_values($context)
)
);
} | php | final public function interpolate($message, array $context = array())
{
return strtr(
$message,
array_combine(
array_map(
function($key)
{
return "{{$key}}";
},
array_keys($context)
),
array_values($context)
)
);
} | [
"final",
"public",
"function",
"interpolate",
"(",
"$",
"message",
",",
"array",
"$",
"context",
"=",
"array",
"(",
")",
")",
"{",
"return",
"strtr",
"(",
"$",
"message",
",",
"array_combine",
"(",
"array_map",
"(",
"function",
"(",
"$",
"key",
")",
"{... | This is the default method for interpolating in PSR-3 loggers
@param string $message The template given
@param array $context An array of values to assign to templatte
@return string | [
"This",
"is",
"the",
"default",
"method",
"for",
"interpolating",
"in",
"PSR",
"-",
"3",
"loggers"
] | 9e9b8baf761af874b95256ad2462e55fbb2b2e58 | https://github.com/shgysk8zer0/core_api/blob/9e9b8baf761af874b95256ad2462e55fbb2b2e58/traits/logger_interpolation.php#L36-L51 |
201,845 | Erebot/Module_Wordlists | src/Wordlists/Base.php | Base.isWord | public static function isWord($word)
{
if (!is_string($word)) {
return false;
}
return (bool) preg_match(self::WORD_FILTER, $word);
} | php | public static function isWord($word)
{
if (!is_string($word)) {
return false;
}
return (bool) preg_match(self::WORD_FILTER, $word);
} | [
"public",
"static",
"function",
"isWord",
"(",
"$",
"word",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"word",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"(",
"bool",
")",
"preg_match",
"(",
"self",
"::",
"WORD_FILTER",
",",
"$",
"... | Filters non-words out.
Only texts that passed this filtering step
are considered as propositions for the game.
\param string $word
A possible "word" to test.
\retval bool
TRUE if the given $word really is a word,
FALSE otherwise.
\note
This method uses a rather broad definition
of what is a word. In particular, it ... | [
"Filters",
"non",
"-",
"words",
"out",
"."
] | 121d1cc72619ec0be2ddf0f3d6a66bac0a5bd1b7 | https://github.com/Erebot/Module_Wordlists/blob/121d1cc72619ec0be2ddf0f3d6a66bac0a5bd1b7/src/Wordlists/Base.php#L98-L104 |
201,846 | PhoxPHP/Console | src/ErrorHandler.php | ErrorHandler.handleError | public function handleError($errNumber, $errString, $errFile ='', $errLine = 0)
{
$interfaceSettings = $this->cmd->getConfigOpt('interface');
$textColor = $interfaceSettings['error']['text_color'];
$textBgColor = $interfaceSettings['error']['text_background'];
$this->env->sendOutput('Error: ' . $errString, $t... | php | public function handleError($errNumber, $errString, $errFile ='', $errLine = 0)
{
$interfaceSettings = $this->cmd->getConfigOpt('interface');
$textColor = $interfaceSettings['error']['text_color'];
$textBgColor = $interfaceSettings['error']['text_background'];
$this->env->sendOutput('Error: ' . $errString, $t... | [
"public",
"function",
"handleError",
"(",
"$",
"errNumber",
",",
"$",
"errString",
",",
"$",
"errFile",
"=",
"''",
",",
"$",
"errLine",
"=",
"0",
")",
"{",
"$",
"interfaceSettings",
"=",
"$",
"this",
"->",
"cmd",
"->",
"getConfigOpt",
"(",
"'interface'",... | Handles generated errors.
@param $errNumber <Integer>
@param $errString <String>
@param $errFile <String>
@param $errLine <Integer>
@access public
@return <void> | [
"Handles",
"generated",
"errors",
"."
] | fee1238cfdb3592964bb5d5a2336e70b8ffd20e9 | https://github.com/PhoxPHP/Console/blob/fee1238cfdb3592964bb5d5a2336e70b8ffd20e9/src/ErrorHandler.php#L66-L74 |
201,847 | theopera/framework | src/Component/Http/Response.php | Response.redirect | public static function redirect($url, array $parameters = [], int $statusCode = Response::STATUS_MOVED_PERMANENTLY) : Response
{
if (!empty($parameters)) {
$url = $url . '?' . http_build_query($parameters);
}
$headers = new Headers();
$headers->add(new Header('Location',... | php | public static function redirect($url, array $parameters = [], int $statusCode = Response::STATUS_MOVED_PERMANENTLY) : Response
{
if (!empty($parameters)) {
$url = $url . '?' . http_build_query($parameters);
}
$headers = new Headers();
$headers->add(new Header('Location',... | [
"public",
"static",
"function",
"redirect",
"(",
"$",
"url",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
",",
"int",
"$",
"statusCode",
"=",
"Response",
"::",
"STATUS_MOVED_PERMANENTLY",
")",
":",
"Response",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
... | Redirect to a url
@param string $url
@param string[] $parameters
@param int $statusCode
@return Response | [
"Redirect",
"to",
"a",
"url"
] | fa6165d3891a310faa580c81dee49a63c150c711 | https://github.com/theopera/framework/blob/fa6165d3891a310faa580c81dee49a63c150c711/src/Component/Http/Response.php#L186-L196 |
201,848 | theopera/framework | src/Component/Http/Response.php | Response.createFromString | public static function createFromString(string $string) : Response
{
$lines = explode("\r\n", $string);
list($httpVersion, $statusCode, $statusText) = explode(' ', array_shift($lines), 3);
$headers = new Headers();
foreach ($lines as $index => $line) {
unset($lines[$in... | php | public static function createFromString(string $string) : Response
{
$lines = explode("\r\n", $string);
list($httpVersion, $statusCode, $statusText) = explode(' ', array_shift($lines), 3);
$headers = new Headers();
foreach ($lines as $index => $line) {
unset($lines[$in... | [
"public",
"static",
"function",
"createFromString",
"(",
"string",
"$",
"string",
")",
":",
"Response",
"{",
"$",
"lines",
"=",
"explode",
"(",
"\"\\r\\n\"",
",",
"$",
"string",
")",
";",
"list",
"(",
"$",
"httpVersion",
",",
"$",
"statusCode",
",",
"$",... | Create a Response object from a string
@param string $string
@return Response | [
"Create",
"a",
"Response",
"object",
"from",
"a",
"string"
] | fa6165d3891a310faa580c81dee49a63c150c711 | https://github.com/theopera/framework/blob/fa6165d3891a310faa580c81dee49a63c150c711/src/Component/Http/Response.php#L204-L224 |
201,849 | theopera/framework | src/Component/Http/Response.php | Response.getStatusLine | public function getStatusLine() : string
{
return sprintf('HTTP/%s %s %s', self::HTTP_VERSION, $this->statusCode, self::getStatusText($this->statusCode));
} | php | public function getStatusLine() : string
{
return sprintf('HTTP/%s %s %s', self::HTTP_VERSION, $this->statusCode, self::getStatusText($this->statusCode));
} | [
"public",
"function",
"getStatusLine",
"(",
")",
":",
"string",
"{",
"return",
"sprintf",
"(",
"'HTTP/%s %s %s'",
",",
"self",
"::",
"HTTP_VERSION",
",",
"$",
"this",
"->",
"statusCode",
",",
"self",
"::",
"getStatusText",
"(",
"$",
"this",
"->",
"statusCode... | Get the complete status line
@return string | [
"Get",
"the",
"complete",
"status",
"line"
] | fa6165d3891a310faa580c81dee49a63c150c711 | https://github.com/theopera/framework/blob/fa6165d3891a310faa580c81dee49a63c150c711/src/Component/Http/Response.php#L251-L254 |
201,850 | theopera/framework | src/Component/Http/Response.php | Response.send | public function send()
{
if (headers_sent()) {
throw new HttpException(Response::STATUS_INTERNAL_SERVER_ERROR, 'Headers already send');
}
header($this->getStatusLine());
foreach ($this->headers as $header) {
header($header);
}
echo $this->b... | php | public function send()
{
if (headers_sent()) {
throw new HttpException(Response::STATUS_INTERNAL_SERVER_ERROR, 'Headers already send');
}
header($this->getStatusLine());
foreach ($this->headers as $header) {
header($header);
}
echo $this->b... | [
"public",
"function",
"send",
"(",
")",
"{",
"if",
"(",
"headers_sent",
"(",
")",
")",
"{",
"throw",
"new",
"HttpException",
"(",
"Response",
"::",
"STATUS_INTERNAL_SERVER_ERROR",
",",
"'Headers already send'",
")",
";",
"}",
"header",
"(",
"$",
"this",
"->"... | Sends the response to the web server
@return void | [
"Sends",
"the",
"response",
"to",
"the",
"web",
"server"
] | fa6165d3891a310faa580c81dee49a63c150c711 | https://github.com/theopera/framework/blob/fa6165d3891a310faa580c81dee49a63c150c711/src/Component/Http/Response.php#L297-L311 |
201,851 | RocketPropelledTortoise/Core | src/Taxonomy/Taxonomy.php | Taxonomy.isTranslatable | public function isTranslatable($vid)
{
if (!is_numeric($vid)) {
$vid = $this->vocabulary($vid);
}
return $this->vocabularyById[$vid]->isTranslatable();
} | php | public function isTranslatable($vid)
{
if (!is_numeric($vid)) {
$vid = $this->vocabulary($vid);
}
return $this->vocabularyById[$vid]->isTranslatable();
} | [
"public",
"function",
"isTranslatable",
"(",
"$",
"vid",
")",
"{",
"if",
"(",
"!",
"is_numeric",
"(",
"$",
"vid",
")",
")",
"{",
"$",
"vid",
"=",
"$",
"this",
"->",
"vocabulary",
"(",
"$",
"vid",
")",
";",
"}",
"return",
"$",
"this",
"->",
"vocab... | Is this vocabulary translatable ?
@param int|string $vid
@return bool | [
"Is",
"this",
"vocabulary",
"translatable",
"?"
] | 78b65663fc463e21e494257140ddbed0a9ccb3c3 | https://github.com/RocketPropelledTortoise/Core/blob/78b65663fc463e21e494257140ddbed0a9ccb3c3/src/Taxonomy/Taxonomy.php#L82-L89 |
201,852 | RocketPropelledTortoise/Core | src/Taxonomy/Taxonomy.php | Taxonomy.getLanguage | public function getLanguage($vocabulary_id, $language_id = null)
{
if (!$this->isTranslatable($vocabulary_id)) {
return 1;
}
if ($language_id === null) {
return I18N::getCurrentId();
}
return $language_id;
} | php | public function getLanguage($vocabulary_id, $language_id = null)
{
if (!$this->isTranslatable($vocabulary_id)) {
return 1;
}
if ($language_id === null) {
return I18N::getCurrentId();
}
return $language_id;
} | [
"public",
"function",
"getLanguage",
"(",
"$",
"vocabulary_id",
",",
"$",
"language_id",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isTranslatable",
"(",
"$",
"vocabulary_id",
")",
")",
"{",
"return",
"1",
";",
"}",
"if",
"(",
"$",
"l... | Get the internal language for the vocabulary
This will return the language_id if the vocabulary is translated or 1 if it's not
@param int|string $vocabulary_id
@param int $language_id
@return int|null | [
"Get",
"the",
"internal",
"language",
"for",
"the",
"vocabulary"
] | 78b65663fc463e21e494257140ddbed0a9ccb3c3 | https://github.com/RocketPropelledTortoise/Core/blob/78b65663fc463e21e494257140ddbed0a9ccb3c3/src/Taxonomy/Taxonomy.php#L100-L111 |
201,853 | RocketPropelledTortoise/Core | src/Taxonomy/Taxonomy.php | Taxonomy.vocabulary | public function vocabulary($key)
{
if (is_numeric($key)) {
return $this->vocabularyById[$key]->machine_name;
}
return $this->vocabularyByName[$key]->id;
} | php | public function vocabulary($key)
{
if (is_numeric($key)) {
return $this->vocabularyById[$key]->machine_name;
}
return $this->vocabularyByName[$key]->id;
} | [
"public",
"function",
"vocabulary",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"is_numeric",
"(",
"$",
"key",
")",
")",
"{",
"return",
"$",
"this",
"->",
"vocabularyById",
"[",
"$",
"key",
"]",
"->",
"machine_name",
";",
"}",
"return",
"$",
"this",
"->",
... | Get a vocabulary by name or ID
Taxonomy::vocabulary(1);
returns 'tags'
Taxonomy::vocabulary('tags');
returns 1
@param int|string $key
@return mixed | [
"Get",
"a",
"vocabulary",
"by",
"name",
"or",
"ID"
] | 78b65663fc463e21e494257140ddbed0a9ccb3c3 | https://github.com/RocketPropelledTortoise/Core/blob/78b65663fc463e21e494257140ddbed0a9ccb3c3/src/Taxonomy/Taxonomy.php#L125-L132 |
201,854 | RocketPropelledTortoise/Core | src/Taxonomy/Taxonomy.php | Taxonomy.uncacheTerm | public function uncacheTerm($term_id)
{
if (array_key_exists($term_id, $this->terms)) {
unset($this->terms[$term_id]);
}
return $this->termRepository->uncacheTerm($term_id);
} | php | public function uncacheTerm($term_id)
{
if (array_key_exists($term_id, $this->terms)) {
unset($this->terms[$term_id]);
}
return $this->termRepository->uncacheTerm($term_id);
} | [
"public",
"function",
"uncacheTerm",
"(",
"$",
"term_id",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"term_id",
",",
"$",
"this",
"->",
"terms",
")",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"terms",
"[",
"$",
"term_id",
"]",
")",
";",
"}... | Remove a term from the cache
@param int $term_id
@return bool | [
"Remove",
"a",
"term",
"from",
"the",
"cache"
] | 78b65663fc463e21e494257140ddbed0a9ccb3c3 | https://github.com/RocketPropelledTortoise/Core/blob/78b65663fc463e21e494257140ddbed0a9ccb3c3/src/Taxonomy/Taxonomy.php#L169-L176 |
201,855 | RocketPropelledTortoise/Core | src/Taxonomy/Taxonomy.php | Taxonomy.addParent | public function addParent($term_id, $parent_id)
{
$this->testCanAddParents($term_id, 1);
$this->termHierarchyRepository->addParent($term_id, $parent_id);
} | php | public function addParent($term_id, $parent_id)
{
$this->testCanAddParents($term_id, 1);
$this->termHierarchyRepository->addParent($term_id, $parent_id);
} | [
"public",
"function",
"addParent",
"(",
"$",
"term_id",
",",
"$",
"parent_id",
")",
"{",
"$",
"this",
"->",
"testCanAddParents",
"(",
"$",
"term_id",
",",
"1",
")",
";",
"$",
"this",
"->",
"termHierarchyRepository",
"->",
"addParent",
"(",
"$",
"term_id",
... | Add one parent to a term
@param int $term_id
@param int $parent_id | [
"Add",
"one",
"parent",
"to",
"a",
"term"
] | 78b65663fc463e21e494257140ddbed0a9ccb3c3 | https://github.com/RocketPropelledTortoise/Core/blob/78b65663fc463e21e494257140ddbed0a9ccb3c3/src/Taxonomy/Taxonomy.php#L226-L231 |
201,856 | RocketPropelledTortoise/Core | src/Taxonomy/Taxonomy.php | Taxonomy.addParents | public function addParents($term_id, array $parent_ids)
{
$this->testCanAddParents($term_id, count($parent_ids));
foreach ($parent_ids as $id) {
$this->termHierarchyRepository->addParent($term_id, $id);
}
} | php | public function addParents($term_id, array $parent_ids)
{
$this->testCanAddParents($term_id, count($parent_ids));
foreach ($parent_ids as $id) {
$this->termHierarchyRepository->addParent($term_id, $id);
}
} | [
"public",
"function",
"addParents",
"(",
"$",
"term_id",
",",
"array",
"$",
"parent_ids",
")",
"{",
"$",
"this",
"->",
"testCanAddParents",
"(",
"$",
"term_id",
",",
"count",
"(",
"$",
"parent_ids",
")",
")",
";",
"foreach",
"(",
"$",
"parent_ids",
"as",... | Add a list of parents to a term
@param int $term_id
@param array<integer> $parent_ids | [
"Add",
"a",
"list",
"of",
"parents",
"to",
"a",
"term"
] | 78b65663fc463e21e494257140ddbed0a9ccb3c3 | https://github.com/RocketPropelledTortoise/Core/blob/78b65663fc463e21e494257140ddbed0a9ccb3c3/src/Taxonomy/Taxonomy.php#L239-L246 |
201,857 | RocketPropelledTortoise/Core | src/Taxonomy/Taxonomy.php | Taxonomy.getTermsForVocabulary | public function getTermsForVocabulary($vocabulary_id)
{
return $this->cache->remember(
'Rocket::Taxonomy::Terms::' . $vocabulary_id,
60,
function () use ($vocabulary_id) {
$terms = TermContainer::where('vocabulary_id', $vocabulary_id)->get(['id']);
... | php | public function getTermsForVocabulary($vocabulary_id)
{
return $this->cache->remember(
'Rocket::Taxonomy::Terms::' . $vocabulary_id,
60,
function () use ($vocabulary_id) {
$terms = TermContainer::where('vocabulary_id', $vocabulary_id)->get(['id']);
... | [
"public",
"function",
"getTermsForVocabulary",
"(",
"$",
"vocabulary_id",
")",
"{",
"return",
"$",
"this",
"->",
"cache",
"->",
"remember",
"(",
"'Rocket::Taxonomy::Terms::'",
".",
"$",
"vocabulary_id",
",",
"60",
",",
"function",
"(",
")",
"use",
"(",
"$",
... | Get all the terms of a vocabulary
@param int $vocabulary_id
@return array | [
"Get",
"all",
"the",
"terms",
"of",
"a",
"vocabulary"
] | 78b65663fc463e21e494257140ddbed0a9ccb3c3 | https://github.com/RocketPropelledTortoise/Core/blob/78b65663fc463e21e494257140ddbed0a9ccb3c3/src/Taxonomy/Taxonomy.php#L291-L309 |
201,858 | RocketPropelledTortoise/Core | src/Taxonomy/Taxonomy.php | Taxonomy.searchTerm | public function searchTerm($term, $vocabulary_id, $language_id = null, $exclude = [])
{
$language_id = $this->getLanguage($vocabulary_id, $language_id);
$term = trim($term);
if ($term == '') {
return;
}
$query = TermData::select('taxonomy_terms.id')
... | php | public function searchTerm($term, $vocabulary_id, $language_id = null, $exclude = [])
{
$language_id = $this->getLanguage($vocabulary_id, $language_id);
$term = trim($term);
if ($term == '') {
return;
}
$query = TermData::select('taxonomy_terms.id')
... | [
"public",
"function",
"searchTerm",
"(",
"$",
"term",
",",
"$",
"vocabulary_id",
",",
"$",
"language_id",
"=",
"null",
",",
"$",
"exclude",
"=",
"[",
"]",
")",
"{",
"$",
"language_id",
"=",
"$",
"this",
"->",
"getLanguage",
"(",
"$",
"vocabulary_id",
"... | Search a specific term, if it doesn't exist, returns false
@param string $term
@param int $vocabulary_id
@param int $language_id
@param array $exclude
@return int|null | [
"Search",
"a",
"specific",
"term",
"if",
"it",
"doesn",
"t",
"exist",
"returns",
"false"
] | 78b65663fc463e21e494257140ddbed0a9ccb3c3 | https://github.com/RocketPropelledTortoise/Core/blob/78b65663fc463e21e494257140ddbed0a9ccb3c3/src/Taxonomy/Taxonomy.php#L320-L340 |
201,859 | RocketPropelledTortoise/Core | src/Taxonomy/Taxonomy.php | Taxonomy.getTermId | public function getTermId($title, $vocabulary_id, $language_id = null, $type = 0)
{
$title = trim($title);
if ($title == '') {
return false;
}
if (!is_numeric($vocabulary_id)) {
$vocabulary_id = $this->vocabulary($vocabulary_id);
}
$language_... | php | public function getTermId($title, $vocabulary_id, $language_id = null, $type = 0)
{
$title = trim($title);
if ($title == '') {
return false;
}
if (!is_numeric($vocabulary_id)) {
$vocabulary_id = $this->vocabulary($vocabulary_id);
}
$language_... | [
"public",
"function",
"getTermId",
"(",
"$",
"title",
",",
"$",
"vocabulary_id",
",",
"$",
"language_id",
"=",
"null",
",",
"$",
"type",
"=",
"0",
")",
"{",
"$",
"title",
"=",
"trim",
"(",
"$",
"title",
")",
";",
"if",
"(",
"$",
"title",
"==",
"'... | Returns the id of a term, if it doesn't exist, creates it.
@param string $title
@param int $vocabulary_id
@param int $language_id
@param int $type
@return bool|int | [
"Returns",
"the",
"id",
"of",
"a",
"term",
"if",
"it",
"doesn",
"t",
"exist",
"creates",
"it",
"."
] | 78b65663fc463e21e494257140ddbed0a9ccb3c3 | https://github.com/RocketPropelledTortoise/Core/blob/78b65663fc463e21e494257140ddbed0a9ccb3c3/src/Taxonomy/Taxonomy.php#L351-L385 |
201,860 | RocketPropelledTortoise/Core | src/Taxonomy/Taxonomy.php | Taxonomy.getTermIds | public function getTermIds($taxonomies)
{
$tags = [];
foreach ($taxonomies as $voc => $terms) {
$vocabulary_id = $this->vocabulary($voc);
$exploded = is_array($terms) ? $terms : explode(',', $terms);
foreach ($exploded as $term) {
$result = $this-... | php | public function getTermIds($taxonomies)
{
$tags = [];
foreach ($taxonomies as $voc => $terms) {
$vocabulary_id = $this->vocabulary($voc);
$exploded = is_array($terms) ? $terms : explode(',', $terms);
foreach ($exploded as $term) {
$result = $this-... | [
"public",
"function",
"getTermIds",
"(",
"$",
"taxonomies",
")",
"{",
"$",
"tags",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"taxonomies",
"as",
"$",
"voc",
"=>",
"$",
"terms",
")",
"{",
"$",
"vocabulary_id",
"=",
"$",
"this",
"->",
"vocabulary",
"(",... | Adds one or more tags and returns an array of id's
@param array $taxonomies
@return array | [
"Adds",
"one",
"or",
"more",
"tags",
"and",
"returns",
"an",
"array",
"of",
"id",
"s"
] | 78b65663fc463e21e494257140ddbed0a9ccb3c3 | https://github.com/RocketPropelledTortoise/Core/blob/78b65663fc463e21e494257140ddbed0a9ccb3c3/src/Taxonomy/Taxonomy.php#L393-L409 |
201,861 | bytic/http | src/Request.php | Request.getHttp | public function getHttp()
{
if (!$this->http) {
$this->http = new Http();
$this->http->setRequest($this);
}
return $this->http;
} | php | public function getHttp()
{
if (!$this->http) {
$this->http = new Http();
$this->http->setRequest($this);
}
return $this->http;
} | [
"public",
"function",
"getHttp",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"http",
")",
"{",
"$",
"this",
"->",
"http",
"=",
"new",
"Http",
"(",
")",
";",
"$",
"this",
"->",
"http",
"->",
"setRequest",
"(",
"$",
"this",
")",
";",
"}",
... | Returns Http object
@return Http | [
"Returns",
"Http",
"object"
] | 0d22507a8bcf05575d3d1d6c6a87c2026778c47c | https://github.com/bytic/http/blob/0d22507a8bcf05575d3d1d6c6a87c2026778c47c/src/Request.php#L93-L101 |
201,862 | nails/module-blog | blog/models/blog_category_model.php | NAILS_Blog_category_model.getCountCommon | protected function getCountCommon($data = array())
{
parent::getCountCommon($data);
// --------------------------------------------------------------------------
$oDb = Factory::service('Database');
$oDb->select($this->tableAlias . '.*');
if (!empty($data['include_count'])... | php | protected function getCountCommon($data = array())
{
parent::getCountCommon($data);
// --------------------------------------------------------------------------
$oDb = Factory::service('Database');
$oDb->select($this->tableAlias . '.*');
if (!empty($data['include_count'])... | [
"protected",
"function",
"getCountCommon",
"(",
"$",
"data",
"=",
"array",
"(",
")",
")",
"{",
"parent",
"::",
"getCountCommon",
"(",
"$",
"data",
")",
";",
"// --------------------------------------------------------------------------",
"$",
"oDb",
"=",
"Factory",
... | Set some common data
@param array $data Data passed from the calling method
@return void | [
"Set",
"some",
"common",
"data"
] | 7b369c5209f4343fff7c7e2a22c237d5a95c8c24 | https://github.com/nails/module-blog/blob/7b369c5209f4343fff7c7e2a22c237d5a95c8c24/blog/models/blog_category_model.php#L38-L64 |
201,863 | nails/module-blog | blog/models/blog_category_model.php | NAILS_Blog_category_model.create | public function create($aData, $bReturnObject = false)
{
$aCategoryData = array();
// --------------------------------------------------------------------------
// Some basic sanity testing
if (empty($aData['label'])) {
$this->setError('"label" is a required field.');... | php | public function create($aData, $bReturnObject = false)
{
$aCategoryData = array();
// --------------------------------------------------------------------------
// Some basic sanity testing
if (empty($aData['label'])) {
$this->setError('"label" is a required field.');... | [
"public",
"function",
"create",
"(",
"$",
"aData",
",",
"$",
"bReturnObject",
"=",
"false",
")",
"{",
"$",
"aCategoryData",
"=",
"array",
"(",
")",
";",
"// --------------------------------------------------------------------------",
"// Some basic sanity testing",
"if",... | Creates a new category
@param array $aData The data to create the category with
@param boolean $bReturnObject Whether to return the full category object (or just the ID)
@return mixed | [
"Creates",
"a",
"new",
"category"
] | 7b369c5209f4343fff7c7e2a22c237d5a95c8c24 | https://github.com/nails/module-blog/blob/7b369c5209f4343fff7c7e2a22c237d5a95c8c24/blog/models/blog_category_model.php#L74-L126 |
201,864 | nails/module-blog | blog/models/blog_category_model.php | NAILS_Blog_category_model.update | public function update($iId, $aData)
{
$aCategoryData = array();
// --------------------------------------------------------------------------
// Some basic sanity testing
if (empty($aData['label'])) {
$this->setError('"label" is a required field.');
retur... | php | public function update($iId, $aData)
{
$aCategoryData = array();
// --------------------------------------------------------------------------
// Some basic sanity testing
if (empty($aData['label'])) {
$this->setError('"label" is a required field.');
retur... | [
"public",
"function",
"update",
"(",
"$",
"iId",
",",
"$",
"aData",
")",
"{",
"$",
"aCategoryData",
"=",
"array",
"(",
")",
";",
"// --------------------------------------------------------------------------",
"// Some basic sanity testing",
"if",
"(",
"empty",
"(",
... | Updates an existing category
@param integer $iId The category's ID
@param array $aData The data to update the category with
@return boolean | [
"Updates",
"an",
"existing",
"category"
] | 7b369c5209f4343fff7c7e2a22c237d5a95c8c24 | https://github.com/nails/module-blog/blob/7b369c5209f4343fff7c7e2a22c237d5a95c8c24/blog/models/blog_category_model.php#L136-L178 |
201,865 | cogentParadigm/behat-starbug-extension | src/Context/RawStarbugContext.php | RawStarbugContext.replaceTokens | public function replaceTokens($text) {
$tokens = $this->macro->search($text);
if (empty($tokens)) {
return $text;
}
static $last = [];
$replacements = [];
foreach ($tokens as $type => $typeTokens) {
foreach ($typeTokens as $name => $token) {
if ($type == "any") {
$... | php | public function replaceTokens($text) {
$tokens = $this->macro->search($text);
if (empty($tokens)) {
return $text;
}
static $last = [];
$replacements = [];
foreach ($tokens as $type => $typeTokens) {
foreach ($typeTokens as $name => $token) {
if ($type == "any") {
$... | [
"public",
"function",
"replaceTokens",
"(",
"$",
"text",
")",
"{",
"$",
"tokens",
"=",
"$",
"this",
"->",
"macro",
"->",
"search",
"(",
"$",
"text",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"tokens",
")",
")",
"{",
"return",
"$",
"text",
";",
"}",... | Replace fake data tokens.
@Transform /^(.*)$/ | [
"Replace",
"fake",
"data",
"tokens",
"."
] | 76da5d943773857ad2388a7cccb6632176b452a9 | https://github.com/cogentParadigm/behat-starbug-extension/blob/76da5d943773857ad2388a7cccb6632176b452a9/src/Context/RawStarbugContext.php#L39-L62 |
201,866 | cogentParadigm/behat-starbug-extension | src/Context/RawStarbugContext.php | RawStarbugContext.replaceTableTokens | public function replaceTableTokens(TableNode $input) {
$table = $input->getTable();
foreach ($table as $row => $values) {
foreach ($values as $idx => $value) {
$table[$row][$idx] = $this->replaceTokens($value);
}
}
return new TableNode($table);
} | php | public function replaceTableTokens(TableNode $input) {
$table = $input->getTable();
foreach ($table as $row => $values) {
foreach ($values as $idx => $value) {
$table[$row][$idx] = $this->replaceTokens($value);
}
}
return new TableNode($table);
} | [
"public",
"function",
"replaceTableTokens",
"(",
"TableNode",
"$",
"input",
")",
"{",
"$",
"table",
"=",
"$",
"input",
"->",
"getTable",
"(",
")",
";",
"foreach",
"(",
"$",
"table",
"as",
"$",
"row",
"=>",
"$",
"values",
")",
"{",
"foreach",
"(",
"$"... | Replace fake data tokens in tables.
@Transform table:* | [
"Replace",
"fake",
"data",
"tokens",
"in",
"tables",
"."
] | 76da5d943773857ad2388a7cccb6632176b452a9 | https://github.com/cogentParadigm/behat-starbug-extension/blob/76da5d943773857ad2388a7cccb6632176b452a9/src/Context/RawStarbugContext.php#L68-L76 |
201,867 | cogentParadigm/behat-starbug-extension | src/Context/RawStarbugContext.php | RawStarbugContext.gatherContexts | public function gatherContexts(BeforeScenarioScope $scope) {
$environment = $scope->getEnvironment();
$this->mink = $environment->getContext('Starbug\Behat\Context\MinkContext');
} | php | public function gatherContexts(BeforeScenarioScope $scope) {
$environment = $scope->getEnvironment();
$this->mink = $environment->getContext('Starbug\Behat\Context\MinkContext');
} | [
"public",
"function",
"gatherContexts",
"(",
"BeforeScenarioScope",
"$",
"scope",
")",
"{",
"$",
"environment",
"=",
"$",
"scope",
"->",
"getEnvironment",
"(",
")",
";",
"$",
"this",
"->",
"mink",
"=",
"$",
"environment",
"->",
"getContext",
"(",
"'Starbug\\... | Access other contexts.
@BeforeScenario | [
"Access",
"other",
"contexts",
"."
] | 76da5d943773857ad2388a7cccb6632176b452a9 | https://github.com/cogentParadigm/behat-starbug-extension/blob/76da5d943773857ad2388a7cccb6632176b452a9/src/Context/RawStarbugContext.php#L82-L85 |
201,868 | refact-be/distext-php | src/Wavy/Distext/Distext.php | Distext.send | public function send($destination, $text)
{
/** @var Response $response */
$response = $this->browser->post('http://distext.wavy.be/api/sms', array(
'X-Auth-Token' => $this->apiKey,
), json_encode([
'destination' => $destination,
'text' => $text,
]... | php | public function send($destination, $text)
{
/** @var Response $response */
$response = $this->browser->post('http://distext.wavy.be/api/sms', array(
'X-Auth-Token' => $this->apiKey,
), json_encode([
'destination' => $destination,
'text' => $text,
]... | [
"public",
"function",
"send",
"(",
"$",
"destination",
",",
"$",
"text",
")",
"{",
"/** @var Response $response */",
"$",
"response",
"=",
"$",
"this",
"->",
"browser",
"->",
"post",
"(",
"'http://distext.wavy.be/api/sms'",
",",
"array",
"(",
"'X-Auth-Token'",
"... | Send a text message
@param string $destination
@param string $text
@throws \Exception | [
"Send",
"a",
"text",
"message"
] | 2d16604ac066983b4a5e01df0c15bba80dd99b32 | https://github.com/refact-be/distext-php/blob/2d16604ac066983b4a5e01df0c15bba80dd99b32/src/Wavy/Distext/Distext.php#L32-L46 |
201,869 | Vectrex/vxPHP | src/Session/SessionDataBag.php | SessionDataBag.remove | public function remove($key) {
if(!array_key_exists($key, $this->data)) {
return NULL;
}
$oldValue = $this->data[$key];
unset($this->data[$key]);
return $oldValue;
} | php | public function remove($key) {
if(!array_key_exists($key, $this->data)) {
return NULL;
}
$oldValue = $this->data[$key];
unset($this->data[$key]);
return $oldValue;
} | [
"public",
"function",
"remove",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"data",
")",
")",
"{",
"return",
"NULL",
";",
"}",
"$",
"oldValue",
"=",
"$",
"this",
"->",
"data",
"[",
"$",
... | unset key value;
returns previously held data
@param string $key
@return mixed | [
"unset",
"key",
"value",
";",
"returns",
"previously",
"held",
"data"
] | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Session/SessionDataBag.php#L120-L131 |
201,870 | Vectrex/vxPHP | src/Session/SessionDataBag.php | SessionDataBag.replace | public function replace(array $data) {
$this->data = array();
foreach ($data as $k => $v) {
$this->data[$k] = $v;
}
} | php | public function replace(array $data) {
$this->data = array();
foreach ($data as $k => $v) {
$this->data[$k] = $v;
}
} | [
"public",
"function",
"replace",
"(",
"array",
"$",
"data",
")",
"{",
"$",
"this",
"->",
"data",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"data",
"as",
"$",
"k",
"=>",
"$",
"v",
")",
"{",
"$",
"this",
"->",
"data",
"[",
"$",
"k",
"]"... | replace current data array
@param array $data | [
"replace",
"current",
"data",
"array"
] | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Session/SessionDataBag.php#L138-L146 |
201,871 | modulusphp/http | Middleware/TransformsRequest.php | TransformsRequest.cleanData | private function cleanData(array $data) : array
{
foreach($data as $key => $value) {
$data[$key] = $this->replace($key, $value);
}
return $data;
} | php | private function cleanData(array $data) : array
{
foreach($data as $key => $value) {
$data[$key] = $this->replace($key, $value);
}
return $data;
} | [
"private",
"function",
"cleanData",
"(",
"array",
"$",
"data",
")",
":",
"array",
"{",
"foreach",
"(",
"$",
"data",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"data",
"[",
"$",
"key",
"]",
"=",
"$",
"this",
"->",
"replace",
"(",
"$",
... | Loop through the values and pass them to the replace method
@param array $data
@return array | [
"Loop",
"through",
"the",
"values",
"and",
"pass",
"them",
"to",
"the",
"replace",
"method"
] | fc5c0f2b582a04de1685578d3fb790686a0a240c | https://github.com/modulusphp/http/blob/fc5c0f2b582a04de1685578d3fb790686a0a240c/Middleware/TransformsRequest.php#L37-L44 |
201,872 | modulusphp/http | Middleware/TransformsRequest.php | TransformsRequest.replace | private function replace($key, $value)
{
if (is_array($value)) return $this->cleanData($value);
return $this->transform($key, $value);
} | php | private function replace($key, $value)
{
if (is_array($value)) return $this->cleanData($value);
return $this->transform($key, $value);
} | [
"private",
"function",
"replace",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
")",
"return",
"$",
"this",
"->",
"cleanData",
"(",
"$",
"value",
")",
";",
"return",
"$",
"this",
"->",
"transform",
"("... | Pass arrays back to the cleanData method and pass everything else to transform
@param mixed $key
@param mixed $value
@return void | [
"Pass",
"arrays",
"back",
"to",
"the",
"cleanData",
"method",
"and",
"pass",
"everything",
"else",
"to",
"transform"
] | fc5c0f2b582a04de1685578d3fb790686a0a240c | https://github.com/modulusphp/http/blob/fc5c0f2b582a04de1685578d3fb790686a0a240c/Middleware/TransformsRequest.php#L53-L58 |
201,873 | lasallecms/lasallecms-l5-lasallecmsemail-pkg | src/Processing/AdminEmailProcessing.php | AdminEmailProcessing.washCreateForm | public function washCreateForm() {
// An array to hold the fields we'll neeed to INSERT the record
$data = [];
// Wash the input fields
$data['to_email_address'] = trim($this->request->input('to_email_address'));
$data['to_name'] = $this->genericWashText($this->request... | php | public function washCreateForm() {
// An array to hold the fields we'll neeed to INSERT the record
$data = [];
// Wash the input fields
$data['to_email_address'] = trim($this->request->input('to_email_address'));
$data['to_name'] = $this->genericWashText($this->request... | [
"public",
"function",
"washCreateForm",
"(",
")",
"{",
"// An array to hold the fields we'll neeed to INSERT the record",
"$",
"data",
"=",
"[",
"]",
";",
"// Wash the input fields",
"$",
"data",
"[",
"'to_email_address'",
"]",
"=",
"trim",
"(",
"$",
"this",
"->",
"... | Wash the create form's input fields
@return array | [
"Wash",
"the",
"create",
"form",
"s",
"input",
"fields"
] | 95db5a59ab322105b9d3681cf9ab1f829c9fdb9f | https://github.com/lasallecms/lasallecms-l5-lasallecmsemail-pkg/blob/95db5a59ab322105b9d3681cf9ab1f829c9fdb9f/src/Processing/AdminEmailProcessing.php#L110-L122 |
201,874 | lasallecms/lasallecms-l5-lasallecmsemail-pkg | src/Processing/AdminEmailProcessing.php | AdminEmailProcessing.prepEmailData | public function prepEmailData($id) {
$email = $this->email_message->find($id);
// Build the email data
// $data is an array
$data = [];
$data['from_name'] = $email->from_name;
$data['from_email_address'] = $email->from_email_address;
$data['to_name'... | php | public function prepEmailData($id) {
$email = $this->email_message->find($id);
// Build the email data
// $data is an array
$data = [];
$data['from_name'] = $email->from_name;
$data['from_email_address'] = $email->from_email_address;
$data['to_name'... | [
"public",
"function",
"prepEmailData",
"(",
"$",
"id",
")",
"{",
"$",
"email",
"=",
"$",
"this",
"->",
"email_message",
"->",
"find",
"(",
"$",
"id",
")",
";",
"// Build the email data",
"// $data is an array",
"$",
"data",
"=",
"[",
"]",
";",
"$",
"data... | Prepare the email
@param int $id The "email_messages" table's ID field
@return array | [
"Prepare",
"the",
"email"
] | 95db5a59ab322105b9d3681cf9ab1f829c9fdb9f | https://github.com/lasallecms/lasallecms-l5-lasallecmsemail-pkg/blob/95db5a59ab322105b9d3681cf9ab1f829c9fdb9f/src/Processing/AdminEmailProcessing.php#L253-L270 |
201,875 | phpffcms/ffcms-core | src/Helper/ModelFilters.php | ModelFilters.isFile | public static function isFile($object, $value): bool
{
// allow empty fields, "required" option filter that
if ($object === null) {
return true;
}
$all = false;
// if string is given
if (!Any::isArray($value)) {
if ($value === '*') {
... | php | public static function isFile($object, $value): bool
{
// allow empty fields, "required" option filter that
if ($object === null) {
return true;
}
$all = false;
// if string is given
if (!Any::isArray($value)) {
if ($value === '*') {
... | [
"public",
"static",
"function",
"isFile",
"(",
"$",
"object",
",",
"$",
"value",
")",
":",
"bool",
"{",
"// allow empty fields, \"required\" option filter that",
"if",
"(",
"$",
"object",
"===",
"null",
")",
"{",
"return",
"true",
";",
"}",
"$",
"all",
"=",
... | Check if field is file or null
@param object $object
@param $value
@return bool | [
"Check",
"if",
"field",
"is",
"file",
"or",
"null"
] | 44a309553ef9f115ccfcfd71f2ac6e381c612082 | https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Helper/ModelFilters.php#L303-L332 |
201,876 | phpffcms/ffcms-core | src/Helper/ModelFilters.php | ModelFilters.sizeFile | public static function sizeFile($object, $value): bool
{
// allow empty field, validate on filter 'required'
if ($object === null) {
return true;
}
if (!Any::isArray($value)) {
$value = [0, $value];
}
// input file is not object?
if (... | php | public static function sizeFile($object, $value): bool
{
// allow empty field, validate on filter 'required'
if ($object === null) {
return true;
}
if (!Any::isArray($value)) {
$value = [0, $value];
}
// input file is not object?
if (... | [
"public",
"static",
"function",
"sizeFile",
"(",
"$",
"object",
",",
"$",
"value",
")",
":",
"bool",
"{",
"// allow empty field, validate on filter 'required'",
"if",
"(",
"$",
"object",
"===",
"null",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"!",
... | Check file size. If is null - will return true
@param object $object
@param $value
@return bool | [
"Check",
"file",
"size",
".",
"If",
"is",
"null",
"-",
"will",
"return",
"true"
] | 44a309553ef9f115ccfcfd71f2ac6e381c612082 | https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Helper/ModelFilters.php#L340-L363 |
201,877 | quantaphp/container-factories | src/FactoryMap.php | FactoryMap.extended | private function extended(callable $factory, callable ...$extensions): callable
{
return array_reduce($extensions, function ($factory, $extension) {
return new Extension($factory, $extension);
}, $factory);
} | php | private function extended(callable $factory, callable ...$extensions): callable
{
return array_reduce($extensions, function ($factory, $extension) {
return new Extension($factory, $extension);
}, $factory);
} | [
"private",
"function",
"extended",
"(",
"callable",
"$",
"factory",
",",
"callable",
"...",
"$",
"extensions",
")",
":",
"callable",
"{",
"return",
"array_reduce",
"(",
"$",
"extensions",
",",
"function",
"(",
"$",
"factory",
",",
"$",
"extension",
")",
"{... | Return an extension from the given callables.
@param callable $factory
@param callable ...$extensions
@return callable | [
"Return",
"an",
"extension",
"from",
"the",
"given",
"callables",
"."
] | 5e753d66a18d0ce4418cbf33fe6d6b74948f303d | https://github.com/quantaphp/container-factories/blob/5e753d66a18d0ce4418cbf33fe6d6b74948f303d/src/FactoryMap.php#L69-L74 |
201,878 | ptlis/grep-db | src/Replace/Replace.php | Replace.replaceDatabase | public function replaceDatabase(
Connection $connection,
string $databaseName,
string $searchTerm,
string $replaceTerm,
int $batchSize = 100
): \Generator {
$databaseMetadata = (new MetadataFactory())->getDatabaseMetadata($connection, $databaseName);
foreach ... | php | public function replaceDatabase(
Connection $connection,
string $databaseName,
string $searchTerm,
string $replaceTerm,
int $batchSize = 100
): \Generator {
$databaseMetadata = (new MetadataFactory())->getDatabaseMetadata($connection, $databaseName);
foreach ... | [
"public",
"function",
"replaceDatabase",
"(",
"Connection",
"$",
"connection",
",",
"string",
"$",
"databaseName",
",",
"string",
"$",
"searchTerm",
",",
"string",
"$",
"replaceTerm",
",",
"int",
"$",
"batchSize",
"=",
"100",
")",
":",
"\\",
"Generator",
"{"... | Performs a search on all tables in the the provided database, batching queries to the specified batch size.
@return \Generator|RowReplaceResult[] | [
"Performs",
"a",
"search",
"on",
"all",
"tables",
"in",
"the",
"the",
"provided",
"database",
"batching",
"queries",
"to",
"the",
"specified",
"batch",
"size",
"."
] | 7abff68982d426690d0515ccd7adc7a2e3d72a3f | https://github.com/ptlis/grep-db/blob/7abff68982d426690d0515ccd7adc7a2e3d72a3f/src/Replace/Replace.php#L51-L74 |
201,879 | ptlis/grep-db | src/Replace/Replace.php | Replace.replaceTable | public function replaceTable(
Connection $connection,
string $databaseName,
string $tableName,
string $searchTerm,
string $replaceTerm,
int $batchSize = 100
): \Generator {
$connection->query('START TRANSACTION');
$rowCount = 0;
$rowSearchRes... | php | public function replaceTable(
Connection $connection,
string $databaseName,
string $tableName,
string $searchTerm,
string $replaceTerm,
int $batchSize = 100
): \Generator {
$connection->query('START TRANSACTION');
$rowCount = 0;
$rowSearchRes... | [
"public",
"function",
"replaceTable",
"(",
"Connection",
"$",
"connection",
",",
"string",
"$",
"databaseName",
",",
"string",
"$",
"tableName",
",",
"string",
"$",
"searchTerm",
",",
"string",
"$",
"replaceTerm",
",",
"int",
"$",
"batchSize",
"=",
"100",
")... | Performs a search on the provided table, batching queries to the specified batch size.
@return \Generator|RowReplaceResult[] | [
"Performs",
"a",
"search",
"on",
"the",
"provided",
"table",
"batching",
"queries",
"to",
"the",
"specified",
"batch",
"size",
"."
] | 7abff68982d426690d0515ccd7adc7a2e3d72a3f | https://github.com/ptlis/grep-db/blob/7abff68982d426690d0515ccd7adc7a2e3d72a3f/src/Replace/Replace.php#L81-L153 |
201,880 | ptlis/grep-db | src/Replace/Replace.php | Replace.replace | private function replace(
ColumnMetadata $columnMetadata,
string $searchTerm,
string $replaceTerm,
string $subject
): FieldReplaceResult {
$fieldReplaced = null;
foreach ($this->replacementStrategyList as $replacementStrategy) {
if ($replacementStrategy->c... | php | private function replace(
ColumnMetadata $columnMetadata,
string $searchTerm,
string $replaceTerm,
string $subject
): FieldReplaceResult {
$fieldReplaced = null;
foreach ($this->replacementStrategyList as $replacementStrategy) {
if ($replacementStrategy->c... | [
"private",
"function",
"replace",
"(",
"ColumnMetadata",
"$",
"columnMetadata",
",",
"string",
"$",
"searchTerm",
",",
"string",
"$",
"replaceTerm",
",",
"string",
"$",
"subject",
")",
":",
"FieldReplaceResult",
"{",
"$",
"fieldReplaced",
"=",
"null",
";",
"fo... | Perform the string replacement on the field.
@throws \RuntimeException If the replacement fails. | [
"Perform",
"the",
"string",
"replacement",
"on",
"the",
"field",
"."
] | 7abff68982d426690d0515ccd7adc7a2e3d72a3f | https://github.com/ptlis/grep-db/blob/7abff68982d426690d0515ccd7adc7a2e3d72a3f/src/Replace/Replace.php#L186-L210 |
201,881 | AmericanCouncils/Slimfra | src/Application.php | Application.register | public function register(ServiceProviderInterface $provider, array $values = array())
{
$this->registeredProviders[get_class($provider)] = true;
parent::register($provider, $values);
} | php | public function register(ServiceProviderInterface $provider, array $values = array())
{
$this->registeredProviders[get_class($provider)] = true;
parent::register($provider, $values);
} | [
"public",
"function",
"register",
"(",
"ServiceProviderInterface",
"$",
"provider",
",",
"array",
"$",
"values",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"registeredProviders",
"[",
"get_class",
"(",
"$",
"provider",
")",
"]",
"=",
"true",
";",... | Keep track of registered providers.
{@inheritdoc} | [
"Keep",
"track",
"of",
"registered",
"providers",
"."
] | 17f2b8dc71bc0d7aa6da2ac89bee2b1806a3aeb6 | https://github.com/AmericanCouncils/Slimfra/blob/17f2b8dc71bc0d7aa6da2ac89bee2b1806a3aeb6/src/Application.php#L53-L58 |
201,882 | AmericanCouncils/Slimfra | src/Application.php | Application.handleError | public function handleError($errno, $errstr, $errfile, $errline)
{
if (!$this['debug']) {
return;
}
throw new \ErrorException($errstr, 0, $errno, $errfile, $errline);
} | php | public function handleError($errno, $errstr, $errfile, $errline)
{
if (!$this['debug']) {
return;
}
throw new \ErrorException($errstr, 0, $errno, $errfile, $errline);
} | [
"public",
"function",
"handleError",
"(",
"$",
"errno",
",",
"$",
"errstr",
",",
"$",
"errfile",
",",
"$",
"errline",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"[",
"'debug'",
"]",
")",
"{",
"return",
";",
"}",
"throw",
"new",
"\\",
"ErrorException",
... | A generic error handler, will convert errors into exceptions in debug mode.
@param int $errno
@param string $errstr
@param string $errfile
@param int $errline
@throws ErrorException | [
"A",
"generic",
"error",
"handler",
"will",
"convert",
"errors",
"into",
"exceptions",
"in",
"debug",
"mode",
"."
] | 17f2b8dc71bc0d7aa6da2ac89bee2b1806a3aeb6 | https://github.com/AmericanCouncils/Slimfra/blob/17f2b8dc71bc0d7aa6da2ac89bee2b1806a3aeb6/src/Application.php#L103-L110 |
201,883 | gplcart/ga_report | controllers/Report.php | Report.listReport | public function listReport()
{
$this->setTitleListReport();
$this->setBreadcrumbListReport();
$this->clearCacheReport();
$this->setData('stores', $this->store->getList());
$this->setData('panels', $this->getPanelsReport());
$default = $this->module->getSettings('ga_... | php | public function listReport()
{
$this->setTitleListReport();
$this->setBreadcrumbListReport();
$this->clearCacheReport();
$this->setData('stores', $this->store->getList());
$this->setData('panels', $this->getPanelsReport());
$default = $this->module->getSettings('ga_... | [
"public",
"function",
"listReport",
"(",
")",
"{",
"$",
"this",
"->",
"setTitleListReport",
"(",
")",
";",
"$",
"this",
"->",
"setBreadcrumbListReport",
"(",
")",
";",
"$",
"this",
"->",
"clearCacheReport",
"(",
")",
";",
"$",
"this",
"->",
"setData",
"(... | Route callback
Displays the report page | [
"Route",
"callback",
"Displays",
"the",
"report",
"page"
] | 856a480e394bb3feaeea4785ccccad56abaac499 | https://github.com/gplcart/ga_report/blob/856a480e394bb3feaeea4785ccccad56abaac499/controllers/Report.php#L41-L54 |
201,884 | gplcart/ga_report | controllers/Report.php | Report.getPanelsReport | protected function getPanelsReport()
{
$settings = $this->module->getSettings('ga_report');
$store_id = $this->getQuery('ga.update.store_id');
if (!empty($store_id)) {
$settings['store_id'] = $store_id;
}
$panels = array();
foreach ($this->report_model-... | php | protected function getPanelsReport()
{
$settings = $this->module->getSettings('ga_report');
$store_id = $this->getQuery('ga.update.store_id');
if (!empty($store_id)) {
$settings['store_id'] = $store_id;
}
$panels = array();
foreach ($this->report_model-... | [
"protected",
"function",
"getPanelsReport",
"(",
")",
"{",
"$",
"settings",
"=",
"$",
"this",
"->",
"module",
"->",
"getSettings",
"(",
"'ga_report'",
")",
";",
"$",
"store_id",
"=",
"$",
"this",
"->",
"getQuery",
"(",
"'ga.update.store_id'",
")",
";",
"if... | Returns an array of report panels
@return array | [
"Returns",
"an",
"array",
"of",
"report",
"panels"
] | 856a480e394bb3feaeea4785ccccad56abaac499 | https://github.com/gplcart/ga_report/blob/856a480e394bb3feaeea4785ccccad56abaac499/controllers/Report.php#L93-L122 |
201,885 | Vectrex/vxPHP | src/Routing/DefaultRouteAuthenticator.php | DefaultRouteAuthenticator.handleViolation | public function handleViolation(Route $route)
{
if(in_array($route, $this->violatingRoutes)) {
throw new ApplicationException('Circular redirects detected; aborting.');
}
// to avoid circular references all redirects are logged
$this->violatingRoutes[] = $route;
... | php | public function handleViolation(Route $route)
{
if(in_array($route, $this->violatingRoutes)) {
throw new ApplicationException('Circular redirects detected; aborting.');
}
// to avoid circular references all redirects are logged
$this->violatingRoutes[] = $route;
... | [
"public",
"function",
"handleViolation",
"(",
"Route",
"$",
"route",
")",
"{",
"if",
"(",
"in_array",
"(",
"$",
"route",
",",
"$",
"this",
"->",
"violatingRoutes",
")",
")",
"{",
"throw",
"new",
"ApplicationException",
"(",
"'Circular redirects detected; abortin... | handle authentication violation by trying to find a redirecting route
@param Route $route
@return mixed|Route
@throws \vxPHP\Application\Exception\ApplicationException | [
"handle",
"authentication",
"violation",
"by",
"trying",
"to",
"find",
"a",
"redirecting",
"route"
] | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Routing/DefaultRouteAuthenticator.php#L97-L118 |
201,886 | agentmedia/phine-core | src/Core/Logic/Tree/ListProvider.php | ListProvider.ToArray | function ToArray()
{
$result = array();
$item = $this->TopMost();
while ($item)
{
$result[] = $item;
$item = $this->NextOf($item);
}
return $result;
} | php | function ToArray()
{
$result = array();
$item = $this->TopMost();
while ($item)
{
$result[] = $item;
$item = $this->NextOf($item);
}
return $result;
} | [
"function",
"ToArray",
"(",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"$",
"item",
"=",
"$",
"this",
"->",
"TopMost",
"(",
")",
";",
"while",
"(",
"$",
"item",
")",
"{",
"$",
"result",
"[",
"]",
"=",
"$",
"item",
";",
"$",
"item",... | Gets the sorted item list
@return mixed[] Returns the items in their given order | [
"Gets",
"the",
"sorted",
"item",
"list"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Tree/ListProvider.php#L29-L39 |
201,887 | agentmedia/phine-core | src/Core/Logic/Tree/ListProvider.php | ListProvider.Last | function Last() {
$items = $this->ToArray();
$cnt = count($items);
return $cnt > 0 ? $items[$cnt -1] : null;
} | php | function Last() {
$items = $this->ToArray();
$cnt = count($items);
return $cnt > 0 ? $items[$cnt -1] : null;
} | [
"function",
"Last",
"(",
")",
"{",
"$",
"items",
"=",
"$",
"this",
"->",
"ToArray",
"(",
")",
";",
"$",
"cnt",
"=",
"count",
"(",
"$",
"items",
")",
";",
"return",
"$",
"cnt",
">",
"0",
"?",
"$",
"items",
"[",
"$",
"cnt",
"-",
"1",
"]",
":"... | Gets the last item
@return mixed Retuens the last list item | [
"Gets",
"the",
"last",
"item"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Tree/ListProvider.php#L45-L49 |
201,888 | codeblanche/Web | src/Web/Route/Rules/UriRule.php | UriRule.complexity | public function complexity()
{
$dynamicPartsCount = substr_count($this->pattern, ':') + substr_count($this->pattern, '?');
return (substr_count($this->pattern, '/') - $dynamicPartsCount) * 100 + $dynamicPartsCount;
} | php | public function complexity()
{
$dynamicPartsCount = substr_count($this->pattern, ':') + substr_count($this->pattern, '?');
return (substr_count($this->pattern, '/') - $dynamicPartsCount) * 100 + $dynamicPartsCount;
} | [
"public",
"function",
"complexity",
"(",
")",
"{",
"$",
"dynamicPartsCount",
"=",
"substr_count",
"(",
"$",
"this",
"->",
"pattern",
",",
"':'",
")",
"+",
"substr_count",
"(",
"$",
"this",
"->",
"pattern",
",",
"'?'",
")",
";",
"return",
"(",
"substr_cou... | Count the number of pattern segments for this rule. | [
"Count",
"the",
"number",
"of",
"pattern",
"segments",
"for",
"this",
"rule",
"."
] | 3e9ebf1943d3ea468f619ba99f7cc10714cb16e9 | https://github.com/codeblanche/Web/blob/3e9ebf1943d3ea468f619ba99f7cc10714cb16e9/src/Web/Route/Rules/UriRule.php#L12-L17 |
201,889 | nice-php/benchmark | src/ResultPruner/StandardDeviationPruner.php | StandardDeviationPruner.prune | public function prune(array $results)
{
$mean = array_sum($results) / count($results);
$deviation = $this->deviations * $this->standardDeviation($results);
$lower = $mean - $deviation;
$upper = $mean + $deviation;
return array_values(array_filter($results, function ($val) us... | php | public function prune(array $results)
{
$mean = array_sum($results) / count($results);
$deviation = $this->deviations * $this->standardDeviation($results);
$lower = $mean - $deviation;
$upper = $mean + $deviation;
return array_values(array_filter($results, function ($val) us... | [
"public",
"function",
"prune",
"(",
"array",
"$",
"results",
")",
"{",
"$",
"mean",
"=",
"array_sum",
"(",
"$",
"results",
")",
"/",
"count",
"(",
"$",
"results",
")",
";",
"$",
"deviation",
"=",
"$",
"this",
"->",
"deviations",
"*",
"$",
"this",
"... | Prune the results
@param array $results
@return array The pruned results | [
"Prune",
"the",
"results"
] | 2084c77dbb88cd76006abbfe85b2b704f6bbd1cf | https://github.com/nice-php/benchmark/blob/2084c77dbb88cd76006abbfe85b2b704f6bbd1cf/src/ResultPruner/StandardDeviationPruner.php#L38-L48 |
201,890 | nice-php/benchmark | src/ResultPruner/StandardDeviationPruner.php | StandardDeviationPruner.standardDeviation | private function standardDeviation(array $results)
{
$mean = array_sum($results) / count($results);
$initial = 0;
$f = function ($carry, $val) use ($mean) {
return $carry + pow($val - $mean, 2);
};
$sum = array_reduce($results, $f, $initial);
$n = count($r... | php | private function standardDeviation(array $results)
{
$mean = array_sum($results) / count($results);
$initial = 0;
$f = function ($carry, $val) use ($mean) {
return $carry + pow($val - $mean, 2);
};
$sum = array_reduce($results, $f, $initial);
$n = count($r... | [
"private",
"function",
"standardDeviation",
"(",
"array",
"$",
"results",
")",
"{",
"$",
"mean",
"=",
"array_sum",
"(",
"$",
"results",
")",
"/",
"count",
"(",
"$",
"results",
")",
";",
"$",
"initial",
"=",
"0",
";",
"$",
"f",
"=",
"function",
"(",
... | Returns one standard deviation for the given results
@param array $results
@return float | [
"Returns",
"one",
"standard",
"deviation",
"for",
"the",
"given",
"results"
] | 2084c77dbb88cd76006abbfe85b2b704f6bbd1cf | https://github.com/nice-php/benchmark/blob/2084c77dbb88cd76006abbfe85b2b704f6bbd1cf/src/ResultPruner/StandardDeviationPruner.php#L57-L68 |
201,891 | nails/module-blog | admin/controllers/Tag.php | Tag.index | public function index()
{
// Page data
$this->data['page']->title = 'Blog › Tags';
// --------------------------------------------------------------------------
$data = array();
$data['include_count'] = true;
$data['where'] = array()... | php | public function index()
{
// Page data
$this->data['page']->title = 'Blog › Tags';
// --------------------------------------------------------------------------
$data = array();
$data['include_count'] = true;
$data['where'] = array()... | [
"public",
"function",
"index",
"(",
")",
"{",
"// Page data",
"$",
"this",
"->",
"data",
"[",
"'page'",
"]",
"->",
"title",
"=",
"'Blog › Tags'",
";",
"// --------------------------------------------------------------------------",
"$",
"data",
"=",
"array",
"... | Browse blog tags
@return void | [
"Browse",
"blog",
"tags"
] | 7b369c5209f4343fff7c7e2a22c237d5a95c8c24 | https://github.com/nails/module-blog/blob/7b369c5209f4343fff7c7e2a22c237d5a95c8c24/admin/controllers/Tag.php#L154-L171 |
201,892 | nails/module-blog | admin/controllers/Tag.php | Tag.create | public function create()
{
if (!userHasPermission('admin:blog:tag:' . $this->blog->id . ':create')) {
unauthorised();
}
// --------------------------------------------------------------------------
if ($this->input->post()) {
$oFormValidation = Factory::se... | php | public function create()
{
if (!userHasPermission('admin:blog:tag:' . $this->blog->id . ':create')) {
unauthorised();
}
// --------------------------------------------------------------------------
if ($this->input->post()) {
$oFormValidation = Factory::se... | [
"public",
"function",
"create",
"(",
")",
"{",
"if",
"(",
"!",
"userHasPermission",
"(",
"'admin:blog:tag:'",
".",
"$",
"this",
"->",
"blog",
"->",
"id",
".",
"':create'",
")",
")",
"{",
"unauthorised",
"(",
")",
";",
"}",
"// -------------------------------... | Create a new blog tag
@return void | [
"Create",
"a",
"new",
"blog",
"tag"
] | 7b369c5209f4343fff7c7e2a22c237d5a95c8c24 | https://github.com/nails/module-blog/blob/7b369c5209f4343fff7c7e2a22c237d5a95c8c24/admin/controllers/Tag.php#L179-L244 |
201,893 | nails/module-blog | admin/controllers/Tag.php | Tag.edit | public function edit()
{
if (!userHasPermission('admin:blog:tag:' . $this->blog->id . ':edit')) {
unauthorised();
}
// --------------------------------------------------------------------------
$this->data['tag'] = $this->blog_tag_model->getById($this->uri->segment(6))... | php | public function edit()
{
if (!userHasPermission('admin:blog:tag:' . $this->blog->id . ':edit')) {
unauthorised();
}
// --------------------------------------------------------------------------
$this->data['tag'] = $this->blog_tag_model->getById($this->uri->segment(6))... | [
"public",
"function",
"edit",
"(",
")",
"{",
"if",
"(",
"!",
"userHasPermission",
"(",
"'admin:blog:tag:'",
".",
"$",
"this",
"->",
"blog",
"->",
"id",
".",
"':edit'",
")",
")",
"{",
"unauthorised",
"(",
")",
";",
"}",
"// -----------------------------------... | Edit a blog tag
@return void | [
"Edit",
"a",
"blog",
"tag"
] | 7b369c5209f4343fff7c7e2a22c237d5a95c8c24 | https://github.com/nails/module-blog/blob/7b369c5209f4343fff7c7e2a22c237d5a95c8c24/admin/controllers/Tag.php#L252-L323 |
201,894 | ekyna/Resource | Configuration/ConfigurationRegistry.php | ConfigurationRegistry.addConfiguration | public function addConfiguration(ConfigurationInterface $configuration)
{
// Clear the parent map.
$this->parentMap = null;
$id = $configuration->getResourceId();
if (array_key_exists($id, $this->configurations)) {
throw new \RuntimeException(sprintf("Configuration for ... | php | public function addConfiguration(ConfigurationInterface $configuration)
{
// Clear the parent map.
$this->parentMap = null;
$id = $configuration->getResourceId();
if (array_key_exists($id, $this->configurations)) {
throw new \RuntimeException(sprintf("Configuration for ... | [
"public",
"function",
"addConfiguration",
"(",
"ConfigurationInterface",
"$",
"configuration",
")",
"{",
"// Clear the parent map.",
"$",
"this",
"->",
"parentMap",
"=",
"null",
";",
"$",
"id",
"=",
"$",
"configuration",
"->",
"getResourceId",
"(",
")",
";",
"if... | Adds the resource configuration.
@param ConfigurationInterface $configuration
@throws \RuntimeException | [
"Adds",
"the",
"resource",
"configuration",
"."
] | 96ee3d28e02bd9513705408e3bb7f88a76e52f56 | https://github.com/ekyna/Resource/blob/96ee3d28e02bd9513705408e3bb7f88a76e52f56/Configuration/ConfigurationRegistry.php#L48-L60 |
201,895 | ekyna/Resource | Configuration/ConfigurationRegistry.php | ConfigurationRegistry.get | public function get($id)
{
if (!$this->has($id)) {
throw new \InvalidArgumentException(sprintf('Configuration "%s" not found.', $id));
}
return $this->configurations[$id];
} | php | public function get($id)
{
if (!$this->has($id)) {
throw new \InvalidArgumentException(sprintf('Configuration "%s" not found.', $id));
}
return $this->configurations[$id];
} | [
"public",
"function",
"get",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"has",
"(",
"$",
"id",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'Configuration \"%s\" not found.'",
",",
"$",
"id",
... | Returns the configuration for the given identifier.
@param string $id
@throws \InvalidArgumentException
@return ConfigurationInterface | [
"Returns",
"the",
"configuration",
"for",
"the",
"given",
"identifier",
"."
] | 96ee3d28e02bd9513705408e3bb7f88a76e52f56 | https://github.com/ekyna/Resource/blob/96ee3d28e02bd9513705408e3bb7f88a76e52f56/Configuration/ConfigurationRegistry.php#L161-L168 |
201,896 | ekyna/Resource | Configuration/ConfigurationRegistry.php | ConfigurationRegistry.getAncestors | public function getAncestors(ConfigurationInterface $configuration, $included = false)
{
$ancestors = [];
if ($included) {
$ancestors[$configuration->getResourceName()] = $configuration;
}
while (null !== $configuration->getParentId()) {
$configuration = $th... | php | public function getAncestors(ConfigurationInterface $configuration, $included = false)
{
$ancestors = [];
if ($included) {
$ancestors[$configuration->getResourceName()] = $configuration;
}
while (null !== $configuration->getParentId()) {
$configuration = $th... | [
"public",
"function",
"getAncestors",
"(",
"ConfigurationInterface",
"$",
"configuration",
",",
"$",
"included",
"=",
"false",
")",
"{",
"$",
"ancestors",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"included",
")",
"{",
"$",
"ancestors",
"[",
"$",
"configuration"... | Returns all the ancestors configuration.
@param ConfigurationInterface $configuration
@param bool $included
@return ConfigurationInterface[] | [
"Returns",
"all",
"the",
"ancestors",
"configuration",
"."
] | 96ee3d28e02bd9513705408e3bb7f88a76e52f56 | https://github.com/ekyna/Resource/blob/96ee3d28e02bd9513705408e3bb7f88a76e52f56/Configuration/ConfigurationRegistry.php#L178-L192 |
201,897 | ekyna/Resource | Configuration/ConfigurationRegistry.php | ConfigurationRegistry.getChildren | public function getChildren(ConfigurationInterface $configuration)
{
$children = [];
foreach ($this->configurations as $child) {
if ($child->getParentId() === $configuration->getResourceId()) {
$children[$child->getResourceName()] = $child;
}
}
... | php | public function getChildren(ConfigurationInterface $configuration)
{
$children = [];
foreach ($this->configurations as $child) {
if ($child->getParentId() === $configuration->getResourceId()) {
$children[$child->getResourceName()] = $child;
}
}
... | [
"public",
"function",
"getChildren",
"(",
"ConfigurationInterface",
"$",
"configuration",
")",
"{",
"$",
"children",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"configurations",
"as",
"$",
"child",
")",
"{",
"if",
"(",
"$",
"child",
"->",
"ge... | Returns all the children configuration.
@param ConfigurationInterface $configuration
@return ConfigurationInterface[] | [
"Returns",
"all",
"the",
"children",
"configuration",
"."
] | 96ee3d28e02bd9513705408e3bb7f88a76e52f56 | https://github.com/ekyna/Resource/blob/96ee3d28e02bd9513705408e3bb7f88a76e52f56/Configuration/ConfigurationRegistry.php#L201-L212 |
201,898 | ekyna/Resource | Configuration/ConfigurationRegistry.php | ConfigurationRegistry.getObjectIdentity | public function getObjectIdentity($object)
{
foreach ($this->configurations as $config) {
if ($config->isRelevant($object)) {
return $config->getObjectIdentity();
}
}
return null;
} | php | public function getObjectIdentity($object)
{
foreach ($this->configurations as $config) {
if ($config->isRelevant($object)) {
return $config->getObjectIdentity();
}
}
return null;
} | [
"public",
"function",
"getObjectIdentity",
"(",
"$",
"object",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"configurations",
"as",
"$",
"config",
")",
"{",
"if",
"(",
"$",
"config",
"->",
"isRelevant",
"(",
"$",
"object",
")",
")",
"{",
"return",
"$",... | Returns the object identity.
@param object $object
@return \Symfony\Component\Security\Acl\Domain\ObjectIdentity|null | [
"Returns",
"the",
"object",
"identity",
"."
] | 96ee3d28e02bd9513705408e3bb7f88a76e52f56 | https://github.com/ekyna/Resource/blob/96ee3d28e02bd9513705408e3bb7f88a76e52f56/Configuration/ConfigurationRegistry.php#L231-L240 |
201,899 | ekyna/Resource | Configuration/ConfigurationRegistry.php | ConfigurationRegistry.getParentMap | public function getParentMap()
{
if (null !== $this->parentMap) {
return $this->parentMap;
}
return $this->parentMap = $this->buildParentMap();
} | php | public function getParentMap()
{
if (null !== $this->parentMap) {
return $this->parentMap;
}
return $this->parentMap = $this->buildParentMap();
} | [
"public",
"function",
"getParentMap",
"(",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"parentMap",
")",
"{",
"return",
"$",
"this",
"->",
"parentMap",
";",
"}",
"return",
"$",
"this",
"->",
"parentMap",
"=",
"$",
"this",
"->",
"buildParentM... | Returns the hierarchy map.
@return array | [
"Returns",
"the",
"hierarchy",
"map",
"."
] | 96ee3d28e02bd9513705408e3bb7f88a76e52f56 | https://github.com/ekyna/Resource/blob/96ee3d28e02bd9513705408e3bb7f88a76e52f56/Configuration/ConfigurationRegistry.php#L247-L254 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.