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,500 | ScreamingDev/phpsemver | lib/PHPSemVer/Console/AbstractCommand.php | AbstractCommand.getWrapperInstance | protected function getWrapperInstance($base, $type = 'Directory')
{
$wrapper = $this->getWrapperClass($type);
if ( ! $wrapper) {
throw new \InvalidArgumentException(
sprintf(
'<error>Unknown wrapper-type "%s"</error>',
$type
... | php | protected function getWrapperInstance($base, $type = 'Directory')
{
$wrapper = $this->getWrapperClass($type);
if ( ! $wrapper) {
throw new \InvalidArgumentException(
sprintf(
'<error>Unknown wrapper-type "%s"</error>',
$type
... | [
"protected",
"function",
"getWrapperInstance",
"(",
"$",
"base",
",",
"$",
"type",
"=",
"'Directory'",
")",
"{",
"$",
"wrapper",
"=",
"$",
"this",
"->",
"getWrapperClass",
"(",
"$",
"type",
")",
";",
"if",
"(",
"!",
"$",
"wrapper",
")",
"{",
"throw",
... | Create a wrapper for the given target.
When the target is a directory,
then the type overridden with "Directory".
@param string $base
@param string $type
@return AbstractWrapper | [
"Create",
"a",
"wrapper",
"for",
"the",
"given",
"target",
"."
] | 11a4bc508f71dee73d4f5fee2e9d39e7984d3e15 | https://github.com/ScreamingDev/phpsemver/blob/11a4bc508f71dee73d4f5fee2e9d39e7984d3e15/lib/PHPSemVer/Console/AbstractCommand.php#L251-L271 |
203,501 | ScreamingDev/phpsemver | lib/PHPSemVer/Console/AbstractCommand.php | AbstractCommand.parseFiles | protected function parseFiles($wrapper, $prefix)
{
$this->verbose($prefix . 'Fetching files ...');
$time = microtime(true);
$fileAmount = count($wrapper->getAllFileNames());
$this->verbose(
sprintf(
"\r" . $prefix . "Collected %d files in %0.2f secon... | php | protected function parseFiles($wrapper, $prefix)
{
$this->verbose($prefix . 'Fetching files ...');
$time = microtime(true);
$fileAmount = count($wrapper->getAllFileNames());
$this->verbose(
sprintf(
"\r" . $prefix . "Collected %d files in %0.2f secon... | [
"protected",
"function",
"parseFiles",
"(",
"$",
"wrapper",
",",
"$",
"prefix",
")",
"{",
"$",
"this",
"->",
"verbose",
"(",
"$",
"prefix",
".",
"'Fetching files ...'",
")",
";",
"$",
"time",
"=",
"microtime",
"(",
"true",
")",
";",
"$",
"fileAmount",
... | Parse files within a wrapper.
@param AbstractWrapper $wrapper
@param string $prefix
@return mixed | [
"Parse",
"files",
"within",
"a",
"wrapper",
"."
] | 11a4bc508f71dee73d4f5fee2e9d39e7984d3e15 | https://github.com/ScreamingDev/phpsemver/blob/11a4bc508f71dee73d4f5fee2e9d39e7984d3e15/lib/PHPSemVer/Console/AbstractCommand.php#L348-L386 |
203,502 | ScreamingDev/phpsemver | lib/PHPSemVer/Console/AbstractCommand.php | AbstractCommand.printConfig | protected function printConfig()
{
$config = $this->getConfig();
$output = $this->getOutput();
foreach ($config->ruleSet()->getChildren() as $ruleSet) {
$output->writeln('Using rule set ' . $ruleSet->getName());
if ( ! $output->isDebug()) {
continue;... | php | protected function printConfig()
{
$config = $this->getConfig();
$output = $this->getOutput();
foreach ($config->ruleSet()->getChildren() as $ruleSet) {
$output->writeln('Using rule set ' . $ruleSet->getName());
if ( ! $output->isDebug()) {
continue;... | [
"protected",
"function",
"printConfig",
"(",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"getConfig",
"(",
")",
";",
"$",
"output",
"=",
"$",
"this",
"->",
"getOutput",
"(",
")",
";",
"foreach",
"(",
"$",
"config",
"->",
"ruleSet",
"(",
")",
"... | Print debug information of the used config.
@param Config $config
@param OutputInterface $output | [
"Print",
"debug",
"information",
"of",
"the",
"used",
"config",
"."
] | 11a4bc508f71dee73d4f5fee2e9d39e7984d3e15 | https://github.com/ScreamingDev/phpsemver/blob/11a4bc508f71dee73d4f5fee2e9d39e7984d3e15/lib/PHPSemVer/Console/AbstractCommand.php#L394-L415 |
203,503 | ScreamingDev/phpsemver | lib/PHPSemVer/Console/AbstractCommand.php | AbstractCommand.resolveConfigFile | protected function resolveConfigFile()
{
$ruleSet = $this->getInput()->getOption('ruleSet');
if (null === $ruleSet && file_exists('phpsemver.xml')) {
return 'phpsemver.xml';
}
if (null === $ruleSet) {
$ruleSet = 'SemVer2';
}
if (file_exists(... | php | protected function resolveConfigFile()
{
$ruleSet = $this->getInput()->getOption('ruleSet');
if (null === $ruleSet && file_exists('phpsemver.xml')) {
return 'phpsemver.xml';
}
if (null === $ruleSet) {
$ruleSet = 'SemVer2';
}
if (file_exists(... | [
"protected",
"function",
"resolveConfigFile",
"(",
")",
"{",
"$",
"ruleSet",
"=",
"$",
"this",
"->",
"getInput",
"(",
")",
"->",
"getOption",
"(",
"'ruleSet'",
")",
";",
"if",
"(",
"null",
"===",
"$",
"ruleSet",
"&&",
"file_exists",
"(",
"'phpsemver.xml'",... | Resolve path to rule set XML.
@param string $ruleSet Path to XML config file.
@return string | [
"Resolve",
"path",
"to",
"rule",
"set",
"XML",
"."
] | 11a4bc508f71dee73d4f5fee2e9d39e7984d3e15 | https://github.com/ScreamingDev/phpsemver/blob/11a4bc508f71dee73d4f5fee2e9d39e7984d3e15/lib/PHPSemVer/Console/AbstractCommand.php#L424-L448 |
203,504 | infusephp/auth | src/Models/UserLink.php | UserLink.url | public function url()
{
if ($this->type === self::FORGOT_PASSWORD) {
return $this->getApp()['base_url'].'users/forgot/'.$this->link;
} else if ($this->type === self::TEMPORARY) {
return $this->getApp()['base_url'].'users/signup/'.$this->link;
}
return false;
... | php | public function url()
{
if ($this->type === self::FORGOT_PASSWORD) {
return $this->getApp()['base_url'].'users/forgot/'.$this->link;
} else if ($this->type === self::TEMPORARY) {
return $this->getApp()['base_url'].'users/signup/'.$this->link;
}
return false;
... | [
"public",
"function",
"url",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"type",
"===",
"self",
"::",
"FORGOT_PASSWORD",
")",
"{",
"return",
"$",
"this",
"->",
"getApp",
"(",
")",
"[",
"'base_url'",
"]",
".",
"'users/forgot/'",
".",
"$",
"this",
"->... | Gets the URL for this link.
@return string|false | [
"Gets",
"the",
"URL",
"for",
"this",
"link",
"."
] | 720280b4b2635572f331afe8d082e3e88cf54eb7 | https://github.com/infusephp/auth/blob/720280b4b2635572f331afe8d082e3e88cf54eb7/src/Models/UserLink.php#L84-L93 |
203,505 | graze/csv-token | src/Tokeniser/StreamTokeniser.php | StreamTokeniser.getTokens | public function getTokens()
{
fseek($this->stream, 0);
$this->buffer = new StreamBuffer($this->stream, static::BUFFER_SIZE, $this->minLength);
$this->buffer->read();
/** @var Token $last */
$last = null;
while (!$this->buffer->isEof()) {
foreach ($this->... | php | public function getTokens()
{
fseek($this->stream, 0);
$this->buffer = new StreamBuffer($this->stream, static::BUFFER_SIZE, $this->minLength);
$this->buffer->read();
/** @var Token $last */
$last = null;
while (!$this->buffer->isEof()) {
foreach ($this->... | [
"public",
"function",
"getTokens",
"(",
")",
"{",
"fseek",
"(",
"$",
"this",
"->",
"stream",
",",
"0",
")",
";",
"$",
"this",
"->",
"buffer",
"=",
"new",
"StreamBuffer",
"(",
"$",
"this",
"->",
"stream",
",",
"static",
"::",
"BUFFER_SIZE",
",",
"$",
... | Loop through the stream, pulling maximum type length each time, find the largest type that matches and create a
token, then move on length characters
@return Iterator | [
"Loop",
"through",
"the",
"stream",
"pulling",
"maximum",
"type",
"length",
"each",
"time",
"find",
"the",
"largest",
"type",
"that",
"matches",
"and",
"create",
"a",
"token",
"then",
"move",
"on",
"length",
"characters"
] | ad11cfc83e7f0cae56da6844f9216bbaf5c8dcb8 | https://github.com/graze/csv-token/blob/ad11cfc83e7f0cae56da6844f9216bbaf5c8dcb8/src/Tokeniser/StreamTokeniser.php#L61-L104 |
203,506 | pmdevelopment/tool-bundle | Components/Traits/HasDoctrineTrait.php | HasDoctrineTrait.persistAndFlush | public function persistAndFlush()
{
if (0 === func_num_args()) {
throw new \LogicException('Missing arguments');
}
$persists = [];
$entities = func_get_args();
foreach ($entities as $entity) {
if (true === is_array($entity)) {
$persis... | php | public function persistAndFlush()
{
if (0 === func_num_args()) {
throw new \LogicException('Missing arguments');
}
$persists = [];
$entities = func_get_args();
foreach ($entities as $entity) {
if (true === is_array($entity)) {
$persis... | [
"public",
"function",
"persistAndFlush",
"(",
")",
"{",
"if",
"(",
"0",
"===",
"func_num_args",
"(",
")",
")",
"{",
"throw",
"new",
"\\",
"LogicException",
"(",
"'Missing arguments'",
")",
";",
"}",
"$",
"persists",
"=",
"[",
"]",
";",
"$",
"entities",
... | Persist and Flush
@return $this | [
"Persist",
"and",
"Flush"
] | 2cbc9f82c5b33fd7a9d389edd3676e9f70ea8129 | https://github.com/pmdevelopment/tool-bundle/blob/2cbc9f82c5b33fd7a9d389edd3676e9f70ea8129/Components/Traits/HasDoctrineTrait.php#L35-L59 |
203,507 | pmdevelopment/tool-bundle | Components/Traits/HasDoctrineTrait.php | HasDoctrineTrait.removeAndFlush | public function removeAndFlush()
{
if (0 === func_num_args()) {
throw new \LogicException('Missing arguments');
}
foreach (func_get_args() as $remove) {
$this->getDoctrine()->getManager()->remove($remove);
}
$this->getDoctrine()->getManager()->flush(... | php | public function removeAndFlush()
{
if (0 === func_num_args()) {
throw new \LogicException('Missing arguments');
}
foreach (func_get_args() as $remove) {
$this->getDoctrine()->getManager()->remove($remove);
}
$this->getDoctrine()->getManager()->flush(... | [
"public",
"function",
"removeAndFlush",
"(",
")",
"{",
"if",
"(",
"0",
"===",
"func_num_args",
"(",
")",
")",
"{",
"throw",
"new",
"\\",
"LogicException",
"(",
"'Missing arguments'",
")",
";",
"}",
"foreach",
"(",
"func_get_args",
"(",
")",
"as",
"$",
"r... | Remove and Flush
@return $this | [
"Remove",
"and",
"Flush"
] | 2cbc9f82c5b33fd7a9d389edd3676e9f70ea8129 | https://github.com/pmdevelopment/tool-bundle/blob/2cbc9f82c5b33fd7a9d389edd3676e9f70ea8129/Components/Traits/HasDoctrineTrait.php#L66-L79 |
203,508 | amarcinkowski/hospitalplugin | src/WP/Menu.php | Menu.registerPages | public function registerPages()
{
foreach ($this->menus as $menu) {
$this->registerPage($menu['title'], $menu['cap'], $menu['link'], $menu['class'], $menu['callback'], $menu['type']);
}
$this->hideMenu();
} | php | public function registerPages()
{
foreach ($this->menus as $menu) {
$this->registerPage($menu['title'], $menu['cap'], $menu['link'], $menu['class'], $menu['callback'], $menu['type']);
}
$this->hideMenu();
} | [
"public",
"function",
"registerPages",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"menus",
"as",
"$",
"menu",
")",
"{",
"$",
"this",
"->",
"registerPage",
"(",
"$",
"menu",
"[",
"'title'",
"]",
",",
"$",
"menu",
"[",
"'cap'",
"]",
",",
"$",
... | register menu pages | [
"register",
"menu",
"pages"
] | acdc2be5157abfbdcafb4dcf6c6ba505e291263f | https://github.com/amarcinkowski/hospitalplugin/blob/acdc2be5157abfbdcafb4dcf6c6ba505e291263f/src/WP/Menu.php#L65-L71 |
203,509 | amarcinkowski/hospitalplugin | src/WP/Menu.php | Menu.registerPage | private function registerPage($title, $capabilities, $url_param, $class, $callback, $type)
{
if ($type == 'submenu') {
add_submenu_page($this->url, $title, $title, $capabilities, $url_param, array(
$class,
$callback
));
} else {
add... | php | private function registerPage($title, $capabilities, $url_param, $class, $callback, $type)
{
if ($type == 'submenu') {
add_submenu_page($this->url, $title, $title, $capabilities, $url_param, array(
$class,
$callback
));
} else {
add... | [
"private",
"function",
"registerPage",
"(",
"$",
"title",
",",
"$",
"capabilities",
",",
"$",
"url_param",
",",
"$",
"class",
",",
"$",
"callback",
",",
"$",
"type",
")",
"{",
"if",
"(",
"$",
"type",
"==",
"'submenu'",
")",
"{",
"add_submenu_page",
"("... | register using add_submenu_page | [
"register",
"using",
"add_submenu_page"
] | acdc2be5157abfbdcafb4dcf6c6ba505e291263f | https://github.com/amarcinkowski/hospitalplugin/blob/acdc2be5157abfbdcafb4dcf6c6ba505e291263f/src/WP/Menu.php#L86-L99 |
203,510 | graze/csv-token | src/Tokeniser/Token/TokenStore.php | TokenStore.sort | private function sort()
{
// sort by reverse key length
uksort($this->tokens, function ($first, $second) {
return strlen($second) - strlen($first);
});
} | php | private function sort()
{
// sort by reverse key length
uksort($this->tokens, function ($first, $second) {
return strlen($second) - strlen($first);
});
} | [
"private",
"function",
"sort",
"(",
")",
"{",
"// sort by reverse key length",
"uksort",
"(",
"$",
"this",
"->",
"tokens",
",",
"function",
"(",
"$",
"first",
",",
"$",
"second",
")",
"{",
"return",
"strlen",
"(",
"$",
"second",
")",
"-",
"strlen",
"(",
... | Sort the tokens into reverse key length order | [
"Sort",
"the",
"tokens",
"into",
"reverse",
"key",
"length",
"order"
] | ad11cfc83e7f0cae56da6844f9216bbaf5c8dcb8 | https://github.com/graze/csv-token/blob/ad11cfc83e7f0cae56da6844f9216bbaf5c8dcb8/src/Tokeniser/Token/TokenStore.php#L123-L129 |
203,511 | aledefreitas/zlx_security | src/Security/Security.php | Security.validHmac | private function validHmac($hmac, $compareHmac)
{
if(function_exists("hash_equals")) {
return hash_equals($hmac, $compareHmac);
}
$hashLength = mb_strlen($hmac, '8bit');
$compareLength = mb_strlen($compareHmac, '8bit');
if ($hashLength !== $compareLength) {
... | php | private function validHmac($hmac, $compareHmac)
{
if(function_exists("hash_equals")) {
return hash_equals($hmac, $compareHmac);
}
$hashLength = mb_strlen($hmac, '8bit');
$compareLength = mb_strlen($compareHmac, '8bit');
if ($hashLength !== $compareLength) {
... | [
"private",
"function",
"validHmac",
"(",
"$",
"hmac",
",",
"$",
"compareHmac",
")",
"{",
"if",
"(",
"function_exists",
"(",
"\"hash_equals\"",
")",
")",
"{",
"return",
"hash_equals",
"(",
"$",
"hmac",
",",
"$",
"compareHmac",
")",
";",
"}",
"$",
"hashLen... | Validates if the provided hmac is equal to the expected hmac
@param string $hmac Provided hmac
@param string $compareHmac Expected hmac
@return boolean | [
"Validates",
"if",
"the",
"provided",
"hmac",
"is",
"equal",
"to",
"the",
"expected",
"hmac"
] | 3281db6bacfff51695835e1e6fc5bbddcf1a028a | https://github.com/aledefreitas/zlx_security/blob/3281db6bacfff51695835e1e6fc5bbddcf1a028a/src/Security/Security.php#L66-L86 |
203,512 | aledefreitas/zlx_security | src/Security/Security.php | Security.encrypt | public function encrypt($original_string, $cipher_key)
{
$cipher_key = $this->_genKey($cipher_key);
$ivSize = openssl_cipher_iv_length('AES-256-CBC');
$iv = openssl_random_pseudo_bytes($ivSize);
$cipher_text = $iv . openssl_encrypt($original_string, 'AES-256-CBC', $cipher_key, OPEN... | php | public function encrypt($original_string, $cipher_key)
{
$cipher_key = $this->_genKey($cipher_key);
$ivSize = openssl_cipher_iv_length('AES-256-CBC');
$iv = openssl_random_pseudo_bytes($ivSize);
$cipher_text = $iv . openssl_encrypt($original_string, 'AES-256-CBC', $cipher_key, OPEN... | [
"public",
"function",
"encrypt",
"(",
"$",
"original_string",
",",
"$",
"cipher_key",
")",
"{",
"$",
"cipher_key",
"=",
"$",
"this",
"->",
"_genKey",
"(",
"$",
"cipher_key",
")",
";",
"$",
"ivSize",
"=",
"openssl_cipher_iv_length",
"(",
"'AES-256-CBC'",
")",... | Encrypts a string using a secret
@param string $original_string Original string
@param string $cipher_key Secret used to encrypt
@return string | [
"Encrypts",
"a",
"string",
"using",
"a",
"secret"
] | 3281db6bacfff51695835e1e6fc5bbddcf1a028a | https://github.com/aledefreitas/zlx_security/blob/3281db6bacfff51695835e1e6fc5bbddcf1a028a/src/Security/Security.php#L108-L118 |
203,513 | aledefreitas/zlx_security | src/Security/Security.php | Security.decrypt | public function decrypt($cipher_string, $cipher_key)
{
$cipher_key = $this->_genKey($cipher_key);
$hmacSize = 64;
$hmacString = mb_substr($cipher_string, 0, $hmacSize, "8bit");
$cipher_text = mb_substr($cipher_string, $hmacSize, null, "8bit");
if(!$this->validHmac($hmacStri... | php | public function decrypt($cipher_string, $cipher_key)
{
$cipher_key = $this->_genKey($cipher_key);
$hmacSize = 64;
$hmacString = mb_substr($cipher_string, 0, $hmacSize, "8bit");
$cipher_text = mb_substr($cipher_string, $hmacSize, null, "8bit");
if(!$this->validHmac($hmacStri... | [
"public",
"function",
"decrypt",
"(",
"$",
"cipher_string",
",",
"$",
"cipher_key",
")",
"{",
"$",
"cipher_key",
"=",
"$",
"this",
"->",
"_genKey",
"(",
"$",
"cipher_key",
")",
";",
"$",
"hmacSize",
"=",
"64",
";",
"$",
"hmacString",
"=",
"mb_substr",
... | Decrypts a string using a secret
@param string $cipher_string Ciphered string
@param string $cipher_key Secret used to encrypt
@return string | [
"Decrypts",
"a",
"string",
"using",
"a",
"secret"
] | 3281db6bacfff51695835e1e6fc5bbddcf1a028a | https://github.com/aledefreitas/zlx_security/blob/3281db6bacfff51695835e1e6fc5bbddcf1a028a/src/Security/Security.php#L128-L144 |
203,514 | bruno-barros/w.eloquent-framework | src/weloquent/Core/Http/Ajax.php | Ajax.listen | public function listen($action, $logged = 'no', $callable)
{
if (!is_string($action) || strlen($action) == 0)
{
throw new AjaxException("Invalid parameter for the action.");
}
// resolve callable
if (is_callable($callable))
{
$this->registerWithClosure($action, $logged, $callable);
}
else
{
... | php | public function listen($action, $logged = 'no', $callable)
{
if (!is_string($action) || strlen($action) == 0)
{
throw new AjaxException("Invalid parameter for the action.");
}
// resolve callable
if (is_callable($callable))
{
$this->registerWithClosure($action, $logged, $callable);
}
else
{
... | [
"public",
"function",
"listen",
"(",
"$",
"action",
",",
"$",
"logged",
"=",
"'no'",
",",
"$",
"callable",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"action",
")",
"||",
"strlen",
"(",
"$",
"action",
")",
"==",
"0",
")",
"{",
"throw",
"new... | Handle the Ajax response. Run the appropriate
action hooks used by WordPress in order to perform
POST ajax request securely.
Developers have the option to run ajax for the
Front-end, Back-end either users are logged in or not
or both.
@param string $action Your ajax 'action' name
@param string $logged Accepted values ... | [
"Handle",
"the",
"Ajax",
"response",
".",
"Run",
"the",
"appropriate",
"action",
"hooks",
"used",
"by",
"WordPress",
"in",
"order",
"to",
"perform",
"POST",
"ajax",
"request",
"securely",
".",
"Developers",
"have",
"the",
"option",
"to",
"run",
"ajax",
"for"... | d252dcb1ba1b6b1cecf67877d7d6d3ba57ebedbd | https://github.com/bruno-barros/w.eloquent-framework/blob/d252dcb1ba1b6b1cecf67877d7d6d3ba57ebedbd/src/weloquent/Core/Http/Ajax.php#L43-L82 |
203,515 | bruno-barros/w.eloquent-framework | src/weloquent/Core/Http/Ajax.php | Ajax.validate | public function validate($nonce = null, $value = null, $message = null, $data = null)
{
$nonce = ($nonce) ? $nonce : $this->app['request']->get('nonce');
$value = ($value) ? $value : $this->app['config']->get('app.key');
if (!wp_verify_nonce($nonce, $value))
{
$default = ($msg = trans('ajax.invalid')) ? $... | php | public function validate($nonce = null, $value = null, $message = null, $data = null)
{
$nonce = ($nonce) ? $nonce : $this->app['request']->get('nonce');
$value = ($value) ? $value : $this->app['config']->get('app.key');
if (!wp_verify_nonce($nonce, $value))
{
$default = ($msg = trans('ajax.invalid')) ? $... | [
"public",
"function",
"validate",
"(",
"$",
"nonce",
"=",
"null",
",",
"$",
"value",
"=",
"null",
",",
"$",
"message",
"=",
"null",
",",
"$",
"data",
"=",
"null",
")",
"{",
"$",
"nonce",
"=",
"(",
"$",
"nonce",
")",
"?",
"$",
"nonce",
":",
"$",... | Check nonce against app.key
@param null|string $nonce By default will use 'nonce' index
@param null|string $value By default will get app.key
@param null|string $message By default try to get translation on ajax.invalid
@param null|mixed $data | [
"Check",
"nonce",
"against",
"app",
".",
"key"
] | d252dcb1ba1b6b1cecf67877d7d6d3ba57ebedbd | https://github.com/bruno-barros/w.eloquent-framework/blob/d252dcb1ba1b6b1cecf67877d7d6d3ba57ebedbd/src/weloquent/Core/Http/Ajax.php#L93-L111 |
203,516 | kmfk/slowdb | src/File.php | File.insert | public function insert($key, $value)
{
$this->file->flock(LOCK_SH);
$this->file->fseek(0, SEEK_END);
$position = $this->file->ftell();
if (is_array($value) || is_object($value)) {
$value = json_encode($value);
}
$this->file->flock(LOCK_EX);
$thi... | php | public function insert($key, $value)
{
$this->file->flock(LOCK_SH);
$this->file->fseek(0, SEEK_END);
$position = $this->file->ftell();
if (is_array($value) || is_object($value)) {
$value = json_encode($value);
}
$this->file->flock(LOCK_EX);
$thi... | [
"public",
"function",
"insert",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"file",
"->",
"flock",
"(",
"LOCK_SH",
")",
";",
"$",
"this",
"->",
"file",
"->",
"fseek",
"(",
"0",
",",
"SEEK_END",
")",
";",
"$",
"position",
"=",... | Write the new record to the database file
We store metadata (lengths) in the first 8 bytes of each row
allowing us to use binary searches and indexing key/value positions
@param string $key The Key to be stored
@param mixed $value The Value to be stored
@return integer Returns the position of the data | [
"Write",
"the",
"new",
"record",
"to",
"the",
"database",
"file"
] | 7461771b8ddc0c9887e2ee69a76ff5ffc763974c | https://github.com/kmfk/slowdb/blob/7461771b8ddc0c9887e2ee69a76ff5ffc763974c/src/File.php#L75-L96 |
203,517 | kmfk/slowdb | src/File.php | File.read | public function read($position)
{
$this->file->flock(LOCK_SH);
$metadata = $this->getMetadata($position);
$this->file->fseek($metadata->klen, SEEK_CUR);
$value = $this->file->fread($metadata->vlen);
$this->file->flock(LOCK_UN);
$mixed = json_decode($value, true);
... | php | public function read($position)
{
$this->file->flock(LOCK_SH);
$metadata = $this->getMetadata($position);
$this->file->fseek($metadata->klen, SEEK_CUR);
$value = $this->file->fread($metadata->vlen);
$this->file->flock(LOCK_UN);
$mixed = json_decode($value, true);
... | [
"public",
"function",
"read",
"(",
"$",
"position",
")",
"{",
"$",
"this",
"->",
"file",
"->",
"flock",
"(",
"LOCK_SH",
")",
";",
"$",
"metadata",
"=",
"$",
"this",
"->",
"getMetadata",
"(",
"$",
"position",
")",
";",
"$",
"this",
"->",
"file",
"->... | Retrieves the data from the database for a Key based on position
@param integer $position The offset in the file where the data is stored
@return array | [
"Retrieves",
"the",
"data",
"from",
"the",
"database",
"for",
"a",
"Key",
"based",
"on",
"position"
] | 7461771b8ddc0c9887e2ee69a76ff5ffc763974c | https://github.com/kmfk/slowdb/blob/7461771b8ddc0c9887e2ee69a76ff5ffc763974c/src/File.php#L105-L120 |
203,518 | kmfk/slowdb | src/File.php | File.update | public function update($position, $key, $value)
{
$this->remove($position);
return $this->insert($key, $value);
} | php | public function update($position, $key, $value)
{
$this->remove($position);
return $this->insert($key, $value);
} | [
"public",
"function",
"update",
"(",
"$",
"position",
",",
"$",
"key",
",",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"remove",
"(",
"$",
"position",
")",
";",
"return",
"$",
"this",
"->",
"insert",
"(",
"$",
"key",
",",
"$",
"value",
")",
";",
... | Updates an existing key by removing it from the existing file and
appending the new value to the end of the file.
@param string $key The Key to be stored
@param mixed $value The Value to be stored
@return integer | [
"Updates",
"an",
"existing",
"key",
"by",
"removing",
"it",
"from",
"the",
"existing",
"file",
"and",
"appending",
"the",
"new",
"value",
"to",
"the",
"end",
"of",
"the",
"file",
"."
] | 7461771b8ddc0c9887e2ee69a76ff5ffc763974c | https://github.com/kmfk/slowdb/blob/7461771b8ddc0c9887e2ee69a76ff5ffc763974c/src/File.php#L131-L136 |
203,519 | kmfk/slowdb | src/File.php | File.truncate | public function truncate()
{
$this->file->flock(LOCK_EX);
$result = $this->file->ftruncate(0);
$this->file->flock(LOCK_UN);
return $result;
} | php | public function truncate()
{
$this->file->flock(LOCK_EX);
$result = $this->file->ftruncate(0);
$this->file->flock(LOCK_UN);
return $result;
} | [
"public",
"function",
"truncate",
"(",
")",
"{",
"$",
"this",
"->",
"file",
"->",
"flock",
"(",
"LOCK_EX",
")",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"file",
"->",
"ftruncate",
"(",
"0",
")",
";",
"$",
"this",
"->",
"file",
"->",
"flock",
"... | Truncates the collection, removing all the data from the file
@return bool | [
"Truncates",
"the",
"collection",
"removing",
"all",
"the",
"data",
"from",
"the",
"file"
] | 7461771b8ddc0c9887e2ee69a76ff5ffc763974c | https://github.com/kmfk/slowdb/blob/7461771b8ddc0c9887e2ee69a76ff5ffc763974c/src/File.php#L174-L181 |
203,520 | alphacomm/alpharpc | src/AlphaRPC/Common/Socket/Socket.php | Socket.create | public static function create($context, $type, LoggerInterface $logger = null, $persistentId = null, $onNewSocket = null)
{
if (!is_callable($onNewSocket)) {
$onNewSocket = null;
}
$newSocket = false;
$callback = function() use ($onNewSocket, &$newSocket) {
$... | php | public static function create($context, $type, LoggerInterface $logger = null, $persistentId = null, $onNewSocket = null)
{
if (!is_callable($onNewSocket)) {
$onNewSocket = null;
}
$newSocket = false;
$callback = function() use ($onNewSocket, &$newSocket) {
$... | [
"public",
"static",
"function",
"create",
"(",
"$",
"context",
",",
"$",
"type",
",",
"LoggerInterface",
"$",
"logger",
"=",
"null",
",",
"$",
"persistentId",
"=",
"null",
",",
"$",
"onNewSocket",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_callable",
"... | Create a new Socket.
@param \ZMQContext $context The Context to create this Socket with
@param integer $type One of the ZMQ::SOCKET_{PUB,SUB,PUSH,PULL,REQ,REP,ROUTER,DEALER} contants.
@param LoggerInterface $logger A Logger
@param string $persistentId When using a persistent soc... | [
"Create",
"a",
"new",
"Socket",
"."
] | cf162854500554c4ba8d39f2675de35a49c30ed0 | https://github.com/alphacomm/alpharpc/blob/cf162854500554c4ba8d39f2675de35a49c30ed0/src/AlphaRPC/Common/Socket/Socket.php#L54-L79 |
203,521 | alphacomm/alpharpc | src/AlphaRPC/Common/Socket/Socket.php | Socket.hasEvents | public function hasEvents($timeout = 0)
{
$poll = new ZMQPoll();
$poll->add($this, ZMQ::POLL_IN);
$read = $write = array();
$events = $poll->poll($read, $write, $timeout);
if ($events > 0) {
return true;
}
return false;
} | php | public function hasEvents($timeout = 0)
{
$poll = new ZMQPoll();
$poll->add($this, ZMQ::POLL_IN);
$read = $write = array();
$events = $poll->poll($read, $write, $timeout);
if ($events > 0) {
return true;
}
return false;
} | [
"public",
"function",
"hasEvents",
"(",
"$",
"timeout",
"=",
"0",
")",
"{",
"$",
"poll",
"=",
"new",
"ZMQPoll",
"(",
")",
";",
"$",
"poll",
"->",
"add",
"(",
"$",
"this",
",",
"ZMQ",
"::",
"POLL_IN",
")",
";",
"$",
"read",
"=",
"$",
"write",
"=... | Poll for new Events on this Socket.
@param integer $timeout Timeout in milliseconds. Defaults to 0 (return immediately).
@return boolean | [
"Poll",
"for",
"new",
"Events",
"on",
"this",
"Socket",
"."
] | cf162854500554c4ba8d39f2675de35a49c30ed0 | https://github.com/alphacomm/alpharpc/blob/cf162854500554c4ba8d39f2675de35a49c30ed0/src/AlphaRPC/Common/Socket/Socket.php#L88-L99 |
203,522 | alphacomm/alpharpc | src/AlphaRPC/Common/Socket/Socket.php | Socket.mrecv | public function mrecv($mode = 0)
{
if ($this->verbose) {
$this->getLogger()->debug('PRE RECV: '.$this->id);
}
$data = array();
while (true) {
$data[] = $this->recv($mode);
if (!$this->getSockOpt(ZMQ::SOCKOPT_RCVMORE)) {
break;
... | php | public function mrecv($mode = 0)
{
if ($this->verbose) {
$this->getLogger()->debug('PRE RECV: '.$this->id);
}
$data = array();
while (true) {
$data[] = $this->recv($mode);
if (!$this->getSockOpt(ZMQ::SOCKOPT_RCVMORE)) {
break;
... | [
"public",
"function",
"mrecv",
"(",
"$",
"mode",
"=",
"0",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"verbose",
")",
"{",
"$",
"this",
"->",
"getLogger",
"(",
")",
"->",
"debug",
"(",
"'PRE RECV: '",
".",
"$",
"this",
"->",
"id",
")",
";",
"}",
"... | Receive a Message.
Use this instead of {@see ::recv}.
@param int $mode
@return \AlphaRPC\Common\Socket\Message | [
"Receive",
"a",
"Message",
"."
] | cf162854500554c4ba8d39f2675de35a49c30ed0 | https://github.com/alphacomm/alpharpc/blob/cf162854500554c4ba8d39f2675de35a49c30ed0/src/AlphaRPC/Common/Socket/Socket.php#L166-L190 |
203,523 | alphacomm/alpharpc | src/AlphaRPC/Common/Socket/Socket.php | Socket.msend | public function msend(Message $msg)
{
if (ZMQ::SOCKET_ROUTER === $this->getSocketType()) {
$msg->prepend($msg->getRoutingInformation());
}
if ($this->verbose) {
$this->getLogger()->debug('SEND: '.$this->id);
$this->getLogger()->debug($msg);
}
... | php | public function msend(Message $msg)
{
if (ZMQ::SOCKET_ROUTER === $this->getSocketType()) {
$msg->prepend($msg->getRoutingInformation());
}
if ($this->verbose) {
$this->getLogger()->debug('SEND: '.$this->id);
$this->getLogger()->debug($msg);
}
... | [
"public",
"function",
"msend",
"(",
"Message",
"$",
"msg",
")",
"{",
"if",
"(",
"ZMQ",
"::",
"SOCKET_ROUTER",
"===",
"$",
"this",
"->",
"getSocketType",
"(",
")",
")",
"{",
"$",
"msg",
"->",
"prepend",
"(",
"$",
"msg",
"->",
"getRoutingInformation",
"(... | Send a Messsage.
@param Message $msg
@return Socket | [
"Send",
"a",
"Messsage",
"."
] | cf162854500554c4ba8d39f2675de35a49c30ed0 | https://github.com/alphacomm/alpharpc/blob/cf162854500554c4ba8d39f2675de35a49c30ed0/src/AlphaRPC/Common/Socket/Socket.php#L199-L223 |
203,524 | K-Phoen/gaufrette-extras-bundle | DependencyInjection/KPhoenGaufretteExtrasExtension.php | KPhoenGaufretteExtrasExtension.createResolverFactories | private function createResolverFactories($config, ContainerBuilder $container)
{
if (null !== $this->factories) {
return $this->factories;
}
// load bundled adapter factories
$tempContainer = new ContainerBuilder();
$parameterBag = $container->getParameterBag();... | php | private function createResolverFactories($config, ContainerBuilder $container)
{
if (null !== $this->factories) {
return $this->factories;
}
// load bundled adapter factories
$tempContainer = new ContainerBuilder();
$parameterBag = $container->getParameterBag();... | [
"private",
"function",
"createResolverFactories",
"(",
"$",
"config",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"factories",
")",
"{",
"return",
"$",
"this",
"->",
"factories",
";",
"}",
"// load bundle... | Creates the resolver factories
@param array $config
@param ContainerBuilder $container | [
"Creates",
"the",
"resolver",
"factories"
] | 3f05779179117d5649184164544e1f22de28d706 | https://github.com/K-Phoen/gaufrette-extras-bundle/blob/3f05779179117d5649184164544e1f22de28d706/DependencyInjection/KPhoenGaufretteExtrasExtension.php#L66-L92 |
203,525 | hal-platform/hal-core | src/Repository/AuditEventRepository.php | AuditEventRepository.getPagedResults | public function getPagedResults($limit = 50, $page = 0)
{
$dql = sprintf(self::DQL_GET_PAGED, AuditEvent::class);
return $this->getPaginator($dql, $limit, $page);
} | php | public function getPagedResults($limit = 50, $page = 0)
{
$dql = sprintf(self::DQL_GET_PAGED, AuditEvent::class);
return $this->getPaginator($dql, $limit, $page);
} | [
"public",
"function",
"getPagedResults",
"(",
"$",
"limit",
"=",
"50",
",",
"$",
"page",
"=",
"0",
")",
"{",
"$",
"dql",
"=",
"sprintf",
"(",
"self",
"::",
"DQL_GET_PAGED",
",",
"AuditEvent",
"::",
"class",
")",
";",
"return",
"$",
"this",
"->",
"get... | Get all audit events, paged.
@param int $limit
@param int $page
@return Paginator | [
"Get",
"all",
"audit",
"events",
"paged",
"."
] | 30d456f8392fc873301ad4217d2ae90436c67090 | https://github.com/hal-platform/hal-core/blob/30d456f8392fc873301ad4217d2ae90436c67090/src/Repository/AuditEventRepository.php#L33-L37 |
203,526 | zikula/FileSystem | Ftp.php | Ftp.connect | public function connect()
{
$this->errorHandler->start();
//create the connection
if ($this->configuration->getSSL()) {
$this->resource = $this->driver->sslConnect($this->configuration->getHost(), $this->configuration->getPort(), $this->configuration->getTimeout());
} el... | php | public function connect()
{
$this->errorHandler->start();
//create the connection
if ($this->configuration->getSSL()) {
$this->resource = $this->driver->sslConnect($this->configuration->getHost(), $this->configuration->getPort(), $this->configuration->getTimeout());
} el... | [
"public",
"function",
"connect",
"(",
")",
"{",
"$",
"this",
"->",
"errorHandler",
"->",
"start",
"(",
")",
";",
"//create the connection",
"if",
"(",
"$",
"this",
"->",
"configuration",
"->",
"getSSL",
"(",
")",
")",
"{",
"$",
"this",
"->",
"resource",
... | Standard function for creating a FTP connection and logging in.
This must be called before any of the other functions in the
Interface. However the construct itself calles this
function upon completion, which alleviates the need to ever call
this function manualy.
@return boolean | [
"Standard",
"function",
"for",
"creating",
"a",
"FTP",
"connection",
"and",
"logging",
"in",
"."
] | 8e12d6839aa50a7590f5ad22cc2d33c8f88ff726 | https://github.com/zikula/FileSystem/blob/8e12d6839aa50a7590f5ad22cc2d33c8f88ff726/Ftp.php#L47-L75 |
203,527 | zikula/FileSystem | Ftp.php | Ftp.fput | public function fput($stream, $remote)
{
$this->isAlive(true);
$this->errorHandler->start();
if ($this->driver->fput($this->resource, $remote, $stream, FTP_BINARY)) {
$this->errorHandler->stop();
return true;
}
$this->errorHandler->stop();
re... | php | public function fput($stream, $remote)
{
$this->isAlive(true);
$this->errorHandler->start();
if ($this->driver->fput($this->resource, $remote, $stream, FTP_BINARY)) {
$this->errorHandler->stop();
return true;
}
$this->errorHandler->stop();
re... | [
"public",
"function",
"fput",
"(",
"$",
"stream",
",",
"$",
"remote",
")",
"{",
"$",
"this",
"->",
"isAlive",
"(",
"true",
")",
";",
"$",
"this",
"->",
"errorHandler",
"->",
"start",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"driver",
"->",
"f... | Similar to put but does not get the file localy.
This should be used instead of put in most cases.
@param stream|resource $stream The resource to put remotely, probably the resource returned from a fget.
@param string $remote The pathname to the desired remote pathname.
@return integer|boolean number of by... | [
"Similar",
"to",
"put",
"but",
"does",
"not",
"get",
"the",
"file",
"localy",
"."
] | 8e12d6839aa50a7590f5ad22cc2d33c8f88ff726 | https://github.com/zikula/FileSystem/blob/8e12d6839aa50a7590f5ad22cc2d33c8f88ff726/Ftp.php#L113-L125 |
203,528 | zikula/FileSystem | Ftp.php | Ftp.putContents | public function putContents($contents, $remote)
{
$stream = fopen('data://text/plain,' . $contents, 'r');
return $this->fput($stream, $remote);
} | php | public function putContents($contents, $remote)
{
$stream = fopen('data://text/plain,' . $contents, 'r');
return $this->fput($stream, $remote);
} | [
"public",
"function",
"putContents",
"(",
"$",
"contents",
",",
"$",
"remote",
")",
"{",
"$",
"stream",
"=",
"fopen",
"(",
"'data://text/plain,'",
".",
"$",
"contents",
",",
"'r'",
")",
";",
"return",
"$",
"this",
"->",
"fput",
"(",
"$",
"stream",
",",... | Write the contents of a string to the remote.
@param string $contents The contents to put remotely.
@param string $remote The pathname to the desired remote pathname.
@return boolean|integer Number of bytes written on success, false on failure. | [
"Write",
"the",
"contents",
"of",
"a",
"string",
"to",
"the",
"remote",
"."
] | 8e12d6839aa50a7590f5ad22cc2d33c8f88ff726 | https://github.com/zikula/FileSystem/blob/8e12d6839aa50a7590f5ad22cc2d33c8f88ff726/Ftp.php#L135-L140 |
203,529 | zikula/FileSystem | Ftp.php | Ftp.fget | public function fget($remote)
{
$this->isAlive(true);
$this->errorHandler->start();
$handle = fopen('php://temp', 'r+');
if ($this->driver->fget($this->resource, $handle, $remote, FTP_BINARY)) {
rewind($handle);
$this->errorHandler->stop();
return... | php | public function fget($remote)
{
$this->isAlive(true);
$this->errorHandler->start();
$handle = fopen('php://temp', 'r+');
if ($this->driver->fget($this->resource, $handle, $remote, FTP_BINARY)) {
rewind($handle);
$this->errorHandler->stop();
return... | [
"public",
"function",
"fget",
"(",
"$",
"remote",
")",
"{",
"$",
"this",
"->",
"isAlive",
"(",
"true",
")",
";",
"$",
"this",
"->",
"errorHandler",
"->",
"start",
"(",
")",
";",
"$",
"handle",
"=",
"fopen",
"(",
"'php://temp'",
",",
"'r+'",
")",
";... | Similar to get but does not save file localy.
This should usually be used instead of get in most cases.
@param string $remote The path to the remote file.
@return resource|boolean The resource on success false on fail. | [
"Similar",
"to",
"get",
"but",
"does",
"not",
"save",
"file",
"localy",
"."
] | 8e12d6839aa50a7590f5ad22cc2d33c8f88ff726 | https://github.com/zikula/FileSystem/blob/8e12d6839aa50a7590f5ad22cc2d33c8f88ff726/Ftp.php#L189-L203 |
203,530 | villermen/runescape-lookup-commons | src/Activity.php | Activity.getActivity | public static function getActivity(int $id): Activity
{
self::initializeActivities();
if (!isset(self::$activities[$id])) {
throw new RuneScapeException(sprintf("Activity with id %d does not exist.", $id));
}
return self::$activities[$id];
} | php | public static function getActivity(int $id): Activity
{
self::initializeActivities();
if (!isset(self::$activities[$id])) {
throw new RuneScapeException(sprintf("Activity with id %d does not exist.", $id));
}
return self::$activities[$id];
} | [
"public",
"static",
"function",
"getActivity",
"(",
"int",
"$",
"id",
")",
":",
"Activity",
"{",
"self",
"::",
"initializeActivities",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"activities",
"[",
"$",
"id",
"]",
")",
")",
"{",
... | Retrieve an activity by ID.
You can use the ACTIVITY_ constants in this class for IDs.
@param int $id
@return Activity
@throws RuneScapeException When the requested activity does not exist. | [
"Retrieve",
"an",
"activity",
"by",
"ID",
".",
"You",
"can",
"use",
"the",
"ACTIVITY_",
"constants",
"in",
"this",
"class",
"for",
"IDs",
"."
] | 3e24dadbdc5e20b755280e5110f4ca0a1758b04c | https://github.com/villermen/runescape-lookup-commons/blob/3e24dadbdc5e20b755280e5110f4ca0a1758b04c/src/Activity.php#L112-L121 |
203,531 | chilimatic/chilimatic-framework | lib/database/sql/mysql/Command.php | Command.kill_process | public function kill_process($pid)
{
if (!is_numeric($pid)) return false;
$pid = (int)$pid;
$sql = "KILL $pid";
return $this->db->query($sql);
} | php | public function kill_process($pid)
{
if (!is_numeric($pid)) return false;
$pid = (int)$pid;
$sql = "KILL $pid";
return $this->db->query($sql);
} | [
"public",
"function",
"kill_process",
"(",
"$",
"pid",
")",
"{",
"if",
"(",
"!",
"is_numeric",
"(",
"$",
"pid",
")",
")",
"return",
"false",
";",
"$",
"pid",
"=",
"(",
"int",
")",
"$",
"pid",
";",
"$",
"sql",
"=",
"\"KILL $pid\"",
";",
"return",
... | kill a specific process
@param int $pid
@return boolean | [
"kill",
"a",
"specific",
"process"
] | 8df7f12e75d75d3fd2197a58c80d39cbb4b9ff12 | https://github.com/chilimatic/chilimatic-framework/blob/8df7f12e75d75d3fd2197a58c80d39cbb4b9ff12/lib/database/sql/mysql/Command.php#L44-L52 |
203,532 | timostamm/url-builder | src/UrlQuery.php | UrlQuery.setArray | public function setArray($key, array $values)
{
$this->validateKey($key);
if (empty($values)) {
throw new \InvalidArgumentException("Missing value.");
}
foreach ($values as $v) {
$this->validateValue($v);
}
$this->params[$key] = [];
foreach ($values as $v) {
$this->params[$key][] = $v;
}
ret... | php | public function setArray($key, array $values)
{
$this->validateKey($key);
if (empty($values)) {
throw new \InvalidArgumentException("Missing value.");
}
foreach ($values as $v) {
$this->validateValue($v);
}
$this->params[$key] = [];
foreach ($values as $v) {
$this->params[$key][] = $v;
}
ret... | [
"public",
"function",
"setArray",
"(",
"$",
"key",
",",
"array",
"$",
"values",
")",
"{",
"$",
"this",
"->",
"validateKey",
"(",
"$",
"key",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"values",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentExcept... | Sets several values for the given parameter key.
@param string $key
@param array $values
@throws \InvalidArgumentException If the key is empty, the key is not a string, no values are given or a value is not a string.
@return self | [
"Sets",
"several",
"values",
"for",
"the",
"given",
"parameter",
"key",
"."
] | 9dec80635017415d83b7e6ef155e9324f4b27a00 | https://github.com/timostamm/url-builder/blob/9dec80635017415d83b7e6ef155e9324f4b27a00/src/UrlQuery.php#L59-L73 |
203,533 | timostamm/url-builder | src/UrlQuery.php | UrlQuery.remove | public function remove($key)
{
$this->validateKey($key);
if ($this->has($key)) {
unset($this->params[$key]);
return true;
} else {
return false;
}
} | php | public function remove($key)
{
$this->validateKey($key);
if ($this->has($key)) {
unset($this->params[$key]);
return true;
} else {
return false;
}
} | [
"public",
"function",
"remove",
"(",
"$",
"key",
")",
"{",
"$",
"this",
"->",
"validateKey",
"(",
"$",
"key",
")",
";",
"if",
"(",
"$",
"this",
"->",
"has",
"(",
"$",
"key",
")",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"params",
"[",
"$",
... | Return all parameters with the given key.
@param string $key
@return boolean True if the parameter existed. | [
"Return",
"all",
"parameters",
"with",
"the",
"given",
"key",
"."
] | 9dec80635017415d83b7e6ef155e9324f4b27a00 | https://github.com/timostamm/url-builder/blob/9dec80635017415d83b7e6ef155e9324f4b27a00/src/UrlQuery.php#L81-L90 |
203,534 | timostamm/url-builder | src/UrlQuery.php | UrlQuery.replace | public function replace(array $new)
{
foreach ($new as $key => $values) {
$this->validateKey($key);
if (! is_array($values)) {
$values = $new[$key] = [
$values
];
}
foreach ($values as $v) {
$this->validateValue($v);
}
}
foreach ($new as $key => $values) {
$this->setArray($key,... | php | public function replace(array $new)
{
foreach ($new as $key => $values) {
$this->validateKey($key);
if (! is_array($values)) {
$values = $new[$key] = [
$values
];
}
foreach ($values as $v) {
$this->validateValue($v);
}
}
foreach ($new as $key => $values) {
$this->setArray($key,... | [
"public",
"function",
"replace",
"(",
"array",
"$",
"new",
")",
"{",
"foreach",
"(",
"$",
"new",
"as",
"$",
"key",
"=>",
"$",
"values",
")",
"{",
"$",
"this",
"->",
"validateKey",
"(",
"$",
"key",
")",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
... | Sets several new parameters, replacing the old values if already present.
The provided array must be associative with the parameter keys as array
keys and parameter values as array values.
The array values may be either a string (to set a single parameter value)
or an array (to set multiple parameter values).
@param... | [
"Sets",
"several",
"new",
"parameters",
"replacing",
"the",
"old",
"values",
"if",
"already",
"present",
"."
] | 9dec80635017415d83b7e6ef155e9324f4b27a00 | https://github.com/timostamm/url-builder/blob/9dec80635017415d83b7e6ef155e9324f4b27a00/src/UrlQuery.php#L103-L119 |
203,535 | timostamm/url-builder | src/UrlQuery.php | UrlQuery.getArray | public function getArray($key)
{
$this->validateKey($key);
return $this->has($key) ? $this->params[$key] : [];
} | php | public function getArray($key)
{
$this->validateKey($key);
return $this->has($key) ? $this->params[$key] : [];
} | [
"public",
"function",
"getArray",
"(",
"$",
"key",
")",
"{",
"$",
"this",
"->",
"validateKey",
"(",
"$",
"key",
")",
";",
"return",
"$",
"this",
"->",
"has",
"(",
"$",
"key",
")",
"?",
"$",
"this",
"->",
"params",
"[",
"$",
"key",
"]",
":",
"["... | Returns all values of the parameters with the given key.
If no parameter with the given key exists, an empty array is returned.
@param string $key
@return array | [
"Returns",
"all",
"values",
"of",
"the",
"parameters",
"with",
"the",
"given",
"key",
".",
"If",
"no",
"parameter",
"with",
"the",
"given",
"key",
"exists",
"an",
"empty",
"array",
"is",
"returned",
"."
] | 9dec80635017415d83b7e6ef155e9324f4b27a00 | https://github.com/timostamm/url-builder/blob/9dec80635017415d83b7e6ef155e9324f4b27a00/src/UrlQuery.php#L140-L144 |
203,536 | timostamm/url-builder | src/UrlQuery.php | UrlQuery.toArray | public function toArray($onlyFirst = false)
{
$r = [];
foreach ($this->params as $key => $values) {
$r[$key] = $onlyFirst ? $values[0] : $values;
}
return $r;
} | php | public function toArray($onlyFirst = false)
{
$r = [];
foreach ($this->params as $key => $values) {
$r[$key] = $onlyFirst ? $values[0] : $values;
}
return $r;
} | [
"public",
"function",
"toArray",
"(",
"$",
"onlyFirst",
"=",
"false",
")",
"{",
"$",
"r",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"params",
"as",
"$",
"key",
"=>",
"$",
"values",
")",
"{",
"$",
"r",
"[",
"$",
"key",
"]",
"=",
"... | Get all parameters as an associative array with the parameter keys as array keys.
Returns either only the first values of the parameters, or all values of the parameters.
@param boolean $onlyFirst
@return array | [
"Get",
"all",
"parameters",
"as",
"an",
"associative",
"array",
"with",
"the",
"parameter",
"keys",
"as",
"array",
"keys",
".",
"Returns",
"either",
"only",
"the",
"first",
"values",
"of",
"the",
"parameters",
"or",
"all",
"values",
"of",
"the",
"parameters"... | 9dec80635017415d83b7e6ef155e9324f4b27a00 | https://github.com/timostamm/url-builder/blob/9dec80635017415d83b7e6ef155e9324f4b27a00/src/UrlQuery.php#L153-L160 |
203,537 | timostamm/url-builder | src/UrlQuery.php | UrlQuery.count | public function count($key = null)
{
if (is_null($key)) {
return count($this->params);
}
return count($this->getArray($key));
} | php | public function count($key = null)
{
if (is_null($key)) {
return count($this->params);
}
return count($this->getArray($key));
} | [
"public",
"function",
"count",
"(",
"$",
"key",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"key",
")",
")",
"{",
"return",
"count",
"(",
"$",
"this",
"->",
"params",
")",
";",
"}",
"return",
"count",
"(",
"$",
"this",
"->",
"getArray"... | Counts the parameters.
Parameter keys that appear multiple times count as one array parameter.
If the $key parameter is used, the number of values of this parameter are counted.
@param string $key
@return int | [
"Counts",
"the",
"parameters",
".",
"Parameter",
"keys",
"that",
"appear",
"multiple",
"times",
"count",
"as",
"one",
"array",
"parameter",
"."
] | 9dec80635017415d83b7e6ef155e9324f4b27a00 | https://github.com/timostamm/url-builder/blob/9dec80635017415d83b7e6ef155e9324f4b27a00/src/UrlQuery.php#L182-L188 |
203,538 | lrezek/Arachnid | src/LRezek/Arachnid/Meta/Property.php | Property.isProperty | function isProperty()
{
//Get the annotation index
$i = $this->getAnnotationIndex(self::PROPERTY);
//If the property annotation is on here
if($i >= 0)
{
//Set the format (Date, JSON, scalar, etc)
$this->format = $this->annotations[$i]->format;
... | php | function isProperty()
{
//Get the annotation index
$i = $this->getAnnotationIndex(self::PROPERTY);
//If the property annotation is on here
if($i >= 0)
{
//Set the format (Date, JSON, scalar, etc)
$this->format = $this->annotations[$i]->format;
... | [
"function",
"isProperty",
"(",
")",
"{",
"//Get the annotation index",
"$",
"i",
"=",
"$",
"this",
"->",
"getAnnotationIndex",
"(",
"self",
"::",
"PROPERTY",
")",
";",
"//If the property annotation is on here",
"if",
"(",
"$",
"i",
">=",
"0",
")",
"{",
"//Set ... | Checks if this property is indeed a property.
@return bool | [
"Checks",
"if",
"this",
"property",
"is",
"indeed",
"a",
"property",
"."
] | fbfc2c6f9d1dbfeef6f677813c12c570d5ea750a | https://github.com/lrezek/Arachnid/blob/fbfc2c6f9d1dbfeef6f677813c12c570d5ea750a/src/LRezek/Arachnid/Meta/Property.php#L112-L132 |
203,539 | lrezek/Arachnid | src/LRezek/Arachnid/Meta/Property.php | Property.getValue | function getValue($entity)
{
$raw = $this->property->getValue($entity);
switch ($this->format)
{
case 'scalar':
return $raw;
//Serialize classes and arrays before putting them in the DB
case 'object':
case 'array':
... | php | function getValue($entity)
{
$raw = $this->property->getValue($entity);
switch ($this->format)
{
case 'scalar':
return $raw;
//Serialize classes and arrays before putting them in the DB
case 'object':
case 'array':
... | [
"function",
"getValue",
"(",
"$",
"entity",
")",
"{",
"$",
"raw",
"=",
"$",
"this",
"->",
"property",
"->",
"getValue",
"(",
"$",
"entity",
")",
";",
"switch",
"(",
"$",
"this",
"->",
"format",
")",
"{",
"case",
"'scalar'",
":",
"return",
"$",
"raw... | Gets this property's value in the given entity.
@param Relation|Node $entity The entity to get the value from.
@return mixed The property value. | [
"Gets",
"this",
"property",
"s",
"value",
"in",
"the",
"given",
"entity",
"."
] | fbfc2c6f9d1dbfeef6f677813c12c570d5ea750a | https://github.com/lrezek/Arachnid/blob/fbfc2c6f9d1dbfeef6f677813c12c570d5ea750a/src/LRezek/Arachnid/Meta/Property.php#L160-L195 |
203,540 | lrezek/Arachnid | src/LRezek/Arachnid/Meta/Property.php | Property.setValue | function setValue($entity, $value)
{
switch ($this->format)
{
case 'scalar':
$this->property->setValue($entity, $value);
break;
//Unserialize classes and arrays before putting them back in the entity.
case 'object':
cas... | php | function setValue($entity, $value)
{
switch ($this->format)
{
case 'scalar':
$this->property->setValue($entity, $value);
break;
//Unserialize classes and arrays before putting them back in the entity.
case 'object':
cas... | [
"function",
"setValue",
"(",
"$",
"entity",
",",
"$",
"value",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"format",
")",
"{",
"case",
"'scalar'",
":",
"$",
"this",
"->",
"property",
"->",
"setValue",
"(",
"$",
"entity",
",",
"$",
"value",
")",
";"... | Sets this property's value in the given entity.
@param Relation|Node $entity The entity to set the property of.
@param mixed $value The value to set it to. | [
"Sets",
"this",
"property",
"s",
"value",
"in",
"the",
"given",
"entity",
"."
] | fbfc2c6f9d1dbfeef6f677813c12c570d5ea750a | https://github.com/lrezek/Arachnid/blob/fbfc2c6f9d1dbfeef6f677813c12c570d5ea750a/src/LRezek/Arachnid/Meta/Property.php#L203-L233 |
203,541 | lrezek/Arachnid | src/LRezek/Arachnid/Meta/Property.php | Property.matches | function matches($names)
{
//Check every argument supplied
foreach (func_get_args() as $name)
{
//Check for any possible match
if (
0 === strcasecmp($name, $this->name) ||
0 === strcasecmp($name, $this->property->getName()) ||
... | php | function matches($names)
{
//Check every argument supplied
foreach (func_get_args() as $name)
{
//Check for any possible match
if (
0 === strcasecmp($name, $this->name) ||
0 === strcasecmp($name, $this->property->getName()) ||
... | [
"function",
"matches",
"(",
"$",
"names",
")",
"{",
"//Check every argument supplied",
"foreach",
"(",
"func_get_args",
"(",
")",
"as",
"$",
"name",
")",
"{",
"//Check for any possible match",
"if",
"(",
"0",
"===",
"strcasecmp",
"(",
"$",
"name",
",",
"$",
... | Checks if a supplied name matches this property's name.
@param mixed $names List of names to check.
@return bool | [
"Checks",
"if",
"a",
"supplied",
"name",
"matches",
"this",
"property",
"s",
"name",
"."
] | fbfc2c6f9d1dbfeef6f677813c12c570d5ea750a | https://github.com/lrezek/Arachnid/blob/fbfc2c6f9d1dbfeef6f677813c12c570d5ea750a/src/LRezek/Arachnid/Meta/Property.php#L251-L268 |
203,542 | lrezek/Arachnid | src/LRezek/Arachnid/Meta/Property.php | Property.validateAnnotations | private function validateAnnotations()
{
//Count annotations in the annotation namespace, ignore annotations not in our namespace
$count = 0;
foreach($this->annotations as $a)
{
//If you find the namespace in the class name, add to count
if(strrpos(get_class($... | php | private function validateAnnotations()
{
//Count annotations in the annotation namespace, ignore annotations not in our namespace
$count = 0;
foreach($this->annotations as $a)
{
//If you find the namespace in the class name, add to count
if(strrpos(get_class($... | [
"private",
"function",
"validateAnnotations",
"(",
")",
"{",
"//Count annotations in the annotation namespace, ignore annotations not in our namespace",
"$",
"count",
"=",
"0",
";",
"foreach",
"(",
"$",
"this",
"->",
"annotations",
"as",
"$",
"a",
")",
"{",
"//If you fi... | Validates the annotation combination on a property.
@throws Exception If the combination is invalid in some way. | [
"Validates",
"the",
"annotation",
"combination",
"on",
"a",
"property",
"."
] | fbfc2c6f9d1dbfeef6f677813c12c570d5ea750a | https://github.com/lrezek/Arachnid/blob/fbfc2c6f9d1dbfeef6f677813c12c570d5ea750a/src/LRezek/Arachnid/Meta/Property.php#L285-L330 |
203,543 | lrezek/Arachnid | src/LRezek/Arachnid/Meta/Property.php | Property.getAnnotationIndex | private function getAnnotationIndex($name)
{
for($i = 0; $i < count($this->annotations); $i++)
{
if($this->annotations[$i] instanceof $name)
{
return $i;
}
}
return -1;
} | php | private function getAnnotationIndex($name)
{
for($i = 0; $i < count($this->annotations); $i++)
{
if($this->annotations[$i] instanceof $name)
{
return $i;
}
}
return -1;
} | [
"private",
"function",
"getAnnotationIndex",
"(",
"$",
"name",
")",
"{",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"count",
"(",
"$",
"this",
"->",
"annotations",
")",
";",
"$",
"i",
"++",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"anno... | Gets the index of a annotation with the value specified, or -1 if it's not in the annotations array.
@param String $name The annotation class.
@return int The index of the annotation in the annotations array(). | [
"Gets",
"the",
"index",
"of",
"a",
"annotation",
"with",
"the",
"value",
"specified",
"or",
"-",
"1",
"if",
"it",
"s",
"not",
"in",
"the",
"annotations",
"array",
"."
] | fbfc2c6f9d1dbfeef6f677813c12c570d5ea750a | https://github.com/lrezek/Arachnid/blob/fbfc2c6f9d1dbfeef6f677813c12c570d5ea750a/src/LRezek/Arachnid/Meta/Property.php#L338-L349 |
203,544 | PhoxPHP/Glider | src/Model/Uses/Record.php | Record.update | protected function update($keyValue=null, String $key, String $table, Array $properties=[])
{
if (isset($properties[$key])) {
unset($properties[$key]);
}
$this->queryBuilder()->where(
$key, $keyValue
)->update($table, $properties);
} | php | protected function update($keyValue=null, String $key, String $table, Array $properties=[])
{
if (isset($properties[$key])) {
unset($properties[$key]);
}
$this->queryBuilder()->where(
$key, $keyValue
)->update($table, $properties);
} | [
"protected",
"function",
"update",
"(",
"$",
"keyValue",
"=",
"null",
",",
"String",
"$",
"key",
",",
"String",
"$",
"table",
",",
"Array",
"$",
"properties",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"properties",
"[",
"$",
"key",
"]"... | Updates an existing record in the database table.
@param $keyValue <Mixed>
@param $key <String>
@param $table <String>
@param $properties <Array>
@access protected
@return <void> | [
"Updates",
"an",
"existing",
"record",
"in",
"the",
"database",
"table",
"."
] | 17aaf3b7bb6e70ea3ae1f04e30a7690e884bf042 | https://github.com/PhoxPHP/Glider/blob/17aaf3b7bb6e70ea3ae1f04e30a7690e884bf042/src/Model/Uses/Record.php#L115-L125 |
203,545 | bruno-barros/w.eloquent-framework | src/weloquent/Core/Globaljs/GlobalJs.php | GlobalJs.add | public function add($index, $data = null, $toAdmin = false)
{
if (!$this->has($index))
{
$this->data = Arr::add($this->data, $index, $data);
$this->metas = Arr::add($this->metas, $this->firstIndex($index), ['admin' => $toAdmin]);
}
return $this;
} | php | public function add($index, $data = null, $toAdmin = false)
{
if (!$this->has($index))
{
$this->data = Arr::add($this->data, $index, $data);
$this->metas = Arr::add($this->metas, $this->firstIndex($index), ['admin' => $toAdmin]);
}
return $this;
} | [
"public",
"function",
"add",
"(",
"$",
"index",
",",
"$",
"data",
"=",
"null",
",",
"$",
"toAdmin",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"has",
"(",
"$",
"index",
")",
")",
"{",
"$",
"this",
"->",
"data",
"=",
"Arr",
"::... | Append new data
@param string $index Unique identifier
@param null $data
@param bool $toAdmin If show on admin environment
@return $this | [
"Append",
"new",
"data"
] | d252dcb1ba1b6b1cecf67877d7d6d3ba57ebedbd | https://github.com/bruno-barros/w.eloquent-framework/blob/d252dcb1ba1b6b1cecf67877d7d6d3ba57ebedbd/src/weloquent/Core/Globaljs/GlobalJs.php#L49-L59 |
203,546 | bruno-barros/w.eloquent-framework | src/weloquent/Core/Globaljs/GlobalJs.php | GlobalJs.toJson | public function toJson($admin = false)
{
$data = $this->prepareDataToJson($admin);
if (count($data) == 0)
{
return '{}';
}
return json_encode($data);
} | php | public function toJson($admin = false)
{
$data = $this->prepareDataToJson($admin);
if (count($data) == 0)
{
return '{}';
}
return json_encode($data);
} | [
"public",
"function",
"toJson",
"(",
"$",
"admin",
"=",
"false",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"prepareDataToJson",
"(",
"$",
"admin",
")",
";",
"if",
"(",
"count",
"(",
"$",
"data",
")",
"==",
"0",
")",
"{",
"return",
"'{}'",
";... | Return the data as JSON
@param bool $admin
@return string|void | [
"Return",
"the",
"data",
"as",
"JSON"
] | d252dcb1ba1b6b1cecf67877d7d6d3ba57ebedbd | https://github.com/bruno-barros/w.eloquent-framework/blob/d252dcb1ba1b6b1cecf67877d7d6d3ba57ebedbd/src/weloquent/Core/Globaljs/GlobalJs.php#L128-L138 |
203,547 | hummer2k/ConLayout | src/Layout/Layout.php | Layout.load | public function load()
{
if (false === $this->isLoaded) {
$this->getEventManager()->trigger(
__FUNCTION__ . '.pre',
$this,
[]
);
$this->generate();
$this->injectBlocks();
$this->isLoaded = true;
... | php | public function load()
{
if (false === $this->isLoaded) {
$this->getEventManager()->trigger(
__FUNCTION__ . '.pre',
$this,
[]
);
$this->generate();
$this->injectBlocks();
$this->isLoaded = true;
... | [
"public",
"function",
"load",
"(",
")",
"{",
"if",
"(",
"false",
"===",
"$",
"this",
"->",
"isLoaded",
")",
"{",
"$",
"this",
"->",
"getEventManager",
"(",
")",
"->",
"trigger",
"(",
"__FUNCTION__",
".",
"'.pre'",
",",
"$",
"this",
",",
"[",
"]",
"... | inject blocks into the root view model
@return LayoutInterface | [
"inject",
"blocks",
"into",
"the",
"root",
"view",
"model"
] | 15e472eaabc9b23ec6a5547524874e30d95e8d3e | https://github.com/hummer2k/ConLayout/blob/15e472eaabc9b23ec6a5547524874e30d95e8d3e/src/Layout/Layout.php#L97-L117 |
203,548 | hummer2k/ConLayout | src/Layout/Layout.php | Layout.isAllowed | private function isAllowed($blockId, ModelInterface $block)
{
$result = $this->getEventManager()->trigger(
__FUNCTION__,
$this,
[
'block_id' => $blockId,
'block' => $block
]
);
if ($result->stopped()) {
... | php | private function isAllowed($blockId, ModelInterface $block)
{
$result = $this->getEventManager()->trigger(
__FUNCTION__,
$this,
[
'block_id' => $blockId,
'block' => $block
]
);
if ($result->stopped()) {
... | [
"private",
"function",
"isAllowed",
"(",
"$",
"blockId",
",",
"ModelInterface",
"$",
"block",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"getEventManager",
"(",
")",
"->",
"trigger",
"(",
"__FUNCTION__",
",",
"$",
"this",
",",
"[",
"'block_id'",
"=... | Determines whether a block should be allowed given certain parameters
@param string $blockId
@param ModelInterface $block
@return bool | [
"Determines",
"whether",
"a",
"block",
"should",
"be",
"allowed",
"given",
"certain",
"parameters"
] | 15e472eaabc9b23ec6a5547524874e30d95e8d3e | https://github.com/hummer2k/ConLayout/blob/15e472eaabc9b23ec6a5547524874e30d95e8d3e/src/Layout/Layout.php#L175-L189 |
203,549 | hummer2k/ConLayout | src/Layout/Layout.php | Layout.addBlock | public function addBlock($blockId, ModelInterface $block)
{
$this->blockPool->add($blockId, $block);
return $this;
} | php | public function addBlock($blockId, ModelInterface $block)
{
$this->blockPool->add($blockId, $block);
return $this;
} | [
"public",
"function",
"addBlock",
"(",
"$",
"blockId",
",",
"ModelInterface",
"$",
"block",
")",
"{",
"$",
"this",
"->",
"blockPool",
"->",
"add",
"(",
"$",
"blockId",
",",
"$",
"block",
")",
";",
"return",
"$",
"this",
";",
"}"
] | adds a block to the registry
@param string $blockId
@param ModelInterface $block
@return LayoutInterface | [
"adds",
"a",
"block",
"to",
"the",
"registry"
] | 15e472eaabc9b23ec6a5547524874e30d95e8d3e | https://github.com/hummer2k/ConLayout/blob/15e472eaabc9b23ec6a5547524874e30d95e8d3e/src/Layout/Layout.php#L198-L202 |
203,550 | oliwierptak/Everon1 | src/Everon/Domain/Repository.php | Repository.prepareDataForEntity | protected function prepareDataForEntity(array $data)
{
/**
* @var \Everon\DataMapper\Interfaces\Schema\Column $Column
*/
foreach ($this->getMapper()->getTable()->getColumns() as $name => $Column) {
if (array_key_exists($name, $data) === false) {
if ($Col... | php | protected function prepareDataForEntity(array $data)
{
/**
* @var \Everon\DataMapper\Interfaces\Schema\Column $Column
*/
foreach ($this->getMapper()->getTable()->getColumns() as $name => $Column) {
if (array_key_exists($name, $data) === false) {
if ($Col... | [
"protected",
"function",
"prepareDataForEntity",
"(",
"array",
"$",
"data",
")",
"{",
"/**\n * @var \\Everon\\DataMapper\\Interfaces\\Schema\\Column $Column\n */",
"foreach",
"(",
"$",
"this",
"->",
"getMapper",
"(",
")",
"->",
"getTable",
"(",
")",
"->",
... | Makes sure data defined in the Entity is in proper format and all keys are set
@param array $data
@return array
@throws \Everon\Exception\Domain | [
"Makes",
"sure",
"data",
"defined",
"in",
"the",
"Entity",
"is",
"in",
"proper",
"format",
"and",
"all",
"keys",
"are",
"set"
] | ac93793d1fa517a8394db5f00062f1925dc218a3 | https://github.com/oliwierptak/Everon1/blob/ac93793d1fa517a8394db5f00062f1925dc218a3/src/Everon/Domain/Repository.php#L62-L83 |
203,551 | open-orchestra/open-orchestra-display-bundle | DisplayBundle/DisplayBlock/Strategies/SubMenuStrategy.php | SubMenuStrategy.getNodes | protected function getNodes(ReadBlockInterface $block)
{
$nodes = null;
$nodeName = $block->getAttribute('nodeName');
$siteId = $this->currentSiteManager->getSiteId();
if (!is_null($nodeName)) {
$nodes = $this->nodeRepository->getSubMenu($nodeName, $block->getAttribute('... | php | protected function getNodes(ReadBlockInterface $block)
{
$nodes = null;
$nodeName = $block->getAttribute('nodeName');
$siteId = $this->currentSiteManager->getSiteId();
if (!is_null($nodeName)) {
$nodes = $this->nodeRepository->getSubMenu($nodeName, $block->getAttribute('... | [
"protected",
"function",
"getNodes",
"(",
"ReadBlockInterface",
"$",
"block",
")",
"{",
"$",
"nodes",
"=",
"null",
";",
"$",
"nodeName",
"=",
"$",
"block",
"->",
"getAttribute",
"(",
"'nodeName'",
")",
";",
"$",
"siteId",
"=",
"$",
"this",
"->",
"current... | Get nodes to display
@param ReadBlockInterface $block
@return array | [
"Get",
"nodes",
"to",
"display"
] | 0e59e8686dac2d8408b57b63b975b4e5a1aa9472 | https://github.com/open-orchestra/open-orchestra-display-bundle/blob/0e59e8686dac2d8408b57b63b975b4e5a1aa9472/DisplayBundle/DisplayBlock/Strategies/SubMenuStrategy.php#L103-L115 |
203,552 | theloopyewe/ravelry-api.php | src/RavelryApi/ServiceClient.php | ServiceClient.defaultCommandFactory | public static function defaultCommandFactory(Description $description)
{
return function (
$name,
array $args = [],
GuzzleClientInterface $client
) use ($description) {
$operation = null;
if ($description->hasOperation($name)) {
... | php | public static function defaultCommandFactory(Description $description)
{
return function (
$name,
array $args = [],
GuzzleClientInterface $client
) use ($description) {
$operation = null;
if ($description->hasOperation($name)) {
... | [
"public",
"static",
"function",
"defaultCommandFactory",
"(",
"Description",
"$",
"description",
")",
"{",
"return",
"function",
"(",
"$",
"name",
",",
"array",
"$",
"args",
"=",
"[",
"]",
",",
"GuzzleClientInterface",
"$",
"client",
")",
"use",
"(",
"$",
... | We're overriding this to support operation-specific requestion options.
Currently this is for disabling `auth` on specific operations. | [
"We",
"re",
"overriding",
"this",
"to",
"support",
"operation",
"-",
"specific",
"requestion",
"options",
".",
"Currently",
"this",
"is",
"for",
"disabling",
"auth",
"on",
"specific",
"operations",
"."
] | 4dacae056e15cf5fd4e236b79843d0736db1e885 | https://github.com/theloopyewe/ravelry-api.php/blob/4dacae056e15cf5fd4e236b79843d0736db1e885/src/RavelryApi/ServiceClient.php#L20-L48 |
203,553 | theloopyewe/ravelry-api.php | src/RavelryApi/ServiceClient.php | ServiceClient.processConfig | protected function processConfig(array $config)
{
$config['command_factory'] = self::defaultCommandFactory($this->getDescription());
// we'll add our own patched processor after this
parent::processConfig(
array_merge(
$config,
[
... | php | protected function processConfig(array $config)
{
$config['command_factory'] = self::defaultCommandFactory($this->getDescription());
// we'll add our own patched processor after this
parent::processConfig(
array_merge(
$config,
[
... | [
"protected",
"function",
"processConfig",
"(",
"array",
"$",
"config",
")",
"{",
"$",
"config",
"[",
"'command_factory'",
"]",
"=",
"self",
"::",
"defaultCommandFactory",
"(",
"$",
"this",
"->",
"getDescription",
"(",
")",
")",
";",
"// we'll add our own patched... | We're overriding this to use our command factory from above and to use
custom objects for API results. | [
"We",
"re",
"overriding",
"this",
"to",
"use",
"our",
"command",
"factory",
"from",
"above",
"and",
"to",
"use",
"custom",
"objects",
"for",
"API",
"results",
"."
] | 4dacae056e15cf5fd4e236b79843d0736db1e885 | https://github.com/theloopyewe/ravelry-api.php/blob/4dacae056e15cf5fd4e236b79843d0736db1e885/src/RavelryApi/ServiceClient.php#L54-L76 |
203,554 | cyberspectrum/i18n-contao | src/Mapping/Terminal42ChangeLanguage/ArticleContentMap.php | ArticleContentMap.mapElements | private function mapElements(array $elements, array $mainElements, array &$map, array &$inverse): void
{
foreach ($elements as $index => $element) {
$elementId = (int) $element['id'];
if (!array_key_exists($index, $mainElements)) {
$this->logger->warning(
... | php | private function mapElements(array $elements, array $mainElements, array &$map, array &$inverse): void
{
foreach ($elements as $index => $element) {
$elementId = (int) $element['id'];
if (!array_key_exists($index, $mainElements)) {
$this->logger->warning(
... | [
"private",
"function",
"mapElements",
"(",
"array",
"$",
"elements",
",",
"array",
"$",
"mainElements",
",",
"array",
"&",
"$",
"map",
",",
"array",
"&",
"$",
"inverse",
")",
":",
"void",
"{",
"foreach",
"(",
"$",
"elements",
"as",
"$",
"index",
"=>",
... | Map the passed elements.
@param array $elements The elements to map.
@param array $mainElements The main elements.
@param array $map The map to store elements to.
@param array $inverse The inverse map.
@return void | [
"Map",
"the",
"passed",
"elements",
"."
] | 038cf6ea9c609a734d7476fba256bc4b0db236b7 | https://github.com/cyberspectrum/i18n-contao/blob/038cf6ea9c609a734d7476fba256bc4b0db236b7/src/Mapping/Terminal42ChangeLanguage/ArticleContentMap.php#L91-L123 |
203,555 | aryelgois/medools-router | src/Controller.php | Controller.authenticate | public function authenticate(string $auth)
{
if ($this->router === null) {
return;
}
try {
$response = $this->router->authenticate($auth, 'Basic');
if (!($response instanceof Response)) {
$response = new Response;
$response... | php | public function authenticate(string $auth)
{
if ($this->router === null) {
return;
}
try {
$response = $this->router->authenticate($auth, 'Basic');
if (!($response instanceof Response)) {
$response = new Response;
$response... | [
"public",
"function",
"authenticate",
"(",
"string",
"$",
"auth",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"router",
"===",
"null",
")",
"{",
"return",
";",
"}",
"try",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"router",
"->",
"authenticate",
"(",... | Authenticates a Basic Authorization Header
When successful, a JWT is sent. It must be used for Bearer Authentication
with other routes
If the authentication is disabled, a 204 response is sent
@param string $auth Request Authorization Header | [
"Authenticates",
"a",
"Basic",
"Authorization",
"Header"
] | 5d755f53b8099952d60cf15a0eb209af5fa3ca8a | https://github.com/aryelgois/medools-router/blob/5d755f53b8099952d60cf15a0eb209af5fa3ca8a/src/Controller.php#L72-L88 |
203,556 | aryelgois/medools-router | src/Controller.php | Controller.run | public function run(
string $method,
string $uri,
array $headers,
string $body
) {
if ($this->router === null) {
return;
}
try {
$response = $this->router->run($method, $uri, $headers, $body);
if ($response !== null) {
... | php | public function run(
string $method,
string $uri,
array $headers,
string $body
) {
if ($this->router === null) {
return;
}
try {
$response = $this->router->run($method, $uri, $headers, $body);
if ($response !== null) {
... | [
"public",
"function",
"run",
"(",
"string",
"$",
"method",
",",
"string",
"$",
"uri",
",",
"array",
"$",
"headers",
",",
"string",
"$",
"body",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"router",
"===",
"null",
")",
"{",
"return",
";",
"}",
"try",
... | Runs the Router and outputs the Response
@param string $method Requested HTTP method
@param string $uri Requested URI
@param array $headers Request Headers
@param string $body Request Body | [
"Runs",
"the",
"Router",
"and",
"outputs",
"the",
"Response"
] | 5d755f53b8099952d60cf15a0eb209af5fa3ca8a | https://github.com/aryelgois/medools-router/blob/5d755f53b8099952d60cf15a0eb209af5fa3ca8a/src/Controller.php#L98-L116 |
203,557 | acacha/forge-publish | src/Console/Commands/PublishAssignment.php | PublishAssignment.createAssignment | protected function createAssignment()
{
$url = config('forge-publish.url') . config('forge-publish.store_assignment_uri');
try {
$response = $this->http->post($url, [
'form_params' => [
'name' => $this->assignmentName,
'repository_u... | php | protected function createAssignment()
{
$url = config('forge-publish.url') . config('forge-publish.store_assignment_uri');
try {
$response = $this->http->post($url, [
'form_params' => [
'name' => $this->assignmentName,
'repository_u... | [
"protected",
"function",
"createAssignment",
"(",
")",
"{",
"$",
"url",
"=",
"config",
"(",
"'forge-publish.url'",
")",
".",
"config",
"(",
"'forge-publish.store_assignment_uri'",
")",
";",
"try",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"http",
"->",
"... | Create assignment.
@return array|mixed | [
"Create",
"assignment",
"."
] | 010779e3d2297c763b82dc3fbde992edffb3a6c6 | https://github.com/acacha/forge-publish/blob/010779e3d2297c763b82dc3fbde992edffb3a6c6/src/Console/Commands/PublishAssignment.php#L139-L164 |
203,558 | PHPColibri/framework | Database/Concrete/MySQL/Connection.php | Connection.close | public function close()
{
if ( ! $this->link->close()) {
throw new DbException('can\'t close database connection: ' . $this->link->error, $this->link->errno);
}
return true;
} | php | public function close()
{
if ( ! $this->link->close()) {
throw new DbException('can\'t close database connection: ' . $this->link->error, $this->link->errno);
}
return true;
} | [
"public",
"function",
"close",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"link",
"->",
"close",
"(",
")",
")",
"{",
"throw",
"new",
"DbException",
"(",
"'can\\'t close database connection: '",
".",
"$",
"this",
"->",
"link",
"->",
"error",
",",
... | Closes the connection.
@return bool
@throws \Colibri\Database\DbException | [
"Closes",
"the",
"connection",
"."
] | 7e5b77141da5e5e7c63afc83592671321ac52f36 | https://github.com/PHPColibri/framework/blob/7e5b77141da5e5e7c63afc83592671321ac52f36/Database/Concrete/MySQL/Connection.php#L54-L61 |
203,559 | SpoonX/SxBootstrap | src/SxBootstrap/View/Helper/Bootstrap/FormColorPicker.php | FormColorPicker.assembleComponent | protected function assembleComponent($element)
{
$options = $this->getOptions();
$element = parent::__invoke($element);
$component = sprintf(
'<div style="padding: 0;" class="input-append color %s" data-color="%s" data-color-format="%s">%s',
$options['class'],
... | php | protected function assembleComponent($element)
{
$options = $this->getOptions();
$element = parent::__invoke($element);
$component = sprintf(
'<div style="padding: 0;" class="input-append color %s" data-color="%s" data-color-format="%s">%s',
$options['class'],
... | [
"protected",
"function",
"assembleComponent",
"(",
"$",
"element",
")",
"{",
"$",
"options",
"=",
"$",
"this",
"->",
"getOptions",
"(",
")",
";",
"$",
"element",
"=",
"parent",
"::",
"__invoke",
"(",
"$",
"element",
")",
";",
"$",
"component",
"=",
"sp... | Put together the colorpicker component.
@param Zend\Form\Element $element | [
"Put",
"together",
"the",
"colorpicker",
"component",
"."
] | 768b02e3b65f7dfe560e821cb0ff41ad3f86b3b6 | https://github.com/SpoonX/SxBootstrap/blob/768b02e3b65f7dfe560e821cb0ff41ad3f86b3b6/src/SxBootstrap/View/Helper/Bootstrap/FormColorPicker.php#L72-L88 |
203,560 | SpoonX/SxBootstrap | src/SxBootstrap/View/Helper/Bootstrap/FormColorPicker.php | FormColorPicker.prepareElement | protected function prepareElement($element)
{
$options = $this->getOptions();
$currClass = $element->getAttribute('class');
$class = $currClass . (null !== $currClass ? ' ' : '') . $options['class'];
$element->setAttributes(array(
'class' => $class,
... | php | protected function prepareElement($element)
{
$options = $this->getOptions();
$currClass = $element->getAttribute('class');
$class = $currClass . (null !== $currClass ? ' ' : '') . $options['class'];
$element->setAttributes(array(
'class' => $class,
... | [
"protected",
"function",
"prepareElement",
"(",
"$",
"element",
")",
"{",
"$",
"options",
"=",
"$",
"this",
"->",
"getOptions",
"(",
")",
";",
"$",
"currClass",
"=",
"$",
"element",
"->",
"getAttribute",
"(",
"'class'",
")",
";",
"$",
"class",
"=",
"$"... | Prepare the element by applying all changes to it required for the colorpicker.
@param Zend\Form\Element\Element $element
@return Zend\Form\View\Helper\FormInput | [
"Prepare",
"the",
"element",
"by",
"applying",
"all",
"changes",
"to",
"it",
"required",
"for",
"the",
"colorpicker",
"."
] | 768b02e3b65f7dfe560e821cb0ff41ad3f86b3b6 | https://github.com/SpoonX/SxBootstrap/blob/768b02e3b65f7dfe560e821cb0ff41ad3f86b3b6/src/SxBootstrap/View/Helper/Bootstrap/FormColorPicker.php#L97-L110 |
203,561 | SpoonX/SxBootstrap | src/SxBootstrap/View/Helper/Bootstrap/FormColorPicker.php | FormColorPicker.setOptions | protected function setOptions($options)
{
$options = array_merge(array(
'format' => 'hex',
'invoke_inline' => false,
'include_dependencies' => false,
'as_component' => false,
'class' => 'colorpicker'... | php | protected function setOptions($options)
{
$options = array_merge(array(
'format' => 'hex',
'invoke_inline' => false,
'include_dependencies' => false,
'as_component' => false,
'class' => 'colorpicker'... | [
"protected",
"function",
"setOptions",
"(",
"$",
"options",
")",
"{",
"$",
"options",
"=",
"array_merge",
"(",
"array",
"(",
"'format'",
"=>",
"'hex'",
",",
"'invoke_inline'",
"=>",
"false",
",",
"'include_dependencies'",
"=>",
"false",
",",
"'as_component'",
... | Set the options for the colorpicker.
@param array $options
@return array The options.
@throws Exception\InvalidArgumentException | [
"Set",
"the",
"options",
"for",
"the",
"colorpicker",
"."
] | 768b02e3b65f7dfe560e821cb0ff41ad3f86b3b6 | https://github.com/SpoonX/SxBootstrap/blob/768b02e3b65f7dfe560e821cb0ff41ad3f86b3b6/src/SxBootstrap/View/Helper/Bootstrap/FormColorPicker.php#L145-L172 |
203,562 | SpoonX/SxBootstrap | src/SxBootstrap/View/Helper/Bootstrap/FormColorPicker.php | FormColorPicker.includeDependencies | protected function includeDependencies()
{
$view = $this->getView();
$view->headScript()->appendFile($view->basePath() . '/js/bootstrap-colorpicker.js');
$view->headLink()->prependStylesheet($view->basePath() . '/css/colorpicker.css');
} | php | protected function includeDependencies()
{
$view = $this->getView();
$view->headScript()->appendFile($view->basePath() . '/js/bootstrap-colorpicker.js');
$view->headLink()->prependStylesheet($view->basePath() . '/css/colorpicker.css');
} | [
"protected",
"function",
"includeDependencies",
"(",
")",
"{",
"$",
"view",
"=",
"$",
"this",
"->",
"getView",
"(",
")",
";",
"$",
"view",
"->",
"headScript",
"(",
")",
"->",
"appendFile",
"(",
"$",
"view",
"->",
"basePath",
"(",
")",
".",
"'/js/bootst... | Include the colorpicker dependencies. | [
"Include",
"the",
"colorpicker",
"dependencies",
"."
] | 768b02e3b65f7dfe560e821cb0ff41ad3f86b3b6 | https://github.com/SpoonX/SxBootstrap/blob/768b02e3b65f7dfe560e821cb0ff41ad3f86b3b6/src/SxBootstrap/View/Helper/Bootstrap/FormColorPicker.php#L190-L195 |
203,563 | antaresproject/translations | src/Processor/Publisher.php | Publisher.publish | public function publish($language)
{
$translations = $this->getTranslationGroups($language->translations);
foreach ($translations as $area => $groups) {
foreach ($groups as $group => $items) {
if (!isset($this->hints[$group])) {
continue;
... | php | public function publish($language)
{
$translations = $this->getTranslationGroups($language->translations);
foreach ($translations as $area => $groups) {
foreach ($groups as $group => $items) {
if (!isset($this->hints[$group])) {
continue;
... | [
"public",
"function",
"publish",
"(",
"$",
"language",
")",
"{",
"$",
"translations",
"=",
"$",
"this",
"->",
"getTranslationGroups",
"(",
"$",
"language",
"->",
"translations",
")",
";",
"foreach",
"(",
"$",
"translations",
"as",
"$",
"area",
"=>",
"$",
... | publish translations from database
@param \Illuminate\Database\Eloquent\Model $language
@return boolean | [
"publish",
"translations",
"from",
"database"
] | 63097aeb97f18c5aeeef7dcf15f0c67959951685 | https://github.com/antaresproject/translations/blob/63097aeb97f18c5aeeef7dcf15f0c67959951685/src/Processor/Publisher.php#L65-L79 |
203,564 | antaresproject/translations | src/Processor/Publisher.php | Publisher.putGitignore | protected function putGitignore($area)
{
$target = resource_path(implode(DIRECTORY_SEPARATOR, ['lang', $area, '.gitignore']));
if (!file_exists($target)) {
return $this->filesystem->put($target, "*\n!.gitignore");
}
return true;
} | php | protected function putGitignore($area)
{
$target = resource_path(implode(DIRECTORY_SEPARATOR, ['lang', $area, '.gitignore']));
if (!file_exists($target)) {
return $this->filesystem->put($target, "*\n!.gitignore");
}
return true;
} | [
"protected",
"function",
"putGitignore",
"(",
"$",
"area",
")",
"{",
"$",
"target",
"=",
"resource_path",
"(",
"implode",
"(",
"DIRECTORY_SEPARATOR",
",",
"[",
"'lang'",
",",
"$",
"area",
",",
"'.gitignore'",
"]",
")",
")",
";",
"if",
"(",
"!",
"file_exi... | Puts gitignore file in lang directory
@param String $area
@return boolean | [
"Puts",
"gitignore",
"file",
"in",
"lang",
"directory"
] | 63097aeb97f18c5aeeef7dcf15f0c67959951685 | https://github.com/antaresproject/translations/blob/63097aeb97f18c5aeeef7dcf15f0c67959951685/src/Processor/Publisher.php#L87-L94 |
203,565 | antaresproject/translations | src/Processor/Publisher.php | Publisher.getResourcePath | protected function getResourcePath($locale, $area, $group)
{
$path = resource_path(implode(DIRECTORY_SEPARATOR, ['lang', $area, $group, $locale]));
if ($this->filesystem->exists($path)) {
$this->filesystem->cleanDirectory($path);
} else {
$this->filesystem->makeDirect... | php | protected function getResourcePath($locale, $area, $group)
{
$path = resource_path(implode(DIRECTORY_SEPARATOR, ['lang', $area, $group, $locale]));
if ($this->filesystem->exists($path)) {
$this->filesystem->cleanDirectory($path);
} else {
$this->filesystem->makeDirect... | [
"protected",
"function",
"getResourcePath",
"(",
"$",
"locale",
",",
"$",
"area",
",",
"$",
"group",
")",
"{",
"$",
"path",
"=",
"resource_path",
"(",
"implode",
"(",
"DIRECTORY_SEPARATOR",
",",
"[",
"'lang'",
",",
"$",
"area",
",",
"$",
"group",
",",
... | Gets resource path
@param String $locale
@param String $area
@param String $group
@return String | [
"Gets",
"resource",
"path"
] | 63097aeb97f18c5aeeef7dcf15f0c67959951685 | https://github.com/antaresproject/translations/blob/63097aeb97f18c5aeeef7dcf15f0c67959951685/src/Processor/Publisher.php#L104-L113 |
203,566 | antaresproject/translations | src/Processor/Publisher.php | Publisher.publishTranslations | protected function publishTranslations($path, array $items)
{
foreach ($items as $filename => $translations) {
$content = "<?php
/**
* Part of the Antares package.
*
* NOTICE OF LICENSE
*
* Licensed under the 3-clause BSD License.
*
* This source file is subject to the 3-clause BSD Lice... | php | protected function publishTranslations($path, array $items)
{
foreach ($items as $filename => $translations) {
$content = "<?php
/**
* Part of the Antares package.
*
* NOTICE OF LICENSE
*
* Licensed under the 3-clause BSD License.
*
* This source file is subject to the 3-clause BSD Lice... | [
"protected",
"function",
"publishTranslations",
"(",
"$",
"path",
",",
"array",
"$",
"items",
")",
"{",
"foreach",
"(",
"$",
"items",
"as",
"$",
"filename",
"=>",
"$",
"translations",
")",
"{",
"$",
"content",
"=",
"\"<?php\n\n/**\n * Part of the Antares package... | writing translations to files
@param String $path
@param array $items
@return boolean | [
"writing",
"translations",
"to",
"files"
] | 63097aeb97f18c5aeeef7dcf15f0c67959951685 | https://github.com/antaresproject/translations/blob/63097aeb97f18c5aeeef7dcf15f0c67959951685/src/Processor/Publisher.php#L122-L150 |
203,567 | antaresproject/translations | src/Processor/Publisher.php | Publisher.getTranslationGroups | protected function getTranslationGroups(Collection $list)
{
$groups = [];
foreach ($list as $model) {
if (!isset($groups[$model->area][$model->group])) {
$groups[$model->area][$model->group] = [];
}
$groups[$model->area][$model->group] = Arr::add($... | php | protected function getTranslationGroups(Collection $list)
{
$groups = [];
foreach ($list as $model) {
if (!isset($groups[$model->area][$model->group])) {
$groups[$model->area][$model->group] = [];
}
$groups[$model->area][$model->group] = Arr::add($... | [
"protected",
"function",
"getTranslationGroups",
"(",
"Collection",
"$",
"list",
")",
"{",
"$",
"groups",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"list",
"as",
"$",
"model",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"groups",
"[",
"$",
"model",
... | grouping translations by component name
@param Collection $list
@return array | [
"grouping",
"translations",
"by",
"component",
"name"
] | 63097aeb97f18c5aeeef7dcf15f0c67959951685 | https://github.com/antaresproject/translations/blob/63097aeb97f18c5aeeef7dcf15f0c67959951685/src/Processor/Publisher.php#L158-L168 |
203,568 | factorio-item-browser/api-client | src/Service/EndpointService.php | EndpointService.getEndpointForRequest | public function getEndpointForRequest(RequestInterface $request): EndpointInterface
{
$requestClass = get_class($request);
if (!isset($this->endpointsByRequestClass[$requestClass])) {
throw new UnsupportedRequestException($requestClass);
}
return $this->endpointsByReques... | php | public function getEndpointForRequest(RequestInterface $request): EndpointInterface
{
$requestClass = get_class($request);
if (!isset($this->endpointsByRequestClass[$requestClass])) {
throw new UnsupportedRequestException($requestClass);
}
return $this->endpointsByReques... | [
"public",
"function",
"getEndpointForRequest",
"(",
"RequestInterface",
"$",
"request",
")",
":",
"EndpointInterface",
"{",
"$",
"requestClass",
"=",
"get_class",
"(",
"$",
"request",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"endpointsByReque... | Returns the endpoint for the request.
@param RequestInterface $request
@return EndpointInterface
@throws UnsupportedRequestException | [
"Returns",
"the",
"endpoint",
"for",
"the",
"request",
"."
] | ebda897483bd537c310a17ff868ca40c0568f728 | https://github.com/factorio-item-browser/api-client/blob/ebda897483bd537c310a17ff868ca40c0568f728/src/Service/EndpointService.php#L42-L50 |
203,569 | anklimsk/cakephp-console-installer | Console/Helper/WaitingShellHelper.php | WaitingShellHelper._getAnimateChar | protected function _getAnimateChar() {
if ($this->_animateCharNum >= count($this->_animateChars)) {
$this->_animateCharNum = 0;
}
return $this->_animateChars[$this->_animateCharNum++];
} | php | protected function _getAnimateChar() {
if ($this->_animateCharNum >= count($this->_animateChars)) {
$this->_animateCharNum = 0;
}
return $this->_animateChars[$this->_animateCharNum++];
} | [
"protected",
"function",
"_getAnimateChar",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_animateCharNum",
">=",
"count",
"(",
"$",
"this",
"->",
"_animateChars",
")",
")",
"{",
"$",
"this",
"->",
"_animateCharNum",
"=",
"0",
";",
"}",
"return",
"$",
... | Get char for animate
@return string | [
"Get",
"char",
"for",
"animate"
] | 76136550e856ff4f8fd3634b77633f86510f63e9 | https://github.com/anklimsk/cakephp-console-installer/blob/76136550e856ff4f8fd3634b77633f86510f63e9/Console/Helper/WaitingShellHelper.php#L58-L64 |
203,570 | anklimsk/cakephp-console-installer | Console/Helper/WaitingShellHelper.php | WaitingShellHelper.animateMessage | public function animateMessage() {
if (!$this->_showMessage) {
$this->_showMessage = true;
$this->_animateCharNum = 0;
$msg = $this->_getWaitMsg();
$msg .= ' ' . $this->_getAnimateChar();
$this->_consoleOutput->write($msg, 0);
} else {
$msg = $this->_getAnimateChar();
$this->_consoleOutput->ove... | php | public function animateMessage() {
if (!$this->_showMessage) {
$this->_showMessage = true;
$this->_animateCharNum = 0;
$msg = $this->_getWaitMsg();
$msg .= ' ' . $this->_getAnimateChar();
$this->_consoleOutput->write($msg, 0);
} else {
$msg = $this->_getAnimateChar();
$this->_consoleOutput->ove... | [
"public",
"function",
"animateMessage",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_showMessage",
")",
"{",
"$",
"this",
"->",
"_showMessage",
"=",
"true",
";",
"$",
"this",
"->",
"_animateCharNum",
"=",
"0",
";",
"$",
"msg",
"=",
"$",
"this"... | Print message 'Please wait...' and animate char on console
@return void | [
"Print",
"message",
"Please",
"wait",
"...",
"and",
"animate",
"char",
"on",
"console"
] | 76136550e856ff4f8fd3634b77633f86510f63e9 | https://github.com/anklimsk/cakephp-console-installer/blob/76136550e856ff4f8fd3634b77633f86510f63e9/Console/Helper/WaitingShellHelper.php#L82-L93 |
203,571 | anklimsk/cakephp-console-installer | Console/Helper/WaitingShellHelper.php | WaitingShellHelper.hideMessage | public function hideMessage() {
if (!$this->_showMessage) {
return;
}
$msg = $this->_getWaitMsg();
$msg .= ' x';
$this->_consoleOutput->write(str_repeat("\x08", mb_strlen($msg)), 0);
$this->_showMessage = false;
} | php | public function hideMessage() {
if (!$this->_showMessage) {
return;
}
$msg = $this->_getWaitMsg();
$msg .= ' x';
$this->_consoleOutput->write(str_repeat("\x08", mb_strlen($msg)), 0);
$this->_showMessage = false;
} | [
"public",
"function",
"hideMessage",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_showMessage",
")",
"{",
"return",
";",
"}",
"$",
"msg",
"=",
"$",
"this",
"->",
"_getWaitMsg",
"(",
")",
";",
"$",
"msg",
".=",
"' x'",
";",
"$",
"this",
"->... | Hide message 'Please wait...' on console
@return void | [
"Hide",
"message",
"Please",
"wait",
"...",
"on",
"console"
] | 76136550e856ff4f8fd3634b77633f86510f63e9 | https://github.com/anklimsk/cakephp-console-installer/blob/76136550e856ff4f8fd3634b77633f86510f63e9/Console/Helper/WaitingShellHelper.php#L100-L109 |
203,572 | as3io/modlr | src/Models/Embeds/HasMany.php | HasMany.areDirty | public function areDirty()
{
if (true === parent::areDirty()) {
return true;
}
foreach ($this->getOriginalAll() as $collection) {
if (true === $collection->isDirty()) {
return true;
}
}
return false;
} | php | public function areDirty()
{
if (true === parent::areDirty()) {
return true;
}
foreach ($this->getOriginalAll() as $collection) {
if (true === $collection->isDirty()) {
return true;
}
}
return false;
} | [
"public",
"function",
"areDirty",
"(",
")",
"{",
"if",
"(",
"true",
"===",
"parent",
"::",
"areDirty",
"(",
")",
")",
"{",
"return",
"true",
";",
"}",
"foreach",
"(",
"$",
"this",
"->",
"getOriginalAll",
"(",
")",
"as",
"$",
"collection",
")",
"{",
... | Extended to also check for dirty states of has-many Collections.
{@inheritDoc} | [
"Extended",
"to",
"also",
"check",
"for",
"dirty",
"states",
"of",
"has",
"-",
"many",
"Collections",
"."
] | 7e684b88bb22a2e18397df9402075c6533084b16 | https://github.com/as3io/modlr/blob/7e684b88bb22a2e18397df9402075c6533084b16/src/Models/Embeds/HasMany.php#L20-L31 |
203,573 | as3io/modlr | src/Models/Embeds/HasMany.php | HasMany.calculateChangeSet | public function calculateChangeSet()
{
$set = [];
foreach ($this->getOriginalAll() as $key => $collection) {
if (false === $collection->isDirty()) {
continue;
}
$set[$key] = $collection->calculateChangeSet();
}
return $set;
} | php | public function calculateChangeSet()
{
$set = [];
foreach ($this->getOriginalAll() as $key => $collection) {
if (false === $collection->isDirty()) {
continue;
}
$set[$key] = $collection->calculateChangeSet();
}
return $set;
} | [
"public",
"function",
"calculateChangeSet",
"(",
")",
"{",
"$",
"set",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"getOriginalAll",
"(",
")",
"as",
"$",
"key",
"=>",
"$",
"collection",
")",
"{",
"if",
"(",
"false",
"===",
"$",
"collection... | Overwritten to account for collection change sets.
{@inheritDoc} | [
"Overwritten",
"to",
"account",
"for",
"collection",
"change",
"sets",
"."
] | 7e684b88bb22a2e18397df9402075c6533084b16 | https://github.com/as3io/modlr/blob/7e684b88bb22a2e18397df9402075c6533084b16/src/Models/Embeds/HasMany.php#L54-L64 |
203,574 | YiMAproject/yimaWidgetator | src/yimaWidgetator/AbstractWidgetHelper.php | AbstractWidgetHelper.addWidget | function addWidget($region, $widget, $priority = 0)
{
if (!$this->rBoxContainer) {
$sm = $this->getServiceLocator()->getServiceLocator();
$rBoxContainer = $sm->get('yimaWidgetator.Widgetizer.Container');
$this->rBoxContainer = $rBoxContainer;
}
$this->r... | php | function addWidget($region, $widget, $priority = 0)
{
if (!$this->rBoxContainer) {
$sm = $this->getServiceLocator()->getServiceLocator();
$rBoxContainer = $sm->get('yimaWidgetator.Widgetizer.Container');
$this->rBoxContainer = $rBoxContainer;
}
$this->r... | [
"function",
"addWidget",
"(",
"$",
"region",
",",
"$",
"widget",
",",
"$",
"priority",
"=",
"0",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"rBoxContainer",
")",
"{",
"$",
"sm",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
"->",
"getSer... | Add Widget To Region Box Container
@param $region
@param $widget
@param int $priority
@return $this | [
"Add",
"Widget",
"To",
"Region",
"Box",
"Container"
] | 332bc9318e6ceaec918147b30317da2f5b3d2636 | https://github.com/YiMAproject/yimaWidgetator/blob/332bc9318e6ceaec918147b30317da2f5b3d2636/src/yimaWidgetator/AbstractWidgetHelper.php#L59-L71 |
203,575 | YiMAproject/yimaWidgetator | src/yimaWidgetator/AbstractWidgetHelper.php | AbstractWidgetHelper.getWidgetManager | function getWidgetManager()
{
if (! $this->widgetManager) {
$sm = $this->getServiceLocator()->getServiceLocator();
$widgetManager = $sm->get('yimaWidgetator.WidgetManager');
if (!($widgetManager instanceof WidgetManager)
|| !($widgetManager instanceof Abstr... | php | function getWidgetManager()
{
if (! $this->widgetManager) {
$sm = $this->getServiceLocator()->getServiceLocator();
$widgetManager = $sm->get('yimaWidgetator.WidgetManager');
if (!($widgetManager instanceof WidgetManager)
|| !($widgetManager instanceof Abstr... | [
"function",
"getWidgetManager",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"widgetManager",
")",
"{",
"$",
"sm",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
"->",
"getServiceLocator",
"(",
")",
";",
"$",
"widgetManager",
"=",
"$",
"sm... | Get Widget Manager
@throws \Exception
@return WidgetManager | [
"Get",
"Widget",
"Manager"
] | 332bc9318e6ceaec918147b30317da2f5b3d2636 | https://github.com/YiMAproject/yimaWidgetator/blob/332bc9318e6ceaec918147b30317da2f5b3d2636/src/yimaWidgetator/AbstractWidgetHelper.php#L79-L97 |
203,576 | znframework/package-hypertext | Table.php | Table.cell | public function cell(Int $spacing, Int $padding) : Table
{
$this->attr['cellspacing'] = $spacing;
$this->attr['cellpadding'] = $padding;
return $this;
} | php | public function cell(Int $spacing, Int $padding) : Table
{
$this->attr['cellspacing'] = $spacing;
$this->attr['cellpadding'] = $padding;
return $this;
} | [
"public",
"function",
"cell",
"(",
"Int",
"$",
"spacing",
",",
"Int",
"$",
"padding",
")",
":",
"Table",
"{",
"$",
"this",
"->",
"attr",
"[",
"'cellspacing'",
"]",
"=",
"$",
"spacing",
";",
"$",
"this",
"->",
"attr",
"[",
"'cellpadding'",
"]",
"=",
... | Sets table cell
@param int $spacing
@param int $padding
@return Table | [
"Sets",
"table",
"cell"
] | 12bbc3bd47a2fae735f638a3e01cc82c1b9c9005 | https://github.com/znframework/package-hypertext/blob/12bbc3bd47a2fae735f638a3e01cc82c1b9c9005/Table.php#L74-L80 |
203,577 | znframework/package-hypertext | Table.php | Table.border | public function border(Int $border, String $color = NULL) : Table
{
$this->attr['border'] = $border;
if( ! empty($color) )
{
$this->attr['bordercolor'] = $color;
}
return $this;
} | php | public function border(Int $border, String $color = NULL) : Table
{
$this->attr['border'] = $border;
if( ! empty($color) )
{
$this->attr['bordercolor'] = $color;
}
return $this;
} | [
"public",
"function",
"border",
"(",
"Int",
"$",
"border",
",",
"String",
"$",
"color",
"=",
"NULL",
")",
":",
"Table",
"{",
"$",
"this",
"->",
"attr",
"[",
"'border'",
"]",
"=",
"$",
"border",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"color",
")"... | Sets table border
@param int $border
@param string $color = NULL
@return Table | [
"Sets",
"table",
"border"
] | 12bbc3bd47a2fae735f638a3e01cc82c1b9c9005 | https://github.com/znframework/package-hypertext/blob/12bbc3bd47a2fae735f638a3e01cc82c1b9c9005/Table.php#L90-L100 |
203,578 | znframework/package-hypertext | Table.php | Table.size | public function size(Int $width, Int $height) : Table
{
$this->attr['width'] = $width;
$this->attr['height'] = $height;
return $this;
} | php | public function size(Int $width, Int $height) : Table
{
$this->attr['width'] = $width;
$this->attr['height'] = $height;
return $this;
} | [
"public",
"function",
"size",
"(",
"Int",
"$",
"width",
",",
"Int",
"$",
"height",
")",
":",
"Table",
"{",
"$",
"this",
"->",
"attr",
"[",
"'width'",
"]",
"=",
"$",
"width",
";",
"$",
"this",
"->",
"attr",
"[",
"'height'",
"]",
"=",
"$",
"height"... | Sets table size
@param int $width
@param int $height
@return Table | [
"Sets",
"table",
"size"
] | 12bbc3bd47a2fae735f638a3e01cc82c1b9c9005 | https://github.com/znframework/package-hypertext/blob/12bbc3bd47a2fae735f638a3e01cc82c1b9c9005/Table.php#L110-L116 |
203,579 | znframework/package-hypertext | Table.php | Table.style | public function style(Array $attributes) : Table
{
$attribute = '';
foreach( $attributes as $key => $values )
{
if( is_numeric($key) )
{
$key = $values;
}
$attribute .= ' '.$key.':'.$values.';';
}
$this->attr[... | php | public function style(Array $attributes) : Table
{
$attribute = '';
foreach( $attributes as $key => $values )
{
if( is_numeric($key) )
{
$key = $values;
}
$attribute .= ' '.$key.':'.$values.';';
}
$this->attr[... | [
"public",
"function",
"style",
"(",
"Array",
"$",
"attributes",
")",
":",
"Table",
"{",
"$",
"attribute",
"=",
"''",
";",
"foreach",
"(",
"$",
"attributes",
"as",
"$",
"key",
"=>",
"$",
"values",
")",
"{",
"if",
"(",
"is_numeric",
"(",
"$",
"key",
... | Sets table style attribute
@param array $attributes
@return Table | [
"Sets",
"table",
"style",
"attribute"
] | 12bbc3bd47a2fae735f638a3e01cc82c1b9c9005 | https://github.com/znframework/package-hypertext/blob/12bbc3bd47a2fae735f638a3e01cc82c1b9c9005/Table.php#L125-L142 |
203,580 | schpill/thin | src/Form.php | Form.buildLabel | public static function buildLabel($name, $label = '', $required = false)
{
$out = '';
if (!empty($label)) {
$class = 'control-label';
$requiredLabel = '.req';
$requiredSuffix = '<span class="required"><i class="icon-asterisk"></i></span>';... | php | public static function buildLabel($name, $label = '', $required = false)
{
$out = '';
if (!empty($label)) {
$class = 'control-label';
$requiredLabel = '.req';
$requiredSuffix = '<span class="required"><i class="icon-asterisk"></i></span>';... | [
"public",
"static",
"function",
"buildLabel",
"(",
"$",
"name",
",",
"$",
"label",
"=",
"''",
",",
"$",
"required",
"=",
"false",
")",
"{",
"$",
"out",
"=",
"''",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"label",
")",
")",
"{",
"$",
"class",
"="... | Builds the label html
@param string $name The name of the html field
@param string $label The label name
@param boolean $required
@return string | [
"Builds",
"the",
"label",
"html"
] | a9102d9d6f70e8b0f6be93153f70849f46489ee1 | https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Form.php#L122-L142 |
203,581 | schpill/thin | src/Form.php | Form.buildWrapper | private static function buildWrapper($field, $name, $label = '', $checkbox = false, $required)
{
$getter = 'get' . Inflector::camelize($name);
$error = null;
$actual = Session::instance('ThinForm')->getActual();
if (null !== $actual) {
$error = $a... | php | private static function buildWrapper($field, $name, $label = '', $checkbox = false, $required)
{
$getter = 'get' . Inflector::camelize($name);
$error = null;
$actual = Session::instance('ThinForm')->getActual();
if (null !== $actual) {
$error = $a... | [
"private",
"static",
"function",
"buildWrapper",
"(",
"$",
"field",
",",
"$",
"name",
",",
"$",
"label",
"=",
"''",
",",
"$",
"checkbox",
"=",
"false",
",",
"$",
"required",
")",
"{",
"$",
"getter",
"=",
"'get'",
".",
"Inflector",
"::",
"camelize",
"... | Builds the Twitter Bootstrap control wrapper
@param string $field The html for the field
@param string $name The name of the field
@param string $label The label name
@param boolean $checkbox
@return string | [
"Builds",
"the",
"Twitter",
"Bootstrap",
"control",
"wrapper"
] | a9102d9d6f70e8b0f6be93153f70849f46489ee1 | https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Form.php#L153-L185 |
203,582 | jtallant/skimpy-engine | src/File/ContentFile.php | ContentFile.getDate | public function getDate()
{
if (false === $this->frontMatter->has('date')) {
# Defaults to last modified
return (new DateTime)->setTimestamp($this->file->getMTime());
}
$date = $this->frontMatter->getDate();
if ($date instanceof DateTime) {
retur... | php | public function getDate()
{
if (false === $this->frontMatter->has('date')) {
# Defaults to last modified
return (new DateTime)->setTimestamp($this->file->getMTime());
}
$date = $this->frontMatter->getDate();
if ($date instanceof DateTime) {
retur... | [
"public",
"function",
"getDate",
"(",
")",
"{",
"if",
"(",
"false",
"===",
"$",
"this",
"->",
"frontMatter",
"->",
"has",
"(",
"'date'",
")",
")",
"{",
"# Defaults to last modified",
"return",
"(",
"new",
"DateTime",
")",
"->",
"setTimestamp",
"(",
"$",
... | Front matter date or filemtime
@return DateTime | [
"Front",
"matter",
"date",
"or",
"filemtime"
] | 2fce5bc16f8745e54fd66a1c291fcea47fc1b4b2 | https://github.com/jtallant/skimpy-engine/blob/2fce5bc16f8745e54fd66a1c291fcea47fc1b4b2/src/File/ContentFile.php#L108-L122 |
203,583 | jtallant/skimpy-engine | src/File/ContentFile.php | ContentFile.getUri | public function getUri()
{
if ($this->isIndex()) {
return $this->getUriPath();
}
$path = $this->getUriPath().DIRECTORY_SEPARATOR.$this->getFilename();
return trim($path, DIRECTORY_SEPARATOR);
} | php | public function getUri()
{
if ($this->isIndex()) {
return $this->getUriPath();
}
$path = $this->getUriPath().DIRECTORY_SEPARATOR.$this->getFilename();
return trim($path, DIRECTORY_SEPARATOR);
} | [
"public",
"function",
"getUri",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isIndex",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"getUriPath",
"(",
")",
";",
"}",
"$",
"path",
"=",
"$",
"this",
"->",
"getUriPath",
"(",
")",
".",
"DIRECTOR... | URI to the content based on directory path
# Directory | URI
------------------------------------
foo/bar/baz.md | foo/bar/baz
Files named index.md do not use the filename in the URI:
index.md => /
foo/index.md => foo/
foo/bar/index.md => foo/bar/index
@return string | [
"URI",
"to",
"the",
"content",
"based",
"on",
"directory",
"path"
] | 2fce5bc16f8745e54fd66a1c291fcea47fc1b4b2 | https://github.com/jtallant/skimpy-engine/blob/2fce5bc16f8745e54fd66a1c291fcea47fc1b4b2/src/File/ContentFile.php#L188-L197 |
203,584 | jtallant/skimpy-engine | src/File/ContentFile.php | ContentFile.getUriPath | protected function getUriPath()
{
$path = dirname($this->getPathFromContent());
$parts = explode(DIRECTORY_SEPARATOR, $path);
$uriParts = array_filter($parts, function ($dirname) {
return false === $this->isTopLevel();
});
return trim(implode(DIRECTORY_SEPARATOR... | php | protected function getUriPath()
{
$path = dirname($this->getPathFromContent());
$parts = explode(DIRECTORY_SEPARATOR, $path);
$uriParts = array_filter($parts, function ($dirname) {
return false === $this->isTopLevel();
});
return trim(implode(DIRECTORY_SEPARATOR... | [
"protected",
"function",
"getUriPath",
"(",
")",
"{",
"$",
"path",
"=",
"dirname",
"(",
"$",
"this",
"->",
"getPathFromContent",
"(",
")",
")",
";",
"$",
"parts",
"=",
"explode",
"(",
"DIRECTORY_SEPARATOR",
",",
"$",
"path",
")",
";",
"$",
"uriParts",
... | Returns the URI parts to the Entry up to but not including
the slug, based on the file location.
@return string | [
"Returns",
"the",
"URI",
"parts",
"to",
"the",
"Entry",
"up",
"to",
"but",
"not",
"including",
"the",
"slug",
"based",
"on",
"the",
"file",
"location",
"."
] | 2fce5bc16f8745e54fd66a1c291fcea47fc1b4b2 | https://github.com/jtallant/skimpy-engine/blob/2fce5bc16f8745e54fd66a1c291fcea47fc1b4b2/src/File/ContentFile.php#L257-L267 |
203,585 | crisu83/yii-consoletools | commands/EnvironmentCommand.php | EnvironmentCommand.run | public function run($args)
{
if (!isset($args[0])) {
$this->usageError('The environment id is not specified.');
}
$id = $args[0];
$this->flush();
echo "\nCopying environment files... \n";
$environmentPath = $this->basePath . '/' . $this->environmentsDir ... | php | public function run($args)
{
if (!isset($args[0])) {
$this->usageError('The environment id is not specified.');
}
$id = $args[0];
$this->flush();
echo "\nCopying environment files... \n";
$environmentPath = $this->basePath . '/' . $this->environmentsDir ... | [
"public",
"function",
"run",
"(",
"$",
"args",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"args",
"[",
"0",
"]",
")",
")",
"{",
"$",
"this",
"->",
"usageError",
"(",
"'The environment id is not specified.'",
")",
";",
"}",
"$",
"id",
"=",
"$",
"a... | Changes the current environment.
@param array $args the command-line arguments.
@throws CException if the environment path does not exist. | [
"Changes",
"the",
"current",
"environment",
"."
] | 53bcb1bcdd33b9ef79034ff9c0d5bbfb3f971afc | https://github.com/crisu83/yii-consoletools/blob/53bcb1bcdd33b9ef79034ff9c0d5bbfb3f971afc/commands/EnvironmentCommand.php#L44-L62 |
203,586 | MovingImage24/VM6ApiClient | lib/ApiClient/AbstractApiClient.php | AbstractApiClient.getChannelList | private function getChannelList()
{
if (empty($this->channelList)) {
$response = $this->makeRequest('GET', 'get_rubric_object_list.json', []);
$this->channelList = $this->deserialize($response->getBody()->getContents(), ChannelList::class);
}
return $this->channelLis... | php | private function getChannelList()
{
if (empty($this->channelList)) {
$response = $this->makeRequest('GET', 'get_rubric_object_list.json', []);
$this->channelList = $this->deserialize($response->getBody()->getContents(), ChannelList::class);
}
return $this->channelLis... | [
"private",
"function",
"getChannelList",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"channelList",
")",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"makeRequest",
"(",
"'GET'",
",",
"'get_rubric_object_list.json'",
",",
"[",
"]",
"... | Returns ChannelList containing all channels belonging to the video manager.
@return ChannelList | [
"Returns",
"ChannelList",
"containing",
"all",
"channels",
"belonging",
"to",
"the",
"video",
"manager",
"."
] | 84e6510fa0fb71cfbb42ea9f23775f681c266fac | https://github.com/MovingImage24/VM6ApiClient/blob/84e6510fa0fb71cfbb42ea9f23775f681c266fac/lib/ApiClient/AbstractApiClient.php#L49-L57 |
203,587 | MovingImage24/VM6ApiClient | lib/ApiClient/AbstractApiClient.php | AbstractApiClient.getChannelIdsInclusiveSubChannels | private function getChannelIdsInclusiveSubChannels($channelIds)
{
$subChannelIds = [];
foreach ($channelIds as $channelId) {
$subChannels = $this->getChannelList()->getChildren($channelId);
$subChannelIds = array_merge($subChannelIds, $subChannels->map(function (Channel $cha... | php | private function getChannelIdsInclusiveSubChannels($channelIds)
{
$subChannelIds = [];
foreach ($channelIds as $channelId) {
$subChannels = $this->getChannelList()->getChildren($channelId);
$subChannelIds = array_merge($subChannelIds, $subChannels->map(function (Channel $cha... | [
"private",
"function",
"getChannelIdsInclusiveSubChannels",
"(",
"$",
"channelIds",
")",
"{",
"$",
"subChannelIds",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"channelIds",
"as",
"$",
"channelId",
")",
"{",
"$",
"subChannels",
"=",
"$",
"this",
"->",
"getChann... | Returns an array containing all channel IDs inclusive sub channels.
@param $channelIds
@return array | [
"Returns",
"an",
"array",
"containing",
"all",
"channel",
"IDs",
"inclusive",
"sub",
"channels",
"."
] | 84e6510fa0fb71cfbb42ea9f23775f681c266fac | https://github.com/MovingImage24/VM6ApiClient/blob/84e6510fa0fb71cfbb42ea9f23775f681c266fac/lib/ApiClient/AbstractApiClient.php#L74-L88 |
203,588 | chilimatic/chilimatic-framework | lib/http/Request.php | Request.init | public function init($param)
{
if (empty($param)) return false;
$this->header = '';
$param_list = new ParamList();
foreach ($param as $key => $value) {
if (property_exists($this, $key)) $this->$key = $value;
elseif (property_exists($param_list, strtolower(s... | php | public function init($param)
{
if (empty($param)) return false;
$this->header = '';
$param_list = new ParamList();
foreach ($param as $key => $value) {
if (property_exists($this, $key)) $this->$key = $value;
elseif (property_exists($param_list, strtolower(s... | [
"public",
"function",
"init",
"(",
"$",
"param",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"param",
")",
")",
"return",
"false",
";",
"$",
"this",
"->",
"header",
"=",
"''",
";",
"$",
"param_list",
"=",
"new",
"ParamList",
"(",
")",
";",
"foreach",
... | set the parameters
@param $param
@return bool | [
"set",
"the",
"parameters"
] | 8df7f12e75d75d3fd2197a58c80d39cbb4b9ff12 | https://github.com/chilimatic/chilimatic-framework/blob/8df7f12e75d75d3fd2197a58c80d39cbb4b9ff12/lib/http/Request.php#L124-L146 |
203,589 | acacha/forge-publish | src/Console/Commands/Traits/ItFetchesSites.php | ItFetchesSites.getSiteByName | protected function getSiteByName($sites, $site_name)
{
$site_found = collect($sites)->filter(function ($site) use ($site_name) {
return $site->name === $site_name;
})->first();
if ($site_found) {
return $site_found;
}
return null;
} | php | protected function getSiteByName($sites, $site_name)
{
$site_found = collect($sites)->filter(function ($site) use ($site_name) {
return $site->name === $site_name;
})->first();
if ($site_found) {
return $site_found;
}
return null;
} | [
"protected",
"function",
"getSiteByName",
"(",
"$",
"sites",
",",
"$",
"site_name",
")",
"{",
"$",
"site_found",
"=",
"collect",
"(",
"$",
"sites",
")",
"->",
"filter",
"(",
"function",
"(",
"$",
"site",
")",
"use",
"(",
"$",
"site_name",
")",
"{",
"... | Get forge site from sites by name.
@param $sites
@param $site_id
@return mixed | [
"Get",
"forge",
"site",
"from",
"sites",
"by",
"name",
"."
] | 010779e3d2297c763b82dc3fbde992edffb3a6c6 | https://github.com/acacha/forge-publish/blob/010779e3d2297c763b82dc3fbde992edffb3a6c6/src/Console/Commands/Traits/ItFetchesSites.php#L40-L50 |
203,590 | acacha/forge-publish | src/Console/Commands/Traits/ItFetchesSites.php | ItFetchesSites.getSite | protected function getSite($sites, $site_id)
{
$site_found = collect($sites)->filter(function ($site) use ($site_id) {
return $site->id === $site_id;
})->first();
if ($site_found) {
return $site_found;
}
return null;
} | php | protected function getSite($sites, $site_id)
{
$site_found = collect($sites)->filter(function ($site) use ($site_id) {
return $site->id === $site_id;
})->first();
if ($site_found) {
return $site_found;
}
return null;
} | [
"protected",
"function",
"getSite",
"(",
"$",
"sites",
",",
"$",
"site_id",
")",
"{",
"$",
"site_found",
"=",
"collect",
"(",
"$",
"sites",
")",
"->",
"filter",
"(",
"function",
"(",
"$",
"site",
")",
"use",
"(",
"$",
"site_id",
")",
"{",
"return",
... | Get forge site from sites.
@param $sites
@param $site_id
@return mixed | [
"Get",
"forge",
"site",
"from",
"sites",
"."
] | 010779e3d2297c763b82dc3fbde992edffb3a6c6 | https://github.com/acacha/forge-publish/blob/010779e3d2297c763b82dc3fbde992edffb3a6c6/src/Console/Commands/Traits/ItFetchesSites.php#L59-L69 |
203,591 | acacha/forge-publish | src/Console/Commands/Traits/ItFetchesSites.php | ItFetchesSites.getSiteName | protected function getSiteName($sites, $site_id)
{
if ($site = $this->getSite($sites, $site_id)) {
return $site->name;
}
return null;
} | php | protected function getSiteName($sites, $site_id)
{
if ($site = $this->getSite($sites, $site_id)) {
return $site->name;
}
return null;
} | [
"protected",
"function",
"getSiteName",
"(",
"$",
"sites",
",",
"$",
"site_id",
")",
"{",
"if",
"(",
"$",
"site",
"=",
"$",
"this",
"->",
"getSite",
"(",
"$",
"sites",
",",
"$",
"site_id",
")",
")",
"{",
"return",
"$",
"site",
"->",
"name",
";",
... | Get forge site name from site id.
@param $sites
@param $site_id
@return mixed | [
"Get",
"forge",
"site",
"name",
"from",
"site",
"id",
"."
] | 010779e3d2297c763b82dc3fbde992edffb3a6c6 | https://github.com/acacha/forge-publish/blob/010779e3d2297c763b82dc3fbde992edffb3a6c6/src/Console/Commands/Traits/ItFetchesSites.php#L78-L84 |
203,592 | acacha/forge-publish | src/Console/Commands/Traits/ItFetchesSites.php | ItFetchesSites.getSiteId | protected function getSiteId($sites, $site_name)
{
if ($site = $this->getSiteByName($sites, $site_name)) {
return $site->id;
}
return null;
} | php | protected function getSiteId($sites, $site_name)
{
if ($site = $this->getSiteByName($sites, $site_name)) {
return $site->id;
}
return null;
} | [
"protected",
"function",
"getSiteId",
"(",
"$",
"sites",
",",
"$",
"site_name",
")",
"{",
"if",
"(",
"$",
"site",
"=",
"$",
"this",
"->",
"getSiteByName",
"(",
"$",
"sites",
",",
"$",
"site_name",
")",
")",
"{",
"return",
"$",
"site",
"->",
"id",
"... | Get forge site id from site name.
@param $sites
@param $site_name
@return mixed | [
"Get",
"forge",
"site",
"id",
"from",
"site",
"name",
"."
] | 010779e3d2297c763b82dc3fbde992edffb3a6c6 | https://github.com/acacha/forge-publish/blob/010779e3d2297c763b82dc3fbde992edffb3a6c6/src/Console/Commands/Traits/ItFetchesSites.php#L93-L99 |
203,593 | RadialCorp/magento-core | src/app/code/community/Radial/Core/Helper/Quote/Item.php | Radial_Core_Helper_Quote_Item.isItemInventoried | public function isItemInventoried(Mage_Sales_Model_Quote_Item $item)
{
// never consider a child product as inventoried, allow the parent deal
// with inventory and let the child not need to worry about it as the parent
// will be the item to keep track of qty being ordered.
// Both ... | php | public function isItemInventoried(Mage_Sales_Model_Quote_Item $item)
{
// never consider a child product as inventoried, allow the parent deal
// with inventory and let the child not need to worry about it as the parent
// will be the item to keep track of qty being ordered.
// Both ... | [
"public",
"function",
"isItemInventoried",
"(",
"Mage_Sales_Model_Quote_Item",
"$",
"item",
")",
"{",
"// never consider a child product as inventoried, allow the parent deal",
"// with inventory and let the child not need to worry about it as the parent",
"// will be the item to keep track of... | Test if the item needs to have its quantity checked for available
inventory.
@param Mage_Sales_Model_Quote_Item $item The item to check
@return bool True if inventory is managed, false if not | [
"Test",
"if",
"the",
"item",
"needs",
"to",
"have",
"its",
"quantity",
"checked",
"for",
"available",
"inventory",
"."
] | 9bb5f218d9caf79eab8598f4f8447037a0cc6355 | https://github.com/RadialCorp/magento-core/blob/9bb5f218d9caf79eab8598f4f8447037a0cc6355/src/app/code/community/Radial/Core/Helper/Quote/Item.php#L32-L59 |
203,594 | RadialCorp/magento-core | src/app/code/community/Radial/Core/Helper/Quote/Item.php | Radial_Core_Helper_Quote_Item.isManagedStock | protected function isManagedStock(Mage_CatalogInventory_Model_Stock_Item $stock)
{
return (
($this->_config->isBackorderable || (int) $stock->getBackorders() === Mage_CatalogInventory_Model_Stock::BACKORDERS_NO)
&& $stock->getManageStock() > 0
);
} | php | protected function isManagedStock(Mage_CatalogInventory_Model_Stock_Item $stock)
{
return (
($this->_config->isBackorderable || (int) $stock->getBackorders() === Mage_CatalogInventory_Model_Stock::BACKORDERS_NO)
&& $stock->getManageStock() > 0
);
} | [
"protected",
"function",
"isManagedStock",
"(",
"Mage_CatalogInventory_Model_Stock_Item",
"$",
"stock",
")",
"{",
"return",
"(",
"(",
"$",
"this",
"->",
"_config",
"->",
"isBackorderable",
"||",
"(",
"int",
")",
"$",
"stock",
"->",
"getBackorders",
"(",
")",
"... | If the inventory configuration allow order item to be backorderable simply check if the
Manage stock for the item is greater than zero. Otherwise, if the inventory configuration
do not allow order items to be backorderable, then ensure the item is not backorder and has
manage stock.
@param Mage_CatalogInventory_Model... | [
"If",
"the",
"inventory",
"configuration",
"allow",
"order",
"item",
"to",
"be",
"backorderable",
"simply",
"check",
"if",
"the",
"Manage",
"stock",
"for",
"the",
"item",
"is",
"greater",
"than",
"zero",
".",
"Otherwise",
"if",
"the",
"inventory",
"configurati... | 9bb5f218d9caf79eab8598f4f8447037a0cc6355 | https://github.com/RadialCorp/magento-core/blob/9bb5f218d9caf79eab8598f4f8447037a0cc6355/src/app/code/community/Radial/Core/Helper/Quote/Item.php#L70-L76 |
203,595 | silvercommerce/contact-admin | src/model/Contact.php | Contact.getTagsList | public function getTagsList()
{
$return = "";
$tags = $this->Tags()->column("Title");
$this->extend("updateTagsList", $tags);
return implode(
$this->config()->list_seperator,
$tags
);
} | php | public function getTagsList()
{
$return = "";
$tags = $this->Tags()->column("Title");
$this->extend("updateTagsList", $tags);
return implode(
$this->config()->list_seperator,
$tags
);
} | [
"public",
"function",
"getTagsList",
"(",
")",
"{",
"$",
"return",
"=",
"\"\"",
";",
"$",
"tags",
"=",
"$",
"this",
"->",
"Tags",
"(",
")",
"->",
"column",
"(",
"\"Title\"",
")",
";",
"$",
"this",
"->",
"extend",
"(",
"\"updateTagsList\"",
",",
"$",
... | Generate as string of tag titles seperated by a comma
@return string | [
"Generate",
"as",
"string",
"of",
"tag",
"titles",
"seperated",
"by",
"a",
"comma"
] | 32cbc2ef2589f93f9dd1796e5db2f11ad15d888c | https://github.com/silvercommerce/contact-admin/blob/32cbc2ef2589f93f9dd1796e5db2f11ad15d888c/src/model/Contact.php#L243-L254 |
203,596 | silvercommerce/contact-admin | src/model/Contact.php | Contact.getListsList | public function getListsList()
{
$return = "";
$list = $this->Lists()->column("Title");
$this->extend("updateListsList", $tags);
return implode(
$this->config()->list_seperator,
$list
);
} | php | public function getListsList()
{
$return = "";
$list = $this->Lists()->column("Title");
$this->extend("updateListsList", $tags);
return implode(
$this->config()->list_seperator,
$list
);
} | [
"public",
"function",
"getListsList",
"(",
")",
"{",
"$",
"return",
"=",
"\"\"",
";",
"$",
"list",
"=",
"$",
"this",
"->",
"Lists",
"(",
")",
"->",
"column",
"(",
"\"Title\"",
")",
";",
"$",
"this",
"->",
"extend",
"(",
"\"updateListsList\"",
",",
"$... | Generate as string of list titles seperated by a comma
@return string | [
"Generate",
"as",
"string",
"of",
"list",
"titles",
"seperated",
"by",
"a",
"comma"
] | 32cbc2ef2589f93f9dd1796e5db2f11ad15d888c | https://github.com/silvercommerce/contact-admin/blob/32cbc2ef2589f93f9dd1796e5db2f11ad15d888c/src/model/Contact.php#L261-L272 |
203,597 | silvercommerce/contact-admin | src/model/Contact.php | Contact.onBeforeDelete | public function onBeforeDelete()
{
parent::onBeforeDelete();
// Delete all locations attached to this order
foreach ($this->Locations() as $item) {
$item->delete();
}
// Delete all notes attached to this order
foreach ($this->Notes() as $item) {
... | php | public function onBeforeDelete()
{
parent::onBeforeDelete();
// Delete all locations attached to this order
foreach ($this->Locations() as $item) {
$item->delete();
}
// Delete all notes attached to this order
foreach ($this->Notes() as $item) {
... | [
"public",
"function",
"onBeforeDelete",
"(",
")",
"{",
"parent",
"::",
"onBeforeDelete",
"(",
")",
";",
"// Delete all locations attached to this order",
"foreach",
"(",
"$",
"this",
"->",
"Locations",
"(",
")",
"as",
"$",
"item",
")",
"{",
"$",
"item",
"->",
... | Cleanup DB on removal | [
"Cleanup",
"DB",
"on",
"removal"
] | 32cbc2ef2589f93f9dd1796e5db2f11ad15d888c | https://github.com/silvercommerce/contact-admin/blob/32cbc2ef2589f93f9dd1796e5db2f11ad15d888c/src/model/Contact.php#L513-L526 |
203,598 | nyeholt/silverstripe-performant | code/services/SiteDataService.php | SiteDataService.getPrivateNodes | protected function getPrivateNodes() {
if (!Member::currentUserID()) {
return array();
}
$groups = Member::currentUser()->Groups()->column();
if (!count($groups)) {
return $groups;
}
$fields = $this->queryFields();
$query = new SQLQuery($fields, '"'.$this->baseClass.'"');
$query = $query->setOrd... | php | protected function getPrivateNodes() {
if (!Member::currentUserID()) {
return array();
}
$groups = Member::currentUser()->Groups()->column();
if (!count($groups)) {
return $groups;
}
$fields = $this->queryFields();
$query = new SQLQuery($fields, '"'.$this->baseClass.'"');
$query = $query->setOrd... | [
"protected",
"function",
"getPrivateNodes",
"(",
")",
"{",
"if",
"(",
"!",
"Member",
"::",
"currentUserID",
"(",
")",
")",
"{",
"return",
"array",
"(",
")",
";",
"}",
"$",
"groups",
"=",
"Member",
"::",
"currentUser",
"(",
")",
"->",
"Groups",
"(",
"... | Get private nodes, assuming SilverStripe's default perm structure
@return SS_Query | [
"Get",
"private",
"nodes",
"assuming",
"SilverStripe",
"s",
"default",
"perm",
"structure"
] | 2c9d2570ddf4a43ced38487184da4de453a4863c | https://github.com/nyeholt/silverstripe-performant/blob/2c9d2570ddf4a43ced38487184da4de453a4863c/code/services/SiteDataService.php#L158-L185 |
203,599 | nyeholt/silverstripe-performant | code/services/SiteDataService.php | SiteDataService.createMenuNode | public function createMenuNode($data) {
$cls = $this->itemClass;
$node = $cls::create($data, $this);
$this->items[$node->ID] = $node;
return $node;
} | php | public function createMenuNode($data) {
$cls = $this->itemClass;
$node = $cls::create($data, $this);
$this->items[$node->ID] = $node;
return $node;
} | [
"public",
"function",
"createMenuNode",
"(",
"$",
"data",
")",
"{",
"$",
"cls",
"=",
"$",
"this",
"->",
"itemClass",
";",
"$",
"node",
"=",
"$",
"cls",
"::",
"create",
"(",
"$",
"data",
",",
"$",
"this",
")",
";",
"$",
"this",
"->",
"items",
"[",... | Creates a menu item from an array of data
@param array $data
@returns MenuItem | [
"Creates",
"a",
"menu",
"item",
"from",
"an",
"array",
"of",
"data"
] | 2c9d2570ddf4a43ced38487184da4de453a4863c | https://github.com/nyeholt/silverstripe-performant/blob/2c9d2570ddf4a43ced38487184da4de453a4863c/code/services/SiteDataService.php#L235-L240 |
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.