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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
11,500 | perinatologie/hub-client-php | src/Factory/ApiClientFactory.php | ApiClientFactory.createV3Client | public function createV3Client($username, $password)
{
return new HubV3Client(
$username,
$password,
$this->hubUrl,
$this->requestHeaders,
$this->tlsCertVerification
);
} | php | public function createV3Client($username, $password)
{
return new HubV3Client(
$username,
$password,
$this->hubUrl,
$this->requestHeaders,
$this->tlsCertVerification
);
} | [
"public",
"function",
"createV3Client",
"(",
"$",
"username",
",",
"$",
"password",
")",
"{",
"return",
"new",
"HubV3Client",
"(",
"$",
"username",
",",
"$",
"password",
",",
"$",
"this",
"->",
"hubUrl",
",",
"$",
"this",
"->",
"requestHeaders",
",",
"$"... | Get a client for the v3 Hub API.
@param string $username
@param string $password
@return \Hub\Client\V3\HubV3Client | [
"Get",
"a",
"client",
"for",
"the",
"v3",
"Hub",
"API",
"."
] | 3a0cf7ec6e3e5bf465167c283ee3dad9f4daaca3 | https://github.com/perinatologie/hub-client-php/blob/3a0cf7ec6e3e5bf465167c283ee3dad9f4daaca3/src/Factory/ApiClientFactory.php#L56-L65 |
11,501 | perinatologie/hub-client-php | src/Factory/ApiClientFactory.php | ApiClientFactory.createV4Client | public function createV4Client($username, $password)
{
if (!$this->userbaseUrl) {
throw new RuntimeException(
'In order to createV4Client you need to have previsously called ApiClientFactory::setUserbaseJwtAuthenticatorUrl'
);
}
$authenticator = new Us... | php | public function createV4Client($username, $password)
{
if (!$this->userbaseUrl) {
throw new RuntimeException(
'In order to createV4Client you need to have previsously called ApiClientFactory::setUserbaseJwtAuthenticatorUrl'
);
}
$authenticator = new Us... | [
"public",
"function",
"createV4Client",
"(",
"$",
"username",
",",
"$",
"password",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"userbaseUrl",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"'In order to createV4Client you need to have previsously called ApiClien... | Get a client for the v4 Hub API.
@param string $username
@param string $password
@throws \RuntimeException if setUserbaseJwtAuthenticatorUrl was not called
@throws \Hub\Client\Exception\ClientCreationException | [
"Get",
"a",
"client",
"for",
"the",
"v4",
"Hub",
"API",
"."
] | 3a0cf7ec6e3e5bf465167c283ee3dad9f4daaca3 | https://github.com/perinatologie/hub-client-php/blob/3a0cf7ec6e3e5bf465167c283ee3dad9f4daaca3/src/Factory/ApiClientFactory.php#L76-L108 |
11,502 | kengoldfarb/underscore_libs | src/_Libs/_Crypt.php | _Crypt._encryptAESPKCS7 | public static function _encryptAESPKCS7($str, $key = _CryptConfig::AES_KEY, $cipher = _CryptConfig::CIPHER, $mode = _CryptConfig::MODE) {
$key = self::_chopKeyForAES($key);
$block = mcrypt_get_block_size($cipher, $mode);
$pad = $block - (strlen($str) % $block);
$str .= str_repeat(chr($pa... | php | public static function _encryptAESPKCS7($str, $key = _CryptConfig::AES_KEY, $cipher = _CryptConfig::CIPHER, $mode = _CryptConfig::MODE) {
$key = self::_chopKeyForAES($key);
$block = mcrypt_get_block_size($cipher, $mode);
$pad = $block - (strlen($str) % $block);
$str .= str_repeat(chr($pa... | [
"public",
"static",
"function",
"_encryptAESPKCS7",
"(",
"$",
"str",
",",
"$",
"key",
"=",
"_CryptConfig",
"::",
"AES_KEY",
",",
"$",
"cipher",
"=",
"_CryptConfig",
"::",
"CIPHER",
",",
"$",
"mode",
"=",
"_CryptConfig",
"::",
"MODE",
")",
"{",
"$",
"key"... | Encrypts a string using AES encryption with PKCS7 padding.
Random IV is used
Adapted from comments in PHP manual:
http://php.net/manual/en/function.mcrypt-encrypt.php
@param string $str The string to encrypt
@param string $key (optional) The private key to encrypt with (note: anything over 24 chars will be chopped of... | [
"Encrypts",
"a",
"string",
"using",
"AES",
"encryption",
"with",
"PKCS7",
"padding",
".",
"Random",
"IV",
"is",
"used"
] | e0d584f25093b594e67b8a3068ebd41c7f6483c5 | https://github.com/kengoldfarb/underscore_libs/blob/e0d584f25093b594e67b8a3068ebd41c7f6483c5/src/_Libs/_Crypt.php#L92-L101 |
11,503 | kengoldfarb/underscore_libs | src/_Libs/_Crypt.php | _Crypt._decryptAESPKCS7 | public static function _decryptAESPKCS7($str, $key = _CryptConfig::AES_KEY, $cipher = _CryptConfig::CIPHER, $mode = _CryptConfig::MODE) {
$key = self::_chopKeyForAES($key);
$ivLength = self::_getBase64IVLength($cipher, $mode);
$iv = substr($str, 0, $ivLength - 1);
$iv = base64_decode($iv... | php | public static function _decryptAESPKCS7($str, $key = _CryptConfig::AES_KEY, $cipher = _CryptConfig::CIPHER, $mode = _CryptConfig::MODE) {
$key = self::_chopKeyForAES($key);
$ivLength = self::_getBase64IVLength($cipher, $mode);
$iv = substr($str, 0, $ivLength - 1);
$iv = base64_decode($iv... | [
"public",
"static",
"function",
"_decryptAESPKCS7",
"(",
"$",
"str",
",",
"$",
"key",
"=",
"_CryptConfig",
"::",
"AES_KEY",
",",
"$",
"cipher",
"=",
"_CryptConfig",
"::",
"CIPHER",
",",
"$",
"mode",
"=",
"_CryptConfig",
"::",
"MODE",
")",
"{",
"$",
"key"... | Decrypts a string using AES encryption with PKCS7 padding.
Adapted from comments in PHP manual:
http://php.net/manual/en/function.mcrypt-encrypt.php
@param string $str The string to encrypt
@param string $key (optional) The private key to encrypt with (note: anything over 24 chars will be chopped off)
@param const $c... | [
"Decrypts",
"a",
"string",
"using",
"AES",
"encryption",
"with",
"PKCS7",
"padding",
"."
] | e0d584f25093b594e67b8a3068ebd41c7f6483c5 | https://github.com/kengoldfarb/underscore_libs/blob/e0d584f25093b594e67b8a3068ebd41c7f6483c5/src/_Libs/_Crypt.php#L115-L126 |
11,504 | kengoldfarb/underscore_libs | src/_Libs/_Crypt.php | _Crypt._createIV | private static function _createIV($cipher, $mode) {
$size = self::_getIVSize($cipher, $mode);
return mcrypt_create_iv($size, MCRYPT_DEV_RANDOM);
} | php | private static function _createIV($cipher, $mode) {
$size = self::_getIVSize($cipher, $mode);
return mcrypt_create_iv($size, MCRYPT_DEV_RANDOM);
} | [
"private",
"static",
"function",
"_createIV",
"(",
"$",
"cipher",
",",
"$",
"mode",
")",
"{",
"$",
"size",
"=",
"self",
"::",
"_getIVSize",
"(",
"$",
"cipher",
",",
"$",
"mode",
")",
";",
"return",
"mcrypt_create_iv",
"(",
"$",
"size",
",",
"MCRYPT_DEV... | Generates an initialization vector based on cipher and mode
@param const $cipher The cipher to be used
@param const $mode The mode to be used
@return string The initialization vector | [
"Generates",
"an",
"initialization",
"vector",
"based",
"on",
"cipher",
"and",
"mode"
] | e0d584f25093b594e67b8a3068ebd41c7f6483c5 | https://github.com/kengoldfarb/underscore_libs/blob/e0d584f25093b594e67b8a3068ebd41c7f6483c5/src/_Libs/_Crypt.php#L212-L215 |
11,505 | zepi/turbo-base | Zepi/Api/Rest/src/Helper/FrontendHelper.php | FrontendHelper.parseAuthorizationString | protected function parseAuthorizationString($authorizationString)
{
if (strpos($authorizationString, 'Basic') !== false) {
$authorizationString = trim(substr($authorizationString, 6));
}
$decoded = base64_decode($authorizationString);
$delimiterPos = strpos($decoded,... | php | protected function parseAuthorizationString($authorizationString)
{
if (strpos($authorizationString, 'Basic') !== false) {
$authorizationString = trim(substr($authorizationString, 6));
}
$decoded = base64_decode($authorizationString);
$delimiterPos = strpos($decoded,... | [
"protected",
"function",
"parseAuthorizationString",
"(",
"$",
"authorizationString",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"authorizationString",
",",
"'Basic'",
")",
"!==",
"false",
")",
"{",
"$",
"authorizationString",
"=",
"trim",
"(",
"substr",
"(",
"$... | Parses the authorization string and returns an array with
the public key and the hmac
@access protected
@param string $authorizationString
@return array | [
"Parses",
"the",
"authorization",
"string",
"and",
"returns",
"an",
"array",
"with",
"the",
"public",
"key",
"and",
"the",
"hmac"
] | 9a36d8c7649317f55f91b2adf386bd1f04ec02a3 | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Api/Rest/src/Helper/FrontendHelper.php#L170-L183 |
11,506 | soloproyectos-php/db | src/db/DbConnector.php | DbConnector.startDebug | public function startDebug($listener = null, $type = "")
{
if (!Text::isEmpty($type) && !in_array($type, ["exec", "query"])) {
throw new DbException("Invalid filter type. Valid filter types are 'exec' and 'query'");
}
$this->_debugListener = $listener !== null? $listener... | php | public function startDebug($listener = null, $type = "")
{
if (!Text::isEmpty($type) && !in_array($type, ["exec", "query"])) {
throw new DbException("Invalid filter type. Valid filter types are 'exec' and 'query'");
}
$this->_debugListener = $listener !== null? $listener... | [
"public",
"function",
"startDebug",
"(",
"$",
"listener",
"=",
"null",
",",
"$",
"type",
"=",
"\"\"",
")",
"{",
"if",
"(",
"!",
"Text",
"::",
"isEmpty",
"(",
"$",
"type",
")",
"&&",
"!",
"in_array",
"(",
"$",
"type",
",",
"[",
"\"exec\"",
",",
"\... | Starts the debugger mechanism.
@param callable $listener Debug listener
@param string $type Listener type ('query' or 'exec', not required)
@return void | [
"Starts",
"the",
"debugger",
"mechanism",
"."
] | 09db63e37bb4fc3d9f6cc2f581e9e2423dc82cf6 | https://github.com/soloproyectos-php/db/blob/09db63e37bb4fc3d9f6cc2f581e9e2423dc82cf6/src/db/DbConnector.php#L80-L94 |
11,507 | soloproyectos-php/db | src/db/DbConnector.php | DbConnector.stopDebug | public function stopDebug($type = "")
{
if (!Text::isEmpty($type) && !in_array($type, ["exec", "query"])) {
throw new DbException("Invalid filter type. Valid filter types are 'exec' and 'query'");
}
$types = Text::isEmpty($type)? ["exec", "query"]: [$type];
forea... | php | public function stopDebug($type = "")
{
if (!Text::isEmpty($type) && !in_array($type, ["exec", "query"])) {
throw new DbException("Invalid filter type. Valid filter types are 'exec' and 'query'");
}
$types = Text::isEmpty($type)? ["exec", "query"]: [$type];
forea... | [
"public",
"function",
"stopDebug",
"(",
"$",
"type",
"=",
"\"\"",
")",
"{",
"if",
"(",
"!",
"Text",
"::",
"isEmpty",
"(",
"$",
"type",
")",
"&&",
"!",
"in_array",
"(",
"$",
"type",
",",
"[",
"\"exec\"",
",",
"\"query\"",
"]",
")",
")",
"{",
"thro... | Stops the debugger mechanism.
@param string $type Listener type ('query' or 'exec', not required)
@return void | [
"Stops",
"the",
"debugger",
"mechanism",
"."
] | 09db63e37bb4fc3d9f6cc2f581e9e2423dc82cf6 | https://github.com/soloproyectos-php/db/blob/09db63e37bb4fc3d9f6cc2f581e9e2423dc82cf6/src/db/DbConnector.php#L103-L113 |
11,508 | soloproyectos-php/db | src/db/DbConnector.php | DbConnector.addDebugListener | public function addDebugListener($listener, $type = "")
{
if (!Text::isEmpty($type) && !in_array($type, ["exec", "query"])) {
throw new DbException("Invalid filter type. Valid filter types are 'exec' and 'query'");
}
$types = Text::isEmpty($type)? ["exec", "query"]: [$ty... | php | public function addDebugListener($listener, $type = "")
{
if (!Text::isEmpty($type) && !in_array($type, ["exec", "query"])) {
throw new DbException("Invalid filter type. Valid filter types are 'exec' and 'query'");
}
$types = Text::isEmpty($type)? ["exec", "query"]: [$ty... | [
"public",
"function",
"addDebugListener",
"(",
"$",
"listener",
",",
"$",
"type",
"=",
"\"\"",
")",
"{",
"if",
"(",
"!",
"Text",
"::",
"isEmpty",
"(",
"$",
"type",
")",
"&&",
"!",
"in_array",
"(",
"$",
"type",
",",
"[",
"\"exec\"",
",",
"\"query\"",
... | Adds a debug listener.
@param Callable $listener Listener
@param string $type Filter type ('exec' or 'query'. Not required)
@return void | [
"Adds",
"a",
"debug",
"listener",
"."
] | 09db63e37bb4fc3d9f6cc2f581e9e2423dc82cf6 | https://github.com/soloproyectos-php/db/blob/09db63e37bb4fc3d9f6cc2f581e9e2423dc82cf6/src/db/DbConnector.php#L123-L133 |
11,509 | soloproyectos-php/db | src/db/DbConnector.php | DbConnector.query | public function query($sql, $arguments = array())
{
$this->_debugger->trigger("query", [$sql, $arguments]);
$ret = new DbSource($this, $sql, $arguments);
return $ret;
} | php | public function query($sql, $arguments = array())
{
$this->_debugger->trigger("query", [$sql, $arguments]);
$ret = new DbSource($this, $sql, $arguments);
return $ret;
} | [
"public",
"function",
"query",
"(",
"$",
"sql",
",",
"$",
"arguments",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"_debugger",
"->",
"trigger",
"(",
"\"query\"",
",",
"[",
"$",
"sql",
",",
"$",
"arguments",
"]",
")",
";",
"$",
"ret",
"=... | Executes a DDL statement.
This function executes a DDL statement (select, show, describe, etc...) and returns a datasource.
Examples:
```php
$db = new DbConnector($dbname, $username, $password);
// retrieves a single row
$row = $db->query("select count(*) from table");
echo $row[0];
// retrieves multiple rows
$rows... | [
"Executes",
"a",
"DDL",
"statement",
"."
] | 09db63e37bb4fc3d9f6cc2f581e9e2423dc82cf6 | https://github.com/soloproyectos-php/db/blob/09db63e37bb4fc3d9f6cc2f581e9e2423dc82cf6/src/db/DbConnector.php#L209-L214 |
11,510 | soloproyectos-php/db | src/db/DbConnector.php | DbConnector.fetchRows | public function fetchRows($sql, $arguments = array())
{
$ret = array();
$result = $this->_exec($sql, $arguments);
// fetches all rows
while ($row = $result->fetch_array()) {
array_push($ret, $row);
}
$result->close();
return $ret;
} | php | public function fetchRows($sql, $arguments = array())
{
$ret = array();
$result = $this->_exec($sql, $arguments);
// fetches all rows
while ($row = $result->fetch_array()) {
array_push($ret, $row);
}
$result->close();
return $ret;
} | [
"public",
"function",
"fetchRows",
"(",
"$",
"sql",
",",
"$",
"arguments",
"=",
"array",
"(",
")",
")",
"{",
"$",
"ret",
"=",
"array",
"(",
")",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"_exec",
"(",
"$",
"sql",
",",
"$",
"arguments",
")",
"... | Executes a DDL statement and returns all rows.
This function executes a DDL statement (select, show, describe, etc...) and returns an
associative array. I recommend to use DbConnector::query() instead.
@param string $sql SQL statement
@param scalar|array $arguments List of arguments (not required)
@retur... | [
"Executes",
"a",
"DDL",
"statement",
"and",
"returns",
"all",
"rows",
"."
] | 09db63e37bb4fc3d9f6cc2f581e9e2423dc82cf6 | https://github.com/soloproyectos-php/db/blob/09db63e37bb4fc3d9f6cc2f581e9e2423dc82cf6/src/db/DbConnector.php#L227-L239 |
11,511 | soloproyectos-php/db | src/db/DbConnector.php | DbConnector._replaceArguments | private function _replaceArguments($sql, $arguments)
{
if (!is_array($arguments)) {
$arguments = array($arguments);
}
// searches string segments (startPos, endPos)
$stringSegments = [];
if (preg_match_all('/(["\'`])((?:\\\\\1|.)*?)\1/', $sql, $matches, P... | php | private function _replaceArguments($sql, $arguments)
{
if (!is_array($arguments)) {
$arguments = array($arguments);
}
// searches string segments (startPos, endPos)
$stringSegments = [];
if (preg_match_all('/(["\'`])((?:\\\\\1|.)*?)\1/', $sql, $matches, P... | [
"private",
"function",
"_replaceArguments",
"(",
"$",
"sql",
",",
"$",
"arguments",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"arguments",
")",
")",
"{",
"$",
"arguments",
"=",
"array",
"(",
"$",
"arguments",
")",
";",
"}",
"// searches string segm... | Replaces arguments in an SQL statement.
@param string $sql SQL statement
@param scalar|array $arguments List of arguments
@return string | [
"Replaces",
"arguments",
"in",
"an",
"SQL",
"statement",
"."
] | 09db63e37bb4fc3d9f6cc2f581e9e2423dc82cf6 | https://github.com/soloproyectos-php/db/blob/09db63e37bb4fc3d9f6cc2f581e9e2423dc82cf6/src/db/DbConnector.php#L293-L345 |
11,512 | aedart/model | src/Traits/Strings/DeliveryAddressTrait.php | DeliveryAddressTrait.getDeliveryAddress | public function getDeliveryAddress() : ?string
{
if ( ! $this->hasDeliveryAddress()) {
$this->setDeliveryAddress($this->getDefaultDeliveryAddress());
}
return $this->deliveryAddress;
} | php | public function getDeliveryAddress() : ?string
{
if ( ! $this->hasDeliveryAddress()) {
$this->setDeliveryAddress($this->getDefaultDeliveryAddress());
}
return $this->deliveryAddress;
} | [
"public",
"function",
"getDeliveryAddress",
"(",
")",
":",
"?",
"string",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasDeliveryAddress",
"(",
")",
")",
"{",
"$",
"this",
"->",
"setDeliveryAddress",
"(",
"$",
"this",
"->",
"getDefaultDeliveryAddress",
"(",
"... | Get delivery address
If no "delivery address" value has been set, this method will
set and return a default "delivery address" value,
if any such value is available
@see getDefaultDeliveryAddress()
@return string|null delivery address or null if no delivery address has been set | [
"Get",
"delivery",
"address"
] | 9a562c1c53a276d01ace0ab71f5305458bea542f | https://github.com/aedart/model/blob/9a562c1c53a276d01ace0ab71f5305458bea542f/src/Traits/Strings/DeliveryAddressTrait.php#L48-L54 |
11,513 | snapwp/snap-debug | src/Debug_Service_Provider.php | Debug_Service_Provider.init_whoops | private function init_whoops()
{
$whoops = new Run;
$general = new General();
$whoops->pushHandler($general->get_handler());
$whoops->pushHandler(new Ajax());
$whoops->pushHandler(new Rest_Api());
$whoops->register();
\ob_start();
// Add to Ser... | php | private function init_whoops()
{
$whoops = new Run;
$general = new General();
$whoops->pushHandler($general->get_handler());
$whoops->pushHandler(new Ajax());
$whoops->pushHandler(new Rest_Api());
$whoops->register();
\ob_start();
// Add to Ser... | [
"private",
"function",
"init_whoops",
"(",
")",
"{",
"$",
"whoops",
"=",
"new",
"Run",
";",
"$",
"general",
"=",
"new",
"General",
"(",
")",
";",
"$",
"whoops",
"->",
"pushHandler",
"(",
"$",
"general",
"->",
"get_handler",
"(",
")",
")",
";",
"$",
... | Register the Whoops service into the service container.
@since 1.0.0 | [
"Register",
"the",
"Whoops",
"service",
"into",
"the",
"service",
"container",
"."
] | 49c0c258ce50098a3fca076ce122adf57571f2e2 | https://github.com/snapwp/snap-debug/blob/49c0c258ce50098a3fca076ce122adf57571f2e2/src/Debug_Service_Provider.php#L55-L70 |
11,514 | gregoriohc/argentum-common | src/Common/Tax.php | Tax.getAmount | public function getAmount($baseAmount = null)
{
if (is_numeric($this->getFixedAmount())) {
return $this->getFixedAmount();
}
if (null === $baseAmount) {
$baseAmount = $this->getBaseAmount();
}
return round($baseAmount * $this->getRate() / 100, 2);
... | php | public function getAmount($baseAmount = null)
{
if (is_numeric($this->getFixedAmount())) {
return $this->getFixedAmount();
}
if (null === $baseAmount) {
$baseAmount = $this->getBaseAmount();
}
return round($baseAmount * $this->getRate() / 100, 2);
... | [
"public",
"function",
"getAmount",
"(",
"$",
"baseAmount",
"=",
"null",
")",
"{",
"if",
"(",
"is_numeric",
"(",
"$",
"this",
"->",
"getFixedAmount",
"(",
")",
")",
")",
"{",
"return",
"$",
"this",
"->",
"getFixedAmount",
"(",
")",
";",
"}",
"if",
"("... | Get tax amount from a given base amount
@param float $baseAmount
@return float | [
"Get",
"tax",
"amount",
"from",
"a",
"given",
"base",
"amount"
] | 9d914d19aa6ed25d33f00d603eff486484f0f3ba | https://github.com/gregoriohc/argentum-common/blob/9d914d19aa6ed25d33f00d603eff486484f0f3ba/src/Common/Tax.php#L208-L219 |
11,515 | agentmedia/phine-news | src/News/Modules/Frontend/ArticleList.php | ArticleList.InitArticles | private function InitArticles()
{
$this->archive = Archive::Schema()->ByPage($this->CurrentPage());
if ($this->archive)
{
$this->InitArchiveArticles();
return;
}
$this->category = Category::Schema()->ByPage($this->CurrentPage());
if ($this->ca... | php | private function InitArticles()
{
$this->archive = Archive::Schema()->ByPage($this->CurrentPage());
if ($this->archive)
{
$this->InitArchiveArticles();
return;
}
$this->category = Category::Schema()->ByPage($this->CurrentPage());
if ($this->ca... | [
"private",
"function",
"InitArticles",
"(",
")",
"{",
"$",
"this",
"->",
"archive",
"=",
"Archive",
"::",
"Schema",
"(",
")",
"->",
"ByPage",
"(",
"$",
"this",
"->",
"CurrentPage",
"(",
")",
")",
";",
"if",
"(",
"$",
"this",
"->",
"archive",
")",
"... | Initializes the article array | [
"Initializes",
"the",
"article",
"array"
] | 51abc830fecd1325f0b7d28391ecd924cdc7c945 | https://github.com/agentmedia/phine-news/blob/51abc830fecd1325f0b7d28391ecd924cdc7c945/src/News/Modules/Frontend/ArticleList.php#L97-L111 |
11,516 | agentmedia/phine-news | src/News/Modules/Frontend/ArticleList.php | ArticleList.InitArchiveArticles | private function InitArchiveArticles()
{
$sql = Access::SqlBuilder();
$tblArticle = Article::Schema()->Table();
$tblCategory = Category::Schema()->Table();
$join = $sql->Join($tblCategory);
$joinCond = $sql->Equals($tblArticle->Field('Category'), $tblCategory->Field('ID'));
... | php | private function InitArchiveArticles()
{
$sql = Access::SqlBuilder();
$tblArticle = Article::Schema()->Table();
$tblCategory = Category::Schema()->Table();
$join = $sql->Join($tblCategory);
$joinCond = $sql->Equals($tblArticle->Field('Category'), $tblCategory->Field('ID'));
... | [
"private",
"function",
"InitArchiveArticles",
"(",
")",
"{",
"$",
"sql",
"=",
"Access",
"::",
"SqlBuilder",
"(",
")",
";",
"$",
"tblArticle",
"=",
"Article",
"::",
"Schema",
"(",
")",
"->",
"Table",
"(",
")",
";",
"$",
"tblCategory",
"=",
"Category",
"... | Initializes article array for a page assigned archive | [
"Initializes",
"article",
"array",
"for",
"a",
"page",
"assigned",
"archive"
] | 51abc830fecd1325f0b7d28391ecd924cdc7c945 | https://github.com/agentmedia/phine-news/blob/51abc830fecd1325f0b7d28391ecd924cdc7c945/src/News/Modules/Frontend/ArticleList.php#L116-L129 |
11,517 | agentmedia/phine-news | src/News/Modules/Frontend/ArticleList.php | ArticleList.InitCategoryArticles | private function InitCategoryArticles()
{
$sql = Access::SqlBuilder();
$tblArticle = Article::Schema()->Table();
$orderBy = $sql->OrderList($sql->OrderDesc($tblArticle->Field('Created')));
$where = $this->PublishedCondition()->
And_($sql->Equals($tblArticle->Field('Ca... | php | private function InitCategoryArticles()
{
$sql = Access::SqlBuilder();
$tblArticle = Article::Schema()->Table();
$orderBy = $sql->OrderList($sql->OrderDesc($tblArticle->Field('Created')));
$where = $this->PublishedCondition()->
And_($sql->Equals($tblArticle->Field('Ca... | [
"private",
"function",
"InitCategoryArticles",
"(",
")",
"{",
"$",
"sql",
"=",
"Access",
"::",
"SqlBuilder",
"(",
")",
";",
"$",
"tblArticle",
"=",
"Article",
"::",
"Schema",
"(",
")",
"->",
"Table",
"(",
")",
";",
"$",
"orderBy",
"=",
"$",
"sql",
"-... | Initializes article array for a page assigned category | [
"Initializes",
"article",
"array",
"for",
"a",
"page",
"assigned",
"category"
] | 51abc830fecd1325f0b7d28391ecd924cdc7c945 | https://github.com/agentmedia/phine-news/blob/51abc830fecd1325f0b7d28391ecd924cdc7c945/src/News/Modules/Frontend/ArticleList.php#L134-L144 |
11,518 | agentmedia/phine-news | src/News/Modules/Frontend/ArticleList.php | ArticleList.PublishedCondition | private function PublishedCondition()
{
$sql = Access::SqlBuilder();
$sqlNow = $sql->Value(Date::Now());
$tblArticle = Article::Schema()->Table();
return $sql->Equals($tblArticle->Field('Publish'), $sql->Value(true))
->And_($sql->IsNull($tblArticle->Field('Publish... | php | private function PublishedCondition()
{
$sql = Access::SqlBuilder();
$sqlNow = $sql->Value(Date::Now());
$tblArticle = Article::Schema()->Table();
return $sql->Equals($tblArticle->Field('Publish'), $sql->Value(true))
->And_($sql->IsNull($tblArticle->Field('Publish... | [
"private",
"function",
"PublishedCondition",
"(",
")",
"{",
"$",
"sql",
"=",
"Access",
"::",
"SqlBuilder",
"(",
")",
";",
"$",
"sqlNow",
"=",
"$",
"sql",
"->",
"Value",
"(",
"Date",
"::",
"Now",
"(",
")",
")",
";",
"$",
"tblArticle",
"=",
"Article",
... | The condition to retreive published articles, only
@return Sql\Condition Returns the sql condition for published articles | [
"The",
"condition",
"to",
"retreive",
"published",
"articles",
"only"
] | 51abc830fecd1325f0b7d28391ecd924cdc7c945 | https://github.com/agentmedia/phine-news/blob/51abc830fecd1325f0b7d28391ecd924cdc7c945/src/News/Modules/Frontend/ArticleList.php#L149-L159 |
11,519 | agentmedia/phine-news | src/News/Modules/Frontend/ArticleList.php | ArticleList.ArticleOffset | private function ArticleOffset()
{
$page = max(1, (int)Request::GetData('page'));
return ($page - 1) * $this->archive->GetItemsPerPage();
} | php | private function ArticleOffset()
{
$page = max(1, (int)Request::GetData('page'));
return ($page - 1) * $this->archive->GetItemsPerPage();
} | [
"private",
"function",
"ArticleOffset",
"(",
")",
"{",
"$",
"page",
"=",
"max",
"(",
"1",
",",
"(",
"int",
")",
"Request",
"::",
"GetData",
"(",
"'page'",
")",
")",
";",
"return",
"(",
"$",
"page",
"-",
"1",
")",
"*",
"$",
"this",
"->",
"archive"... | The offset for the database limit
@return int | [
"The",
"offset",
"for",
"the",
"database",
"limit"
] | 51abc830fecd1325f0b7d28391ecd924cdc7c945 | https://github.com/agentmedia/phine-news/blob/51abc830fecd1325f0b7d28391ecd924cdc7c945/src/News/Modules/Frontend/ArticleList.php#L185-L189 |
11,520 | userapp-io/userapp-php | lib/UserApp/Http/Response.php | Response.fromRaw | public static function fromRaw($raw){
$response = new Response();
$header_end_offset = strpos($raw, "\r\n\r\n");
$raw_head = substr($raw, 0, $header_end_offset);
$raw_body = substr($raw, $header_end_offset+4);
$raw_headers = explode("\r\n", $raw_head);
$status_head = array_shift($raw_headers);
$st... | php | public static function fromRaw($raw){
$response = new Response();
$header_end_offset = strpos($raw, "\r\n\r\n");
$raw_head = substr($raw, 0, $header_end_offset);
$raw_body = substr($raw, $header_end_offset+4);
$raw_headers = explode("\r\n", $raw_head);
$status_head = array_shift($raw_headers);
$st... | [
"public",
"static",
"function",
"fromRaw",
"(",
"$",
"raw",
")",
"{",
"$",
"response",
"=",
"new",
"Response",
"(",
")",
";",
"$",
"header_end_offset",
"=",
"strpos",
"(",
"$",
"raw",
",",
"\"\\r\\n\\r\\n\"",
")",
";",
"$",
"raw_head",
"=",
"substr",
"... | Parse a raw HTTP response | [
"Parse",
"a",
"raw",
"HTTP",
"response"
] | 02bc3b55b49a050683697da4fa86c50f95e6637e | https://github.com/userapp-io/userapp-php/blob/02bc3b55b49a050683697da4fa86c50f95e6637e/lib/UserApp/Http/Response.php#L14-L40 |
11,521 | philiplb/CRUDlexUser | src/CRUDlex/PasswordReset.php | PasswordReset.getValidPasswordReset | protected function getValidPasswordReset($token)
{
$passwordResets = $this->passwordResetData->listEntries(['token' => $token]);
if (count($passwordResets) !== 1) {
return null;
}
$passwordReset = $passwordResets[0];
$createdAt = $passwordReset->get('created_at')... | php | protected function getValidPasswordReset($token)
{
$passwordResets = $this->passwordResetData->listEntries(['token' => $token]);
if (count($passwordResets) !== 1) {
return null;
}
$passwordReset = $passwordResets[0];
$createdAt = $passwordReset->get('created_at')... | [
"protected",
"function",
"getValidPasswordReset",
"(",
"$",
"token",
")",
"{",
"$",
"passwordResets",
"=",
"$",
"this",
"->",
"passwordResetData",
"->",
"listEntries",
"(",
"[",
"'token'",
"=>",
"$",
"token",
"]",
")",
";",
"if",
"(",
"count",
"(",
"$",
... | Gets the password reset of a token but only if it is younger than 48h.
@param string $token
the password reset token
@return null|CRUDlex\Entity
the password reset request | [
"Gets",
"the",
"password",
"reset",
"of",
"a",
"token",
"but",
"only",
"if",
"it",
"is",
"younger",
"than",
"48h",
"."
] | 011c70106786ded665200a1b6b61234800c2b802 | https://github.com/philiplb/CRUDlexUser/blob/011c70106786ded665200a1b6b61234800c2b802/src/CRUDlex/PasswordReset.php#L41-L55 |
11,522 | philiplb/CRUDlexUser | src/CRUDlex/PasswordReset.php | PasswordReset.requestPasswordReset | public function requestPasswordReset($identifyingField, $identifyingValue)
{
$users = $this->userData->listEntries([$identifyingField => $identifyingValue]);
if (count($users) !== 1) {
return null;
}
$user = $users[0];
$userSetup = new UserSetup();
do {... | php | public function requestPasswordReset($identifyingField, $identifyingValue)
{
$users = $this->userData->listEntries([$identifyingField => $identifyingValue]);
if (count($users) !== 1) {
return null;
}
$user = $users[0];
$userSetup = new UserSetup();
do {... | [
"public",
"function",
"requestPasswordReset",
"(",
"$",
"identifyingField",
",",
"$",
"identifyingValue",
")",
"{",
"$",
"users",
"=",
"$",
"this",
"->",
"userData",
"->",
"listEntries",
"(",
"[",
"$",
"identifyingField",
"=>",
"$",
"identifyingValue",
"]",
")... | Creates a password reset request.
@param string $identifyingField
the identifying field to grab an user, likely the email
@param string $identifyingValue
the identifying value to grab an user, likely the email
@return null|string
the token of the password reset instance ready to be send to the user via
a secondary ch... | [
"Creates",
"a",
"password",
"reset",
"request",
"."
] | 011c70106786ded665200a1b6b61234800c2b802 | https://github.com/philiplb/CRUDlexUser/blob/011c70106786ded665200a1b6b61234800c2b802/src/CRUDlex/PasswordReset.php#L85-L107 |
11,523 | philiplb/CRUDlexUser | src/CRUDlex/PasswordReset.php | PasswordReset.resetPassword | public function resetPassword($token, $newPassword)
{
$passwordReset = $this->getValidPasswordReset($token);
if ($passwordReset === null) {
return false;
}
$user = $passwordReset->get('user');
$user = $this->userData->get($user['id']);
$user->set('password... | php | public function resetPassword($token, $newPassword)
{
$passwordReset = $this->getValidPasswordReset($token);
if ($passwordReset === null) {
return false;
}
$user = $passwordReset->get('user');
$user = $this->userData->get($user['id']);
$user->set('password... | [
"public",
"function",
"resetPassword",
"(",
"$",
"token",
",",
"$",
"newPassword",
")",
"{",
"$",
"passwordReset",
"=",
"$",
"this",
"->",
"getValidPasswordReset",
"(",
"$",
"token",
")",
";",
"if",
"(",
"$",
"passwordReset",
"===",
"null",
")",
"{",
"re... | Resets the password of an user belonging to the given password reset
token.
@param string $token
the password reset token
@param string $newPassword
the new password
@return boolean
true on success, false on failure with one of this reasons:
- no or more than one password reset request found for this token
- the pass... | [
"Resets",
"the",
"password",
"of",
"an",
"user",
"belonging",
"to",
"the",
"given",
"password",
"reset",
"token",
"."
] | 011c70106786ded665200a1b6b61234800c2b802 | https://github.com/philiplb/CRUDlexUser/blob/011c70106786ded665200a1b6b61234800c2b802/src/CRUDlex/PasswordReset.php#L124-L140 |
11,524 | SU-SWS/stanford-api-auth | src/Auth.php | Auth.authenticate | public function authenticate($username, $password) {
// Get some things.
$client = $this->getClient();
$parameters = $this->getAuthParams();
$endpoint = $this->getEndpoint();
$code = NULL;
$response = $client->get($endpoint,
['query' => $parameters, 'auth' => [$username, $password]]
... | php | public function authenticate($username, $password) {
// Get some things.
$client = $this->getClient();
$parameters = $this->getAuthParams();
$endpoint = $this->getEndpoint();
$code = NULL;
$response = $client->get($endpoint,
['query' => $parameters, 'auth' => [$username, $password]]
... | [
"public",
"function",
"authenticate",
"(",
"$",
"username",
",",
"$",
"password",
")",
"{",
"// Get some things.",
"$",
"client",
"=",
"$",
"this",
"->",
"getClient",
"(",
")",
";",
"$",
"parameters",
"=",
"$",
"this",
"->",
"getAuthParams",
"(",
")",
";... | Authenticates a username and password with the CAP API.
Response returns an API token and expires integer. The API token can then
be used in future API calls to protected parts of the API.
@return bool
True for success and false for some issue. | [
"Authenticates",
"a",
"username",
"and",
"password",
"with",
"the",
"CAP",
"API",
"."
] | 633d4226ae2ada22717d938dbfb28dad7d630690 | https://github.com/SU-SWS/stanford-api-auth/blob/633d4226ae2ada22717d938dbfb28dad7d630690/src/Auth.php#L170-L199 |
11,525 | jivoo/core | src/Store/Document.php | Document.toDocument | public function toDocument()
{
$doc = new Document();
$doc->data = $this->data;
$doc->defaults = $this->defaultData;
return $doc;
} | php | public function toDocument()
{
$doc = new Document();
$doc->data = $this->data;
$doc->defaults = $this->defaultData;
return $doc;
} | [
"public",
"function",
"toDocument",
"(",
")",
"{",
"$",
"doc",
"=",
"new",
"Document",
"(",
")",
";",
"$",
"doc",
"->",
"data",
"=",
"$",
"this",
"->",
"data",
";",
"$",
"doc",
"->",
"defaults",
"=",
"$",
"this",
"->",
"defaultData",
";",
"return",... | Convert to document.
@return Document Document. | [
"Convert",
"to",
"document",
"."
] | 4ef3445068f0ff9c0a6512cb741831a847013b76 | https://github.com/jivoo/core/blob/4ef3445068f0ff9c0a6512cb741831a847013b76/src/Store/Document.php#L154-L160 |
11,526 | jivoo/core | src/Store/Document.php | Document.getSubset | public function getSubset($key)
{
if (isset($this->emptySubset)) {
$this->createTrueSubset();
}
$doc = $this->createEmpty();
if (! isset($this->data[$key]) or ! is_array($this->data[$key])) {
$doc->data = null;
$doc->emptySubset = $key;
} e... | php | public function getSubset($key)
{
if (isset($this->emptySubset)) {
$this->createTrueSubset();
}
$doc = $this->createEmpty();
if (! isset($this->data[$key]) or ! is_array($this->data[$key])) {
$doc->data = null;
$doc->emptySubset = $key;
} e... | [
"public",
"function",
"getSubset",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"emptySubset",
")",
")",
"{",
"$",
"this",
"->",
"createTrueSubset",
"(",
")",
";",
"}",
"$",
"doc",
"=",
"$",
"this",
"->",
"createEmpty",
"(... | Get a subdocument.
@param string $key
Key.
@return Document A subset. | [
"Get",
"a",
"subdocument",
"."
] | 4ef3445068f0ff9c0a6512cb741831a847013b76 | https://github.com/jivoo/core/blob/4ef3445068f0ff9c0a6512cb741831a847013b76/src/Store/Document.php#L169-L190 |
11,527 | jivoo/core | src/Store/Document.php | Document.createTrueSubset | protected function createTrueSubset()
{
$this->parent->data[$this->emptySubset] = array();
$this->data = & $this->parent->data[$this->emptySubset];
$this->emptySubset = null;
} | php | protected function createTrueSubset()
{
$this->parent->data[$this->emptySubset] = array();
$this->data = & $this->parent->data[$this->emptySubset];
$this->emptySubset = null;
} | [
"protected",
"function",
"createTrueSubset",
"(",
")",
"{",
"$",
"this",
"->",
"parent",
"->",
"data",
"[",
"$",
"this",
"->",
"emptySubset",
"]",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"data",
"=",
"&",
"$",
"this",
"->",
"parent",
"->",
... | Create actual subset. | [
"Create",
"actual",
"subset",
"."
] | 4ef3445068f0ff9c0a6512cb741831a847013b76 | https://github.com/jivoo/core/blob/4ef3445068f0ff9c0a6512cb741831a847013b76/src/Store/Document.php#L205-L210 |
11,528 | jivoo/core | src/Store/Document.php | Document.set | public function set($key, $value)
{
Assume::that(is_scalar($key));
if (isset($this->emptySubset)) {
$this->createTrueSubset();
}
$oldValue = null;
if (isset($this->data[$key])) {
$oldValue = $this->data[$key];
}
if (isset($key) and isse... | php | public function set($key, $value)
{
Assume::that(is_scalar($key));
if (isset($this->emptySubset)) {
$this->createTrueSubset();
}
$oldValue = null;
if (isset($this->data[$key])) {
$oldValue = $this->data[$key];
}
if (isset($key) and isse... | [
"public",
"function",
"set",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"Assume",
"::",
"that",
"(",
"is_scalar",
"(",
"$",
"key",
")",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"emptySubset",
")",
")",
"{",
"$",
"this",
"->",
"c... | Update a document key.
@param string $key
The document key to access.
@param mixed $value
The value to associate with the key. | [
"Update",
"a",
"document",
"key",
"."
] | 4ef3445068f0ff9c0a6512cb741831a847013b76 | https://github.com/jivoo/core/blob/4ef3445068f0ff9c0a6512cb741831a847013b76/src/Store/Document.php#L220-L239 |
11,529 | jivoo/core | src/Store/Document.php | Document.setRecursive | public function setRecursive($key, $value)
{
if (! is_array($value)) {
$this->set($key, $value);
return;
}
$subset = $this->getSubset($key);
$array = $value;
foreach ($array as $key => $value) {
$subset->setRecursive($key, $value);
... | php | public function setRecursive($key, $value)
{
if (! is_array($value)) {
$this->set($key, $value);
return;
}
$subset = $this->getSubset($key);
$array = $value;
foreach ($array as $key => $value) {
$subset->setRecursive($key, $value);
... | [
"public",
"function",
"setRecursive",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"$",
"this",
"->",
"set",
"(",
"$",
"key",
",",
"$",
"value",
")",
";",
"return",
";",
"}",
"$",
... | Update a subdocument recursively.
@param string $key
The document key to access.
@param mixed $value
The value or subarray to associate with the key. | [
"Update",
"a",
"subdocument",
"recursively",
"."
] | 4ef3445068f0ff9c0a6512cb741831a847013b76 | https://github.com/jivoo/core/blob/4ef3445068f0ff9c0a6512cb741831a847013b76/src/Store/Document.php#L257-L268 |
11,530 | jivoo/core | src/Store/Document.php | Document.get | public function get($key, $default = null)
{
if (isset($this->data[$key])) {
$value = $this->data[$key];
} else {
if (isset($default)) {
$this->setDefault($key, $default);
} elseif (isset($this->defaultData[$key])) {
$default = $thi... | php | public function get($key, $default = null)
{
if (isset($this->data[$key])) {
$value = $this->data[$key];
} else {
if (isset($default)) {
$this->setDefault($key, $default);
} elseif (isset($this->defaultData[$key])) {
$default = $thi... | [
"public",
"function",
"get",
"(",
"$",
"key",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"data",
"[",
"$",
"key",
"]",
")",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"data",
"[",
"$",
"key",
... | Retreive value of a document key.
Returns the default value if
the key is not found or if the type of the found value does not match the
type of the defuault value.
@param string $key
Document key.
@param mixed $default
Optional default value.
@return mixed Content of document key. | [
"Retreive",
"value",
"of",
"a",
"document",
"key",
".",
"Returns",
"the",
"default",
"value",
"if",
"the",
"key",
"is",
"not",
"found",
"or",
"if",
"the",
"type",
"of",
"the",
"found",
"value",
"does",
"not",
"match",
"the",
"type",
"of",
"the",
"defua... | 4ef3445068f0ff9c0a6512cb741831a847013b76 | https://github.com/jivoo/core/blob/4ef3445068f0ff9c0a6512cb741831a847013b76/src/Store/Document.php#L322-L341 |
11,531 | jivoo/core | src/Store/Document.php | Document.autoVar | public function autoVar($default = null)
{
$backtrace = debug_backtrace();
$name = '';
if (isset($backtrace[1]['class'])) {
$name = $backtrace[1]['class'] . '::';
}
$name .= $backtrace[1]['function'];
$name .= '(' . $backtrace[1]['line'] . ')';
$va... | php | public function autoVar($default = null)
{
$backtrace = debug_backtrace();
$name = '';
if (isset($backtrace[1]['class'])) {
$name = $backtrace[1]['class'] . '::';
}
$name .= $backtrace[1]['function'];
$name .= '(' . $backtrace[1]['line'] . ')';
$va... | [
"public",
"function",
"autoVar",
"(",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"backtrace",
"=",
"debug_backtrace",
"(",
")",
";",
"$",
"name",
"=",
"''",
";",
"if",
"(",
"isset",
"(",
"$",
"backtrace",
"[",
"1",
"]",
"[",
"'class'",
"]",
")",
... | Create a persistent variable using this document.
@param mixed $default
Default value.
@return Statevar State variable. | [
"Create",
"a",
"persistent",
"variable",
"using",
"this",
"document",
"."
] | 4ef3445068f0ff9c0a6512cb741831a847013b76 | https://github.com/jivoo/core/blob/4ef3445068f0ff9c0a6512cb741831a847013b76/src/Store/Document.php#L362-L376 |
11,532 | rafflesargentina/l5-resource-controller | src/Traits/WorksWithRelations.php | WorksWithRelations.updateOrCreateRelations | public function updateOrCreateRelations(Request $request, Model $model)
{
$parameterBag = $request->request;
foreach ($parameterBag->all() as $name => $attributes) {
if (is_array($request->{$name})) {
$this->_checkRelationExists($model, $name);
$relation ... | php | public function updateOrCreateRelations(Request $request, Model $model)
{
$parameterBag = $request->request;
foreach ($parameterBag->all() as $name => $attributes) {
if (is_array($request->{$name})) {
$this->_checkRelationExists($model, $name);
$relation ... | [
"public",
"function",
"updateOrCreateRelations",
"(",
"Request",
"$",
"request",
",",
"Model",
"$",
"model",
")",
"{",
"$",
"parameterBag",
"=",
"$",
"request",
"->",
"request",
";",
"foreach",
"(",
"$",
"parameterBag",
"->",
"all",
"(",
")",
"as",
"$",
... | Update or create relations handling array type request data.
@param Request $request The Request object.
@param Model $model The eloquent model.
@return void | [
"Update",
"or",
"create",
"relations",
"handling",
"array",
"type",
"request",
"data",
"."
] | 5ee5de4803a26d0592dd6f5db77aec40c1a56c09 | https://github.com/rafflesargentina/l5-resource-controller/blob/5ee5de4803a26d0592dd6f5db77aec40c1a56c09/src/Traits/WorksWithRelations.php#L24-L35 |
11,533 | rafflesargentina/l5-resource-controller | src/Traits/WorksWithRelations.php | WorksWithRelations.handleRelations | protected function handleRelations(array $fillable, Model $model, Relation $relation)
{
switch (true) {
case $relation instanceof HasOne || $relation instanceof MorphOne:
$this->updateOrCreateHasOne($fillable, $model, $relation);
break;
case $relation instanceof Belon... | php | protected function handleRelations(array $fillable, Model $model, Relation $relation)
{
switch (true) {
case $relation instanceof HasOne || $relation instanceof MorphOne:
$this->updateOrCreateHasOne($fillable, $model, $relation);
break;
case $relation instanceof Belon... | [
"protected",
"function",
"handleRelations",
"(",
"array",
"$",
"fillable",
",",
"Model",
"$",
"model",
",",
"Relation",
"$",
"relation",
")",
"{",
"switch",
"(",
"true",
")",
"{",
"case",
"$",
"relation",
"instanceof",
"HasOne",
"||",
"$",
"relation",
"ins... | Handle relations.
@param array $fillable The relation fillable.
@param Model $model The eloquent model.
@param Relation $relation The eloquent relation.
@return void | [
"Handle",
"relations",
"."
] | 5ee5de4803a26d0592dd6f5db77aec40c1a56c09 | https://github.com/rafflesargentina/l5-resource-controller/blob/5ee5de4803a26d0592dd6f5db77aec40c1a56c09/src/Traits/WorksWithRelations.php#L46-L62 |
11,534 | rafflesargentina/l5-resource-controller | src/Traits/WorksWithRelations.php | WorksWithRelations.updateOrCreateHasOne | protected function updateOrCreateHasOne(array $fillable, Model $model, Relation $relation)
{
$id = '';
if (array_key_exists('id', $fillable)) {
$id = $fillable['id'];
}
if (array_except($fillable, ['id'])) {
if (property_exists($this, 'pruneHasOne') && $this... | php | protected function updateOrCreateHasOne(array $fillable, Model $model, Relation $relation)
{
$id = '';
if (array_key_exists('id', $fillable)) {
$id = $fillable['id'];
}
if (array_except($fillable, ['id'])) {
if (property_exists($this, 'pruneHasOne') && $this... | [
"protected",
"function",
"updateOrCreateHasOne",
"(",
"array",
"$",
"fillable",
",",
"Model",
"$",
"model",
",",
"Relation",
"$",
"relation",
")",
"{",
"$",
"id",
"=",
"''",
";",
"if",
"(",
"array_key_exists",
"(",
"'id'",
",",
"$",
"fillable",
")",
")",... | HasOne relation updateOrCreate logic.
@param array $fillable The relation fillable.
@param Model $model The eloquent model.
@param Relation $relation The eloquent relation.
@return Model | null | [
"HasOne",
"relation",
"updateOrCreate",
"logic",
"."
] | 5ee5de4803a26d0592dd6f5db77aec40c1a56c09 | https://github.com/rafflesargentina/l5-resource-controller/blob/5ee5de4803a26d0592dd6f5db77aec40c1a56c09/src/Traits/WorksWithRelations.php#L73-L90 |
11,535 | rafflesargentina/l5-resource-controller | src/Traits/WorksWithRelations.php | WorksWithRelations.updateOrCreateBelongsToOne | protected function updateOrCreateBelongsToOne(array $fillable, Model $model, Relation $relation)
{
$related = $relation->getRelated();
if (array_except($fillable, ['id'])) {
if (!$relation->first()) {
$record = $relation->associate($related->create($fillable));
... | php | protected function updateOrCreateBelongsToOne(array $fillable, Model $model, Relation $relation)
{
$related = $relation->getRelated();
if (array_except($fillable, ['id'])) {
if (!$relation->first()) {
$record = $relation->associate($related->create($fillable));
... | [
"protected",
"function",
"updateOrCreateBelongsToOne",
"(",
"array",
"$",
"fillable",
",",
"Model",
"$",
"model",
",",
"Relation",
"$",
"relation",
")",
"{",
"$",
"related",
"=",
"$",
"relation",
"->",
"getRelated",
"(",
")",
";",
"if",
"(",
"array_except",
... | BelongsToOne relation updateOrCreate logic.
@param array $fillable The relation fillable.
@param Model $model The eloquent model.
@param Relation $relation The eloquent relation.
@return Model | [
"BelongsToOne",
"relation",
"updateOrCreate",
"logic",
"."
] | 5ee5de4803a26d0592dd6f5db77aec40c1a56c09 | https://github.com/rafflesargentina/l5-resource-controller/blob/5ee5de4803a26d0592dd6f5db77aec40c1a56c09/src/Traits/WorksWithRelations.php#L101-L117 |
11,536 | rafflesargentina/l5-resource-controller | src/Traits/WorksWithRelations.php | WorksWithRelations.updateOrCreateHasMany | protected function updateOrCreateHasMany(array $fillable, Model $model, Relation $relation)
{
$keys = [];
$id = '';
$records = [];
foreach ($fillable as $fields) {
if (is_array($fields)) {
if (array_key_exists('id', $fields)) {
$id = $... | php | protected function updateOrCreateHasMany(array $fillable, Model $model, Relation $relation)
{
$keys = [];
$id = '';
$records = [];
foreach ($fillable as $fields) {
if (is_array($fields)) {
if (array_key_exists('id', $fields)) {
$id = $... | [
"protected",
"function",
"updateOrCreateHasMany",
"(",
"array",
"$",
"fillable",
",",
"Model",
"$",
"model",
",",
"Relation",
"$",
"relation",
")",
"{",
"$",
"keys",
"=",
"[",
"]",
";",
"$",
"id",
"=",
"''",
";",
"$",
"records",
"=",
"[",
"]",
";",
... | HasMany relation updateOrCreate logic.
@param array $fillable The relation fillable.
@param Model $model The eloquent model.
@param Relation $relation The eloquent relation.
@return array | [
"HasMany",
"relation",
"updateOrCreate",
"logic",
"."
] | 5ee5de4803a26d0592dd6f5db77aec40c1a56c09 | https://github.com/rafflesargentina/l5-resource-controller/blob/5ee5de4803a26d0592dd6f5db77aec40c1a56c09/src/Traits/WorksWithRelations.php#L128-L162 |
11,537 | rafflesargentina/l5-resource-controller | src/Traits/WorksWithRelations.php | WorksWithRelations.updateOrCreateBelongsToMany | protected function updateOrCreateBelongsToMany(array $fillable, Model $model, Relation $relation)
{
$keys = [];
$records = [];
$related = $relation->getRelated();
foreach ($fillable as $fields) {
if (array_key_exists('id', $fields)) {
$id = $fields['id']... | php | protected function updateOrCreateBelongsToMany(array $fillable, Model $model, Relation $relation)
{
$keys = [];
$records = [];
$related = $relation->getRelated();
foreach ($fillable as $fields) {
if (array_key_exists('id', $fields)) {
$id = $fields['id']... | [
"protected",
"function",
"updateOrCreateBelongsToMany",
"(",
"array",
"$",
"fillable",
",",
"Model",
"$",
"model",
",",
"Relation",
"$",
"relation",
")",
"{",
"$",
"keys",
"=",
"[",
"]",
";",
"$",
"records",
"=",
"[",
"]",
";",
"$",
"related",
"=",
"$"... | BelongsToMany relation updateOrCreate logic.
@param array $fillable The relation fillable.
@param Model $model The eloquent model.
@param Relation $relation The eloquent relation.
@return array | [
"BelongsToMany",
"relation",
"updateOrCreate",
"logic",
"."
] | 5ee5de4803a26d0592dd6f5db77aec40c1a56c09 | https://github.com/rafflesargentina/l5-resource-controller/blob/5ee5de4803a26d0592dd6f5db77aec40c1a56c09/src/Traits/WorksWithRelations.php#L173-L198 |
11,538 | rafflesargentina/l5-resource-controller | src/Traits/WorksWithRelations.php | WorksWithRelations._checkRelationExists | private function _checkRelationExists(Model $model, string $relationName)
{
if (!method_exists($model, $relationName) || !$model->{$relationName}() instanceof Relation) {
if (Lang::has('resource-controller.data2relationinexistent')) {
$message = trans('resource-controller.data2re... | php | private function _checkRelationExists(Model $model, string $relationName)
{
if (!method_exists($model, $relationName) || !$model->{$relationName}() instanceof Relation) {
if (Lang::has('resource-controller.data2relationinexistent')) {
$message = trans('resource-controller.data2re... | [
"private",
"function",
"_checkRelationExists",
"(",
"Model",
"$",
"model",
",",
"string",
"$",
"relationName",
")",
"{",
"if",
"(",
"!",
"method_exists",
"(",
"$",
"model",
",",
"$",
"relationName",
")",
"||",
"!",
"$",
"model",
"->",
"{",
"$",
"relation... | Throw an exception if array type request data is not named after an existent Eloquent relation.
@param Model $model The eloquent model.
@param string $relationName The eloquent relation name.
@throws MassAssignmentException
@return void | [
"Throw",
"an",
"exception",
"if",
"array",
"type",
"request",
"data",
"is",
"not",
"named",
"after",
"an",
"existent",
"Eloquent",
"relation",
"."
] | 5ee5de4803a26d0592dd6f5db77aec40c1a56c09 | https://github.com/rafflesargentina/l5-resource-controller/blob/5ee5de4803a26d0592dd6f5db77aec40c1a56c09/src/Traits/WorksWithRelations.php#L210-L221 |
11,539 | martinhej/robocloud | src/robocloud/Consumer/Kinesis/ConsumerRecovery.php | ConsumerRecovery.getRecoveryFileContent | protected function getRecoveryFileContent(): array
{
$content = file_get_contents($this->consumerRecoveryFile);
if (!empty($content)) {
return json_decode($content, TRUE);
} elseif ($content === FALSE) {
throw new ConsumerRecoveryException('Error reading Consumer reco... | php | protected function getRecoveryFileContent(): array
{
$content = file_get_contents($this->consumerRecoveryFile);
if (!empty($content)) {
return json_decode($content, TRUE);
} elseif ($content === FALSE) {
throw new ConsumerRecoveryException('Error reading Consumer reco... | [
"protected",
"function",
"getRecoveryFileContent",
"(",
")",
":",
"array",
"{",
"$",
"content",
"=",
"file_get_contents",
"(",
"$",
"this",
"->",
"consumerRecoveryFile",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"content",
")",
")",
"{",
"return",
"json... | Gets the recovery file contents.
@return array
The recovery file content as array.
@throws \robocloud\Exception\ConsumerRecoveryException
On the recovery file read error. | [
"Gets",
"the",
"recovery",
"file",
"contents",
"."
] | 108dfbc2b6e9aca2a87795c3e7518cbf1cf5d229 | https://github.com/martinhej/robocloud/blob/108dfbc2b6e9aca2a87795c3e7518cbf1cf5d229/src/robocloud/Consumer/Kinesis/ConsumerRecovery.php#L100-L110 |
11,540 | jannisfink/yarf | src/request/Request.php | Request.get | public function get($key) {
$get = $this->getParam($key, $this->get);
if ($get !== null) {
return $get;
}
$post = $this->getParam($key, $this->post);
if ($post !== null) {
return $post;
}
return $this->getParam($key, $this->files);
} | php | public function get($key) {
$get = $this->getParam($key, $this->get);
if ($get !== null) {
return $get;
}
$post = $this->getParam($key, $this->post);
if ($post !== null) {
return $post;
}
return $this->getParam($key, $this->files);
} | [
"public",
"function",
"get",
"(",
"$",
"key",
")",
"{",
"$",
"get",
"=",
"$",
"this",
"->",
"getParam",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"get",
")",
";",
"if",
"(",
"$",
"get",
"!==",
"null",
")",
"{",
"return",
"$",
"get",
";",
"}",
... | Returns a parameter given via url variables or post variables.
If a key exists both in url an in post variables, the url variable
will be returned.
@param string $key name of the parameter
@return string|null the parameter value, {@code null} if the key does not exist | [
"Returns",
"a",
"parameter",
"given",
"via",
"url",
"variables",
"or",
"post",
"variables",
".",
"If",
"a",
"key",
"exists",
"both",
"in",
"url",
"an",
"in",
"post",
"variables",
"the",
"url",
"variable",
"will",
"be",
"returned",
"."
] | 91237dc0f3b724abaaba490f5171f181a92e939f | https://github.com/jannisfink/yarf/blob/91237dc0f3b724abaaba490f5171f181a92e939f/src/request/Request.php#L78-L88 |
11,541 | Rockbeat-Sky/framework | src/core/Output.php | Output.setContentType | public function setContentType($mimes){
if (strpos($mimes, '/') === FALSE)
{
$extension = ltrim($mimes, '.');
// Is this extension supported?
if (isset($this->mimes[$extension]))
{
$mime_type =& $this->mimes[$extension];
if (is_array($mime_type))
{
$mime_type = current($mime_type);
... | php | public function setContentType($mimes){
if (strpos($mimes, '/') === FALSE)
{
$extension = ltrim($mimes, '.');
// Is this extension supported?
if (isset($this->mimes[$extension]))
{
$mime_type =& $this->mimes[$extension];
if (is_array($mime_type))
{
$mime_type = current($mime_type);
... | [
"public",
"function",
"setContentType",
"(",
"$",
"mimes",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"mimes",
",",
"'/'",
")",
"===",
"FALSE",
")",
"{",
"$",
"extension",
"=",
"ltrim",
"(",
"$",
"mimes",
",",
"'.'",
")",
";",
"// Is this extension suppo... | set Content Type
@param string (Mimes Type, list mimes type at config/Mimes.php)
@return void | [
"set",
"Content",
"Type"
] | e8ffd04f2fdc27a62b185b342f32bf58899ceda4 | https://github.com/Rockbeat-Sky/framework/blob/e8ffd04f2fdc27a62b185b342f32bf58899ceda4/src/core/Output.php#L79-L101 |
11,542 | RalfEggert/travello-view-helper | src/ConfigProvider.php | ConfigProvider.getViewHelperConfig | public function getViewHelperConfig()
{
return [
'aliases' => [
'h1' => H1::class,
'date' => Date::class,
'bootstrapForm' => BootstrapForm::class,
'bootstrapMenu' => Boot... | php | public function getViewHelperConfig()
{
return [
'aliases' => [
'h1' => H1::class,
'date' => Date::class,
'bootstrapForm' => BootstrapForm::class,
'bootstrapMenu' => Boot... | [
"public",
"function",
"getViewHelperConfig",
"(",
")",
"{",
"return",
"[",
"'aliases'",
"=>",
"[",
"'h1'",
"=>",
"H1",
"::",
"class",
",",
"'date'",
"=>",
"Date",
"::",
"class",
",",
"'bootstrapForm'",
"=>",
"BootstrapForm",
"::",
"class",
",",
"'bootstrapMe... | Get view helper configuration
@return array | [
"Get",
"view",
"helper",
"configuration"
] | 631a44bed767a6e9a1d45ff3956dd661f67e63a3 | https://github.com/RalfEggert/travello-view-helper/blob/631a44bed767a6e9a1d45ff3956dd661f67e63a3/src/ConfigProvider.php#L47-L66 |
11,543 | tux-rampage/rampage-php | library/rampage/core/Logger.php | Logger.log | public function log($priority, $message, $extra = array())
{
if (!is_int($priority) || ($priority<0) || ($priority>=count($this->priorities))) {
throw new Exception\InvalidArgumentException(sprintf(
'$priority must be an integer > 0 and < %d; received %s',
count($... | php | public function log($priority, $message, $extra = array())
{
if (!is_int($priority) || ($priority<0) || ($priority>=count($this->priorities))) {
throw new Exception\InvalidArgumentException(sprintf(
'$priority must be an integer > 0 and < %d; received %s',
count($... | [
"public",
"function",
"log",
"(",
"$",
"priority",
",",
"$",
"message",
",",
"$",
"extra",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"is_int",
"(",
"$",
"priority",
")",
"||",
"(",
"$",
"priority",
"<",
"0",
")",
"||",
"(",
"$",
"priori... | Add a message as a log entry
In contrast of the zend implementation this does NOT cast the message to a
string, nor does it require a stringifyable object.
Leaving handling the message to the log writer makes much more sense then
the current, shitty implementation.
@param int $priority
@param mixed $message
@param... | [
"Add",
"a",
"message",
"as",
"a",
"log",
"entry"
] | 1c679b04a6d477e2f8fdb86135e1d9f0c128b1cf | https://github.com/tux-rampage/rampage-php/blob/1c679b04a6d477e2f8fdb86135e1d9f0c128b1cf/library/rampage/core/Logger.php#L60-L99 |
11,544 | webriq/core | module/Core/src/Grid/Core/Model/SubDomain/Rpc.php | Rpc.isSubdomainAvailable | public function isSubdomainAvailable( $subdomain, $params = array() )
{
$params = (object) $params;
return ! $this->getMapper()
->isSubdomainExists(
$subdomain,
empty( $params->id ) ? null : $params->id
... | php | public function isSubdomainAvailable( $subdomain, $params = array() )
{
$params = (object) $params;
return ! $this->getMapper()
->isSubdomainExists(
$subdomain,
empty( $params->id ) ? null : $params->id
... | [
"public",
"function",
"isSubdomainAvailable",
"(",
"$",
"subdomain",
",",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"$",
"params",
"=",
"(",
"object",
")",
"$",
"params",
";",
"return",
"!",
"$",
"this",
"->",
"getMapper",
"(",
")",
"->",
"isS... | Return true, if subdomain is available
@param string $subdomain
@param array|object $params
@return bool | [
"Return",
"true",
"if",
"subdomain",
"is",
"available"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Core/src/Grid/Core/Model/SubDomain/Rpc.php#L39-L48 |
11,545 | agentmedia/phine-forms | src/Forms/Modules/Frontend/Select.php | Select.Init | protected function Init()
{
$select = ContentSelect::Schema()->ByContent($this->Content());
$disableValidation = $select->GetDisableFrontendValidation();
$this->label = $select->GetLabel();
$this->name = $select->GetName();
$this->required = $disableValidation ? false : $sele... | php | protected function Init()
{
$select = ContentSelect::Schema()->ByContent($this->Content());
$disableValidation = $select->GetDisableFrontendValidation();
$this->label = $select->GetLabel();
$this->name = $select->GetName();
$this->required = $disableValidation ? false : $sele... | [
"protected",
"function",
"Init",
"(",
")",
"{",
"$",
"select",
"=",
"ContentSelect",
"::",
"Schema",
"(",
")",
"->",
"ByContent",
"(",
"$",
"this",
"->",
"Content",
"(",
")",
")",
";",
"$",
"disableValidation",
"=",
"$",
"select",
"->",
"GetDisableFronte... | Initializes the select content
@return boolean Returns false if processing shall continue | [
"Initializes",
"the",
"select",
"content"
] | cd7a92ea443756bef5885a9e8f59ad6b8d2771fc | https://github.com/agentmedia/phine-forms/blob/cd7a92ea443756bef5885a9e8f59ad6b8d2771fc/src/Forms/Modules/Frontend/Select.php#L52-L65 |
11,546 | agentmedia/phine-forms | src/Forms/Modules/Frontend/Select.php | Select.BackendName | public function BackendName()
{
$name = parent::BackendName();
if (!$this->Content())
{
return $name;
}
$select = ContentSelect::Schema()->ByContent($this->Content());
$name .= ' : ' . $select->GetName();
return $name;
} | php | public function BackendName()
{
$name = parent::BackendName();
if (!$this->Content())
{
return $name;
}
$select = ContentSelect::Schema()->ByContent($this->Content());
$name .= ' : ' . $select->GetName();
return $name;
} | [
"public",
"function",
"BackendName",
"(",
")",
"{",
"$",
"name",
"=",
"parent",
"::",
"BackendName",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"Content",
"(",
")",
")",
"{",
"return",
"$",
"name",
";",
"}",
"$",
"select",
"=",
"ContentSelec... | Gets the name for backend views
@return string Returns the backend name | [
"Gets",
"the",
"name",
"for",
"backend",
"views"
] | cd7a92ea443756bef5885a9e8f59ad6b8d2771fc | https://github.com/agentmedia/phine-forms/blob/cd7a92ea443756bef5885a9e8f59ad6b8d2771fc/src/Forms/Modules/Frontend/Select.php#L98-L108 |
11,547 | xmmedia/XMSecurityBundle | Listener/AuthenticationLoggerListener.php | AuthenticationLoggerListener.logSuccess | public function logSuccess()
{
/** @var XM\SecurityBundle\Entity\User $user */
$user = $this->tokenStorage->getToken()->getUser();
if ($user instanceof \XM\SecurityBundle\Entity\User) {
$user->incrementLoginCount();
$this->userManager->updateUser($user);
... | php | public function logSuccess()
{
/** @var XM\SecurityBundle\Entity\User $user */
$user = $this->tokenStorage->getToken()->getUser();
if ($user instanceof \XM\SecurityBundle\Entity\User) {
$user->incrementLoginCount();
$this->userManager->updateUser($user);
... | [
"public",
"function",
"logSuccess",
"(",
")",
"{",
"/** @var XM\\SecurityBundle\\Entity\\User $user */",
"$",
"user",
"=",
"$",
"this",
"->",
"tokenStorage",
"->",
"getToken",
"(",
")",
"->",
"getUser",
"(",
")",
";",
"if",
"(",
"$",
"user",
"instanceof",
"\\"... | Logs the successful login.
Event will be passed but we don't use it or care what it is. | [
"Logs",
"the",
"successful",
"login",
".",
"Event",
"will",
"be",
"passed",
"but",
"we",
"don",
"t",
"use",
"it",
"or",
"care",
"what",
"it",
"is",
"."
] | ee71a1bb4fe038e5a08e44f73247c4e03631a840 | https://github.com/xmmedia/XMSecurityBundle/blob/ee71a1bb4fe038e5a08e44f73247c4e03631a840/Listener/AuthenticationLoggerListener.php#L68-L80 |
11,548 | xmmedia/XMSecurityBundle | Listener/AuthenticationLoggerListener.php | AuthenticationLoggerListener.logFailure | public function logFailure(AuthenticationFailureEvent $event)
{
$request = $this->requestStack->getCurrentRequest();
$exception = $event->getAuthenticationException()
->getPrevious();
if (null === $exception) {
$exception = $event->getAuthenticationException();
... | php | public function logFailure(AuthenticationFailureEvent $event)
{
$request = $this->requestStack->getCurrentRequest();
$exception = $event->getAuthenticationException()
->getPrevious();
if (null === $exception) {
$exception = $event->getAuthenticationException();
... | [
"public",
"function",
"logFailure",
"(",
"AuthenticationFailureEvent",
"$",
"event",
")",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"requestStack",
"->",
"getCurrentRequest",
"(",
")",
";",
"$",
"exception",
"=",
"$",
"event",
"->",
"getAuthenticationExceptio... | Logs a failed login.
@param AuthenticationFailureEvent $event | [
"Logs",
"a",
"failed",
"login",
"."
] | ee71a1bb4fe038e5a08e44f73247c4e03631a840 | https://github.com/xmmedia/XMSecurityBundle/blob/ee71a1bb4fe038e5a08e44f73247c4e03631a840/Listener/AuthenticationLoggerListener.php#L87-L104 |
11,549 | xmmedia/XMSecurityBundle | Listener/AuthenticationLoggerListener.php | AuthenticationLoggerListener.createAuthLog | protected function createAuthLog()
{
$request = $this->requestStack->getCurrentRequest();
/** @var XM\SecurityBundle\Entity\AuthLog $authLog */
$authLog = new $this->authLogClass();
$authLog->setDatetime(new \DateTimeImmutable());
$authLog->setUserAgent($request->headers->ge... | php | protected function createAuthLog()
{
$request = $this->requestStack->getCurrentRequest();
/** @var XM\SecurityBundle\Entity\AuthLog $authLog */
$authLog = new $this->authLogClass();
$authLog->setDatetime(new \DateTimeImmutable());
$authLog->setUserAgent($request->headers->ge... | [
"protected",
"function",
"createAuthLog",
"(",
")",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"requestStack",
"->",
"getCurrentRequest",
"(",
")",
";",
"/** @var XM\\SecurityBundle\\Entity\\AuthLog $authLog */",
"$",
"authLog",
"=",
"new",
"$",
"this",
"->",
"a... | Creates the auth log entity with the User Agent and client IP.
@return AuthLog | [
"Creates",
"the",
"auth",
"log",
"entity",
"with",
"the",
"User",
"Agent",
"and",
"client",
"IP",
"."
] | ee71a1bb4fe038e5a08e44f73247c4e03631a840 | https://github.com/xmmedia/XMSecurityBundle/blob/ee71a1bb4fe038e5a08e44f73247c4e03631a840/Listener/AuthenticationLoggerListener.php#L111-L122 |
11,550 | xmmedia/XMSecurityBundle | Listener/AuthenticationLoggerListener.php | AuthenticationLoggerListener.addLogSuccess | protected function addLogSuccess(UserInterface $user)
{
$this->userManager->updateUser($user);
$authLog = $this->createAuthLog();
$authLog->setSuccess(true);
$authLog->setUser($user);
$authLog->setUsername($user->getUsername());
$this->em->persist($authLog);
... | php | protected function addLogSuccess(UserInterface $user)
{
$this->userManager->updateUser($user);
$authLog = $this->createAuthLog();
$authLog->setSuccess(true);
$authLog->setUser($user);
$authLog->setUsername($user->getUsername());
$this->em->persist($authLog);
... | [
"protected",
"function",
"addLogSuccess",
"(",
"UserInterface",
"$",
"user",
")",
"{",
"$",
"this",
"->",
"userManager",
"->",
"updateUser",
"(",
"$",
"user",
")",
";",
"$",
"authLog",
"=",
"$",
"this",
"->",
"createAuthLog",
"(",
")",
";",
"$",
"authLog... | Add successful log.
@param UserInterface $user | [
"Add",
"successful",
"log",
"."
] | ee71a1bb4fe038e5a08e44f73247c4e03631a840 | https://github.com/xmmedia/XMSecurityBundle/blob/ee71a1bb4fe038e5a08e44f73247c4e03631a840/Listener/AuthenticationLoggerListener.php#L129-L140 |
11,551 | konservs/brilliant.framework | libraries/Users/Social/google.php | BSocialAdapterGoogle.getBirthday | public function getBirthday(){
if(isset($this->_userInfo['birthday'])) {
$this->_userInfo['birthday'] = str_replace('0000', date('Y'), $this->_userInfo['birthday']);
$result = date('d.m.Y', strtotime($this->_userInfo['birthday']));
}
else {
$result = null;
}
return $result;
} | php | public function getBirthday(){
if(isset($this->_userInfo['birthday'])) {
$this->_userInfo['birthday'] = str_replace('0000', date('Y'), $this->_userInfo['birthday']);
$result = date('d.m.Y', strtotime($this->_userInfo['birthday']));
}
else {
$result = null;
}
return $result;
} | [
"public",
"function",
"getBirthday",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_userInfo",
"[",
"'birthday'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"_userInfo",
"[",
"'birthday'",
"]",
"=",
"str_replace",
"(",
"'0000'",
",",
"date",
... | Get user birthday or null if it is not set
@return string|null | [
"Get",
"user",
"birthday",
"or",
"null",
"if",
"it",
"is",
"not",
"set"
] | 95f03f1917f746fee98bea8a906ba0588c87762d | https://github.com/konservs/brilliant.framework/blob/95f03f1917f746fee98bea8a906ba0588c87762d/libraries/Users/Social/google.php#L23-L32 |
11,552 | wudimeicom/WudimeiPHP | Lang.php | Lang.groupAppend | public function groupAppend( $groupName, $groupName2OrArray , $replace = true ){
$this->load($groupName);
$data = [];
if( is_array( $groupName2OrArray ) ){
$data = $groupName2OrArray;
}
else{
$this->load( $groupName2OrArray );
$data = $this->langs[ $groupName2OrArray];
}
if( !empty( $data)){
f... | php | public function groupAppend( $groupName, $groupName2OrArray , $replace = true ){
$this->load($groupName);
$data = [];
if( is_array( $groupName2OrArray ) ){
$data = $groupName2OrArray;
}
else{
$this->load( $groupName2OrArray );
$data = $this->langs[ $groupName2OrArray];
}
if( !empty( $data)){
f... | [
"public",
"function",
"groupAppend",
"(",
"$",
"groupName",
",",
"$",
"groupName2OrArray",
",",
"$",
"replace",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"load",
"(",
"$",
"groupName",
")",
";",
"$",
"data",
"=",
"[",
"]",
";",
"if",
"(",
"is_array",... | append a group or array to the group
@param string $groupName
@param string|array $groupName2OrArray
@param bool $replace | [
"append",
"a",
"group",
"or",
"array",
"to",
"the",
"group"
] | ea7267d449cea06dc057919efa498599bd8ee4b9 | https://github.com/wudimeicom/WudimeiPHP/blob/ea7267d449cea06dc057919efa498599bd8ee4b9/Lang.php#L189-L213 |
11,553 | tomvlk/sweet-orm | src/SweetORM/Structure/Annotation/Column.php | Column.defaultValue | public function defaultValue()
{
if ($this->default === null) {
return null;
}
$default = $this->default;
if (strstr($this->default, '{{') && strstr($this->default, '}}')) {
// Parse special replacements (if we have one)
$default = str_replace("{... | php | public function defaultValue()
{
if ($this->default === null) {
return null;
}
$default = $this->default;
if (strstr($this->default, '{{') && strstr($this->default, '}}')) {
// Parse special replacements (if we have one)
$default = str_replace("{... | [
"public",
"function",
"defaultValue",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"default",
"===",
"null",
")",
"{",
"return",
"null",
";",
"}",
"$",
"default",
"=",
"$",
"this",
"->",
"default",
";",
"if",
"(",
"strstr",
"(",
"$",
"this",
"->",
... | Parse and return default value of column.
@return string|int|null default value | [
"Parse",
"and",
"return",
"default",
"value",
"of",
"column",
"."
] | bca014a9f83be34c87b14d6c8a36156e24577374 | https://github.com/tomvlk/sweet-orm/blob/bca014a9f83be34c87b14d6c8a36156e24577374/src/SweetORM/Structure/Annotation/Column.php#L82-L96 |
11,554 | DerekMarcinyshyn/monashee-backup | src/Monashee/Backup/UploadS3.php | UploadS3.deleteDailyBackups | private function deleteDailyBackups()
{
try {
$date = strtotime('-2 months');
// leave first day of the month
if ((int) date('j', $date) !== 1) {
$this->filesystem->deleteDir(date("Y/m/d", $date));
}
} catch (\Exception $e) {
... | php | private function deleteDailyBackups()
{
try {
$date = strtotime('-2 months');
// leave first day of the month
if ((int) date('j', $date) !== 1) {
$this->filesystem->deleteDir(date("Y/m/d", $date));
}
} catch (\Exception $e) {
... | [
"private",
"function",
"deleteDailyBackups",
"(",
")",
"{",
"try",
"{",
"$",
"date",
"=",
"strtotime",
"(",
"'-2 months'",
")",
";",
"// leave first day of the month",
"if",
"(",
"(",
"int",
")",
"date",
"(",
"'j'",
",",
"$",
"date",
")",
"!==",
"1",
")"... | Delete AWS S3 directory of 2 months ago but keep 1st of the month | [
"Delete",
"AWS",
"S3",
"directory",
"of",
"2",
"months",
"ago",
"but",
"keep",
"1st",
"of",
"the",
"month"
] | 2f96f3ddbbdd1c672e0064bf3b66951f94975158 | https://github.com/DerekMarcinyshyn/monashee-backup/blob/2f96f3ddbbdd1c672e0064bf3b66951f94975158/src/Monashee/Backup/UploadS3.php#L90-L102 |
11,555 | reflex-php/lockdown | src/Reflex/Lockdown/Permissions/Eloquent/Provider.php | Provider.delete | public function delete($key)
{
$permission = $this->findByKey($key);
if (! isset($permission)) {
return true;
}
return $permission->delete();
} | php | public function delete($key)
{
$permission = $this->findByKey($key);
if (! isset($permission)) {
return true;
}
return $permission->delete();
} | [
"public",
"function",
"delete",
"(",
"$",
"key",
")",
"{",
"$",
"permission",
"=",
"$",
"this",
"->",
"findByKey",
"(",
"$",
"key",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"permission",
")",
")",
"{",
"return",
"true",
";",
"}",
"return",
"$... | Delete a permission
@param string $key Lookup key
@return boolean | [
"Delete",
"a",
"permission"
] | 2798e448608eef469f2924d75013deccfd6aca44 | https://github.com/reflex-php/lockdown/blob/2798e448608eef469f2924d75013deccfd6aca44/src/Reflex/Lockdown/Permissions/Eloquent/Provider.php#L70-L78 |
11,556 | reflex-php/lockdown | src/Reflex/Lockdown/Permissions/Eloquent/Provider.php | Provider.findNotInRole | public function findNotInRole(RoleInterface $role)
{
$callback = function ($permission) use ($role) {
return $role->hasnt($permission->key);
};
return array_filter($this->findAll(), $callback);
} | php | public function findNotInRole(RoleInterface $role)
{
$callback = function ($permission) use ($role) {
return $role->hasnt($permission->key);
};
return array_filter($this->findAll(), $callback);
} | [
"public",
"function",
"findNotInRole",
"(",
"RoleInterface",
"$",
"role",
")",
"{",
"$",
"callback",
"=",
"function",
"(",
"$",
"permission",
")",
"use",
"(",
"$",
"role",
")",
"{",
"return",
"$",
"role",
"->",
"hasnt",
"(",
"$",
"permission",
"->",
"k... | Find permission not in a role
@param Reflex\Lockdown\Roles\RoleInterface $role Role instance
@return \Illuminate\Support\Collection | [
"Find",
"permission",
"not",
"in",
"a",
"role"
] | 2798e448608eef469f2924d75013deccfd6aca44 | https://github.com/reflex-php/lockdown/blob/2798e448608eef469f2924d75013deccfd6aca44/src/Reflex/Lockdown/Permissions/Eloquent/Provider.php#L140-L147 |
11,557 | AnonymPHP/Anonym-Library | src/Anonym/Security/TypeHint.php | TypeHint.handle | public static function handle($errLevel, $errMessage)
{
if ($errLevel === E_RECOVERABLE_ERROR) {
if ($explode = explode(' ', $errMessage)) {
if (
$explode[0] === 'Argument' &&
$explode[2] === 'passed' &&
$explode[3] =... | php | public static function handle($errLevel, $errMessage)
{
if ($errLevel === E_RECOVERABLE_ERROR) {
if ($explode = explode(' ', $errMessage)) {
if (
$explode[0] === 'Argument' &&
$explode[2] === 'passed' &&
$explode[3] =... | [
"public",
"static",
"function",
"handle",
"(",
"$",
"errLevel",
",",
"$",
"errMessage",
")",
"{",
"if",
"(",
"$",
"errLevel",
"===",
"E_RECOVERABLE_ERROR",
")",
"{",
"if",
"(",
"$",
"explode",
"=",
"explode",
"(",
"' '",
",",
"$",
"errMessage",
")",
")... | handle the error
@param integer $errLevel the level of error
@param string $errMessage the message of error
@return bool true on success, if failure happen return false | [
"handle",
"the",
"error"
] | c967ad804f84e8fb204593a0959cda2fed5ae075 | https://github.com/AnonymPHP/Anonym-Library/blob/c967ad804f84e8fb204593a0959cda2fed5ae075/src/Anonym/Security/TypeHint.php#L56-L94 |
11,558 | phlexible/phlexible | src/Phlexible/Bundle/SearchBundle/Controller/SearchController.php | SearchController.indexAction | public function indexAction(Request $request)
{
$query = $request->get('query');
$limit = $request->get('limit', 8);
$start = $request->get('start', 0);
$search = $this->get('phlexible_search.search');
$results = $search->search($query);
return new JsonResponse([
... | php | public function indexAction(Request $request)
{
$query = $request->get('query');
$limit = $request->get('limit', 8);
$start = $request->get('start', 0);
$search = $this->get('phlexible_search.search');
$results = $search->search($query);
return new JsonResponse([
... | [
"public",
"function",
"indexAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"query",
"=",
"$",
"request",
"->",
"get",
"(",
"'query'",
")",
";",
"$",
"limit",
"=",
"$",
"request",
"->",
"get",
"(",
"'limit'",
",",
"8",
")",
";",
"$",
"start... | Return search results.
@param Request $request
@return JsonResponse
@Route("", name="search_search")
@Method({"GET", "POST"})
@ApiDoc(
description="Search",
requirements={
{"name"="query", "dataType"="string", "required"=true, "description"="Search query"}
},
filters={
{"name"="limit", "dataType"="integer", "default"... | [
"Return",
"search",
"results",
"."
] | 132f24924c9bb0dbb6c1ea84db0a463f97fa3893 | https://github.com/phlexible/phlexible/blob/132f24924c9bb0dbb6c1ea84db0a463f97fa3893/src/Phlexible/Bundle/SearchBundle/Controller/SearchController.php#L48-L61 |
11,559 | plista/core | src/Plista/Core/Enum.php | Enum.values | public static final function values() {
$calledClass = get_called_class();
// let's check the cache so we don't have to call reflection constantly
if (empty(self::$cachedValues[$calledClass])) {
$class = new \ReflectionClass($calledClass);
self::$cachedValues[$calledClass] = $class->getConstants();
}
... | php | public static final function values() {
$calledClass = get_called_class();
// let's check the cache so we don't have to call reflection constantly
if (empty(self::$cachedValues[$calledClass])) {
$class = new \ReflectionClass($calledClass);
self::$cachedValues[$calledClass] = $class->getConstants();
}
... | [
"public",
"static",
"final",
"function",
"values",
"(",
")",
"{",
"$",
"calledClass",
"=",
"get_called_class",
"(",
")",
";",
"// let's check the cache so we don't have to call reflection constantly",
"if",
"(",
"empty",
"(",
"self",
"::",
"$",
"cachedValues",
"[",
... | Returns a list of values this Enum can take. The keys are the defined constants and the
values are their respective values.
@return array | [
"Returns",
"a",
"list",
"of",
"values",
"this",
"Enum",
"can",
"take",
".",
"The",
"keys",
"are",
"the",
"defined",
"constants",
"and",
"the",
"values",
"are",
"their",
"respective",
"values",
"."
] | 0fa9b97f71ccfc743a4f367744380dc13dddb6d3 | https://github.com/plista/core/blob/0fa9b97f71ccfc743a4f367744380dc13dddb6d3/src/Plista/Core/Enum.php#L112-L122 |
11,560 | plista/core | src/Plista/Core/Enum.php | Enum.equals | public final function equals($e) {
// first we check the case when an Enum is passed in
if (is_object($e)) {
// we require it to be the same type, even when the value may be identical
if (!($e instanceof static)) {
return false;
}
// strict check
return $this->value === $e->value;
}
// if i... | php | public final function equals($e) {
// first we check the case when an Enum is passed in
if (is_object($e)) {
// we require it to be the same type, even when the value may be identical
if (!($e instanceof static)) {
return false;
}
// strict check
return $this->value === $e->value;
}
// if i... | [
"public",
"final",
"function",
"equals",
"(",
"$",
"e",
")",
"{",
"// first we check the case when an Enum is passed in",
"if",
"(",
"is_object",
"(",
"$",
"e",
")",
")",
"{",
"// we require it to be the same type, even when the value may be identical",
"if",
"(",
"!",
... | Helper function to compare an Enum instance to another Enum instance or a scalar value.
@param Enum|string|int $e the value to compare against
@return bool | [
"Helper",
"function",
"to",
"compare",
"an",
"Enum",
"instance",
"to",
"another",
"Enum",
"instance",
"or",
"a",
"scalar",
"value",
"."
] | 0fa9b97f71ccfc743a4f367744380dc13dddb6d3 | https://github.com/plista/core/blob/0fa9b97f71ccfc743a4f367744380dc13dddb6d3/src/Plista/Core/Enum.php#L139-L156 |
11,561 | emaphp/eMapper | lib/eMapper/Fluent/Query/FluentInsert.php | FluentInsert.values | public function values($values) {
if (is_array($values))
$this->value = $values;
else
$this->valueList = func_get_args();
return $this;
} | php | public function values($values) {
if (is_array($values))
$this->value = $values;
else
$this->valueList = func_get_args();
return $this;
} | [
"public",
"function",
"values",
"(",
"$",
"values",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"values",
")",
")",
"$",
"this",
"->",
"value",
"=",
"$",
"values",
";",
"else",
"$",
"this",
"->",
"valueList",
"=",
"func_get_args",
"(",
")",
";",
"re... | Sets the values to insert as a list
@param mixed $values
@return \eMapper\Fluent\Query\FluentInsert | [
"Sets",
"the",
"values",
"to",
"insert",
"as",
"a",
"list"
] | df7100e601d2a1363d07028a786b6ceb22271829 | https://github.com/emaphp/eMapper/blob/df7100e601d2a1363d07028a786b6ceb22271829/lib/eMapper/Fluent/Query/FluentInsert.php#L40-L46 |
11,562 | emaphp/eMapper | lib/eMapper/Fluent/Query/FluentInsert.php | FluentInsert.valuesExpr | public function valuesExpr($expression) {
$args = func_get_args();
$this->expression = array_shift($args);
if (empty($args))
return $this;
//check if argument is a list
try {
$this->valuesArray($args[0]);
}
catch (\InvalidArgumentException $e) {
$this->valueList = $args;
}
return $th... | php | public function valuesExpr($expression) {
$args = func_get_args();
$this->expression = array_shift($args);
if (empty($args))
return $this;
//check if argument is a list
try {
$this->valuesArray($args[0]);
}
catch (\InvalidArgumentException $e) {
$this->valueList = $args;
}
return $th... | [
"public",
"function",
"valuesExpr",
"(",
"$",
"expression",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"$",
"this",
"->",
"expression",
"=",
"array_shift",
"(",
"$",
"args",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"args",
")",
")",
... | Sets the VALUES clause along with its arguments
@param string $expression
@return \eMapper\Fluent\Query\FluentInsert | [
"Sets",
"the",
"VALUES",
"clause",
"along",
"with",
"its",
"arguments"
] | df7100e601d2a1363d07028a786b6ceb22271829 | https://github.com/emaphp/eMapper/blob/df7100e601d2a1363d07028a786b6ceb22271829/lib/eMapper/Fluent/Query/FluentInsert.php#L53-L69 |
11,563 | emaphp/eMapper | lib/eMapper/Fluent/Query/FluentInsert.php | FluentInsert.valuesArray | public function valuesArray($values) {
if ($values instanceof \ArrayObject)
$this->value = $values->getArrayCopy();
elseif (is_object($values))
$this->value = get_object_vars($values);
elseif (is_array($values))
$this->value = $values;
else
throw new \InvalidArgumentException("Method 'valuesArray' e... | php | public function valuesArray($values) {
if ($values instanceof \ArrayObject)
$this->value = $values->getArrayCopy();
elseif (is_object($values))
$this->value = get_object_vars($values);
elseif (is_array($values))
$this->value = $values;
else
throw new \InvalidArgumentException("Method 'valuesArray' e... | [
"public",
"function",
"valuesArray",
"(",
"$",
"values",
")",
"{",
"if",
"(",
"$",
"values",
"instanceof",
"\\",
"ArrayObject",
")",
"$",
"this",
"->",
"value",
"=",
"$",
"values",
"->",
"getArrayCopy",
"(",
")",
";",
"elseif",
"(",
"is_object",
"(",
"... | Sets the value to insert as an associative array
@param mixed $values
@throws \InvalidArgumentException
@return \eMapper\Fluent\Query\FluentInsert | [
"Sets",
"the",
"value",
"to",
"insert",
"as",
"an",
"associative",
"array"
] | df7100e601d2a1363d07028a786b6ceb22271829 | https://github.com/emaphp/eMapper/blob/df7100e601d2a1363d07028a786b6ceb22271829/lib/eMapper/Fluent/Query/FluentInsert.php#L77-L93 |
11,564 | emaphp/eMapper | lib/eMapper/Fluent/Query/FluentInsert.php | FluentInsert.columns | public function columns($columns) {
if (is_array($columns))
$this->columnList = $columns;
else
$this->columnList = func_get_args();
return $this;
} | php | public function columns($columns) {
if (is_array($columns))
$this->columnList = $columns;
else
$this->columnList = func_get_args();
return $this;
} | [
"public",
"function",
"columns",
"(",
"$",
"columns",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"columns",
")",
")",
"$",
"this",
"->",
"columnList",
"=",
"$",
"columns",
";",
"else",
"$",
"this",
"->",
"columnList",
"=",
"func_get_args",
"(",
")",
... | Sets the column list
@return \eMapper\Fluent\Query\FluentInsert | [
"Sets",
"the",
"column",
"list"
] | df7100e601d2a1363d07028a786b6ceb22271829 | https://github.com/emaphp/eMapper/blob/df7100e601d2a1363d07028a786b6ceb22271829/lib/eMapper/Fluent/Query/FluentInsert.php#L99-L105 |
11,565 | emaphp/eMapper | lib/eMapper/Fluent/Query/FluentInsert.php | FluentInsert.translateColumn | protected function translateColumn($column) {
if ($column instanceof Column)
return $column->getName();
return preg_match('/^(\w+)/', $column, $matches) ? $matches[1] : $column;
} | php | protected function translateColumn($column) {
if ($column instanceof Column)
return $column->getName();
return preg_match('/^(\w+)/', $column, $matches) ? $matches[1] : $column;
} | [
"protected",
"function",
"translateColumn",
"(",
"$",
"column",
")",
"{",
"if",
"(",
"$",
"column",
"instanceof",
"Column",
")",
"return",
"$",
"column",
"->",
"getName",
"(",
")",
";",
"return",
"preg_match",
"(",
"'/^(\\w+)/'",
",",
"$",
"column",
",",
... | Translates a insert column
@param Column | string $column
@return string | [
"Translates",
"a",
"insert",
"column"
] | df7100e601d2a1363d07028a786b6ceb22271829 | https://github.com/emaphp/eMapper/blob/df7100e601d2a1363d07028a786b6ceb22271829/lib/eMapper/Fluent/Query/FluentInsert.php#L112-L117 |
11,566 | emaphp/eMapper | lib/eMapper/Fluent/Query/FluentInsert.php | FluentInsert.buildColumnsClause | protected function buildColumnsClause() {
if (empty($this->columnList)) {
if (!empty($this->value))
$this->columnList = array_keys($this->value);
else
return '';
}
$columns = [];
foreach ($this->columnList as $column)
$columns[] = $this->translateColumn($column);
return implode(... | php | protected function buildColumnsClause() {
if (empty($this->columnList)) {
if (!empty($this->value))
$this->columnList = array_keys($this->value);
else
return '';
}
$columns = [];
foreach ($this->columnList as $column)
$columns[] = $this->translateColumn($column);
return implode(... | [
"protected",
"function",
"buildColumnsClause",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"columnList",
")",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"value",
")",
")",
"$",
"this",
"->",
"columnList",
"=",
"array_ke... | Returns the column list as a string
@return string | [
"Returns",
"the",
"column",
"list",
"as",
"a",
"string"
] | df7100e601d2a1363d07028a786b6ceb22271829 | https://github.com/emaphp/eMapper/blob/df7100e601d2a1363d07028a786b6ceb22271829/lib/eMapper/Fluent/Query/FluentInsert.php#L123-L137 |
11,567 | emaphp/eMapper | lib/eMapper/Fluent/Query/FluentInsert.php | FluentInsert.buildValuesClause | protected function buildValuesClause() {
if (!empty($this->expression))
return $this->expression;
if (empty($this->value)) {
$values = [];
for ($i = 0, $n = count($this->valueList); $i < $n; $i++)
$values[] = '%{' . $i . '}';
return implode(',', $values);
}
$values = [];
fore... | php | protected function buildValuesClause() {
if (!empty($this->expression))
return $this->expression;
if (empty($this->value)) {
$values = [];
for ($i = 0, $n = count($this->valueList); $i < $n; $i++)
$values[] = '%{' . $i . '}';
return implode(',', $values);
}
$values = [];
fore... | [
"protected",
"function",
"buildValuesClause",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"expression",
")",
")",
"return",
"$",
"this",
"->",
"expression",
";",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"value",
")",
")",
"{",
... | Returns the value list expression
@return string | [
"Returns",
"the",
"value",
"list",
"expression"
] | df7100e601d2a1363d07028a786b6ceb22271829 | https://github.com/emaphp/eMapper/blob/df7100e601d2a1363d07028a786b6ceb22271829/lib/eMapper/Fluent/Query/FluentInsert.php#L157-L179 |
11,568 | benkle-libs/feed-parser | src/Traits/WithMappedLinkTrait.php | WithMappedLinkTrait.setUrl | public function setUrl($url)
{
$relation = new RelationLink();
$relation
->setRelationType('self')
->setUrl($url);
return $this->setRelation($relation);
} | php | public function setUrl($url)
{
$relation = new RelationLink();
$relation
->setRelationType('self')
->setUrl($url);
return $this->setRelation($relation);
} | [
"public",
"function",
"setUrl",
"(",
"$",
"url",
")",
"{",
"$",
"relation",
"=",
"new",
"RelationLink",
"(",
")",
";",
"$",
"relation",
"->",
"setRelationType",
"(",
"'self'",
")",
"->",
"setUrl",
"(",
"$",
"url",
")",
";",
"return",
"$",
"this",
"->... | Set the feed url.
@param string $url
@return $this | [
"Set",
"the",
"feed",
"url",
"."
] | 8b86daf9dfe57e6e7ccae83dbc65ac7ce462144f | https://github.com/benkle-libs/feed-parser/blob/8b86daf9dfe57e6e7ccae83dbc65ac7ce462144f/src/Traits/WithMappedLinkTrait.php#L56-L63 |
11,569 | benkle-libs/feed-parser | src/Traits/WithMappedLinkTrait.php | WithMappedLinkTrait.getRelationSilently | private function getRelationSilently($rel)
{
$result = null;
try {
$result = $this->getRelation($rel);
} catch (\Exception $e) {
}
return $result;
} | php | private function getRelationSilently($rel)
{
$result = null;
try {
$result = $this->getRelation($rel);
} catch (\Exception $e) {
}
return $result;
} | [
"private",
"function",
"getRelationSilently",
"(",
"$",
"rel",
")",
"{",
"$",
"result",
"=",
"null",
";",
"try",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"getRelation",
"(",
"$",
"rel",
")",
";",
"}",
"catch",
"(",
"\\",
"Exception",
"$",
"e",
"... | Get a relation link, failing silently.
@codeCoverageIgnore
@param string $rel
@return RelationLinkInterface|null | [
"Get",
"a",
"relation",
"link",
"failing",
"silently",
"."
] | 8b86daf9dfe57e6e7ccae83dbc65ac7ce462144f | https://github.com/benkle-libs/feed-parser/blob/8b86daf9dfe57e6e7ccae83dbc65ac7ce462144f/src/Traits/WithMappedLinkTrait.php#L95-L103 |
11,570 | lucifurious/kisma | src/Kisma/Core/Utility/Option.php | Option.get | public static function get( &$options = array(), $key, $defaultValue = null, $unsetValue = false, $emptyStringIsNull = false )
{
// Get many?
if ( is_array( $key ) )
{
return static::getMany( $options, $key, $defaultValue, $unsetValue );
}
$_originalKey = $key;
... | php | public static function get( &$options = array(), $key, $defaultValue = null, $unsetValue = false, $emptyStringIsNull = false )
{
// Get many?
if ( is_array( $key ) )
{
return static::getMany( $options, $key, $defaultValue, $unsetValue );
}
$_originalKey = $key;
... | [
"public",
"static",
"function",
"get",
"(",
"&",
"$",
"options",
"=",
"array",
"(",
")",
",",
"$",
"key",
",",
"$",
"defaultValue",
"=",
"null",
",",
"$",
"unsetValue",
"=",
"false",
",",
"$",
"emptyStringIsNull",
"=",
"false",
")",
"{",
"//\tGet many?... | Retrieves an option from the given array.
$defaultValue is returned if $key is not found.
Can optionally delete $key from $options.
@param array|\ArrayAccess|object $options An array or object from which to get $key's value
@param string $key The array index or property to r... | [
"Retrieves",
"an",
"option",
"from",
"the",
"given",
"array",
"."
] | 4cc9954249da4e535b52f154e728935f07e648ae | https://github.com/lucifurious/kisma/blob/4cc9954249da4e535b52f154e728935f07e648ae/src/Kisma/Core/Utility/Option.php#L101-L173 |
11,571 | lucifurious/kisma | src/Kisma/Core/Utility/Option.php | Option.addTo | public static function addTo( &$source, $key, $subKey, $value = null )
{
$_target = static::clean( static::get( $source, $key, array() ) );
static::set( $_target, $subKey, $value );
static::set( $source, $key, $_target );
return $_target;
} | php | public static function addTo( &$source, $key, $subKey, $value = null )
{
$_target = static::clean( static::get( $source, $key, array() ) );
static::set( $_target, $subKey, $value );
static::set( $source, $key, $_target );
return $_target;
} | [
"public",
"static",
"function",
"addTo",
"(",
"&",
"$",
"source",
",",
"$",
"key",
",",
"$",
"subKey",
",",
"$",
"value",
"=",
"null",
")",
"{",
"$",
"_target",
"=",
"static",
"::",
"clean",
"(",
"static",
"::",
"get",
"(",
"$",
"source",
",",
"$... | Adds a value to a property array
@param array $source
@param string $key
@param string $subKey
@param mixed $value
@return array The new array | [
"Adds",
"a",
"value",
"to",
"a",
"property",
"array"
] | 4cc9954249da4e535b52f154e728935f07e648ae | https://github.com/lucifurious/kisma/blob/4cc9954249da4e535b52f154e728935f07e648ae/src/Kisma/Core/Utility/Option.php#L221-L228 |
11,572 | lucifurious/kisma | src/Kisma/Core/Utility/Option.php | Option.removeFrom | public static function removeFrom( &$source, $key, $subKey )
{
$_target = static::clean( static::get( $source, $key, array() ) );
$_result = static::remove( $_target, $subKey );
static::set( $source, $key, $_target );
return $_result;
} | php | public static function removeFrom( &$source, $key, $subKey )
{
$_target = static::clean( static::get( $source, $key, array() ) );
$_result = static::remove( $_target, $subKey );
static::set( $source, $key, $_target );
return $_result;
} | [
"public",
"static",
"function",
"removeFrom",
"(",
"&",
"$",
"source",
",",
"$",
"key",
",",
"$",
"subKey",
")",
"{",
"$",
"_target",
"=",
"static",
"::",
"clean",
"(",
"static",
"::",
"get",
"(",
"$",
"source",
",",
"$",
"key",
",",
"array",
"(",
... | Removes a value from a property array
@param array $source
@param string $key
@param string $subKey
@return mixed The original value of the removed key | [
"Removes",
"a",
"value",
"from",
"a",
"property",
"array"
] | 4cc9954249da4e535b52f154e728935f07e648ae | https://github.com/lucifurious/kisma/blob/4cc9954249da4e535b52f154e728935f07e648ae/src/Kisma/Core/Utility/Option.php#L239-L246 |
11,573 | lucifurious/kisma | src/Kisma/Core/Utility/Option.php | Option.set | public static function set( &$options = array(), $key, $value = null )
{
if ( is_array( $key ) )
{
return static::setMany( $options, $key );
}
$_cleanKey = static::_cleanKey( $key );
if ( is_array( $options ) )
{
// Check for the original key... | php | public static function set( &$options = array(), $key, $value = null )
{
if ( is_array( $key ) )
{
return static::setMany( $options, $key );
}
$_cleanKey = static::_cleanKey( $key );
if ( is_array( $options ) )
{
// Check for the original key... | [
"public",
"static",
"function",
"set",
"(",
"&",
"$",
"options",
"=",
"array",
"(",
")",
",",
"$",
"key",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"key",
")",
")",
"{",
"return",
"static",
"::",
"setMany",
"(",
... | Sets an value in the given array at key.
@param array|\ArrayAccess|object $options The array or object from which to set $key's $value
@param string|array $key The array index or property to set
@param mixed $value The value to set
@return bool|bool[] | [
"Sets",
"an",
"value",
"in",
"the",
"given",
"array",
"at",
"key",
"."
] | 4cc9954249da4e535b52f154e728935f07e648ae | https://github.com/lucifurious/kisma/blob/4cc9954249da4e535b52f154e728935f07e648ae/src/Kisma/Core/Utility/Option.php#L273-L325 |
11,574 | lucifurious/kisma | src/Kisma/Core/Utility/Option.php | Option.remove | public static function remove( &$options = array(), $key )
{
$_originalValue = null;
if ( static::contains( $options, $key ) )
{
$_cleanedKey = static::_cleanKey( $key );
if ( is_array( $options ) )
{
if ( !isset( $options[$key] ) && isse... | php | public static function remove( &$options = array(), $key )
{
$_originalValue = null;
if ( static::contains( $options, $key ) )
{
$_cleanedKey = static::_cleanKey( $key );
if ( is_array( $options ) )
{
if ( !isset( $options[$key] ) && isse... | [
"public",
"static",
"function",
"remove",
"(",
"&",
"$",
"options",
"=",
"array",
"(",
")",
",",
"$",
"key",
")",
"{",
"$",
"_originalValue",
"=",
"null",
";",
"if",
"(",
"static",
"::",
"contains",
"(",
"$",
"options",
",",
"$",
"key",
")",
")",
... | Unsets an option in the given array
@param array $options
@param string $key
@return mixed | [
"Unsets",
"an",
"option",
"in",
"the",
"given",
"array"
] | 4cc9954249da4e535b52f154e728935f07e648ae | https://github.com/lucifurious/kisma/blob/4cc9954249da4e535b52f154e728935f07e648ae/src/Kisma/Core/Utility/Option.php#L335-L373 |
11,575 | lucifurious/kisma | src/Kisma/Core/Utility/Option.php | Option.clean | public static function clean( $array = null, $callback = null )
{
$_result = ( empty( $array ) ? array() : ( !is_array( $array ) ? array($array) : $array ) );
if ( null === $callback || !is_callable( $callback ) )
{
return $_result;
}
$_response = array();
... | php | public static function clean( $array = null, $callback = null )
{
$_result = ( empty( $array ) ? array() : ( !is_array( $array ) ? array($array) : $array ) );
if ( null === $callback || !is_callable( $callback ) )
{
return $_result;
}
$_response = array();
... | [
"public",
"static",
"function",
"clean",
"(",
"$",
"array",
"=",
"null",
",",
"$",
"callback",
"=",
"null",
")",
"{",
"$",
"_result",
"=",
"(",
"empty",
"(",
"$",
"array",
")",
"?",
"array",
"(",
")",
":",
"(",
"!",
"is_array",
"(",
"$",
"array",... | Ensures the argument passed in is actually an array with optional iteration callback
@static
@param array $array
@param callable|\Closure $callback
@return array | [
"Ensures",
"the",
"argument",
"passed",
"in",
"is",
"actually",
"an",
"array",
"with",
"optional",
"iteration",
"callback"
] | 4cc9954249da4e535b52f154e728935f07e648ae | https://github.com/lucifurious/kisma/blob/4cc9954249da4e535b52f154e728935f07e648ae/src/Kisma/Core/Utility/Option.php#L385-L402 |
11,576 | lucifurious/kisma | src/Kisma/Core/Utility/Option.php | Option.merge | public static function merge( $target )
{
$_arrays = static::clean( func_get_args() );
$_target = static::clean( array_shift( $_arrays ) );
foreach ( $_arrays as $_array )
{
$_target = array_merge(
$_target,
static::clean( $_array )
... | php | public static function merge( $target )
{
$_arrays = static::clean( func_get_args() );
$_target = static::clean( array_shift( $_arrays ) );
foreach ( $_arrays as $_array )
{
$_target = array_merge(
$_target,
static::clean( $_array )
... | [
"public",
"static",
"function",
"merge",
"(",
"$",
"target",
")",
"{",
"$",
"_arrays",
"=",
"static",
"::",
"clean",
"(",
"func_get_args",
"(",
")",
")",
";",
"$",
"_target",
"=",
"static",
"::",
"clean",
"(",
"array_shift",
"(",
"$",
"_arrays",
")",
... | Merge one or more arrays but ensures each is an array. Basically an idiot-proof array_merge
@param array $target The destination array
@return array The resulting array
@return array | [
"Merge",
"one",
"or",
"more",
"arrays",
"but",
"ensures",
"each",
"is",
"an",
"array",
".",
"Basically",
"an",
"idiot",
"-",
"proof",
"array_merge"
] | 4cc9954249da4e535b52f154e728935f07e648ae | https://github.com/lucifurious/kisma/blob/4cc9954249da4e535b52f154e728935f07e648ae/src/Kisma/Core/Utility/Option.php#L431-L449 |
11,577 | lucifurious/kisma | src/Kisma/Core/Utility/Option.php | Option.prefixKeys | public static function prefixKeys( $prefix, array $data = array() )
{
foreach ( static::clean( $data ) as $_key => $_value )
{
if ( is_numeric( $_key ) )
{
continue;
}
if ( is_array( $_value ) )
{
$_value = ... | php | public static function prefixKeys( $prefix, array $data = array() )
{
foreach ( static::clean( $data ) as $_key => $_value )
{
if ( is_numeric( $_key ) )
{
continue;
}
if ( is_array( $_value ) )
{
$_value = ... | [
"public",
"static",
"function",
"prefixKeys",
"(",
"$",
"prefix",
",",
"array",
"$",
"data",
"=",
"array",
"(",
")",
")",
"{",
"foreach",
"(",
"static",
"::",
"clean",
"(",
"$",
"data",
")",
"as",
"$",
"_key",
"=>",
"$",
"_value",
")",
"{",
"if",
... | Spins through an array and prefixes the keys with a string
@param string $prefix
@param array $data
@return mixed | [
"Spins",
"through",
"an",
"array",
"and",
"prefixes",
"the",
"keys",
"with",
"a",
"string"
] | 4cc9954249da4e535b52f154e728935f07e648ae | https://github.com/lucifurious/kisma/blob/4cc9954249da4e535b52f154e728935f07e648ae/src/Kisma/Core/Utility/Option.php#L512-L531 |
11,578 | lucifurious/kisma | src/Kisma/Core/Utility/Option.php | Option._cleanKey | protected static function _cleanKey( $key, $opposite = true )
{
if ( !static::$_neutralizeKeys )
{
$_cleaned = $key;
}
elseif ( $key == ( $_cleaned = Inflector::neutralize( $key ) ) )
{
if ( $opposite )
{
return Inflector::d... | php | protected static function _cleanKey( $key, $opposite = true )
{
if ( !static::$_neutralizeKeys )
{
$_cleaned = $key;
}
elseif ( $key == ( $_cleaned = Inflector::neutralize( $key ) ) )
{
if ( $opposite )
{
return Inflector::d... | [
"protected",
"static",
"function",
"_cleanKey",
"(",
"$",
"key",
",",
"$",
"opposite",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"static",
"::",
"$",
"_neutralizeKeys",
")",
"{",
"$",
"_cleaned",
"=",
"$",
"key",
";",
"}",
"elseif",
"(",
"$",
"key",
"... | Converts key to a neutral format if not already...
@param string $key
@param bool $opposite If true, the key is switched back to it's neutral or non-neutral format
@return string | [
"Converts",
"key",
"to",
"a",
"neutral",
"format",
"if",
"not",
"already",
"..."
] | 4cc9954249da4e535b52f154e728935f07e648ae | https://github.com/lucifurious/kisma/blob/4cc9954249da4e535b52f154e728935f07e648ae/src/Kisma/Core/Utility/Option.php#L573-L588 |
11,579 | Hexmedia/symfony-fake-process | FakeProcessBuilder.php | FakeProcessBuilder.setInput | public function setInput($input)
{
$this->input = ProcessUtils::validateInput(sprintf('%s::%s', __CLASS__, __FUNCTION__), $input);
return $this;
} | php | public function setInput($input)
{
$this->input = ProcessUtils::validateInput(sprintf('%s::%s', __CLASS__, __FUNCTION__), $input);
return $this;
} | [
"public",
"function",
"setInput",
"(",
"$",
"input",
")",
"{",
"$",
"this",
"->",
"input",
"=",
"ProcessUtils",
"::",
"validateInput",
"(",
"sprintf",
"(",
"'%s::%s'",
",",
"__CLASS__",
",",
"__FUNCTION__",
")",
",",
"$",
"input",
")",
";",
"return",
"$"... | Sets the input of the process.
@param mixed $input The input as a string
@return FakeProcessBuilder
@throws InvalidArgumentException In case the argument is invalid | [
"Sets",
"the",
"input",
"of",
"the",
"process",
"."
] | 6f93863c5d2363555165488de5a44a4beff5337f | https://github.com/Hexmedia/symfony-fake-process/blob/6f93863c5d2363555165488de5a44a4beff5337f/FakeProcessBuilder.php#L178-L183 |
11,580 | jivoo/core | src/Cli/Shell.php | Shell.dump | public function dump($value)
{
if (is_object($value)) {
return get_class($value);
}
if (is_resource($value)) {
return get_resource_type($value);
}
return var_export($value, true);
} | php | public function dump($value)
{
if (is_object($value)) {
return get_class($value);
}
if (is_resource($value)) {
return get_resource_type($value);
}
return var_export($value, true);
} | [
"public",
"function",
"dump",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"value",
")",
")",
"{",
"return",
"get_class",
"(",
"$",
"value",
")",
";",
"}",
"if",
"(",
"is_resource",
"(",
"$",
"value",
")",
")",
"{",
"return",
"g... | Create a string representation of any PHP value.
@param mixed $value
Any value.
@return string String representation. | [
"Create",
"a",
"string",
"representation",
"of",
"any",
"PHP",
"value",
"."
] | 4ef3445068f0ff9c0a6512cb741831a847013b76 | https://github.com/jivoo/core/blob/4ef3445068f0ff9c0a6512cb741831a847013b76/src/Cli/Shell.php#L243-L252 |
11,581 | phossa2/libs | src/Phossa2/Cache/Driver/DriverAbstract.php | DriverAbstract.isDeferred | protected function isDeferred(/*# string */ $key)/*# : array */
{
$res = [];
if (isset($this->defer[$key])) {
$res['expire'] = $this->defer[$key]->getExpiration()->getTimestamp();
}
return $res;
} | php | protected function isDeferred(/*# string */ $key)/*# : array */
{
$res = [];
if (isset($this->defer[$key])) {
$res['expire'] = $this->defer[$key]->getExpiration()->getTimestamp();
}
return $res;
} | [
"protected",
"function",
"isDeferred",
"(",
"/*# string */",
"$",
"key",
")",
"/*# : array */",
"{",
"$",
"res",
"=",
"[",
"]",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"defer",
"[",
"$",
"key",
"]",
")",
")",
"{",
"$",
"res",
"[",
"'expire... | In deferred array ?
@param string $key
@return array
@access protected | [
"In",
"deferred",
"array",
"?"
] | 921e485c8cc29067f279da2cdd06f47a9bddd115 | https://github.com/phossa2/libs/blob/921e485c8cc29067f279da2cdd06f47a9bddd115/src/Phossa2/Cache/Driver/DriverAbstract.php#L177-L184 |
11,582 | Clastic/AliasBundle | EventListener/FormSubscriber.php | FormSubscriber.validate | public function validate(FormEvent $event)
{
/** @var Alias $alias */
$alias = $event->getData()->getNode()->alias;
if ($alias instanceof ValueHolderInterface) {
$alias = $alias->getWrappedValueHolderValue();
}
$violations = $this->validator->validate($alias);
... | php | public function validate(FormEvent $event)
{
/** @var Alias $alias */
$alias = $event->getData()->getNode()->alias;
if ($alias instanceof ValueHolderInterface) {
$alias = $alias->getWrappedValueHolderValue();
}
$violations = $this->validator->validate($alias);
... | [
"public",
"function",
"validate",
"(",
"FormEvent",
"$",
"event",
")",
"{",
"/** @var Alias $alias */",
"$",
"alias",
"=",
"$",
"event",
"->",
"getData",
"(",
")",
"->",
"getNode",
"(",
")",
"->",
"alias",
";",
"if",
"(",
"$",
"alias",
"instanceof",
"Val... | Validate if the Alias is valid and unique.
@param FormEvent $event | [
"Validate",
"if",
"the",
"Alias",
"is",
"valid",
"and",
"unique",
"."
] | 7f5099589561ed4988abab2dcccf5c58ea5edb66 | https://github.com/Clastic/AliasBundle/blob/7f5099589561ed4988abab2dcccf5c58ea5edb66/EventListener/FormSubscriber.php#L55-L75 |
11,583 | letrunghieu/taki | src/Traits/TakiRegistration.php | TakiRegistration.getActivate | public function getActivate(Request $request, $token)
{
$user = User::where('token', $token)->first();
if (!$user) {
throw new NotFoundHttpException;
}
$user->is_activated = true;
$user->token = null;
$user->save();
if (method... | php | public function getActivate(Request $request, $token)
{
$user = User::where('token', $token)->first();
if (!$user) {
throw new NotFoundHttpException;
}
$user->is_activated = true;
$user->token = null;
$user->save();
if (method... | [
"public",
"function",
"getActivate",
"(",
"Request",
"$",
"request",
",",
"$",
"token",
")",
"{",
"$",
"user",
"=",
"User",
"::",
"where",
"(",
"'token'",
",",
"$",
"token",
")",
"->",
"first",
"(",
")",
";",
"if",
"(",
"!",
"$",
"user",
")",
"{"... | Activate a user by a link
@param $token
@return \Illuminate\View\View
@throws NotFoundHttpException | [
"Activate",
"a",
"user",
"by",
"a",
"link"
] | c4af7345a4a9df6d83c84f04335da92b62debf17 | https://github.com/letrunghieu/taki/blob/c4af7345a4a9df6d83c84f04335da92b62debf17/src/Traits/TakiRegistration.php#L64-L81 |
11,584 | letrunghieu/taki | src/Traits/TakiRegistration.php | TakiRegistration.validateCreating | protected function validateCreating()
{
$rules = config('taki.validator.create', []);
if (config('taki.username.required') && !array_get($rules, config('taki.field.username'))) {
$rules[config('taki.field.username')] = config('taki.username.validator', 'required');
}
... | php | protected function validateCreating()
{
$rules = config('taki.validator.create', []);
if (config('taki.username.required') && !array_get($rules, config('taki.field.username'))) {
$rules[config('taki.field.username')] = config('taki.username.validator', 'required');
}
... | [
"protected",
"function",
"validateCreating",
"(",
")",
"{",
"$",
"rules",
"=",
"config",
"(",
"'taki.validator.create'",
",",
"[",
"]",
")",
";",
"if",
"(",
"config",
"(",
"'taki.username.required'",
")",
"&&",
"!",
"array_get",
"(",
"$",
"rules",
",",
"co... | get the validation rules when creating user
@param array $data
@return array | [
"get",
"the",
"validation",
"rules",
"when",
"creating",
"user"
] | c4af7345a4a9df6d83c84f04335da92b62debf17 | https://github.com/letrunghieu/taki/blob/c4af7345a4a9df6d83c84f04335da92b62debf17/src/Traits/TakiRegistration.php#L104-L113 |
11,585 | tjbp/tablelegs | src/lib/TableFilter.php | TableFilter.getUrl | public function getUrl($option)
{
if ($this->isActive($option)) {
$params = $this->request->all();
unset($params[$this->getKey()]);
return '?'.http_build_query($params);
}
return '?'.http_build_query([$this->key => $option] + $this->request->all());
... | php | public function getUrl($option)
{
if ($this->isActive($option)) {
$params = $this->request->all();
unset($params[$this->getKey()]);
return '?'.http_build_query($params);
}
return '?'.http_build_query([$this->key => $option] + $this->request->all());
... | [
"public",
"function",
"getUrl",
"(",
"$",
"option",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isActive",
"(",
"$",
"option",
")",
")",
"{",
"$",
"params",
"=",
"$",
"this",
"->",
"request",
"->",
"all",
"(",
")",
";",
"unset",
"(",
"$",
"params",
... | Return the URL parameter string to enable this filter.
@return string | [
"Return",
"the",
"URL",
"parameter",
"string",
"to",
"enable",
"this",
"filter",
"."
] | 89916f6662ab324a96c62672ed4bb9a6e9cb3360 | https://github.com/tjbp/tablelegs/blob/89916f6662ab324a96c62672ed4bb9a6e9cb3360/src/lib/TableFilter.php#L95-L106 |
11,586 | n0m4dz/laracasa | Zend/Gdata/Analytics.php | Zend_Gdata_Analytics.getAccountFeed | public function getAccountFeed($uri = self::ANALYTICS_ACCOUNT_FEED_URI)
{
if ($uri instanceof Query) {
$uri = $uri->getQueryUrl();
}
return parent::getFeed($uri, 'Zend_Gdata_Analytics_AccountFeed');
} | php | public function getAccountFeed($uri = self::ANALYTICS_ACCOUNT_FEED_URI)
{
if ($uri instanceof Query) {
$uri = $uri->getQueryUrl();
}
return parent::getFeed($uri, 'Zend_Gdata_Analytics_AccountFeed');
} | [
"public",
"function",
"getAccountFeed",
"(",
"$",
"uri",
"=",
"self",
"::",
"ANALYTICS_ACCOUNT_FEED_URI",
")",
"{",
"if",
"(",
"$",
"uri",
"instanceof",
"Query",
")",
"{",
"$",
"uri",
"=",
"$",
"uri",
"->",
"getQueryUrl",
"(",
")",
";",
"}",
"return",
... | Retrieve account feed object
@param string|Zend_Uri_Uri $uri
@return Zend_Gdata_Analytics_AccountFeed | [
"Retrieve",
"account",
"feed",
"object"
] | 6141f0c16c7d4453275e3b74be5041f336085c91 | https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Analytics.php#L96-L102 |
11,587 | n0m4dz/laracasa | Zend/Gdata/Analytics.php | Zend_Gdata_Analytics.getDataFeed | public function getDataFeed($uri = self::ANALYTICS_FEED_URI)
{
if ($uri instanceof Query) {
$uri = $uri->getQueryUrl();
}
return parent::getFeed($uri, 'Zend_Gdata_Analytics_DataFeed');
} | php | public function getDataFeed($uri = self::ANALYTICS_FEED_URI)
{
if ($uri instanceof Query) {
$uri = $uri->getQueryUrl();
}
return parent::getFeed($uri, 'Zend_Gdata_Analytics_DataFeed');
} | [
"public",
"function",
"getDataFeed",
"(",
"$",
"uri",
"=",
"self",
"::",
"ANALYTICS_FEED_URI",
")",
"{",
"if",
"(",
"$",
"uri",
"instanceof",
"Query",
")",
"{",
"$",
"uri",
"=",
"$",
"uri",
"->",
"getQueryUrl",
"(",
")",
";",
"}",
"return",
"parent",
... | Retrieve data feed object
@param string|Zend_Uri_Uri $uri
@return Zend_Gdata_Analytics_DataFeed | [
"Retrieve",
"data",
"feed",
"object"
] | 6141f0c16c7d4453275e3b74be5041f336085c91 | https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Analytics.php#L110-L116 |
11,588 | cherrylabs/arx-utils | src/Arx/Utils/Hook.php | Hook.get | public static function get($name, $default = null){
$dots = null;
if ($pos = strpos($name, '.')) {
$dots = substr($name, $pos + 1);
$name = substr($name, 0, $pos);
}
if(isset($GLOBALS[ARX_HOOK][$name])){
if ($dots) {
return Arr::get... | php | public static function get($name, $default = null){
$dots = null;
if ($pos = strpos($name, '.')) {
$dots = substr($name, $pos + 1);
$name = substr($name, 0, $pos);
}
if(isset($GLOBALS[ARX_HOOK][$name])){
if ($dots) {
return Arr::get... | [
"public",
"static",
"function",
"get",
"(",
"$",
"name",
",",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"dots",
"=",
"null",
";",
"if",
"(",
"$",
"pos",
"=",
"strpos",
"(",
"$",
"name",
",",
"'.'",
")",
")",
"{",
"$",
"dots",
"=",
"substr",
... | Get registered hook
@param $name
@param array $param
@return bool | [
"Get",
"registered",
"hook"
] | c3986ef44aee9457ee66d52f5833091ba3c03cee | https://github.com/cherrylabs/arx-utils/blob/c3986ef44aee9457ee66d52f5833091ba3c03cee/src/Arx/Utils/Hook.php#L240-L263 |
11,589 | nonetallt/jinitialize-core | src/JinScript/JinScriptParser.php | JinScriptParser.parse | private function parse()
{
$handle = fopen($this->filepath, 'r');
if(! $handle) throw new \Exception("Can't read file $this->filepath");
$plugin = null;
while(($line = fgets($handle)) !== false) {
/* Skip comments and empty lines */
if(starts_with($line, '#... | php | private function parse()
{
$handle = fopen($this->filepath, 'r');
if(! $handle) throw new \Exception("Can't read file $this->filepath");
$plugin = null;
while(($line = fgets($handle)) !== false) {
/* Skip comments and empty lines */
if(starts_with($line, '#... | [
"private",
"function",
"parse",
"(",
")",
"{",
"$",
"handle",
"=",
"fopen",
"(",
"$",
"this",
"->",
"filepath",
",",
"'r'",
")",
";",
"if",
"(",
"!",
"$",
"handle",
")",
"throw",
"new",
"\\",
"Exception",
"(",
"\"Can't read file $this->filepath\"",
")",
... | Private since files should only be parsed when neccesary | [
"Private",
"since",
"files",
"should",
"only",
"be",
"parsed",
"when",
"neccesary"
] | 284fbd72b7c1d6f5f8f265dfe2589c0d99b6a88f | https://github.com/nonetallt/jinitialize-core/blob/284fbd72b7c1d6f5f8f265dfe2589c0d99b6a88f/src/JinScript/JinScriptParser.php#L42-L73 |
11,590 | Silvestra/Silvestra | src/Silvestra/Bundle/AdminBundle/Twig/Extension/AdminMenuExtension.php | AdminMenuExtension.render | public function render($template = null)
{
if (null === $template) {
$template = 'SilvestraAdminBundle:Menu:vertical_admin_menu.html.twig';
}
return $this->helper->render($template, $this->builder->build());
} | php | public function render($template = null)
{
if (null === $template) {
$template = 'SilvestraAdminBundle:Menu:vertical_admin_menu.html.twig';
}
return $this->helper->render($template, $this->builder->build());
} | [
"public",
"function",
"render",
"(",
"$",
"template",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"template",
")",
"{",
"$",
"template",
"=",
"'SilvestraAdminBundle:Menu:vertical_admin_menu.html.twig'",
";",
"}",
"return",
"$",
"this",
"->",
"helper"... | Render admin menu.
@param null|string $template
@return string | [
"Render",
"admin",
"menu",
"."
] | b7367601b01495ae3c492b42042f804dee13ab06 | https://github.com/Silvestra/Silvestra/blob/b7367601b01495ae3c492b42042f804dee13ab06/src/Silvestra/Bundle/AdminBundle/Twig/Extension/AdminMenuExtension.php#L67-L74 |
11,591 | bfitech/zapmin | src/AdminStoreInit.php | AdminStoreInit.init | public function init() {
if ($this->initialized)
return $this;
$this->initialized = true;
$this->check_tables();
return $this;
} | php | public function init() {
if ($this->initialized)
return $this;
$this->initialized = true;
$this->check_tables();
return $this;
} | [
"public",
"function",
"init",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"initialized",
")",
"return",
"$",
"this",
";",
"$",
"this",
"->",
"initialized",
"=",
"true",
";",
"$",
"this",
"->",
"check_tables",
"(",
")",
";",
"return",
"$",
"this",
... | Initialize properties, tables, etc. | [
"Initialize",
"properties",
"tables",
"etc",
"."
] | 4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe | https://github.com/bfitech/zapmin/blob/4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe/src/AdminStoreInit.php#L106-L112 |
11,592 | bfitech/zapmin | src/AdminStoreInit.php | AdminStoreInit.deinit | public function deinit() {
if (!$this->initialized)
return $this;
$this->user_token = null;
$this->user_data = null;
$this->expiration = 3600 * 2;
$this->byway_expiration = 3600 * 24 * 7;
$this->initialized = false;
return $this;
} | php | public function deinit() {
if (!$this->initialized)
return $this;
$this->user_token = null;
$this->user_data = null;
$this->expiration = 3600 * 2;
$this->byway_expiration = 3600 * 24 * 7;
$this->initialized = false;
return $this;
} | [
"public",
"function",
"deinit",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"initialized",
")",
"return",
"$",
"this",
";",
"$",
"this",
"->",
"user_token",
"=",
"null",
";",
"$",
"this",
"->",
"user_data",
"=",
"null",
";",
"$",
"this",
"->"... | Restore properties to default. | [
"Restore",
"properties",
"to",
"default",
"."
] | 4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe | https://github.com/bfitech/zapmin/blob/4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe/src/AdminStoreInit.php#L117-L130 |
11,593 | bfitech/zapmin | src/AdminStoreInit.php | AdminStoreInit.store_check_expiration | protected function store_check_expiration($expiration=null) {
if (!$expiration)
return 3600 * 2;
$expiration = (int)$expiration;
if ($expiration < 600)
$expiration = 600;
return $expiration;
} | php | protected function store_check_expiration($expiration=null) {
if (!$expiration)
return 3600 * 2;
$expiration = (int)$expiration;
if ($expiration < 600)
$expiration = 600;
return $expiration;
} | [
"protected",
"function",
"store_check_expiration",
"(",
"$",
"expiration",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"expiration",
")",
"return",
"3600",
"*",
"2",
";",
"$",
"expiration",
"=",
"(",
"int",
")",
"$",
"expiration",
";",
"if",
"(",
"$",
... | Verify expiration.
Do not allow session that's too short. That would annoy users.
@param int $expiration Session expiration, in seconds. This can
be used for standard or byway session. | [
"Verify",
"expiration",
"."
] | 4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe | https://github.com/bfitech/zapmin/blob/4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe/src/AdminStoreInit.php#L140-L147 |
11,594 | bfitech/zapmin | src/AdminStoreInit.php | AdminStoreInit.check_tables | private function check_tables() {
$tab = new AdminStoreTables();
$tab::init($this);
$force = $this->force_create_table;
if ($tab::exists($force)) {
if (!$force)
$tab::upgrade();
$tab::deinit();
return;
}
$tab::install($this->expiration);
$tab::deinit();
} | php | private function check_tables() {
$tab = new AdminStoreTables();
$tab::init($this);
$force = $this->force_create_table;
if ($tab::exists($force)) {
if (!$force)
$tab::upgrade();
$tab::deinit();
return;
}
$tab::install($this->expiration);
$tab::deinit();
} | [
"private",
"function",
"check_tables",
"(",
")",
"{",
"$",
"tab",
"=",
"new",
"AdminStoreTables",
"(",
")",
";",
"$",
"tab",
"::",
"init",
"(",
"$",
"this",
")",
";",
"$",
"force",
"=",
"$",
"this",
"->",
"force_create_table",
";",
"if",
"(",
"$",
... | Check tables.
Check table existance and upgradability. If
$this->force_create_table is true, old tables will be dropped
and old data discarded. | [
"Check",
"tables",
"."
] | 4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe | https://github.com/bfitech/zapmin/blob/4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe/src/AdminStoreInit.php#L156-L168 |
11,595 | bfitech/zapmin | src/AdminStoreInit.php | AdminStoreInit.store_match_password | protected function store_match_password($uname, $upass, $usalt) {
$udata = $this->store->query(
"SELECT uid, uname " .
"FROM udata WHERE upass=? LIMIT 1",
[self::hash_password($uname, $upass, $usalt)]);
if (!$udata)
return false;
return $udata;
} | php | protected function store_match_password($uname, $upass, $usalt) {
$udata = $this->store->query(
"SELECT uid, uname " .
"FROM udata WHERE upass=? LIMIT 1",
[self::hash_password($uname, $upass, $usalt)]);
if (!$udata)
return false;
return $udata;
} | [
"protected",
"function",
"store_match_password",
"(",
"$",
"uname",
",",
"$",
"upass",
",",
"$",
"usalt",
")",
"{",
"$",
"udata",
"=",
"$",
"this",
"->",
"store",
"->",
"query",
"(",
"\"SELECT uid, uname \"",
".",
"\"FROM udata WHERE upass=? LIMIT 1\"",
",",
"... | Match password and return user data on success.
@param string $uname Username.
@param string $upass User plain text password.
@param string $usalt User salt.
@return array|bool False on failure, user data on success. User
data elements are subset of those returned by
AdminStore::adm_get_safe_user_data. | [
"Match",
"password",
"and",
"return",
"user",
"data",
"on",
"success",
"."
] | 4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe | https://github.com/bfitech/zapmin/blob/4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe/src/AdminStoreInit.php#L197-L205 |
11,596 | bfitech/zapmin | src/AdminStoreInit.php | AdminStoreInit.store_redis_cache_read | protected function store_redis_cache_read($token) {
if (!$this->redis)
return null;
$key = sprintf('%s:%s', $this->token_name, $token);
$data = $this->redis->get($key);
if ($data === false)
# key not fund
return null;
$data = @json_decode($data, true);
if (!$data)
# cached data is broken
$dat... | php | protected function store_redis_cache_read($token) {
if (!$this->redis)
return null;
$key = sprintf('%s:%s', $this->token_name, $token);
$data = $this->redis->get($key);
if ($data === false)
# key not fund
return null;
$data = @json_decode($data, true);
if (!$data)
# cached data is broken
$dat... | [
"protected",
"function",
"store_redis_cache_read",
"(",
"$",
"token",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"redis",
")",
"return",
"null",
";",
"$",
"key",
"=",
"sprintf",
"(",
"'%s:%s'",
",",
"$",
"this",
"->",
"token_name",
",",
"$",
"token",... | Read session data from cache.
@param string $token Session token. | [
"Read",
"session",
"data",
"from",
"cache",
"."
] | 4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe | https://github.com/bfitech/zapmin/blob/4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe/src/AdminStoreInit.php#L212-L228 |
11,597 | bfitech/zapmin | src/AdminStoreInit.php | AdminStoreInit.store_redis_cache_write | protected function store_redis_cache_write(
$token, $data, $expire_at, $expire=null
) {
if (!$this->redis)
return;
$key = sprintf('%s:%s', $this->token_name, $token);
$this->redis->set($key, json_encode($data));
if ($expire === null) {
$expire_at = str_replace(' ', 'T', $expire_at) . 'Z';
$expire_... | php | protected function store_redis_cache_write(
$token, $data, $expire_at, $expire=null
) {
if (!$this->redis)
return;
$key = sprintf('%s:%s', $this->token_name, $token);
$this->redis->set($key, json_encode($data));
if ($expire === null) {
$expire_at = str_replace(' ', 'T', $expire_at) . 'Z';
$expire_... | [
"protected",
"function",
"store_redis_cache_write",
"(",
"$",
"token",
",",
"$",
"data",
",",
"$",
"expire_at",
",",
"$",
"expire",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"redis",
")",
"return",
";",
"$",
"key",
"=",
"sprintf",
"("... | Write session to cache.
@param string $token Session token.
@param array $data User data.
@param string $expire_at Redis expireat parameter, in UTC
datetime.
@param int $expire Redis expire parameter, in seconds. If this
is set, $expire_at is ignored. | [
"Write",
"session",
"to",
"cache",
"."
] | 4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe | https://github.com/bfitech/zapmin/blob/4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe/src/AdminStoreInit.php#L240-L260 |
11,598 | bfitech/zapmin | src/AdminStoreInit.php | AdminStoreInit.store_redis_cache_del | protected function store_redis_cache_del($token) {
if (!$this->redis)
return;
$key = sprintf('%s:%s', $this->token_name, $token);
$this->redis->del($key);
$this->logger->debug(sprintf(
"Zapmin: session removed from cache: '%s'.", $token));
} | php | protected function store_redis_cache_del($token) {
if (!$this->redis)
return;
$key = sprintf('%s:%s', $this->token_name, $token);
$this->redis->del($key);
$this->logger->debug(sprintf(
"Zapmin: session removed from cache: '%s'.", $token));
} | [
"protected",
"function",
"store_redis_cache_del",
"(",
"$",
"token",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"redis",
")",
"return",
";",
"$",
"key",
"=",
"sprintf",
"(",
"'%s:%s'",
",",
"$",
"this",
"->",
"token_name",
",",
"$",
"token",
")",
"... | Remove session cache.
@param string $token Session token. | [
"Remove",
"session",
"cache",
"."
] | 4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe | https://github.com/bfitech/zapmin/blob/4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe/src/AdminStoreInit.php#L267-L274 |
11,599 | bfitech/zapmin | src/AdminStoreInit.php | AdminStoreInit.store_get_user_status | protected function store_get_user_status() {
$this->init();
if ($this->user_token === null)
return null;
if ($this->user_data !== null)
return $this->user_data;
$token = $this->user_token;
# cache validation
$cached = $this->store_redis_cache_read($token);
if ($cached !== null) {
if ($cached['u... | php | protected function store_get_user_status() {
$this->init();
if ($this->user_token === null)
return null;
if ($this->user_data !== null)
return $this->user_data;
$token = $this->user_token;
# cache validation
$cached = $this->store_redis_cache_read($token);
if ($cached !== null) {
if ($cached['u... | [
"protected",
"function",
"store_get_user_status",
"(",
")",
"{",
"$",
"this",
"->",
"init",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"user_token",
"===",
"null",
")",
"return",
"null",
";",
"if",
"(",
"$",
"this",
"->",
"user_data",
"!==",
"null",
... | Populate session data. | [
"Populate",
"session",
"data",
"."
] | 4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe | https://github.com/bfitech/zapmin/blob/4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe/src/AdminStoreInit.php#L279-L322 |
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.