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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
203,900 | plinker-rpc/system | src/System.php | System.distro | public function distro()
{
if (file_exists('/etc/redhat-release')) {
$centos_array = explode(' ', file_get_contents('/etc/redhat-release'));
return strtoupper($centos_array[0]);
}
if (file_exists('/etc/os-release')) {
preg_match('/ID=([a-zA-Z]+)/', file_g... | php | public function distro()
{
if (file_exists('/etc/redhat-release')) {
$centos_array = explode(' ', file_get_contents('/etc/redhat-release'));
return strtoupper($centos_array[0]);
}
if (file_exists('/etc/os-release')) {
preg_match('/ID=([a-zA-Z]+)/', file_g... | [
"public",
"function",
"distro",
"(",
")",
"{",
"if",
"(",
"file_exists",
"(",
"'/etc/redhat-release'",
")",
")",
"{",
"$",
"centos_array",
"=",
"explode",
"(",
"' '",
",",
"file_get_contents",
"(",
"'/etc/redhat-release'",
")",
")",
";",
"return",
"strtoupper"... | Get system distro
@return string | [
"Get",
"system",
"distro"
] | b0b83aad136a91c094eaac8c463df7c916d1c76e | https://github.com/plinker-rpc/system/blob/b0b83aad136a91c094eaac8c463df7c916d1c76e/src/System.php#L710-L722 |
203,901 | plinker-rpc/system | src/System.php | System.reboot | public function reboot()
{
if (!file_exists($this->tmp_path.'/reboot.sh')) {
file_put_contents($this->tmp_path.'/reboot.sh', '#!/bin/bash'.PHP_EOL.'/sbin/shutdown -r now');
chmod($this->tmp_path.'/reboot.sh', 0750);
}
shell_exec($this->tmp_path.'/reboot.sh');
... | php | public function reboot()
{
if (!file_exists($this->tmp_path.'/reboot.sh')) {
file_put_contents($this->tmp_path.'/reboot.sh', '#!/bin/bash'.PHP_EOL.'/sbin/shutdown -r now');
chmod($this->tmp_path.'/reboot.sh', 0750);
}
shell_exec($this->tmp_path.'/reboot.sh');
... | [
"public",
"function",
"reboot",
"(",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"this",
"->",
"tmp_path",
".",
"'/reboot.sh'",
")",
")",
"{",
"file_put_contents",
"(",
"$",
"this",
"->",
"tmp_path",
".",
"'/reboot.sh'",
",",
"'#!/bin/bash'",
".",
... | Reboot the system
@requires root
@return void | [
"Reboot",
"the",
"system"
] | b0b83aad136a91c094eaac8c463df7c916d1c76e | https://github.com/plinker-rpc/system/blob/b0b83aad136a91c094eaac8c463df7c916d1c76e/src/System.php#L763-L771 |
203,902 | QoboLtd/cakephp-translations | src/Model/Table/LanguagesTable.php | LanguagesTable.localeToLanguage | public function localeToLanguage(string $locale): string
{
if (empty($locale)) {
throw new InvalidArgumentException("Locale must be a non-emptystring.");
}
// Truncate all, starting with underscore, at, or dot
$result = (string)preg_replace('/(_|@|\.).*$/', '', strtolowe... | php | public function localeToLanguage(string $locale): string
{
if (empty($locale)) {
throw new InvalidArgumentException("Locale must be a non-emptystring.");
}
// Truncate all, starting with underscore, at, or dot
$result = (string)preg_replace('/(_|@|\.).*$/', '', strtolowe... | [
"public",
"function",
"localeToLanguage",
"(",
"string",
"$",
"locale",
")",
":",
"string",
"{",
"if",
"(",
"empty",
"(",
"$",
"locale",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"\"Locale must be a non-emptystring.\"",
")",
";",
"}",
"//... | Convert locale to language
On Linux, have a look at /usr/share/locale for the
list of possible locales and locale formats.
@throws \InvalidArgumentException when locale is not a string
@param string $locale Locale string (example: ru_RU.KOI8-R)
@return string Language (example: ru) | [
"Convert",
"locale",
"to",
"language"
] | b488eafce71a55d517b975342487812f0d2d375a | https://github.com/QoboLtd/cakephp-translations/blob/b488eafce71a55d517b975342487812f0d2d375a/src/Model/Table/LanguagesTable.php#L97-L109 |
203,903 | QoboLtd/cakephp-translations | src/Model/Table/LanguagesTable.php | LanguagesTable.isRtl | public function isRtl(string $language): bool
{
$result = false;
// Simplify and verify, just in case
$language = $this->localeToLanguage($language);
if (in_array($language, $this->getRtl())) {
$result = true;
}
return $result;
} | php | public function isRtl(string $language): bool
{
$result = false;
// Simplify and verify, just in case
$language = $this->localeToLanguage($language);
if (in_array($language, $this->getRtl())) {
$result = true;
}
return $result;
} | [
"public",
"function",
"isRtl",
"(",
"string",
"$",
"language",
")",
":",
"bool",
"{",
"$",
"result",
"=",
"false",
";",
"// Simplify and verify, just in case",
"$",
"language",
"=",
"$",
"this",
"->",
"localeToLanguage",
"(",
"$",
"language",
")",
";",
"if",... | Check if given language is right-to-left
@param string $language Language code or locale string (example: ru_RU.KOI8-R)
@return bool | [
"Check",
"if",
"given",
"language",
"is",
"right",
"-",
"to",
"-",
"left"
] | b488eafce71a55d517b975342487812f0d2d375a | https://github.com/QoboLtd/cakephp-translations/blob/b488eafce71a55d517b975342487812f0d2d375a/src/Model/Table/LanguagesTable.php#L129-L140 |
203,904 | QoboLtd/cakephp-translations | src/Model/Table/LanguagesTable.php | LanguagesTable.getAvailable | public function getAvailable(): array
{
$result = [];
$dbLanguages = $this->find('list', ['keyField' => 'code', 'valueField' => 'name'])
->where(['trashed IS' => null])
->toArray();
$supportedLanguages = $this->getSupported();
... | php | public function getAvailable(): array
{
$result = [];
$dbLanguages = $this->find('list', ['keyField' => 'code', 'valueField' => 'name'])
->where(['trashed IS' => null])
->toArray();
$supportedLanguages = $this->getSupported();
... | [
"public",
"function",
"getAvailable",
"(",
")",
":",
"array",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"$",
"dbLanguages",
"=",
"$",
"this",
"->",
"find",
"(",
"'list'",
",",
"[",
"'keyField'",
"=>",
"'code'",
",",
"'valueField'",
"=>",
"'name'",
"]",
... | Get a list of all available languages
Available languages are those that are in
configuration, but haven't yet been used for
an active language.
@return mixed[] | [
"Get",
"a",
"list",
"of",
"all",
"available",
"languages"
] | b488eafce71a55d517b975342487812f0d2d375a | https://github.com/QoboLtd/cakephp-translations/blob/b488eafce71a55d517b975342487812f0d2d375a/src/Model/Table/LanguagesTable.php#L163-L174 |
203,905 | QoboLtd/cakephp-translations | src/Model/Table/LanguagesTable.php | LanguagesTable.getName | public function getName(string $code): string
{
$result = $code;
if (empty($code)) {
throw new InvalidArgumentException("Code must be a non-empty string.");
}
$languages = $this->getSupported();
if (!empty($languages[$code])) {
$result = $languages[$... | php | public function getName(string $code): string
{
$result = $code;
if (empty($code)) {
throw new InvalidArgumentException("Code must be a non-empty string.");
}
$languages = $this->getSupported();
if (!empty($languages[$code])) {
$result = $languages[$... | [
"public",
"function",
"getName",
"(",
"string",
"$",
"code",
")",
":",
"string",
"{",
"$",
"result",
"=",
"$",
"code",
";",
"if",
"(",
"empty",
"(",
"$",
"code",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"\"Code must be a non-empty st... | Get language name by code
@throws \InvalidArgumentException when code is not a string
@param string $code Language code to lookup
@return string | [
"Get",
"language",
"name",
"by",
"code"
] | b488eafce71a55d517b975342487812f0d2d375a | https://github.com/QoboLtd/cakephp-translations/blob/b488eafce71a55d517b975342487812f0d2d375a/src/Model/Table/LanguagesTable.php#L183-L197 |
203,906 | QoboLtd/cakephp-translations | src/Model/Table/LanguagesTable.php | LanguagesTable.addOrRestore | public function addOrRestore(array $data): \Translations\Model\Entity\Language
{
if (empty($data['code'])) {
throw new InvalidArgumentException("Language data is missing 'code' key");
}
if (empty($data['is_rtl'])) {
$data['is_rtl'] = $this->isRtl($data['code']);
... | php | public function addOrRestore(array $data): \Translations\Model\Entity\Language
{
if (empty($data['code'])) {
throw new InvalidArgumentException("Language data is missing 'code' key");
}
if (empty($data['is_rtl'])) {
$data['is_rtl'] = $this->isRtl($data['code']);
... | [
"public",
"function",
"addOrRestore",
"(",
"array",
"$",
"data",
")",
":",
"\\",
"Translations",
"\\",
"Model",
"\\",
"Entity",
"\\",
"Language",
"{",
"if",
"(",
"empty",
"(",
"$",
"data",
"[",
"'code'",
"]",
")",
")",
"{",
"throw",
"new",
"InvalidArgu... | Add a new language or restore a deleted one
@throws \InvalidArgumentException when data is wrong or incomplete
@param mixed[] $data Language data to populate Entity with
@return \Translations\Model\Entity\Language | [
"Add",
"a",
"new",
"language",
"or",
"restore",
"a",
"deleted",
"one"
] | b488eafce71a55d517b975342487812f0d2d375a | https://github.com/QoboLtd/cakephp-translations/blob/b488eafce71a55d517b975342487812f0d2d375a/src/Model/Table/LanguagesTable.php#L206-L239 |
203,907 | chilimatic/chilimatic-framework | lib/cgenerator/Mysql.php | Mysql.scan_table | public function scan_table($table_name = '')
{
if (empty($table_name)) return false;
$this->_l_table_name = strtolower($table_name);
$this->table_name = $table_name;
$this->tpl_replacements['table_name'] = $table_name;
// get a more deta... | php | public function scan_table($table_name = '')
{
if (empty($table_name)) return false;
$this->_l_table_name = strtolower($table_name);
$this->table_name = $table_name;
$this->tpl_replacements['table_name'] = $table_name;
// get a more deta... | [
"public",
"function",
"scan_table",
"(",
"$",
"table_name",
"=",
"''",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"table_name",
")",
")",
"return",
"false",
";",
"$",
"this",
"->",
"_l_table_name",
"=",
"strtolower",
"(",
"$",
"table_name",
")",
";",
"$",... | fetches a numeric table list
@param $table_name string
@return boolean | [
"fetches",
"a",
"numeric",
"table",
"list"
] | 8df7f12e75d75d3fd2197a58c80d39cbb4b9ff12 | https://github.com/chilimatic/chilimatic-framework/blob/8df7f12e75d75d3fd2197a58c80d39cbb4b9ff12/lib/cgenerator/Mysql.php#L92-L107 |
203,908 | chilimatic/chilimatic-framework | lib/cgenerator/Mysql.php | Mysql.get_type_value | public function get_type_value($type = null, $type_cast = false)
{
if (empty($type)) return "null";
if (strpos(strtolower($type), 'int') !== false) {
return ($type_cast) ? '(int)' : 0;
}
if (strpos(strtolower($type), 'float') !== false) {
return ($type_cast... | php | public function get_type_value($type = null, $type_cast = false)
{
if (empty($type)) return "null";
if (strpos(strtolower($type), 'int') !== false) {
return ($type_cast) ? '(int)' : 0;
}
if (strpos(strtolower($type), 'float') !== false) {
return ($type_cast... | [
"public",
"function",
"get_type_value",
"(",
"$",
"type",
"=",
"null",
",",
"$",
"type_cast",
"=",
"false",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"type",
")",
")",
"return",
"\"null\"",
";",
"if",
"(",
"strpos",
"(",
"strtolower",
"(",
"$",
"type",... | get type value parses the mysql type and returns
@param $type string
@param bool|string $type_cast string
@return string | [
"get",
"type",
"value",
"parses",
"the",
"mysql",
"type",
"and",
"returns"
] | 8df7f12e75d75d3fd2197a58c80d39cbb4b9ff12 | https://github.com/chilimatic/chilimatic-framework/blob/8df7f12e75d75d3fd2197a58c80d39cbb4b9ff12/lib/cgenerator/Mysql.php#L118-L176 |
203,909 | chilimatic/chilimatic-framework | lib/cgenerator/Mysql.php | Mysql.generate_primary_key_statement | public function generate_primary_key_statement()
{
if (empty($this->primary_key)) return false;
if (count($this->primary_key) == 1) {
$this->tpl_replacements['primary_key_assign_statement'] = "'{$this->primary_key[0]}'";
$this->tpl_replacements['primary_key_if_statement'] ... | php | public function generate_primary_key_statement()
{
if (empty($this->primary_key)) return false;
if (count($this->primary_key) == 1) {
$this->tpl_replacements['primary_key_assign_statement'] = "'{$this->primary_key[0]}'";
$this->tpl_replacements['primary_key_if_statement'] ... | [
"public",
"function",
"generate_primary_key_statement",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"primary_key",
")",
")",
"return",
"false",
";",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"primary_key",
")",
"==",
"1",
")",
"{",
"$"... | generates the primary key statement
@return bool | [
"generates",
"the",
"primary",
"key",
"statement"
] | 8df7f12e75d75d3fd2197a58c80d39cbb4b9ff12 | https://github.com/chilimatic/chilimatic-framework/blob/8df7f12e75d75d3fd2197a58c80d39cbb4b9ff12/lib/cgenerator/Mysql.php#L183-L210 |
203,910 | RadialCorp/magento-core | src/app/code/community/Radial/Amqp/Helper/Config.php | Radial_Amqp_Helper_Config.getQueueConfigurationScopes | public function getQueueConfigurationScopes()
{
// cache of seen, unique AMQP configurations
$configurations = array();
// list of stores to produce unique AMQP configuration
$uniqueStores = array();
foreach (Mage::app()->getStores(true) as $store) {
$amqpConfig =... | php | public function getQueueConfigurationScopes()
{
// cache of seen, unique AMQP configurations
$configurations = array();
// list of stores to produce unique AMQP configuration
$uniqueStores = array();
foreach (Mage::app()->getStores(true) as $store) {
$amqpConfig =... | [
"public",
"function",
"getQueueConfigurationScopes",
"(",
")",
"{",
"// cache of seen, unique AMQP configurations",
"$",
"configurations",
"=",
"array",
"(",
")",
";",
"// list of stores to produce unique AMQP configuration",
"$",
"uniqueStores",
"=",
"array",
"(",
")",
";"... | Get an array of stores with unique AMQP configuration.
@return Mage_Core_Model_Store[] | [
"Get",
"an",
"array",
"of",
"stores",
"with",
"unique",
"AMQP",
"configuration",
"."
] | 9bb5f218d9caf79eab8598f4f8447037a0cc6355 | https://github.com/RadialCorp/magento-core/blob/9bb5f218d9caf79eab8598f4f8447037a0cc6355/src/app/code/community/Radial/Amqp/Helper/Config.php#L58-L72 |
203,911 | RadialCorp/magento-core | src/app/code/community/Radial/Amqp/Helper/Config.php | Radial_Amqp_Helper_Config.updateLastTimestamp | public function updateLastTimestamp(ITestMessage $payload, Mage_Core_Model_Store $store)
{
list($scope, $scopeId) = $this->getScopeForStoreSettings($store);
return Mage::getModel('core/config_data')
->addData(array(
'path' => $this->_amqpConfigMap->getPathForKey('last_tes... | php | public function updateLastTimestamp(ITestMessage $payload, Mage_Core_Model_Store $store)
{
list($scope, $scopeId) = $this->getScopeForStoreSettings($store);
return Mage::getModel('core/config_data')
->addData(array(
'path' => $this->_amqpConfigMap->getPathForKey('last_tes... | [
"public",
"function",
"updateLastTimestamp",
"(",
"ITestMessage",
"$",
"payload",
",",
"Mage_Core_Model_Store",
"$",
"store",
")",
"{",
"list",
"(",
"$",
"scope",
",",
"$",
"scopeId",
")",
"=",
"$",
"this",
"->",
"getScopeForStoreSettings",
"(",
"$",
"store",
... | Update the core_config_data setting for timestamp from the last test
message received. Value should be saved in the most appropriate scope for
the store being processed. E.g. if the store is the default store, or has
the same AMQP configuration as the default store, the timestamp should be
updated in the default scope.... | [
"Update",
"the",
"core_config_data",
"setting",
"for",
"timestamp",
"from",
"the",
"last",
"test",
"message",
"received",
".",
"Value",
"should",
"be",
"saved",
"in",
"the",
"most",
"appropriate",
"scope",
"for",
"the",
"store",
"being",
"processed",
".",
"E",... | 9bb5f218d9caf79eab8598f4f8447037a0cc6355 | https://github.com/RadialCorp/magento-core/blob/9bb5f218d9caf79eab8598f4f8447037a0cc6355/src/app/code/community/Radial/Amqp/Helper/Config.php#L123-L134 |
203,912 | romaricdrigon/OrchestraBundle | Controller/GenericController.php | GenericController.listAction | public function listAction(RepositoryDefinitionInterface $repository_definition, RepositoryInterface $repository, EntityReflectionInterface $entity)
{
$name = $this->get('orchestra.resolver.repository_name')->getName($repository_definition);
if (false === $entity->isListable()) {
throw ... | php | public function listAction(RepositoryDefinitionInterface $repository_definition, RepositoryInterface $repository, EntityReflectionInterface $entity)
{
$name = $this->get('orchestra.resolver.repository_name')->getName($repository_definition);
if (false === $entity->isListable()) {
throw ... | [
"public",
"function",
"listAction",
"(",
"RepositoryDefinitionInterface",
"$",
"repository_definition",
",",
"RepositoryInterface",
"$",
"repository",
",",
"EntityReflectionInterface",
"$",
"entity",
")",
"{",
"$",
"name",
"=",
"$",
"this",
"->",
"get",
"(",
"'orche... | Action used when a repository "listing" is called
@param RepositoryDefinitionInterface $repository_definition
@param RepositoryInterface $repository
@param EntityReflectionInterface $entity
@throws DomainErrorException
@return \Symfony\Component\HttpFoundation\Response | [
"Action",
"used",
"when",
"a",
"repository",
"listing",
"is",
"called"
] | 4abb9736fcb6b23ed08ebd14ab169867339a4785 | https://github.com/romaricdrigon/OrchestraBundle/blob/4abb9736fcb6b23ed08ebd14ab169867339a4785/Controller/GenericController.php#L52-L82 |
203,913 | romaricdrigon/OrchestraBundle | Controller/GenericController.php | GenericController.repositoryQueryAction | public function repositoryQueryAction(RepositoryDefinitionInterface $repository_definition, RepositoryInterface $repository, EntityReflectionInterface $entity, $repository_method)
{
return $this->render('RomaricDrigonOrchestraBundle:Generic:dashboard.html.twig', []);
} | php | public function repositoryQueryAction(RepositoryDefinitionInterface $repository_definition, RepositoryInterface $repository, EntityReflectionInterface $entity, $repository_method)
{
return $this->render('RomaricDrigonOrchestraBundle:Generic:dashboard.html.twig', []);
} | [
"public",
"function",
"repositoryQueryAction",
"(",
"RepositoryDefinitionInterface",
"$",
"repository_definition",
",",
"RepositoryInterface",
"$",
"repository",
",",
"EntityReflectionInterface",
"$",
"entity",
",",
"$",
"repository_method",
")",
"{",
"return",
"$",
"this... | Action used when a method on en Repository is called
@param RepositoryDefinitionInterface $repository_definition
@param RepositoryInterface $repository
@param EntityReflectionInterface $entity
@param string $repository_method
@return \Symfony\Component\HttpFoundation\Response | [
"Action",
"used",
"when",
"a",
"method",
"on",
"en",
"Repository",
"is",
"called"
] | 4abb9736fcb6b23ed08ebd14ab169867339a4785 | https://github.com/romaricdrigon/OrchestraBundle/blob/4abb9736fcb6b23ed08ebd14ab169867339a4785/Controller/GenericController.php#L108-L111 |
203,914 | romaricdrigon/OrchestraBundle | Controller/GenericController.php | GenericController.repositoryCommandAction | public function repositoryCommandAction(Request $request, RepositoryDefinitionInterface $repository_definition, RepositoryInterface $repository, $repository_method, CommandInterface $command)
{
$form = $this->createForm('orchestra_command_type', $command, [
'command' => $command
]);
... | php | public function repositoryCommandAction(Request $request, RepositoryDefinitionInterface $repository_definition, RepositoryInterface $repository, $repository_method, CommandInterface $command)
{
$form = $this->createForm('orchestra_command_type', $command, [
'command' => $command
]);
... | [
"public",
"function",
"repositoryCommandAction",
"(",
"Request",
"$",
"request",
",",
"RepositoryDefinitionInterface",
"$",
"repository_definition",
",",
"RepositoryInterface",
"$",
"repository",
",",
"$",
"repository_method",
",",
"CommandInterface",
"$",
"command",
")",... | Action used when a method accepting a Command, on en Repository is called
@param Request $request
@param RepositoryDefinitionInterface $repository_definition
@param RepositoryInterface $repository
@param string $repository_method
@param CommandInterface $command
@return \Symfony\Component\HttpFoundation\Response | [
"Action",
"used",
"when",
"a",
"method",
"accepting",
"a",
"Command",
"on",
"en",
"Repository",
"is",
"called"
] | 4abb9736fcb6b23ed08ebd14ab169867339a4785 | https://github.com/romaricdrigon/OrchestraBundle/blob/4abb9736fcb6b23ed08ebd14ab169867339a4785/Controller/GenericController.php#L123-L157 |
203,915 | romaricdrigon/OrchestraBundle | Controller/GenericController.php | GenericController.entityCommandAction | public function entityCommandAction(Request $request, CommandInterface $command, EntityReflectionInterface $entity, $entity_method, EntityInterface $object = null)
{
if (null === $object) {
throw new NotFoundHttpException();
}
$form = $this->createForm('orchestra_command_type', ... | php | public function entityCommandAction(Request $request, CommandInterface $command, EntityReflectionInterface $entity, $entity_method, EntityInterface $object = null)
{
if (null === $object) {
throw new NotFoundHttpException();
}
$form = $this->createForm('orchestra_command_type', ... | [
"public",
"function",
"entityCommandAction",
"(",
"Request",
"$",
"request",
",",
"CommandInterface",
"$",
"command",
",",
"EntityReflectionInterface",
"$",
"entity",
",",
"$",
"entity_method",
",",
"EntityInterface",
"$",
"object",
"=",
"null",
")",
"{",
"if",
... | Action used when a method accepting a Command, on en Entity is called
@param Request $request
@param CommandInterface $command
@param EntityReflectionInterface $entity
@param string $entity_method
@param EntityInterface $object
@throws NotFoundHttpException
@return \Symfony\Component\HttpFoundation\Response | [
"Action",
"used",
"when",
"a",
"method",
"accepting",
"a",
"Command",
"on",
"en",
"Entity",
"is",
"called"
] | 4abb9736fcb6b23ed08ebd14ab169867339a4785 | https://github.com/romaricdrigon/OrchestraBundle/blob/4abb9736fcb6b23ed08ebd14ab169867339a4785/Controller/GenericController.php#L170-L205 |
203,916 | romaricdrigon/OrchestraBundle | Controller/GenericController.php | GenericController.entityEventAction | public function entityEventAction(EntityReflectionInterface $entity, $entity_method, EntityInterface $object = null, RepositoryDefinitionInterface $repository_definition, RepositoryInterface $repository)
{
if (null === $object) {
throw new NotFoundHttpException();
}
// Get the E... | php | public function entityEventAction(EntityReflectionInterface $entity, $entity_method, EntityInterface $object = null, RepositoryDefinitionInterface $repository_definition, RepositoryInterface $repository)
{
if (null === $object) {
throw new NotFoundHttpException();
}
// Get the E... | [
"public",
"function",
"entityEventAction",
"(",
"EntityReflectionInterface",
"$",
"entity",
",",
"$",
"entity_method",
",",
"EntityInterface",
"$",
"object",
"=",
"null",
",",
"RepositoryDefinitionInterface",
"$",
"repository_definition",
",",
"RepositoryInterface",
"$",
... | Action used when a method with a "EmitEvent" annotations is called
@param EntityReflectionInterface $entity
@param string $entity_method
@param EntityInterface $object
@param RepositoryDefinitionInterface $repository_definition
@param RepositoryInterface $repository
@throws DomainErrorException
@throws NotFoundHttpExc... | [
"Action",
"used",
"when",
"a",
"method",
"with",
"a",
"EmitEvent",
"annotations",
"is",
"called"
] | 4abb9736fcb6b23ed08ebd14ab169867339a4785 | https://github.com/romaricdrigon/OrchestraBundle/blob/4abb9736fcb6b23ed08ebd14ab169867339a4785/Controller/GenericController.php#L219-L250 |
203,917 | antaresproject/sample_module | src/Http/Form/Configuration.php | Configuration.controlsFieldset | protected function controlsFieldset()
{
return $this->grid->fieldset(function (Fieldset $fieldset) {
$fieldset->legend('Sample Module Configuration');
$fieldset->control('input:text', 'name')
->label(trans('antares/sample_module::messages.... | php | protected function controlsFieldset()
{
return $this->grid->fieldset(function (Fieldset $fieldset) {
$fieldset->legend('Sample Module Configuration');
$fieldset->control('input:text', 'name')
->label(trans('antares/sample_module::messages.... | [
"protected",
"function",
"controlsFieldset",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"grid",
"->",
"fieldset",
"(",
"function",
"(",
"Fieldset",
"$",
"fieldset",
")",
"{",
"$",
"fieldset",
"->",
"legend",
"(",
"'Sample Module Configuration'",
")",
";",
"... | creates main controls fieldset
@return \Antares\Html\Form\Fieldset | [
"creates",
"main",
"controls",
"fieldset"
] | aceab14f392c25e32729018518e9d6b4e6fe23db | https://github.com/antaresproject/sample_module/blob/aceab14f392c25e32729018518e9d6b4e6fe23db/src/Http/Form/Configuration.php#L58-L113 |
203,918 | luoxiaojun1992/lb_framework | components/helpers/FileHelper.php | FileHelper.send | public static function send($filePath, $remoteFileSystem)
{
return (new Client())->put($remoteFileSystem, ['body' => fopen($filePath, self::READ_BINARY)])
->getStatusCode() == HttpHelper::STATUS_OK;
} | php | public static function send($filePath, $remoteFileSystem)
{
return (new Client())->put($remoteFileSystem, ['body' => fopen($filePath, self::READ_BINARY)])
->getStatusCode() == HttpHelper::STATUS_OK;
} | [
"public",
"static",
"function",
"send",
"(",
"$",
"filePath",
",",
"$",
"remoteFileSystem",
")",
"{",
"return",
"(",
"new",
"Client",
"(",
")",
")",
"->",
"put",
"(",
"$",
"remoteFileSystem",
",",
"[",
"'body'",
"=>",
"fopen",
"(",
"$",
"filePath",
","... | Send a file
@param $filePath
@param $remoteFileSystem
@return bool | [
"Send",
"a",
"file"
] | 12a865729e7738d7d1e07371ad7203243c4571fa | https://github.com/luoxiaojun1992/lb_framework/blob/12a865729e7738d7d1e07371ad7203243c4571fa/components/helpers/FileHelper.php#L183-L187 |
203,919 | luoxiaojun1992/lb_framework | components/helpers/FileHelper.php | FileHelper.receive | public static function receive($savePath, RequestContract $request = null)
{
file_put_contents($savePath, $request ? $request->getRawContent() : RequestKit::getRawContent());
} | php | public static function receive($savePath, RequestContract $request = null)
{
file_put_contents($savePath, $request ? $request->getRawContent() : RequestKit::getRawContent());
} | [
"public",
"static",
"function",
"receive",
"(",
"$",
"savePath",
",",
"RequestContract",
"$",
"request",
"=",
"null",
")",
"{",
"file_put_contents",
"(",
"$",
"savePath",
",",
"$",
"request",
"?",
"$",
"request",
"->",
"getRawContent",
"(",
")",
":",
"Requ... | Receive a file
@param $savePath
@param RequestContract|null $request | [
"Receive",
"a",
"file"
] | 12a865729e7738d7d1e07371ad7203243c4571fa | https://github.com/luoxiaojun1992/lb_framework/blob/12a865729e7738d7d1e07371ad7203243c4571fa/components/helpers/FileHelper.php#L195-L198 |
203,920 | luoxiaojun1992/lb_framework | components/helpers/FileHelper.php | FileHelper.copy | public static function copy($src, $dst, $context = null)
{
return self::resourceExists($src) ? copy($src, $dst, $context) : false;
} | php | public static function copy($src, $dst, $context = null)
{
return self::resourceExists($src) ? copy($src, $dst, $context) : false;
} | [
"public",
"static",
"function",
"copy",
"(",
"$",
"src",
",",
"$",
"dst",
",",
"$",
"context",
"=",
"null",
")",
"{",
"return",
"self",
"::",
"resourceExists",
"(",
"$",
"src",
")",
"?",
"copy",
"(",
"$",
"src",
",",
"$",
"dst",
",",
"$",
"contex... | Copy a file or a directory
@param $src
@param $dst
@param null $context
@return bool | [
"Copy",
"a",
"file",
"or",
"a",
"directory"
] | 12a865729e7738d7d1e07371ad7203243c4571fa | https://github.com/luoxiaojun1992/lb_framework/blob/12a865729e7738d7d1e07371ad7203243c4571fa/components/helpers/FileHelper.php#L208-L211 |
203,921 | luoxiaojun1992/lb_framework | components/helpers/FileHelper.php | FileHelper.move | public static function move($oldName, $newName, $context = null)
{
return self::rename($oldName, $newName, $context);
} | php | public static function move($oldName, $newName, $context = null)
{
return self::rename($oldName, $newName, $context);
} | [
"public",
"static",
"function",
"move",
"(",
"$",
"oldName",
",",
"$",
"newName",
",",
"$",
"context",
"=",
"null",
")",
"{",
"return",
"self",
"::",
"rename",
"(",
"$",
"oldName",
",",
"$",
"newName",
",",
"$",
"context",
")",
";",
"}"
] | Move a file or a directory
@param $oldName
@param $newName
@param null $context
@return bool | [
"Move",
"a",
"file",
"or",
"a",
"directory"
] | 12a865729e7738d7d1e07371ad7203243c4571fa | https://github.com/luoxiaojun1992/lb_framework/blob/12a865729e7738d7d1e07371ad7203243c4571fa/components/helpers/FileHelper.php#L221-L224 |
203,922 | luoxiaojun1992/lb_framework | components/helpers/FileHelper.php | FileHelper.rename | public static function rename($oldName, $newName, $context = null)
{
return self::resourceExists($oldName) ? rename($oldName, $newName, $context) : false;
} | php | public static function rename($oldName, $newName, $context = null)
{
return self::resourceExists($oldName) ? rename($oldName, $newName, $context) : false;
} | [
"public",
"static",
"function",
"rename",
"(",
"$",
"oldName",
",",
"$",
"newName",
",",
"$",
"context",
"=",
"null",
")",
"{",
"return",
"self",
"::",
"resourceExists",
"(",
"$",
"oldName",
")",
"?",
"rename",
"(",
"$",
"oldName",
",",
"$",
"newName",... | Rename a file or a directory
@param $oldName
@param $newName
@param null $context
@return bool | [
"Rename",
"a",
"file",
"or",
"a",
"directory"
] | 12a865729e7738d7d1e07371ad7203243c4571fa | https://github.com/luoxiaojun1992/lb_framework/blob/12a865729e7738d7d1e07371ad7203243c4571fa/components/helpers/FileHelper.php#L234-L237 |
203,923 | as3io/modlr | src/Events/EventDispatcher.php | EventDispatcher.getListeners | protected function getListeners($eventName)
{
if (isset($this->listeners[$eventName])) {
return $this->listeners[$eventName];
}
return null;
} | php | protected function getListeners($eventName)
{
if (isset($this->listeners[$eventName])) {
return $this->listeners[$eventName];
}
return null;
} | [
"protected",
"function",
"getListeners",
"(",
"$",
"eventName",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"listeners",
"[",
"$",
"eventName",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"listeners",
"[",
"$",
"eventName",
"]",
";",
"... | Gets all registered listeners for an event name.
@param string $eventName
@return array|null | [
"Gets",
"all",
"registered",
"listeners",
"for",
"an",
"event",
"name",
"."
] | 7e684b88bb22a2e18397df9402075c6533084b16 | https://github.com/as3io/modlr/blob/7e684b88bb22a2e18397df9402075c6533084b16/src/Events/EventDispatcher.php#L91-L97 |
203,924 | inhere/php-library-plus | libs/Log/AbstractLogger.php | AbstractLogger.log | public function log($level, $message, array $context = array())
{
$level = static::toNumberLevel($level);
return $this->addRecord($level, $message, $context);
} | php | public function log($level, $message, array $context = array())
{
$level = static::toNumberLevel($level);
return $this->addRecord($level, $message, $context);
} | [
"public",
"function",
"log",
"(",
"$",
"level",
",",
"$",
"message",
",",
"array",
"$",
"context",
"=",
"array",
"(",
")",
")",
"{",
"$",
"level",
"=",
"static",
"::",
"toNumberLevel",
"(",
"$",
"level",
")",
";",
"return",
"$",
"this",
"->",
"addR... | Adds a log record at an arbitrary level.
This method allows for compatibility with common interfaces.
@param int|string $level The log level
@param string $message The log message
@param array $context The log context
@return Boolean Whether the record has been processed | [
"Adds",
"a",
"log",
"record",
"at",
"an",
"arbitrary",
"level",
".",
"This",
"method",
"allows",
"for",
"compatibility",
"with",
"common",
"interfaces",
"."
] | 8604e037937d31fa2338d79aaf9d0910cb48f559 | https://github.com/inhere/php-library-plus/blob/8604e037937d31fa2338d79aaf9d0910cb48f559/libs/Log/AbstractLogger.php#L202-L207 |
203,925 | amarcinkowski/hospitalplugin | src/utils/Utils.php | Utils.diffDates | public static function diffDates($date1, $date2)
{
$ts1 = strtotime($date1);
$ts2 = strtotime($date2);
$seconds_diff = $ts2 - $ts1;
return floor($seconds_diff / 3600 / 24);
} | php | public static function diffDates($date1, $date2)
{
$ts1 = strtotime($date1);
$ts2 = strtotime($date2);
$seconds_diff = $ts2 - $ts1;
return floor($seconds_diff / 3600 / 24);
} | [
"public",
"static",
"function",
"diffDates",
"(",
"$",
"date1",
",",
"$",
"date2",
")",
"{",
"$",
"ts1",
"=",
"strtotime",
"(",
"$",
"date1",
")",
";",
"$",
"ts2",
"=",
"strtotime",
"(",
"$",
"date2",
")",
";",
"$",
"seconds_diff",
"=",
"$",
"ts2",... | diff in days
@param $date1 $date1 string parsable date strtotime(date)
@param $date2 $date2 string parsable date strtotime(date)
@return number | [
"diff",
"in",
"days"
] | acdc2be5157abfbdcafb4dcf6c6ba505e291263f | https://github.com/amarcinkowski/hospitalplugin/blob/acdc2be5157abfbdcafb4dcf6c6ba505e291263f/src/utils/Utils.php#L49-L57 |
203,926 | amarcinkowski/hospitalplugin | src/utils/Utils.php | Utils.readFileToArray | public static function readFileToArray($url, $delm = ";", $encl = "\"", $head = false)
{
$csvxrow = file($url); // ---- csv rows to array ----
$csvxrow[0] = chop($csvxrow[0]);
$csvxrow[0] = str_replace($encl, '', $csvxrow[0]);
$keydata = explode($delm, $csvxrow[0]);
... | php | public static function readFileToArray($url, $delm = ";", $encl = "\"", $head = false)
{
$csvxrow = file($url); // ---- csv rows to array ----
$csvxrow[0] = chop($csvxrow[0]);
$csvxrow[0] = str_replace($encl, '', $csvxrow[0]);
$keydata = explode($delm, $csvxrow[0]);
... | [
"public",
"static",
"function",
"readFileToArray",
"(",
"$",
"url",
",",
"$",
"delm",
"=",
"\";\"",
",",
"$",
"encl",
"=",
"\"\\\"\"",
",",
"$",
"head",
"=",
"false",
")",
"{",
"$",
"csvxrow",
"=",
"file",
"(",
"$",
"url",
")",
";",
"// ---- csv rows... | read file to array
@param $url file url
@param $delm default ;
@param $encl default \
@param $head default false
@return array of strings | [
"read",
"file",
"to",
"array"
] | acdc2be5157abfbdcafb4dcf6c6ba505e291263f | https://github.com/amarcinkowski/hospitalplugin/blob/acdc2be5157abfbdcafb4dcf6c6ba505e291263f/src/utils/Utils.php#L225-L263 |
203,927 | amarcinkowski/hospitalplugin | src/utils/Utils.php | Utils.w1250_to_utf8 | public static function w1250_to_utf8($text)
{
// map based on:
// http://konfiguracja.c0.pl/iso02vscp1250en.html
// http://konfiguracja.c0.pl/webpl/index_en.html#examp
// http://www.htmlentities.com/html/entities/
$map = array(
chr(0x8A) => chr(0xA9),
... | php | public static function w1250_to_utf8($text)
{
// map based on:
// http://konfiguracja.c0.pl/iso02vscp1250en.html
// http://konfiguracja.c0.pl/webpl/index_en.html#examp
// http://www.htmlentities.com/html/entities/
$map = array(
chr(0x8A) => chr(0xA9),
... | [
"public",
"static",
"function",
"w1250_to_utf8",
"(",
"$",
"text",
")",
"{",
"// map based on:",
"// http://konfiguracja.c0.pl/iso02vscp1250en.html",
"// http://konfiguracja.c0.pl/webpl/index_en.html#examp",
"// http://www.htmlentities.com/html/entities/",
"$",
"map",
"=",
"array",
... | PL chars conv iso8859-2 => win1250 => utf8
@param text string with PL chars
@return string encoded | [
"PL",
"chars",
"conv",
"iso8859",
"-",
"2",
"=",
">",
"win1250",
"=",
">",
"utf8"
] | acdc2be5157abfbdcafb4dcf6c6ba505e291263f | https://github.com/amarcinkowski/hospitalplugin/blob/acdc2be5157abfbdcafb4dcf6c6ba505e291263f/src/utils/Utils.php#L271-L336 |
203,928 | thelia-modules/SmartyFilter | Model/Base/SmartyFilterQuery.php | SmartyFilterQuery.create | public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \SmartyFilter\Model\SmartyFilterQuery) {
return $criteria;
}
$query = new \SmartyFilter\Model\SmartyFilterQuery();
if (null !== $modelAlias) {
$query->setModelAlias(... | php | public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \SmartyFilter\Model\SmartyFilterQuery) {
return $criteria;
}
$query = new \SmartyFilter\Model\SmartyFilterQuery();
if (null !== $modelAlias) {
$query->setModelAlias(... | [
"public",
"static",
"function",
"create",
"(",
"$",
"modelAlias",
"=",
"null",
",",
"$",
"criteria",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"criteria",
"instanceof",
"\\",
"SmartyFilter",
"\\",
"Model",
"\\",
"SmartyFilterQuery",
")",
"{",
"return",
"$",
... | Returns a new ChildSmartyFilterQuery object.
@param string $modelAlias The alias of a model in the query
@param Criteria $criteria Optional Criteria to build the query from
@return ChildSmartyFilterQuery | [
"Returns",
"a",
"new",
"ChildSmartyFilterQuery",
"object",
"."
] | e510d281f51ddc4344e563d0f6aaa192fa7171e9 | https://github.com/thelia-modules/SmartyFilter/blob/e510d281f51ddc4344e563d0f6aaa192fa7171e9/Model/Base/SmartyFilterQuery.php#L80-L94 |
203,929 | thelia-modules/SmartyFilter | Model/Base/SmartyFilterQuery.php | SmartyFilterQuery.filterByActive | public function filterByActive($active = null, $comparison = null)
{
if (is_array($active)) {
$useMinMax = false;
if (isset($active['min'])) {
$this->addUsingAlias(SmartyFilterTableMap::ACTIVE, $active['min'], Criteria::GREATER_EQUAL);
$useMinMax = tru... | php | public function filterByActive($active = null, $comparison = null)
{
if (is_array($active)) {
$useMinMax = false;
if (isset($active['min'])) {
$this->addUsingAlias(SmartyFilterTableMap::ACTIVE, $active['min'], Criteria::GREATER_EQUAL);
$useMinMax = tru... | [
"public",
"function",
"filterByActive",
"(",
"$",
"active",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"active",
")",
")",
"{",
"$",
"useMinMax",
"=",
"false",
";",
"if",
"(",
"isset",
"(",
"$",
"ac... | Filter the query on the active column
Example usage:
<code>
$query->filterByActive(1234); // WHERE active = 1234
$query->filterByActive(array(12, 34)); // WHERE active IN (12, 34)
$query->filterByActive(array('min' => 12)); // WHERE active > 12
</code>
@param mixed $active The value to use as filter.
Use scalar v... | [
"Filter",
"the",
"query",
"on",
"the",
"active",
"column"
] | e510d281f51ddc4344e563d0f6aaa192fa7171e9 | https://github.com/thelia-modules/SmartyFilter/blob/e510d281f51ddc4344e563d0f6aaa192fa7171e9/Model/Base/SmartyFilterQuery.php#L289-L310 |
203,930 | thelia-modules/SmartyFilter | Model/Base/SmartyFilterQuery.php | SmartyFilterQuery.filterByFiltertype | public function filterByFiltertype($filtertype = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($filtertype)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $filtertype)) {
$filtertype = str_replace('*', '%', $filt... | php | public function filterByFiltertype($filtertype = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($filtertype)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $filtertype)) {
$filtertype = str_replace('*', '%', $filt... | [
"public",
"function",
"filterByFiltertype",
"(",
"$",
"filtertype",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"filtertype",
")",
")",
"{",
"$",
... | Filter the query on the filtertype column
Example usage:
<code>
$query->filterByFiltertype('fooValue'); // WHERE filtertype = 'fooValue'
$query->filterByFiltertype('%fooValue%'); // WHERE filtertype LIKE '%fooValue%'
</code>
@param string $filtertype The value to use as filter.
Accepts wildcards (* and % trigge... | [
"Filter",
"the",
"query",
"on",
"the",
"filtertype",
"column"
] | e510d281f51ddc4344e563d0f6aaa192fa7171e9 | https://github.com/thelia-modules/SmartyFilter/blob/e510d281f51ddc4344e563d0f6aaa192fa7171e9/Model/Base/SmartyFilterQuery.php#L327-L339 |
203,931 | thelia-modules/SmartyFilter | Model/Base/SmartyFilterQuery.php | SmartyFilterQuery.filterBySmartyFilterI18n | public function filterBySmartyFilterI18n($smartyFilterI18n, $comparison = null)
{
if ($smartyFilterI18n instanceof \SmartyFilter\Model\SmartyFilterI18n) {
return $this
->addUsingAlias(SmartyFilterTableMap::ID, $smartyFilterI18n->getId(), $comparison);
} elseif ($smartyFil... | php | public function filterBySmartyFilterI18n($smartyFilterI18n, $comparison = null)
{
if ($smartyFilterI18n instanceof \SmartyFilter\Model\SmartyFilterI18n) {
return $this
->addUsingAlias(SmartyFilterTableMap::ID, $smartyFilterI18n->getId(), $comparison);
} elseif ($smartyFil... | [
"public",
"function",
"filterBySmartyFilterI18n",
"(",
"$",
"smartyFilterI18n",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"smartyFilterI18n",
"instanceof",
"\\",
"SmartyFilter",
"\\",
"Model",
"\\",
"SmartyFilterI18n",
")",
"{",
"return",
"$... | Filter the query by a related \SmartyFilter\Model\SmartyFilterI18n object
@param \SmartyFilter\Model\SmartyFilterI18n|ObjectCollection $smartyFilterI18n the related object to use as filter
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return ChildSmartyFilterQuery ... | [
"Filter",
"the",
"query",
"by",
"a",
"related",
"\\",
"SmartyFilter",
"\\",
"Model",
"\\",
"SmartyFilterI18n",
"object"
] | e510d281f51ddc4344e563d0f6aaa192fa7171e9 | https://github.com/thelia-modules/SmartyFilter/blob/e510d281f51ddc4344e563d0f6aaa192fa7171e9/Model/Base/SmartyFilterQuery.php#L378-L391 |
203,932 | thelia-modules/SmartyFilter | Model/Base/SmartyFilterQuery.php | SmartyFilterQuery.useSmartyFilterI18nQuery | public function useSmartyFilterI18nQuery($relationAlias = null, $joinType = 'LEFT JOIN')
{
return $this
->joinSmartyFilterI18n($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'SmartyFilterI18n', '\SmartyFilter\Model\SmartyFilterI18nQuery');
} | php | public function useSmartyFilterI18nQuery($relationAlias = null, $joinType = 'LEFT JOIN')
{
return $this
->joinSmartyFilterI18n($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'SmartyFilterI18n', '\SmartyFilter\Model\SmartyFilterI18nQuery');
} | [
"public",
"function",
"useSmartyFilterI18nQuery",
"(",
"$",
"relationAlias",
"=",
"null",
",",
"$",
"joinType",
"=",
"'LEFT JOIN'",
")",
"{",
"return",
"$",
"this",
"->",
"joinSmartyFilterI18n",
"(",
"$",
"relationAlias",
",",
"$",
"joinType",
")",
"->",
"useQ... | Use the SmartyFilterI18n relation SmartyFilterI18n object
@see useQuery()
@param string $relationAlias optional alias for the relation,
to be used as main alias in the secondary query
@param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
@return \SmartyFilter\Model\Smart... | [
"Use",
"the",
"SmartyFilterI18n",
"relation",
"SmartyFilterI18n",
"object"
] | e510d281f51ddc4344e563d0f6aaa192fa7171e9 | https://github.com/thelia-modules/SmartyFilter/blob/e510d281f51ddc4344e563d0f6aaa192fa7171e9/Model/Base/SmartyFilterQuery.php#L436-L441 |
203,933 | SpoonX/SxBootstrap | src/SxBootstrap/View/Helper/Bootstrap/NavigationMenu.php | NavigationMenu.renderDropDownMenu | public function renderDropDownMenu($container = null, array $options = array())
{
$menu = $this->getNavigationMenu()->renderMenu($container, $options);
$query = new Query($menu, strtolower(mb_detect_encoding($menu)));
$uls = $query->execute('li>ul');
/** @var \DOMElement $ul */
... | php | public function renderDropDownMenu($container = null, array $options = array())
{
$menu = $this->getNavigationMenu()->renderMenu($container, $options);
$query = new Query($menu, strtolower(mb_detect_encoding($menu)));
$uls = $query->execute('li>ul');
/** @var \DOMElement $ul */
... | [
"public",
"function",
"renderDropDownMenu",
"(",
"$",
"container",
"=",
"null",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"menu",
"=",
"$",
"this",
"->",
"getNavigationMenu",
"(",
")",
"->",
"renderMenu",
"(",
"$",
"container",... | Render a dropdown menu
@param string|\SpiffyNavigation\Container|null $container
@param array $options
@return string | [
"Render",
"a",
"dropdown",
"menu"
] | 768b02e3b65f7dfe560e821cb0ff41ad3f86b3b6 | https://github.com/SpoonX/SxBootstrap/blob/768b02e3b65f7dfe560e821cb0ff41ad3f86b3b6/src/SxBootstrap/View/Helper/Bootstrap/NavigationMenu.php#L37-L66 |
203,934 | SpoonX/SxBootstrap | src/SxBootstrap/View/Helper/Bootstrap/NavigationMenu.php | NavigationMenu.addCss | protected function addCss($css, \DOMElement $el)
{
$el->setAttribute(
'class',
$el->getAttribute('class')
? $el->getAttribute('class') . ' ' . $css
: $css
);
return $el;
} | php | protected function addCss($css, \DOMElement $el)
{
$el->setAttribute(
'class',
$el->getAttribute('class')
? $el->getAttribute('class') . ' ' . $css
: $css
);
return $el;
} | [
"protected",
"function",
"addCss",
"(",
"$",
"css",
",",
"\\",
"DOMElement",
"$",
"el",
")",
"{",
"$",
"el",
"->",
"setAttribute",
"(",
"'class'",
",",
"$",
"el",
"->",
"getAttribute",
"(",
"'class'",
")",
"?",
"$",
"el",
"->",
"getAttribute",
"(",
"... | Add css to a DomElement
@param $css
@param \DOMElement $el
@return \DOMElement | [
"Add",
"css",
"to",
"a",
"DomElement"
] | 768b02e3b65f7dfe560e821cb0ff41ad3f86b3b6 | https://github.com/SpoonX/SxBootstrap/blob/768b02e3b65f7dfe560e821cb0ff41ad3f86b3b6/src/SxBootstrap/View/Helper/Bootstrap/NavigationMenu.php#L75-L85 |
203,935 | Nextpertise/PdoBulk | src/PdoBulk/PdoBulk.php | PdoBulk.flushQueue | public function flushQueue($table, $onduplicate = null) {
if (gettype($table) != 'string') {
throw new Exception('First parameter should be string, ' . gettype($table) . ' given.');
}
if (isset($this->queue[$table]) && $this->queue[$table]) {
// Define query
$query = "INSERT INTO `" . $table . "` (`" . i... | php | public function flushQueue($table, $onduplicate = null) {
if (gettype($table) != 'string') {
throw new Exception('First parameter should be string, ' . gettype($table) . ' given.');
}
if (isset($this->queue[$table]) && $this->queue[$table]) {
// Define query
$query = "INSERT INTO `" . $table . "` (`" . i... | [
"public",
"function",
"flushQueue",
"(",
"$",
"table",
",",
"$",
"onduplicate",
"=",
"null",
")",
"{",
"if",
"(",
"gettype",
"(",
"$",
"table",
")",
"!=",
"'string'",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'First parameter should be string, '",
".",
... | Bulk insert logic | [
"Bulk",
"insert",
"logic"
] | 21426f998fe292c11c356e75ffa6f716e2c507c7 | https://github.com/Nextpertise/PdoBulk/blob/21426f998fe292c11c356e75ffa6f716e2c507c7/src/PdoBulk/PdoBulk.php#L31-L81 |
203,936 | chilimatic/chilimatic-framework | lib/cache/engine/Memcached.php | Memcached.deleteFromList | public function deleteFromList($key_array = array())
{
if (empty($key_array)) return false;
foreach ($key_array as $key_del) {
if (empty($this->cacheListing)) break;
foreach ($this->cacheListing as $key) {
if (mb_strpos(mb_strtolower($key), mb_strtolower($ke... | php | public function deleteFromList($key_array = array())
{
if (empty($key_array)) return false;
foreach ($key_array as $key_del) {
if (empty($this->cacheListing)) break;
foreach ($this->cacheListing as $key) {
if (mb_strpos(mb_strtolower($key), mb_strtolower($ke... | [
"public",
"function",
"deleteFromList",
"(",
"$",
"key_array",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"key_array",
")",
")",
"return",
"false",
";",
"foreach",
"(",
"$",
"key_array",
"as",
"$",
"key_del",
")",
"{",
"if",
"(",... | delete memcached values based on an input array
@param array $key_array
@return bool | [
"delete",
"memcached",
"values",
"based",
"on",
"an",
"input",
"array"
] | 8df7f12e75d75d3fd2197a58c80d39cbb4b9ff12 | https://github.com/chilimatic/chilimatic-framework/blob/8df7f12e75d75d3fd2197a58c80d39cbb4b9ff12/lib/cache/engine/Memcached.php#L256-L269 |
203,937 | gbprod/doctrine-specification | src/DoctrineSpecification/Handler.php | Handler.handle | public function handle(Specification $spec)
{
$factory = $this->registry->getFactory($spec);
return $factory->create($spec, $this->qb);
} | php | public function handle(Specification $spec)
{
$factory = $this->registry->getFactory($spec);
return $factory->create($spec, $this->qb);
} | [
"public",
"function",
"handle",
"(",
"Specification",
"$",
"spec",
")",
"{",
"$",
"factory",
"=",
"$",
"this",
"->",
"registry",
"->",
"getFactory",
"(",
"$",
"spec",
")",
";",
"return",
"$",
"factory",
"->",
"create",
"(",
"$",
"spec",
",",
"$",
"th... | handle specification for queryfactory
@param Specification $spec
@return Base | [
"handle",
"specification",
"for",
"queryfactory"
] | 348e8ec31547f4949a193d21b3a1d5cdb48b23cb | https://github.com/gbprod/doctrine-specification/blob/348e8ec31547f4949a193d21b3a1d5cdb48b23cb/src/DoctrineSpecification/Handler.php#L56-L61 |
203,938 | WolfMicrosystems/ldap | src/WMS/Library/Ldap/Enum/AbstractEnum.php | AbstractEnum.isValid | public static function isValid($value)
{
if (__CLASS__ === get_called_class()) {
throw new \RuntimeException('Cannot call isValid() on ' . __CLASS__);
}
$reflectionClass = new \ReflectionClass(get_called_class());
$validValues = $reflectionClass->getConstants();
... | php | public static function isValid($value)
{
if (__CLASS__ === get_called_class()) {
throw new \RuntimeException('Cannot call isValid() on ' . __CLASS__);
}
$reflectionClass = new \ReflectionClass(get_called_class());
$validValues = $reflectionClass->getConstants();
... | [
"public",
"static",
"function",
"isValid",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"__CLASS__",
"===",
"get_called_class",
"(",
")",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'Cannot call isValid() on '",
".",
"__CLASS__",
")",
";",
"}",
"$",... | Checks if the value is valid according to the enumeration.
@param mixed $value
@return bool
@throws \RuntimeException | [
"Checks",
"if",
"the",
"value",
"is",
"valid",
"according",
"to",
"the",
"enumeration",
"."
] | 872bbdc6127a41f0c51f2aa73425b8063a5c8148 | https://github.com/WolfMicrosystems/ldap/blob/872bbdc6127a41f0c51f2aa73425b8063a5c8148/src/WMS/Library/Ldap/Enum/AbstractEnum.php#L28-L48 |
203,939 | spiral/views | src/ViewSource.php | ViewSource.withCode | public function withCode(string $code): ViewSource
{
$context = clone $this;
$context->code = $code;
return $context;
} | php | public function withCode(string $code): ViewSource
{
$context = clone $this;
$context->code = $code;
return $context;
} | [
"public",
"function",
"withCode",
"(",
"string",
"$",
"code",
")",
":",
"ViewSource",
"{",
"$",
"context",
"=",
"clone",
"$",
"this",
";",
"$",
"context",
"->",
"code",
"=",
"$",
"code",
";",
"return",
"$",
"context",
";",
"}"
] | Get source copy with redefined code.
@param string $code
@return self | [
"Get",
"source",
"copy",
"with",
"redefined",
"code",
"."
] | 0e35697204dfffabf71546d20e89f14b50414a9a | https://github.com/spiral/views/blob/0e35697204dfffabf71546d20e89f14b50414a9a/src/ViewSource.php#L87-L93 |
203,940 | g4code/http | src/Response.php | Response.setRedirect | public function setRedirect($url, $code = 302)
{
$this->canSendHeaders(true);
$this->setHeader('Location', $url, true)
->setHttpResponseCode($code);
return $this;
} | php | public function setRedirect($url, $code = 302)
{
$this->canSendHeaders(true);
$this->setHeader('Location', $url, true)
->setHttpResponseCode($code);
return $this;
} | [
"public",
"function",
"setRedirect",
"(",
"$",
"url",
",",
"$",
"code",
"=",
"302",
")",
"{",
"$",
"this",
"->",
"canSendHeaders",
"(",
"true",
")",
";",
"$",
"this",
"->",
"setHeader",
"(",
"'Location'",
",",
"$",
"url",
",",
"true",
")",
"->",
"s... | Set redirect URL
Sets Location header and response code. Forces replacement of any prior
redirects.
@param string $url
@param int $code
@return \G4\Http\Response | [
"Set",
"redirect",
"URL"
] | 270a6b30d49a3656aea6d85e400f18293427926e | https://github.com/g4code/http/blob/270a6b30d49a3656aea6d85e400f18293427926e/src/Response.php#L146-L153 |
203,941 | g4code/http | src/Response.php | Response.sendHeaders | public function sendHeaders()
{
// Only check if we can send headers if we have headers to send
if (count($this->_headersRaw) || count($this->_headers) || (200 != $this->_httpResponseCode)) {
$this->canSendHeaders(true);
} elseif (200 == $this->_httpResponseCode) {
//... | php | public function sendHeaders()
{
// Only check if we can send headers if we have headers to send
if (count($this->_headersRaw) || count($this->_headers) || (200 != $this->_httpResponseCode)) {
$this->canSendHeaders(true);
} elseif (200 == $this->_httpResponseCode) {
//... | [
"public",
"function",
"sendHeaders",
"(",
")",
"{",
"// Only check if we can send headers if we have headers to send",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"_headersRaw",
")",
"||",
"count",
"(",
"$",
"this",
"->",
"_headers",
")",
"||",
"(",
"200",
"!=",... | Send all headers
Sends any headers specified. If an {@link setHttpResponseCode() HTTP response code}
has been specified, it is sent with the first header.
@return \G4\Http\Response | [
"Send",
"all",
"headers"
] | 270a6b30d49a3656aea6d85e400f18293427926e | https://github.com/g4code/http/blob/270a6b30d49a3656aea6d85e400f18293427926e/src/Response.php#L289-L325 |
203,942 | g4code/http | src/Response.php | Response.setBody | public function setBody($content, $name = null)
{
if ((null === $name) || !is_string($name)) {
$this->_body = array('default' => (string) $content);
} else {
$this->_body[$name] = (string) $content;
}
return $this;
} | php | public function setBody($content, $name = null)
{
if ((null === $name) || !is_string($name)) {
$this->_body = array('default' => (string) $content);
} else {
$this->_body[$name] = (string) $content;
}
return $this;
} | [
"public",
"function",
"setBody",
"(",
"$",
"content",
",",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"(",
"null",
"===",
"$",
"name",
")",
"||",
"!",
"is_string",
"(",
"$",
"name",
")",
")",
"{",
"$",
"this",
"->",
"_body",
"=",
"array",
"... | Set body content
If $name is not passed, or is not a string, resets the entire body and
sets the 'default' key to $content.
If $name is a string, sets the named segment in the body array to
$content.
@param string $content
@param null|string $name
@return \G4\Http\Response | [
"Set",
"body",
"content"
] | 270a6b30d49a3656aea6d85e400f18293427926e | https://github.com/g4code/http/blob/270a6b30d49a3656aea6d85e400f18293427926e/src/Response.php#L340-L349 |
203,943 | g4code/http | src/Response.php | Response.appendBody | public function appendBody($content, $name = null)
{
if ((null === $name) || !is_string($name)) {
if (isset($this->_body['default'])) {
$this->_body['default'] .= (string) $content;
} else {
return $this->append('default', $content);
}
... | php | public function appendBody($content, $name = null)
{
if ((null === $name) || !is_string($name)) {
if (isset($this->_body['default'])) {
$this->_body['default'] .= (string) $content;
} else {
return $this->append('default', $content);
}
... | [
"public",
"function",
"appendBody",
"(",
"$",
"content",
",",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"(",
"null",
"===",
"$",
"name",
")",
"||",
"!",
"is_string",
"(",
"$",
"name",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"-... | Append content to the body content
@param string $content
@param null|string $name
@return \G4\Http\Response | [
"Append",
"content",
"to",
"the",
"body",
"content"
] | 270a6b30d49a3656aea6d85e400f18293427926e | https://github.com/g4code/http/blob/270a6b30d49a3656aea6d85e400f18293427926e/src/Response.php#L358-L373 |
203,944 | g4code/http | src/Response.php | Response.clearBody | public function clearBody($name = null)
{
if (null !== $name) {
$name = (string) $name;
if (isset($this->_body[$name])) {
unset($this->_body[$name]);
return true;
}
return false;
}
$this->_body = array();
... | php | public function clearBody($name = null)
{
if (null !== $name) {
$name = (string) $name;
if (isset($this->_body[$name])) {
unset($this->_body[$name]);
return true;
}
return false;
}
$this->_body = array();
... | [
"public",
"function",
"clearBody",
"(",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"name",
")",
"{",
"$",
"name",
"=",
"(",
"string",
")",
"$",
"name",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_body",
"[",
"$",
... | Clear body array
With no arguments, clears the entire body array. Given a $name, clears
just that named segment; if no segment matching $name exists, returns
false to indicate an error.
@param string $name Named segment to clear
@return boolean | [
"Clear",
"body",
"array"
] | 270a6b30d49a3656aea6d85e400f18293427926e | https://github.com/g4code/http/blob/270a6b30d49a3656aea6d85e400f18293427926e/src/Response.php#L385-L399 |
203,945 | g4code/http | src/Response.php | Response.append | public function append($name, $content)
{
if (!is_string($name)) {
throw new \Exception('Invalid body segment key ("' . gettype($name) . '")');
}
if (isset($this->_body[$name])) {
unset($this->_body[$name]);
}
$this->_body[$name] = (string) $content;... | php | public function append($name, $content)
{
if (!is_string($name)) {
throw new \Exception('Invalid body segment key ("' . gettype($name) . '")');
}
if (isset($this->_body[$name])) {
unset($this->_body[$name]);
}
$this->_body[$name] = (string) $content;... | [
"public",
"function",
"append",
"(",
"$",
"name",
",",
"$",
"content",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'Invalid body segment key (\"'",
".",
"gettype",
"(",
"$",
"name",
"... | Append a named body segment to the body content array
If segment already exists, replaces with $content and places at end of
array.
@param string $name
@param string $content
@return \G4\Http\Response | [
"Append",
"a",
"named",
"body",
"segment",
"to",
"the",
"body",
"content",
"array"
] | 270a6b30d49a3656aea6d85e400f18293427926e | https://github.com/g4code/http/blob/270a6b30d49a3656aea6d85e400f18293427926e/src/Response.php#L437-L449 |
203,946 | g4code/http | src/Response.php | Response.insert | public function insert($name, $content, $parent = null, $before = false)
{
if (!is_string($name)) {
throw new \Exception('Invalid body segment key ("' . gettype($name) . '")');
}
if ((null !== $parent) && !is_string($parent)) {
throw new \Exception('Invalid body segm... | php | public function insert($name, $content, $parent = null, $before = false)
{
if (!is_string($name)) {
throw new \Exception('Invalid body segment key ("' . gettype($name) . '")');
}
if ((null !== $parent) && !is_string($parent)) {
throw new \Exception('Invalid body segm... | [
"public",
"function",
"insert",
"(",
"$",
"name",
",",
"$",
"content",
",",
"$",
"parent",
"=",
"null",
",",
"$",
"before",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"... | Insert a named segment into the body content array
@param string $name
@param string $content
@param string $parent
@param boolean $before Whether to insert the new segment before or
after the parent. Defaults to false (after)
@return \G4\Http\Response | [
"Insert",
"a",
"named",
"segment",
"into",
"the",
"body",
"content",
"array"
] | 270a6b30d49a3656aea6d85e400f18293427926e | https://github.com/g4code/http/blob/270a6b30d49a3656aea6d85e400f18293427926e/src/Response.php#L487-L527 |
203,947 | g4code/http | src/Response.php | Response.hasExceptionOfType | public function hasExceptionOfType($type)
{
foreach ($this->_exceptions as $e) {
if ($e instanceof $type) {
return true;
}
}
return false;
} | php | public function hasExceptionOfType($type)
{
foreach ($this->_exceptions as $e) {
if ($e instanceof $type) {
return true;
}
}
return false;
} | [
"public",
"function",
"hasExceptionOfType",
"(",
"$",
"type",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"_exceptions",
"as",
"$",
"e",
")",
"{",
"if",
"(",
"$",
"e",
"instanceof",
"$",
"type",
")",
"{",
"return",
"true",
";",
"}",
"}",
"return",
... | Does the response object contain an exception of a given type?
@param string $type
@return boolean | [
"Does",
"the",
"response",
"object",
"contain",
"an",
"exception",
"of",
"a",
"given",
"type?"
] | 270a6b30d49a3656aea6d85e400f18293427926e | https://github.com/g4code/http/blob/270a6b30d49a3656aea6d85e400f18293427926e/src/Response.php#L578-L587 |
203,948 | g4code/http | src/Response.php | Response.hasExceptionOfMessage | public function hasExceptionOfMessage($message)
{
foreach ($this->_exceptions as $e) {
if ($message == $e->getMessage()) {
return true;
}
}
return false;
} | php | public function hasExceptionOfMessage($message)
{
foreach ($this->_exceptions as $e) {
if ($message == $e->getMessage()) {
return true;
}
}
return false;
} | [
"public",
"function",
"hasExceptionOfMessage",
"(",
"$",
"message",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"_exceptions",
"as",
"$",
"e",
")",
"{",
"if",
"(",
"$",
"message",
"==",
"$",
"e",
"->",
"getMessage",
"(",
")",
")",
"{",
"return",
"tr... | Does the response object contain an exception with a given message?
@param string $message
@return boolean | [
"Does",
"the",
"response",
"object",
"contain",
"an",
"exception",
"with",
"a",
"given",
"message?"
] | 270a6b30d49a3656aea6d85e400f18293427926e | https://github.com/g4code/http/blob/270a6b30d49a3656aea6d85e400f18293427926e/src/Response.php#L595-L604 |
203,949 | g4code/http | src/Response.php | Response.hasExceptionOfCode | public function hasExceptionOfCode($code)
{
$code = (int) $code;
foreach ($this->_exceptions as $e) {
if ($code == $e->getCode()) {
return true;
}
}
return false;
} | php | public function hasExceptionOfCode($code)
{
$code = (int) $code;
foreach ($this->_exceptions as $e) {
if ($code == $e->getCode()) {
return true;
}
}
return false;
} | [
"public",
"function",
"hasExceptionOfCode",
"(",
"$",
"code",
")",
"{",
"$",
"code",
"=",
"(",
"int",
")",
"$",
"code",
";",
"foreach",
"(",
"$",
"this",
"->",
"_exceptions",
"as",
"$",
"e",
")",
"{",
"if",
"(",
"$",
"code",
"==",
"$",
"e",
"->",... | Does the response object contain an exception with a given code?
@param int $code
@return boolean | [
"Does",
"the",
"response",
"object",
"contain",
"an",
"exception",
"with",
"a",
"given",
"code?"
] | 270a6b30d49a3656aea6d85e400f18293427926e | https://github.com/g4code/http/blob/270a6b30d49a3656aea6d85e400f18293427926e/src/Response.php#L612-L622 |
203,950 | g4code/http | src/Response.php | Response.getExceptionByType | public function getExceptionByType($type)
{
$exceptions = array();
foreach ($this->_exceptions as $e) {
if ($e instanceof $type) {
$exceptions[] = $e;
}
}
if (empty($exceptions)) {
$exceptions = false;
}
return $ex... | php | public function getExceptionByType($type)
{
$exceptions = array();
foreach ($this->_exceptions as $e) {
if ($e instanceof $type) {
$exceptions[] = $e;
}
}
if (empty($exceptions)) {
$exceptions = false;
}
return $ex... | [
"public",
"function",
"getExceptionByType",
"(",
"$",
"type",
")",
"{",
"$",
"exceptions",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"_exceptions",
"as",
"$",
"e",
")",
"{",
"if",
"(",
"$",
"e",
"instanceof",
"$",
"type",
")",
... | Retrieve all exceptions of a given type
@param string $type
@return false|array | [
"Retrieve",
"all",
"exceptions",
"of",
"a",
"given",
"type"
] | 270a6b30d49a3656aea6d85e400f18293427926e | https://github.com/g4code/http/blob/270a6b30d49a3656aea6d85e400f18293427926e/src/Response.php#L630-L644 |
203,951 | g4code/http | src/Response.php | Response.getExceptionByMessage | public function getExceptionByMessage($message)
{
$exceptions = array();
foreach ($this->_exceptions as $e) {
if ($message == $e->getMessage()) {
$exceptions[] = $e;
}
}
if (empty($exceptions)) {
$exceptions = false;
}
... | php | public function getExceptionByMessage($message)
{
$exceptions = array();
foreach ($this->_exceptions as $e) {
if ($message == $e->getMessage()) {
$exceptions[] = $e;
}
}
if (empty($exceptions)) {
$exceptions = false;
}
... | [
"public",
"function",
"getExceptionByMessage",
"(",
"$",
"message",
")",
"{",
"$",
"exceptions",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"_exceptions",
"as",
"$",
"e",
")",
"{",
"if",
"(",
"$",
"message",
"==",
"$",
"e",
"->",... | Retrieve all exceptions of a given message
@param string $message
@return false|array | [
"Retrieve",
"all",
"exceptions",
"of",
"a",
"given",
"message"
] | 270a6b30d49a3656aea6d85e400f18293427926e | https://github.com/g4code/http/blob/270a6b30d49a3656aea6d85e400f18293427926e/src/Response.php#L652-L666 |
203,952 | g4code/http | src/Response.php | Response.getExceptionByCode | public function getExceptionByCode($code)
{
$code = (int) $code;
$exceptions = array();
foreach ($this->_exceptions as $e) {
if ($code == $e->getCode()) {
$exceptions[] = $e;
}
}
if (empty($exceptions)) {
$exceptions ... | php | public function getExceptionByCode($code)
{
$code = (int) $code;
$exceptions = array();
foreach ($this->_exceptions as $e) {
if ($code == $e->getCode()) {
$exceptions[] = $e;
}
}
if (empty($exceptions)) {
$exceptions ... | [
"public",
"function",
"getExceptionByCode",
"(",
"$",
"code",
")",
"{",
"$",
"code",
"=",
"(",
"int",
")",
"$",
"code",
";",
"$",
"exceptions",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"_exceptions",
"as",
"$",
"e",
")",
"{",... | Retrieve all exceptions of a given code
@param mixed $code
@return void | [
"Retrieve",
"all",
"exceptions",
"of",
"a",
"given",
"code"
] | 270a6b30d49a3656aea6d85e400f18293427926e | https://github.com/g4code/http/blob/270a6b30d49a3656aea6d85e400f18293427926e/src/Response.php#L674-L689 |
203,953 | g4code/http | src/Response.php | Response.sendResponse | public function sendResponse()
{
$this->sendHeaders();
if ($this->isException() && $this->renderExceptions())
{
$exceptions = '';
foreach ($this->getException() as $e)
{
$exceptions .= $e->__toString() . "\n";
}
ech... | php | public function sendResponse()
{
$this->sendHeaders();
if ($this->isException() && $this->renderExceptions())
{
$exceptions = '';
foreach ($this->getException() as $e)
{
$exceptions .= $e->__toString() . "\n";
}
ech... | [
"public",
"function",
"sendResponse",
"(",
")",
"{",
"$",
"this",
"->",
"sendHeaders",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"isException",
"(",
")",
"&&",
"$",
"this",
"->",
"renderExceptions",
"(",
")",
")",
"{",
"$",
"exceptions",
"=",
"''"... | Send the response, including all headers, rendering exceptions if so
requested.
@return void | [
"Send",
"the",
"response",
"including",
"all",
"headers",
"rendering",
"exceptions",
"if",
"so",
"requested",
"."
] | 270a6b30d49a3656aea6d85e400f18293427926e | https://github.com/g4code/http/blob/270a6b30d49a3656aea6d85e400f18293427926e/src/Response.php#L716-L732 |
203,954 | Fuzzyma/contao-eloquent-bundle | Traits/ContaoFilesModelTrait.php | ContaoFilesModelTrait.getContaoFile | private function getContaoFile($uuid)
{
$uuid = StringUtil::deserialize($uuid);
if (is_array($uuid)) return FilesModel::findMultipleByUuids($uuid);
return FilesModel::findByUuid($uuid);
} | php | private function getContaoFile($uuid)
{
$uuid = StringUtil::deserialize($uuid);
if (is_array($uuid)) return FilesModel::findMultipleByUuids($uuid);
return FilesModel::findByUuid($uuid);
} | [
"private",
"function",
"getContaoFile",
"(",
"$",
"uuid",
")",
"{",
"$",
"uuid",
"=",
"StringUtil",
"::",
"deserialize",
"(",
"$",
"uuid",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"uuid",
")",
")",
"return",
"FilesModel",
"::",
"findMultipleByUuids",
"... | Always return a contao file model since its more suitable when working with contao | [
"Always",
"return",
"a",
"contao",
"file",
"model",
"since",
"its",
"more",
"suitable",
"when",
"working",
"with",
"contao"
] | d5af2a3f48807db278ec3c92df463171f9514179 | https://github.com/Fuzzyma/contao-eloquent-bundle/blob/d5af2a3f48807db278ec3c92df463171f9514179/Traits/ContaoFilesModelTrait.php#L19-L25 |
203,955 | Fuzzyma/contao-eloquent-bundle | Traits/ContaoFilesModelTrait.php | ContaoFilesModelTrait.setContaoFile | private function setContaoFile($file)
{
if (is_array($file)) {
return serialize(array_map([__CLASS__, 'setContaoFile'], $file));
}
if ($file instanceof FilesModel) {
return $file->uuid;
}
if (Validator::isStringUuid($file)) {
return String... | php | private function setContaoFile($file)
{
if (is_array($file)) {
return serialize(array_map([__CLASS__, 'setContaoFile'], $file));
}
if ($file instanceof FilesModel) {
return $file->uuid;
}
if (Validator::isStringUuid($file)) {
return String... | [
"private",
"function",
"setContaoFile",
"(",
"$",
"file",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"file",
")",
")",
"{",
"return",
"serialize",
"(",
"array_map",
"(",
"[",
"__CLASS__",
",",
"'setContaoFile'",
"]",
",",
"$",
"file",
")",
")",
";",
... | we check if its a file model and extract the uuid. If its a string we convert it. | [
"we",
"check",
"if",
"its",
"a",
"file",
"model",
"and",
"extract",
"the",
"uuid",
".",
"If",
"its",
"a",
"string",
"we",
"convert",
"it",
"."
] | d5af2a3f48807db278ec3c92df463171f9514179 | https://github.com/Fuzzyma/contao-eloquent-bundle/blob/d5af2a3f48807db278ec3c92df463171f9514179/Traits/ContaoFilesModelTrait.php#L28-L41 |
203,956 | octris/sqlbuilder | libs/Sqlbuilder.php | Sqlbuilder.resolveSnippet | public function resolveSnippet($name, array &$parameters)
{
$name = strtoupper($name);
if (isset($this->clauses[$name])) {
$snippet = $this->clauses[$name]->resolveClauses($parameters);
} elseif (isset($this->snippets[$name])) {
$snippet = $this->snippets[$name];
... | php | public function resolveSnippet($name, array &$parameters)
{
$name = strtoupper($name);
if (isset($this->clauses[$name])) {
$snippet = $this->clauses[$name]->resolveClauses($parameters);
} elseif (isset($this->snippets[$name])) {
$snippet = $this->snippets[$name];
... | [
"public",
"function",
"resolveSnippet",
"(",
"$",
"name",
",",
"array",
"&",
"$",
"parameters",
")",
"{",
"$",
"name",
"=",
"strtoupper",
"(",
"$",
"name",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"clauses",
"[",
"$",
"name",
"]",
")",... | Resolve template snippet.
@param string $name Name of snippet to resolve.
@param array $parameters Parameters for resolving snippet.
@return array Array of resolved template snippet and parameters. | [
"Resolve",
"template",
"snippet",
"."
] | d22a494fd4814b3245fce20b4076eec1b382ffd3 | https://github.com/octris/sqlbuilder/blob/d22a494fd4814b3245fce20b4076eec1b382ffd3/libs/Sqlbuilder.php#L60-L73 |
203,957 | octris/sqlbuilder | libs/Sqlbuilder.php | Sqlbuilder.resolveParameter | public function resolveParameter($idx, $type, $name)
{
return $this->dialect->resolveParameter($idx, $type, $name);
} | php | public function resolveParameter($idx, $type, $name)
{
return $this->dialect->resolveParameter($idx, $type, $name);
} | [
"public",
"function",
"resolveParameter",
"(",
"$",
"idx",
",",
"$",
"type",
",",
"$",
"name",
")",
"{",
"return",
"$",
"this",
"->",
"dialect",
"->",
"resolveParameter",
"(",
"$",
"idx",
",",
"$",
"type",
",",
"$",
"name",
")",
";",
"}"
] | Resolve query parameter.
@param int $idx Position of the parameter in the query.
@param string $type Type of the parameter.
@param string $name Name of the parameter. | [
"Resolve",
"query",
"parameter",
"."
] | d22a494fd4814b3245fce20b4076eec1b382ffd3 | https://github.com/octris/sqlbuilder/blob/d22a494fd4814b3245fce20b4076eec1b382ffd3/libs/Sqlbuilder.php#L82-L85 |
203,958 | octris/sqlbuilder | libs/Sqlbuilder.php | Sqlbuilder.addClause | protected function addClause($name, $sql, array $parameters, $joiner, $prefix = '', $postfix = '', $is_inclusive = false)
{
$name = strtoupper($name);
if (!isset($this->clauses[$name])) {
$this->clauses[$name] = new \Octris\Sqlbuilder\Clauses($joiner, $prefix, $postfix);
}
... | php | protected function addClause($name, $sql, array $parameters, $joiner, $prefix = '', $postfix = '', $is_inclusive = false)
{
$name = strtoupper($name);
if (!isset($this->clauses[$name])) {
$this->clauses[$name] = new \Octris\Sqlbuilder\Clauses($joiner, $prefix, $postfix);
}
... | [
"protected",
"function",
"addClause",
"(",
"$",
"name",
",",
"$",
"sql",
",",
"array",
"$",
"parameters",
",",
"$",
"joiner",
",",
"$",
"prefix",
"=",
"''",
",",
"$",
"postfix",
"=",
"''",
",",
"$",
"is_inclusive",
"=",
"false",
")",
"{",
"$",
"nam... | Add clause.
@param string $name Name of clause to add.
@param string $sql SQL snippet of clause.
@param array $parameters Parameters for clause.
@param string $joiner String to ... | [
"Add",
"clause",
"."
] | d22a494fd4814b3245fce20b4076eec1b382ffd3 | https://github.com/octris/sqlbuilder/blob/d22a494fd4814b3245fce20b4076eec1b382ffd3/libs/Sqlbuilder.php#L125-L134 |
203,959 | octris/sqlbuilder | libs/Sqlbuilder.php | Sqlbuilder.addPaging | public function addPaging($limit, $page = 1)
{
$this->addClause('PAGING', $this->dialect->getLimitString($limit, ($page - 1) * $limit), [], '', '', "\n", false);
return $this;
} | php | public function addPaging($limit, $page = 1)
{
$this->addClause('PAGING', $this->dialect->getLimitString($limit, ($page - 1) * $limit), [], '', '', "\n", false);
return $this;
} | [
"public",
"function",
"addPaging",
"(",
"$",
"limit",
",",
"$",
"page",
"=",
"1",
")",
"{",
"$",
"this",
"->",
"addClause",
"(",
"'PAGING'",
",",
"$",
"this",
"->",
"dialect",
"->",
"getLimitString",
"(",
"$",
"limit",
",",
"(",
"$",
"page",
"-",
"... | Add paging.
@param int $limit Limit rows to return.
@param int $page Optional page to start querying at.
@return \Octris\Sqlbuilder This instance for method chaining. | [
"Add",
"paging",
"."
] | d22a494fd4814b3245fce20b4076eec1b382ffd3 | https://github.com/octris/sqlbuilder/blob/d22a494fd4814b3245fce20b4076eec1b382ffd3/libs/Sqlbuilder.php#L295-L300 |
203,960 | buse974/Dal | src/Dal/Mapper/AbstractMapper.php | AbstractMapper.requestPdo | public function requestPdo($request, $param = null)
{
$this->result = $this->tableGateway->requestPdo($request, $param);
return $this->result;
} | php | public function requestPdo($request, $param = null)
{
$this->result = $this->tableGateway->requestPdo($request, $param);
return $this->result;
} | [
"public",
"function",
"requestPdo",
"(",
"$",
"request",
",",
"$",
"param",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"result",
"=",
"$",
"this",
"->",
"tableGateway",
"->",
"requestPdo",
"(",
"$",
"request",
",",
"$",
"param",
")",
";",
"return",
"$... | Excecute request directly by PDO.
@param string $request
@param array $param
@return \Dal\Db\ResultSet\ResultSet | [
"Excecute",
"request",
"directly",
"by",
"PDO",
"."
] | faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab | https://github.com/buse974/Dal/blob/faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab/src/Dal/Mapper/AbstractMapper.php#L74-L79 |
203,961 | buse974/Dal | src/Dal/Mapper/AbstractMapper.php | AbstractMapper.selectWith | public function selectWith(\Zend\Db\Sql\Select $select)
{
if ($this->usePaginator === true) {
return $this->initPaginator($select);
}
$this->result = $this->tableGateway->selectWith($select);
return $this->result;
} | php | public function selectWith(\Zend\Db\Sql\Select $select)
{
if ($this->usePaginator === true) {
return $this->initPaginator($select);
}
$this->result = $this->tableGateway->selectWith($select);
return $this->result;
} | [
"public",
"function",
"selectWith",
"(",
"\\",
"Zend",
"\\",
"Db",
"\\",
"Sql",
"\\",
"Select",
"$",
"select",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"usePaginator",
"===",
"true",
")",
"{",
"return",
"$",
"this",
"->",
"initPaginator",
"(",
"$",
"s... | Select request.
@param \Zend\Db\Sql\Select
@return \Zend\Db\ResultSet\ResultSet | [
"Select",
"request",
"."
] | faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab | https://github.com/buse974/Dal/blob/faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab/src/Dal/Mapper/AbstractMapper.php#L143-L152 |
203,962 | buse974/Dal | src/Dal/Mapper/AbstractMapper.php | AbstractMapper.fetchAll | public function fetchAll()
{
if ($this->usePaginator === true) {
return $this->initPaginator($this->tableGateway->getSql()->select());
}
$this->result = $this->tableGateway->select();
return $this->result;
} | php | public function fetchAll()
{
if ($this->usePaginator === true) {
return $this->initPaginator($this->tableGateway->getSql()->select());
}
$this->result = $this->tableGateway->select();
return $this->result;
} | [
"public",
"function",
"fetchAll",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"usePaginator",
"===",
"true",
")",
"{",
"return",
"$",
"this",
"->",
"initPaginator",
"(",
"$",
"this",
"->",
"tableGateway",
"->",
"getSql",
"(",
")",
"->",
"select",
"(",... | Fetch All.
@return \Zend\Db\ResultSet\ResultSet | [
"Fetch",
"All",
"."
] | faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab | https://github.com/buse974/Dal/blob/faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab/src/Dal/Mapper/AbstractMapper.php#L159-L167 |
203,963 | buse974/Dal | src/Dal/Mapper/AbstractMapper.php | AbstractMapper.deleteWith | public function deleteWith(\Zend\Db\Sql\Delete $delete)
{
return $this->tableGateway->deleteWith($delete);
} | php | public function deleteWith(\Zend\Db\Sql\Delete $delete)
{
return $this->tableGateway->deleteWith($delete);
} | [
"public",
"function",
"deleteWith",
"(",
"\\",
"Zend",
"\\",
"Db",
"\\",
"Sql",
"\\",
"Delete",
"$",
"delete",
")",
"{",
"return",
"$",
"this",
"->",
"tableGateway",
"->",
"deleteWith",
"(",
"$",
"delete",
")",
";",
"}"
] | Delete request.
@param \Zend\Db\Sql\Delete
@return int | [
"Delete",
"request",
"."
] | faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab | https://github.com/buse974/Dal/blob/faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab/src/Dal/Mapper/AbstractMapper.php#L176-L179 |
203,964 | buse974/Dal | src/Dal/Mapper/AbstractMapper.php | AbstractMapper.insertWith | public function insertWith(\Zend\Db\Sql\Insert $insert)
{
return $this->tableGateway->insertWith($insert);
} | php | public function insertWith(\Zend\Db\Sql\Insert $insert)
{
return $this->tableGateway->insertWith($insert);
} | [
"public",
"function",
"insertWith",
"(",
"\\",
"Zend",
"\\",
"Db",
"\\",
"Sql",
"\\",
"Insert",
"$",
"insert",
")",
"{",
"return",
"$",
"this",
"->",
"tableGateway",
"->",
"insertWith",
"(",
"$",
"insert",
")",
";",
"}"
] | Insert request.
@param \Zend\Db\Sql\Insert
@return int | [
"Insert",
"request",
"."
] | faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab | https://github.com/buse974/Dal/blob/faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab/src/Dal/Mapper/AbstractMapper.php#L188-L191 |
203,965 | buse974/Dal | src/Dal/Mapper/AbstractMapper.php | AbstractMapper.updateWith | public function updateWith(\Zend\Db\Sql\Update $update)
{
return $this->tableGateway->updateWith($update);
} | php | public function updateWith(\Zend\Db\Sql\Update $update)
{
return $this->tableGateway->updateWith($update);
} | [
"public",
"function",
"updateWith",
"(",
"\\",
"Zend",
"\\",
"Db",
"\\",
"Sql",
"\\",
"Update",
"$",
"update",
")",
"{",
"return",
"$",
"this",
"->",
"tableGateway",
"->",
"updateWith",
"(",
"$",
"update",
")",
";",
"}"
] | Update request.
@param \Zend\Db\Sql\Update
@return int | [
"Update",
"request",
"."
] | faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab | https://github.com/buse974/Dal/blob/faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab/src/Dal/Mapper/AbstractMapper.php#L200-L203 |
203,966 | buse974/Dal | src/Dal/Mapper/AbstractMapper.php | AbstractMapper.fetchRow | public function fetchRow($column, $value)
{
$where = array($column, $value);
return $this->tableGateway->select($where)->current();
} | php | public function fetchRow($column, $value)
{
$where = array($column, $value);
return $this->tableGateway->select($where)->current();
} | [
"public",
"function",
"fetchRow",
"(",
"$",
"column",
",",
"$",
"value",
")",
"{",
"$",
"where",
"=",
"array",
"(",
"$",
"column",
",",
"$",
"value",
")",
";",
"return",
"$",
"this",
"->",
"tableGateway",
"->",
"select",
"(",
"$",
"where",
")",
"->... | Get row.
@param string $column
@param multitype $value
@return \Dal\Model\AbstractModel | [
"Get",
"row",
"."
] | faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab | https://github.com/buse974/Dal/blob/faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab/src/Dal/Mapper/AbstractMapper.php#L213-L218 |
203,967 | buse974/Dal | src/Dal/Mapper/AbstractMapper.php | AbstractMapper.delete | public function delete(AbstractModel $model)
{
$array = $model->toArrayCurrent();
if (empty($array)) {
throw new \Exception('Error : delete used an empty model');
}
return $this->tableGateway->delete($array);
} | php | public function delete(AbstractModel $model)
{
$array = $model->toArrayCurrent();
if (empty($array)) {
throw new \Exception('Error : delete used an empty model');
}
return $this->tableGateway->delete($array);
} | [
"public",
"function",
"delete",
"(",
"AbstractModel",
"$",
"model",
")",
"{",
"$",
"array",
"=",
"$",
"model",
"->",
"toArrayCurrent",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"array",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'Erro... | Delete full modele.
@param \Dal\Model\AbstractModel $model
@return bool | [
"Delete",
"full",
"modele",
"."
] | faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab | https://github.com/buse974/Dal/blob/faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab/src/Dal/Mapper/AbstractMapper.php#L272-L281 |
203,968 | buse974/Dal | src/Dal/Mapper/AbstractMapper.php | AbstractMapper.usePaginator | public function usePaginator($options)
{
if ($options === null) {
$this->usePaginator = false;
return $this;
}
$this->usePaginator = true;
$this->paginatorOptions['s'] = (isset($options['s'])) ? $options['s'] : null;
$this->paginatorOptions['d'] = (... | php | public function usePaginator($options)
{
if ($options === null) {
$this->usePaginator = false;
return $this;
}
$this->usePaginator = true;
$this->paginatorOptions['s'] = (isset($options['s'])) ? $options['s'] : null;
$this->paginatorOptions['d'] = (... | [
"public",
"function",
"usePaginator",
"(",
"$",
"options",
")",
"{",
"if",
"(",
"$",
"options",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"usePaginator",
"=",
"false",
";",
"return",
"$",
"this",
";",
"}",
"$",
"this",
"->",
"usePaginator",
"=",
"t... | Set the mapper options and enable the mapper.
@param array $options
@return AbstractMapper | [
"Set",
"the",
"mapper",
"options",
"and",
"enable",
"the",
"mapper",
"."
] | faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab | https://github.com/buse974/Dal/blob/faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab/src/Dal/Mapper/AbstractMapper.php#L290-L308 |
203,969 | buse974/Dal | src/Dal/Mapper/AbstractMapper.php | AbstractMapper.initPaginator | protected function initPaginator($select)
{
$this->usePaginator = false;
$this->paginator = new Paginator(
$select,
$this->tableGateway->getAdapter(),
$this->tableGateway->getResultSetPrototype());
if (isset($this->paginatorOption... | php | protected function initPaginator($select)
{
$this->usePaginator = false;
$this->paginator = new Paginator(
$select,
$this->tableGateway->getAdapter(),
$this->tableGateway->getResultSetPrototype());
if (isset($this->paginatorOption... | [
"protected",
"function",
"initPaginator",
"(",
"$",
"select",
")",
"{",
"$",
"this",
"->",
"usePaginator",
"=",
"false",
";",
"$",
"this",
"->",
"paginator",
"=",
"new",
"Paginator",
"(",
"$",
"select",
",",
"$",
"this",
"->",
"tableGateway",
"->",
"getA... | Init the paginator with a select object.
@param \Zend\Db\Sql\Select|array $select
@return mixed | [
"Init",
"the",
"paginator",
"with",
"a",
"select",
"object",
"."
] | faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab | https://github.com/buse974/Dal/blob/faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab/src/Dal/Mapper/AbstractMapper.php#L317-L346 |
203,970 | buse974/Dal | src/Dal/Mapper/AbstractMapper.php | AbstractMapper.printSql | public function printSql(\Zend\Db\Sql\SqlInterface $request)
{
return $request->getSqlString($this->tableGateway->getAdapter()->getPlatform());
} | php | public function printSql(\Zend\Db\Sql\SqlInterface $request)
{
return $request->getSqlString($this->tableGateway->getAdapter()->getPlatform());
} | [
"public",
"function",
"printSql",
"(",
"\\",
"Zend",
"\\",
"Db",
"\\",
"Sql",
"\\",
"SqlInterface",
"$",
"request",
")",
"{",
"return",
"$",
"request",
"->",
"getSqlString",
"(",
"$",
"this",
"->",
"tableGateway",
"->",
"getAdapter",
"(",
")",
"->",
"get... | Return request sql.
@param \Zend\Db\Sql\SqlInterface $request
@return string | [
"Return",
"request",
"sql",
"."
] | faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab | https://github.com/buse974/Dal/blob/faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab/src/Dal/Mapper/AbstractMapper.php#L371-L374 |
203,971 | phpalchemy/phpalchemy | Alchemy/Component/ClassLoader/ClassLoader.php | ClassLoader.register | public function register($namespace, $includePath)
{
if (array_key_exists($namespace, $this->includePaths)) {
throw new \Exception("Error: Namespace '$namespace' is already registered!");
}
$this->includePaths[$namespace] = rtrim($includePath, DS) . DS;
} | php | public function register($namespace, $includePath)
{
if (array_key_exists($namespace, $this->includePaths)) {
throw new \Exception("Error: Namespace '$namespace' is already registered!");
}
$this->includePaths[$namespace] = rtrim($includePath, DS) . DS;
} | [
"public",
"function",
"register",
"(",
"$",
"namespace",
",",
"$",
"includePath",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"namespace",
",",
"$",
"this",
"->",
"includePaths",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"\"Error: Names... | Register a determinated namespace and its include path to find it.
@param string $namespace namespace of a class given
@param string $includePath path where the class exists | [
"Register",
"a",
"determinated",
"namespace",
"and",
"its",
"include",
"path",
"to",
"find",
"it",
"."
] | 5b7e9b13acfda38c61b2da2639e8a56f298dc32e | https://github.com/phpalchemy/phpalchemy/blob/5b7e9b13acfda38c61b2da2639e8a56f298dc32e/Alchemy/Component/ClassLoader/ClassLoader.php#L70-L77 |
203,972 | phpalchemy/phpalchemy | Alchemy/Component/ClassLoader/ClassLoader.php | ClassLoader.registerClass | public function registerClass($className, $includeFile)
{
if (array_key_exists($className, $this->includePaths)) {
throw new \Exception("Error: Class '$className' is already registered!");
}
$this->includePaths[$className] = $includeFile;
} | php | public function registerClass($className, $includeFile)
{
if (array_key_exists($className, $this->includePaths)) {
throw new \Exception("Error: Class '$className' is already registered!");
}
$this->includePaths[$className] = $includeFile;
} | [
"public",
"function",
"registerClass",
"(",
"$",
"className",
",",
"$",
"includeFile",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"className",
",",
"$",
"this",
"->",
"includePaths",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"\"Error: ... | Register a determinated class to autoloader
Example:
$classLoader = ClassLoader::getInstance();
$classLoader->registerClass('MyClass', '/classes/class.myclass.php');
This is useful when we want to add autoloading to a class without naming
convention and therefore the class name is different of class file,
or the clas... | [
"Register",
"a",
"determinated",
"class",
"to",
"autoloader"
] | 5b7e9b13acfda38c61b2da2639e8a56f298dc32e | https://github.com/phpalchemy/phpalchemy/blob/5b7e9b13acfda38c61b2da2639e8a56f298dc32e/Alchemy/Component/ClassLoader/ClassLoader.php#L90-L97 |
203,973 | honeylex/honeylex | app/lib/Console/Scaffold/SkeletonGenerator.php | SkeletonGenerator.createFolders | protected function createFolders()
{
foreach ($this->getFolderStructure() as $folder) {
$newFolder = $this->twigStringRenderer->renderToString($folder, $this->data);
$this->fs->mkdir($this->targetPath.DIRECTORY_SEPARATOR.$newFolder, self::DIRECTORY_MODE);
$msg = '[mkdir]... | php | protected function createFolders()
{
foreach ($this->getFolderStructure() as $folder) {
$newFolder = $this->twigStringRenderer->renderToString($folder, $this->data);
$this->fs->mkdir($this->targetPath.DIRECTORY_SEPARATOR.$newFolder, self::DIRECTORY_MODE);
$msg = '[mkdir]... | [
"protected",
"function",
"createFolders",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getFolderStructure",
"(",
")",
"as",
"$",
"folder",
")",
"{",
"$",
"newFolder",
"=",
"$",
"this",
"->",
"twigStringRenderer",
"->",
"renderToString",
"(",
"$",
"fo... | Creates all folders specified by getFolderStructure within the target
location. | [
"Creates",
"all",
"folders",
"specified",
"by",
"getFolderStructure",
"within",
"the",
"target",
"location",
"."
] | ad0a177ec365793a2c3813b948a1750c77ef00c1 | https://github.com/honeylex/honeylex/blob/ad0a177ec365793a2c3813b948a1750c77ef00c1/app/lib/Console/Scaffold/SkeletonGenerator.php#L120-L131 |
203,974 | honeylex/honeylex | app/lib/Console/Scaffold/SkeletonGenerator.php | SkeletonGenerator.copyFiles | protected function copyFiles()
{
$skeletonFinder = new SkeletonFinder($this->lookupPaths);
$sourcePath = $skeletonFinder->findByName($this->skeletonName)->getRealpath();
$finder = $this->getFinderForFilesToCopy($sourcePath);
foreach ($finder as $file) {
$targetFilePath ... | php | protected function copyFiles()
{
$skeletonFinder = new SkeletonFinder($this->lookupPaths);
$sourcePath = $skeletonFinder->findByName($this->skeletonName)->getRealpath();
$finder = $this->getFinderForFilesToCopy($sourcePath);
foreach ($finder as $file) {
$targetFilePath ... | [
"protected",
"function",
"copyFiles",
"(",
")",
"{",
"$",
"skeletonFinder",
"=",
"new",
"SkeletonFinder",
"(",
"$",
"this",
"->",
"lookupPaths",
")",
";",
"$",
"sourcePath",
"=",
"$",
"skeletonFinder",
"->",
"findByName",
"(",
"$",
"this",
"->",
"skeletonNam... | Copies all files from the source location to the target location. | [
"Copies",
"all",
"files",
"from",
"the",
"source",
"location",
"to",
"the",
"target",
"location",
"."
] | ad0a177ec365793a2c3813b948a1750c77ef00c1 | https://github.com/honeylex/honeylex/blob/ad0a177ec365793a2c3813b948a1750c77ef00c1/app/lib/Console/Scaffold/SkeletonGenerator.php#L136-L155 |
203,975 | honeylex/honeylex | app/lib/Console/Scaffold/SkeletonGenerator.php | SkeletonGenerator.renderTemplates | protected function renderTemplates()
{
$finder = new Finder;
$finder->files()->name('*'.self::TEMPLATE_FILENAME_EXTENSION)->in($this->targetPath);
$twigRenderer = TwigRenderer::create(
[
'twig_extensions' => [ new ProjectExtension($this->configProvider) ],
... | php | protected function renderTemplates()
{
$finder = new Finder;
$finder->files()->name('*'.self::TEMPLATE_FILENAME_EXTENSION)->in($this->targetPath);
$twigRenderer = TwigRenderer::create(
[
'twig_extensions' => [ new ProjectExtension($this->configProvider) ],
... | [
"protected",
"function",
"renderTemplates",
"(",
")",
"{",
"$",
"finder",
"=",
"new",
"Finder",
";",
"$",
"finder",
"->",
"files",
"(",
")",
"->",
"name",
"(",
"'*'",
".",
"self",
"::",
"TEMPLATE_FILENAME_EXTENSION",
")",
"->",
"in",
"(",
"$",
"this",
... | Renders all files within the target location whose extension is
".tmpl.twig" onto a file that has the same name without that extension.
After the rendering all the ".tmpl.twig" files will be deleted in the
target location. | [
"Renders",
"all",
"files",
"within",
"the",
"target",
"location",
"whose",
"extension",
"is",
".",
"tmpl",
".",
"twig",
"onto",
"a",
"file",
"that",
"has",
"the",
"same",
"name",
"without",
"that",
"extension",
".",
"After",
"the",
"rendering",
"all",
"the... | ad0a177ec365793a2c3813b948a1750c77ef00c1 | https://github.com/honeylex/honeylex/blob/ad0a177ec365793a2c3813b948a1750c77ef00c1/app/lib/Console/Scaffold/SkeletonGenerator.php#L176-L217 |
203,976 | bluetree-service/data | src/Calculation/Math.php | Math.end | public static function end($edition, $used, $start, $timeNow)
{
if (!$used) {
return 0;
}
$end = $edition / ($used / ($timeNow - $start));
$end += $timeNow;
return $end;
} | php | public static function end($edition, $used, $start, $timeNow)
{
if (!$used) {
return 0;
}
$end = $edition / ($used / ($timeNow - $start));
$end += $timeNow;
return $end;
} | [
"public",
"static",
"function",
"end",
"(",
"$",
"edition",
",",
"$",
"used",
",",
"$",
"start",
",",
"$",
"timeNow",
")",
"{",
"if",
"(",
"!",
"$",
"used",
")",
"{",
"return",
"0",
";",
"}",
"$",
"end",
"=",
"$",
"edition",
"/",
"(",
"$",
"u... | Estimate time to end, by given current usage value and max value
@param float $edition maximum number of value
@param float $used how many was used
@param integer $start start time in unix timestamp
@param integer $timeNow current unix timestamp
@return integer estimated end time in unix timestamp | [
"Estimate",
"time",
"to",
"end",
"by",
"given",
"current",
"usage",
"value",
"and",
"max",
"value"
] | a8df78ee4f7b97b862f989d3effc75f022fd75cb | https://github.com/bluetree-service/data/blob/a8df78ee4f7b97b862f989d3effc75f022fd75cb/src/Calculation/Math.php#L71-L81 |
203,977 | 3ev/wordpress-core | src/Tev/Field/Model/AuthorField.php | AuthorField.getValue | public function getValue()
{
$val = $this->base['value'];
if (is_array($val)) {
if (isset($val['ID'])) {
return $this->authorFactory->create($val['ID']);
} else {
$authors = array();
foreach ($val as $a) {
... | php | public function getValue()
{
$val = $this->base['value'];
if (is_array($val)) {
if (isset($val['ID'])) {
return $this->authorFactory->create($val['ID']);
} else {
$authors = array();
foreach ($val as $a) {
... | [
"public",
"function",
"getValue",
"(",
")",
"{",
"$",
"val",
"=",
"$",
"this",
"->",
"base",
"[",
"'value'",
"]",
";",
"if",
"(",
"is_array",
"(",
"$",
"val",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"val",
"[",
"'ID'",
"]",
")",
")",
"{"... | Get a single author object or array of author objects.
If no authors are configured, returned will result will be an empty array
if this is a mutli-select, or null if not.
@return \Tev\Author\Model\Author|\Tev\Author\Model\Author[]|null | [
"Get",
"a",
"single",
"author",
"object",
"or",
"array",
"of",
"author",
"objects",
"."
] | da674fbec5bf3d5bd2a2141680a4c141113eb6b0 | https://github.com/3ev/wordpress-core/blob/da674fbec5bf3d5bd2a2141680a4c141113eb6b0/src/Tev/Field/Model/AuthorField.php#L43-L66 |
203,978 | deweller/php-cliopts | src/CLIOpts/Help/ConsoleFormat.php | ConsoleFormat.applyformatToText | public static function applyformatToText() {
$args = func_get_args();
$count = func_num_args();
$text = $args[$count - 1];
if ($count == 1) { return $text; }
$mode_texts = array_slice($args, 0, $count - 1);
return self::buildEscapeCodes($mode_texts).$text.self::buildEscapeCodes('plain');
} | php | public static function applyformatToText() {
$args = func_get_args();
$count = func_num_args();
$text = $args[$count - 1];
if ($count == 1) { return $text; }
$mode_texts = array_slice($args, 0, $count - 1);
return self::buildEscapeCodes($mode_texts).$text.self::buildEscapeCodes('plain');
} | [
"public",
"static",
"function",
"applyformatToText",
"(",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"$",
"count",
"=",
"func_num_args",
"(",
")",
";",
"$",
"text",
"=",
"$",
"args",
"[",
"$",
"count",
"-",
"1",
"]",
";",
"if",
"("... | Applies one or more console formatting codes to text
@param string $mode A mode like bold or black. This can be repeated numerous times.
@param string $text the text to be formatted
@return string a formatted version of $text | [
"Applies",
"one",
"or",
"more",
"console",
"formatting",
"codes",
"to",
"text"
] | 1923f3a7ad24062c6279c725579ff3af15141dec | https://github.com/deweller/php-cliopts/blob/1923f3a7ad24062c6279c725579ff3af15141dec/src/CLIOpts/Help/ConsoleFormat.php#L57-L67 |
203,979 | deweller/php-cliopts | src/CLIOpts/Help/ConsoleFormat.php | ConsoleFormat.buildEscapeCodes | protected static function buildEscapeCodes($mode_texts) {
if (!is_array($mode_texts)) { $mode_texts = array($mode_texts); }
$code_text = '';
foreach ($mode_texts as $mode) {
$constant_name = 'self::CONSOLE_'.strtoupper($mode);
if (defined($constant_name)) {
$code_text .= (strlen($code_t... | php | protected static function buildEscapeCodes($mode_texts) {
if (!is_array($mode_texts)) { $mode_texts = array($mode_texts); }
$code_text = '';
foreach ($mode_texts as $mode) {
$constant_name = 'self::CONSOLE_'.strtoupper($mode);
if (defined($constant_name)) {
$code_text .= (strlen($code_t... | [
"protected",
"static",
"function",
"buildEscapeCodes",
"(",
"$",
"mode_texts",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"mode_texts",
")",
")",
"{",
"$",
"mode_texts",
"=",
"array",
"(",
"$",
"mode_texts",
")",
";",
"}",
"$",
"code_text",
"=",
"... | builds ANSI escape codes
@param mixed $mode_texts An array of mode texts like bold or white. Can also be a single string.
@return string ANSI escape code to activate the modes | [
"builds",
"ANSI",
"escape",
"codes"
] | 1923f3a7ad24062c6279c725579ff3af15141dec | https://github.com/deweller/php-cliopts/blob/1923f3a7ad24062c6279c725579ff3af15141dec/src/CLIOpts/Help/ConsoleFormat.php#L82-L94 |
203,980 | newestindustry/ginger-rest | src/Ginger/Url.php | Url.getParameter | public function getParameter($key)
{
if(isset($this->queryParts[$key])) {
return $this->queryParts[$key];
} else {
return false;
}
} | php | public function getParameter($key)
{
if(isset($this->queryParts[$key])) {
return $this->queryParts[$key];
} else {
return false;
}
} | [
"public",
"function",
"getParameter",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"queryParts",
"[",
"$",
"key",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"queryParts",
"[",
"$",
"key",
"]",
";",
"}",
"else",
"{"... | getParameter function.
@access public
@param mixed $key
@return void | [
"getParameter",
"function",
"."
] | 482b77dc122a60ab0bf143a3c4a1e67168985c83 | https://github.com/newestindustry/ginger-rest/blob/482b77dc122a60ab0bf143a3c4a1e67168985c83/src/Ginger/Url.php#L127-L134 |
203,981 | newup/core | src/Filesystem/Generators/PathTreeArrayFormat.php | PathTreeArrayFormat.getPathForTreeGenerator | private function getPathForTreeGenerator($pathKey, $path)
{
// If the $path is an array, it most likely already contains
// the information we need, such as if the target is a file or directory.
if (is_array($path) && array_key_exists('type', $path) && array_key_exists('path', $path)) {
... | php | private function getPathForTreeGenerator($pathKey, $path)
{
// If the $path is an array, it most likely already contains
// the information we need, such as if the target is a file or directory.
if (is_array($path) && array_key_exists('type', $path) && array_key_exists('path', $path)) {
... | [
"private",
"function",
"getPathForTreeGenerator",
"(",
"$",
"pathKey",
",",
"$",
"path",
")",
"{",
"// If the $path is an array, it most likely already contains",
"// the information we need, such as if the target is a file or directory.",
"if",
"(",
"is_array",
"(",
"$",
"path",... | Converts the key and path into an array that various tree
generators expect.
This function does NOT process the path using any renderers.
@param $pathKey
@param $path
@return mixed
@throws InvalidArgumentException | [
"Converts",
"the",
"key",
"and",
"path",
"into",
"an",
"array",
"that",
"various",
"tree",
"generators",
"expect",
"."
] | 54128903e7775e67d63284d958b46862c8df71f9 | https://github.com/newup/core/blob/54128903e7775e67d63284d958b46862c8df71f9/src/Filesystem/Generators/PathTreeArrayFormat.php#L22-L49 |
203,982 | andyburton/Sonic-Framework | src/Memcached.php | Memcached.create | public function create ($exclude = array (), $cache = FALSE)
{
// If we're not caching or there is no memcached object just call parent
if ($cache === FALSE || !($this->memcached instanceof \Memcached))
{
return parent::create ($exclude);
}
// Call parent method
$parent = parent::create ($ex... | php | public function create ($exclude = array (), $cache = FALSE)
{
// If we're not caching or there is no memcached object just call parent
if ($cache === FALSE || !($this->memcached instanceof \Memcached))
{
return parent::create ($exclude);
}
// Call parent method
$parent = parent::create ($ex... | [
"public",
"function",
"create",
"(",
"$",
"exclude",
"=",
"array",
"(",
")",
",",
"$",
"cache",
"=",
"FALSE",
")",
"{",
"// If we're not caching or there is no memcached object just call parent",
"if",
"(",
"$",
"cache",
"===",
"FALSE",
"||",
"!",
"(",
"$",
"t... | Create object in the database and set in memcached
@param array $exclude Attributes not to set
@param integer|boolean $cache Number of seconds to cache the object for
0 = cache never expires, FALSE = do not cache
@return boolean | [
"Create",
"object",
"in",
"the",
"database",
"and",
"set",
"in",
"memcached"
] | a5999448a0abab4d542413002a780ede391e7374 | https://github.com/andyburton/Sonic-Framework/blob/a5999448a0abab4d542413002a780ede391e7374/src/Memcached.php#L28-L55 |
203,983 | andyburton/Sonic-Framework | src/Memcached.php | Memcached.read | public function read ($pkValue = FALSE, $cache = FALSE)
{
// If we're not caching or there is no memcached object just call parent
if ($cache === FALSE || !($this->memcached instanceof \Memcached))
{
return parent::read ($pkValue);
}
// If there is a key value passed set it
if ($pkValue !== ... | php | public function read ($pkValue = FALSE, $cache = FALSE)
{
// If we're not caching or there is no memcached object just call parent
if ($cache === FALSE || !($this->memcached instanceof \Memcached))
{
return parent::read ($pkValue);
}
// If there is a key value passed set it
if ($pkValue !== ... | [
"public",
"function",
"read",
"(",
"$",
"pkValue",
"=",
"FALSE",
",",
"$",
"cache",
"=",
"FALSE",
")",
"{",
"// If we're not caching or there is no memcached object just call parent",
"if",
"(",
"$",
"cache",
"===",
"FALSE",
"||",
"!",
"(",
"$",
"this",
"->",
... | Read an object from memcached if it exists,
otherwise load the object from the database and then cache it
@param mixed $pkValue Primary key value
@param integer|boolean $cache Number of seconds to cache the object for
0 = cache never expires, FALSE = do not cache
@return boolean | [
"Read",
"an",
"object",
"from",
"memcached",
"if",
"it",
"exists",
"otherwise",
"load",
"the",
"object",
"from",
"the",
"database",
"and",
"then",
"cache",
"it"
] | a5999448a0abab4d542413002a780ede391e7374 | https://github.com/andyburton/Sonic-Framework/blob/a5999448a0abab4d542413002a780ede391e7374/src/Memcached.php#L67-L117 |
203,984 | andyburton/Sonic-Framework | src/Memcached.php | Memcached.delete | public function delete ($pkValue = FALSE)
{
// If there is no key value passed set it
if ($pkValue === FALSE)
{
$pkValue = $this->iget (static::$pk);
}
// Call parent method
$parent = parent::delete ($pkValue);
if ($parent === FALSE)
{
return FALSE;
}
// If there is a memcac... | php | public function delete ($pkValue = FALSE)
{
// If there is no key value passed set it
if ($pkValue === FALSE)
{
$pkValue = $this->iget (static::$pk);
}
// Call parent method
$parent = parent::delete ($pkValue);
if ($parent === FALSE)
{
return FALSE;
}
// If there is a memcac... | [
"public",
"function",
"delete",
"(",
"$",
"pkValue",
"=",
"FALSE",
")",
"{",
"// If there is no key value passed set it",
"if",
"(",
"$",
"pkValue",
"===",
"FALSE",
")",
"{",
"$",
"pkValue",
"=",
"$",
"this",
"->",
"iget",
"(",
"static",
"::",
"$",
"pk",
... | Delete an object in the database and memcached
@param mixed $pkValue Primary key value
@return boolean | [
"Delete",
"an",
"object",
"in",
"the",
"database",
"and",
"memcached"
] | a5999448a0abab4d542413002a780ede391e7374 | https://github.com/andyburton/Sonic-Framework/blob/a5999448a0abab4d542413002a780ede391e7374/src/Memcached.php#L165-L195 |
203,985 | andyburton/Sonic-Framework | src/Memcached.php | Memcached.getCacheAttributes | private function getCacheAttributes ()
{
$attributes = array ();
foreach (array_keys (self::$attributes) as $name)
{
$attributes[$name] = $this->iget ($name);
}
return $attributes;
} | php | private function getCacheAttributes ()
{
$attributes = array ();
foreach (array_keys (self::$attributes) as $name)
{
$attributes[$name] = $this->iget ($name);
}
return $attributes;
} | [
"private",
"function",
"getCacheAttributes",
"(",
")",
"{",
"$",
"attributes",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"array_keys",
"(",
"self",
"::",
"$",
"attributes",
")",
"as",
"$",
"name",
")",
"{",
"$",
"attributes",
"[",
"$",
"name",
"]",
... | Return object attributes to cache
@return array | [
"Return",
"object",
"attributes",
"to",
"cache"
] | a5999448a0abab4d542413002a780ede391e7374 | https://github.com/andyburton/Sonic-Framework/blob/a5999448a0abab4d542413002a780ede391e7374/src/Memcached.php#L225-L237 |
203,986 | andyburton/Sonic-Framework | src/Memcached.php | Memcached.setCacheAttributes | private function setCacheAttributes ($arr)
{
foreach ($arr as $name => $val)
{
$this->iset ($name, $val, FALSE);
}
} | php | private function setCacheAttributes ($arr)
{
foreach ($arr as $name => $val)
{
$this->iset ($name, $val, FALSE);
}
} | [
"private",
"function",
"setCacheAttributes",
"(",
"$",
"arr",
")",
"{",
"foreach",
"(",
"$",
"arr",
"as",
"$",
"name",
"=>",
"$",
"val",
")",
"{",
"$",
"this",
"->",
"iset",
"(",
"$",
"name",
",",
"$",
"val",
",",
"FALSE",
")",
";",
"}",
"}"
] | Set object attributes from cache
@return array | [
"Set",
"object",
"attributes",
"from",
"cache"
] | a5999448a0abab4d542413002a780ede391e7374 | https://github.com/andyburton/Sonic-Framework/blob/a5999448a0abab4d542413002a780ede391e7374/src/Memcached.php#L245-L253 |
203,987 | kmfk/slowdb | src/Database.php | Database.getCollection | public function getCollection($name)
{
$name = strtolower($name);
if ($this->collections->containsKey($name)) {
return $this->collections->get($name);
}
$this->collections->set($name, $this->createCollection($name));
return $this->collections->get($name);
} | php | public function getCollection($name)
{
$name = strtolower($name);
if ($this->collections->containsKey($name)) {
return $this->collections->get($name);
}
$this->collections->set($name, $this->createCollection($name));
return $this->collections->get($name);
} | [
"public",
"function",
"getCollection",
"(",
"$",
"name",
")",
"{",
"$",
"name",
"=",
"strtolower",
"(",
"$",
"name",
")",
";",
"if",
"(",
"$",
"this",
"->",
"collections",
"->",
"containsKey",
"(",
"$",
"name",
")",
")",
"{",
"return",
"$",
"this",
... | Gets a Collection by name
Collections are idempotent, we create a collection if it does not exist
or return existing collections
@param string $name The name of the Collection
@return Collection | [
"Gets",
"a",
"Collection",
"by",
"name"
] | 7461771b8ddc0c9887e2ee69a76ff5ffc763974c | https://github.com/kmfk/slowdb/blob/7461771b8ddc0c9887e2ee69a76ff5ffc763974c/src/Database.php#L67-L78 |
203,988 | kmfk/slowdb | src/Database.php | Database.all | public function all()
{
$results = [];
foreach ($this->collections as $collection) {
$results[] = array_merge(['name' => $collection->name], $collection->info());
}
return $results;
} | php | public function all()
{
$results = [];
foreach ($this->collections as $collection) {
$results[] = array_merge(['name' => $collection->name], $collection->info());
}
return $results;
} | [
"public",
"function",
"all",
"(",
")",
"{",
"$",
"results",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"collections",
"as",
"$",
"collection",
")",
"{",
"$",
"results",
"[",
"]",
"=",
"array_merge",
"(",
"[",
"'name'",
"=>",
"$",
"colle... | Lists the available Collections by name
@return array | [
"Lists",
"the",
"available",
"Collections",
"by",
"name"
] | 7461771b8ddc0c9887e2ee69a76ff5ffc763974c | https://github.com/kmfk/slowdb/blob/7461771b8ddc0c9887e2ee69a76ff5ffc763974c/src/Database.php#L85-L93 |
203,989 | kmfk/slowdb | src/Database.php | Database.drop | public function drop($collection)
{
if (!$this->collections->containsKey($collection)) {
return false;
}
$this->collections->get($collection)->drop();
$this->collections->remove($collection);
return true;
} | php | public function drop($collection)
{
if (!$this->collections->containsKey($collection)) {
return false;
}
$this->collections->get($collection)->drop();
$this->collections->remove($collection);
return true;
} | [
"public",
"function",
"drop",
"(",
"$",
"collection",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"collections",
"->",
"containsKey",
"(",
"$",
"collection",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"this",
"->",
"collections",
"->",
"get",
... | Drops a Collection - removing all data
@param string $collection The name of the Collection to drop | [
"Drops",
"a",
"Collection",
"-",
"removing",
"all",
"data"
] | 7461771b8ddc0c9887e2ee69a76ff5ffc763974c | https://github.com/kmfk/slowdb/blob/7461771b8ddc0c9887e2ee69a76ff5ffc763974c/src/Database.php#L100-L110 |
203,990 | kmfk/slowdb | src/Database.php | Database.loadCollections | private function loadCollections()
{
$collections = new ArrayCollection();
$finder = new Finder();
$finder->files()->name('*.dat')->in($this->filepath);
foreach ($finder as $file) {
$name = $file->getBasename('.dat');
$collections->set($name, $this->createCo... | php | private function loadCollections()
{
$collections = new ArrayCollection();
$finder = new Finder();
$finder->files()->name('*.dat')->in($this->filepath);
foreach ($finder as $file) {
$name = $file->getBasename('.dat');
$collections->set($name, $this->createCo... | [
"private",
"function",
"loadCollections",
"(",
")",
"{",
"$",
"collections",
"=",
"new",
"ArrayCollection",
"(",
")",
";",
"$",
"finder",
"=",
"new",
"Finder",
"(",
")",
";",
"$",
"finder",
"->",
"files",
"(",
")",
"->",
"name",
"(",
"'*.dat'",
")",
... | Loads the collections for the Database
@return ArrayCollection | [
"Loads",
"the",
"collections",
"for",
"the",
"Database"
] | 7461771b8ddc0c9887e2ee69a76ff5ffc763974c | https://github.com/kmfk/slowdb/blob/7461771b8ddc0c9887e2ee69a76ff5ffc763974c/src/Database.php#L127-L140 |
203,991 | samsonos/php_core | src/loader/ContainerManager.php | ContainerManager.collectXmlMetadata | public function collectXmlMetadata(array $metadataCollection) : array
{
// If config path is exists
if (file_exists($this->configPath)) {
// Init resolver
$xmlConfigurator = new XmlResolver(new CollectionClassResolver([
Scope::class,
Name::clas... | php | public function collectXmlMetadata(array $metadataCollection) : array
{
// If config path is exists
if (file_exists($this->configPath)) {
// Init resolver
$xmlConfigurator = new XmlResolver(new CollectionClassResolver([
Scope::class,
Name::clas... | [
"public",
"function",
"collectXmlMetadata",
"(",
"array",
"$",
"metadataCollection",
")",
":",
"array",
"{",
"// If config path is exists",
"if",
"(",
"file_exists",
"(",
"$",
"this",
"->",
"configPath",
")",
")",
"{",
"// Init resolver",
"$",
"xmlConfigurator",
"... | Get xml metadata collection
@param array $metadataCollection
@return array
@throws \Exception | [
"Get",
"xml",
"metadata",
"collection"
] | 15f30528e2efab9e9cf16e9aad3899edced49de1 | https://github.com/samsonos/php_core/blob/15f30528e2efab9e9cf16e9aad3899edced49de1/src/loader/ContainerManager.php#L79-L103 |
203,992 | samsonos/php_core | src/loader/ContainerManager.php | ContainerManager.getDefaultPropertyValue | public function getDefaultPropertyValue($className, $propertyName)
{
$reflection = new \ReflectionClass($className);
$values = $reflection->getDefaultProperties();
return $values[$propertyName] ?? null;
} | php | public function getDefaultPropertyValue($className, $propertyName)
{
$reflection = new \ReflectionClass($className);
$values = $reflection->getDefaultProperties();
return $values[$propertyName] ?? null;
} | [
"public",
"function",
"getDefaultPropertyValue",
"(",
"$",
"className",
",",
"$",
"propertyName",
")",
"{",
"$",
"reflection",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"className",
")",
";",
"$",
"values",
"=",
"$",
"reflection",
"->",
"getDefaultPropert... | Get default property value by property name
@param $className
@param $propertyName
@return null | [
"Get",
"default",
"property",
"value",
"by",
"property",
"name"
] | 15f30528e2efab9e9cf16e9aad3899edced49de1 | https://github.com/samsonos/php_core/blob/15f30528e2efab9e9cf16e9aad3899edced49de1/src/loader/ContainerManager.php#L112-L117 |
203,993 | samsonos/php_core | src/loader/ContainerManager.php | ContainerManager.createMetadata | public function createMetadata($class, $name, $path, $scope = 'module') : ClassMetadata
{
$metadata = new ClassMetadata();
$class = ltrim($class, '\\');
$name = strtolower(ltrim($name, '\\'));
$metadata->className = $class;
$metadata->name = str_replace(['\\', '/'], '_', $nam... | php | public function createMetadata($class, $name, $path, $scope = 'module') : ClassMetadata
{
$metadata = new ClassMetadata();
$class = ltrim($class, '\\');
$name = strtolower(ltrim($name, '\\'));
$metadata->className = $class;
$metadata->name = str_replace(['\\', '/'], '_', $nam... | [
"public",
"function",
"createMetadata",
"(",
"$",
"class",
",",
"$",
"name",
",",
"$",
"path",
",",
"$",
"scope",
"=",
"'module'",
")",
":",
"ClassMetadata",
"{",
"$",
"metadata",
"=",
"new",
"ClassMetadata",
"(",
")",
";",
"$",
"class",
"=",
"ltrim",
... | Create metadata for module
@param $class
@param $name
@param $path
@param string $scope
@return ClassMetadata | [
"Create",
"metadata",
"for",
"module"
] | 15f30528e2efab9e9cf16e9aad3899edced49de1 | https://github.com/samsonos/php_core/blob/15f30528e2efab9e9cf16e9aad3899edced49de1/src/loader/ContainerManager.php#L128-L154 |
203,994 | samsonos/php_core | src/loader/ContainerManager.php | ContainerManager.collectAnnotationMetadata | public function collectAnnotationMetadata($classes, $metadataCollection)
{
// Load annotation and parse classes
new Injectable();
new InjectArgument(['var' => 'type']);
new Service(['value' => '']);
$reader = new AnnotationReader();
$resolver = new AnnotationResolver... | php | public function collectAnnotationMetadata($classes, $metadataCollection)
{
// Load annotation and parse classes
new Injectable();
new InjectArgument(['var' => 'type']);
new Service(['value' => '']);
$reader = new AnnotationReader();
$resolver = new AnnotationResolver... | [
"public",
"function",
"collectAnnotationMetadata",
"(",
"$",
"classes",
",",
"$",
"metadataCollection",
")",
"{",
"// Load annotation and parse classes",
"new",
"Injectable",
"(",
")",
";",
"new",
"InjectArgument",
"(",
"[",
"'var'",
"=>",
"'type'",
"]",
")",
";",... | Get annotation metadata
@param $classes
@param $metadataCollection
@return array|\samsonframework\container\metadata\ClassMetadata[] | [
"Get",
"annotation",
"metadata"
] | 15f30528e2efab9e9cf16e9aad3899edced49de1 | https://github.com/samsonos/php_core/blob/15f30528e2efab9e9cf16e9aad3899edced49de1/src/loader/ContainerManager.php#L269-L287 |
203,995 | danhanly/signalert | src/Signalert/Resolver.php | Resolver.getRenderer | public function getRenderer()
{
// Attempt to retrieve the renderer config
$config = new Config($this->configDirectory);
$rendererClass = $config->getRenderer();
// Validate Renderer Class
$reflection = new ReflectionClass($rendererClass);
// Ensure class is built wit... | php | public function getRenderer()
{
// Attempt to retrieve the renderer config
$config = new Config($this->configDirectory);
$rendererClass = $config->getRenderer();
// Validate Renderer Class
$reflection = new ReflectionClass($rendererClass);
// Ensure class is built wit... | [
"public",
"function",
"getRenderer",
"(",
")",
"{",
"// Attempt to retrieve the renderer config",
"$",
"config",
"=",
"new",
"Config",
"(",
"$",
"this",
"->",
"configDirectory",
")",
";",
"$",
"rendererClass",
"=",
"$",
"config",
"->",
"getRenderer",
"(",
")",
... | Returns a valid renderer class
@return RendererInterface
@throws Exception\SignalertInvalidRendererException
@throws SignalertResolverException | [
"Returns",
"a",
"valid",
"renderer",
"class"
] | 21ee50e3fc0352306a2966b555984b5c9eada582 | https://github.com/danhanly/signalert/blob/21ee50e3fc0352306a2966b555984b5c9eada582/src/Signalert/Resolver.php#L32-L45 |
203,996 | danhanly/signalert | src/Signalert/Resolver.php | Resolver.getDriver | public function getDriver()
{
// Attempt to retrieve the driver config
$config = new Config($this->configDirectory);
$driverClass = $config->getDriver();
// Validate Driver Class
$reflection = new ReflectionClass($driverClass);
// Ensure class is built with the correc... | php | public function getDriver()
{
// Attempt to retrieve the driver config
$config = new Config($this->configDirectory);
$driverClass = $config->getDriver();
// Validate Driver Class
$reflection = new ReflectionClass($driverClass);
// Ensure class is built with the correc... | [
"public",
"function",
"getDriver",
"(",
")",
"{",
"// Attempt to retrieve the driver config",
"$",
"config",
"=",
"new",
"Config",
"(",
"$",
"this",
"->",
"configDirectory",
")",
";",
"$",
"driverClass",
"=",
"$",
"config",
"->",
"getDriver",
"(",
")",
";",
... | Returns a valid driver class
@return DriverInterface
@throws SignalertResolverException | [
"Returns",
"a",
"valid",
"driver",
"class"
] | 21ee50e3fc0352306a2966b555984b5c9eada582 | https://github.com/danhanly/signalert/blob/21ee50e3fc0352306a2966b555984b5c9eada582/src/Signalert/Resolver.php#L53-L67 |
203,997 | skillberto/SonataExtendedAdminBundle | Controller/CRUDController.php | CRUDController.activateAction | public function activateAction()
{
$object = $this->getObject();
if (method_exists($object, 'setActive') && method_exists($object, 'getActive')) {
$object->setActive(($object->getActive()==1) ? 0 : 1);
}
$this->admin->update($object);
... | php | public function activateAction()
{
$object = $this->getObject();
if (method_exists($object, 'setActive') && method_exists($object, 'getActive')) {
$object->setActive(($object->getActive()==1) ? 0 : 1);
}
$this->admin->update($object);
... | [
"public",
"function",
"activateAction",
"(",
")",
"{",
"$",
"object",
"=",
"$",
"this",
"->",
"getObject",
"(",
")",
";",
"if",
"(",
"method_exists",
"(",
"$",
"object",
",",
"'setActive'",
")",
"&&",
"method_exists",
"(",
"$",
"object",
",",
"'getActive... | Activate or inactivate the object
@throws Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
@return Symfony\Component\HttpFoundation\RedirectResponse | [
"Activate",
"or",
"inactivate",
"the",
"object"
] | 5ca04cab25181e78b7ee4e866ae0567bd074fa41 | https://github.com/skillberto/SonataExtendedAdminBundle/blob/5ca04cab25181e78b7ee4e866ae0567bd074fa41/Controller/CRUDController.php#L23-L34 |
203,998 | oliwierptak/Everon1 | src/Everon/Helper/Asserts/IsArray.php | IsArray.assertIsArray | public function assertIsArray($value, $message='%s must be an Array', $exception='Asserts')
{
if (isset($value) === false || is_array($value) === false) {
$this->throwException($exception, $message, $value);
}
} | php | public function assertIsArray($value, $message='%s must be an Array', $exception='Asserts')
{
if (isset($value) === false || is_array($value) === false) {
$this->throwException($exception, $message, $value);
}
} | [
"public",
"function",
"assertIsArray",
"(",
"$",
"value",
",",
"$",
"message",
"=",
"'%s must be an Array'",
",",
"$",
"exception",
"=",
"'Asserts'",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"value",
")",
"===",
"false",
"||",
"is_array",
"(",
"$",
"value... | Verifies that the specified condition is array.
The assertion fails if the condition is not array.
@param mixed $value
@param string $message
@param string $exception
@throws \Everon\Exception\Asserts | [
"Verifies",
"that",
"the",
"specified",
"condition",
"is",
"array",
".",
"The",
"assertion",
"fails",
"if",
"the",
"condition",
"is",
"not",
"array",
"."
] | ac93793d1fa517a8394db5f00062f1925dc218a3 | https://github.com/oliwierptak/Everon1/blob/ac93793d1fa517a8394db5f00062f1925dc218a3/src/Everon/Helper/Asserts/IsArray.php#L23-L28 |
203,999 | RowlandOti/ooglee-blogmodule | src/OoGlee/Application/Entities/Post/Category/CategoryResponse.php | PostResponse.make | public function make(ICategory $category)
{
//$category->setResponse($this->response->view('admin.categorys.view', compact('category')));
$category->setResponse($this->response->view(\OogleeBConfig::get('config.category_view.view'), compact('category')));
} | php | public function make(ICategory $category)
{
//$category->setResponse($this->response->view('admin.categorys.view', compact('category')));
$category->setResponse($this->response->view(\OogleeBConfig::get('config.category_view.view'), compact('category')));
} | [
"public",
"function",
"make",
"(",
"ICategory",
"$",
"category",
")",
"{",
"//$category->setResponse($this->response->view('admin.categorys.view', compact('category')));\r",
"$",
"category",
"->",
"setResponse",
"(",
"$",
"this",
"->",
"response",
"->",
"view",
"(",
"\\",... | Make the category response.
@param ICategory $category | [
"Make",
"the",
"category",
"response",
"."
] | d9c0fe4745bb09f8b94047b0cda4fd7438cde16a | https://github.com/RowlandOti/ooglee-blogmodule/blob/d9c0fe4745bb09f8b94047b0cda4fd7438cde16a/src/OoGlee/Application/Entities/Post/Category/CategoryResponse.php#L40-L44 |
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.