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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
13,400 | csun-metalab/laravel-directory-authentication | src/Authentication/Handlers/HandlerLDAP.php | HandlerLDAP.searchByEmailArray | public function searchByEmailArray($email) {
$results = $this->ldap->search($this->basedn,
$this->search_mail_array . '=' . $email);
return $results;
} | php | public function searchByEmailArray($email) {
$results = $this->ldap->search($this->basedn,
$this->search_mail_array . '=' . $email);
return $results;
} | [
"public",
"function",
"searchByEmailArray",
"(",
"$",
"email",
")",
"{",
"$",
"results",
"=",
"$",
"this",
"->",
"ldap",
"->",
"search",
"(",
"$",
"this",
"->",
"basedn",
",",
"$",
"this",
"->",
"search_mail_array",
".",
"'='",
".",
"$",
"email",
")",
... | Queries LDAP for the record with the specified mailLocalAddress.
@param string $email The mailLocalAddress to use for searching
@return Result-instance | [
"Queries",
"LDAP",
"for",
"the",
"record",
"with",
"the",
"specified",
"mailLocalAddress",
"."
] | b8d4fa64dd646566e508cdf838d6a3d03b1d53ea | https://github.com/csun-metalab/laravel-directory-authentication/blob/b8d4fa64dd646566e508cdf838d6a3d03b1d53ea/src/Authentication/Handlers/HandlerLDAP.php#L439-L443 |
13,401 | csun-metalab/laravel-directory-authentication | src/Authentication/Handlers/HandlerLDAP.php | HandlerLDAP.searchByQuery | public function searchByQuery($query) {
$results = $this->ldap->search($this->basedn, $query);
return $results;
} | php | public function searchByQuery($query) {
$results = $this->ldap->search($this->basedn, $query);
return $results;
} | [
"public",
"function",
"searchByQuery",
"(",
"$",
"query",
")",
"{",
"$",
"results",
"=",
"$",
"this",
"->",
"ldap",
"->",
"search",
"(",
"$",
"this",
"->",
"basedn",
",",
"$",
"query",
")",
";",
"return",
"$",
"results",
";",
"}"
] | Queries LDAP for the records using the specified query.
@param string $query Any valid LDAP query to use for searching
@return Result-instance | [
"Queries",
"LDAP",
"for",
"the",
"records",
"using",
"the",
"specified",
"query",
"."
] | b8d4fa64dd646566e508cdf838d6a3d03b1d53ea | https://github.com/csun-metalab/laravel-directory-authentication/blob/b8d4fa64dd646566e508cdf838d6a3d03b1d53ea/src/Authentication/Handlers/HandlerLDAP.php#L451-L454 |
13,402 | csun-metalab/laravel-directory-authentication | src/Authentication/Handlers/HandlerLDAP.php | HandlerLDAP.searchByUid | public function searchByUid($uid) {
$results = $this->ldap->search($this->basedn,
$this->search_username . '=' . $uid);
return $results;
} | php | public function searchByUid($uid) {
$results = $this->ldap->search($this->basedn,
$this->search_username . '=' . $uid);
return $results;
} | [
"public",
"function",
"searchByUid",
"(",
"$",
"uid",
")",
"{",
"$",
"results",
"=",
"$",
"this",
"->",
"ldap",
"->",
"search",
"(",
"$",
"this",
"->",
"basedn",
",",
"$",
"this",
"->",
"search_username",
".",
"'='",
".",
"$",
"uid",
")",
";",
"ret... | Queries LDAP for the record with the specified uid.
@param string $uid The uid to use for searching
@return Result-instance | [
"Queries",
"LDAP",
"for",
"the",
"record",
"with",
"the",
"specified",
"uid",
"."
] | b8d4fa64dd646566e508cdf838d6a3d03b1d53ea | https://github.com/csun-metalab/laravel-directory-authentication/blob/b8d4fa64dd646566e508cdf838d6a3d03b1d53ea/src/Authentication/Handlers/HandlerLDAP.php#L462-L466 |
13,403 | csun-metalab/laravel-directory-authentication | src/Authentication/Handlers/HandlerLDAP.php | HandlerLDAP.addObject | public function addObject($identifier, $attributes) {
// bind using the add credentials
$this->bind(
$this->add_dn,
$this->add_pw
);
// generate a new node and set its DN within the add subtree
$node = new Node();
// if the identifier contains a comma, it's likely a DN
if(strpos($identifier, ',') ... | php | public function addObject($identifier, $attributes) {
// bind using the add credentials
$this->bind(
$this->add_dn,
$this->add_pw
);
// generate a new node and set its DN within the add subtree
$node = new Node();
// if the identifier contains a comma, it's likely a DN
if(strpos($identifier, ',') ... | [
"public",
"function",
"addObject",
"(",
"$",
"identifier",
",",
"$",
"attributes",
")",
"{",
"// bind using the add credentials",
"$",
"this",
"->",
"bind",
"(",
"$",
"this",
"->",
"add_dn",
",",
"$",
"this",
"->",
"add_pw",
")",
";",
"// generate a new node a... | Adds an object into the add subtree using the specified identifier and
an associative array of attributes. Returns a boolean describing whether
the operation was successful. Throws an exception if the bind fails.
@param string $identifier The value to use as the "username" identifier
@param array $attributes Associati... | [
"Adds",
"an",
"object",
"into",
"the",
"add",
"subtree",
"using",
"the",
"specified",
"identifier",
"and",
"an",
"associative",
"array",
"of",
"attributes",
".",
"Returns",
"a",
"boolean",
"describing",
"whether",
"the",
"operation",
"was",
"successful",
".",
... | b8d4fa64dd646566e508cdf838d6a3d03b1d53ea | https://github.com/csun-metalab/laravel-directory-authentication/blob/b8d4fa64dd646566e508cdf838d6a3d03b1d53ea/src/Authentication/Handlers/HandlerLDAP.php#L479-L520 |
13,404 | csun-metalab/laravel-directory-authentication | src/Authentication/Handlers/HandlerLDAP.php | HandlerLDAP.modifyObject | public function modifyObject($identifier, $attributes) {
// bind using the modify credentials if anything other than "self"
// has been set as the method
if($this->modify_method != "self") {
$this->bind(
$this->modify_dn,
$this->modify_pw
);
}
// if the identifier contains a comma, it's likely ... | php | public function modifyObject($identifier, $attributes) {
// bind using the modify credentials if anything other than "self"
// has been set as the method
if($this->modify_method != "self") {
$this->bind(
$this->modify_dn,
$this->modify_pw
);
}
// if the identifier contains a comma, it's likely ... | [
"public",
"function",
"modifyObject",
"(",
"$",
"identifier",
",",
"$",
"attributes",
")",
"{",
"// bind using the modify credentials if anything other than \"self\"",
"// has been set as the method",
"if",
"(",
"$",
"this",
"->",
"modify_method",
"!=",
"\"self\"",
")",
"... | Modifies an object in the modify subtree using the specified identifier
and an associative array of attributes. Returns a boolean describing
whether the operation was successful. Throws an exception if the bind
fails.
@param string $identifier The value to use as the "username" identifier
@param array $attributes Asso... | [
"Modifies",
"an",
"object",
"in",
"the",
"modify",
"subtree",
"using",
"the",
"specified",
"identifier",
"and",
"an",
"associative",
"array",
"of",
"attributes",
".",
"Returns",
"a",
"boolean",
"describing",
"whether",
"the",
"operation",
"was",
"successful",
".... | b8d4fa64dd646566e508cdf838d6a3d03b1d53ea | https://github.com/csun-metalab/laravel-directory-authentication/blob/b8d4fa64dd646566e508cdf838d6a3d03b1d53ea/src/Authentication/Handlers/HandlerLDAP.php#L534-L584 |
13,405 | csun-metalab/laravel-directory-authentication | src/Authentication/Handlers/HandlerLDAP.php | HandlerLDAP.setAddBaseDN | public function setAddBaseDN($add_base_dn) {
if(!empty($add_base_dn)) {
$this->add_base_dn = $add_base_dn;
}
else
{
$this->add_base_dn = $this->basedn;
}
} | php | public function setAddBaseDN($add_base_dn) {
if(!empty($add_base_dn)) {
$this->add_base_dn = $add_base_dn;
}
else
{
$this->add_base_dn = $this->basedn;
}
} | [
"public",
"function",
"setAddBaseDN",
"(",
"$",
"add_base_dn",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"add_base_dn",
")",
")",
"{",
"$",
"this",
"->",
"add_base_dn",
"=",
"$",
"add_base_dn",
";",
"}",
"else",
"{",
"$",
"this",
"->",
"add_base_dn"... | Sets the base DN for add operations in a subtree.
@param string $add_base_dn The base DN for add operations | [
"Sets",
"the",
"base",
"DN",
"for",
"add",
"operations",
"in",
"a",
"subtree",
"."
] | b8d4fa64dd646566e508cdf838d6a3d03b1d53ea | https://github.com/csun-metalab/laravel-directory-authentication/blob/b8d4fa64dd646566e508cdf838d6a3d03b1d53ea/src/Authentication/Handlers/HandlerLDAP.php#L659-L667 |
13,406 | csun-metalab/laravel-directory-authentication | src/Authentication/Handlers/HandlerLDAP.php | HandlerLDAP.setAddDN | public function setAddDN($add_dn) {
if(!empty($add_dn)) {
$this->add_dn = $add_dn;
}
else
{
$this->add_dn = $this->dn;
}
} | php | public function setAddDN($add_dn) {
if(!empty($add_dn)) {
$this->add_dn = $add_dn;
}
else
{
$this->add_dn = $this->dn;
}
} | [
"public",
"function",
"setAddDN",
"(",
"$",
"add_dn",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"add_dn",
")",
")",
"{",
"$",
"this",
"->",
"add_dn",
"=",
"$",
"add_dn",
";",
"}",
"else",
"{",
"$",
"this",
"->",
"add_dn",
"=",
"$",
"this",
"... | Sets the admin DN for add operations in a subtree. If the parameter is
left empty, the search admin DN will be used instead.
@param string $add_dn The admin DN for add operations | [
"Sets",
"the",
"admin",
"DN",
"for",
"add",
"operations",
"in",
"a",
"subtree",
".",
"If",
"the",
"parameter",
"is",
"left",
"empty",
"the",
"search",
"admin",
"DN",
"will",
"be",
"used",
"instead",
"."
] | b8d4fa64dd646566e508cdf838d6a3d03b1d53ea | https://github.com/csun-metalab/laravel-directory-authentication/blob/b8d4fa64dd646566e508cdf838d6a3d03b1d53ea/src/Authentication/Handlers/HandlerLDAP.php#L675-L683 |
13,407 | csun-metalab/laravel-directory-authentication | src/Authentication/Handlers/HandlerLDAP.php | HandlerLDAP.setAddPassword | public function setAddPassword($add_pw) {
if(!empty($add_pw)) {
$this->add_pw = $add_pw;
}
else
{
$this->add_pw = $this->password;
}
} | php | public function setAddPassword($add_pw) {
if(!empty($add_pw)) {
$this->add_pw = $add_pw;
}
else
{
$this->add_pw = $this->password;
}
} | [
"public",
"function",
"setAddPassword",
"(",
"$",
"add_pw",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"add_pw",
")",
")",
"{",
"$",
"this",
"->",
"add_pw",
"=",
"$",
"add_pw",
";",
"}",
"else",
"{",
"$",
"this",
"->",
"add_pw",
"=",
"$",
"this... | Sets the admin password for add operations in a subtree. If the
parameter is left empty, the search admin password will be used instead.
@param string $add_pw The admin password for add operations | [
"Sets",
"the",
"admin",
"password",
"for",
"add",
"operations",
"in",
"a",
"subtree",
".",
"If",
"the",
"parameter",
"is",
"left",
"empty",
"the",
"search",
"admin",
"password",
"will",
"be",
"used",
"instead",
"."
] | b8d4fa64dd646566e508cdf838d6a3d03b1d53ea | https://github.com/csun-metalab/laravel-directory-authentication/blob/b8d4fa64dd646566e508cdf838d6a3d03b1d53ea/src/Authentication/Handlers/HandlerLDAP.php#L691-L699 |
13,408 | csun-metalab/laravel-directory-authentication | src/Authentication/Handlers/HandlerLDAP.php | HandlerLDAP.setModifyBaseDN | public function setModifyBaseDN($modify_base_dn) {
if(!empty($modify_base_dn)) {
$this->modify_base_dn = $modify_base_dn;
}
else
{
$this->modify_base_dn = $this->add_base_dn;
}
} | php | public function setModifyBaseDN($modify_base_dn) {
if(!empty($modify_base_dn)) {
$this->modify_base_dn = $modify_base_dn;
}
else
{
$this->modify_base_dn = $this->add_base_dn;
}
} | [
"public",
"function",
"setModifyBaseDN",
"(",
"$",
"modify_base_dn",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"modify_base_dn",
")",
")",
"{",
"$",
"this",
"->",
"modify_base_dn",
"=",
"$",
"modify_base_dn",
";",
"}",
"else",
"{",
"$",
"this",
"->",
... | Sets the base DN for modify operations in a subtree. If the parameter is
left empty, the add base DN will be used instead.
@param string $modify_base_dn The base DN for modify operations | [
"Sets",
"the",
"base",
"DN",
"for",
"modify",
"operations",
"in",
"a",
"subtree",
".",
"If",
"the",
"parameter",
"is",
"left",
"empty",
"the",
"add",
"base",
"DN",
"will",
"be",
"used",
"instead",
"."
] | b8d4fa64dd646566e508cdf838d6a3d03b1d53ea | https://github.com/csun-metalab/laravel-directory-authentication/blob/b8d4fa64dd646566e508cdf838d6a3d03b1d53ea/src/Authentication/Handlers/HandlerLDAP.php#L724-L732 |
13,409 | csun-metalab/laravel-directory-authentication | src/Authentication/Handlers/HandlerLDAP.php | HandlerLDAP.setModifyDN | public function setModifyDN($modify_dn) {
if(!empty($modify_dn)) {
$this->modify_dn = $modify_dn;
}
else
{
$this->modify_dn = $this->add_dn;
}
} | php | public function setModifyDN($modify_dn) {
if(!empty($modify_dn)) {
$this->modify_dn = $modify_dn;
}
else
{
$this->modify_dn = $this->add_dn;
}
} | [
"public",
"function",
"setModifyDN",
"(",
"$",
"modify_dn",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"modify_dn",
")",
")",
"{",
"$",
"this",
"->",
"modify_dn",
"=",
"$",
"modify_dn",
";",
"}",
"else",
"{",
"$",
"this",
"->",
"modify_dn",
"=",
... | Sets the admin DN for modify operations in a subtree. If the parameter
is left empty, the add admin DN will be used instead.
@param string $modify_dn The admin DN for modify operations | [
"Sets",
"the",
"admin",
"DN",
"for",
"modify",
"operations",
"in",
"a",
"subtree",
".",
"If",
"the",
"parameter",
"is",
"left",
"empty",
"the",
"add",
"admin",
"DN",
"will",
"be",
"used",
"instead",
"."
] | b8d4fa64dd646566e508cdf838d6a3d03b1d53ea | https://github.com/csun-metalab/laravel-directory-authentication/blob/b8d4fa64dd646566e508cdf838d6a3d03b1d53ea/src/Authentication/Handlers/HandlerLDAP.php#L740-L748 |
13,410 | csun-metalab/laravel-directory-authentication | src/Authentication/Handlers/HandlerLDAP.php | HandlerLDAP.setModifyPassword | public function setModifyPassword($modify_pw) {
if(!empty($modify_pw)) {
$this->modify_pw = $modify_pw;
}
else
{
$this->modify_pw = $this->add_pw;
}
} | php | public function setModifyPassword($modify_pw) {
if(!empty($modify_pw)) {
$this->modify_pw = $modify_pw;
}
else
{
$this->modify_pw = $this->add_pw;
}
} | [
"public",
"function",
"setModifyPassword",
"(",
"$",
"modify_pw",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"modify_pw",
")",
")",
"{",
"$",
"this",
"->",
"modify_pw",
"=",
"$",
"modify_pw",
";",
"}",
"else",
"{",
"$",
"this",
"->",
"modify_pw",
"... | Sets the admin password for modify operations in a subtree. If the
parameter is left empty, the add admin password will be used instead.
@param string $modify_dn The admin password for modify operations | [
"Sets",
"the",
"admin",
"password",
"for",
"modify",
"operations",
"in",
"a",
"subtree",
".",
"If",
"the",
"parameter",
"is",
"left",
"empty",
"the",
"add",
"admin",
"password",
"will",
"be",
"used",
"instead",
"."
] | b8d4fa64dd646566e508cdf838d6a3d03b1d53ea | https://github.com/csun-metalab/laravel-directory-authentication/blob/b8d4fa64dd646566e508cdf838d6a3d03b1d53ea/src/Authentication/Handlers/HandlerLDAP.php#L756-L764 |
13,411 | venta/framework | src/ServiceProvider/src/AbstractServiceProvider.php | AbstractServiceProvider.loadConfigFromFiles | protected function loadConfigFromFiles(string ...$configFiles)
{
foreach ($configFiles as $configFile) {
$this->config->merge(require $configFile);
}
} | php | protected function loadConfigFromFiles(string ...$configFiles)
{
foreach ($configFiles as $configFile) {
$this->config->merge(require $configFile);
}
} | [
"protected",
"function",
"loadConfigFromFiles",
"(",
"string",
"...",
"$",
"configFiles",
")",
"{",
"foreach",
"(",
"$",
"configFiles",
"as",
"$",
"configFile",
")",
"{",
"$",
"this",
"->",
"config",
"->",
"merge",
"(",
"require",
"$",
"configFile",
")",
"... | Merges config params from service provider with the global configuration.
@param string[] ...$configFiles | [
"Merges",
"config",
"params",
"from",
"service",
"provider",
"with",
"the",
"global",
"configuration",
"."
] | 514a7854cc69f84f47e62a58cc55efd68b7c9f83 | https://github.com/venta/framework/blob/514a7854cc69f84f47e62a58cc55efd68b7c9f83/src/ServiceProvider/src/AbstractServiceProvider.php#L82-L87 |
13,412 | venta/framework | src/ServiceProvider/src/AbstractServiceProvider.php | AbstractServiceProvider.provideCommands | protected function provideCommands(string ...$commandClasses)
{
/** @var CommandCollection $commandCollector */
$commandCollector = $this->container->get(CommandCollection::class);
foreach ($commandClasses as $commandClass) {
$commandCollector->add($commandClass);
}
} | php | protected function provideCommands(string ...$commandClasses)
{
/** @var CommandCollection $commandCollector */
$commandCollector = $this->container->get(CommandCollection::class);
foreach ($commandClasses as $commandClass) {
$commandCollector->add($commandClass);
}
} | [
"protected",
"function",
"provideCommands",
"(",
"string",
"...",
"$",
"commandClasses",
")",
"{",
"/** @var CommandCollection $commandCollector */",
"$",
"commandCollector",
"=",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
"CommandCollection",
"::",
"class",
")... | Registers commands exposed by service provider.
@param string[] ...$commandClasses | [
"Registers",
"commands",
"exposed",
"by",
"service",
"provider",
"."
] | 514a7854cc69f84f47e62a58cc55efd68b7c9f83 | https://github.com/venta/framework/blob/514a7854cc69f84f47e62a58cc55efd68b7c9f83/src/ServiceProvider/src/AbstractServiceProvider.php#L94-L101 |
13,413 | incraigulous/contentful-sdk | src/ManagementClient.php | ManagementClient.post | function post($resource, $payload = array(), $headers = array())
{
$result = $this->client->post($this->build_url($resource), [
'headers' => array_merge([
'Content-Type' => $this->getContentType(),
'Authorization' => $this->getBearer(),
'Content-Le... | php | function post($resource, $payload = array(), $headers = array())
{
$result = $this->client->post($this->build_url($resource), [
'headers' => array_merge([
'Content-Type' => $this->getContentType(),
'Authorization' => $this->getBearer(),
'Content-Le... | [
"function",
"post",
"(",
"$",
"resource",
",",
"$",
"payload",
"=",
"array",
"(",
")",
",",
"$",
"headers",
"=",
"array",
"(",
")",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"client",
"->",
"post",
"(",
"$",
"this",
"->",
"build_url",
"(",... | Build and make a POST request.
@param $resource
@param array $payload
@param array $headers
@return GuzzleHttp\Message\FutureResponse|GuzzleHttp\Message\ResponseInterface|GuzzleHttp\Ring\Future\FutureInterface|mixed|null | [
"Build",
"and",
"make",
"a",
"POST",
"request",
"."
] | 29399b11b0e085a06ea5976661378c379fe5a731 | https://github.com/incraigulous/contentful-sdk/blob/29399b11b0e085a06ea5976661378c379fe5a731/src/ManagementClient.php#L42-L53 |
13,414 | incraigulous/contentful-sdk | src/ManagementClient.php | ManagementClient.delete | function delete($resource, $headers = array())
{
$result = $this->client->delete($this->build_url($resource), [
'headers' => array_merge([
'Authorization' => $this->getBearer()
], $headers)
]);
return $result;
} | php | function delete($resource, $headers = array())
{
$result = $this->client->delete($this->build_url($resource), [
'headers' => array_merge([
'Authorization' => $this->getBearer()
], $headers)
]);
return $result;
} | [
"function",
"delete",
"(",
"$",
"resource",
",",
"$",
"headers",
"=",
"array",
"(",
")",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"client",
"->",
"delete",
"(",
"$",
"this",
"->",
"build_url",
"(",
"$",
"resource",
")",
",",
"[",
"'headers'... | Build and make a DELETE request.
@param $resource
@param array $headers
@return GuzzleHttp\Message\FutureResponse|GuzzleHttp\Message\ResponseInterface|GuzzleHttp\Ring\Future\FutureInterface|mixed|null | [
"Build",
"and",
"make",
"a",
"DELETE",
"request",
"."
] | 29399b11b0e085a06ea5976661378c379fe5a731 | https://github.com/incraigulous/contentful-sdk/blob/29399b11b0e085a06ea5976661378c379fe5a731/src/ManagementClient.php#L82-L90 |
13,415 | attm2x/m2x-php | src/HttpRequest.php | HttpRequest.request | public function request($method, $url, $params = array(), $vars = array()) {
$this->request = curl_init();
$this->setRequestMethod($method);
$this->setOptions($url, $method, $params, $vars);
$data = curl_exec($this->request);
if ($data === false) {
throw new \Exception('Curl Error: ' . curl... | php | public function request($method, $url, $params = array(), $vars = array()) {
$this->request = curl_init();
$this->setRequestMethod($method);
$this->setOptions($url, $method, $params, $vars);
$data = curl_exec($this->request);
if ($data === false) {
throw new \Exception('Curl Error: ' . curl... | [
"public",
"function",
"request",
"(",
"$",
"method",
",",
"$",
"url",
",",
"$",
"params",
"=",
"array",
"(",
")",
",",
"$",
"vars",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"request",
"=",
"curl_init",
"(",
")",
";",
"$",
"this",
"-... | Executes a request
@param string $method
@param string $url
@param array $params
@param array $vars
@return HttpResponse | [
"Executes",
"a",
"request"
] | 4c2ff6d70af50538818855e648af24bf5cf16ead | https://github.com/attm2x/m2x-php/blob/4c2ff6d70af50538818855e648af24bf5cf16ead/src/HttpRequest.php#L86-L103 |
13,416 | attm2x/m2x-php | src/HttpRequest.php | HttpRequest.setRequestMethod | protected function setRequestMethod($method) {
switch (strtoupper($method)) {
case 'HEAD':
curl_setopt($this->request, CURLOPT_NOBODY, true);
break;
case 'GET':
# Hack to allow a request body to be set via CURLOPT_POSTFIELDS
# for GET requests.
curl_setopt($this->... | php | protected function setRequestMethod($method) {
switch (strtoupper($method)) {
case 'HEAD':
curl_setopt($this->request, CURLOPT_NOBODY, true);
break;
case 'GET':
# Hack to allow a request body to be set via CURLOPT_POSTFIELDS
# for GET requests.
curl_setopt($this->... | [
"protected",
"function",
"setRequestMethod",
"(",
"$",
"method",
")",
"{",
"switch",
"(",
"strtoupper",
"(",
"$",
"method",
")",
")",
"{",
"case",
"'HEAD'",
":",
"curl_setopt",
"(",
"$",
"this",
"->",
"request",
",",
"CURLOPT_NOBODY",
",",
"true",
")",
"... | Set the associated CURL options for a request method
@param string $method
@return void | [
"Set",
"the",
"associated",
"CURL",
"options",
"for",
"a",
"request",
"method"
] | 4c2ff6d70af50538818855e648af24bf5cf16ead | https://github.com/attm2x/m2x-php/blob/4c2ff6d70af50538818855e648af24bf5cf16ead/src/HttpRequest.php#L111-L127 |
13,417 | attm2x/m2x-php | src/HttpRequest.php | HttpRequest.setOptions | protected function setOptions($url, $method, $params, $vars) {
if(!empty($params)) {
$url = $url . "?" . http_build_query($params);
}
curl_setopt($this->request, CURLOPT_URL, $url);
curl_setopt($this->request, CURLOPT_HEADER, true);
curl_setopt($this->request, CURLOPT_RETURNTRANSFER, true);
... | php | protected function setOptions($url, $method, $params, $vars) {
if(!empty($params)) {
$url = $url . "?" . http_build_query($params);
}
curl_setopt($this->request, CURLOPT_URL, $url);
curl_setopt($this->request, CURLOPT_HEADER, true);
curl_setopt($this->request, CURLOPT_RETURNTRANSFER, true);
... | [
"protected",
"function",
"setOptions",
"(",
"$",
"url",
",",
"$",
"method",
",",
"$",
"params",
",",
"$",
"vars",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"params",
")",
")",
"{",
"$",
"url",
"=",
"$",
"url",
".",
"\"?\"",
".",
"http_build_qu... | Set the CURL options
@param string $url
@param array $method
@param array $params
@param array $vars
@return void | [
"Set",
"the",
"CURL",
"options"
] | 4c2ff6d70af50538818855e648af24bf5cf16ead | https://github.com/attm2x/m2x-php/blob/4c2ff6d70af50538818855e648af24bf5cf16ead/src/HttpRequest.php#L138-L158 |
13,418 | attm2x/m2x-php | src/HttpRequest.php | HttpRequest.setJSONPayload | protected function setJSONPayload($vars) {
$this->headers['Content-Type'] = 'application/json';
$this->headers['Content-Length'] = 0;
$this->headers['Expect'] = '';
if (!empty($vars)) {
$data = json_encode($vars);
$this->headers['Content-Length'] = strlen($data);
curl_setopt($this->re... | php | protected function setJSONPayload($vars) {
$this->headers['Content-Type'] = 'application/json';
$this->headers['Content-Length'] = 0;
$this->headers['Expect'] = '';
if (!empty($vars)) {
$data = json_encode($vars);
$this->headers['Content-Length'] = strlen($data);
curl_setopt($this->re... | [
"protected",
"function",
"setJSONPayload",
"(",
"$",
"vars",
")",
"{",
"$",
"this",
"->",
"headers",
"[",
"'Content-Type'",
"]",
"=",
"'application/json'",
";",
"$",
"this",
"->",
"headers",
"[",
"'Content-Length'",
"]",
"=",
"0",
";",
"$",
"this",
"->",
... | Set the JSON payload
@param array $vars | [
"Set",
"the",
"JSON",
"payload"
] | 4c2ff6d70af50538818855e648af24bf5cf16ead | https://github.com/attm2x/m2x-php/blob/4c2ff6d70af50538818855e648af24bf5cf16ead/src/HttpRequest.php#L165-L175 |
13,419 | kriskbx/mikado | src/Formatters/MetaFormatter.php | MetaFormatter.format | public function format($data)
{
if (!$data->hasProperty('meta')) {
return $data;
}
// Loop through the meta arrays/objects/whatever
foreach ($data->getProperty('meta') as $meta) {
$regex = false;
// Check if the meta array is valid
if... | php | public function format($data)
{
if (!$data->hasProperty('meta')) {
return $data;
}
// Loop through the meta arrays/objects/whatever
foreach ($data->getProperty('meta') as $meta) {
$regex = false;
// Check if the meta array is valid
if... | [
"public",
"function",
"format",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"!",
"$",
"data",
"->",
"hasProperty",
"(",
"'meta'",
")",
")",
"{",
"return",
"$",
"data",
";",
"}",
"// Loop through the meta arrays/objects/whatever",
"foreach",
"(",
"$",
"data",
"-... | Format the meta fields from the given data.
@param FormatAble $data
@return FormatAble | [
"Format",
"the",
"meta",
"fields",
"from",
"the",
"given",
"data",
"."
] | f00e566d682a66796f3f8a68b348920fadd9ee87 | https://github.com/kriskbx/mikado/blob/f00e566d682a66796f3f8a68b348920fadd9ee87/src/Formatters/MetaFormatter.php#L41-L73 |
13,420 | kriskbx/mikado | src/Formatters/MetaFormatter.php | MetaFormatter.metaKeyIsRegex | protected function metaKeyIsRegex($meta)
{
if (!isset($meta['meta_key'])) {
return false;
}
return $this->pregMatchArray($meta['meta_key'], $this->regex);
} | php | protected function metaKeyIsRegex($meta)
{
if (!isset($meta['meta_key'])) {
return false;
}
return $this->pregMatchArray($meta['meta_key'], $this->regex);
} | [
"protected",
"function",
"metaKeyIsRegex",
"(",
"$",
"meta",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"meta",
"[",
"'meta_key'",
"]",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"$",
"this",
"->",
"pregMatchArray",
"(",
"$",
"meta",
"["... | Meta key is regex?
@param array $meta
@return array|bool | [
"Meta",
"key",
"is",
"regex?"
] | f00e566d682a66796f3f8a68b348920fadd9ee87 | https://github.com/kriskbx/mikado/blob/f00e566d682a66796f3f8a68b348920fadd9ee87/src/Formatters/MetaFormatter.php#L98-L105 |
13,421 | kriskbx/mikado | src/Formatters/MetaFormatter.php | MetaFormatter.getUnserializedValue | protected function getUnserializedValue($meta)
{
$value = $meta['meta_value'];
if ($unserializedValue = @unserialize($value)) {
$value = $unserializedValue;
}
return $value;
} | php | protected function getUnserializedValue($meta)
{
$value = $meta['meta_value'];
if ($unserializedValue = @unserialize($value)) {
$value = $unserializedValue;
}
return $value;
} | [
"protected",
"function",
"getUnserializedValue",
"(",
"$",
"meta",
")",
"{",
"$",
"value",
"=",
"$",
"meta",
"[",
"'meta_value'",
"]",
";",
"if",
"(",
"$",
"unserializedValue",
"=",
"@",
"unserialize",
"(",
"$",
"value",
")",
")",
"{",
"$",
"value",
"=... | Get unserialized value.
@param array $meta
@return mixed | [
"Get",
"unserialized",
"value",
"."
] | f00e566d682a66796f3f8a68b348920fadd9ee87 | https://github.com/kriskbx/mikado/blob/f00e566d682a66796f3f8a68b348920fadd9ee87/src/Formatters/MetaFormatter.php#L114-L123 |
13,422 | ikwattro/guzzle-stereo | src/Recorder.php | Recorder.processConfig | private function processConfig()
{
$processor = new Processor();
$coreConfig = Yaml::parse(file_get_contents(__DIR__.'/Resources/core_filters.yml'));
$configs = array($this->config, $coreConfig);
$configuration = new StereoConfiguration();
$processedConfiguration = $processor... | php | private function processConfig()
{
$processor = new Processor();
$coreConfig = Yaml::parse(file_get_contents(__DIR__.'/Resources/core_filters.yml'));
$configs = array($this->config, $coreConfig);
$configuration = new StereoConfiguration();
$processedConfiguration = $processor... | [
"private",
"function",
"processConfig",
"(",
")",
"{",
"$",
"processor",
"=",
"new",
"Processor",
"(",
")",
";",
"$",
"coreConfig",
"=",
"Yaml",
"::",
"parse",
"(",
"file_get_contents",
"(",
"__DIR__",
".",
"'/Resources/core_filters.yml'",
")",
")",
";",
"$"... | Process configuration for registering tapes and filters. | [
"Process",
"configuration",
"for",
"registering",
"tapes",
"and",
"filters",
"."
] | a76f19b0a81048eca104f07bd490bf06a46b6e9d | https://github.com/ikwattro/guzzle-stereo/blob/a76f19b0a81048eca104f07bd490bf06a46b6e9d/src/Recorder.php#L145-L172 |
13,423 | ikwattro/guzzle-stereo | src/Recorder.php | Recorder.dump | public function dump()
{
foreach ($this->tapes as $tape) {
if ($tape->hasResponses()) {
$fileName = 'record_'.$tape->getName().'.json';
$content = $this->formatter->encodeResponsesCollection($tape->getResponses());
$this->writer->write($fileName, $... | php | public function dump()
{
foreach ($this->tapes as $tape) {
if ($tape->hasResponses()) {
$fileName = 'record_'.$tape->getName().'.json';
$content = $this->formatter->encodeResponsesCollection($tape->getResponses());
$this->writer->write($fileName, $... | [
"public",
"function",
"dump",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"tapes",
"as",
"$",
"tape",
")",
"{",
"if",
"(",
"$",
"tape",
"->",
"hasResponses",
"(",
")",
")",
"{",
"$",
"fileName",
"=",
"'record_'",
".",
"$",
"tape",
"->",
"ge... | Dumps the tapes on disk. | [
"Dumps",
"the",
"tapes",
"on",
"disk",
"."
] | a76f19b0a81048eca104f07bd490bf06a46b6e9d | https://github.com/ikwattro/guzzle-stereo/blob/a76f19b0a81048eca104f07bd490bf06a46b6e9d/src/Recorder.php#L185-L194 |
13,424 | ikwattro/guzzle-stereo | src/Recorder.php | Recorder.getTapeContent | public function getTapeContent($name)
{
$tape = $this->getTape($name);
if ($tape->hasResponses()) {
$content = $this->formatter->encodeResponsesCollection($tape->getResponses());
return $content;
}
return;
} | php | public function getTapeContent($name)
{
$tape = $this->getTape($name);
if ($tape->hasResponses()) {
$content = $this->formatter->encodeResponsesCollection($tape->getResponses());
return $content;
}
return;
} | [
"public",
"function",
"getTapeContent",
"(",
"$",
"name",
")",
"{",
"$",
"tape",
"=",
"$",
"this",
"->",
"getTape",
"(",
"$",
"name",
")",
";",
"if",
"(",
"$",
"tape",
"->",
"hasResponses",
"(",
")",
")",
"{",
"$",
"content",
"=",
"$",
"this",
"-... | Returns the content of a specific tape without writing it to disk.
@param string $name
@return null|string | [
"Returns",
"the",
"content",
"of",
"a",
"specific",
"tape",
"without",
"writing",
"it",
"to",
"disk",
"."
] | a76f19b0a81048eca104f07bd490bf06a46b6e9d | https://github.com/ikwattro/guzzle-stereo/blob/a76f19b0a81048eca104f07bd490bf06a46b6e9d/src/Recorder.php#L203-L213 |
13,425 | DevGroup-ru/yii2-data-structure-tools | src/widgets/PropertiesForm.php | PropertiesForm.buildTabsArray | protected function buildTabsArray($availableGroups, $attachedGroups)
{
$addGroupItems = [];
$tabs = [];
foreach ($availableGroups as $id => $name) {
if (!in_array($id, $attachedGroups)) {
$addGroupItems[$id] = $name;
}
$isAttached = in_arra... | php | protected function buildTabsArray($availableGroups, $attachedGroups)
{
$addGroupItems = [];
$tabs = [];
foreach ($availableGroups as $id => $name) {
if (!in_array($id, $attachedGroups)) {
$addGroupItems[$id] = $name;
}
$isAttached = in_arra... | [
"protected",
"function",
"buildTabsArray",
"(",
"$",
"availableGroups",
",",
"$",
"attachedGroups",
")",
"{",
"$",
"addGroupItems",
"=",
"[",
"]",
";",
"$",
"tabs",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"availableGroups",
"as",
"$",
"id",
"=>",
"$",
... | Build array for tabs.
@param array $availableGroups
@param array $attachedGroups
@return array | [
"Build",
"array",
"for",
"tabs",
"."
] | a5b24d7c0b24d4b0d58cacd91ec7fd876e979097 | https://github.com/DevGroup-ru/yii2-data-structure-tools/blob/a5b24d7c0b24d4b0d58cacd91ec7fd876e979097/src/widgets/PropertiesForm.php#L60-L131 |
13,426 | taskforcedev/laravel-support | src/Helpers/Composer.php | Composer.packageExists | public function packageExists($namespace, $package)
{
$folder = $this->vendorFolder . $namespace;
$folderExists = file_exists($folder);
if (!$folderExists) {
return false;
}
$packageFolder = $folder . '/' . $package;
$packageFolderExists = file_exists($p... | php | public function packageExists($namespace, $package)
{
$folder = $this->vendorFolder . $namespace;
$folderExists = file_exists($folder);
if (!$folderExists) {
return false;
}
$packageFolder = $folder . '/' . $package;
$packageFolderExists = file_exists($p... | [
"public",
"function",
"packageExists",
"(",
"$",
"namespace",
",",
"$",
"package",
")",
"{",
"$",
"folder",
"=",
"$",
"this",
"->",
"vendorFolder",
".",
"$",
"namespace",
";",
"$",
"folderExists",
"=",
"file_exists",
"(",
"$",
"folder",
")",
";",
"if",
... | Determine if a composer package exists.
@param string $namespace Package namespace.
@param string $package Package name.
@return bool | [
"Determine",
"if",
"a",
"composer",
"package",
"exists",
"."
] | fdfa90ca10ffd57bc6f7aca20d2f3db7dc259221 | https://github.com/taskforcedev/laravel-support/blob/fdfa90ca10ffd57bc6f7aca20d2f3db7dc259221/src/Helpers/Composer.php#L21-L34 |
13,427 | Runscope/guzzle-runscope | src/Runscope/Plugin/RunscopePlugin.php | RunscopePlugin.onBeforeSend | public function onBeforeSend(Event $event)
{
/** @var \Guzzle\Http\Message\Request $request */
$request = $event['request'];
list($newUrl, $port) = $this->proxify(
$request->getUrl(),
$this->bucketKey,
$this->gatewayHost
);
$request->setU... | php | public function onBeforeSend(Event $event)
{
/** @var \Guzzle\Http\Message\Request $request */
$request = $event['request'];
list($newUrl, $port) = $this->proxify(
$request->getUrl(),
$this->bucketKey,
$this->gatewayHost
);
$request->setU... | [
"public",
"function",
"onBeforeSend",
"(",
"Event",
"$",
"event",
")",
"{",
"/** @var \\Guzzle\\Http\\Message\\Request $request */",
"$",
"request",
"=",
"$",
"event",
"[",
"'request'",
"]",
";",
"list",
"(",
"$",
"newUrl",
",",
"$",
"port",
")",
"=",
"$",
"... | Event triggered right before sending a request
@param Event $event | [
"Event",
"triggered",
"right",
"before",
"sending",
"a",
"request"
] | e369cb90e0dabfc835d32a1e0614e0e2954d510b | https://github.com/Runscope/guzzle-runscope/blob/e369cb90e0dabfc835d32a1e0614e0e2954d510b/src/Runscope/Plugin/RunscopePlugin.php#L41-L61 |
13,428 | LightboxDigital/wp-dynamic-image-resizer | includes/class-dynamic-image-resizer-loader.php | Dynamic_Image_Resizer_Loader.add_action | public function add_action( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
$this->actions = $this->add( $this->actions, $hook, $component, $callback, $priority, $accepted_args );
} | php | public function add_action( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
$this->actions = $this->add( $this->actions, $hook, $component, $callback, $priority, $accepted_args );
} | [
"public",
"function",
"add_action",
"(",
"$",
"hook",
",",
"$",
"component",
",",
"$",
"callback",
",",
"$",
"priority",
"=",
"10",
",",
"$",
"accepted_args",
"=",
"1",
")",
"{",
"$",
"this",
"->",
"actions",
"=",
"$",
"this",
"->",
"add",
"(",
"$"... | Add a new action to the collection to be registered with WordPress.
@since 1.0.0
@param string $hook The name of the WordPress action that is being registered.
@param object $component A reference to the instance of the object on which the action is defined.
@param string $callback The name of the f... | [
"Add",
"a",
"new",
"action",
"to",
"the",
"collection",
"to",
"be",
"registered",
"with",
"WordPress",
"."
] | cc1d67192c8463eba4c0920130abec933ed2296b | https://github.com/LightboxDigital/wp-dynamic-image-resizer/blob/cc1d67192c8463eba4c0920130abec933ed2296b/includes/class-dynamic-image-resizer-loader.php#L66-L68 |
13,429 | LightboxDigital/wp-dynamic-image-resizer | includes/class-dynamic-image-resizer-loader.php | Dynamic_Image_Resizer_Loader.add_filter | public function add_filter( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
$this->filters = $this->add( $this->filters, $hook, $component, $callback, $priority, $accepted_args );
} | php | public function add_filter( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
$this->filters = $this->add( $this->filters, $hook, $component, $callback, $priority, $accepted_args );
} | [
"public",
"function",
"add_filter",
"(",
"$",
"hook",
",",
"$",
"component",
",",
"$",
"callback",
",",
"$",
"priority",
"=",
"10",
",",
"$",
"accepted_args",
"=",
"1",
")",
"{",
"$",
"this",
"->",
"filters",
"=",
"$",
"this",
"->",
"add",
"(",
"$"... | Add a new filter to the collection to be registered with WordPress.
@since 1.0.0
@param string $hook The name of the WordPress filter that is being registered.
@param object $component A reference to the instance of the object on which the filter is defined.
@param string $callback The name of the f... | [
"Add",
"a",
"new",
"filter",
"to",
"the",
"collection",
"to",
"be",
"registered",
"with",
"WordPress",
"."
] | cc1d67192c8463eba4c0920130abec933ed2296b | https://github.com/LightboxDigital/wp-dynamic-image-resizer/blob/cc1d67192c8463eba4c0920130abec933ed2296b/includes/class-dynamic-image-resizer-loader.php#L81-L83 |
13,430 | LightboxDigital/wp-dynamic-image-resizer | includes/class-dynamic-image-resizer-loader.php | Dynamic_Image_Resizer_Loader.run | public function run() {
foreach ( $this->filters as $hook ) {
add_filter( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
}
foreach ( $this->actions as $hook ) {
add_action( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['pr... | php | public function run() {
foreach ( $this->filters as $hook ) {
add_filter( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
}
foreach ( $this->actions as $hook ) {
add_action( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['pr... | [
"public",
"function",
"run",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"filters",
"as",
"$",
"hook",
")",
"{",
"add_filter",
"(",
"$",
"hook",
"[",
"'hook'",
"]",
",",
"array",
"(",
"$",
"hook",
"[",
"'component'",
"]",
",",
"$",
"hook",
... | Register the filters and actions with WordPress.
@since 1.0.0 | [
"Register",
"the",
"filters",
"and",
"actions",
"with",
"WordPress",
"."
] | cc1d67192c8463eba4c0920130abec933ed2296b | https://github.com/LightboxDigital/wp-dynamic-image-resizer/blob/cc1d67192c8463eba4c0920130abec933ed2296b/includes/class-dynamic-image-resizer-loader.php#L119-L129 |
13,431 | sifophp/sifo-common-instance | models/i18n/translator.php | I18nTranslatorModel.getTranslations | public function getTranslations( $language, $instance, $parent_instance = false )
{
$sql = <<<TRANSLATIONS
SELECT
id,
message,
comment,
SUBSTRING_INDEX(GROUP_CONCAT(destination_instance ORDER BY language_depth DESC, instance_depth DESC SEPARATOR '##-##'),'##-##',1) a... | php | public function getTranslations( $language, $instance, $parent_instance = false )
{
$sql = <<<TRANSLATIONS
SELECT
id,
message,
comment,
SUBSTRING_INDEX(GROUP_CONCAT(destination_instance ORDER BY language_depth DESC, instance_depth DESC SEPARATOR '##-##'),'##-##',1) a... | [
"public",
"function",
"getTranslations",
"(",
"$",
"language",
",",
"$",
"instance",
",",
"$",
"parent_instance",
"=",
"false",
")",
"{",
"$",
"sql",
"=",
" <<<TRANSLATIONS\n SELECT\n id,\n message,\n comment,\n SUBSTRING_INDEX(GROUP_CONCA... | Returns the translations list for a given langauge.
@param string $language
@return array | [
"Returns",
"the",
"translations",
"list",
"for",
"a",
"given",
"langauge",
"."
] | 52d54ea3e565bd2bccd77e0b0a6a99b5cae3aff5 | https://github.com/sifophp/sifo-common-instance/blob/52d54ea3e565bd2bccd77e0b0a6a99b5cae3aff5/models/i18n/translator.php#L16-L88 |
13,432 | sifophp/sifo-common-instance | models/i18n/translator.php | I18nTranslatorModel.getStats | public function getStats( $instance, $parent_instance )
{
$parent_instance_sql = '';
$parent_instance_sub_sql = 'm.instance = ? OR t.instance = ?';
if ( $parent_instance )
{
$parent_instance_sql = ' OR instance IS NULL ';
$parent_instance_sub_sql = '( m.instance = ? OR m.instance IS NULL ) AND ( t.in... | php | public function getStats( $instance, $parent_instance )
{
$parent_instance_sql = '';
$parent_instance_sub_sql = 'm.instance = ? OR t.instance = ?';
if ( $parent_instance )
{
$parent_instance_sql = ' OR instance IS NULL ';
$parent_instance_sub_sql = '( m.instance = ? OR m.instance IS NULL ) AND ( t.in... | [
"public",
"function",
"getStats",
"(",
"$",
"instance",
",",
"$",
"parent_instance",
")",
"{",
"$",
"parent_instance_sql",
"=",
"''",
";",
"$",
"parent_instance_sub_sql",
"=",
"'m.instance = ? OR t.instance = ?'",
";",
"if",
"(",
"$",
"parent_instance",
")",
"{",
... | Get stats of translations.
@return array | [
"Get",
"stats",
"of",
"translations",
"."
] | 52d54ea3e565bd2bccd77e0b0a6a99b5cae3aff5 | https://github.com/sifophp/sifo-common-instance/blob/52d54ea3e565bd2bccd77e0b0a6a99b5cae3aff5/models/i18n/translator.php#L115-L150 |
13,433 | sifophp/sifo-common-instance | models/i18n/translator.php | I18nTranslatorModel.addMessage | public function addMessage( $message, $instance = null )
{
$sql = <<<SQL
INSERT INTO
i18n_messages
SET
message = ?,
instance = ?
SQL;
return $this->Execute( $sql, array(
'tag' => 'Add message',
$message,
... | php | public function addMessage( $message, $instance = null )
{
$sql = <<<SQL
INSERT INTO
i18n_messages
SET
message = ?,
instance = ?
SQL;
return $this->Execute( $sql, array(
'tag' => 'Add message',
$message,
... | [
"public",
"function",
"addMessage",
"(",
"$",
"message",
",",
"$",
"instance",
"=",
"null",
")",
"{",
"$",
"sql",
"=",
" <<<SQL\nINSERT INTO\n\ti18n_messages\nSET\n\tmessage \t= ?,\n\tinstance\t= ?\nSQL",
";",
"return",
"$",
"this",
"->",
"Execute",
"(",
"$",
"sql",... | Add message in database.
@param $message
@return mixed | [
"Add",
"message",
"in",
"database",
"."
] | 52d54ea3e565bd2bccd77e0b0a6a99b5cae3aff5 | https://github.com/sifophp/sifo-common-instance/blob/52d54ea3e565bd2bccd77e0b0a6a99b5cae3aff5/models/i18n/translator.php#L157-L172 |
13,434 | venta/framework | src/Routing/src/Exception/MethodNotAllowedException.php | MethodNotAllowedException.buildMessage | protected function buildMessage(array $allowedMethods): string
{
$ending = 'Allowed method is: %s';
if (count($allowedMethods) > 1) {
$ending = 'Allowed methods are: %s';
}
return sprintf('Method is not allowed. ' . $ending, implode(', ', $allowedMethods));
} | php | protected function buildMessage(array $allowedMethods): string
{
$ending = 'Allowed method is: %s';
if (count($allowedMethods) > 1) {
$ending = 'Allowed methods are: %s';
}
return sprintf('Method is not allowed. ' . $ending, implode(', ', $allowedMethods));
} | [
"protected",
"function",
"buildMessage",
"(",
"array",
"$",
"allowedMethods",
")",
":",
"string",
"{",
"$",
"ending",
"=",
"'Allowed method is: %s'",
";",
"if",
"(",
"count",
"(",
"$",
"allowedMethods",
")",
">",
"1",
")",
"{",
"$",
"ending",
"=",
"'Allowe... | Builds error message
@param array $allowedMethods
@return string | [
"Builds",
"error",
"message"
] | 514a7854cc69f84f47e62a58cc55efd68b7c9f83 | https://github.com/venta/framework/blob/514a7854cc69f84f47e62a58cc55efd68b7c9f83/src/Routing/src/Exception/MethodNotAllowedException.php#L30-L39 |
13,435 | crysalead/net | src/Http/Request.php | Request.accepts | public function accepts()
{
$accepts = $this->hasHeader('Accept') ? $this->getHeader('Accept') : ['text/html'];
foreach ($accepts as $i => $value) {
list($mime, $q) = preg_split('/;\s*q\s*=\s*/', $value, 2) + [$value, 1.0];
$stars = substr_count($mime, '*');
$sco... | php | public function accepts()
{
$accepts = $this->hasHeader('Accept') ? $this->getHeader('Accept') : ['text/html'];
foreach ($accepts as $i => $value) {
list($mime, $q) = preg_split('/;\s*q\s*=\s*/', $value, 2) + [$value, 1.0];
$stars = substr_count($mime, '*');
$sco... | [
"public",
"function",
"accepts",
"(",
")",
"{",
"$",
"accepts",
"=",
"$",
"this",
"->",
"hasHeader",
"(",
"'Accept'",
")",
"?",
"$",
"this",
"->",
"getHeader",
"(",
"'Accept'",
")",
":",
"[",
"'text/html'",
"]",
";",
"foreach",
"(",
"$",
"accepts",
"... | Return information about the mime of content that the client is requesting.
@param boolean $all If `true` lists all accepted content mimes
@return mixed Returns the negotiated mime or the accepted content mimes sorted by
client preference if `$all` is set to `true`. | [
"Return",
"information",
"about",
"the",
"mime",
"of",
"content",
"that",
"the",
"client",
"is",
"requesting",
"."
] | 4d75abead39e954529b56cbffa3841a9cd3044bb | https://github.com/crysalead/net/blob/4d75abead39e954529b56cbffa3841a9cd3044bb/src/Http/Request.php#L197-L211 |
13,436 | crysalead/net | src/Http/Request.php | Request.url | public function url()
{
$scheme = $this->scheme();
$scheme = $scheme ? $scheme . '://' : '//';
$query = $this->query() ? '?' . http_build_query($this->query()) : '';
$fragment = $this->fragment() ? '#' . $this->fragment() : '';
return $scheme . $this->host() . $this->path() .... | php | public function url()
{
$scheme = $this->scheme();
$scheme = $scheme ? $scheme . '://' : '//';
$query = $this->query() ? '?' . http_build_query($this->query()) : '';
$fragment = $this->fragment() ? '#' . $this->fragment() : '';
return $scheme . $this->host() . $this->path() .... | [
"public",
"function",
"url",
"(",
")",
"{",
"$",
"scheme",
"=",
"$",
"this",
"->",
"scheme",
"(",
")",
";",
"$",
"scheme",
"=",
"$",
"scheme",
"?",
"$",
"scheme",
".",
"'://'",
":",
"'//'",
";",
"$",
"query",
"=",
"$",
"this",
"->",
"query",
"(... | Returns the message URI.
@return string | [
"Returns",
"the",
"message",
"URI",
"."
] | 4d75abead39e954529b56cbffa3841a9cd3044bb | https://github.com/crysalead/net/blob/4d75abead39e954529b56cbffa3841a9cd3044bb/src/Http/Request.php#L341-L348 |
13,437 | crysalead/net | src/Http/Request.php | Request.credential | public function credential()
{
if (!$username = $this->username()) {
return '';
}
$credentials = $username;
if ($password = $this->password()) {
$credentials .= ':' . $password;
}
return $credentials;
} | php | public function credential()
{
if (!$username = $this->username()) {
return '';
}
$credentials = $username;
if ($password = $this->password()) {
$credentials .= ':' . $password;
}
return $credentials;
} | [
"public",
"function",
"credential",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"username",
"=",
"$",
"this",
"->",
"username",
"(",
")",
")",
"{",
"return",
"''",
";",
"}",
"$",
"credentials",
"=",
"$",
"username",
";",
"if",
"(",
"$",
"password",
"=",
... | Returns the credential.
@return string|null The credential string. | [
"Returns",
"the",
"credential",
"."
] | 4d75abead39e954529b56cbffa3841a9cd3044bb | https://github.com/crysalead/net/blob/4d75abead39e954529b56cbffa3841a9cd3044bb/src/Http/Request.php#L355-L365 |
13,438 | crysalead/net | src/Http/Request.php | Request.requestTarget | public function requestTarget()
{
if ($this->method() === 'CONNECT' || $this->mode() === 'authority') {
$credential = $this->credential();
return ($credential ? $credential. '@' : '') . $this->host();
}
if ($this->mode() === 'absolute') {
return $this->ur... | php | public function requestTarget()
{
if ($this->method() === 'CONNECT' || $this->mode() === 'authority') {
$credential = $this->credential();
return ($credential ? $credential. '@' : '') . $this->host();
}
if ($this->mode() === 'absolute') {
return $this->ur... | [
"public",
"function",
"requestTarget",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"method",
"(",
")",
"===",
"'CONNECT'",
"||",
"$",
"this",
"->",
"mode",
"(",
")",
"===",
"'authority'",
")",
"{",
"$",
"credential",
"=",
"$",
"this",
"->",
"credent... | Returns the request target present in the status line.
@return string | [
"Returns",
"the",
"request",
"target",
"present",
"in",
"the",
"status",
"line",
"."
] | 4d75abead39e954529b56cbffa3841a9cd3044bb | https://github.com/crysalead/net/blob/4d75abead39e954529b56cbffa3841a9cd3044bb/src/Http/Request.php#L400-L415 |
13,439 | crysalead/net | src/Http/Request.php | Request.auth | public function auth($auth = true)
{
$headers = $this->headers();
if ($auth === false) {
unset($headers['Authorization']);
}
if (!$auth) {
return;
}
if (is_array($auth) && !empty($auth['nonce'])) {
$data = ['method' => $this->method... | php | public function auth($auth = true)
{
$headers = $this->headers();
if ($auth === false) {
unset($headers['Authorization']);
}
if (!$auth) {
return;
}
if (is_array($auth) && !empty($auth['nonce'])) {
$data = ['method' => $this->method... | [
"public",
"function",
"auth",
"(",
"$",
"auth",
"=",
"true",
")",
"{",
"$",
"headers",
"=",
"$",
"this",
"->",
"headers",
"(",
")",
";",
"if",
"(",
"$",
"auth",
"===",
"false",
")",
"{",
"unset",
"(",
"$",
"headers",
"[",
"'Authorization'",
"]",
... | Sets the request authorization.
@param mixed $auth Any array with a 'nonce' attribute implies Digest authentication.
Defaults to Basic authentication otherwise.
If `false` the Authorization header will be removed.
@return mixed | [
"Sets",
"the",
"request",
"authorization",
"."
] | 4d75abead39e954529b56cbffa3841a9cd3044bb | https://github.com/crysalead/net/blob/4d75abead39e954529b56cbffa3841a9cd3044bb/src/Http/Request.php#L425-L444 |
13,440 | crysalead/net | src/Http/Request.php | Request.applyCookies | public function applyCookies($cookies)
{
$values = [];
foreach ($cookies as $cookie) {
if ($cookie->matches($this->url())) {
$values[$cookie->path()] = $cookie->name() . '=' . $cookie->value();
}
}
$keys = array_map('strlen', array_keys($value... | php | public function applyCookies($cookies)
{
$values = [];
foreach ($cookies as $cookie) {
if ($cookie->matches($this->url())) {
$values[$cookie->path()] = $cookie->name() . '=' . $cookie->value();
}
}
$keys = array_map('strlen', array_keys($value... | [
"public",
"function",
"applyCookies",
"(",
"$",
"cookies",
")",
"{",
"$",
"values",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"cookies",
"as",
"$",
"cookie",
")",
"{",
"if",
"(",
"$",
"cookie",
"->",
"matches",
"(",
"$",
"this",
"->",
"url",
"(",
... | Set the Cookie header
@param array $cookies The cookies.
@return self | [
"Set",
"the",
"Cookie",
"header"
] | 4d75abead39e954529b56cbffa3841a9cd3044bb | https://github.com/crysalead/net/blob/4d75abead39e954529b56cbffa3841a9cd3044bb/src/Http/Request.php#L498-L516 |
13,441 | crysalead/net | src/Http/Request.php | Request.cookieValues | public function cookieValues()
{
$headers = $request->headers();
return isset($headers['Cookie']) ? CookieValues::toArray($headers['Cookie']->value()) : [];
} | php | public function cookieValues()
{
$headers = $request->headers();
return isset($headers['Cookie']) ? CookieValues::toArray($headers['Cookie']->value()) : [];
} | [
"public",
"function",
"cookieValues",
"(",
")",
"{",
"$",
"headers",
"=",
"$",
"request",
"->",
"headers",
"(",
")",
";",
"return",
"isset",
"(",
"$",
"headers",
"[",
"'Cookie'",
"]",
")",
"?",
"CookieValues",
"::",
"toArray",
"(",
"$",
"headers",
"[",... | Extract cookies value.
@return array The cookies value. | [
"Extract",
"cookies",
"value",
"."
] | 4d75abead39e954529b56cbffa3841a9cd3044bb | https://github.com/crysalead/net/blob/4d75abead39e954529b56cbffa3841a9cd3044bb/src/Http/Request.php#L523-L527 |
13,442 | crysalead/net | src/Http/Request.php | Request.create | public static function create($method = 'GET', $url = null, $config = [])
{
if (func_num_args()) {
if(!preg_match('~^(?:[a-z]+:)?//~i', $url) || !$defaults = parse_url($url)) {
throw new NetException("Invalid url: `'{$url}'`.");
}
$defaults['username'] = i... | php | public static function create($method = 'GET', $url = null, $config = [])
{
if (func_num_args()) {
if(!preg_match('~^(?:[a-z]+:)?//~i', $url) || !$defaults = parse_url($url)) {
throw new NetException("Invalid url: `'{$url}'`.");
}
$defaults['username'] = i... | [
"public",
"static",
"function",
"create",
"(",
"$",
"method",
"=",
"'GET'",
",",
"$",
"url",
"=",
"null",
",",
"$",
"config",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"func_num_args",
"(",
")",
")",
"{",
"if",
"(",
"!",
"preg_match",
"(",
"'~^(?:[a-z]+:... | Creates a request instance using an absolute URL.
@param string $url An absolute URL.
@param array $config The config array.
@return self | [
"Creates",
"a",
"request",
"instance",
"using",
"an",
"absolute",
"URL",
"."
] | 4d75abead39e954529b56cbffa3841a9cd3044bb | https://github.com/crysalead/net/blob/4d75abead39e954529b56cbffa3841a9cd3044bb/src/Http/Request.php#L562-L573 |
13,443 | crysalead/net | src/Mime/Message.php | Message.addTo | public function addTo($address, $name = null)
{
$address = $this->_addRecipient('To', $address, $name);
$this->_recipients[$address->email()] = $address;
return $this;
} | php | public function addTo($address, $name = null)
{
$address = $this->_addRecipient('To', $address, $name);
$this->_recipients[$address->email()] = $address;
return $this;
} | [
"public",
"function",
"addTo",
"(",
"$",
"address",
",",
"$",
"name",
"=",
"null",
")",
"{",
"$",
"address",
"=",
"$",
"this",
"->",
"_addRecipient",
"(",
"'To'",
",",
"$",
"address",
",",
"$",
"name",
")",
";",
"$",
"this",
"->",
"_recipients",
"[... | Add an email recipient.
@param string $address The email address.
@param mixed $name The name.
@return self | [
"Add",
"an",
"email",
"recipient",
"."
] | 4d75abead39e954529b56cbffa3841a9cd3044bb | https://github.com/crysalead/net/blob/4d75abead39e954529b56cbffa3841a9cd3044bb/src/Mime/Message.php#L316-L321 |
13,444 | crysalead/net | src/Mime/Message.php | Message.addCc | public function addCc($address, $name = null)
{
$address = $this->_addRecipient('Cc', $address, $name);
$this->_recipients[$address->email()] = $address;
return $this;
} | php | public function addCc($address, $name = null)
{
$address = $this->_addRecipient('Cc', $address, $name);
$this->_recipients[$address->email()] = $address;
return $this;
} | [
"public",
"function",
"addCc",
"(",
"$",
"address",
",",
"$",
"name",
"=",
"null",
")",
"{",
"$",
"address",
"=",
"$",
"this",
"->",
"_addRecipient",
"(",
"'Cc'",
",",
"$",
"address",
",",
"$",
"name",
")",
";",
"$",
"this",
"->",
"_recipients",
"[... | Adds carbon copy email recipient.
@param string $address The email address.
@param mixed $name The name.
@return self | [
"Adds",
"carbon",
"copy",
"email",
"recipient",
"."
] | 4d75abead39e954529b56cbffa3841a9cd3044bb | https://github.com/crysalead/net/blob/4d75abead39e954529b56cbffa3841a9cd3044bb/src/Mime/Message.php#L330-L335 |
13,445 | crysalead/net | src/Mime/Message.php | Message.addBcc | public function addBcc($address, $name = null)
{
$class = $this->_classes['address'];
$bcc = new $class($address, $name);
$this->_recipients[$bcc->email()] = $bcc;
return $this;
} | php | public function addBcc($address, $name = null)
{
$class = $this->_classes['address'];
$bcc = new $class($address, $name);
$this->_recipients[$bcc->email()] = $bcc;
return $this;
} | [
"public",
"function",
"addBcc",
"(",
"$",
"address",
",",
"$",
"name",
"=",
"null",
")",
"{",
"$",
"class",
"=",
"$",
"this",
"->",
"_classes",
"[",
"'address'",
"]",
";",
"$",
"bcc",
"=",
"new",
"$",
"class",
"(",
"$",
"address",
",",
"$",
"name... | Adds blind carbon copy email recipient.
@param string $address The sender email address.
@param mixed $name The sender name.
@return self | [
"Adds",
"blind",
"carbon",
"copy",
"email",
"recipient",
"."
] | 4d75abead39e954529b56cbffa3841a9cd3044bb | https://github.com/crysalead/net/blob/4d75abead39e954529b56cbffa3841a9cd3044bb/src/Mime/Message.php#L344-L350 |
13,446 | crysalead/net | src/Mime/Message.php | Message._addRecipient | protected function _addRecipient($type, $address, $name = null)
{
$classes = $this->_classes;
$headers = $this->headers();
if (!isset($headers[$type])) {
$addresses = $classes['addresses'];
$headers[$type] = new $addresses();
}
$class = $classes['addre... | php | protected function _addRecipient($type, $address, $name = null)
{
$classes = $this->_classes;
$headers = $this->headers();
if (!isset($headers[$type])) {
$addresses = $classes['addresses'];
$headers[$type] = new $addresses();
}
$class = $classes['addre... | [
"protected",
"function",
"_addRecipient",
"(",
"$",
"type",
",",
"$",
"address",
",",
"$",
"name",
"=",
"null",
")",
"{",
"$",
"classes",
"=",
"$",
"this",
"->",
"_classes",
";",
"$",
"headers",
"=",
"$",
"this",
"->",
"headers",
"(",
")",
";",
"if... | Add a recipient to a specific type section.
@param string $type The type of recipient.
@param string $address The email address.
@param mixed $name The name.
@return objedt The created address. | [
"Add",
"a",
"recipient",
"to",
"a",
"specific",
"type",
"section",
"."
] | 4d75abead39e954529b56cbffa3841a9cd3044bb | https://github.com/crysalead/net/blob/4d75abead39e954529b56cbffa3841a9cd3044bb/src/Mime/Message.php#L360-L372 |
13,447 | crysalead/net | src/Mime/Message.php | Message.addInline | public function addInline($path, $name = null, $mime = true, $encoding = true)
{
$cid = static::generateId($this->client());
$filename = basename($path);
$this->_inlines[$path] = [
'filename' => $name ?: $filename,
'disposition' => 'attachment',
'mime' ... | php | public function addInline($path, $name = null, $mime = true, $encoding = true)
{
$cid = static::generateId($this->client());
$filename = basename($path);
$this->_inlines[$path] = [
'filename' => $name ?: $filename,
'disposition' => 'attachment',
'mime' ... | [
"public",
"function",
"addInline",
"(",
"$",
"path",
",",
"$",
"name",
"=",
"null",
",",
"$",
"mime",
"=",
"true",
",",
"$",
"encoding",
"=",
"true",
")",
"{",
"$",
"cid",
"=",
"static",
"::",
"generateId",
"(",
"$",
"this",
"->",
"client",
"(",
... | Add an embedded file. | [
"Add",
"an",
"embedded",
"file",
"."
] | 4d75abead39e954529b56cbffa3841a9cd3044bb | https://github.com/crysalead/net/blob/4d75abead39e954529b56cbffa3841a9cd3044bb/src/Mime/Message.php#L407-L418 |
13,448 | crysalead/net | src/Mime/Message.php | Message.addAttachment | public function addAttachment($path, $name = null, $mime = true, $encoding = true)
{
$cid = static::generateId($this->client());
$filename = basename($path);
$this->_attachments[$path] = [
'filename' => $name ?: $filename,
'disposition' => 'attachment',
... | php | public function addAttachment($path, $name = null, $mime = true, $encoding = true)
{
$cid = static::generateId($this->client());
$filename = basename($path);
$this->_attachments[$path] = [
'filename' => $name ?: $filename,
'disposition' => 'attachment',
... | [
"public",
"function",
"addAttachment",
"(",
"$",
"path",
",",
"$",
"name",
"=",
"null",
",",
"$",
"mime",
"=",
"true",
",",
"$",
"encoding",
"=",
"true",
")",
"{",
"$",
"cid",
"=",
"static",
"::",
"generateId",
"(",
"$",
"this",
"->",
"client",
"("... | Add an attachment. | [
"Add",
"an",
"attachment",
"."
] | 4d75abead39e954529b56cbffa3841a9cd3044bb | https://github.com/crysalead/net/blob/4d75abead39e954529b56cbffa3841a9cd3044bb/src/Mime/Message.php#L423-L434 |
13,449 | crysalead/net | src/Mime/Message.php | Message.html | public function html($body, $basePath = null)
{
if (!func_num_args()) {
return $this->_body;
}
if ($basePath) {
$cids = [];
$hasInline = preg_match_all('~
(<img[^<>]*\s src\s*=\s*
|<body[^<>]*\s background\s*=\s*
... | php | public function html($body, $basePath = null)
{
if (!func_num_args()) {
return $this->_body;
}
if ($basePath) {
$cids = [];
$hasInline = preg_match_all('~
(<img[^<>]*\s src\s*=\s*
|<body[^<>]*\s background\s*=\s*
... | [
"public",
"function",
"html",
"(",
"$",
"body",
",",
"$",
"basePath",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"func_num_args",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"_body",
";",
"}",
"if",
"(",
"$",
"basePath",
")",
"{",
"$",
"cids",
... | Set the HTML body message with an optionnal alternative body.
@param string $body The HTML body message.
@param string $altBody The alt body.
@return string|self | [
"Set",
"the",
"HTML",
"body",
"message",
"with",
"an",
"optionnal",
"alternative",
"body",
"."
] | 4d75abead39e954529b56cbffa3841a9cd3044bb | https://github.com/crysalead/net/blob/4d75abead39e954529b56cbffa3841a9cd3044bb/src/Mime/Message.php#L473-L507 |
13,450 | crysalead/net | src/Mime/Message.php | Message.stripTags | public static function stripTags($html, $charset = 'UTF-8')
{
$patterns = [
'~<(style|script|head).*</\\1>~Uis' => '',
'~<t[dh][ >]~i' => ' $0',
'~<a\s[^>]*href=(?|"([^"]+)"|\'([^\']+)\')[^>]*>(.*?)</a>~is' => '$2 <$1>',
'~[\r\n ]+~' => ' ',
... | php | public static function stripTags($html, $charset = 'UTF-8')
{
$patterns = [
'~<(style|script|head).*</\\1>~Uis' => '',
'~<t[dh][ >]~i' => ' $0',
'~<a\s[^>]*href=(?|"([^"]+)"|\'([^\']+)\')[^>]*>(.*?)</a>~is' => '$2 <$1>',
'~[\r\n ]+~' => ' ',
... | [
"public",
"static",
"function",
"stripTags",
"(",
"$",
"html",
",",
"$",
"charset",
"=",
"'UTF-8'",
")",
"{",
"$",
"patterns",
"=",
"[",
"'~<(style|script|head).*</\\\\1>~Uis'",
"=>",
"''",
",",
"'~<t[dh][ >]~i'",
"=>",
"' $0'",
",",
"'~<a\\s[^>]*href=(?|\"([^\"]+... | Strip HTML tags
@param string $html The html content
@return string | [
"Strip",
"HTML",
"tags"
] | 4d75abead39e954529b56cbffa3841a9cd3044bb | https://github.com/crysalead/net/blob/4d75abead39e954529b56cbffa3841a9cd3044bb/src/Mime/Message.php#L632-L646 |
13,451 | antarestupin/Accessible | lib/Accessible/AutoConstructTrait.php | AutoConstructTrait.initializeProperties | protected function initializeProperties($properties = null)
{
$this->getPropertiesInfo();
// Initialize the properties that were defined using the Initialize / InitializeObject annotations
$initializeValueValidationEnabled = Configuration::isInitializeValuesValidationEnabled();
fore... | php | protected function initializeProperties($properties = null)
{
$this->getPropertiesInfo();
// Initialize the properties that were defined using the Initialize / InitializeObject annotations
$initializeValueValidationEnabled = Configuration::isInitializeValuesValidationEnabled();
fore... | [
"protected",
"function",
"initializeProperties",
"(",
"$",
"properties",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"getPropertiesInfo",
"(",
")",
";",
"// Initialize the properties that were defined using the Initialize / InitializeObject annotations",
"$",
"initializeValueVali... | Initializes the object according to its class specification and given arguments.
@param array $properties The values to give to the properties. | [
"Initializes",
"the",
"object",
"according",
"to",
"its",
"class",
"specification",
"and",
"given",
"arguments",
"."
] | d12ce93d72f74c099dfd2109371fcd6ddfffdca4 | https://github.com/antarestupin/Accessible/blob/d12ce93d72f74c099dfd2109371fcd6ddfffdca4/lib/Accessible/AutoConstructTrait.php#L22-L63 |
13,452 | antarestupin/Accessible | lib/Accessible/AutoConstructTrait.php | AutoConstructTrait.updateInitializedPropertyValue | private function updateInitializedPropertyValue($propertyName, $value)
{
if (empty($this->_collectionsItemNames['byProperty'][$propertyName])) {
$this->updatePropertyAssociation($propertyName, array("oldValue" => null, "newValue" => $value));
} else {
foreach ($value as $newV... | php | private function updateInitializedPropertyValue($propertyName, $value)
{
if (empty($this->_collectionsItemNames['byProperty'][$propertyName])) {
$this->updatePropertyAssociation($propertyName, array("oldValue" => null, "newValue" => $value));
} else {
foreach ($value as $newV... | [
"private",
"function",
"updateInitializedPropertyValue",
"(",
"$",
"propertyName",
",",
"$",
"value",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"_collectionsItemNames",
"[",
"'byProperty'",
"]",
"[",
"$",
"propertyName",
"]",
")",
")",
"{",
"$",
... | Update an initialized value.
@param string $propertyName
@param mixed $value | [
"Update",
"an",
"initialized",
"value",
"."
] | d12ce93d72f74c099dfd2109371fcd6ddfffdca4 | https://github.com/antarestupin/Accessible/blob/d12ce93d72f74c099dfd2109371fcd6ddfffdca4/lib/Accessible/AutoConstructTrait.php#L71-L80 |
13,453 | ssnepenthe/soter | src/class-upgrader.php | Upgrader.delete_vulnerabilities | protected function delete_vulnerabilities() {
$query = new WP_Query( [
'fields' => 'ids',
'no_found_rows' => true,
'post_type' => 'soter_vulnerability',
'post_status' => 'private',
// @todo Vulnerabilities were previously garbage collected on a daily
// basis so it shouldn't be a problem to get all ... | php | protected function delete_vulnerabilities() {
$query = new WP_Query( [
'fields' => 'ids',
'no_found_rows' => true,
'post_type' => 'soter_vulnerability',
'post_status' => 'private',
// @todo Vulnerabilities were previously garbage collected on a daily
// basis so it shouldn't be a problem to get all ... | [
"protected",
"function",
"delete_vulnerabilities",
"(",
")",
"{",
"$",
"query",
"=",
"new",
"WP_Query",
"(",
"[",
"'fields'",
"=>",
"'ids'",
",",
"'no_found_rows'",
"=>",
"true",
",",
"'post_type'",
"=>",
"'soter_vulnerability'",
",",
"'post_status'",
"=>",
"'pr... | Deletes any lingering soter_vulnerability posts.
@return void | [
"Deletes",
"any",
"lingering",
"soter_vulnerability",
"posts",
"."
] | f6d7032f8562e23c2ee8dbf9d60ef1114c8cdce7 | https://github.com/ssnepenthe/soter/blob/f6d7032f8562e23c2ee8dbf9d60ef1114c8cdce7/src/class-upgrader.php#L51-L68 |
13,454 | ssnepenthe/soter | src/class-upgrader.php | Upgrader.prepare_ignored_plugins | protected function prepare_ignored_plugins( array $plugins ) {
if ( ! function_exists( 'get_plugins' ) ) {
require_once ABSPATH . 'wp-admin/includes/plugin.php';
}
$valid_slugs = array_map( function( $file ) {
if ( false === strpos( $file, '/' ) ) {
$slug = basename( $file, '.php' );
} else {
$s... | php | protected function prepare_ignored_plugins( array $plugins ) {
if ( ! function_exists( 'get_plugins' ) ) {
require_once ABSPATH . 'wp-admin/includes/plugin.php';
}
$valid_slugs = array_map( function( $file ) {
if ( false === strpos( $file, '/' ) ) {
$slug = basename( $file, '.php' );
} else {
$s... | [
"protected",
"function",
"prepare_ignored_plugins",
"(",
"array",
"$",
"plugins",
")",
"{",
"if",
"(",
"!",
"function_exists",
"(",
"'get_plugins'",
")",
")",
"{",
"require_once",
"ABSPATH",
".",
"'wp-admin/includes/plugin.php'",
";",
"}",
"$",
"valid_slugs",
"=",... | Ensure ignored plugins setting only contains currently installed plugins.
@param array $plugins List of ignored plugins.
@return array | [
"Ensure",
"ignored",
"plugins",
"setting",
"only",
"contains",
"currently",
"installed",
"plugins",
"."
] | f6d7032f8562e23c2ee8dbf9d60ef1114c8cdce7 | https://github.com/ssnepenthe/soter/blob/f6d7032f8562e23c2ee8dbf9d60ef1114c8cdce7/src/class-upgrader.php#L77-L93 |
13,455 | ssnepenthe/soter | src/class-upgrader.php | Upgrader.prepare_ignored_themes | protected function prepare_ignored_themes( array $themes ) {
$valid_slugs = array_values( wp_list_pluck(
wp_get_themes(),
'stylesheet'
) );
return array_values( array_intersect( $valid_slugs, $themes ) );
} | php | protected function prepare_ignored_themes( array $themes ) {
$valid_slugs = array_values( wp_list_pluck(
wp_get_themes(),
'stylesheet'
) );
return array_values( array_intersect( $valid_slugs, $themes ) );
} | [
"protected",
"function",
"prepare_ignored_themes",
"(",
"array",
"$",
"themes",
")",
"{",
"$",
"valid_slugs",
"=",
"array_values",
"(",
"wp_list_pluck",
"(",
"wp_get_themes",
"(",
")",
",",
"'stylesheet'",
")",
")",
";",
"return",
"array_values",
"(",
"array_int... | Ensure ignored themes setting only contains currently installed themes.
@param array $themes List of ignored themes.
@return array | [
"Ensure",
"ignored",
"themes",
"setting",
"only",
"contains",
"currently",
"installed",
"themes",
"."
] | f6d7032f8562e23c2ee8dbf9d60ef1114c8cdce7 | https://github.com/ssnepenthe/soter/blob/f6d7032f8562e23c2ee8dbf9d60ef1114c8cdce7/src/class-upgrader.php#L102-L109 |
13,456 | ssnepenthe/soter | src/class-upgrader.php | Upgrader.upgrade_to_050 | protected function upgrade_to_050() {
if ( $this->options->installed_version ) {
return;
}
$this->upgrade_cron();
$this->upgrade_options();
$this->upgrade_results();
$this->delete_vulnerabilities();
// Set installed version so upgrader does not run again.
$this->options->get_store()->set( 'install... | php | protected function upgrade_to_050() {
if ( $this->options->installed_version ) {
return;
}
$this->upgrade_cron();
$this->upgrade_options();
$this->upgrade_results();
$this->delete_vulnerabilities();
// Set installed version so upgrader does not run again.
$this->options->get_store()->set( 'install... | [
"protected",
"function",
"upgrade_to_050",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"options",
"->",
"installed_version",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"upgrade_cron",
"(",
")",
";",
"$",
"this",
"->",
"upgrade_options",
"(",
")",
... | Required logic for upgrading to v0.5.0.
@return void | [
"Required",
"logic",
"for",
"upgrading",
"to",
"v0",
".",
"5",
".",
"0",
"."
] | f6d7032f8562e23c2ee8dbf9d60ef1114c8cdce7 | https://github.com/ssnepenthe/soter/blob/f6d7032f8562e23c2ee8dbf9d60ef1114c8cdce7/src/class-upgrader.php#L116-L129 |
13,457 | ssnepenthe/soter | src/class-upgrader.php | Upgrader.upgrade_options | protected function upgrade_options() {
// Pre-0.4.0 options array to 0.5.0+ individual option entries.
$old_options = (array) $this->options->get_store()->get( 'settings', [] );
if ( isset( $old_options['email_address'] ) ) {
$sanitized = sanitize_email( $old_options['email_address'] );
if ( $sanitized ) ... | php | protected function upgrade_options() {
// Pre-0.4.0 options array to 0.5.0+ individual option entries.
$old_options = (array) $this->options->get_store()->get( 'settings', [] );
if ( isset( $old_options['email_address'] ) ) {
$sanitized = sanitize_email( $old_options['email_address'] );
if ( $sanitized ) ... | [
"protected",
"function",
"upgrade_options",
"(",
")",
"{",
"// Pre-0.4.0 options array to 0.5.0+ individual option entries.",
"$",
"old_options",
"=",
"(",
"array",
")",
"$",
"this",
"->",
"options",
"->",
"get_store",
"(",
")",
"->",
"get",
"(",
"'settings'",
",",
... | Upgrade to latest options implementation.
@return void | [
"Upgrade",
"to",
"latest",
"options",
"implementation",
"."
] | f6d7032f8562e23c2ee8dbf9d60ef1114c8cdce7 | https://github.com/ssnepenthe/soter/blob/f6d7032f8562e23c2ee8dbf9d60ef1114c8cdce7/src/class-upgrader.php#L153-L200 |
13,458 | serverdensity/sd-php-wrapper | lib/serverdensity/Api/Devices.php | Devices.create | public function create($device, array $tagNames = array()){
if (!empty($tagNames)){
$tagEndpoint = new Tags($this->client);
$tags = $tagEndpoint->findAll($tagNames);
if(!empty($tags['notFound'])){
foreach($tags['notFound'] as $name){
$tags[... | php | public function create($device, array $tagNames = array()){
if (!empty($tagNames)){
$tagEndpoint = new Tags($this->client);
$tags = $tagEndpoint->findAll($tagNames);
if(!empty($tags['notFound'])){
foreach($tags['notFound'] as $name){
$tags[... | [
"public",
"function",
"create",
"(",
"$",
"device",
",",
"array",
"$",
"tagNames",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"tagNames",
")",
")",
"{",
"$",
"tagEndpoint",
"=",
"new",
"Tags",
"(",
"$",
"this",
"->",
"cl... | Create a device
@link https://developer.serverdensity.com/v2.0/docs/creating-a-device
@param array $device with all its attributes.
@return an array that is the device. | [
"Create",
"a",
"device"
] | 9c742a9ee61e32a9bc4ed17b5fe0eca1f4c3015e | https://github.com/serverdensity/sd-php-wrapper/blob/9c742a9ee61e32a9bc4ed17b5fe0eca1f4c3015e/lib/serverdensity/Api/Devices.php#L13-L29 |
13,459 | reinvanoyen/aegis | lib/Aegis/Lexer.php | Lexer.tokenize | public function tokenize(string $input) : TokenStream
{
$this->prepare($input);
// Loop each character
while ($this->cursor < $this->end) {
$this->currentChar = $this->input[$this->cursor];
if (preg_match('@'.Token::REGEX_T_EOL.'@', $this->currentChar)) {
... | php | public function tokenize(string $input) : TokenStream
{
$this->prepare($input);
// Loop each character
while ($this->cursor < $this->end) {
$this->currentChar = $this->input[$this->cursor];
if (preg_match('@'.Token::REGEX_T_EOL.'@', $this->currentChar)) {
... | [
"public",
"function",
"tokenize",
"(",
"string",
"$",
"input",
")",
":",
"TokenStream",
"{",
"$",
"this",
"->",
"prepare",
"(",
"$",
"input",
")",
";",
"// Loop each character",
"while",
"(",
"$",
"this",
"->",
"cursor",
"<",
"$",
"this",
"->",
"end",
... | Tokenizes a string into a TokenStream
@param $input
@return TokenStream | [
"Tokenizes",
"a",
"string",
"into",
"a",
"TokenStream"
] | ecd831fd6f3ceb4fb20fb5af83483d73cad8e323 | https://github.com/reinvanoyen/aegis/blob/ecd831fd6f3ceb4fb20fb5af83483d73cad8e323/lib/Aegis/Lexer.php#L92-L134 |
13,460 | reinvanoyen/aegis | lib/Aegis/Lexer.php | Lexer.prepare | private function prepare(string $input)
{
$this->input = str_replace(["\n\r", "\r"], "\n", $input);
// Create new token stream
$this->stream = new TokenStream();
$this->cursor = 0;
$this->line = 1;
$this->lineOffset = 0;
$this->end = strlen($this->input);
... | php | private function prepare(string $input)
{
$this->input = str_replace(["\n\r", "\r"], "\n", $input);
// Create new token stream
$this->stream = new TokenStream();
$this->cursor = 0;
$this->line = 1;
$this->lineOffset = 0;
$this->end = strlen($this->input);
... | [
"private",
"function",
"prepare",
"(",
"string",
"$",
"input",
")",
"{",
"$",
"this",
"->",
"input",
"=",
"str_replace",
"(",
"[",
"\"\\n\\r\"",
",",
"\"\\r\"",
"]",
",",
"\"\\n\"",
",",
"$",
"input",
")",
";",
"// Create new token stream",
"$",
"this",
... | Prepares the Lexer for tokenizing a string
@param string $input | [
"Prepares",
"the",
"Lexer",
"for",
"tokenizing",
"a",
"string"
] | ecd831fd6f3ceb4fb20fb5af83483d73cad8e323 | https://github.com/reinvanoyen/aegis/blob/ecd831fd6f3ceb4fb20fb5af83483d73cad8e323/lib/Aegis/Lexer.php#L141-L162 |
13,461 | reinvanoyen/aegis | lib/Aegis/Lexer.php | Lexer.setMode | private function setMode(int $mode)
{
$this->mode = $mode;
$this->modeStartLine = $this->line;
$this->modeStartPosition = $this->getCurrentLinePosition();
} | php | private function setMode(int $mode)
{
$this->mode = $mode;
$this->modeStartLine = $this->line;
$this->modeStartPosition = $this->getCurrentLinePosition();
} | [
"private",
"function",
"setMode",
"(",
"int",
"$",
"mode",
")",
"{",
"$",
"this",
"->",
"mode",
"=",
"$",
"mode",
";",
"$",
"this",
"->",
"modeStartLine",
"=",
"$",
"this",
"->",
"line",
";",
"$",
"this",
"->",
"modeStartPosition",
"=",
"$",
"this",
... | Sets the lexing mode
@param int $mode | [
"Sets",
"the",
"lexing",
"mode"
] | ecd831fd6f3ceb4fb20fb5af83483d73cad8e323 | https://github.com/reinvanoyen/aegis/blob/ecd831fd6f3ceb4fb20fb5af83483d73cad8e323/lib/Aegis/Lexer.php#L336-L341 |
13,462 | kriskbx/mikado | src/Providers/MikadoServiceProvider.php | MikadoServiceProvider.addManager | protected function addManager($fileInfo, &$mikado)
{
$manager = new Manager();
$pathParts = pathinfo($fileInfo->getBasename());
$model = $pathParts['filename'];
$this->addFormatter($manager, $model, 'MetaFormatter');
$this->addFormatter($manager, $model, 'RemapFormatter');
... | php | protected function addManager($fileInfo, &$mikado)
{
$manager = new Manager();
$pathParts = pathinfo($fileInfo->getBasename());
$model = $pathParts['filename'];
$this->addFormatter($manager, $model, 'MetaFormatter');
$this->addFormatter($manager, $model, 'RemapFormatter');
... | [
"protected",
"function",
"addManager",
"(",
"$",
"fileInfo",
",",
"&",
"$",
"mikado",
")",
"{",
"$",
"manager",
"=",
"new",
"Manager",
"(",
")",
";",
"$",
"pathParts",
"=",
"pathinfo",
"(",
"$",
"fileInfo",
"->",
"getBasename",
"(",
")",
")",
";",
"$... | Add manager to mikado.
@param DirectoryIterator $fileInfo
@param Mikado $mikado | [
"Add",
"manager",
"to",
"mikado",
"."
] | f00e566d682a66796f3f8a68b348920fadd9ee87 | https://github.com/kriskbx/mikado/blob/f00e566d682a66796f3f8a68b348920fadd9ee87/src/Providers/MikadoServiceProvider.php#L56-L68 |
13,463 | kriskbx/mikado | src/Providers/MikadoServiceProvider.php | MikadoServiceProvider.addFormatter | protected function addFormatter(&$manager, $model, $formatter)
{
// Get the config
$config = (include $this->configPath . '/' . $model . '.php');
if(!isset($config[$formatter]))
return;
$formatterClass = 'kriskbx\mikado\Formatters\\' . $formatter;
if (is_array(... | php | protected function addFormatter(&$manager, $model, $formatter)
{
// Get the config
$config = (include $this->configPath . '/' . $model . '.php');
if(!isset($config[$formatter]))
return;
$formatterClass = 'kriskbx\mikado\Formatters\\' . $formatter;
if (is_array(... | [
"protected",
"function",
"addFormatter",
"(",
"&",
"$",
"manager",
",",
"$",
"model",
",",
"$",
"formatter",
")",
"{",
"// Get the config",
"$",
"config",
"=",
"(",
"include",
"$",
"this",
"->",
"configPath",
".",
"'/'",
".",
"$",
"model",
".",
"'.php'",... | Add formatter to manager.
@param Manager $manager
@param string $model
@param string $formatter | [
"Add",
"formatter",
"to",
"manager",
"."
] | f00e566d682a66796f3f8a68b348920fadd9ee87 | https://github.com/kriskbx/mikado/blob/f00e566d682a66796f3f8a68b348920fadd9ee87/src/Providers/MikadoServiceProvider.php#L77-L90 |
13,464 | delatbabel/site-config | src/Models/Config.php | Config.isJson | protected function isJson($string) {
// json_decode a numeric string doesn't throw an error, so we have to check it manually
if (! is_string($string) || is_numeric($string)) {
return false;
}
$result = @json_decode($string);
return (json_last_error() == JSON_ERROR_NON... | php | protected function isJson($string) {
// json_decode a numeric string doesn't throw an error, so we have to check it manually
if (! is_string($string) || is_numeric($string)) {
return false;
}
$result = @json_decode($string);
return (json_last_error() == JSON_ERROR_NON... | [
"protected",
"function",
"isJson",
"(",
"$",
"string",
")",
"{",
"// json_decode a numeric string doesn't throw an error, so we have to check it manually",
"if",
"(",
"!",
"is_string",
"(",
"$",
"string",
")",
"||",
"is_numeric",
"(",
"$",
"string",
")",
")",
"{",
"... | Check to see if a string is JSON.
@param $string
@return bool | [
"Check",
"to",
"see",
"if",
"a",
"string",
"is",
"JSON",
"."
] | e547e63f5ea7140036bb3fe46ff47143b4f93d0f | https://github.com/delatbabel/site-config/blob/e547e63f5ea7140036bb3fe46ff47143b4f93d0f/src/Models/Config.php#L44-L51 |
13,465 | delatbabel/site-config | src/Models/Config.php | Config.fetchSettings | public static function fetchSettings($environment = null, $website_id = null, $group = 'config')
{
$model = static::where('group', '=', $group);
// Environment can be null, or must match or use the null wildcard.
$model->where(function ($query) use ($environment) {
if (empty($en... | php | public static function fetchSettings($environment = null, $website_id = null, $group = 'config')
{
$model = static::where('group', '=', $group);
// Environment can be null, or must match or use the null wildcard.
$model->where(function ($query) use ($environment) {
if (empty($en... | [
"public",
"static",
"function",
"fetchSettings",
"(",
"$",
"environment",
"=",
"null",
",",
"$",
"website_id",
"=",
"null",
",",
"$",
"group",
"=",
"'config'",
")",
"{",
"$",
"model",
"=",
"static",
"::",
"where",
"(",
"'group'",
",",
"'='",
",",
"$",
... | Return the configuration data for a specific environment & group.
What this function tries to achieve is to return the configuration
for a given environment and group, The configuration table contains
2 limiting columns, which are website_id and environment. The way
that the limiting columns work is that if there is... | [
"Return",
"the",
"configuration",
"data",
"for",
"a",
"specific",
"environment",
"&",
"group",
"."
] | e547e63f5ea7140036bb3fe46ff47143b4f93d0f | https://github.com/delatbabel/site-config/blob/e547e63f5ea7140036bb3fe46ff47143b4f93d0f/src/Models/Config.php#L166-L206 |
13,466 | delatbabel/site-config | src/Models/Config.php | Config.fetchExactSettings | public static function fetchExactSettings($environment = null, $website_id = null, $group = 'config')
{
$model = static::where('group', '=', $group);
// Environment can be null, or must match or use the null wildcard.
$model->where(function ($query) use ($environment) {
if (empt... | php | public static function fetchExactSettings($environment = null, $website_id = null, $group = 'config')
{
$model = static::where('group', '=', $group);
// Environment can be null, or must match or use the null wildcard.
$model->where(function ($query) use ($environment) {
if (empt... | [
"public",
"static",
"function",
"fetchExactSettings",
"(",
"$",
"environment",
"=",
"null",
",",
"$",
"website_id",
"=",
"null",
",",
"$",
"group",
"=",
"'config'",
")",
"{",
"$",
"model",
"=",
"static",
"::",
"where",
"(",
"'group'",
",",
"'='",
",",
... | Return the exact configuration data for a specific environment & group.
This function returns the exact configuration data for a specific
environment and group, ignoring any wildcard (NULL) values.
As an example here are some table entries:
<code>
id host env key value
1 NULL NULL fruit apple... | [
"Return",
"the",
"exact",
"configuration",
"data",
"for",
"a",
"specific",
"environment",
"&",
"group",
"."
] | e547e63f5ea7140036bb3fe46ff47143b4f93d0f | https://github.com/delatbabel/site-config/blob/e547e63f5ea7140036bb3fe46ff47143b4f93d0f/src/Models/Config.php#L249-L279 |
13,467 | delatbabel/site-config | src/Models/Config.php | Config.fetchAllGroups | public static function fetchAllGroups()
{
$model = new self;
$result = [];
try {
foreach ($model->select('group')->distinct()->get() as $row) {
$result[] = $row->group;
}
} catch (\Exception $e) {
// Do nothing.
}
... | php | public static function fetchAllGroups()
{
$model = new self;
$result = [];
try {
foreach ($model->select('group')->distinct()->get() as $row) {
$result[] = $row->group;
}
} catch (\Exception $e) {
// Do nothing.
}
... | [
"public",
"static",
"function",
"fetchAllGroups",
"(",
")",
"{",
"$",
"model",
"=",
"new",
"self",
";",
"$",
"result",
"=",
"[",
"]",
";",
"try",
"{",
"foreach",
"(",
"$",
"model",
"->",
"select",
"(",
"'group'",
")",
"->",
"distinct",
"(",
")",
"-... | Return an array of all groups.
@return array | [
"Return",
"an",
"array",
"of",
"all",
"groups",
"."
] | e547e63f5ea7140036bb3fe46ff47143b4f93d0f | https://github.com/delatbabel/site-config/blob/e547e63f5ea7140036bb3fe46ff47143b4f93d0f/src/Models/Config.php#L334-L348 |
13,468 | delatbabel/site-config | src/Models/Config.php | Config.set | public static function set($key, $value, $group = 'config', $environment = null, $website_id = null, $type = 'string')
{
// Let's check if we are doing special array handling
$arrayHandling = false;
$keyExploded = explode('.', $key);
if (count($keyExploded) > 1) {
$arra... | php | public static function set($key, $value, $group = 'config', $environment = null, $website_id = null, $type = 'string')
{
// Let's check if we are doing special array handling
$arrayHandling = false;
$keyExploded = explode('.', $key);
if (count($keyExploded) > 1) {
$arra... | [
"public",
"static",
"function",
"set",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"group",
"=",
"'config'",
",",
"$",
"environment",
"=",
"null",
",",
"$",
"website_id",
"=",
"null",
",",
"$",
"type",
"=",
"'string'",
")",
"{",
"// Let's check if we... | Store a group of settings into the database.
@param string $key
@param mixed $value
@param string $group
@param string $environment
@param integer $website_id
@param string $type "array"|"string"|"integer"
@return Config | [
"Store",
"a",
"group",
"of",
"settings",
"into",
"the",
"database",
"."
] | e547e63f5ea7140036bb3fe46ff47143b4f93d0f | https://github.com/delatbabel/site-config/blob/e547e63f5ea7140036bb3fe46ff47143b4f93d0f/src/Models/Config.php#L361-L436 |
13,469 | delatbabel/site-config | src/Models/Config.php | Config.buildArrayPath | protected static function buildArrayPath($map, $value, &$array)
{
$key = array_shift($map);
if (count($map) !== 0) {
$array[$key] = [];
self::buildArrayPath($map, $value, $array[$key]);
} else {
$array[$key] = $value;
}
} | php | protected static function buildArrayPath($map, $value, &$array)
{
$key = array_shift($map);
if (count($map) !== 0) {
$array[$key] = [];
self::buildArrayPath($map, $value, $array[$key]);
} else {
$array[$key] = $value;
}
} | [
"protected",
"static",
"function",
"buildArrayPath",
"(",
"$",
"map",
",",
"$",
"value",
",",
"&",
"$",
"array",
")",
"{",
"$",
"key",
"=",
"array_shift",
"(",
"$",
"map",
")",
";",
"if",
"(",
"count",
"(",
"$",
"map",
")",
"!==",
"0",
")",
"{",
... | This inserts a value into an array at a point in the array path.
### Example
<code>
$map = [1, 2];
$value = 'hello';
$array = [];
buildArrayPath($map, $value, $array);
// $array is now [1 => [2 => 'hello']]
</code>
@param array $map
@param mixed $value
@param $array
@return void | [
"This",
"inserts",
"a",
"value",
"into",
"an",
"array",
"at",
"a",
"point",
"in",
"the",
"array",
"path",
"."
] | e547e63f5ea7140036bb3fe46ff47143b4f93d0f | https://github.com/delatbabel/site-config/blob/e547e63f5ea7140036bb3fe46ff47143b4f93d0f/src/Models/Config.php#L457-L466 |
13,470 | webbuilders-group/silverstripe-gridfield-deleted-items | src/Forms/GridFieldDeletedDeleteAction.php | GridFieldDeletedDeleteAction.getColumnContent | public function getColumnContent($gridField, $record, $columnName) {
if(!DataObject::has_extension($gridField->getModelClass(), Versioned::class)) {
user_error($gridField->getModelClass().' does not have the Versioned extension', E_USER_WARNING);
return;
}
... | php | public function getColumnContent($gridField, $record, $columnName) {
if(!DataObject::has_extension($gridField->getModelClass(), Versioned::class)) {
user_error($gridField->getModelClass().' does not have the Versioned extension', E_USER_WARNING);
return;
}
... | [
"public",
"function",
"getColumnContent",
"(",
"$",
"gridField",
",",
"$",
"record",
",",
"$",
"columnName",
")",
"{",
"if",
"(",
"!",
"DataObject",
"::",
"has_extension",
"(",
"$",
"gridField",
"->",
"getModelClass",
"(",
")",
",",
"Versioned",
"::",
"cla... | Gets the content for the column, this basically says if it's deleted from the stage you can't delete it
@param GridField $gridField Grid Field Reference
@param DataObject $record Current data object being rendered
@param string $columnName Name of the column
@return string The HTML for the column | [
"Gets",
"the",
"content",
"for",
"the",
"column",
"this",
"basically",
"says",
"if",
"it",
"s",
"deleted",
"from",
"the",
"stage",
"you",
"can",
"t",
"delete",
"it"
] | fd4e90701357de00acf06f4b820b745817f4ce9c | https://github.com/webbuilders-group/silverstripe-gridfield-deleted-items/blob/fd4e90701357de00acf06f4b820b745817f4ce9c/src/Forms/GridFieldDeletedDeleteAction.php#L16-L29 |
13,471 | ptlis/conneg | src/Parser/FieldTokenizer.php | FieldTokenizer.tokenize | public function tokenize($httpField, $fromField)
{
$quoteSeparators = array('"', "'");
$tokenList = array();
$stringAccumulator = '';
$lastQuote = '';
// Iterate through field, character-by-character
for ($i = 0; $i < strlen($httpField); $i++) {
$chr = su... | php | public function tokenize($httpField, $fromField)
{
$quoteSeparators = array('"', "'");
$tokenList = array();
$stringAccumulator = '';
$lastQuote = '';
// Iterate through field, character-by-character
for ($i = 0; $i < strlen($httpField); $i++) {
$chr = su... | [
"public",
"function",
"tokenize",
"(",
"$",
"httpField",
",",
"$",
"fromField",
")",
"{",
"$",
"quoteSeparators",
"=",
"array",
"(",
"'\"'",
",",
"\"'\"",
")",
";",
"$",
"tokenList",
"=",
"array",
"(",
")",
";",
"$",
"stringAccumulator",
"=",
"''",
";"... | Tokenize the HTTP field for subsequent processing.
Note: we don't need to worry about multi-byte characters; HTTP fields must be ISO-8859-1 encoded.
@param string $httpField
@param string $fromField
@return array<string> | [
"Tokenize",
"the",
"HTTP",
"field",
"for",
"subsequent",
"processing",
"."
] | 04afb568f368ecdd81c13277006c4be041ccb58b | https://github.com/ptlis/conneg/blob/04afb568f368ecdd81c13277006c4be041ccb58b/src/Parser/FieldTokenizer.php#L28-L84 |
13,472 | sifophp/sifo-common-instance | controllers/manager/templateLauncher.php | ManagerTemplateLauncherController._getRequiredVars | private function _getRequiredVars( $template_identifier )
{
if ( !( isset( $this->_available_templates[$template_identifier] ) ) )
{
trigger_error( "Template identifier not found.", E_USER_ERROR );
}
$template_path = ROOT_PATH.'/'.$this->_available_templates[$template_identifier];
if ( !( $template_sour... | php | private function _getRequiredVars( $template_identifier )
{
if ( !( isset( $this->_available_templates[$template_identifier] ) ) )
{
trigger_error( "Template identifier not found.", E_USER_ERROR );
}
$template_path = ROOT_PATH.'/'.$this->_available_templates[$template_identifier];
if ( !( $template_sour... | [
"private",
"function",
"_getRequiredVars",
"(",
"$",
"template_identifier",
")",
"{",
"if",
"(",
"!",
"(",
"isset",
"(",
"$",
"this",
"->",
"_available_templates",
"[",
"$",
"template_identifier",
"]",
")",
")",
")",
"{",
"trigger_error",
"(",
"\"Template iden... | Return the found in use vars in tpl.
@param $template_identifier
@return array | [
"Return",
"the",
"found",
"in",
"use",
"vars",
"in",
"tpl",
"."
] | 52d54ea3e565bd2bccd77e0b0a6a99b5cae3aff5 | https://github.com/sifophp/sifo-common-instance/blob/52d54ea3e565bd2bccd77e0b0a6a99b5cae3aff5/controllers/manager/templateLauncher.php#L17-L42 |
13,473 | joomla-projects/jorobo | src/Tasks/Build/Package.php | Package.createInstaller | private function createInstaller()
{
$this->say("Creating package installer");
// Copy XML and script.php
$sourceFolder = $this->getSourceFolder() . "/administrator/manifests/packages";
$targetFolder = $this->getBuildFolder() . "/administrator/manifests/packages";
$xmlFile = $targetFolder . "/pkg_" . $... | php | private function createInstaller()
{
$this->say("Creating package installer");
// Copy XML and script.php
$sourceFolder = $this->getSourceFolder() . "/administrator/manifests/packages";
$targetFolder = $this->getBuildFolder() . "/administrator/manifests/packages";
$xmlFile = $targetFolder . "/pkg_" . $... | [
"private",
"function",
"createInstaller",
"(",
")",
"{",
"$",
"this",
"->",
"say",
"(",
"\"Creating package installer\"",
")",
";",
"// Copy XML and script.php",
"$",
"sourceFolder",
"=",
"$",
"this",
"->",
"getSourceFolder",
"(",
")",
".",
"\"/administrator/manifes... | Generate the installer xml file for the package
@return void
@since 1.0 | [
"Generate",
"the",
"installer",
"xml",
"file",
"for",
"the",
"package"
] | e72dd0ed15f387739f67cacdbc2c0bd1b427f317 | https://github.com/joomla-projects/jorobo/blob/e72dd0ed15f387739f67cacdbc2c0bd1b427f317/src/Tasks/Build/Package.php#L72-L107 |
13,474 | FWidm/dwd-hourly-crawler | src/fwidm/dwdHourlyCrawler/DWDConfiguration.php | DWDConfiguration.getConfiguration | public static function getConfiguration()
{
if (self::$configuration === null && file_exists(self::$configFilePath)) {
// $jsonConfig = file_get_contents(self::$configFilePath_depr);
// self::$configuration = json_decode($jsonConfig);
$settings = include __DIR__ . '/../../... | php | public static function getConfiguration()
{
if (self::$configuration === null && file_exists(self::$configFilePath)) {
// $jsonConfig = file_get_contents(self::$configFilePath_depr);
// self::$configuration = json_decode($jsonConfig);
$settings = include __DIR__ . '/../../... | [
"public",
"static",
"function",
"getConfiguration",
"(",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"configuration",
"===",
"null",
"&&",
"file_exists",
"(",
"self",
"::",
"$",
"configFilePath",
")",
")",
"{",
"// $jsonConfig = file_get_contents(self::$confi... | Returns the complete configuration file to the callee
@return mixed | [
"Returns",
"the",
"complete",
"configuration",
"file",
"to",
"the",
"callee"
] | 36dec7d84a85af599e9d4fb6a3bcc302378ce4a8 | https://github.com/FWidm/dwd-hourly-crawler/blob/36dec7d84a85af599e9d4fb6a3bcc302378ce4a8/src/fwidm/dwdHourlyCrawler/DWDConfiguration.php#L48-L63 |
13,475 | sebastiaanluca/laravel-validator | src/Validators/Validator.php | Validator.getValidInput | public function getValidInput($clean = false)
{
$input = array_dot($this->all());
$rules = array_keys($this->rules());
$keys = collect($rules)->map(function (string $rule) use ($input) {
// Transform each rule to a regex string while supporting
// the wildcard (*) ch... | php | public function getValidInput($clean = false)
{
$input = array_dot($this->all());
$rules = array_keys($this->rules());
$keys = collect($rules)->map(function (string $rule) use ($input) {
// Transform each rule to a regex string while supporting
// the wildcard (*) ch... | [
"public",
"function",
"getValidInput",
"(",
"$",
"clean",
"=",
"false",
")",
"{",
"$",
"input",
"=",
"array_dot",
"(",
"$",
"this",
"->",
"all",
"(",
")",
")",
";",
"$",
"rules",
"=",
"array_keys",
"(",
"$",
"this",
"->",
"rules",
"(",
")",
")",
... | Get validated user input.
Check if input corresponds with fields under validation.
@param bool $clean Remove the input fields whose values are empty.
@return array | [
"Get",
"validated",
"user",
"input",
"."
] | 931b60cfeb2fd4d93a4525d8575ae72825a73fa9 | https://github.com/sebastiaanluca/laravel-validator/blob/931b60cfeb2fd4d93a4525d8575ae72825a73fa9/src/Validators/Validator.php#L35-L64 |
13,476 | sebastiaanluca/laravel-validator | src/Validators/Validator.php | Validator.sanitizeInput | public function sanitizeInput(array $input)
{
return $input = collect($input)->reject(function ($value) {
return is_null($value) || empty($value);
})->toArray();
} | php | public function sanitizeInput(array $input)
{
return $input = collect($input)->reject(function ($value) {
return is_null($value) || empty($value);
})->toArray();
} | [
"public",
"function",
"sanitizeInput",
"(",
"array",
"$",
"input",
")",
"{",
"return",
"$",
"input",
"=",
"collect",
"(",
"$",
"input",
")",
"->",
"reject",
"(",
"function",
"(",
"$",
"value",
")",
"{",
"return",
"is_null",
"(",
"$",
"value",
")",
"|... | Remove null and empty values from the input.
@param array $input
@return array | [
"Remove",
"null",
"and",
"empty",
"values",
"from",
"the",
"input",
"."
] | 931b60cfeb2fd4d93a4525d8575ae72825a73fa9 | https://github.com/sebastiaanluca/laravel-validator/blob/931b60cfeb2fd4d93a4525d8575ae72825a73fa9/src/Validators/Validator.php#L87-L92 |
13,477 | Im0rtality/Underscore | src/Registry.php | Registry.instance | public function instance($name)
{
if (empty($this->instances[$name])) {
if (empty($this->aliases[$name])) {
$this->aliasDefault($name);
}
$this->instances[$name] = new $this->aliases[$name];
}
return $this->instances[$name];
} | php | public function instance($name)
{
if (empty($this->instances[$name])) {
if (empty($this->aliases[$name])) {
$this->aliasDefault($name);
}
$this->instances[$name] = new $this->aliases[$name];
}
return $this->instances[$name];
} | [
"public",
"function",
"instance",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"instances",
"[",
"$",
"name",
"]",
")",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"aliases",
"[",
"$",
"name",
"]",
")",
")",... | Get the callable for an Underscore method alias.
@param string $name
@return callable | [
"Get",
"the",
"callable",
"for",
"an",
"Underscore",
"method",
"alias",
"."
] | 2deb95cfd340761d00ecd0f033e67ce600f2b535 | https://github.com/Im0rtality/Underscore/blob/2deb95cfd340761d00ecd0f033e67ce600f2b535/src/Registry.php#L52-L62 |
13,478 | Im0rtality/Underscore | src/Registry.php | Registry.alias | public function alias($name, $spec)
{
if (is_callable($spec)) {
$this->instances[$name] = $spec;
} else {
$this->aliases[$name] = $spec;
// Ensure that the new alias will be used when called.
unset($this->instances[$name]);
}
} | php | public function alias($name, $spec)
{
if (is_callable($spec)) {
$this->instances[$name] = $spec;
} else {
$this->aliases[$name] = $spec;
// Ensure that the new alias will be used when called.
unset($this->instances[$name]);
}
} | [
"public",
"function",
"alias",
"(",
"$",
"name",
",",
"$",
"spec",
")",
"{",
"if",
"(",
"is_callable",
"(",
"$",
"spec",
")",
")",
"{",
"$",
"this",
"->",
"instances",
"[",
"$",
"name",
"]",
"=",
"$",
"spec",
";",
"}",
"else",
"{",
"$",
"this",... | Alias method name to a callable.
@param string $name
@param callable $spec
@return void | [
"Alias",
"method",
"name",
"to",
"a",
"callable",
"."
] | 2deb95cfd340761d00ecd0f033e67ce600f2b535 | https://github.com/Im0rtality/Underscore/blob/2deb95cfd340761d00ecd0f033e67ce600f2b535/src/Registry.php#L71-L81 |
13,479 | Im0rtality/Underscore | src/Registry.php | Registry.aliasDefault | private function aliasDefault($name)
{
$spec = sprintf('\Underscore\Mutator\%sMutator', ucfirst($name));
if (!class_exists($spec)) {
$spec = sprintf('\Underscore\Accessor\%sAccessor', ucfirst($name));
}
if (!class_exists($spec)) {
$spec = sprintf('\Underscor... | php | private function aliasDefault($name)
{
$spec = sprintf('\Underscore\Mutator\%sMutator', ucfirst($name));
if (!class_exists($spec)) {
$spec = sprintf('\Underscore\Accessor\%sAccessor', ucfirst($name));
}
if (!class_exists($spec)) {
$spec = sprintf('\Underscor... | [
"private",
"function",
"aliasDefault",
"(",
"$",
"name",
")",
"{",
"$",
"spec",
"=",
"sprintf",
"(",
"'\\Underscore\\Mutator\\%sMutator'",
",",
"ucfirst",
"(",
"$",
"name",
")",
")",
";",
"if",
"(",
"!",
"class_exists",
"(",
"$",
"spec",
")",
")",
"{",
... | Define a default mutator, accessor, or initializer for a method name.
@throws \BadMethodCallException If no default can be located.
@param string $name
@return void | [
"Define",
"a",
"default",
"mutator",
"accessor",
"or",
"initializer",
"for",
"a",
"method",
"name",
"."
] | 2deb95cfd340761d00ecd0f033e67ce600f2b535 | https://github.com/Im0rtality/Underscore/blob/2deb95cfd340761d00ecd0f033e67ce600f2b535/src/Registry.php#L90-L107 |
13,480 | attm2x/m2x-php | src/Command.php | Command.refresh | public function refresh() {
$response = $this->client->get($this->path());
$this->setData($response->json());
} | php | public function refresh() {
$response = $this->client->get($this->path());
$this->setData($response->json());
} | [
"public",
"function",
"refresh",
"(",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"client",
"->",
"get",
"(",
"$",
"this",
"->",
"path",
"(",
")",
")",
";",
"$",
"this",
"->",
"setData",
"(",
"$",
"response",
"->",
"json",
"(",
")",
")",
... | Refresh the Command Info | [
"Refresh",
"the",
"Command",
"Info"
] | 4c2ff6d70af50538818855e648af24bf5cf16ead | https://github.com/attm2x/m2x-php/blob/4c2ff6d70af50538818855e648af24bf5cf16ead/src/Command.php#L41-L44 |
13,481 | psecio/propauth | src/Policy.php | Policy.addCheck | protected function addCheck($name, $type, $args)
{
$func = $type.'Check';
if (method_exists($this, $func)) {
$type = strtolower(str_replace($type, '', $name));
$this->$func($type, $name, $args);
} else {
throw new \InvalidArgumentException('Invalid check ty... | php | protected function addCheck($name, $type, $args)
{
$func = $type.'Check';
if (method_exists($this, $func)) {
$type = strtolower(str_replace($type, '', $name));
$this->$func($type, $name, $args);
} else {
throw new \InvalidArgumentException('Invalid check ty... | [
"protected",
"function",
"addCheck",
"(",
"$",
"name",
",",
"$",
"type",
",",
"$",
"args",
")",
"{",
"$",
"func",
"=",
"$",
"type",
".",
"'Check'",
";",
"if",
"(",
"method_exists",
"(",
"$",
"this",
",",
"$",
"func",
")",
")",
"{",
"$",
"type",
... | Add a new check to the set
@param string $name Function name
@param string $type Check type
@param array $args Check arguments
@throws \InvalidArgumentException If check type is invalid | [
"Add",
"a",
"new",
"check",
"to",
"the",
"set"
] | cb24fcc0a3fa459f2ef40a867c334951aabf7b83 | https://github.com/psecio/propauth/blob/cb24fcc0a3fa459f2ef40a867c334951aabf7b83/src/Policy.php#L94-L104 |
13,482 | psecio/propauth | src/Policy.php | Policy.load | public static function load($dslString)
{
$policy = self::instance();
$parts = explode('||', $dslString);
foreach ($parts as $match) {
$args = [];
list($method, $value) = explode(':', $match);
// if we have data following the ":" inside (), array it
... | php | public static function load($dslString)
{
$policy = self::instance();
$parts = explode('||', $dslString);
foreach ($parts as $match) {
$args = [];
list($method, $value) = explode(':', $match);
// if we have data following the ":" inside (), array it
... | [
"public",
"static",
"function",
"load",
"(",
"$",
"dslString",
")",
"{",
"$",
"policy",
"=",
"self",
"::",
"instance",
"(",
")",
";",
"$",
"parts",
"=",
"explode",
"(",
"'||'",
",",
"$",
"dslString",
")",
";",
"foreach",
"(",
"$",
"parts",
"as",
"$... | Load a policy from a string DSL
See the README for formatting
@param string $dslString DSL formatted string | [
"Load",
"a",
"policy",
"from",
"a",
"string",
"DSL",
"See",
"the",
"README",
"for",
"formatting"
] | cb24fcc0a3fa459f2ef40a867c334951aabf7b83 | https://github.com/psecio/propauth/blob/cb24fcc0a3fa459f2ef40a867c334951aabf7b83/src/Policy.php#L122-L150 |
13,483 | psecio/propauth | src/Policy.php | Policy.check | private function check($matchType, $type, $name, $args)
{
$value = array_shift($args);
if (!isset($args[0])) {
$args[0] = ['rule' => Policy::ANY];
}
// see what other options we've been given
if (is_string($args[0]) && ($args[0] === Policy::ANY || $args[0] === Pol... | php | private function check($matchType, $type, $name, $args)
{
$value = array_shift($args);
if (!isset($args[0])) {
$args[0] = ['rule' => Policy::ANY];
}
// see what other options we've been given
if (is_string($args[0]) && ($args[0] === Policy::ANY || $args[0] === Pol... | [
"private",
"function",
"check",
"(",
"$",
"matchType",
",",
"$",
"type",
",",
"$",
"name",
",",
"$",
"args",
")",
"{",
"$",
"value",
"=",
"array_shift",
"(",
"$",
"args",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"args",
"[",
"0",
"]",
")",
... | Add a new check to the current set for the policy
@param string $matchType Match type
@param string $type Type of check
@param string $name Name for the check
@param array $args Additional arguments for the check | [
"Add",
"a",
"new",
"check",
"to",
"the",
"current",
"set",
"for",
"the",
"policy"
] | cb24fcc0a3fa459f2ef40a867c334951aabf7b83 | https://github.com/psecio/propauth/blob/cb24fcc0a3fa459f2ef40a867c334951aabf7b83/src/Policy.php#L172-L189 |
13,484 | psecio/propauth | src/Policy.php | Policy.cannotCheck | private function cannotCheck($type, $name, $args)
{
if (isset($args[0]) && (is_object($args[0]) && get_class($args[0]) === 'Closure')) {
$type = 'closure';
$args[1] = $args[0];
} elseif (is_string($args[0]) && strpos($args[0], '::') !== false) {
$type = 'method';
... | php | private function cannotCheck($type, $name, $args)
{
if (isset($args[0]) && (is_object($args[0]) && get_class($args[0]) === 'Closure')) {
$type = 'closure';
$args[1] = $args[0];
} elseif (is_string($args[0]) && strpos($args[0], '::') !== false) {
$type = 'method';
... | [
"private",
"function",
"cannotCheck",
"(",
"$",
"type",
",",
"$",
"name",
",",
"$",
"args",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"args",
"[",
"0",
"]",
")",
"&&",
"(",
"is_object",
"(",
"$",
"args",
"[",
"0",
"]",
")",
"&&",
"get_class",
"("... | Add a "cannot" check to the set
@param string $type Check type
@param string $name Name for the check
@param array $args Additional arguments | [
"Add",
"a",
"cannot",
"check",
"to",
"the",
"set"
] | cb24fcc0a3fa459f2ef40a867c334951aabf7b83 | https://github.com/psecio/propauth/blob/cb24fcc0a3fa459f2ef40a867c334951aabf7b83/src/Policy.php#L228-L238 |
13,485 | terdia/legato-framework | src/Routing/Route.php | Route.add | public static function add($method, $target, $handler, $name = null)
{
array_push(static::$prefixRoutes, [
'method' => $method, 'target' => $target,
'handler' => $handler, 'name' => $name,
]);
} | php | public static function add($method, $target, $handler, $name = null)
{
array_push(static::$prefixRoutes, [
'method' => $method, 'target' => $target,
'handler' => $handler, 'name' => $name,
]);
} | [
"public",
"static",
"function",
"add",
"(",
"$",
"method",
",",
"$",
"target",
",",
"$",
"handler",
",",
"$",
"name",
"=",
"null",
")",
"{",
"array_push",
"(",
"static",
"::",
"$",
"prefixRoutes",
",",
"[",
"'method'",
"=>",
"$",
"method",
",",
"'tar... | Support method to add group of routes.
@param $method, HTTP Request method
@param $target, the route
@param $handler, Closure | Controller@method
@param $name, route name optional | [
"Support",
"method",
"to",
"add",
"group",
"of",
"routes",
"."
] | 44057c1c3c6f3e9643e9fade51bd417860fafda8 | https://github.com/terdia/legato-framework/blob/44057c1c3c6f3e9643e9fade51bd417860fafda8/src/Routing/Route.php#L61-L67 |
13,486 | terdia/legato-framework | src/Routing/Route.php | Route.group | public static function group($prefix, Closure $callback)
{
$callback->call(new static());
foreach (static::$prefixRoutes as $key => $prefixRoute) {
$target = $prefix.$prefixRoute['target'];
$handler = $prefixRoute['handler'];
$name = $prefixRoute['name'];
... | php | public static function group($prefix, Closure $callback)
{
$callback->call(new static());
foreach (static::$prefixRoutes as $key => $prefixRoute) {
$target = $prefix.$prefixRoute['target'];
$handler = $prefixRoute['handler'];
$name = $prefixRoute['name'];
... | [
"public",
"static",
"function",
"group",
"(",
"$",
"prefix",
",",
"Closure",
"$",
"callback",
")",
"{",
"$",
"callback",
"->",
"call",
"(",
"new",
"static",
"(",
")",
")",
";",
"foreach",
"(",
"static",
"::",
"$",
"prefixRoutes",
"as",
"$",
"key",
"=... | Route Group.
@param $prefix
@param \Closure $callback | [
"Route",
"Group",
"."
] | 44057c1c3c6f3e9643e9fade51bd417860fafda8 | https://github.com/terdia/legato-framework/blob/44057c1c3c6f3e9643e9fade51bd417860fafda8/src/Routing/Route.php#L75-L90 |
13,487 | terdia/legato-framework | src/Routing/Route.php | Route.resource | public static function resource($target, $handler)
{
$route = $target;
$sanitized = str_replace('/', '', $target);
static::get($route, $handler.'@index', $sanitized.'_index');
static::get($target.'/create', $handler.'@showCreateForm', $sanitized.'_create_form');
static::post... | php | public static function resource($target, $handler)
{
$route = $target;
$sanitized = str_replace('/', '', $target);
static::get($route, $handler.'@index', $sanitized.'_index');
static::get($target.'/create', $handler.'@showCreateForm', $sanitized.'_create_form');
static::post... | [
"public",
"static",
"function",
"resource",
"(",
"$",
"target",
",",
"$",
"handler",
")",
"{",
"$",
"route",
"=",
"$",
"target",
";",
"$",
"sanitized",
"=",
"str_replace",
"(",
"'/'",
",",
"''",
",",
"$",
"target",
")",
";",
"static",
"::",
"get",
... | Create a Rest Resource.
@param $target
@param $handler | [
"Create",
"a",
"Rest",
"Resource",
"."
] | 44057c1c3c6f3e9643e9fade51bd417860fafda8 | https://github.com/terdia/legato-framework/blob/44057c1c3c6f3e9643e9fade51bd417860fafda8/src/Routing/Route.php#L98-L110 |
13,488 | liip/LiipDrupalConnectorModule | src/Liip/Drupal/Modules/DrupalConnector/File.php | File.file_save_data | function file_save_data($data, $destination = NULL, $replace = FILE_EXISTS_RENAME) {
return file_save_data($data, $destination, $replace);
} | php | function file_save_data($data, $destination = NULL, $replace = FILE_EXISTS_RENAME) {
return file_save_data($data, $destination, $replace);
} | [
"function",
"file_save_data",
"(",
"$",
"data",
",",
"$",
"destination",
"=",
"NULL",
",",
"$",
"replace",
"=",
"FILE_EXISTS_RENAME",
")",
"{",
"return",
"file_save_data",
"(",
"$",
"data",
",",
"$",
"destination",
",",
"$",
"replace",
")",
";",
"}"
] | Saves a file to the specified destination and creates a database entry.
@param $data
A string containing the contents of the file.
@param $destination
A string containing the destination URI. This must be a stream wrapper URI.
If no value is provided, a randomized name will be generated and the file
will be saved usin... | [
"Saves",
"a",
"file",
"to",
"the",
"specified",
"destination",
"and",
"creates",
"a",
"database",
"entry",
"."
] | 6ba161ef0d3a27c108e533f1adbea22ed73b78ce | https://github.com/liip/LiipDrupalConnectorModule/blob/6ba161ef0d3a27c108e533f1adbea22ed73b78ce/src/Liip/Drupal/Modules/DrupalConnector/File.php#L133-L135 |
13,489 | terdia/legato-framework | src/Console/StartPhpInbuiltServer.php | StartPhpInbuiltServer.execute | public function execute(InputInterface $input, OutputInterface $output)
{
chdir('public');
/*
* check for user supplied hostname option
*/
if ($input->hasOption('hostname') && $input->getOption('hostname') != null) {
$this->hostname = $input->getOption('hostnam... | php | public function execute(InputInterface $input, OutputInterface $output)
{
chdir('public');
/*
* check for user supplied hostname option
*/
if ($input->hasOption('hostname') && $input->getOption('hostname') != null) {
$this->hostname = $input->getOption('hostnam... | [
"public",
"function",
"execute",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"chdir",
"(",
"'public'",
")",
";",
"/*\n * check for user supplied hostname option\n */",
"if",
"(",
"$",
"input",
"->",
"hasOption"... | You command logic.
@param InputInterface $input
@param OutputInterface $output
@return void | [
"You",
"command",
"logic",
"."
] | 44057c1c3c6f3e9643e9fade51bd417860fafda8 | https://github.com/terdia/legato-framework/blob/44057c1c3c6f3e9643e9fade51bd417860fafda8/src/Console/StartPhpInbuiltServer.php#L56-L85 |
13,490 | iP1SMS/ip1-php-sdk | src/Core/ClassValidationArray.php | ClassValidationArray.offsetSet | public function offsetSet($index, $value): void
{
if (!is_object($value)) {
throw new \InvalidArgumentException("Excepcted object, got ". gettype($value));
}
if (!isset($this->class)) {
$this->class = get_class($value);
}
if (get_class($value) === $thi... | php | public function offsetSet($index, $value): void
{
if (!is_object($value)) {
throw new \InvalidArgumentException("Excepcted object, got ". gettype($value));
}
if (!isset($this->class)) {
$this->class = get_class($value);
}
if (get_class($value) === $thi... | [
"public",
"function",
"offsetSet",
"(",
"$",
"index",
",",
"$",
"value",
")",
":",
"void",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"value",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"\"Excepcted object, got \"",
".",
"gettyp... | Sets the value at the specified index to value if value's class matches the one set.
If a class has not been set it will set the given object's class as the only allowed class.
@param mixed $index The index to put the value in.
@param object $value The object that should be added.
@return void
@throws \InvalidArgument... | [
"Sets",
"the",
"value",
"at",
"the",
"specified",
"index",
"to",
"value",
"if",
"value",
"s",
"class",
"matches",
"the",
"one",
"set",
".",
"If",
"a",
"class",
"has",
"not",
"been",
"set",
"it",
"will",
"set",
"the",
"given",
"object",
"s",
"class",
... | 348e6572a279363ba689c9e0f5689b83a25930f5 | https://github.com/iP1SMS/ip1-php-sdk/blob/348e6572a279363ba689c9e0f5689b83a25930f5/src/Core/ClassValidationArray.php#L79-L92 |
13,491 | venta/framework | src/Container/src/Exception/UnresolvableDependencyException.php | UnresolvableDependencyException.formatParameter | private function formatParameter(ReflectionParameter $parameter): string
{
return $parameter->hasType() ?
sprintf('%s $%s', $parameter->getType(), $parameter->getName()) :
sprintf('$%s', $parameter->getName());
} | php | private function formatParameter(ReflectionParameter $parameter): string
{
return $parameter->hasType() ?
sprintf('%s $%s', $parameter->getType(), $parameter->getName()) :
sprintf('$%s', $parameter->getName());
} | [
"private",
"function",
"formatParameter",
"(",
"ReflectionParameter",
"$",
"parameter",
")",
":",
"string",
"{",
"return",
"$",
"parameter",
"->",
"hasType",
"(",
")",
"?",
"sprintf",
"(",
"'%s $%s'",
",",
"$",
"parameter",
"->",
"getType",
"(",
")",
",",
... | Formats parameter depending on type
@param ReflectionParameter $parameter
@return string | [
"Formats",
"parameter",
"depending",
"on",
"type"
] | 514a7854cc69f84f47e62a58cc55efd68b7c9f83 | https://github.com/venta/framework/blob/514a7854cc69f84f47e62a58cc55efd68b7c9f83/src/Container/src/Exception/UnresolvableDependencyException.php#L61-L66 |
13,492 | terdia/legato-framework | src/Console/CommandTemplate.php | CommandTemplate.controller | public function controller()
{
if ($this->restful) {
return filesystem()->exists(realpath(__DIR__.'/../../../../../app/controllers')) ?
realpath(__DIR__.'/../Templates/controller/restful.stub') :
realpath(__DIR__.'/../Templates/controller/restful.core.stub');
... | php | public function controller()
{
if ($this->restful) {
return filesystem()->exists(realpath(__DIR__.'/../../../../../app/controllers')) ?
realpath(__DIR__.'/../Templates/controller/restful.stub') :
realpath(__DIR__.'/../Templates/controller/restful.core.stub');
... | [
"public",
"function",
"controller",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"restful",
")",
"{",
"return",
"filesystem",
"(",
")",
"->",
"exists",
"(",
"realpath",
"(",
"__DIR__",
".",
"'/../../../../../app/controllers'",
")",
")",
"?",
"realpath",
"(... | Get the template for creating a controller.
@return bool|string | [
"Get",
"the",
"template",
"for",
"creating",
"a",
"controller",
"."
] | 44057c1c3c6f3e9643e9fade51bd417860fafda8 | https://github.com/terdia/legato-framework/blob/44057c1c3c6f3e9643e9fade51bd417860fafda8/src/Console/CommandTemplate.php#L22-L33 |
13,493 | guillaumemonet/Rad | src/Rad/Utils/StringUtils.php | StringUtils.parseComments | public static function parseComments($comments) {
$ret = [];
//trim(str_replace(array('/', '*', '**'), '', substr($comments, 0, strpos($comments, '@'))));
$comments = str_replace(array('/*', '*', '**'), '', $comments);
$array_comments = explode("\n", $comments);
foreach ($ar... | php | public static function parseComments($comments) {
$ret = [];
//trim(str_replace(array('/', '*', '**'), '', substr($comments, 0, strpos($comments, '@'))));
$comments = str_replace(array('/*', '*', '**'), '', $comments);
$array_comments = explode("\n", $comments);
foreach ($ar... | [
"public",
"static",
"function",
"parseComments",
"(",
"$",
"comments",
")",
"{",
"$",
"ret",
"=",
"[",
"]",
";",
"//trim(str_replace(array('/', '*', '**'), '', substr($comments, 0, strpos($comments, '@'))));\r",
"$",
"comments",
"=",
"str_replace",
"(",
"array",
"(",
"'... | Parse comment, used only when generate php
@param string $comments | [
"Parse",
"comment",
"used",
"only",
"when",
"generate",
"php"
] | cb9932f570cf3c2a7197f81e1d959c2729989e59 | https://github.com/guillaumemonet/Rad/blob/cb9932f570cf3c2a7197f81e1d959c2729989e59/src/Rad/Utils/StringUtils.php#L194-L208 |
13,494 | mimmi20/Wurfl | src/Handlers/CatchAllMozillaHandler.php | CatchAllMozillaHandler.applyConclusiveMatch | public function applyConclusiveMatch($userAgent)
{
//High accuracy mode
$tolerance = Utils::firstCloseParen($userAgent);
return $this->getDeviceIDFromRIS($userAgent, $tolerance);
} | php | public function applyConclusiveMatch($userAgent)
{
//High accuracy mode
$tolerance = Utils::firstCloseParen($userAgent);
return $this->getDeviceIDFromRIS($userAgent, $tolerance);
} | [
"public",
"function",
"applyConclusiveMatch",
"(",
"$",
"userAgent",
")",
"{",
"//High accuracy mode",
"$",
"tolerance",
"=",
"Utils",
"::",
"firstCloseParen",
"(",
"$",
"userAgent",
")",
";",
"return",
"$",
"this",
"->",
"getDeviceIDFromRIS",
"(",
"$",
"userAge... | If UA starts with Mozilla, apply LD with tollerance 5.
@param string $userAgent
@return string | [
"If",
"UA",
"starts",
"with",
"Mozilla",
"apply",
"LD",
"with",
"tollerance",
"5",
"."
] | 443ed0d73a0b9a21ebd0d6ddf1e32669b9de44ec | https://github.com/mimmi20/Wurfl/blob/443ed0d73a0b9a21ebd0d6ddf1e32669b9de44ec/src/Handlers/CatchAllMozillaHandler.php#L50-L56 |
13,495 | rfdy/imagemagick | Image/Url.php | Url.getImageData | public function getImageData() {
if ($this->imageData === null) {
$this->imageData = $this->download($this->url);
}
return $this->imageData;
} | php | public function getImageData() {
if ($this->imageData === null) {
$this->imageData = $this->download($this->url);
}
return $this->imageData;
} | [
"public",
"function",
"getImageData",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"imageData",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"imageData",
"=",
"$",
"this",
"->",
"download",
"(",
"$",
"this",
"->",
"url",
")",
";",
"}",
"return",
"$"... | Returns the complete image data, wherever it may have come from.
@return string | [
"Returns",
"the",
"complete",
"image",
"data",
"wherever",
"it",
"may",
"have",
"come",
"from",
"."
] | dd1e52fbd66093828dd013e64c53dc7d68f1bc91 | https://github.com/rfdy/imagemagick/blob/dd1e52fbd66093828dd013e64c53dc7d68f1bc91/Image/Url.php#L28-L33 |
13,496 | MissAllSunday/Ohara | src/Suki/Db.php | Db.read | public function read($params, $data, $key = false, $single = false)
{
global $smcFunc;
$dataResult = [];
$query = $smcFunc['db_query']('', '
SELECT ' . $params['rows'] .'
FROM {db_prefix}' . $params['table'] .'
'. (!empty($params['join']) ? 'LEFT JOIN '. $params['join'] : '') .'
'. (!empty($params['w... | php | public function read($params, $data, $key = false, $single = false)
{
global $smcFunc;
$dataResult = [];
$query = $smcFunc['db_query']('', '
SELECT ' . $params['rows'] .'
FROM {db_prefix}' . $params['table'] .'
'. (!empty($params['join']) ? 'LEFT JOIN '. $params['join'] : '') .'
'. (!empty($params['w... | [
"public",
"function",
"read",
"(",
"$",
"params",
",",
"$",
"data",
",",
"$",
"key",
"=",
"false",
",",
"$",
"single",
"=",
"false",
")",
"{",
"global",
"$",
"smcFunc",
";",
"$",
"dataResult",
"=",
"[",
"]",
";",
"$",
"query",
"=",
"$",
"smcFunc"... | Reads data from a table.
@param array $params An array with all the params for the query
@param array $data An array to pass to $smcFunc casting array
@param bool $key A boolean value to asign a row as key on the returning array
@param bool $single A bool to tell the query to return a single value instead of An array... | [
"Reads",
"data",
"from",
"a",
"table",
"."
] | 7753500cde1d51a0d7b37593aeaf2fc05fefd903 | https://github.com/MissAllSunday/Ohara/blob/7753500cde1d51a0d7b37593aeaf2fc05fefd903/src/Suki/Db.php#L85-L116 |
13,497 | MissAllSunday/Ohara | src/Suki/Db.php | Db.delete | public function delete($value, $table = '', $column = '')
{
global $smcFunc;
if (empty($id) || empty($table) || empty($column))
return false;
// Perform.
return $smcFunc['db_query']('', '
DELETE FROM {db_prefix}' . ($table) . '
WHERE '. ($column) .' = '. ($value) .'', array());
} | php | public function delete($value, $table = '', $column = '')
{
global $smcFunc;
if (empty($id) || empty($table) || empty($column))
return false;
// Perform.
return $smcFunc['db_query']('', '
DELETE FROM {db_prefix}' . ($table) . '
WHERE '. ($column) .' = '. ($value) .'', array());
} | [
"public",
"function",
"delete",
"(",
"$",
"value",
",",
"$",
"table",
"=",
"''",
",",
"$",
"column",
"=",
"''",
")",
"{",
"global",
"$",
"smcFunc",
";",
"if",
"(",
"empty",
"(",
"$",
"id",
")",
"||",
"empty",
"(",
"$",
"table",
")",
"||",
"empt... | Deletes an entry from X table.
@access public
@param mixed $value The table name.
@param string $table The table name, if left empty and $this->_schema is defined, it will use the first table on it.
@param string $column The column name, if left empty and $this->_schema[$table] is defined, it will use the first column ... | [
"Deletes",
"an",
"entry",
"from",
"X",
"table",
"."
] | 7753500cde1d51a0d7b37593aeaf2fc05fefd903 | https://github.com/MissAllSunday/Ohara/blob/7753500cde1d51a0d7b37593aeaf2fc05fefd903/src/Suki/Db.php#L178-L189 |
13,498 | ionutmilica/laravel-settings | src/Drivers/Json.php | Json.load | public function load()
{
$data = [];
if (is_file($this->filePath)) {
$data = json_decode(file_get_contents($this->filePath), true);
}
return $data;
} | php | public function load()
{
$data = [];
if (is_file($this->filePath)) {
$data = json_decode(file_get_contents($this->filePath), true);
}
return $data;
} | [
"public",
"function",
"load",
"(",
")",
"{",
"$",
"data",
"=",
"[",
"]",
";",
"if",
"(",
"is_file",
"(",
"$",
"this",
"->",
"filePath",
")",
")",
"{",
"$",
"data",
"=",
"json_decode",
"(",
"file_get_contents",
"(",
"$",
"this",
"->",
"filePath",
")... | Prepare the data for driver operations | [
"Prepare",
"the",
"data",
"for",
"driver",
"operations"
] | becbd839f8c1c1bcbfde42ea808f1c69e5233dee | https://github.com/ionutmilica/laravel-settings/blob/becbd839f8c1c1bcbfde42ea808f1c69e5233dee/src/Drivers/Json.php#L43-L52 |
13,499 | ronan-gloo/jade-php | src/Jade/Lexer.php | Lexer.setInput | public function setInput($input)
{
$this->input = preg_replace("/\r\n|\r/", "\n", $input);
$this->lineno = 1;
$this->deferred = array();
$this->indentStack = array();
$this->stash = array();
} | php | public function setInput($input)
{
$this->input = preg_replace("/\r\n|\r/", "\n", $input);
$this->lineno = 1;
$this->deferred = array();
$this->indentStack = array();
$this->stash = array();
} | [
"public",
"function",
"setInput",
"(",
"$",
"input",
")",
"{",
"$",
"this",
"->",
"input",
"=",
"preg_replace",
"(",
"\"/\\r\\n|\\r/\"",
",",
"\"\\n\"",
",",
"$",
"input",
")",
";",
"$",
"this",
"->",
"lineno",
"=",
"1",
";",
"$",
"this",
"->",
"defe... | Set lexer input.
@param string $input input string | [
"Set",
"lexer",
"input",
"."
] | 77230d2eef2f0d4f045292a5906162f0c0499421 | https://github.com/ronan-gloo/jade-php/blob/77230d2eef2f0d4f045292a5906162f0c0499421/src/Jade/Lexer.php#L52-L59 |
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.