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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
194,100 | prolic/HumusMvc | src/HumusMvc/Cache/Service/CacheManagerFactory.php | CacheManagerFactory.createService | public function createService(ServiceLocatorInterface $serviceLocator)
{
$config = $serviceLocator->get('Config');
if (!isset($config['cache_manager'])) {
throw new Exception\RuntimeException(
'No cache manager config found.'
);
}
$options = $c... | php | public function createService(ServiceLocatorInterface $serviceLocator)
{
$config = $serviceLocator->get('Config');
if (!isset($config['cache_manager'])) {
throw new Exception\RuntimeException(
'No cache manager config found.'
);
}
$options = $c... | [
"public",
"function",
"createService",
"(",
"ServiceLocatorInterface",
"$",
"serviceLocator",
")",
"{",
"$",
"config",
"=",
"$",
"serviceLocator",
"->",
"get",
"(",
"'Config'",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"config",
"[",
"'cache_manager'",
"]... | Create cache manager service
@param ServiceLocatorInterface $serviceLocator
@return CacheManager
@throws Exception\RuntimeException | [
"Create",
"cache",
"manager",
"service"
] | 09e8c6422d84b57745cc643047e10761be2a21a7 | https://github.com/prolic/HumusMvc/blob/09e8c6422d84b57745cc643047e10761be2a21a7/src/HumusMvc/Cache/Service/CacheManagerFactory.php#L35-L53 |
194,101 | ScaraMVC/Framework | src/Scara/Mail/Mailer.php | Mailer.setAuthentication | public function setAuthentication($username, $password)
{
$this->_mailer->Username = $username;
$this->_mailer->Password = $password;
return $this;
} | php | public function setAuthentication($username, $password)
{
$this->_mailer->Username = $username;
$this->_mailer->Password = $password;
return $this;
} | [
"public",
"function",
"setAuthentication",
"(",
"$",
"username",
",",
"$",
"password",
")",
"{",
"$",
"this",
"->",
"_mailer",
"->",
"Username",
"=",
"$",
"username",
";",
"$",
"this",
"->",
"_mailer",
"->",
"Password",
"=",
"$",
"password",
";",
"return... | Sets the authentication used to send the mail.
@param string $username
@param string $password
@return \Scara\Mail\Mailer | [
"Sets",
"the",
"authentication",
"used",
"to",
"send",
"the",
"mail",
"."
] | 199b08b45fadf5dae14ac4732af03b36e15bbef2 | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Mail/Mailer.php#L87-L93 |
194,102 | ScaraMVC/Framework | src/Scara/Mail/Mailer.php | Mailer.create | public function create($options = [])
{
if (isset($options['to'])) {
$name = '';
if (is_array($options['to'])) {
if (isset($options['to'][1])) {
$name = $options['to'][1];
}
$this->setTo($options['to'][0], $name);
... | php | public function create($options = [])
{
if (isset($options['to'])) {
$name = '';
if (is_array($options['to'])) {
if (isset($options['to'][1])) {
$name = $options['to'][1];
}
$this->setTo($options['to'][0], $name);
... | [
"public",
"function",
"create",
"(",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"options",
"[",
"'to'",
"]",
")",
")",
"{",
"$",
"name",
"=",
"''",
";",
"if",
"(",
"is_array",
"(",
"$",
"options",
"[",
"'to'",
"]",
... | Creates the initial message. Takes in to, from and subject.
@param array $options
@return \Scara\Mail\Mailer | [
"Creates",
"the",
"initial",
"message",
".",
"Takes",
"in",
"to",
"from",
"and",
"subject",
"."
] | 199b08b45fadf5dae14ac4732af03b36e15bbef2 | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Mail/Mailer.php#L102-L137 |
194,103 | ScaraMVC/Framework | src/Scara/Mail/Mailer.php | Mailer.setTo | public function setTo($email, $name = '')
{
if (empty($email)) {
throw new MailerException('email is required for setTo!');
}
if (empty($name)) {
$name = substr($email, 0, strrpos($email, '@'));
}
if (is_null($this->to)) {
$this->to = [$e... | php | public function setTo($email, $name = '')
{
if (empty($email)) {
throw new MailerException('email is required for setTo!');
}
if (empty($name)) {
$name = substr($email, 0, strrpos($email, '@'));
}
if (is_null($this->to)) {
$this->to = [$e... | [
"public",
"function",
"setTo",
"(",
"$",
"email",
",",
"$",
"name",
"=",
"''",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"email",
")",
")",
"{",
"throw",
"new",
"MailerException",
"(",
"'email is required for setTo!'",
")",
";",
"}",
"if",
"(",
"empty",
... | Sets the Recipient of the email.
@param string $email
@param string $name
@return \Scara\Mail\Mailer | [
"Sets",
"the",
"Recipient",
"of",
"the",
"email",
"."
] | 199b08b45fadf5dae14ac4732af03b36e15bbef2 | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Mail/Mailer.php#L147-L164 |
194,104 | ScaraMVC/Framework | src/Scara/Mail/Mailer.php | Mailer.setFrom | public function setFrom($email, $name = '')
{
if (empty($email)) {
throw new MailerException('email is required for setFrom!');
}
if (empty($name)) {
$name = substr($email, 0, strrpos($email, '@'));
}
if (is_null($this->from)) {
$this->fr... | php | public function setFrom($email, $name = '')
{
if (empty($email)) {
throw new MailerException('email is required for setFrom!');
}
if (empty($name)) {
$name = substr($email, 0, strrpos($email, '@'));
}
if (is_null($this->from)) {
$this->fr... | [
"public",
"function",
"setFrom",
"(",
"$",
"email",
",",
"$",
"name",
"=",
"''",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"email",
")",
")",
"{",
"throw",
"new",
"MailerException",
"(",
"'email is required for setFrom!'",
")",
";",
"}",
"if",
"(",
"empt... | Sets the Sender of the email.
@param string $email
@param string $name
@return \Scara\Mail\Mailer | [
"Sets",
"the",
"Sender",
"of",
"the",
"email",
"."
] | 199b08b45fadf5dae14ac4732af03b36e15bbef2 | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Mail/Mailer.php#L174-L191 |
194,105 | ScaraMVC/Framework | src/Scara/Mail/Mailer.php | Mailer.cc | public function cc($email, $name = '')
{
if (empty($email)) {
throw new MailerException('email is required for cc!');
}
$this->_mailer->addCC($email, $name);
return $this;
} | php | public function cc($email, $name = '')
{
if (empty($email)) {
throw new MailerException('email is required for cc!');
}
$this->_mailer->addCC($email, $name);
return $this;
} | [
"public",
"function",
"cc",
"(",
"$",
"email",
",",
"$",
"name",
"=",
"''",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"email",
")",
")",
"{",
"throw",
"new",
"MailerException",
"(",
"'email is required for cc!'",
")",
";",
"}",
"$",
"this",
"->",
"_mai... | Adds a CC to the email.
@param string $email
@param string $name
@return \Scara\Mail\Mailer | [
"Adds",
"a",
"CC",
"to",
"the",
"email",
"."
] | 199b08b45fadf5dae14ac4732af03b36e15bbef2 | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Mail/Mailer.php#L201-L210 |
194,106 | ScaraMVC/Framework | src/Scara/Mail/Mailer.php | Mailer.bcc | public function bcc($email, $name = '')
{
if (empty($email)) {
throw new MailerException('email is required for bcc!');
}
$this->_mailer->addBCC($email, $name);
return $this;
} | php | public function bcc($email, $name = '')
{
if (empty($email)) {
throw new MailerException('email is required for bcc!');
}
$this->_mailer->addBCC($email, $name);
return $this;
} | [
"public",
"function",
"bcc",
"(",
"$",
"email",
",",
"$",
"name",
"=",
"''",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"email",
")",
")",
"{",
"throw",
"new",
"MailerException",
"(",
"'email is required for bcc!'",
")",
";",
"}",
"$",
"this",
"->",
"_m... | Adds a VCC to the email.
@param string $email
@param string $name
@return \Scara\Mail\Mailer | [
"Adds",
"a",
"VCC",
"to",
"the",
"email",
"."
] | 199b08b45fadf5dae14ac4732af03b36e15bbef2 | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Mail/Mailer.php#L220-L229 |
194,107 | ScaraMVC/Framework | src/Scara/Mail/Mailer.php | Mailer.addAddress | public function addAddress($email, $name = '')
{
if (empty($email)) {
throw new MailerException('email is required for addAddress!');
}
$this->_mailer->addAddress($email, $name);
return $this;
} | php | public function addAddress($email, $name = '')
{
if (empty($email)) {
throw new MailerException('email is required for addAddress!');
}
$this->_mailer->addAddress($email, $name);
return $this;
} | [
"public",
"function",
"addAddress",
"(",
"$",
"email",
",",
"$",
"name",
"=",
"''",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"email",
")",
")",
"{",
"throw",
"new",
"MailerException",
"(",
"'email is required for addAddress!'",
")",
";",
"}",
"$",
"this",... | Adds a recipient to the email.
@param string $email
@param string $name
@return \Scara\Mail\Mailer | [
"Adds",
"a",
"recipient",
"to",
"the",
"email",
"."
] | 199b08b45fadf5dae14ac4732af03b36e15bbef2 | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Mail/Mailer.php#L239-L248 |
194,108 | ScaraMVC/Framework | src/Scara/Mail/Mailer.php | Mailer.attach | public function attach($file)
{
if (empty($file)) {
throw new MailerException('a file is required to use attach!');
} elseif (!file_exists($file)) {
throw new MailerException("$file does not exist!");
}
$this->_mailer->addAttachment($file);
return $t... | php | public function attach($file)
{
if (empty($file)) {
throw new MailerException('a file is required to use attach!');
} elseif (!file_exists($file)) {
throw new MailerException("$file does not exist!");
}
$this->_mailer->addAttachment($file);
return $t... | [
"public",
"function",
"attach",
"(",
"$",
"file",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"file",
")",
")",
"{",
"throw",
"new",
"MailerException",
"(",
"'a file is required to use attach!'",
")",
";",
"}",
"elseif",
"(",
"!",
"file_exists",
"(",
"$",
"f... | Attaches a file to the email.
@param string $file
@return \Scara\Mail\Mailer | [
"Attaches",
"a",
"file",
"to",
"the",
"email",
"."
] | 199b08b45fadf5dae14ac4732af03b36e15bbef2 | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Mail/Mailer.php#L257-L268 |
194,109 | ScaraMVC/Framework | src/Scara/Mail/Mailer.php | Mailer.send | public function send()
{
$this->_mailer->addAddress($this->to[0], $this->to[1]);
$this->_mailer->setFrom($this->from[0], $this->from[1]);
$this->_mailer->isHtml($this->html);
$this->_mailer->Subject = $this->subject;
$this->_mailer->Body = $this->body;
$this->_mailer-... | php | public function send()
{
$this->_mailer->addAddress($this->to[0], $this->to[1]);
$this->_mailer->setFrom($this->from[0], $this->from[1]);
$this->_mailer->isHtml($this->html);
$this->_mailer->Subject = $this->subject;
$this->_mailer->Body = $this->body;
$this->_mailer-... | [
"public",
"function",
"send",
"(",
")",
"{",
"$",
"this",
"->",
"_mailer",
"->",
"addAddress",
"(",
"$",
"this",
"->",
"to",
"[",
"0",
"]",
",",
"$",
"this",
"->",
"to",
"[",
"1",
"]",
")",
";",
"$",
"this",
"->",
"_mailer",
"->",
"setFrom",
"(... | Sends the constructed email.
@return bool | [
"Sends",
"the",
"constructed",
"email",
"."
] | 199b08b45fadf5dae14ac4732af03b36e15bbef2 | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Mail/Mailer.php#L311-L321 |
194,110 | MarijnKoesen/php-code-generator | src/codegenerator/Request.php | Request.getCookieItem | public function getCookieItem($key)
{
return isset($this->cookie[$key]) ? $this->cookie[$key] : null;
} | php | public function getCookieItem($key)
{
return isset($this->cookie[$key]) ? $this->cookie[$key] : null;
} | [
"public",
"function",
"getCookieItem",
"(",
"$",
"key",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"cookie",
"[",
"$",
"key",
"]",
")",
"?",
"$",
"this",
"->",
"cookie",
"[",
"$",
"key",
"]",
":",
"null",
";",
"}"
] | Get a single cookie by index from the cookie array.
@param mixed $key. | [
"Get",
"a",
"single",
"cookie",
"by",
"index",
"from",
"the",
"cookie",
"array",
"."
] | 36e66505b8d5994d3ac159b776df5455ad01e1b1 | https://github.com/MarijnKoesen/php-code-generator/blob/36e66505b8d5994d3ac159b776df5455ad01e1b1/src/codegenerator/Request.php#L126-L129 |
194,111 | MarijnKoesen/php-code-generator | src/codegenerator/Request.php | Request.removeCookieItem | public function removeCookieItem($key)
{
if (isset($this->cookie[$key])) {
unset($this->cookie[$key]);
return true;
} else {
return false;
}
} | php | public function removeCookieItem($key)
{
if (isset($this->cookie[$key])) {
unset($this->cookie[$key]);
return true;
} else {
return false;
}
} | [
"public",
"function",
"removeCookieItem",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"cookie",
"[",
"$",
"key",
"]",
")",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"cookie",
"[",
"$",
"key",
"]",
")",
";",
"return",
... | Remove a single cookie by index from the cookie array.
@param mixed $key.
@return boolean $succes. | [
"Remove",
"a",
"single",
"cookie",
"by",
"index",
"from",
"the",
"cookie",
"array",
"."
] | 36e66505b8d5994d3ac159b776df5455ad01e1b1 | https://github.com/MarijnKoesen/php-code-generator/blob/36e66505b8d5994d3ac159b776df5455ad01e1b1/src/codegenerator/Request.php#L163-L171 |
194,112 | MarijnKoesen/php-code-generator | src/codegenerator/Request.php | Request.removeFile | public function removeFile($key)
{
if (isset($this->files[$key])) {
unset($this->files[$key]);
return true;
} else {
return false;
}
} | php | public function removeFile($key)
{
if (isset($this->files[$key])) {
unset($this->files[$key]);
return true;
} else {
return false;
}
} | [
"public",
"function",
"removeFile",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"files",
"[",
"$",
"key",
"]",
")",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"files",
"[",
"$",
"key",
"]",
")",
";",
"return",
"true",... | Remove a single file by index from the files array.
@param mixed $key.
@return boolean $succes. | [
"Remove",
"a",
"single",
"file",
"by",
"index",
"from",
"the",
"files",
"array",
"."
] | 36e66505b8d5994d3ac159b776df5455ad01e1b1 | https://github.com/MarijnKoesen/php-code-generator/blob/36e66505b8d5994d3ac159b776df5455ad01e1b1/src/codegenerator/Request.php#L236-L244 |
194,113 | MarijnKoesen/php-code-generator | src/codegenerator/Request.php | Request.getGetItem | public function getGetItem($key)
{
return isset($this->get[$key]) ? $this->get[$key] : null;
} | php | public function getGetItem($key)
{
return isset($this->get[$key]) ? $this->get[$key] : null;
} | [
"public",
"function",
"getGetItem",
"(",
"$",
"key",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"get",
"[",
"$",
"key",
"]",
")",
"?",
"$",
"this",
"->",
"get",
"[",
"$",
"key",
"]",
":",
"null",
";",
"}"
] | Get a single get by index from the get array.
@param mixed $key. | [
"Get",
"a",
"single",
"get",
"by",
"index",
"from",
"the",
"get",
"array",
"."
] | 36e66505b8d5994d3ac159b776df5455ad01e1b1 | https://github.com/MarijnKoesen/php-code-generator/blob/36e66505b8d5994d3ac159b776df5455ad01e1b1/src/codegenerator/Request.php#L268-L271 |
194,114 | MarijnKoesen/php-code-generator | src/codegenerator/Request.php | Request.removeGetItem | public function removeGetItem($key)
{
if (isset($this->get[$key])) {
unset($this->get[$key]);
return true;
} else {
return false;
}
} | php | public function removeGetItem($key)
{
if (isset($this->get[$key])) {
unset($this->get[$key]);
return true;
} else {
return false;
}
} | [
"public",
"function",
"removeGetItem",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"get",
"[",
"$",
"key",
"]",
")",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"get",
"[",
"$",
"key",
"]",
")",
";",
"return",
"true",
... | Remove a single get by index from the get array.
@param mixed $key.
@return boolean $succes. | [
"Remove",
"a",
"single",
"get",
"by",
"index",
"from",
"the",
"get",
"array",
"."
] | 36e66505b8d5994d3ac159b776df5455ad01e1b1 | https://github.com/MarijnKoesen/php-code-generator/blob/36e66505b8d5994d3ac159b776df5455ad01e1b1/src/codegenerator/Request.php#L305-L313 |
194,115 | MarijnKoesen/php-code-generator | src/codegenerator/Request.php | Request.removeParameter | public function removeParameter($key)
{
if (isset($this->parameters[$key])) {
unset($this->parameters[$key]);
return true;
} else {
return false;
}
} | php | public function removeParameter($key)
{
if (isset($this->parameters[$key])) {
unset($this->parameters[$key]);
return true;
} else {
return false;
}
} | [
"public",
"function",
"removeParameter",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"parameters",
"[",
"$",
"key",
"]",
")",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"parameters",
"[",
"$",
"key",
"]",
")",
";",
"ret... | Remove a single parameter by index from the parameters array.
@param mixed $key.
@return boolean $succes. | [
"Remove",
"a",
"single",
"parameter",
"by",
"index",
"from",
"the",
"parameters",
"array",
"."
] | 36e66505b8d5994d3ac159b776df5455ad01e1b1 | https://github.com/MarijnKoesen/php-code-generator/blob/36e66505b8d5994d3ac159b776df5455ad01e1b1/src/codegenerator/Request.php#L387-L395 |
194,116 | MarijnKoesen/php-code-generator | src/codegenerator/Request.php | Request.getPostItem | public function getPostItem($key)
{
return isset($this->post[$key]) ? $this->post[$key] : null;
} | php | public function getPostItem($key)
{
return isset($this->post[$key]) ? $this->post[$key] : null;
} | [
"public",
"function",
"getPostItem",
"(",
"$",
"key",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"post",
"[",
"$",
"key",
"]",
")",
"?",
"$",
"this",
"->",
"post",
"[",
"$",
"key",
"]",
":",
"null",
";",
"}"
] | Get a single post by index from the post array.
@param mixed $key. | [
"Get",
"a",
"single",
"post",
"by",
"index",
"from",
"the",
"post",
"array",
"."
] | 36e66505b8d5994d3ac159b776df5455ad01e1b1 | https://github.com/MarijnKoesen/php-code-generator/blob/36e66505b8d5994d3ac159b776df5455ad01e1b1/src/codegenerator/Request.php#L432-L435 |
194,117 | MarijnKoesen/php-code-generator | src/codegenerator/Request.php | Request.getSessionItem | public function getSessionItem($key)
{
return isset($this->session[$key]) ? $this->session[$key] : null;
} | php | public function getSessionItem($key)
{
return isset($this->session[$key]) ? $this->session[$key] : null;
} | [
"public",
"function",
"getSessionItem",
"(",
"$",
"key",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"session",
"[",
"$",
"key",
"]",
")",
"?",
"$",
"this",
"->",
"session",
"[",
"$",
"key",
"]",
":",
"null",
";",
"}"
] | Get a single session by index from the session array.
@param mixed $key. | [
"Get",
"a",
"single",
"session",
"by",
"index",
"from",
"the",
"session",
"array",
"."
] | 36e66505b8d5994d3ac159b776df5455ad01e1b1 | https://github.com/MarijnKoesen/php-code-generator/blob/36e66505b8d5994d3ac159b776df5455ad01e1b1/src/codegenerator/Request.php#L500-L503 |
194,118 | MarijnKoesen/php-code-generator | src/codegenerator/Request.php | Request.removeSessionItem | public function removeSessionItem($key)
{
if (isset($this->session[$key])) {
unset($this->session[$key]);
return true;
} else {
return false;
}
} | php | public function removeSessionItem($key)
{
if (isset($this->session[$key])) {
unset($this->session[$key]);
return true;
} else {
return false;
}
} | [
"public",
"function",
"removeSessionItem",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"session",
"[",
"$",
"key",
"]",
")",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"session",
"[",
"$",
"key",
"]",
")",
";",
"return"... | Remove a single session by index from the session array.
@param mixed $key.
@return boolean $succes. | [
"Remove",
"a",
"single",
"session",
"by",
"index",
"from",
"the",
"session",
"array",
"."
] | 36e66505b8d5994d3ac159b776df5455ad01e1b1 | https://github.com/MarijnKoesen/php-code-generator/blob/36e66505b8d5994d3ac159b776df5455ad01e1b1/src/codegenerator/Request.php#L537-L545 |
194,119 | Fulfillment-dot-com/api-wrapper-php | src/Utilities/Helper.php | Helper.getStoragePath | public static function getStoragePath($path = '')
{
if (function_exists('storage_path'))
{
return storage_path($path);
}
else
{
return (__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '../storage') . ($path ? DIRECTORY_SEPARATOR . $path : $path);
}
} | php | public static function getStoragePath($path = '')
{
if (function_exists('storage_path'))
{
return storage_path($path);
}
else
{
return (__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '../storage') . ($path ? DIRECTORY_SEPARATOR . $path : $path);
}
} | [
"public",
"static",
"function",
"getStoragePath",
"(",
"$",
"path",
"=",
"''",
")",
"{",
"if",
"(",
"function_exists",
"(",
"'storage_path'",
")",
")",
"{",
"return",
"storage_path",
"(",
"$",
"path",
")",
";",
"}",
"else",
"{",
"return",
"(",
"__DIR__",... | Get the path to the storage folder.
@param string $path
@return string | [
"Get",
"the",
"path",
"to",
"the",
"storage",
"folder",
"."
] | f4352843d060bc1b460c1283f25c210c9b94d324 | https://github.com/Fulfillment-dot-com/api-wrapper-php/blob/f4352843d060bc1b460c1283f25c210c9b94d324/src/Utilities/Helper.php#L11-L21 |
194,120 | wb-crowdfusion/crowdfusion | system/core/classes/mvc/filters/JsonFilterer.php | JsonFilterer.encode | public function encode()
{
if (is_null($this->getParameter('value')))
return '""';
$value = $this->getParameter('value');
$index = $this->getParameter('index');
if($index != null && is_array($value))
return JSONUtils::encode($value[$index]);
return ... | php | public function encode()
{
if (is_null($this->getParameter('value')))
return '""';
$value = $this->getParameter('value');
$index = $this->getParameter('index');
if($index != null && is_array($value))
return JSONUtils::encode($value[$index]);
return ... | [
"public",
"function",
"encode",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"getParameter",
"(",
"'value'",
")",
")",
")",
"return",
"'\"\"'",
";",
"$",
"value",
"=",
"$",
"this",
"->",
"getParameter",
"(",
"'value'",
")",
";",
"$",
... | Escapes the specified parameter in 'value' for use in json
Expected Param:
value mixed if is a string, this is what will be converted
index string if specified and value is an array, then value[index] will be converted
@return string | [
"Escapes",
"the",
"specified",
"parameter",
"in",
"value",
"for",
"use",
"in",
"json"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/mvc/filters/JsonFilterer.php#L39-L51 |
194,121 | faizalpribadi/Cache | Driver/OpCache/Memcache.php | Memcache.set | public function set($id, $data, $lifeTime = 0)
{
if ($lifeTime > (int) 2592000) {
$lifeTime = time() + $lifeTime;
}
return $this->memcache->add($id, $data, CacheFlags::CACHE_COMPRESSED, (int) $lifeTime);
} | php | public function set($id, $data, $lifeTime = 0)
{
if ($lifeTime > (int) 2592000) {
$lifeTime = time() + $lifeTime;
}
return $this->memcache->add($id, $data, CacheFlags::CACHE_COMPRESSED, (int) $lifeTime);
} | [
"public",
"function",
"set",
"(",
"$",
"id",
",",
"$",
"data",
",",
"$",
"lifeTime",
"=",
"0",
")",
"{",
"if",
"(",
"$",
"lifeTime",
">",
"(",
"int",
")",
"2592000",
")",
"{",
"$",
"lifeTime",
"=",
"time",
"(",
")",
"+",
"$",
"lifeTime",
";",
... | Set the data content for memcache cache provider
@param string $id
@param string $data
@param int $lifeTime
@return mixed | [
"Set",
"the",
"data",
"content",
"for",
"memcache",
"cache",
"provider"
] | e62a4d71739e542ca6e7bac77f5cc522accef8cb | https://github.com/faizalpribadi/Cache/blob/e62a4d71739e542ca6e7bac77f5cc522accef8cb/Driver/OpCache/Memcache.php#L70-L77 |
194,122 | faizalpribadi/Cache | Driver/OpCache/Memcache.php | Memcache.get | public function get($id)
{
if (function_exists('memcache_get')) {
return $this->memcache->get($id);
}
throw new MemcacheException(
sprintf('key id memcache "%s" not found, are you sure memcache_get function already loaded ?', $id)
);
} | php | public function get($id)
{
if (function_exists('memcache_get')) {
return $this->memcache->get($id);
}
throw new MemcacheException(
sprintf('key id memcache "%s" not found, are you sure memcache_get function already loaded ?', $id)
);
} | [
"public",
"function",
"get",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"function_exists",
"(",
"'memcache_get'",
")",
")",
"{",
"return",
"$",
"this",
"->",
"memcache",
"->",
"get",
"(",
"$",
"id",
")",
";",
"}",
"throw",
"new",
"MemcacheException",
"(",
... | Get data content from cache key memcache
@param string $id
@return string
@throws \Mozart\Library\Cache\Exception\MemcacheException | [
"Get",
"data",
"content",
"from",
"cache",
"key",
"memcache"
] | e62a4d71739e542ca6e7bac77f5cc522accef8cb | https://github.com/faizalpribadi/Cache/blob/e62a4d71739e542ca6e7bac77f5cc522accef8cb/Driver/OpCache/Memcache.php#L87-L96 |
194,123 | modusphp/framework | src/Response/ResponseManager.php | ResponseManager.process | public function process(PayloadInterface $payload, ResponseGenerator $generator)
{
$typeMap = $generator->checkContentResponseType();
$availableTypes = array_keys($typeMap);
$type = $this->determineResponseType($availableTypes);
// If we don't get a valid type back, let's force on... | php | public function process(PayloadInterface $payload, ResponseGenerator $generator)
{
$typeMap = $generator->checkContentResponseType();
$availableTypes = array_keys($typeMap);
$type = $this->determineResponseType($availableTypes);
// If we don't get a valid type back, let's force on... | [
"public",
"function",
"process",
"(",
"PayloadInterface",
"$",
"payload",
",",
"ResponseGenerator",
"$",
"generator",
")",
"{",
"$",
"typeMap",
"=",
"$",
"generator",
"->",
"checkContentResponseType",
"(",
")",
";",
"$",
"availableTypes",
"=",
"array_keys",
"(",... | Processes the results of the Action.
@var $payload PayloadInterface
@var $generator ResponseGenerator
@throws Exception\ContentTypeNotValidException | [
"Processes",
"the",
"results",
"of",
"the",
"Action",
"."
] | 9d041a2de97b1736702bf75c0f5e9d1c69366746 | https://github.com/modusphp/framework/blob/9d041a2de97b1736702bf75c0f5e9d1c69366746/src/Response/ResponseManager.php#L45-L61 |
194,124 | modusphp/framework | src/Response/ResponseManager.php | ResponseManager.determineResponseType | protected function determineResponseType($availableTypes)
{
$bestType = $this->contentNegotiation->negotiateMedia($availableTypes);
if ($bestType instanceof Accept\Media\MediaValue) {
$contentType = $bestType->getValue();
$subType = $bestType->getSubtype();
$this-... | php | protected function determineResponseType($availableTypes)
{
$bestType = $this->contentNegotiation->negotiateMedia($availableTypes);
if ($bestType instanceof Accept\Media\MediaValue) {
$contentType = $bestType->getValue();
$subType = $bestType->getSubtype();
$this-... | [
"protected",
"function",
"determineResponseType",
"(",
"$",
"availableTypes",
")",
"{",
"$",
"bestType",
"=",
"$",
"this",
"->",
"contentNegotiation",
"->",
"negotiateMedia",
"(",
"$",
"availableTypes",
")",
";",
"if",
"(",
"$",
"bestType",
"instanceof",
"Accept... | Determines if the Accepts header types match what this responder is configured to return.
If not, we throw an exception.
@throws Exception\ContentTypeNotValidException | [
"Determines",
"if",
"the",
"Accepts",
"header",
"types",
"match",
"what",
"this",
"responder",
"is",
"configured",
"to",
"return",
".",
"If",
"not",
"we",
"throw",
"an",
"exception",
"."
] | 9d041a2de97b1736702bf75c0f5e9d1c69366746 | https://github.com/modusphp/framework/blob/9d041a2de97b1736702bf75c0f5e9d1c69366746/src/Response/ResponseManager.php#L79-L88 |
194,125 | tjwlucas/phpjstore | src/jstoreObject.php | jstoreObject.toJSON | public function toJSON()
{
$allvals = Array();
$reflection = new \ReflectionObject($this);
$properties = $reflection->getProperties(\ReflectionProperty::IS_PUBLIC);
foreach($properties as $prop){
$propkey = $prop->getName();
$allvals[$propkey] = $this->$pro... | php | public function toJSON()
{
$allvals = Array();
$reflection = new \ReflectionObject($this);
$properties = $reflection->getProperties(\ReflectionProperty::IS_PUBLIC);
foreach($properties as $prop){
$propkey = $prop->getName();
$allvals[$propkey] = $this->$pro... | [
"public",
"function",
"toJSON",
"(",
")",
"{",
"$",
"allvals",
"=",
"Array",
"(",
")",
";",
"$",
"reflection",
"=",
"new",
"\\",
"ReflectionObject",
"(",
"$",
"this",
")",
";",
"$",
"properties",
"=",
"$",
"reflection",
"->",
"getProperties",
"(",
"\\"... | Outputs the object as a JSON | [
"Outputs",
"the",
"object",
"as",
"a",
"JSON"
] | ebc8f821de38757724efb89992a9d3aa9f9834d2 | https://github.com/tjwlucas/phpjstore/blob/ebc8f821de38757724efb89992a9d3aa9f9834d2/src/jstoreObject.php#L18-L29 |
194,126 | koolkode/view-express | src/ExpressCompiler.php | ExpressCompiler.write | public function write($contents)
{
if($this->output != '')
{
$this->buffer .= "\t\t\$out->write(" . var_export($this->output, true) . ");\n";
$this->output = '';
}
$this->buffer .= $contents;
} | php | public function write($contents)
{
if($this->output != '')
{
$this->buffer .= "\t\t\$out->write(" . var_export($this->output, true) . ");\n";
$this->output = '';
}
$this->buffer .= $contents;
} | [
"public",
"function",
"write",
"(",
"$",
"contents",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"output",
"!=",
"''",
")",
"{",
"$",
"this",
"->",
"buffer",
".=",
"\"\\t\\t\\$out->write(\"",
".",
"var_export",
"(",
"$",
"this",
"->",
"output",
",",
"true"... | Write instructions into the generated code.
@param string $contents | [
"Write",
"instructions",
"into",
"the",
"generated",
"code",
"."
] | a8ebe6f373b6bfe8b8818d6264535e8fe063a596 | https://github.com/koolkode/view-express/blob/a8ebe6f373b6bfe8b8818d6264535e8fe063a596/src/ExpressCompiler.php#L168-L177 |
194,127 | koolkode/view-express | src/ExpressCompiler.php | ExpressCompiler.generateCode | public function generateCode($key)
{
if($this->extends === NULL && $this->output != '')
{
$this->buffer .= "\t\t\$out->write(" . var_export($this->output, true) . ");\n";
$this->output = '';
}
$buffer = sprintf("<?php\n\nnamespace %s {\n\n", __NAMESPACE__);
$buffer .= 'use KoolKode\View\TagBuilder;... | php | public function generateCode($key)
{
if($this->extends === NULL && $this->output != '')
{
$this->buffer .= "\t\t\$out->write(" . var_export($this->output, true) . ");\n";
$this->output = '';
}
$buffer = sprintf("<?php\n\nnamespace %s {\n\n", __NAMESPACE__);
$buffer .= 'use KoolKode\View\TagBuilder;... | [
"public",
"function",
"generateCode",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"extends",
"===",
"NULL",
"&&",
"$",
"this",
"->",
"output",
"!=",
"''",
")",
"{",
"$",
"this",
"->",
"buffer",
".=",
"\"\\t\\t\\$out->write(\"",
".",
"var_e... | Generate code within a class and return it.
@param string $key Will be prepended to the class name to make it unique.
@return string | [
"Generate",
"code",
"within",
"a",
"class",
"and",
"return",
"it",
"."
] | a8ebe6f373b6bfe8b8818d6264535e8fe063a596 | https://github.com/koolkode/view-express/blob/a8ebe6f373b6bfe8b8818d6264535e8fe063a596/src/ExpressCompiler.php#L232-L302 |
194,128 | metaclassing/PHP-Curler | src/Certbot.php | Certbot.findCertificate | public function findCertificate($name)
{
foreach ($this->accounttypes as $type) {
foreach ($this->accounts[$type] as $account) {
// Skip empty accounts with no visible certificates
if (!isset($account['certificates'])) {
continue;
... | php | public function findCertificate($name)
{
foreach ($this->accounttypes as $type) {
foreach ($this->accounts[$type] as $account) {
// Skip empty accounts with no visible certificates
if (!isset($account['certificates'])) {
continue;
... | [
"public",
"function",
"findCertificate",
"(",
"$",
"name",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"accounttypes",
"as",
"$",
"type",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"accounts",
"[",
"$",
"type",
"]",
"as",
"$",
"account",
")",
"{",... | Really only necessary until I implement a direct API route to search for certificates... | [
"Really",
"only",
"necessary",
"until",
"I",
"implement",
"a",
"direct",
"API",
"route",
"to",
"search",
"for",
"certificates",
"..."
] | 6e658c141171d852c68754d452dbfb97b24638cc | https://github.com/metaclassing/PHP-Curler/blob/6e658c141171d852c68754d452dbfb97b24638cc/src/Certbot.php#L92-L110 |
194,129 | juliangut/mapping | src/Driver/AbstractMappingDriver.php | AbstractMappingDriver.getMappingData | protected function getMappingData(): array
{
$mappings = [];
foreach ($this->locator->getMappingFiles() as $mappingFile) {
$mappings[] = $this->loadMappingFile($mappingFile);
}
$mappingData = [];
foreach ($mappings as $mapping) {
$mappingData = $this... | php | protected function getMappingData(): array
{
$mappings = [];
foreach ($this->locator->getMappingFiles() as $mappingFile) {
$mappings[] = $this->loadMappingFile($mappingFile);
}
$mappingData = [];
foreach ($mappings as $mapping) {
$mappingData = $this... | [
"protected",
"function",
"getMappingData",
"(",
")",
":",
"array",
"{",
"$",
"mappings",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"locator",
"->",
"getMappingFiles",
"(",
")",
"as",
"$",
"mappingFile",
")",
"{",
"$",
"mappings",
"[",
"]",... | Get mapping data.
@throws \Jgut\Mapping\Exception\DriverException
@return mixed[] | [
"Get",
"mapping",
"data",
"."
] | 1830ff84c054d8e3759df170a5664a97f7070be9 | https://github.com/juliangut/mapping/blob/1830ff84c054d8e3759df170a5664a97f7070be9/src/Driver/AbstractMappingDriver.php#L28-L42 |
194,130 | juliangut/mapping | src/Driver/AbstractMappingDriver.php | AbstractMappingDriver.mergeMappings | final protected function mergeMappings(array $mappingsA, array $mappingsB): array
{
foreach ($mappingsB as $key => $value) {
if (isset($mappingsA[$key]) || \array_key_exists($key, $mappingsA)) {
if (\is_int($key)) {
$mappingsA[] = $value;
} els... | php | final protected function mergeMappings(array $mappingsA, array $mappingsB): array
{
foreach ($mappingsB as $key => $value) {
if (isset($mappingsA[$key]) || \array_key_exists($key, $mappingsA)) {
if (\is_int($key)) {
$mappingsA[] = $value;
} els... | [
"final",
"protected",
"function",
"mergeMappings",
"(",
"array",
"$",
"mappingsA",
",",
"array",
"$",
"mappingsB",
")",
":",
"array",
"{",
"foreach",
"(",
"$",
"mappingsB",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
... | Merge mapping data.
@param array $mappingsA
@param array $mappingsB
@return array | [
"Merge",
"mapping",
"data",
"."
] | 1830ff84c054d8e3759df170a5664a97f7070be9 | https://github.com/juliangut/mapping/blob/1830ff84c054d8e3759df170a5664a97f7070be9/src/Driver/AbstractMappingDriver.php#L61-L78 |
194,131 | ezra-obiwale/dSCore | src/Core/Authenticate.php | Authenticate.checkPermission | private function checkPermission(array $properties) {
if (empty($properties))
return true;
if (isset($properties['actions']) && !is_array($properties['actions']))
$properties['actions'] = array($properties['actions']);
if (isset($properties['actions']) && !empty($properties['actions']) &&
!in_array($th... | php | private function checkPermission(array $properties) {
if (empty($properties))
return true;
if (isset($properties['actions']) && !is_array($properties['actions']))
$properties['actions'] = array($properties['actions']);
if (isset($properties['actions']) && !empty($properties['actions']) &&
!in_array($th... | [
"private",
"function",
"checkPermission",
"(",
"array",
"$",
"properties",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"properties",
")",
")",
"return",
"true",
";",
"if",
"(",
"isset",
"(",
"$",
"properties",
"[",
"'actions'",
"]",
")",
"&&",
"!",
"is_arr... | Checks each permission
@param array $properties
@return null|boolean
@throws \Exception | [
"Checks",
"each",
"permission"
] | dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d | https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Core/Authenticate.php#L43-L76 |
194,132 | ezra-obiwale/dSCore | src/Core/Authenticate.php | Authenticate.execute | final public function execute() {
if (!is_array($this->controller->accessRules()))
throw new \Exception('Authentication failed: Method "accessRules" in "' .
$this->controller->getClass() . '" must return an array');
foreach ($this->controller->accessRules() as $rule) {
if (!is_array($rule))
throw new ... | php | final public function execute() {
if (!is_array($this->controller->accessRules()))
throw new \Exception('Authentication failed: Method "accessRules" in "' .
$this->controller->getClass() . '" must return an array');
foreach ($this->controller->accessRules() as $rule) {
if (!is_array($rule))
throw new ... | [
"final",
"public",
"function",
"execute",
"(",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"this",
"->",
"controller",
"->",
"accessRules",
"(",
")",
")",
")",
"throw",
"new",
"\\",
"Exception",
"(",
"'Authentication failed: Method \"accessRules\" in \"'",
... | Executes the authentication
@return boolean
@throws \Exception | [
"Executes",
"the",
"authentication"
] | dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d | https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Core/Authenticate.php#L83-L113 |
194,133 | perryflynn/PerrysLambda | src/PerrysLambda/Sortable.php | Sortable.startOrder | public static function startOrder(ArrayList $list, $order)
{
$order = LambdaUtils::toSelectCallable($order);
$temp = new static($list, $order, self::ORDER_ASC);
$temp->thenBy($order);
return $temp;
} | php | public static function startOrder(ArrayList $list, $order)
{
$order = LambdaUtils::toSelectCallable($order);
$temp = new static($list, $order, self::ORDER_ASC);
$temp->thenBy($order);
return $temp;
} | [
"public",
"static",
"function",
"startOrder",
"(",
"ArrayList",
"$",
"list",
",",
"$",
"order",
")",
"{",
"$",
"order",
"=",
"LambdaUtils",
"::",
"toSelectCallable",
"(",
"$",
"order",
")",
";",
"$",
"temp",
"=",
"new",
"static",
"(",
"$",
"list",
",",... | Create asc order instance
@param \PerrysLambda\ArrayList $list
@param callable|string|null $order
@return \PerrysLambda\Sortable | [
"Create",
"asc",
"order",
"instance"
] | 9f1734ae4689d73278b887f9354dfd31428e96de | https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/Sortable.php#L21-L27 |
194,134 | perryflynn/PerrysLambda | src/PerrysLambda/Sortable.php | Sortable.startOrderDesc | public static function startOrderDesc(ArrayList $list, $order)
{
$order = LambdaUtils::toSelectCallable($order);
$temp = new static($list, $order, self::ORDER_DESC);
$temp->thenByDesc($order);
return $temp;
} | php | public static function startOrderDesc(ArrayList $list, $order)
{
$order = LambdaUtils::toSelectCallable($order);
$temp = new static($list, $order, self::ORDER_DESC);
$temp->thenByDesc($order);
return $temp;
} | [
"public",
"static",
"function",
"startOrderDesc",
"(",
"ArrayList",
"$",
"list",
",",
"$",
"order",
")",
"{",
"$",
"order",
"=",
"LambdaUtils",
"::",
"toSelectCallable",
"(",
"$",
"order",
")",
";",
"$",
"temp",
"=",
"new",
"static",
"(",
"$",
"list",
... | Create desc order instance
@param \PerrysLambda\ArrayList $list
@param callable|string|null $order
@return \PerrysLambda\Sortable | [
"Create",
"desc",
"order",
"instance"
] | 9f1734ae4689d73278b887f9354dfd31428e96de | https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/Sortable.php#L35-L41 |
194,135 | perryflynn/PerrysLambda | src/PerrysLambda/Sortable.php | Sortable.thenBy | public function thenBy($order)
{
$order = LambdaUtils::toSelectCallable($order);
$this->orders[] = array("property" => $order, "direction" => self::ORDER_ASC);
return $this;
} | php | public function thenBy($order)
{
$order = LambdaUtils::toSelectCallable($order);
$this->orders[] = array("property" => $order, "direction" => self::ORDER_ASC);
return $this;
} | [
"public",
"function",
"thenBy",
"(",
"$",
"order",
")",
"{",
"$",
"order",
"=",
"LambdaUtils",
"::",
"toSelectCallable",
"(",
"$",
"order",
")",
";",
"$",
"this",
"->",
"orders",
"[",
"]",
"=",
"array",
"(",
"\"property\"",
"=>",
"$",
"order",
",",
"... | New asc order rule
@param callable|string|null $order
@return \PerrysLambda\Sortable | [
"New",
"asc",
"order",
"rule"
] | 9f1734ae4689d73278b887f9354dfd31428e96de | https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/Sortable.php#L55-L60 |
194,136 | perryflynn/PerrysLambda | src/PerrysLambda/Sortable.php | Sortable.thenByDesc | public function thenByDesc($order)
{
$order = LambdaUtils::toSelectCallable($order);
$this->orders[] = array("property" => $order, "direction" => self::ORDER_DESC);
return $this;
} | php | public function thenByDesc($order)
{
$order = LambdaUtils::toSelectCallable($order);
$this->orders[] = array("property" => $order, "direction" => self::ORDER_DESC);
return $this;
} | [
"public",
"function",
"thenByDesc",
"(",
"$",
"order",
")",
"{",
"$",
"order",
"=",
"LambdaUtils",
"::",
"toSelectCallable",
"(",
"$",
"order",
")",
";",
"$",
"this",
"->",
"orders",
"[",
"]",
"=",
"array",
"(",
"\"property\"",
"=>",
"$",
"order",
",",... | New desc order rule
@param callable|string|null $order
@return \PerrysLambda\Sortable | [
"New",
"desc",
"order",
"rule"
] | 9f1734ae4689d73278b887f9354dfd31428e96de | https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/Sortable.php#L67-L72 |
194,137 | perryflynn/PerrysLambda | src/PerrysLambda/Sortable.php | Sortable.setDefaultComparator | protected function setDefaultComparator()
{
$func = function($a, $b)
{
$temp = 0;
$cmpres = null;
foreach($this->orders as $order)
{
$valuea = call_user_func($order['property'], $a);
$valueb = call_user_func($order['prop... | php | protected function setDefaultComparator()
{
$func = function($a, $b)
{
$temp = 0;
$cmpres = null;
foreach($this->orders as $order)
{
$valuea = call_user_func($order['property'], $a);
$valueb = call_user_func($order['prop... | [
"protected",
"function",
"setDefaultComparator",
"(",
")",
"{",
"$",
"func",
"=",
"function",
"(",
"$",
"a",
",",
"$",
"b",
")",
"{",
"$",
"temp",
"=",
"0",
";",
"$",
"cmpres",
"=",
"null",
";",
"foreach",
"(",
"$",
"this",
"->",
"orders",
"as",
... | Set the default compare method | [
"Set",
"the",
"default",
"compare",
"method"
] | 9f1734ae4689d73278b887f9354dfd31428e96de | https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/Sortable.php#L97-L133 |
194,138 | perryflynn/PerrysLambda | src/PerrysLambda/Sortable.php | Sortable.toList | public function toList()
{
$data = $this->list->getData();
usort($data, $this->getComparator());
$newlist = $this->list->newInstance();
$newlist->setData($data);
return $newlist;
} | php | public function toList()
{
$data = $this->list->getData();
usort($data, $this->getComparator());
$newlist = $this->list->newInstance();
$newlist->setData($data);
return $newlist;
} | [
"public",
"function",
"toList",
"(",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"list",
"->",
"getData",
"(",
")",
";",
"usort",
"(",
"$",
"data",
",",
"$",
"this",
"->",
"getComparator",
"(",
")",
")",
";",
"$",
"newlist",
"=",
"$",
"this",
... | Sort and get the result
@return \PerrysLambda\ArrayList | [
"Sort",
"and",
"get",
"the",
"result"
] | 9f1734ae4689d73278b887f9354dfd31428e96de | https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/Sortable.php#L139-L148 |
194,139 | rawphp/RawSession | src/RawPHP/RawSession/Handler/FileHandler.php | FileHandler.getFileContents | protected function getFileContents()
{
$json = file_get_contents( $this->sessionPath );
$this->items = json_decode( $json, TRUE );
} | php | protected function getFileContents()
{
$json = file_get_contents( $this->sessionPath );
$this->items = json_decode( $json, TRUE );
} | [
"protected",
"function",
"getFileContents",
"(",
")",
"{",
"$",
"json",
"=",
"file_get_contents",
"(",
"$",
"this",
"->",
"sessionPath",
")",
";",
"$",
"this",
"->",
"items",
"=",
"json_decode",
"(",
"$",
"json",
",",
"TRUE",
")",
";",
"}"
] | Get file contents from file. | [
"Get",
"file",
"contents",
"from",
"file",
"."
] | 1e410e1def1d6d61acfade3bd31478464c70aea3 | https://github.com/rawphp/RawSession/blob/1e410e1def1d6d61acfade3bd31478464c70aea3/src/RawPHP/RawSession/Handler/FileHandler.php#L151-L156 |
194,140 | betasyntax/Betasyntax-Framework-Core | src/Betasyntax/Core/Application.php | Application.getEnvironment | private function getEnvironment()
{
$env = new \Dotenv\Dotenv($this->basePath);
$env->load();
$this->env['env'] = getenv('APP_ENV');
$this->env['debug'] = getenv('APP_DEBUG');
$this->env['appSecret'] = getenv('APP_KEY');
} | php | private function getEnvironment()
{
$env = new \Dotenv\Dotenv($this->basePath);
$env->load();
$this->env['env'] = getenv('APP_ENV');
$this->env['debug'] = getenv('APP_DEBUG');
$this->env['appSecret'] = getenv('APP_KEY');
} | [
"private",
"function",
"getEnvironment",
"(",
")",
"{",
"$",
"env",
"=",
"new",
"\\",
"Dotenv",
"\\",
"Dotenv",
"(",
"$",
"this",
"->",
"basePath",
")",
";",
"$",
"env",
"->",
"load",
"(",
")",
";",
"$",
"this",
"->",
"env",
"[",
"'env'",
"]",
"=... | Loads the environment from your .env file
@return array | [
"Loads",
"the",
"environment",
"from",
"your",
".",
"env",
"file"
] | 2d135ec1f7dd98e6ef21512a069ac2595f1eb78e | https://github.com/betasyntax/Betasyntax-Framework-Core/blob/2d135ec1f7dd98e6ef21512a069ac2595f1eb78e/src/Betasyntax/Core/Application.php#L210-L217 |
194,141 | betasyntax/Betasyntax-Framework-Core | src/Betasyntax/Core/Application.php | Application.boot | public function boot()
{
//start the session
$this->session = Session::getInstance();
// create the container instance
$this->container = new AppContainer;
//boot the app and registers any middlewhere
$this->container->addServiceProvider(new ServiceProvider($this));
} | php | public function boot()
{
//start the session
$this->session = Session::getInstance();
// create the container instance
$this->container = new AppContainer;
//boot the app and registers any middlewhere
$this->container->addServiceProvider(new ServiceProvider($this));
} | [
"public",
"function",
"boot",
"(",
")",
"{",
"//start the session",
"$",
"this",
"->",
"session",
"=",
"Session",
"::",
"getInstance",
"(",
")",
";",
"// create the container instance",
"$",
"this",
"->",
"container",
"=",
"new",
"AppContainer",
";",
"//boot the... | Application boot method. Loads the app providers and sets some default application variables
@return void | [
"Application",
"boot",
"method",
".",
"Loads",
"the",
"app",
"providers",
"and",
"sets",
"some",
"default",
"application",
"variables"
] | 2d135ec1f7dd98e6ef21512a069ac2595f1eb78e | https://github.com/betasyntax/Betasyntax-Framework-Core/blob/2d135ec1f7dd98e6ef21512a069ac2595f1eb78e/src/Betasyntax/Core/Application.php#L259-L267 |
194,142 | WellBloud/sovacore-core | src/model/AdminModule/facade/BaseFacade.php | BaseFacade.getParentsForBreadcrumbs | public function getParentsForBreadcrumbs(
$entity,
&$parents = []
)
{
array_push($parents, $entity);
if ($entity->parent !== null) {
$this->getParentsForBreadcrumbs($entity->parent, $parents);
}
return array_reverse($parents);
} | php | public function getParentsForBreadcrumbs(
$entity,
&$parents = []
)
{
array_push($parents, $entity);
if ($entity->parent !== null) {
$this->getParentsForBreadcrumbs($entity->parent, $parents);
}
return array_reverse($parents);
} | [
"public",
"function",
"getParentsForBreadcrumbs",
"(",
"$",
"entity",
",",
"&",
"$",
"parents",
"=",
"[",
"]",
")",
"{",
"array_push",
"(",
"$",
"parents",
",",
"$",
"entity",
")",
";",
"if",
"(",
"$",
"entity",
"->",
"parent",
"!==",
"null",
")",
"{... | Finds all parents of the entity
@param type $entity
@param array $parents
@return array | [
"Finds",
"all",
"parents",
"of",
"the",
"entity"
] | 1816a0d7cd3ec4a90d64e301fc2469d171ad217f | https://github.com/WellBloud/sovacore-core/blob/1816a0d7cd3ec4a90d64e301fc2469d171ad217f/src/model/AdminModule/facade/BaseFacade.php#L55-L65 |
194,143 | WellBloud/sovacore-core | src/model/AdminModule/facade/BaseFacade.php | BaseFacade.deleteItem | public function deleteItem($id = null)
{
if ($id === null) {
throw new ItemNotSelectedException;
}
$entity = $this->getById($id);
$this->deleteEntity($entity);
} | php | public function deleteItem($id = null)
{
if ($id === null) {
throw new ItemNotSelectedException;
}
$entity = $this->getById($id);
$this->deleteEntity($entity);
} | [
"public",
"function",
"deleteItem",
"(",
"$",
"id",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"id",
"===",
"null",
")",
"{",
"throw",
"new",
"ItemNotSelectedException",
";",
"}",
"$",
"entity",
"=",
"$",
"this",
"->",
"getById",
"(",
"$",
"id",
")",
"... | Method for deleting an item
@param type $id
@throws ItemNotSelectedException | [
"Method",
"for",
"deleting",
"an",
"item"
] | 1816a0d7cd3ec4a90d64e301fc2469d171ad217f | https://github.com/WellBloud/sovacore-core/blob/1816a0d7cd3ec4a90d64e301fc2469d171ad217f/src/model/AdminModule/facade/BaseFacade.php#L72-L79 |
194,144 | WellBloud/sovacore-core | src/model/AdminModule/facade/BaseFacade.php | BaseFacade.publishUnpublish | public function publishUnpublish($id,
User $userEntity
)
{
if ($id === null) {
throw new ItemNotSelectedException;
}
$entity = $this->getById($id);
$entity->published = !$entity->published;
$entity->modifiedOn = new DateTime();
$entity->modifie... | php | public function publishUnpublish($id,
User $userEntity
)
{
if ($id === null) {
throw new ItemNotSelectedException;
}
$entity = $this->getById($id);
$entity->published = !$entity->published;
$entity->modifiedOn = new DateTime();
$entity->modifie... | [
"public",
"function",
"publishUnpublish",
"(",
"$",
"id",
",",
"User",
"$",
"userEntity",
")",
"{",
"if",
"(",
"$",
"id",
"===",
"null",
")",
"{",
"throw",
"new",
"ItemNotSelectedException",
";",
"}",
"$",
"entity",
"=",
"$",
"this",
"->",
"getById",
"... | Method for publishing and unpublishing entity
@param integer $id
@param User $userEntity
@throws ItemNotSelectedException | [
"Method",
"for",
"publishing",
"and",
"unpublishing",
"entity"
] | 1816a0d7cd3ec4a90d64e301fc2469d171ad217f | https://github.com/WellBloud/sovacore-core/blob/1816a0d7cd3ec4a90d64e301fc2469d171ad217f/src/model/AdminModule/facade/BaseFacade.php#L119-L131 |
194,145 | WellBloud/sovacore-core | src/model/AdminModule/facade/BaseFacade.php | BaseFacade.getDefaultValues | public function getDefaultValues($id = null)
{
if ($id === null) {
return array();
}
$entity = $this->getById($id);
$values = $this->getDefaultFormValues($entity);
return $values;
} | php | public function getDefaultValues($id = null)
{
if ($id === null) {
return array();
}
$entity = $this->getById($id);
$values = $this->getDefaultFormValues($entity);
return $values;
} | [
"public",
"function",
"getDefaultValues",
"(",
"$",
"id",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"id",
"===",
"null",
")",
"{",
"return",
"array",
"(",
")",
";",
"}",
"$",
"entity",
"=",
"$",
"this",
"->",
"getById",
"(",
"$",
"id",
")",
";",
"... | Method for passing default values for form
@param type $id
@return type | [
"Method",
"for",
"passing",
"default",
"values",
"for",
"form"
] | 1816a0d7cd3ec4a90d64e301fc2469d171ad217f | https://github.com/WellBloud/sovacore-core/blob/1816a0d7cd3ec4a90d64e301fc2469d171ad217f/src/model/AdminModule/facade/BaseFacade.php#L148-L156 |
194,146 | WellBloud/sovacore-core | src/model/AdminModule/facade/BaseFacade.php | BaseFacade.getUniqueAlias | public function getUniqueAlias($entity,
string $titleProperty = 'title',
string $titleValue = null,
string $aliasColumn = 'seoTitle'
): string
{
return $this->repository->getUniqueAlias($entity, trim($titleProperty), $titleValue, $aliasColumn);
} | php | public function getUniqueAlias($entity,
string $titleProperty = 'title',
string $titleValue = null,
string $aliasColumn = 'seoTitle'
): string
{
return $this->repository->getUniqueAlias($entity, trim($titleProperty), $titleValue, $aliasColumn);
} | [
"public",
"function",
"getUniqueAlias",
"(",
"$",
"entity",
",",
"string",
"$",
"titleProperty",
"=",
"'title'",
",",
"string",
"$",
"titleValue",
"=",
"null",
",",
"string",
"$",
"aliasColumn",
"=",
"'seoTitle'",
")",
":",
"string",
"{",
"return",
"$",
"t... | Returns unique alias for SEF URL
@param type $entity
@param string $titleProperty entity property with title (or name)
@param string $titleValue
@param string $aliasColumn
@return string | [
"Returns",
"unique",
"alias",
"for",
"SEF",
"URL"
] | 1816a0d7cd3ec4a90d64e301fc2469d171ad217f | https://github.com/WellBloud/sovacore-core/blob/1816a0d7cd3ec4a90d64e301fc2469d171ad217f/src/model/AdminModule/facade/BaseFacade.php#L166-L173 |
194,147 | kambalabs/KmbDomain | src/KmbDomain/Model/Environment.php | Environment.getNormalizedName | public function getNormalizedName()
{
if ($this->normalizedName === null) {
$this->normalizedName = implode('_', $this->getAncestorsNames());
}
return $this->normalizedName;
} | php | public function getNormalizedName()
{
if ($this->normalizedName === null) {
$this->normalizedName = implode('_', $this->getAncestorsNames());
}
return $this->normalizedName;
} | [
"public",
"function",
"getNormalizedName",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"normalizedName",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"normalizedName",
"=",
"implode",
"(",
"'_'",
",",
"$",
"this",
"->",
"getAncestorsNames",
"(",
")",
")"... | Get NormalizedName.
@return string | [
"Get",
"NormalizedName",
"."
] | b1631bd936c6c6798076b51dfaebd706e1bdc8c2 | https://github.com/kambalabs/KmbDomain/blob/b1631bd936c6c6798076b51dfaebd706e1bdc8c2/src/KmbDomain/Model/Environment.php#L113-L119 |
194,148 | bseddon/XPath20 | DOM/DOMSchemaType.php | DOMSchemaType.fromSchemaType | public static function fromSchemaType( $qname )
{
$types = SchemaTypes::getInstance();
$type = $types->getType( "{$qname->prefix}:{$qname->localName}" );
if ( ! $type ) return null;
$datatype = new DOMSchemaDatatype( "{$qname->prefix}:{$qname->localName}" );
$result = new DOMSchemaSimpleType( $qnam... | php | public static function fromSchemaType( $qname )
{
$types = SchemaTypes::getInstance();
$type = $types->getType( "{$qname->prefix}:{$qname->localName}" );
if ( ! $type ) return null;
$datatype = new DOMSchemaDatatype( "{$qname->prefix}:{$qname->localName}" );
$result = new DOMSchemaSimpleType( $qnam... | [
"public",
"static",
"function",
"fromSchemaType",
"(",
"$",
"qname",
")",
"{",
"$",
"types",
"=",
"SchemaTypes",
"::",
"getInstance",
"(",
")",
";",
"$",
"type",
"=",
"$",
"types",
"->",
"getType",
"(",
"\"{$qname->prefix}:{$qname->localName}\"",
")",
";",
"... | Create an instance for a type in the SchemaTypes types list if there is one
@param QName $qname
@return DOMSchemaSimpleType | [
"Create",
"an",
"instance",
"for",
"a",
"type",
"in",
"the",
"SchemaTypes",
"types",
"list",
"if",
"there",
"is",
"one"
] | 69882b6efffaa5470a819d5fdd2f6473ddeb046d | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMSchemaType.php#L66-L76 |
194,149 | bseddon/XPath20 | DOM/DOMSchemaType.php | DOMSchemaType.GetBuiltInComplexTypeByTypeCode | public static function GetBuiltInComplexTypeByTypeCode( $typeCode )
{
// The $typeCode must be valid (one of the items in XmlTypeCode)
$type = XmlTypeCode::getTypeForCode( $typeCode );
if ( $type === false)
{
throw new \InvalidArgumentException( "The typecode passed to DOMSchemaType::GetBuiltInCompl... | php | public static function GetBuiltInComplexTypeByTypeCode( $typeCode )
{
// The $typeCode must be valid (one of the items in XmlTypeCode)
$type = XmlTypeCode::getTypeForCode( $typeCode );
if ( $type === false)
{
throw new \InvalidArgumentException( "The typecode passed to DOMSchemaType::GetBuiltInCompl... | [
"public",
"static",
"function",
"GetBuiltInComplexTypeByTypeCode",
"(",
"$",
"typeCode",
")",
"{",
"// The $typeCode must be valid (one of the items in XmlTypeCode)\r",
"$",
"type",
"=",
"XmlTypeCode",
"::",
"getTypeForCode",
"(",
"$",
"typeCode",
")",
";",
"if",
"(",
"... | Returns an XmlSchemaComplexType that represents the built-in
complex type of the complex type specified.
@param XmlTypeCode $typeCode One of the XmlTypeCode values representing the complex type.
@throws \InvalidArgumentException
@return XmlSchemaComplexType The type that represents the built-in complex type. | [
"Returns",
"an",
"XmlSchemaComplexType",
"that",
"represents",
"the",
"built",
"-",
"in",
"complex",
"type",
"of",
"the",
"complex",
"type",
"specified",
"."
] | 69882b6efffaa5470a819d5fdd2f6473ddeb046d | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMSchemaType.php#L86-L97 |
194,150 | bseddon/XPath20 | DOM/DOMSchemaType.php | DOMSchemaType.GetBuiltInComplexTypeByQName | public static function GetBuiltInComplexTypeByQName( $qualifiedName )
{
// The $qualifiedName cannot be null
if ( is_null( $qualifiedName ) ) throw new \lyquidity\xml\exceptions\ArgumentNullException( "The QName passed to DOMSchemaType::GetBuiltInComplexTypeByQName cannot be null" );
$type = "";
if ( $q... | php | public static function GetBuiltInComplexTypeByQName( $qualifiedName )
{
// The $qualifiedName cannot be null
if ( is_null( $qualifiedName ) ) throw new \lyquidity\xml\exceptions\ArgumentNullException( "The QName passed to DOMSchemaType::GetBuiltInComplexTypeByQName cannot be null" );
$type = "";
if ( $q... | [
"public",
"static",
"function",
"GetBuiltInComplexTypeByQName",
"(",
"$",
"qualifiedName",
")",
"{",
"// The $qualifiedName cannot be null\r",
"if",
"(",
"is_null",
"(",
"$",
"qualifiedName",
")",
")",
"throw",
"new",
"\\",
"lyquidity",
"\\",
"xml",
"\\",
"exception... | Returns an XmlSchemaComplexType that represents the built-in
complex type of the complex type specified by qualified name.
@param QName|string $qualifiedName The QName of the complex type.
@return The XmlSchemaComplexType that represents the built-in complex type.
@except \lyquidity\xml\exceptions\ArgumentNullExcept... | [
"Returns",
"an",
"XmlSchemaComplexType",
"that",
"represents",
"the",
"built",
"-",
"in",
"complex",
"type",
"of",
"the",
"complex",
"type",
"specified",
"by",
"qualified",
"name",
"."
] | 69882b6efffaa5470a819d5fdd2f6473ddeb046d | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMSchemaType.php#L109-L136 |
194,151 | bseddon/XPath20 | DOM/DOMSchemaType.php | DOMSchemaType.getSchemaType | public static function getSchemaType( $domNode )
{
try
{
$types = SchemaTypes::getInstance();
$type = $types->getTypeForDOMNode( $domNode );
if ( $type )
{
// TODO Kludge alert!! The XBRL_Types class wrongly used the prefix 'xsd' instead of 'xs'
// This needs to be fixed but for n... | php | public static function getSchemaType( $domNode )
{
try
{
$types = SchemaTypes::getInstance();
$type = $types->getTypeForDOMNode( $domNode );
if ( $type )
{
// TODO Kludge alert!! The XBRL_Types class wrongly used the prefix 'xsd' instead of 'xs'
// This needs to be fixed but for n... | [
"public",
"static",
"function",
"getSchemaType",
"(",
"$",
"domNode",
")",
"{",
"try",
"{",
"$",
"types",
"=",
"SchemaTypes",
"::",
"getInstance",
"(",
")",
";",
"$",
"type",
"=",
"$",
"types",
"->",
"getTypeForDOMNode",
"(",
"$",
"domNode",
")",
";",
... | Create a DOMSchemaType instance from a DOMNode
@param DOMXPathItem $domNode
@return XmlSchemaType | [
"Create",
"a",
"DOMSchemaType",
"instance",
"from",
"a",
"DOMNode"
] | 69882b6efffaa5470a819d5fdd2f6473ddeb046d | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMSchemaType.php#L268-L295 |
194,152 | SCLInternet/SclRequestResponse | src/SclRequestResponse/AbstractRequestResponse.php | AbstractRequestResponse.processRequest | public function processRequest(RequestInterface $request)
{
$this->response = $this->communicator->getResponse($request);
return $this->response;
} | php | public function processRequest(RequestInterface $request)
{
$this->response = $this->communicator->getResponse($request);
return $this->response;
} | [
"public",
"function",
"processRequest",
"(",
"RequestInterface",
"$",
"request",
")",
"{",
"$",
"this",
"->",
"response",
"=",
"$",
"this",
"->",
"communicator",
"->",
"getResponse",
"(",
"$",
"request",
")",
";",
"return",
"$",
"this",
"->",
"response",
"... | Sends the request to the server and hands back the response.
@param RequestInterface $request
@return ResponseInterface | [
"Sends",
"the",
"request",
"to",
"the",
"server",
"and",
"hands",
"back",
"the",
"response",
"."
] | 40e5e24288c70be6c7e4e54992069aba969f562c | https://github.com/SCLInternet/SclRequestResponse/blob/40e5e24288c70be6c7e4e54992069aba969f562c/src/SclRequestResponse/AbstractRequestResponse.php#L54-L59 |
194,153 | AlexyaFramework/Tools | Alexya/Tools/Session/Results.php | Results.initialize | public static function initialize(Session $session) : void
{
static::$_session = $session;
if(!static::$_session->keyExists("_RESULTS")) {
static::$_session->set("_RESULTS", []);
}
} | php | public static function initialize(Session $session) : void
{
static::$_session = $session;
if(!static::$_session->keyExists("_RESULTS")) {
static::$_session->set("_RESULTS", []);
}
} | [
"public",
"static",
"function",
"initialize",
"(",
"Session",
"$",
"session",
")",
":",
"void",
"{",
"static",
"::",
"$",
"_session",
"=",
"$",
"session",
";",
"if",
"(",
"!",
"static",
"::",
"$",
"_session",
"->",
"keyExists",
"(",
"\"_RESULTS\"",
")",
... | Sets session object.
@param Session $session Session where results will be saved. | [
"Sets",
"session",
"object",
"."
] | 2ae7c91cde0517579b926dd872eaf7ea324fd1e4 | https://github.com/AlexyaFramework/Tools/blob/2ae7c91cde0517579b926dd872eaf7ea324fd1e4/Alexya/Tools/Session/Results.php#L41-L48 |
194,154 | AlexyaFramework/Tools | Alexya/Tools/Session/Results.php | Results.flash | public static function flash(string $name, $result) : void
{
$results = static::$_session->get("_RESULTS");
$results[$name] = [
"type" => "flash",
"result" => $result
];
static::$_session->set("_RESULTS", $results);
} | php | public static function flash(string $name, $result) : void
{
$results = static::$_session->get("_RESULTS");
$results[$name] = [
"type" => "flash",
"result" => $result
];
static::$_session->set("_RESULTS", $results);
} | [
"public",
"static",
"function",
"flash",
"(",
"string",
"$",
"name",
",",
"$",
"result",
")",
":",
"void",
"{",
"$",
"results",
"=",
"static",
"::",
"$",
"_session",
"->",
"get",
"(",
"\"_RESULTS\"",
")",
";",
"$",
"results",
"[",
"$",
"name",
"]",
... | Adds a flash result.
@param string $name Result name.
@param mixed $result Result to add. | [
"Adds",
"a",
"flash",
"result",
"."
] | 2ae7c91cde0517579b926dd872eaf7ea324fd1e4 | https://github.com/AlexyaFramework/Tools/blob/2ae7c91cde0517579b926dd872eaf7ea324fd1e4/Alexya/Tools/Session/Results.php#L74-L84 |
194,155 | AlexyaFramework/Tools | Alexya/Tools/Session/Results.php | Results.delete | public static function delete(string $name) : void
{
$results = static::$_session->get("_RESULTS");
unset($results[$name]);
static::$_session->set("_RESULTS", $results);
} | php | public static function delete(string $name) : void
{
$results = static::$_session->get("_RESULTS");
unset($results[$name]);
static::$_session->set("_RESULTS", $results);
} | [
"public",
"static",
"function",
"delete",
"(",
"string",
"$",
"name",
")",
":",
"void",
"{",
"$",
"results",
"=",
"static",
"::",
"$",
"_session",
"->",
"get",
"(",
"\"_RESULTS\"",
")",
";",
"unset",
"(",
"$",
"results",
"[",
"$",
"name",
"]",
")",
... | Deletes a result.
@param string $name Result name. | [
"Deletes",
"a",
"result",
"."
] | 2ae7c91cde0517579b926dd872eaf7ea324fd1e4 | https://github.com/AlexyaFramework/Tools/blob/2ae7c91cde0517579b926dd872eaf7ea324fd1e4/Alexya/Tools/Session/Results.php#L91-L98 |
194,156 | AlexyaFramework/Tools | Alexya/Tools/Session/Results.php | Results.get | public static function get($length = -1, int $offset = 0) : array
{
$ret = [];
$results = static::$_session->get("_RESULTS");
if(
!is_numeric($length) &&
isset($results[$length])
) {
$ret = $results[$length]["result"];
if($res... | php | public static function get($length = -1, int $offset = 0) : array
{
$ret = [];
$results = static::$_session->get("_RESULTS");
if(
!is_numeric($length) &&
isset($results[$length])
) {
$ret = $results[$length]["result"];
if($res... | [
"public",
"static",
"function",
"get",
"(",
"$",
"length",
"=",
"-",
"1",
",",
"int",
"$",
"offset",
"=",
"0",
")",
":",
"array",
"{",
"$",
"ret",
"=",
"[",
"]",
";",
"$",
"results",
"=",
"static",
"::",
"$",
"_session",
"->",
"get",
"(",
"\"_R... | Returns the results.
@param int|string $length Length of the array to return, if string, the name of the result.
@param int $offset Array offset.
@return array Array with `$length` results. | [
"Returns",
"the",
"results",
"."
] | 2ae7c91cde0517579b926dd872eaf7ea324fd1e4 | https://github.com/AlexyaFramework/Tools/blob/2ae7c91cde0517579b926dd872eaf7ea324fd1e4/Alexya/Tools/Session/Results.php#L108-L148 |
194,157 | AnonymPHP/Anonym-Route | Matchers/RegexChecker.php | RegexChecker.match | public function match($url = null)
{
$match = parent::match($url);
$regex = $this->getRegex($this->getMatchUrl());
if ($regex !== ' ') {
if (preg_match("@" . ltrim($regex) . "@si", $this->getRequestedUrl(), $matches) || true === $match) {
unset($matches[0]);
... | php | public function match($url = null)
{
$match = parent::match($url);
$regex = $this->getRegex($this->getMatchUrl());
if ($regex !== ' ') {
if (preg_match("@" . ltrim($regex) . "@si", $this->getRequestedUrl(), $matches) || true === $match) {
unset($matches[0]);
... | [
"public",
"function",
"match",
"(",
"$",
"url",
"=",
"null",
")",
"{",
"$",
"match",
"=",
"parent",
"::",
"match",
"(",
"$",
"url",
")",
";",
"$",
"regex",
"=",
"$",
"this",
"->",
"getRegex",
"(",
"$",
"this",
"->",
"getMatchUrl",
"(",
")",
")",
... | Regex kontrolu yapar
@param string|null $url
@return bool | [
"Regex",
"kontrolu",
"yapar"
] | bb7f8004fbbd2998af8b0061f404f026f11466ab | https://github.com/AnonymPHP/Anonym-Route/blob/bb7f8004fbbd2998af8b0061f404f026f11466ab/Matchers/RegexChecker.php#L38-L55 |
194,158 | mossphp/moss-storage | Moss/Storage/Query/AbstractEntityValueQuery.php | AbstractEntityValueQuery.getValueFromReferencedEntity | protected function getValueFromReferencedEntity(FieldInterface $field)
{
$references = $this->model->referredIn($field->name());
foreach ($references as $foreign => $reference) {
$entity = $this->accessor->getPropertyValue($this->instance, $reference->container());
if ($enti... | php | protected function getValueFromReferencedEntity(FieldInterface $field)
{
$references = $this->model->referredIn($field->name());
foreach ($references as $foreign => $reference) {
$entity = $this->accessor->getPropertyValue($this->instance, $reference->container());
if ($enti... | [
"protected",
"function",
"getValueFromReferencedEntity",
"(",
"FieldInterface",
"$",
"field",
")",
"{",
"$",
"references",
"=",
"$",
"this",
"->",
"model",
"->",
"referredIn",
"(",
"$",
"field",
"->",
"name",
"(",
")",
")",
";",
"foreach",
"(",
"$",
"refer... | Gets value from first referenced entity that has it
@param FieldInterface $field | [
"Gets",
"value",
"from",
"first",
"referenced",
"entity",
"that",
"has",
"it"
] | 0d123e7ae6bbfce1e2a18e73bf70997277b430c1 | https://github.com/mossphp/moss-storage/blob/0d123e7ae6bbfce1e2a18e73bf70997277b430c1/Moss/Storage/Query/AbstractEntityValueQuery.php#L83-L97 |
194,159 | WideFocus/Feed-Writer | src/WriterField.php | WriterField.getValue | public function getValue(ArrayAccess $item): string
{
$value = $item->offsetExists($this->name)
? $item->offsetGet($this->name)
: '';
if (is_callable($this->filter)) {
if ($this->filter instanceof ContextAwareFilterInterface) {
$this->filter->setC... | php | public function getValue(ArrayAccess $item): string
{
$value = $item->offsetExists($this->name)
? $item->offsetGet($this->name)
: '';
if (is_callable($this->filter)) {
if ($this->filter instanceof ContextAwareFilterInterface) {
$this->filter->setC... | [
"public",
"function",
"getValue",
"(",
"ArrayAccess",
"$",
"item",
")",
":",
"string",
"{",
"$",
"value",
"=",
"$",
"item",
"->",
"offsetExists",
"(",
"$",
"this",
"->",
"name",
")",
"?",
"$",
"item",
"->",
"offsetGet",
"(",
"$",
"this",
"->",
"name"... | Get the value from a data object, the filter is applied.
@param ArrayAccess $item
@return string | [
"Get",
"the",
"value",
"from",
"a",
"data",
"object",
"the",
"filter",
"is",
"applied",
"."
] | c2698394645c75db06962e5e9d638f0cabe69fe3 | https://github.com/WideFocus/Feed-Writer/blob/c2698394645c75db06962e5e9d638f0cabe69fe3/src/WriterField.php#L76-L91 |
194,160 | squareproton/Bond | src/Bond/Pg/Catalog/Repository/Attribute.php | Attribute.getIndexes | public function getIndexes( $oid )
{
// load primary keys
$query = new Query(
"SELECT string_to_array( indkey::text, ' ') AS keys, * FROM pg_index WHERE indrelid = %oid:int%",
array( 'oid' => $this->get('oid') )
);
$indexes = $this->db->query( $query )->fetc... | php | public function getIndexes( $oid )
{
// load primary keys
$query = new Query(
"SELECT string_to_array( indkey::text, ' ') AS keys, * FROM pg_index WHERE indrelid = %oid:int%",
array( 'oid' => $this->get('oid') )
);
$indexes = $this->db->query( $query )->fetc... | [
"public",
"function",
"getIndexes",
"(",
"$",
"oid",
")",
"{",
"// load primary keys",
"$",
"query",
"=",
"new",
"Query",
"(",
"\"SELECT string_to_array( indkey::text, ' ') AS keys, * FROM pg_index WHERE indrelid = %oid:int%\"",
",",
"array",
"(",
"'oid'",
"=>",
"$",
"thi... | Get relation indexes from a oid
@param String $oid
@return array() | [
"Get",
"relation",
"indexes",
"from",
"a",
"oid"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Pg/Catalog/Repository/Attribute.php#L203-L230 |
194,161 | squareproton/Bond | src/Bond/Pg/Catalog/Repository/Attribute.php | Attribute.findByIdentifier | public function findByIdentifier( $identifier )
{
$identifier = explode('.', $identifier);
if( count( $identifier) < 2 ) {
throw new \InvalidArgumentException("yeah, not a table.column level identifier");
}
$columnName = array_pop( $identifier );
$tableName = i... | php | public function findByIdentifier( $identifier )
{
$identifier = explode('.', $identifier);
if( count( $identifier) < 2 ) {
throw new \InvalidArgumentException("yeah, not a table.column level identifier");
}
$columnName = array_pop( $identifier );
$tableName = i... | [
"public",
"function",
"findByIdentifier",
"(",
"$",
"identifier",
")",
"{",
"$",
"identifier",
"=",
"explode",
"(",
"'.'",
",",
"$",
"identifier",
")",
";",
"if",
"(",
"count",
"(",
"$",
"identifier",
")",
"<",
"2",
")",
"{",
"throw",
"new",
"\\",
"I... | Initalise a attribute by a schema.table.column or table.column identifier
AFAICT due to the ambiguity of the identifier this is probably best doen with a round trip to the database. It isn't slow.
@return | [
"Initalise",
"a",
"attribute",
"by",
"a",
"schema",
".",
"table",
".",
"column",
"or",
"table",
".",
"column",
"identifier",
"AFAICT",
"due",
"to",
"the",
"ambiguity",
"of",
"the",
"identifier",
"this",
"is",
"probably",
"best",
"doen",
"with",
"a",
"round... | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Pg/Catalog/Repository/Attribute.php#L237-L274 |
194,162 | squareproton/Bond | src/Bond/Pg/Catalog/Repository/Attribute.php | Attribute.buildComments | protected function buildComments()
{
if( is_null( $this->comments ) ) {
$this->comments = array();
} else {
return;
}
$sql = <<<SQL
SELECT
a.attrelid::text || '.' || a.attnum AS key,
d.description AS text
FROM
pg_attribute AS a
INNER JOIN
pg_... | php | protected function buildComments()
{
if( is_null( $this->comments ) ) {
$this->comments = array();
} else {
return;
}
$sql = <<<SQL
SELECT
a.attrelid::text || '.' || a.attnum AS key,
d.description AS text
FROM
pg_attribute AS a
INNER JOIN
pg_... | [
"protected",
"function",
"buildComments",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"comments",
")",
")",
"{",
"$",
"this",
"->",
"comments",
"=",
"array",
"(",
")",
";",
"}",
"else",
"{",
"return",
";",
"}",
"$",
"sql",
"=",
"... | It's a hassle complicating all the column source queries with a join to pg_description.
This is a lazy load comment solution. Midly hacky. | [
"It",
"s",
"a",
"hassle",
"complicating",
"all",
"the",
"column",
"source",
"queries",
"with",
"a",
"join",
"to",
"pg_description",
".",
"This",
"is",
"a",
"lazy",
"load",
"comment",
"solution",
".",
"Midly",
"hacky",
"."
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Pg/Catalog/Repository/Attribute.php#L316-L349 |
194,163 | t-kanstantsin/fileupload | src/formatter/adapter/Watermark.php | Watermark.getWatermark | private function getWatermark(ImagineInterface $imagine): ?ImageInterface
{
$resource = null;
if ($this->getMarkFilepath() !== null) {
$resource = fopen($this->getMarkFilepath(), 'rb');
} elseif (\is_string($this->markContent)) {
$resource = 'a'; // TODO: create resou... | php | private function getWatermark(ImagineInterface $imagine): ?ImageInterface
{
$resource = null;
if ($this->getMarkFilepath() !== null) {
$resource = fopen($this->getMarkFilepath(), 'rb');
} elseif (\is_string($this->markContent)) {
$resource = 'a'; // TODO: create resou... | [
"private",
"function",
"getWatermark",
"(",
"ImagineInterface",
"$",
"imagine",
")",
":",
"?",
"ImageInterface",
"{",
"$",
"resource",
"=",
"null",
";",
"if",
"(",
"$",
"this",
"->",
"getMarkFilepath",
"(",
")",
"!==",
"null",
")",
"{",
"$",
"resource",
... | Get watermark image
@param ImagineInterface $imagine
@return ImageInterface|null
@throws \Imagine\Exception\RuntimeException
@throws \UnexpectedValueException
@throws \ErrorException | [
"Get",
"watermark",
"image"
] | d6317a9b9b36d992f09affe3900ef7d7ddfd855f | https://github.com/t-kanstantsin/fileupload/blob/d6317a9b9b36d992f09affe3900ef7d7ddfd855f/src/formatter/adapter/Watermark.php#L119-L135 |
194,164 | rafflesargentina/l5-filterable-sortable | src/QueryFilters.php | QueryFilters.getAppliedFilters | public static function getAppliedFilters()
{
$classMethods = get_class_methods(get_class());
$calledClassMethods = get_class_methods(get_called_class());
$filteredMethods = array_filter(
$calledClassMethods, function ($calledClassMethod) use ($classMethods) {
ret... | php | public static function getAppliedFilters()
{
$classMethods = get_class_methods(get_class());
$calledClassMethods = get_class_methods(get_called_class());
$filteredMethods = array_filter(
$calledClassMethods, function ($calledClassMethod) use ($classMethods) {
ret... | [
"public",
"static",
"function",
"getAppliedFilters",
"(",
")",
"{",
"$",
"classMethods",
"=",
"get_class_methods",
"(",
"get_class",
"(",
")",
")",
";",
"$",
"calledClassMethods",
"=",
"get_class_methods",
"(",
"get_called_class",
"(",
")",
")",
";",
"$",
"fil... | Get applied filters from request.
@return array | [
"Get",
"applied",
"filters",
"from",
"request",
"."
] | eb3ecf399145ec7c5241ba2134ed0bea2057e6c3 | https://github.com/rafflesargentina/l5-filterable-sortable/blob/eb3ecf399145ec7c5241ba2134ed0bea2057e6c3/src/QueryFilters.php#L71-L83 |
194,165 | Mohiohio/wordpress-lib | src/Admin.php | Admin.add_field | function add_field($name, $title=null, \Closure $display_callback=null, Setting\Section $section=null, $default=null)
{
if(is_array($name)){
$field = $name + [
$display_callback=null,
$section = null,
$default = null,
$type = 'text... | php | function add_field($name, $title=null, \Closure $display_callback=null, Setting\Section $section=null, $default=null)
{
if(is_array($name)){
$field = $name + [
$display_callback=null,
$section = null,
$default = null,
$type = 'text... | [
"function",
"add_field",
"(",
"$",
"name",
",",
"$",
"title",
"=",
"null",
",",
"\\",
"Closure",
"$",
"display_callback",
"=",
"null",
",",
"Setting",
"\\",
"Section",
"$",
"section",
"=",
"null",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"("... | Just pass name which is an assoc array -
what you see here are legacy params | [
"Just",
"pass",
"name",
"which",
"is",
"an",
"assoc",
"array",
"-",
"what",
"you",
"see",
"here",
"are",
"legacy",
"params"
] | 10ff55bc02a1e48c3e53a8a80bd5a0f3d14736af | https://github.com/Mohiohio/wordpress-lib/blob/10ff55bc02a1e48c3e53a8a80bd5a0f3d14736af/src/Admin.php#L26-L47 |
194,166 | attogram/shared-media-orm | src/Attogram/SharedMedia/Orm/PageQuery.php | PageQuery.format | public function format(array $response)
{
$car = '<br />';
$format = '';
foreach ($response as $page) {
$format .= '<div class="page"><span class="title">'
. ApiTools::safeString($page->getTitle()) . '</span>'
.$car . 'pageid: <span class="pageid">' . $pag... | php | public function format(array $response)
{
$car = '<br />';
$format = '';
foreach ($response as $page) {
$format .= '<div class="page"><span class="title">'
. ApiTools::safeString($page->getTitle()) . '</span>'
.$car . 'pageid: <span class="pageid">' . $pag... | [
"public",
"function",
"format",
"(",
"array",
"$",
"response",
")",
"{",
"$",
"car",
"=",
"'<br />'",
";",
"$",
"format",
"=",
"''",
";",
"foreach",
"(",
"$",
"response",
"as",
"$",
"page",
")",
"{",
"$",
"format",
".=",
"'<div class=\"page\"><span class... | format a page response as an HTML string
@param array $response
@return string | [
"format",
"a",
"page",
"response",
"as",
"an",
"HTML",
"string"
] | 81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8 | https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/PageQuery.php#L81-L97 |
194,167 | nattreid/mailing | src/Mail.php | Mail.setCommand | public function setCommand(string $args): self
{
if ($this->mailer instanceof SendmailMailer) {
$this->mailer->commandArgs = $args;
}
return $this;
} | php | public function setCommand(string $args): self
{
if ($this->mailer instanceof SendmailMailer) {
$this->mailer->commandArgs = $args;
}
return $this;
} | [
"public",
"function",
"setCommand",
"(",
"string",
"$",
"args",
")",
":",
"self",
"{",
"if",
"(",
"$",
"this",
"->",
"mailer",
"instanceof",
"SendmailMailer",
")",
"{",
"$",
"this",
"->",
"mailer",
"->",
"commandArgs",
"=",
"$",
"args",
";",
"}",
"retu... | Nastavi argumenty pro mailer
@param string $args
@return self | [
"Nastavi",
"argumenty",
"pro",
"mailer"
] | d61750a47c38d7533294d74d6601ca99a25f1b7c | https://github.com/nattreid/mailing/blob/d61750a47c38d7533294d74d6601ca99a25f1b7c/src/Mail.php#L137-L143 |
194,168 | hiqdev/minii-helpers | src/BaseStringHelper.php | BaseStringHelper.explode | public static function explode($string, $delimiter = ',', $trim = true, $skipEmpty = false)
{
$result = explode($delimiter, $string);
if ($trim) {
if ($trim === true) {
$trim = 'trim';
} elseif (!is_callable($trim)) {
$trim = function ($v) use ... | php | public static function explode($string, $delimiter = ',', $trim = true, $skipEmpty = false)
{
$result = explode($delimiter, $string);
if ($trim) {
if ($trim === true) {
$trim = 'trim';
} elseif (!is_callable($trim)) {
$trim = function ($v) use ... | [
"public",
"static",
"function",
"explode",
"(",
"$",
"string",
",",
"$",
"delimiter",
"=",
"','",
",",
"$",
"trim",
"=",
"true",
",",
"$",
"skipEmpty",
"=",
"false",
")",
"{",
"$",
"result",
"=",
"explode",
"(",
"$",
"delimiter",
",",
"$",
"string",
... | Explodes string into array, optionally trims values and skips empty ones
@param string $string String to be exploded.
@param string $delimiter Delimiter. Default is ','.
@param mixed $trim Whether to trim each element. Can be:
- boolean - to trim normally;
- string - custom characters to trim. Will be passed as a seco... | [
"Explodes",
"string",
"into",
"array",
"optionally",
"trims",
"values",
"and",
"skips",
"empty",
"ones"
] | 001b7a56a6ebdc432c4683fe47c00a913f8e57d7 | https://github.com/hiqdev/minii-helpers/blob/001b7a56a6ebdc432c4683fe47c00a913f8e57d7/src/BaseStringHelper.php#L252-L270 |
194,169 | freialib/hlin.archetype | src/Mock/Filesystem.php | FilesystemMock.& | function & mock_mount(array $fs, $mountpoint = '~/approot') {
$mountpoint = str_replace('~', $this->mock_homedir, trim($mountpoint, '/'));
$normalizedfs = $this->mock_normalize($fs);
$path = & $this->mock_ensurepath($mountpoint);
$this->mock_fsmerge($path, $normalizedfs);
return $path;
} | php | function & mock_mount(array $fs, $mountpoint = '~/approot') {
$mountpoint = str_replace('~', $this->mock_homedir, trim($mountpoint, '/'));
$normalizedfs = $this->mock_normalize($fs);
$path = & $this->mock_ensurepath($mountpoint);
$this->mock_fsmerge($path, $normalizedfs);
return $path;
} | [
"function",
"&",
"mock_mount",
"(",
"array",
"$",
"fs",
",",
"$",
"mountpoint",
"=",
"'~/approot'",
")",
"{",
"$",
"mountpoint",
"=",
"str_replace",
"(",
"'~'",
",",
"$",
"this",
"->",
"mock_homedir",
",",
"trim",
"(",
"$",
"mountpoint",
",",
"'/'",
")... | Mount virtual filesystem at specified location.
@return array path reference | [
"Mount",
"virtual",
"filesystem",
"at",
"specified",
"location",
"."
] | d8750a9bf4b7efb8063899969e3f39c1915c423a | https://github.com/freialib/hlin.archetype/blob/d8750a9bf4b7efb8063899969e3f39c1915c423a/src/Mock/Filesystem.php#L50-L58 |
194,170 | freialib/hlin.archetype | src/Mock/Filesystem.php | FilesystemMock.mock_fsmerge | function mock_fsmerge( & $fs, & $comp) {
if (isset($comp['%type']) && $comp['%type'] == 'file') {
throw new \Exception('[Mock] Tried to copy file as directory.');
}
// map existing files
$existing_files = [];
foreach ($fs as $node => $file) {
if (is_integer($node)) {
$existing_files[] = $file['file... | php | function mock_fsmerge( & $fs, & $comp) {
if (isset($comp['%type']) && $comp['%type'] == 'file') {
throw new \Exception('[Mock] Tried to copy file as directory.');
}
// map existing files
$existing_files = [];
foreach ($fs as $node => $file) {
if (is_integer($node)) {
$existing_files[] = $file['file... | [
"function",
"mock_fsmerge",
"(",
"&",
"$",
"fs",
",",
"&",
"$",
"comp",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"comp",
"[",
"'%type'",
"]",
")",
"&&",
"$",
"comp",
"[",
"'%type'",
"]",
"==",
"'file'",
")",
"{",
"throw",
"new",
"\\",
"Exception",... | Merges two file system definitions togheter. | [
"Merges",
"two",
"file",
"system",
"definitions",
"togheter",
"."
] | d8750a9bf4b7efb8063899969e3f39c1915c423a | https://github.com/freialib/hlin.archetype/blob/d8750a9bf4b7efb8063899969e3f39c1915c423a/src/Mock/Filesystem.php#L63-L92 |
194,171 | projek-xyz/ci-installer | src/ComposerInstaller.php | ComposerInstaller.getModuleMigrations | protected function getModuleMigrations($downloadPath, $moduleMigrationPath = 'asset/data')
{
$moduleMigrationPath = trim($moduleMigrationPath, '/');
$moduleMigrations = glob($downloadPath . '/' . $moduleMigrationPath . '/*.php');
sort($moduleMigrations);
return $moduleMigrations;... | php | protected function getModuleMigrations($downloadPath, $moduleMigrationPath = 'asset/data')
{
$moduleMigrationPath = trim($moduleMigrationPath, '/');
$moduleMigrations = glob($downloadPath . '/' . $moduleMigrationPath . '/*.php');
sort($moduleMigrations);
return $moduleMigrations;... | [
"protected",
"function",
"getModuleMigrations",
"(",
"$",
"downloadPath",
",",
"$",
"moduleMigrationPath",
"=",
"'asset/data'",
")",
"{",
"$",
"moduleMigrationPath",
"=",
"trim",
"(",
"$",
"moduleMigrationPath",
",",
"'/'",
")",
";",
"$",
"moduleMigrations",
"=",
... | Check if module have migrations files
@param string $downloadPath Module download path
@param string $moduleMigrationPath Module migration path
it's relative to $download path and
any slash will be trimmed
@return bool | [
"Check",
"if",
"module",
"have",
"migrations",
"files"
] | 2628fa58e5298460f3f6595e369bb94ab7bd8003 | https://github.com/projek-xyz/ci-installer/blob/2628fa58e5298460f3f6595e369bb94ab7bd8003/src/ComposerInstaller.php#L173-L180 |
194,172 | projek-xyz/ci-installer | src/ComposerInstaller.php | ComposerInstaller.copyModuleMigrations | protected function copyModuleMigrations(array $config, array $moduleMigrations)
{
$migrationPath = $this->checkMigrationsPath($config);
if ($migrationPath === false) {
return false;
}
$migrations = glob($migrationPath . '*.php');
$old_migration_names = array();
... | php | protected function copyModuleMigrations(array $config, array $moduleMigrations)
{
$migrationPath = $this->checkMigrationsPath($config);
if ($migrationPath === false) {
return false;
}
$migrations = glob($migrationPath . '*.php');
$old_migration_names = array();
... | [
"protected",
"function",
"copyModuleMigrations",
"(",
"array",
"$",
"config",
",",
"array",
"$",
"moduleMigrations",
")",
"{",
"$",
"migrationPath",
"=",
"$",
"this",
"->",
"checkMigrationsPath",
"(",
"$",
"config",
")",
";",
"if",
"(",
"$",
"migrationPath",
... | Copy all module migration files to application migration directory
@param array $config Migration configs
@param array $moduleMigrations Module migration file list
@return void | [
"Copy",
"all",
"module",
"migration",
"files",
"to",
"application",
"migration",
"directory"
] | 2628fa58e5298460f3f6595e369bb94ab7bd8003 | https://github.com/projek-xyz/ci-installer/blob/2628fa58e5298460f3f6595e369bb94ab7bd8003/src/ComposerInstaller.php#L189-L233 |
194,173 | projek-xyz/ci-installer | src/ComposerInstaller.php | ComposerInstaller.checkMigrationsPath | protected function checkMigrationsPath(array $config)
{
// Check if $config['migration_path'] is already defined
$migrationPath = isset($config['migration_path']) ? $config['migration_path'] : false;
$migrationPath = str_replace('FCPATH', '', $migrationPath);
// Check if $config['mi... | php | protected function checkMigrationsPath(array $config)
{
// Check if $config['migration_path'] is already defined
$migrationPath = isset($config['migration_path']) ? $config['migration_path'] : false;
$migrationPath = str_replace('FCPATH', '', $migrationPath);
// Check if $config['mi... | [
"protected",
"function",
"checkMigrationsPath",
"(",
"array",
"$",
"config",
")",
"{",
"// Check if $config['migration_path'] is already defined",
"$",
"migrationPath",
"=",
"isset",
"(",
"$",
"config",
"[",
"'migration_path'",
"]",
")",
"?",
"$",
"config",
"[",
"'m... | Check Application Migrations path, if not available it will create new one
@param array $config Migration configuration
@return string | [
"Check",
"Application",
"Migrations",
"path",
"if",
"not",
"available",
"it",
"will",
"create",
"new",
"one"
] | 2628fa58e5298460f3f6595e369bb94ab7bd8003 | https://github.com/projek-xyz/ci-installer/blob/2628fa58e5298460f3f6595e369bb94ab7bd8003/src/ComposerInstaller.php#L254-L266 |
194,174 | projek-xyz/ci-installer | src/ComposerInstaller.php | ComposerInstaller.getMigrationConfig | protected function getMigrationConfig($downloadPath)
{
$extra = ($pkg = $this->composer->getPackage()) ? $pkg->getExtra() : array();
// Check CI APPPATH
$appPath = defined('APPPATH') ? APPPATH : $extra['codeigniter-application-dir'];
// $appPath = defined('APPPATH') ? APPPATH : dirna... | php | protected function getMigrationConfig($downloadPath)
{
$extra = ($pkg = $this->composer->getPackage()) ? $pkg->getExtra() : array();
// Check CI APPPATH
$appPath = defined('APPPATH') ? APPPATH : $extra['codeigniter-application-dir'];
// $appPath = defined('APPPATH') ? APPPATH : dirna... | [
"protected",
"function",
"getMigrationConfig",
"(",
"$",
"downloadPath",
")",
"{",
"$",
"extra",
"=",
"(",
"$",
"pkg",
"=",
"$",
"this",
"->",
"composer",
"->",
"getPackage",
"(",
")",
")",
"?",
"$",
"pkg",
"->",
"getExtra",
"(",
")",
":",
"array",
"... | Get migration configurations
@return array | [
"Get",
"migration",
"configurations"
] | 2628fa58e5298460f3f6595e369bb94ab7bd8003 | https://github.com/projek-xyz/ci-installer/blob/2628fa58e5298460f3f6595e369bb94ab7bd8003/src/ComposerInstaller.php#L273-L283 |
194,175 | e-commit/EcommitUtilBundle | Helper/UtilHelper.php | UtilHelper.tag | public function tag($name, Array $options = array(), $content = null, $open = false)
{
if (!$name) {
return '';
}
$htmlOptions = '';
foreach ($options as $key => $value) {
$htmlOptions .= ' ' . $key . '="' . \htmlspecialchars($value, \ENT_COMPAT) . '"';
... | php | public function tag($name, Array $options = array(), $content = null, $open = false)
{
if (!$name) {
return '';
}
$htmlOptions = '';
foreach ($options as $key => $value) {
$htmlOptions .= ' ' . $key . '="' . \htmlspecialchars($value, \ENT_COMPAT) . '"';
... | [
"public",
"function",
"tag",
"(",
"$",
"name",
",",
"Array",
"$",
"options",
"=",
"array",
"(",
")",
",",
"$",
"content",
"=",
"null",
",",
"$",
"open",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"name",
")",
"{",
"return",
"''",
";",
"}",
... | Constructs an html tag
@param string $name Tag name
@param array $options Tag options
@param string $content Content
@param bool $open True to leave tag open
@return string | [
"Constructs",
"an",
"html",
"tag"
] | 2ee5ddae7709e8ad4412739cbecda28e0590da8b | https://github.com/e-commit/EcommitUtilBundle/blob/2ee5ddae7709e8ad4412739cbecda28e0590da8b/Helper/UtilHelper.php#L63-L77 |
194,176 | ekyna/Resource | Model/TranslatableTrait.php | TranslatableTrait.translate | public function translate($locale = null, $create = false)
{
$locale = $locale ?: $this->currentLocale;
if (null === $locale) {
throw new \RuntimeException('No locale has been set and current locale is undefined.');
}
if ($this->currentTranslation && $locale === $this->c... | php | public function translate($locale = null, $create = false)
{
$locale = $locale ?: $this->currentLocale;
if (null === $locale) {
throw new \RuntimeException('No locale has been set and current locale is undefined.');
}
if ($this->currentTranslation && $locale === $this->c... | [
"public",
"function",
"translate",
"(",
"$",
"locale",
"=",
"null",
",",
"$",
"create",
"=",
"false",
")",
"{",
"$",
"locale",
"=",
"$",
"locale",
"?",
":",
"$",
"this",
"->",
"currentLocale",
";",
"if",
"(",
"null",
"===",
"$",
"locale",
")",
"{",... | Returns the translation regarding to the current or fallback locale.
@param string $locale
@param bool $create
@return TranslationInterface
@throws \RuntimeException | [
"Returns",
"the",
"translation",
"regarding",
"to",
"the",
"current",
"or",
"fallback",
"locale",
"."
] | 96ee3d28e02bd9513705408e3bb7f88a76e52f56 | https://github.com/ekyna/Resource/blob/96ee3d28e02bd9513705408e3bb7f88a76e52f56/Model/TranslatableTrait.php#L63-L106 |
194,177 | ekyna/Resource | Model/TranslatableTrait.php | TranslatableTrait.addTranslation | public function addTranslation(TranslationInterface $translation)
{
if (!$this->translations->containsKey($translation->getLocale())) {
$this->translations->set($translation->getLocale(), $translation);
$translation->setTranslatable($this);
}
return $this;
} | php | public function addTranslation(TranslationInterface $translation)
{
if (!$this->translations->containsKey($translation->getLocale())) {
$this->translations->set($translation->getLocale(), $translation);
$translation->setTranslatable($this);
}
return $this;
} | [
"public",
"function",
"addTranslation",
"(",
"TranslationInterface",
"$",
"translation",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"translations",
"->",
"containsKey",
"(",
"$",
"translation",
"->",
"getLocale",
"(",
")",
")",
")",
"{",
"$",
"this",
"->... | Adds the translation.
@param TranslationInterface $translation
@return TranslatableInterface|$this | [
"Adds",
"the",
"translation",
"."
] | 96ee3d28e02bd9513705408e3bb7f88a76e52f56 | https://github.com/ekyna/Resource/blob/96ee3d28e02bd9513705408e3bb7f88a76e52f56/Model/TranslatableTrait.php#L160-L168 |
194,178 | g4code/clean-core | src/UseCase/UseCaseAbstract.php | UseCaseAbstract.reference | public function reference($useCaseName, $resourcePart = null, Request $request = null)
{
if(null === $request) {
$request = $this->getRequest();
}
return $this->getUseCaseFactoryInstance()
->setUseCaseName($useCaseName)
->setRequest($request)
-... | php | public function reference($useCaseName, $resourcePart = null, Request $request = null)
{
if(null === $request) {
$request = $this->getRequest();
}
return $this->getUseCaseFactoryInstance()
->setUseCaseName($useCaseName)
->setRequest($request)
-... | [
"public",
"function",
"reference",
"(",
"$",
"useCaseName",
",",
"$",
"resourcePart",
"=",
"null",
",",
"Request",
"$",
"request",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"request",
")",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"get... | Factory method for use of a new UseCase class
Returns whole resource or just one part
@param string $useCaseName
@param string $resourcePart
@param Request $request
@return mixed | [
"Factory",
"method",
"for",
"use",
"of",
"a",
"new",
"UseCase",
"class",
"Returns",
"whole",
"resource",
"or",
"just",
"one",
"part"
] | 7cbe9b4f93aa96c23b93c89e0262941d2b159f5c | https://github.com/g4code/clean-core/blob/7cbe9b4f93aa96c23b93c89e0262941d2b159f5c/src/UseCase/UseCaseAbstract.php#L82-L91 |
194,179 | ARCANESOFT/Blog | src/ViewComposers/Admin/Dashboard/CategoriesRatiosComposer.php | CategoriesRatiosComposer.prepareRatios | private function prepareRatios(Collection $categories)
{
$ratios = $categories->filter(function (Category $category) {
return $category->hasPosts();
})
->transform(function (Category $category) {
return [
'label' => $category->name,... | php | private function prepareRatios(Collection $categories)
{
$ratios = $categories->filter(function (Category $category) {
return $category->hasPosts();
})
->transform(function (Category $category) {
return [
'label' => $category->name,... | [
"private",
"function",
"prepareRatios",
"(",
"Collection",
"$",
"categories",
")",
"{",
"$",
"ratios",
"=",
"$",
"categories",
"->",
"filter",
"(",
"function",
"(",
"Category",
"$",
"category",
")",
"{",
"return",
"$",
"category",
"->",
"hasPosts",
"(",
")... | Prepare the categories ratios.
@param \Illuminate\Database\Eloquent\Collection $categories
@return \Illuminate\Database\Eloquent\Collection | [
"Prepare",
"the",
"categories",
"ratios",
"."
] | 2078fdfdcbccda161c02899b9e1f344f011b2859 | https://github.com/ARCANESOFT/Blog/blob/2078fdfdcbccda161c02899b9e1f344f011b2859/src/ViewComposers/Admin/Dashboard/CategoriesRatiosComposer.php#L47-L68 |
194,180 | agentmedia/phine-builtin | src/BuiltIn/Logic/Hooks/DeleteContainer.php | DeleteContainer.BeforeDelete | public function BeforeDelete($item)
{
$contContainers = ContentContainer::Schema()->FetchByContainer(true, $item);
$logger = new Logger(BackendModule::Guard()->GetUser());
foreach ($contContainers as $contContainer)
{
$content = $contContainer->GetContent();
$provid... | php | public function BeforeDelete($item)
{
$contContainers = ContentContainer::Schema()->FetchByContainer(true, $item);
$logger = new Logger(BackendModule::Guard()->GetUser());
foreach ($contContainers as $contContainer)
{
$content = $contContainer->GetContent();
$provid... | [
"public",
"function",
"BeforeDelete",
"(",
"$",
"item",
")",
"{",
"$",
"contContainers",
"=",
"ContentContainer",
"::",
"Schema",
"(",
")",
"->",
"FetchByContainer",
"(",
"true",
",",
"$",
"item",
")",
";",
"$",
"logger",
"=",
"new",
"Logger",
"(",
"Back... | Deletes the container contents related to the container
@param Container $item The container to be deleted | [
"Deletes",
"the",
"container",
"contents",
"related",
"to",
"the",
"container"
] | 4dd05bc406a71e997bd4eaa16b12e23dbe62a456 | https://github.com/agentmedia/phine-builtin/blob/4dd05bc406a71e997bd4eaa16b12e23dbe62a456/src/BuiltIn/Logic/Hooks/DeleteContainer.php#L23-L35 |
194,181 | perryflynn/PerrysLambda | src/PerrysLambda/LambdaUtils.php | LambdaUtils.toSelectCallable | public static function toSelectCallable($mixed=null)
{
// callable
if(self::isClosure($mixed) || self::isInstanceCallable($mixed))
{
return $mixed;
}
// nothing, return full row
elseif(is_null($mixed) || $mixed==="")
{
return function($... | php | public static function toSelectCallable($mixed=null)
{
// callable
if(self::isClosure($mixed) || self::isInstanceCallable($mixed))
{
return $mixed;
}
// nothing, return full row
elseif(is_null($mixed) || $mixed==="")
{
return function($... | [
"public",
"static",
"function",
"toSelectCallable",
"(",
"$",
"mixed",
"=",
"null",
")",
"{",
"// callable",
"if",
"(",
"self",
"::",
"isClosure",
"(",
"$",
"mixed",
")",
"||",
"self",
"::",
"isInstanceCallable",
"(",
"$",
"mixed",
")",
")",
"{",
"return... | Converts strings, empty strings and NULL into a callable
@param string|callable|null $mixed
@return callable
@throws \PerrysLambda\Exception\InvalidException | [
"Converts",
"strings",
"empty",
"strings",
"and",
"NULL",
"into",
"a",
"callable"
] | 9f1734ae4689d73278b887f9354dfd31428e96de | https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/LambdaUtils.php#L43-L79 |
194,182 | perryflynn/PerrysLambda | src/PerrysLambda/LambdaUtils.php | LambdaUtils.toConditionCallable | public static function toConditionCallable($mixed=null)
{
// callable
if(self::isClosure($mixed) || self::isInstanceCallable($mixed))
{
return $mixed;
}
// is bool
elseif(is_bool($mixed) || is_string($mixed) || is_numeric($mixed))
{
ret... | php | public static function toConditionCallable($mixed=null)
{
// callable
if(self::isClosure($mixed) || self::isInstanceCallable($mixed))
{
return $mixed;
}
// is bool
elseif(is_bool($mixed) || is_string($mixed) || is_numeric($mixed))
{
ret... | [
"public",
"static",
"function",
"toConditionCallable",
"(",
"$",
"mixed",
"=",
"null",
")",
"{",
"// callable",
"if",
"(",
"self",
"::",
"isClosure",
"(",
"$",
"mixed",
")",
"||",
"self",
"::",
"isInstanceCallable",
"(",
"$",
"mixed",
")",
")",
"{",
"ret... | Convert strings, numbers, booleans and arrays into a callable
@param type $mixed
@return type
@throws InvalidException | [
"Convert",
"strings",
"numbers",
"booleans",
"and",
"arrays",
"into",
"a",
"callable"
] | 9f1734ae4689d73278b887f9354dfd31428e96de | https://github.com/perryflynn/PerrysLambda/blob/9f1734ae4689d73278b887f9354dfd31428e96de/src/PerrysLambda/LambdaUtils.php#L88-L128 |
194,183 | rafflesargentina/l5-filterable-sortable | src/FilterableSortableTrait.php | FilterableSortableTrait.scopeFilter | public function scopeFilter($query)
{
if (!$this->filters) {
$message = 'Please set the $filters property.';
throw new FilterableSortableException($message);
}
$this->filters = app()->make($this->filters);
if (!$this->filters instanceof QueryFilters) {
... | php | public function scopeFilter($query)
{
if (!$this->filters) {
$message = 'Please set the $filters property.';
throw new FilterableSortableException($message);
}
$this->filters = app()->make($this->filters);
if (!$this->filters instanceof QueryFilters) {
... | [
"public",
"function",
"scopeFilter",
"(",
"$",
"query",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"filters",
")",
"{",
"$",
"message",
"=",
"'Please set the $filters property.'",
";",
"throw",
"new",
"FilterableSortableException",
"(",
"$",
"message",
")",
... | Filter a result set.
@param Bulder $query The builder instance.
@return Builder
@throws FilterableSortableException | [
"Filter",
"a",
"result",
"set",
"."
] | eb3ecf399145ec7c5241ba2134ed0bea2057e6c3 | https://github.com/rafflesargentina/l5-filterable-sortable/blob/eb3ecf399145ec7c5241ba2134ed0bea2057e6c3/src/FilterableSortableTrait.php#L18-L35 |
194,184 | rafflesargentina/l5-filterable-sortable | src/FilterableSortableTrait.php | FilterableSortableTrait.scopeSort | public function scopeSort($query)
{
if (!$this->sorters) {
$message = 'Please set the $sorters property.';
throw new FilterableSortableException($message);
}
$this->sorters = app()->make($this->sorters);
if (!$this->sorters instanceof QuerySorters) {
... | php | public function scopeSort($query)
{
if (!$this->sorters) {
$message = 'Please set the $sorters property.';
throw new FilterableSortableException($message);
}
$this->sorters = app()->make($this->sorters);
if (!$this->sorters instanceof QuerySorters) {
... | [
"public",
"function",
"scopeSort",
"(",
"$",
"query",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"sorters",
")",
"{",
"$",
"message",
"=",
"'Please set the $sorters property.'",
";",
"throw",
"new",
"FilterableSortableException",
"(",
"$",
"message",
")",
... | Sort a result set.
@param Builder $query The builder instance.
@return Builder
@throws FilterableSortableException | [
"Sort",
"a",
"result",
"set",
"."
] | eb3ecf399145ec7c5241ba2134ed0bea2057e6c3 | https://github.com/rafflesargentina/l5-filterable-sortable/blob/eb3ecf399145ec7c5241ba2134ed0bea2057e6c3/src/FilterableSortableTrait.php#L46-L63 |
194,185 | MindyPHP/QueryBuilder | QueryBuilder.php | QueryBuilder.makeAliasKey | public function makeAliasKey($table, $increment = true)
{
// if ($increment) {
// $this->_aliasesCount += 1;
// }
return strtr('{table}_{count}', [
'{table}' => TableNameResolver::getTableName($table),
'{count}' => $this->_aliasesCount + 1,
])... | php | public function makeAliasKey($table, $increment = true)
{
// if ($increment) {
// $this->_aliasesCount += 1;
// }
return strtr('{table}_{count}', [
'{table}' => TableNameResolver::getTableName($table),
'{count}' => $this->_aliasesCount + 1,
])... | [
"public",
"function",
"makeAliasKey",
"(",
"$",
"table",
",",
"$",
"increment",
"=",
"true",
")",
"{",
"// if ($increment) {",
"// $this->_aliasesCount += 1;",
"// }",
"return",
"strtr",
"(",
"'{table}_{count}'",
",",
"[",
"'{table}'",
"=>",
"... | Makes alias for joined table.
@param $table
@param bool $increment
@return string | [
"Makes",
"alias",
"for",
"joined",
"table",
"."
] | fc486454786f3d38887dd7246802ea11e2954e54 | https://github.com/MindyPHP/QueryBuilder/blob/fc486454786f3d38887dd7246802ea11e2954e54/QueryBuilder.php#L1010-L1019 |
194,186 | t3v/t3v_datamapper | Classes/Service/DatabaseService.php | DatabaseService.setup | public static function setup(string $connection = 'Default') {
// First, create a new `Capsule` manager instance. Capsule aims to make configuring the library for usage outside of
// the Laravel framework as easy as possible.
$capsule = new Capsule();
// Add connection to Capsule.
$capsule->addConn... | php | public static function setup(string $connection = 'Default') {
// First, create a new `Capsule` manager instance. Capsule aims to make configuring the library for usage outside of
// the Laravel framework as easy as possible.
$capsule = new Capsule();
// Add connection to Capsule.
$capsule->addConn... | [
"public",
"static",
"function",
"setup",
"(",
"string",
"$",
"connection",
"=",
"'Default'",
")",
"{",
"// First, create a new `Capsule` manager instance. Capsule aims to make configuring the library for usage outside of",
"// the Laravel framework as easy as possible.",
"$",
"capsule"... | Setup the Eloquent ORM.
@param string $connection The optional connection, defaults to `Default` | [
"Setup",
"the",
"Eloquent",
"ORM",
"."
] | bab2de90f467936fbe4270cd133cb4109d1108eb | https://github.com/t3v/t3v_datamapper/blob/bab2de90f467936fbe4270cd133cb4109d1108eb/Classes/Service/DatabaseService.php#L19-L32 |
194,187 | t3v/t3v_datamapper | Classes/Service/DatabaseService.php | DatabaseService.getConnection | protected static function getConnection(string $connection = 'Default'): array {
$configuration = [];
if (is_array($GLOBALS['TYPO3_CONF_VARS']['DB']['Connections'][$connection])) {
$extensionConfiguration = $GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['t3v_datamapper'];
if (is_string($extensionCo... | php | protected static function getConnection(string $connection = 'Default'): array {
$configuration = [];
if (is_array($GLOBALS['TYPO3_CONF_VARS']['DB']['Connections'][$connection])) {
$extensionConfiguration = $GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['t3v_datamapper'];
if (is_string($extensionCo... | [
"protected",
"static",
"function",
"getConnection",
"(",
"string",
"$",
"connection",
"=",
"'Default'",
")",
":",
"array",
"{",
"$",
"configuration",
"=",
"[",
"]",
";",
"if",
"(",
"is_array",
"(",
"$",
"GLOBALS",
"[",
"'TYPO3_CONF_VARS'",
"]",
"[",
"'DB'"... | Returns the connection configuration from the Global TYPO3 configuration options.
@param string $connection The optional connection, defaults to `Default`
@return array The connection configuration
@link https://laravel.com/docs/master/database#configuration The Laravel Database Configuration
@link https://docs.typo3.... | [
"Returns",
"the",
"connection",
"configuration",
"from",
"the",
"Global",
"TYPO3",
"configuration",
"options",
"."
] | bab2de90f467936fbe4270cd133cb4109d1108eb | https://github.com/t3v/t3v_datamapper/blob/bab2de90f467936fbe4270cd133cb4109d1108eb/Classes/Service/DatabaseService.php#L42-L65 |
194,188 | Subscribo/klarna-invoice-sdk-wrapped | src/Encoding.php | KlarnaEncoding.get | public static function get($country)
{
switch (strtoupper($country)) {
case "DE":
return KlarnaEncoding::PNO_DE;
case "DK":
return KlarnaEncoding::PNO_DK;
case "FI":
return KlarnaEncoding::PNO_FI;
case "NL":
return KlarnaEncodin... | php | public static function get($country)
{
switch (strtoupper($country)) {
case "DE":
return KlarnaEncoding::PNO_DE;
case "DK":
return KlarnaEncoding::PNO_DK;
case "FI":
return KlarnaEncoding::PNO_FI;
case "NL":
return KlarnaEncodin... | [
"public",
"static",
"function",
"get",
"(",
"$",
"country",
")",
"{",
"switch",
"(",
"strtoupper",
"(",
"$",
"country",
")",
")",
"{",
"case",
"\"DE\"",
":",
"return",
"KlarnaEncoding",
"::",
"PNO_DE",
";",
"case",
"\"DK\"",
":",
"return",
"KlarnaEncoding"... | Returns the constant for the wanted country.
@param string $country country
@return int | [
"Returns",
"the",
"constant",
"for",
"the",
"wanted",
"country",
"."
] | 4a45ddd9ec444f5a6d02628ad65e635a3e12611c | https://github.com/Subscribo/klarna-invoice-sdk-wrapped/blob/4a45ddd9ec444f5a6d02628ad65e635a3e12611c/src/Encoding.php#L114-L134 |
194,189 | Subscribo/klarna-invoice-sdk-wrapped | src/Encoding.php | KlarnaEncoding.getRegexp | public static function getRegexp($enc)
{
switch($enc) {
case self::PNO_SE:
/*
* All positions except C contain numbers 0-9.
*
* PNO:
* YYYYMMDDCNNNN, C = -|+ length 13
* YYYYMMDDNNNN 12
* YYM... | php | public static function getRegexp($enc)
{
switch($enc) {
case self::PNO_SE:
/*
* All positions except C contain numbers 0-9.
*
* PNO:
* YYYYMMDDCNNNN, C = -|+ length 13
* YYYYMMDDNNNN 12
* YYM... | [
"public",
"static",
"function",
"getRegexp",
"(",
"$",
"enc",
")",
"{",
"switch",
"(",
"$",
"enc",
")",
"{",
"case",
"self",
"::",
"PNO_SE",
":",
"/*\n * All positions except C contain numbers 0-9.\n *\n * PNO:\n * YYYYMMDDCNNNN... | Returns a regexp string for the specified encoding constant.
@param int $enc PNO/SSN encoding constant.
@return string The regular expression.
@throws Klarna_UnknownEncodingException | [
"Returns",
"a",
"regexp",
"string",
"for",
"the",
"specified",
"encoding",
"constant",
"."
] | 4a45ddd9ec444f5a6d02628ad65e635a3e12611c | https://github.com/Subscribo/klarna-invoice-sdk-wrapped/blob/4a45ddd9ec444f5a6d02628ad65e635a3e12611c/src/Encoding.php#L144-L236 |
194,190 | theopera/framework | src/Component/WebApplication/ConfigurationBag.php | ConfigurationBag.getSection | public function getSection(string $key) : ConfigurationBagInterface
{
return new ConfigurationBag(isset($this->parameters[$key]) ? $this->parameters[$key] : []);
} | php | public function getSection(string $key) : ConfigurationBagInterface
{
return new ConfigurationBag(isset($this->parameters[$key]) ? $this->parameters[$key] : []);
} | [
"public",
"function",
"getSection",
"(",
"string",
"$",
"key",
")",
":",
"ConfigurationBagInterface",
"{",
"return",
"new",
"ConfigurationBag",
"(",
"isset",
"(",
"$",
"this",
"->",
"parameters",
"[",
"$",
"key",
"]",
")",
"?",
"$",
"this",
"->",
"paramete... | Returns a new ConfigurationBag with parameters
If the section does not exists an empty ConfigurationBag is returned
@param string $key
@return ConfigurationBagInterface | [
"Returns",
"a",
"new",
"ConfigurationBag",
"with",
"parameters",
"If",
"the",
"section",
"does",
"not",
"exists",
"an",
"empty",
"ConfigurationBag",
"is",
"returned"
] | fa6165d3891a310faa580c81dee49a63c150c711 | https://github.com/theopera/framework/blob/fa6165d3891a310faa580c81dee49a63c150c711/src/Component/WebApplication/ConfigurationBag.php#L133-L136 |
194,191 | Topolis/FunctionLibrary | src/String.php | String.getNest | public static function getNest($input, $open = "(", $close = ")"){
$pattern = '#\\'.$open.'((?>[^\\'.$open.'[\\'.$close.']+)|(?R))*\\'.$close.'#';
$count = preg_match_all($pattern, $input, $matches);
if($count > 0)
return $matches[0][0];
retur... | php | public static function getNest($input, $open = "(", $close = ")"){
$pattern = '#\\'.$open.'((?>[^\\'.$open.'[\\'.$close.']+)|(?R))*\\'.$close.'#';
$count = preg_match_all($pattern, $input, $matches);
if($count > 0)
return $matches[0][0];
retur... | [
"public",
"static",
"function",
"getNest",
"(",
"$",
"input",
",",
"$",
"open",
"=",
"\"(\"",
",",
"$",
"close",
"=",
"\")\"",
")",
"{",
"$",
"pattern",
"=",
"'#\\\\'",
".",
"$",
"open",
".",
"'((?>[^\\\\'",
".",
"$",
"open",
".",
"'[\\\\'",
".",
"... | return anything within specified balanced brackets, including any nested brackets
@param string $input source string
@param string $open opening bracket. Default: '('
@param string $close closing bracket. Default: ')' | [
"return",
"anything",
"within",
"specified",
"balanced",
"brackets",
"including",
"any",
"nested",
"brackets"
] | bc57f465932fbf297927c2a32765255131b907eb | https://github.com/Topolis/FunctionLibrary/blob/bc57f465932fbf297927c2a32765255131b907eb/src/String.php#L84-L93 |
194,192 | cloudtek/dynamodm | lib/Cloudtek/DynamoDM/QueryBuilder.php | QueryBuilder.addFilterCriteria | private function addFilterCriteria()
{
$filters = $this->dm->getFilterCollection()->getFilterCriteria($this->class);
foreach ($filters as $filter) {
$this->addCriteria($filter);
}
} | php | private function addFilterCriteria()
{
$filters = $this->dm->getFilterCollection()->getFilterCriteria($this->class);
foreach ($filters as $filter) {
$this->addCriteria($filter);
}
} | [
"private",
"function",
"addFilterCriteria",
"(",
")",
"{",
"$",
"filters",
"=",
"$",
"this",
"->",
"dm",
"->",
"getFilterCollection",
"(",
")",
"->",
"getFilterCriteria",
"(",
"$",
"this",
"->",
"class",
")",
";",
"foreach",
"(",
"$",
"filters",
"as",
"$... | Add any filters to the query criteria.
@return void | [
"Add",
"any",
"filters",
"to",
"the",
"query",
"criteria",
"."
] | 119d355e2c5cbaef1f867970349b4432f5704fcd | https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/QueryBuilder.php#L162-L169 |
194,193 | cloudtek/dynamodm | lib/Cloudtek/DynamoDM/QueryBuilder.php | QueryBuilder.checkIndexIsEligible | private function checkIndexIsEligible()
{
$index = $this->getIndex();
if ($index->isSecondaryGlobal() && !$index->hasAttributes($this->expr->getAttributes())) {
throw ODMException::queryIndexProjectionIncompatible();
}
return (bool)$this->getKeyCondition();
} | php | private function checkIndexIsEligible()
{
$index = $this->getIndex();
if ($index->isSecondaryGlobal() && !$index->hasAttributes($this->expr->getAttributes())) {
throw ODMException::queryIndexProjectionIncompatible();
}
return (bool)$this->getKeyCondition();
} | [
"private",
"function",
"checkIndexIsEligible",
"(",
")",
"{",
"$",
"index",
"=",
"$",
"this",
"->",
"getIndex",
"(",
")",
";",
"if",
"(",
"$",
"index",
"->",
"isSecondaryGlobal",
"(",
")",
"&&",
"!",
"$",
"index",
"->",
"hasAttributes",
"(",
"$",
"this... | Indicates if the selected index is eligible for the assembled query.
@return bool
@throws ODMException | [
"Indicates",
"if",
"the",
"selected",
"index",
"is",
"eligible",
"for",
"the",
"assembled",
"query",
"."
] | 119d355e2c5cbaef1f867970349b4432f5704fcd | https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/QueryBuilder.php#L269-L278 |
194,194 | cloudtek/dynamodm | lib/Cloudtek/DynamoDM/QueryBuilder.php | QueryBuilder.delete | public function delete($hashValue = null, $rangeValue = null)
{
$this->setQueryClass(DeleteItem::class);
if ($hashValue !== null) {
$this->setPrimaryKey($hashValue, $rangeValue);
}
return $this;
} | php | public function delete($hashValue = null, $rangeValue = null)
{
$this->setQueryClass(DeleteItem::class);
if ($hashValue !== null) {
$this->setPrimaryKey($hashValue, $rangeValue);
}
return $this;
} | [
"public",
"function",
"delete",
"(",
"$",
"hashValue",
"=",
"null",
",",
"$",
"rangeValue",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"setQueryClass",
"(",
"DeleteItem",
"::",
"class",
")",
";",
"if",
"(",
"$",
"hashValue",
"!==",
"null",
")",
"{",
"... | Sets the query operation to 'delete' and optionally specifies the primary key.
@param mixed|null $hashValue
@param mixed|null $rangeValue
@return $this | [
"Sets",
"the",
"query",
"operation",
"to",
"delete",
"and",
"optionally",
"specifies",
"the",
"primary",
"key",
"."
] | 119d355e2c5cbaef1f867970349b4432f5704fcd | https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/QueryBuilder.php#L308-L317 |
194,195 | cloudtek/dynamodm | lib/Cloudtek/DynamoDM/QueryBuilder.php | QueryBuilder.get | public function get($hashValue = null, $rangeValue = null)
{
if ($this->expr->condition->count() > 0) {
throw ODMException::queryGetOperationConditionsNotSupported();
}
$this->setQueryClass(GetItem::class);
if ($hashValue !== null) {
$this->setPrimaryKey($ha... | php | public function get($hashValue = null, $rangeValue = null)
{
if ($this->expr->condition->count() > 0) {
throw ODMException::queryGetOperationConditionsNotSupported();
}
$this->setQueryClass(GetItem::class);
if ($hashValue !== null) {
$this->setPrimaryKey($ha... | [
"public",
"function",
"get",
"(",
"$",
"hashValue",
"=",
"null",
",",
"$",
"rangeValue",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"expr",
"->",
"condition",
"->",
"count",
"(",
")",
">",
"0",
")",
"{",
"throw",
"ODMException",
"::",
"qu... | Sets the query operation to 'get' and optionally specifies the primary key.
@param mixed|null $hashValue
@param mixed|null $rangeValue
@return $this
@throws ODMException | [
"Sets",
"the",
"query",
"operation",
"to",
"get",
"and",
"optionally",
"specifies",
"the",
"primary",
"key",
"."
] | 119d355e2c5cbaef1f867970349b4432f5704fcd | https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/QueryBuilder.php#L374-L387 |
194,196 | cloudtek/dynamodm | lib/Cloudtek/DynamoDM/QueryBuilder.php | QueryBuilder.getFilter | private function getFilter($keyCondition)
{
$filter = clone $this->expr->condition;
$conditions = $keyCondition instanceof Composite ?
$keyCondition->getParts() : [$keyCondition];
foreach ($conditions as $condition) {
$filter->remove($condition);
}
... | php | private function getFilter($keyCondition)
{
$filter = clone $this->expr->condition;
$conditions = $keyCondition instanceof Composite ?
$keyCondition->getParts() : [$keyCondition];
foreach ($conditions as $condition) {
$filter->remove($condition);
}
... | [
"private",
"function",
"getFilter",
"(",
"$",
"keyCondition",
")",
"{",
"$",
"filter",
"=",
"clone",
"$",
"this",
"->",
"expr",
"->",
"condition",
";",
"$",
"conditions",
"=",
"$",
"keyCondition",
"instanceof",
"Composite",
"?",
"$",
"keyCondition",
"->",
... | Return a expression containing only the subexpression parts which are not
part of specified key condition.
@param Equality|AddAnd $keyCondition
@return AddAnd | [
"Return",
"a",
"expression",
"containing",
"only",
"the",
"subexpression",
"parts",
"which",
"are",
"not",
"part",
"of",
"specified",
"key",
"condition",
"."
] | 119d355e2c5cbaef1f867970349b4432f5704fcd | https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/QueryBuilder.php#L476-L487 |
194,197 | cloudtek/dynamodm | lib/Cloudtek/DynamoDM/QueryBuilder.php | QueryBuilder.getQuery | public function getQuery()
{
switch ($this->queryClass) {
case DeleteItem::class:
return $this->makeDelete();
case GetItem::class:
return $this->makeGet();
case PutItem::class:
return $this->makePut();
case Scan:... | php | public function getQuery()
{
switch ($this->queryClass) {
case DeleteItem::class:
return $this->makeDelete();
case GetItem::class:
return $this->makeGet();
case PutItem::class:
return $this->makePut();
case Scan:... | [
"public",
"function",
"getQuery",
"(",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"queryClass",
")",
"{",
"case",
"DeleteItem",
"::",
"class",
":",
"return",
"$",
"this",
"->",
"makeDelete",
"(",
")",
";",
"case",
"GetItem",
"::",
"class",
":",
"retur... | Build and return the query object.
@return Scan|Query|GetItem|PutItem|UpdateItem|DeleteItem | [
"Build",
"and",
"return",
"the",
"query",
"object",
"."
] | 119d355e2c5cbaef1f867970349b4432f5704fcd | https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/QueryBuilder.php#L549-L567 |
194,198 | cloudtek/dynamodm | lib/Cloudtek/DynamoDM/QueryBuilder.php | QueryBuilder.requireIndexes | public function requireIndexes($bool = true)
{
if (!$this->isQueryOrScan()) {
//TODO: exception
}
if ($bool) {
$this->queryClass = Query::class;
} else {
$this->queryClass = Scan::class;
}
return $this;
} | php | public function requireIndexes($bool = true)
{
if (!$this->isQueryOrScan()) {
//TODO: exception
}
if ($bool) {
$this->queryClass = Query::class;
} else {
$this->queryClass = Scan::class;
}
return $this;
} | [
"public",
"function",
"requireIndexes",
"(",
"$",
"bool",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isQueryOrScan",
"(",
")",
")",
"{",
"//TODO: exception",
"}",
"if",
"(",
"$",
"bool",
")",
"{",
"$",
"this",
"->",
"queryClass",
"=",... | Set whether or not to require indexes.
@param bool $bool
@return $this | [
"Set",
"whether",
"or",
"not",
"to",
"require",
"indexes",
"."
] | 119d355e2c5cbaef1f867970349b4432f5704fcd | https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/QueryBuilder.php#L843-L856 |
194,199 | cloudtek/dynamodm | lib/Cloudtek/DynamoDM/QueryBuilder.php | QueryBuilder.update | public function update($hashValue = null, $rangeValue = null)
{
$this->setQueryClass(UpdateItem::class);
if ($hashValue !== null) {
$this->setPrimaryKey($hashValue, $rangeValue);
}
return $this;
} | php | public function update($hashValue = null, $rangeValue = null)
{
$this->setQueryClass(UpdateItem::class);
if ($hashValue !== null) {
$this->setPrimaryKey($hashValue, $rangeValue);
}
return $this;
} | [
"public",
"function",
"update",
"(",
"$",
"hashValue",
"=",
"null",
",",
"$",
"rangeValue",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"setQueryClass",
"(",
"UpdateItem",
"::",
"class",
")",
";",
"if",
"(",
"$",
"hashValue",
"!==",
"null",
")",
"{",
"... | Sets the query operation to 'update' and optionally specifies the primary key.
@param mixed|null $hashValue
@param mixed|null $rangeValue
@return $this | [
"Sets",
"the",
"query",
"operation",
"to",
"update",
"and",
"optionally",
"specifies",
"the",
"primary",
"key",
"."
] | 119d355e2c5cbaef1f867970349b4432f5704fcd | https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/QueryBuilder.php#L926-L935 |
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.