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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
20,200 | legalthings/permission-matcher | src/PermissionMatcher.php | PermissionMatcher.getStringQueryParameters | protected function getStringQueryParameters($string)
{
$query = parse_url($string, PHP_URL_QUERY);
$params = [];
if ($query) parse_str($query, $params);
return $params;
} | php | protected function getStringQueryParameters($string)
{
$query = parse_url($string, PHP_URL_QUERY);
$params = [];
if ($query) parse_str($query, $params);
return $params;
} | [
"protected",
"function",
"getStringQueryParameters",
"(",
"$",
"string",
")",
"{",
"$",
"query",
"=",
"parse_url",
"(",
"$",
"string",
",",
"PHP_URL_QUERY",
")",
";",
"$",
"params",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"query",
")",
"parse_str",
"(",
"$... | Get the query parameters used in a string
@param string $string
@return array | [
"Get",
"the",
"query",
"parameters",
"used",
"in",
"a",
"string"
] | fbfa925e92406fe9dac83b387be47931e6de0f81 | https://github.com/legalthings/permission-matcher/blob/fbfa925e92406fe9dac83b387be47931e6de0f81/src/PermissionMatcher.php#L165-L173 |
20,201 | legalthings/permission-matcher | src/PermissionMatcher.php | PermissionMatcher.flatten | protected function flatten($input)
{
$list = [];
foreach ($input as $item) {
$list = array_merge($list, (array)$item);
}
return array_unique($list);
} | php | protected function flatten($input)
{
$list = [];
foreach ($input as $item) {
$list = array_merge($list, (array)$item);
}
return array_unique($list);
} | [
"protected",
"function",
"flatten",
"(",
"$",
"input",
")",
"{",
"$",
"list",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"input",
"as",
"$",
"item",
")",
"{",
"$",
"list",
"=",
"array_merge",
"(",
"$",
"list",
",",
"(",
"array",
")",
"$",
"item",
... | Turn a 2 dimensional privilege array into a list of privileges
@param array $input
@return array | [
"Turn",
"a",
"2",
"dimensional",
"privilege",
"array",
"into",
"a",
"list",
"of",
"privileges"
] | fbfa925e92406fe9dac83b387be47931e6de0f81 | https://github.com/legalthings/permission-matcher/blob/fbfa925e92406fe9dac83b387be47931e6de0f81/src/PermissionMatcher.php#L182-L191 |
20,202 | legalthings/permission-matcher | src/PermissionMatcher.php | PermissionMatcher.addAuthzGroupsToPrivileges | protected function addAuthzGroupsToPrivileges(array $privileges, $authzGroupsPrivileges, array $authzGroups)
{
$authzGroupsPrivileges = !is_string($authzGroupsPrivileges) ? $authzGroupsPrivileges : [$authzGroupsPrivileges];
foreach($authzGroupsPrivileges as $privilege) {
$curren... | php | protected function addAuthzGroupsToPrivileges(array $privileges, $authzGroupsPrivileges, array $authzGroups)
{
$authzGroupsPrivileges = !is_string($authzGroupsPrivileges) ? $authzGroupsPrivileges : [$authzGroupsPrivileges];
foreach($authzGroupsPrivileges as $privilege) {
$curren... | [
"protected",
"function",
"addAuthzGroupsToPrivileges",
"(",
"array",
"$",
"privileges",
",",
"$",
"authzGroupsPrivileges",
",",
"array",
"$",
"authzGroups",
")",
"{",
"$",
"authzGroupsPrivileges",
"=",
"!",
"is_string",
"(",
"$",
"authzGroupsPrivileges",
")",
"?",
... | Populate an array of privileges with their corresponding authz groups
@param array $privileges The resulting array
@param string|array $authzGroupsPrivileges The privileges that the authzgroup has
@param array $authzGroups
@return array $privileges | [
"Populate",
"an",
"array",
"of",
"privileges",
"with",
"their",
"corresponding",
"authz",
"groups"
] | fbfa925e92406fe9dac83b387be47931e6de0f81 | https://github.com/legalthings/permission-matcher/blob/fbfa925e92406fe9dac83b387be47931e6de0f81/src/PermissionMatcher.php#L201-L211 |
20,203 | lukasz-adamski/teamspeak3-framework | src/TeamSpeak3/Helper/Str.php | Str.fromHex | public static function fromHex($hex)
{
$string = "";
if(strlen($hex)%2 == 1)
{
throw new Exception("given parameter '" . $hex . "' is not a valid hexadecimal number");
}
foreach(str_split($hex, 2) as $chunk)
{
$string .= chr(hexdec($chunk));
}
return new self($string);
... | php | public static function fromHex($hex)
{
$string = "";
if(strlen($hex)%2 == 1)
{
throw new Exception("given parameter '" . $hex . "' is not a valid hexadecimal number");
}
foreach(str_split($hex, 2) as $chunk)
{
$string .= chr(hexdec($chunk));
}
return new self($string);
... | [
"public",
"static",
"function",
"fromHex",
"(",
"$",
"hex",
")",
"{",
"$",
"string",
"=",
"\"\"",
";",
"if",
"(",
"strlen",
"(",
"$",
"hex",
")",
"%",
"2",
"==",
"1",
")",
"{",
"throw",
"new",
"Exception",
"(",
"\"given parameter '\"",
".",
"$",
"h... | Returns the Str based on a given hex value.
@param string $hex
@throws Exception
@return Str | [
"Returns",
"the",
"Str",
"based",
"on",
"a",
"given",
"hex",
"value",
"."
] | 39a56eca608da6b56b6aa386a7b5b31dc576c41a | https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Helper/Str.php#L529-L544 |
20,204 | skmetaly/laravel-twitch-restful-api | src/API/BaseApi.php | BaseApi.createRequest | protected function createRequest($type, $url, $token)
{
return $this->client->createRequest($type, $url, $this->getDefaultHeaders($token));
} | php | protected function createRequest($type, $url, $token)
{
return $this->client->createRequest($type, $url, $this->getDefaultHeaders($token));
} | [
"protected",
"function",
"createRequest",
"(",
"$",
"type",
",",
"$",
"url",
",",
"$",
"token",
")",
"{",
"return",
"$",
"this",
"->",
"client",
"->",
"createRequest",
"(",
"$",
"type",
",",
"$",
"url",
",",
"$",
"this",
"->",
"getDefaultHeaders",
"(",... | Creates an authorized request
@param $type
@param $url
@param $token
@return \GuzzleHttp\Message\Request|\GuzzleHttp\Message\RequestInterface | [
"Creates",
"an",
"authorized",
"request"
] | 70c83e441deb411ade2e343ad5cb0339c90dc6c2 | https://github.com/skmetaly/laravel-twitch-restful-api/blob/70c83e441deb411ade2e343ad5cb0339c90dc6c2/src/API/BaseApi.php#L82-L85 |
20,205 | NuclearCMS/Hierarchy | src/Builders/BuilderService.php | BuilderService.buildTable | public function buildTable($name, $id)
{
$this->modelBuilder->build($name);
$this->formBuilder->build($name);
$migration = $this->migrationBuilder->buildSourceTableMigration($name);
$this->migrateUp($migration);
} | php | public function buildTable($name, $id)
{
$this->modelBuilder->build($name);
$this->formBuilder->build($name);
$migration = $this->migrationBuilder->buildSourceTableMigration($name);
$this->migrateUp($migration);
} | [
"public",
"function",
"buildTable",
"(",
"$",
"name",
",",
"$",
"id",
")",
"{",
"$",
"this",
"->",
"modelBuilder",
"->",
"build",
"(",
"$",
"name",
")",
";",
"$",
"this",
"->",
"formBuilder",
"->",
"build",
"(",
"$",
"name",
")",
";",
"$",
"migrati... | Builds a source table and associated entities
@param string $name
@param int $id | [
"Builds",
"a",
"source",
"table",
"and",
"associated",
"entities"
] | 535171c5e2db72265313fd2110aec8456e46f459 | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Builders/BuilderService.php#L50-L57 |
20,206 | NuclearCMS/Hierarchy | src/Builders/BuilderService.php | BuilderService.buildField | public function buildField($name, $type, $indexed, $tableName, NodeTypeContract $nodeType)
{
$this->modelBuilder->build($tableName, $nodeType->getFields());
$this->buildForm($nodeType);
$migration = $this->migrationBuilder->buildFieldMigrationForTable($name, $type, $indexed, $tableName);
... | php | public function buildField($name, $type, $indexed, $tableName, NodeTypeContract $nodeType)
{
$this->modelBuilder->build($tableName, $nodeType->getFields());
$this->buildForm($nodeType);
$migration = $this->migrationBuilder->buildFieldMigrationForTable($name, $type, $indexed, $tableName);
... | [
"public",
"function",
"buildField",
"(",
"$",
"name",
",",
"$",
"type",
",",
"$",
"indexed",
",",
"$",
"tableName",
",",
"NodeTypeContract",
"$",
"nodeType",
")",
"{",
"$",
"this",
"->",
"modelBuilder",
"->",
"build",
"(",
"$",
"tableName",
",",
"$",
"... | Builds a field on a source table and associated entities
@param string $name
@param string $type
@param bool $indexed
@param string $tableName
@param NodeTypeContract $nodeType | [
"Builds",
"a",
"field",
"on",
"a",
"source",
"table",
"and",
"associated",
"entities"
] | 535171c5e2db72265313fd2110aec8456e46f459 | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Builders/BuilderService.php#L68-L75 |
20,207 | NuclearCMS/Hierarchy | src/Builders/BuilderService.php | BuilderService.destroyTable | public function destroyTable($name, array $fields, $id)
{
$this->modelBuilder->destroy($name);
$this->formBuilder->destroy($name);
$migration = $this->migrationBuilder
->getMigrationClassPathByKey($name);
$this->migrateDown($migration);
$this->migrationBuilder-... | php | public function destroyTable($name, array $fields, $id)
{
$this->modelBuilder->destroy($name);
$this->formBuilder->destroy($name);
$migration = $this->migrationBuilder
->getMigrationClassPathByKey($name);
$this->migrateDown($migration);
$this->migrationBuilder-... | [
"public",
"function",
"destroyTable",
"(",
"$",
"name",
",",
"array",
"$",
"fields",
",",
"$",
"id",
")",
"{",
"$",
"this",
"->",
"modelBuilder",
"->",
"destroy",
"(",
"$",
"name",
")",
";",
"$",
"this",
"->",
"formBuilder",
"->",
"destroy",
"(",
"$"... | Destroys a source table and all associated entities
@param string $name
@param array $fields
@param int $id | [
"Destroys",
"a",
"source",
"table",
"and",
"all",
"associated",
"entities"
] | 535171c5e2db72265313fd2110aec8456e46f459 | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Builders/BuilderService.php#L94-L105 |
20,208 | NuclearCMS/Hierarchy | src/Builders/BuilderService.php | BuilderService.destroyField | public function destroyField($name, $tableName, NodeTypeContract $nodeType)
{
$this->modelBuilder->build($tableName, $nodeType->getFields());
$this->formBuilder->build($tableName, $nodeType->getFields());
$migration = $this->migrationBuilder
->getMigrationClassPathByKey($tableNa... | php | public function destroyField($name, $tableName, NodeTypeContract $nodeType)
{
$this->modelBuilder->build($tableName, $nodeType->getFields());
$this->formBuilder->build($tableName, $nodeType->getFields());
$migration = $this->migrationBuilder
->getMigrationClassPathByKey($tableNa... | [
"public",
"function",
"destroyField",
"(",
"$",
"name",
",",
"$",
"tableName",
",",
"NodeTypeContract",
"$",
"nodeType",
")",
"{",
"$",
"this",
"->",
"modelBuilder",
"->",
"build",
"(",
"$",
"tableName",
",",
"$",
"nodeType",
"->",
"getFields",
"(",
")",
... | Destroys a field on a source table and all associated entities
@param string $name
@param string $tableName
@param NodeTypeContract $nodeType | [
"Destroys",
"a",
"field",
"on",
"a",
"source",
"table",
"and",
"all",
"associated",
"entities"
] | 535171c5e2db72265313fd2110aec8456e46f459 | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Builders/BuilderService.php#L114-L125 |
20,209 | jasny/controller | src/Controller/RouteAction.php | RouteAction.getFunctionArgs | protected function getFunctionArgs(\stdClass $route, \ReflectionFunctionAbstract $refl)
{
$args = [];
$params = $refl->getParameters();
foreach ($params as $param) {
$key = $param->name;
if (property_exists($route, $key)) {
$value = $route->$key;
... | php | protected function getFunctionArgs(\stdClass $route, \ReflectionFunctionAbstract $refl)
{
$args = [];
$params = $refl->getParameters();
foreach ($params as $param) {
$key = $param->name;
if (property_exists($route, $key)) {
$value = $route->$key;
... | [
"protected",
"function",
"getFunctionArgs",
"(",
"\\",
"stdClass",
"$",
"route",
",",
"\\",
"ReflectionFunctionAbstract",
"$",
"refl",
")",
"{",
"$",
"args",
"=",
"[",
"]",
";",
"$",
"params",
"=",
"$",
"refl",
"->",
"getParameters",
"(",
")",
";",
"fore... | Get the arguments for a function from a route using reflection
@param \stdClass $route
@param \ReflectionFunctionAbstract $refl
@return array | [
"Get",
"the",
"arguments",
"for",
"a",
"function",
"from",
"a",
"route",
"using",
"reflection"
] | 28edf64343f1d8218c166c0c570128e1ee6153d8 | https://github.com/jasny/controller/blob/28edf64343f1d8218c166c0c570128e1ee6153d8/src/Controller/RouteAction.php#L161-L184 |
20,210 | 42mate/towel | src/Towel/Model/User.php | User.validateLogin | public function validateLogin($email, $password)
{
$password = md5($password);
$result = $this->fetchOne(
"SELECT * FROM {$this->table} WHERE email = ? AND password = ?",
array($email, $password)
);
if (!empty($result)) {
return true;
}
... | php | public function validateLogin($email, $password)
{
$password = md5($password);
$result = $this->fetchOne(
"SELECT * FROM {$this->table} WHERE email = ? AND password = ?",
array($email, $password)
);
if (!empty($result)) {
return true;
}
... | [
"public",
"function",
"validateLogin",
"(",
"$",
"email",
",",
"$",
"password",
")",
"{",
"$",
"password",
"=",
"md5",
"(",
"$",
"password",
")",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"fetchOne",
"(",
"\"SELECT * FROM {$this->table} WHERE email = ? AND p... | Validates username and password against the DB.
If success sets the user info in the object and return true.
If fails returns false.
@param String $email
@param String $password
@return Boolean | [
"Validates",
"username",
"and",
"password",
"against",
"the",
"DB",
".",
"If",
"success",
"sets",
"the",
"user",
"info",
"in",
"the",
"object",
"and",
"return",
"true",
".",
"If",
"fails",
"returns",
"false",
"."
] | 5316c3075fc844e8a5cbae113712b26556227dff | https://github.com/42mate/towel/blob/5316c3075fc844e8a5cbae113712b26556227dff/src/Towel/Model/User.php#L19-L33 |
20,211 | 42mate/towel | src/Towel/Model/User.php | User.regeneratePassword | public function regeneratePassword()
{
$clean_password = generatePassword(6, 4);
$password = md5($clean_password);
$this->db()->executeUpdate(
"UPDATE {$this->table} SET password = ? WHERE ID = ?",
array($password, $this->getId())
);
return $clean_pas... | php | public function regeneratePassword()
{
$clean_password = generatePassword(6, 4);
$password = md5($clean_password);
$this->db()->executeUpdate(
"UPDATE {$this->table} SET password = ? WHERE ID = ?",
array($password, $this->getId())
);
return $clean_pas... | [
"public",
"function",
"regeneratePassword",
"(",
")",
"{",
"$",
"clean_password",
"=",
"generatePassword",
"(",
"6",
",",
"4",
")",
";",
"$",
"password",
"=",
"md5",
"(",
"$",
"clean_password",
")",
";",
"$",
"this",
"->",
"db",
"(",
")",
"->",
"execut... | Regenerates and sets the new password for a User.
@return String password : The new Password. | [
"Regenerates",
"and",
"sets",
"the",
"new",
"password",
"for",
"a",
"User",
"."
] | 5316c3075fc844e8a5cbae113712b26556227dff | https://github.com/42mate/towel/blob/5316c3075fc844e8a5cbae113712b26556227dff/src/Towel/Model/User.php#L70-L80 |
20,212 | thecodingmachine/security.userservice | src/Mouf/Security/UserService/UserService.php | UserService.isLogged | public function isLogged()
{
$this->byPassIsLogged = true;
try {
// Is a session mechanism available?
if (!session_id()) {
if ($this->sessionManager) {
$this->sessionManager->start();
} else {
throw new M... | php | public function isLogged()
{
$this->byPassIsLogged = true;
try {
// Is a session mechanism available?
if (!session_id()) {
if ($this->sessionManager) {
$this->sessionManager->start();
} else {
throw new M... | [
"public",
"function",
"isLogged",
"(",
")",
"{",
"$",
"this",
"->",
"byPassIsLogged",
"=",
"true",
";",
"try",
"{",
"// Is a session mechanism available?",
"if",
"(",
"!",
"session_id",
"(",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"sessionManager",
")... | Returns "true" if the user is logged, "false" otherwise.
@return boolean | [
"Returns",
"true",
"if",
"the",
"user",
"is",
"logged",
"false",
"otherwise",
"."
] | 39de12c32f324ab113441a69cd73cdb4b4673225 | https://github.com/thecodingmachine/security.userservice/blob/39de12c32f324ab113441a69cd73cdb4b4673225/src/Mouf/Security/UserService/UserService.php#L222-L251 |
20,213 | thecodingmachine/security.userservice | src/Mouf/Security/UserService/UserService.php | UserService.logoff | public function logoff()
{
// Is a session mechanism available?
if (!session_id()) {
if ($this->sessionManager) {
$this->sessionManager->start();
} else {
throw new MoufException("The session must be initialized before trying to login. Please u... | php | public function logoff()
{
// Is a session mechanism available?
if (!session_id()) {
if ($this->sessionManager) {
$this->sessionManager->start();
} else {
throw new MoufException("The session must be initialized before trying to login. Please u... | [
"public",
"function",
"logoff",
"(",
")",
"{",
"// Is a session mechanism available?",
"if",
"(",
"!",
"session_id",
"(",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"sessionManager",
")",
"{",
"$",
"this",
"->",
"sessionManager",
"->",
"start",
"(",
")",... | Logs the user off. | [
"Logs",
"the",
"user",
"off",
"."
] | 39de12c32f324ab113441a69cd73cdb4b4673225 | https://github.com/thecodingmachine/security.userservice/blob/39de12c32f324ab113441a69cd73cdb4b4673225/src/Mouf/Security/UserService/UserService.php#L270-L296 |
20,214 | thecodingmachine/security.userservice | src/Mouf/Security/UserService/UserService.php | UserService.getUserLogin | public function getUserLogin()
{
// Is a session mechanism available?
if (!session_id()) {
if ($this->sessionManager) {
$this->sessionManager->start();
} else {
throw new MoufException("The session must be initialized before checking if the use... | php | public function getUserLogin()
{
// Is a session mechanism available?
if (!session_id()) {
if ($this->sessionManager) {
$this->sessionManager->start();
} else {
throw new MoufException("The session must be initialized before checking if the use... | [
"public",
"function",
"getUserLogin",
"(",
")",
"{",
"// Is a session mechanism available?",
"if",
"(",
"!",
"session_id",
"(",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"sessionManager",
")",
"{",
"$",
"this",
"->",
"sessionManager",
"->",
"start",
"(",
... | Returns the current user login.
@return string | [
"Returns",
"the",
"current",
"user",
"login",
"."
] | 39de12c32f324ab113441a69cd73cdb4b4673225 | https://github.com/thecodingmachine/security.userservice/blob/39de12c32f324ab113441a69cd73cdb4b4673225/src/Mouf/Security/UserService/UserService.php#L333-L356 |
20,215 | antaresproject/notifications | src/Http/Filter/DateRangeNotificationLogsFilter.php | DateRangeNotificationLogsFilter.apply | public function apply($builder)
{
if (!empty($values = $this->getValues())) {
$range = json_decode($values, true);
if (!isset($range['start']) or ! isset($range['end'])) {
return $builder;
}
$start = $range['start'] . ' 00:00:00';
$... | php | public function apply($builder)
{
if (!empty($values = $this->getValues())) {
$range = json_decode($values, true);
if (!isset($range['start']) or ! isset($range['end'])) {
return $builder;
}
$start = $range['start'] . ' 00:00:00';
$... | [
"public",
"function",
"apply",
"(",
"$",
"builder",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"values",
"=",
"$",
"this",
"->",
"getValues",
"(",
")",
")",
")",
"{",
"$",
"range",
"=",
"json_decode",
"(",
"$",
"values",
",",
"true",
")",
";",
... | Filters data by parameters from memory
@param mixed $builder | [
"Filters",
"data",
"by",
"parameters",
"from",
"memory"
] | 60de743477b7e9cbb51de66da5fd9461adc9dd8a | https://github.com/antaresproject/notifications/blob/60de743477b7e9cbb51de66da5fd9461adc9dd8a/src/Http/Filter/DateRangeNotificationLogsFilter.php#L57-L68 |
20,216 | gedex/php-janrain-api | lib/Janrain/Api/Engage/Sharing.php | Sharing.broadcast | public function broadcast(array $params)
{
if (!isset($params['identifier']) && !isset($params['device_token'])) {
throw new MissingArgumentException('identifier or device_token');
}
if (!isset($params['message'])) {
throw new MissingArgumentException('message');
}
return $this->post('sharing/broadca... | php | public function broadcast(array $params)
{
if (!isset($params['identifier']) && !isset($params['device_token'])) {
throw new MissingArgumentException('identifier or device_token');
}
if (!isset($params['message'])) {
throw new MissingArgumentException('message');
}
return $this->post('sharing/broadca... | [
"public",
"function",
"broadcast",
"(",
"array",
"$",
"params",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"params",
"[",
"'identifier'",
"]",
")",
"&&",
"!",
"isset",
"(",
"$",
"params",
"[",
"'device_token'",
"]",
")",
")",
"{",
"throw",
"new",
... | Shares activity information directly with a provider. The information
provided in the parameters is passed to a provider to publish on their
network.
The `broadcast` call shares with one provider at a time, determined by the
`identifier` or `device_token` that you use.
@param array $params
@link http://developers.ja... | [
"Shares",
"activity",
"information",
"directly",
"with",
"a",
"provider",
".",
"The",
"information",
"provided",
"in",
"the",
"parameters",
"is",
"passed",
"to",
"a",
"provider",
"to",
"publish",
"on",
"their",
"network",
"."
] | 6283f68454e0ad5211ac620f1d337df38cd49597 | https://github.com/gedex/php-janrain-api/blob/6283f68454e0ad5211ac620f1d337df38cd49597/lib/Janrain/Api/Engage/Sharing.php#L23-L34 |
20,217 | gedex/php-janrain-api | lib/Janrain/Api/Engage/Sharing.php | Sharing.direct | public function direct(array $params)
{
if (!isset($params['identifier']) && !isset($params['device_token'])) {
throw new MissingArgumentException('identifier or device_token');
}
if (!isset($params['recipients'])) {
throw new MissingArgumentException('recipients');
} else if (!is_array($params['recipie... | php | public function direct(array $params)
{
if (!isset($params['identifier']) && !isset($params['device_token'])) {
throw new MissingArgumentException('identifier or device_token');
}
if (!isset($params['recipients'])) {
throw new MissingArgumentException('recipients');
} else if (!is_array($params['recipie... | [
"public",
"function",
"direct",
"(",
"array",
"$",
"params",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"params",
"[",
"'identifier'",
"]",
")",
"&&",
"!",
"isset",
"(",
"$",
"params",
"[",
"'device_token'",
"]",
")",
")",
"{",
"throw",
"new",
"M... | Shares activity information directly with the specified recipents on a
provider's network, instead of publishing it to everyone on the network.
The `direct` call shares with one provider at a time, determined by the
`identifier` or `device_token` you enter.
@param array $params
@link http://developers.janrain.com/do... | [
"Shares",
"activity",
"information",
"directly",
"with",
"the",
"specified",
"recipents",
"on",
"a",
"provider",
"s",
"network",
"instead",
"of",
"publishing",
"it",
"to",
"everyone",
"on",
"the",
"network",
"."
] | 6283f68454e0ad5211ac620f1d337df38cd49597 | https://github.com/gedex/php-janrain-api/blob/6283f68454e0ad5211ac620f1d337df38cd49597/lib/Janrain/Api/Engage/Sharing.php#L47-L66 |
20,218 | gedex/php-janrain-api | lib/Janrain/Api/Engage/Sharing.php | Sharing.getShareProviders | public function getShareProviders($format = 'json', $callback = '')
{
$params = compact('format');
if (!empty($callback)) {
$params['callback'] = $callback;
}
return $this->post('get_share_providers', $params);
} | php | public function getShareProviders($format = 'json', $callback = '')
{
$params = compact('format');
if (!empty($callback)) {
$params['callback'] = $callback;
}
return $this->post('get_share_providers', $params);
} | [
"public",
"function",
"getShareProviders",
"(",
"$",
"format",
"=",
"'json'",
",",
"$",
"callback",
"=",
"''",
")",
"{",
"$",
"params",
"=",
"compact",
"(",
"'format'",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"callback",
")",
")",
"{",
"$",
"p... | Returns a list of email and sharing providers configured for the widget.
This call has no required parameters; it identifies the proper application
by the realm prefacing the URL path.
@param string $format Either 'json' or 'xml'
@param string $callback Specifies the return of a JSONP-formatted response
@link http:... | [
"Returns",
"a",
"list",
"of",
"email",
"and",
"sharing",
"providers",
"configured",
"for",
"the",
"widget",
".",
"This",
"call",
"has",
"no",
"required",
"parameters",
";",
"it",
"identifies",
"the",
"proper",
"application",
"by",
"the",
"realm",
"prefacing",
... | 6283f68454e0ad5211ac620f1d337df38cd49597 | https://github.com/gedex/php-janrain-api/blob/6283f68454e0ad5211ac620f1d337df38cd49597/lib/Janrain/Api/Engage/Sharing.php#L92-L100 |
20,219 | mekras/Types | src/DateTime/Traits/DateComingChecks.php | DateComingChecks.isDateWillComeIn | public function isDateWillComeIn($interval)
{
if (!($interval instanceof \DateInterval)) {
$interval = new \DateInterval((string) $interval);
}
$now = new \DateTime('now');
return 0 === $this->diff($now->add($interval))->invert;
} | php | public function isDateWillComeIn($interval)
{
if (!($interval instanceof \DateInterval)) {
$interval = new \DateInterval((string) $interval);
}
$now = new \DateTime('now');
return 0 === $this->diff($now->add($interval))->invert;
} | [
"public",
"function",
"isDateWillComeIn",
"(",
"$",
"interval",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"interval",
"instanceof",
"\\",
"DateInterval",
")",
")",
"{",
"$",
"interval",
"=",
"new",
"\\",
"DateInterval",
"(",
"(",
"string",
")",
"$",
"interval"... | Return TRUE if this date will come in a given interval
@param \DateInterval|string $interval DateInterval or string interval specification
@return bool
@link http://php.net/DateInterval
@since 1.1 | [
"Return",
"TRUE",
"if",
"this",
"date",
"will",
"come",
"in",
"a",
"given",
"interval"
] | a168809097d41f3dacec658b6ecd2fd0f10b30e1 | https://github.com/mekras/Types/blob/a168809097d41f3dacec658b6ecd2fd0f10b30e1/src/DateTime/Traits/DateComingChecks.php#L43-L50 |
20,220 | ronaldborla/chikka | src/Borla/Chikka/Chikka.php | Chikka.replyTo | public function replyTo(Message $message, $messageOrContent, $cost = 0, $messageId = null, $adjustCost = true) {
// Return
return $this->reply($message->id, $message->mobile, $messageOrContent, $cost, $messageId, $adjustCost);
} | php | public function replyTo(Message $message, $messageOrContent, $cost = 0, $messageId = null, $adjustCost = true) {
// Return
return $this->reply($message->id, $message->mobile, $messageOrContent, $cost, $messageId, $adjustCost);
} | [
"public",
"function",
"replyTo",
"(",
"Message",
"$",
"message",
",",
"$",
"messageOrContent",
",",
"$",
"cost",
"=",
"0",
",",
"$",
"messageId",
"=",
"null",
",",
"$",
"adjustCost",
"=",
"true",
")",
"{",
"// Return",
"return",
"$",
"this",
"->",
"rep... | Reply to a message | [
"Reply",
"to",
"a",
"message"
] | 446987706f81d5a0efbc8bd6b7d3b259d0527719 | https://github.com/ronaldborla/chikka/blob/446987706f81d5a0efbc8bd6b7d3b259d0527719/src/Borla/Chikka/Chikka.php#L89-L92 |
20,221 | snapwp/snap-blade | src/Snap_Blade.php | Snap_Blade.run | public function run($view, $data = array())
{
return parent::run(
$view,
\array_merge(View::get_additional_data($view, $data), $data)
);
} | php | public function run($view, $data = array())
{
return parent::run(
$view,
\array_merge(View::get_additional_data($view, $data), $data)
);
} | [
"public",
"function",
"run",
"(",
"$",
"view",
",",
"$",
"data",
"=",
"array",
"(",
")",
")",
"{",
"return",
"parent",
"::",
"run",
"(",
"$",
"view",
",",
"\\",
"array_merge",
"(",
"View",
"::",
"get_additional_data",
"(",
"$",
"view",
",",
"$",
"d... | Run the blade engine. Is only called when rendering a view.
@since 1.0.0
@param string $view The template name to render.
@param array $data The data to pass to BladeOne.
@return string
@throws \Exception | [
"Run",
"the",
"blade",
"engine",
".",
"Is",
"only",
"called",
"when",
"rendering",
"a",
"view",
"."
] | 41e004e93440f6b58638b64dc8d20cca4a0546fa | https://github.com/snapwp/snap-blade/blob/41e004e93440f6b58638b64dc8d20cca4a0546fa/src/Snap_Blade.php#L68-L74 |
20,222 | gpupo/common-schema | src/ORM/Entity/Trading/Order/Customer/Customer.php | Customer.setPhone | public function setPhone(\Gpupo\CommonSchema\ORM\Entity\People\Phone $phone = null)
{
$this->phone = $phone;
return $this;
} | php | public function setPhone(\Gpupo\CommonSchema\ORM\Entity\People\Phone $phone = null)
{
$this->phone = $phone;
return $this;
} | [
"public",
"function",
"setPhone",
"(",
"\\",
"Gpupo",
"\\",
"CommonSchema",
"\\",
"ORM",
"\\",
"Entity",
"\\",
"People",
"\\",
"Phone",
"$",
"phone",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"phone",
"=",
"$",
"phone",
";",
"return",
"$",
"this",
";... | Set phone.
@param null|\Gpupo\CommonSchema\ORM\Entity\People\Phone $phone
@return Customer | [
"Set",
"phone",
"."
] | a762d2eb3063b7317c72c69cbb463b1f95b86b0a | https://github.com/gpupo/common-schema/blob/a762d2eb3063b7317c72c69cbb463b1f95b86b0a/src/ORM/Entity/Trading/Order/Customer/Customer.php#L287-L292 |
20,223 | gpupo/common-schema | src/ORM/Entity/Trading/Order/Customer/Customer.php | Customer.setAlternativePhone | public function setAlternativePhone(\Gpupo\CommonSchema\ORM\Entity\People\AlternativePhone $alternativePhone = null)
{
$this->alternative_phone = $alternativePhone;
return $this;
} | php | public function setAlternativePhone(\Gpupo\CommonSchema\ORM\Entity\People\AlternativePhone $alternativePhone = null)
{
$this->alternative_phone = $alternativePhone;
return $this;
} | [
"public",
"function",
"setAlternativePhone",
"(",
"\\",
"Gpupo",
"\\",
"CommonSchema",
"\\",
"ORM",
"\\",
"Entity",
"\\",
"People",
"\\",
"AlternativePhone",
"$",
"alternativePhone",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"alternative_phone",
"=",
"$",
"alt... | Set alternativePhone.
@param null|\Gpupo\CommonSchema\ORM\Entity\People\AlternativePhone $alternativePhone
@return Customer | [
"Set",
"alternativePhone",
"."
] | a762d2eb3063b7317c72c69cbb463b1f95b86b0a | https://github.com/gpupo/common-schema/blob/a762d2eb3063b7317c72c69cbb463b1f95b86b0a/src/ORM/Entity/Trading/Order/Customer/Customer.php#L311-L316 |
20,224 | gpupo/common-schema | src/ORM/Entity/Trading/Order/Customer/Customer.php | Customer.setAddressBilling | public function setAddressBilling(\Gpupo\CommonSchema\ORM\Entity\Trading\Order\Customer\AddressBilling $addressBilling = null)
{
$this->address_billing = $addressBilling;
return $this;
} | php | public function setAddressBilling(\Gpupo\CommonSchema\ORM\Entity\Trading\Order\Customer\AddressBilling $addressBilling = null)
{
$this->address_billing = $addressBilling;
return $this;
} | [
"public",
"function",
"setAddressBilling",
"(",
"\\",
"Gpupo",
"\\",
"CommonSchema",
"\\",
"ORM",
"\\",
"Entity",
"\\",
"Trading",
"\\",
"Order",
"\\",
"Customer",
"\\",
"AddressBilling",
"$",
"addressBilling",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"addr... | Set addressBilling.
@param null|\Gpupo\CommonSchema\ORM\Entity\Trading\Order\Customer\AddressBilling $addressBilling
@return Customer | [
"Set",
"addressBilling",
"."
] | a762d2eb3063b7317c72c69cbb463b1f95b86b0a | https://github.com/gpupo/common-schema/blob/a762d2eb3063b7317c72c69cbb463b1f95b86b0a/src/ORM/Entity/Trading/Order/Customer/Customer.php#L359-L364 |
20,225 | gpupo/common-schema | src/ORM/Entity/Trading/Order/Customer/Customer.php | Customer.setAddressDelivery | public function setAddressDelivery(\Gpupo\CommonSchema\ORM\Entity\Trading\Order\Customer\AddressDelivery $addressDelivery = null)
{
$this->address_delivery = $addressDelivery;
return $this;
} | php | public function setAddressDelivery(\Gpupo\CommonSchema\ORM\Entity\Trading\Order\Customer\AddressDelivery $addressDelivery = null)
{
$this->address_delivery = $addressDelivery;
return $this;
} | [
"public",
"function",
"setAddressDelivery",
"(",
"\\",
"Gpupo",
"\\",
"CommonSchema",
"\\",
"ORM",
"\\",
"Entity",
"\\",
"Trading",
"\\",
"Order",
"\\",
"Customer",
"\\",
"AddressDelivery",
"$",
"addressDelivery",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"a... | Set addressDelivery.
@param null|\Gpupo\CommonSchema\ORM\Entity\Trading\Order\Customer\AddressDelivery $addressDelivery
@return Customer | [
"Set",
"addressDelivery",
"."
] | a762d2eb3063b7317c72c69cbb463b1f95b86b0a | https://github.com/gpupo/common-schema/blob/a762d2eb3063b7317c72c69cbb463b1f95b86b0a/src/ORM/Entity/Trading/Order/Customer/Customer.php#L383-L388 |
20,226 | wenbinye/PhalconX | src/Db/Column.php | Column.copy | public static function copy(BaseColumn $column)
{
$definition = self::filterArray(get_object_vars($column));
return new self($definition['name'], $definition);
} | php | public static function copy(BaseColumn $column)
{
$definition = self::filterArray(get_object_vars($column));
return new self($definition['name'], $definition);
} | [
"public",
"static",
"function",
"copy",
"(",
"BaseColumn",
"$",
"column",
")",
"{",
"$",
"definition",
"=",
"self",
"::",
"filterArray",
"(",
"get_object_vars",
"(",
"$",
"column",
")",
")",
";",
"return",
"new",
"self",
"(",
"$",
"definition",
"[",
"'na... | Copy to new column | [
"Copy",
"to",
"new",
"column"
] | 0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1 | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Db/Column.php#L24-L28 |
20,227 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Database/src/handler.php | ezcDbHandler.quoteIdentifier | public function quoteIdentifier( $identifier )
{
if ( sizeof( $this->identifierQuoteChars ) === 2 )
{
$identifier =
$this->identifierQuoteChars["start"]
. str_replace(
$this->identifierQuoteChars["end"],
$this->ide... | php | public function quoteIdentifier( $identifier )
{
if ( sizeof( $this->identifierQuoteChars ) === 2 )
{
$identifier =
$this->identifierQuoteChars["start"]
. str_replace(
$this->identifierQuoteChars["end"],
$this->ide... | [
"public",
"function",
"quoteIdentifier",
"(",
"$",
"identifier",
")",
"{",
"if",
"(",
"sizeof",
"(",
"$",
"this",
"->",
"identifierQuoteChars",
")",
"===",
"2",
")",
"{",
"$",
"identifier",
"=",
"$",
"this",
"->",
"identifierQuoteChars",
"[",
"\"start\"",
... | Returns the quoted version of an identifier to be used in an SQL query.
This method takes a given identifier and quotes it, so it can safely be
used in SQL queries.
@param string $identifier The identifier to quote.
@return string The quoted identifier. | [
"Returns",
"the",
"quoted",
"version",
"of",
"an",
"identifier",
"to",
"be",
"used",
"in",
"an",
"SQL",
"query",
".",
"This",
"method",
"takes",
"a",
"given",
"identifier",
"and",
"quotes",
"it",
"so",
"it",
"can",
"safely",
"be",
"used",
"in",
"SQL",
... | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/handler.php#L327-L341 |
20,228 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/validators/unique_index_name.php | ezcDbSchemaUniqueIndexNameValidator.validate | static public function validate( ezcDbSchema $schema )
{
$indexes = array();
$errors = array();
/* For each table we check all auto increment fields. */
foreach ( $schema->getSchema() as $tableName => $table )
{
foreach ( $table->indexes as $indexName => $dummy )... | php | static public function validate( ezcDbSchema $schema )
{
$indexes = array();
$errors = array();
/* For each table we check all auto increment fields. */
foreach ( $schema->getSchema() as $tableName => $table )
{
foreach ( $table->indexes as $indexName => $dummy )... | [
"static",
"public",
"function",
"validate",
"(",
"ezcDbSchema",
"$",
"schema",
")",
"{",
"$",
"indexes",
"=",
"array",
"(",
")",
";",
"$",
"errors",
"=",
"array",
"(",
")",
";",
"/* For each table we check all auto increment fields. */",
"foreach",
"(",
"$",
"... | Validates if all the index names used are unique accross the schema.
This method loops over all the indexes in all tables and checks whether
they have been used before.
@param ezcDbSchema $schema
@return array(string) | [
"Validates",
"if",
"all",
"the",
"index",
"names",
"used",
"are",
"unique",
"accross",
"the",
"schema",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/validators/unique_index_name.php#L29-L52 |
20,229 | hametuha/wpametu | src/WPametu/API/Rest/WpApi.php | WpApi.rest_api_init | public function rest_api_init() {
$register = [];
foreach ( [ 'GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTION' ] as $method ) {
$method_name = strtolower( "handle_{$method}" );
if ( ! method_exists( $this, $method_name ) ) {
continue;
}
$register[] = [
'methods' => $method,
'call... | php | public function rest_api_init() {
$register = [];
foreach ( [ 'GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTION' ] as $method ) {
$method_name = strtolower( "handle_{$method}" );
if ( ! method_exists( $this, $method_name ) ) {
continue;
}
$register[] = [
'methods' => $method,
'call... | [
"public",
"function",
"rest_api_init",
"(",
")",
"{",
"$",
"register",
"=",
"[",
"]",
";",
"foreach",
"(",
"[",
"'GET'",
",",
"'POST'",
",",
"'PUT'",
",",
"'PATCH'",
",",
"'DELETE'",
",",
"'HEAD'",
",",
"'OPTION'",
"]",
"as",
"$",
"method",
")",
"{",... | Register rest endpoints
@throws \Exception If no handler is set, throws error. | [
"Register",
"rest",
"endpoints"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/API/Rest/WpApi.php#L40-L59 |
20,230 | interactivesolutions/honeycomb-core | src/models/HCModel.php | HCModel.getTableEnumList | public static function getTableEnumList(string $field, string $labelKey = null, string $translationCode = null)
{
$type = DB::select(
DB::raw('SHOW COLUMNS FROM ' . self::getTableName() . ' WHERE Field = "' . $field . '"')
)[0]->Type;
preg_match('/^enum\((.*)\)$/', $type, $match... | php | public static function getTableEnumList(string $field, string $labelKey = null, string $translationCode = null)
{
$type = DB::select(
DB::raw('SHOW COLUMNS FROM ' . self::getTableName() . ' WHERE Field = "' . $field . '"')
)[0]->Type;
preg_match('/^enum\((.*)\)$/', $type, $match... | [
"public",
"static",
"function",
"getTableEnumList",
"(",
"string",
"$",
"field",
",",
"string",
"$",
"labelKey",
"=",
"null",
",",
"string",
"$",
"translationCode",
"=",
"null",
")",
"{",
"$",
"type",
"=",
"DB",
"::",
"select",
"(",
"DB",
"::",
"raw",
... | Get table enum field list with translations or not
@param string $field
@param null|string $labelKey
@param string $translationCode
@return array | [
"Get",
"table",
"enum",
"field",
"list",
"with",
"translations",
"or",
"not"
] | 06b8d88bb285e73a1a286e60411ca5f41863f39f | https://github.com/interactivesolutions/honeycomb-core/blob/06b8d88bb285e73a1a286e60411ca5f41863f39f/src/models/HCModel.php#L55-L79 |
20,231 | ouropencode/dachi | src/Modules.php | Modules.get | public static function get($module) {
if(self::$modules === array())
self::initialize();
if(!isset(self::$modules[$module]))
return false;
return self::$modules[$module];
} | php | public static function get($module) {
if(self::$modules === array())
self::initialize();
if(!isset(self::$modules[$module]))
return false;
return self::$modules[$module];
} | [
"public",
"static",
"function",
"get",
"(",
"$",
"module",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"modules",
"===",
"array",
"(",
")",
")",
"self",
"::",
"initialize",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"modules",
"[... | Retrieve module information.
@param string $module Module shortname
@return Module | [
"Retrieve",
"module",
"information",
"."
] | a0e1daf269d0345afbb859ce20ef9da6decd7efe | https://github.com/ouropencode/dachi/blob/a0e1daf269d0345afbb859ce20ef9da6decd7efe/src/Modules.php#L36-L44 |
20,232 | LIN3S/Distribution | src/Php/Composer/Wordpress.php | Wordpress.installRequiredFiles | public static function installRequiredFiles()
{
$htaccess = __DIR__ . '/../../../../../../.htaccess';
$robots = __DIR__ . '/../../../../../../robots.txt';
$wpConfig = __DIR__ . '/../../../../../../wp-config-custom';
$fileSystem = new Filesystem();
try {
if (false... | php | public static function installRequiredFiles()
{
$htaccess = __DIR__ . '/../../../../../../.htaccess';
$robots = __DIR__ . '/../../../../../../robots.txt';
$wpConfig = __DIR__ . '/../../../../../../wp-config-custom';
$fileSystem = new Filesystem();
try {
if (false... | [
"public",
"static",
"function",
"installRequiredFiles",
"(",
")",
"{",
"$",
"htaccess",
"=",
"__DIR__",
".",
"'/../../../../../../.htaccess'",
";",
"$",
"robots",
"=",
"__DIR__",
".",
"'/../../../../../../robots.txt'",
";",
"$",
"wpConfig",
"=",
"__DIR__",
".",
"'... | Static method that creates .htaccess, robots.txt and wp-config-custom.php files if they do not exist. | [
"Static",
"method",
"that",
"creates",
".",
"htaccess",
"robots",
".",
"txt",
"and",
"wp",
"-",
"config",
"-",
"custom",
".",
"php",
"files",
"if",
"they",
"do",
"not",
"exist",
"."
] | 294cda1c2128fa967b3b316f01f202e4e46d2e5b | https://github.com/LIN3S/Distribution/blob/294cda1c2128fa967b3b316f01f202e4e46d2e5b/src/Php/Composer/Wordpress.php#L26-L46 |
20,233 | glynnforrest/active-doctrine | src/ActiveDoctrine/Entity/EntitySelector.php | EntitySelector.decorateWhere | protected function decorateWhere($method, &$args)
{
$column = $args[0];
$expression = isset($args[1]) ? $args[1] : null;
$value = isset($args[2]) ? $args[2] : null;
if (!$expression instanceof Entity && !$value instanceof Entity) {
return;
}
$entity_clas... | php | protected function decorateWhere($method, &$args)
{
$column = $args[0];
$expression = isset($args[1]) ? $args[1] : null;
$value = isset($args[2]) ? $args[2] : null;
if (!$expression instanceof Entity && !$value instanceof Entity) {
return;
}
$entity_clas... | [
"protected",
"function",
"decorateWhere",
"(",
"$",
"method",
",",
"&",
"$",
"args",
")",
"{",
"$",
"column",
"=",
"$",
"args",
"[",
"0",
"]",
";",
"$",
"expression",
"=",
"isset",
"(",
"$",
"args",
"[",
"1",
"]",
")",
"?",
"$",
"args",
"[",
"1... | Modify the arguments of a where method to account for selecting
by entity objects.
@param $method The where method being called
@param $args The arguments | [
"Modify",
"the",
"arguments",
"of",
"a",
"where",
"method",
"to",
"account",
"for",
"selecting",
"by",
"entity",
"objects",
"."
] | fcf8c434c7df4704966107bf9a95c005a0b37168 | https://github.com/glynnforrest/active-doctrine/blob/fcf8c434c7df4704966107bf9a95c005a0b37168/src/ActiveDoctrine/Entity/EntitySelector.php#L111-L132 |
20,234 | glynnforrest/active-doctrine | src/ActiveDoctrine/Entity/EntitySelector.php | EntitySelector.execute | public function execute()
{
if ($this->counting) {
return $this->executeCount();
}
if ($this->single) {
return $this->executeSingle($this->entity_class);
}
return $this->executeCollection($this->entity_class);
} | php | public function execute()
{
if ($this->counting) {
return $this->executeCount();
}
if ($this->single) {
return $this->executeSingle($this->entity_class);
}
return $this->executeCollection($this->entity_class);
} | [
"public",
"function",
"execute",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"counting",
")",
"{",
"return",
"$",
"this",
"->",
"executeCount",
"(",
")",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"single",
")",
"{",
"return",
"$",
"this",
"->",
"e... | Execute the query and return the result.
@return mixed An EntityCollection, Entity or integer. | [
"Execute",
"the",
"query",
"and",
"return",
"the",
"result",
"."
] | fcf8c434c7df4704966107bf9a95c005a0b37168 | https://github.com/glynnforrest/active-doctrine/blob/fcf8c434c7df4704966107bf9a95c005a0b37168/src/ActiveDoctrine/Entity/EntitySelector.php#L139-L150 |
20,235 | surebert/surebert-framework | src/sb/XMPP/Message.php | Message.setBody | public function setBody($body)
{
$node = $this->getBody(false);
if(!$node){
$node = $this->createElement('body');
$this->doc->appendChild($node);
}
$node->nodeValue = htmlspecialchars($body);
} | php | public function setBody($body)
{
$node = $this->getBody(false);
if(!$node){
$node = $this->createElement('body');
$this->doc->appendChild($node);
}
$node->nodeValue = htmlspecialchars($body);
} | [
"public",
"function",
"setBody",
"(",
"$",
"body",
")",
"{",
"$",
"node",
"=",
"$",
"this",
"->",
"getBody",
"(",
"false",
")",
";",
"if",
"(",
"!",
"$",
"node",
")",
"{",
"$",
"node",
"=",
"$",
"this",
"->",
"createElement",
"(",
"'body'",
")",
... | Sets the body of the message to be send
@param string $body | [
"Sets",
"the",
"body",
"of",
"the",
"message",
"to",
"be",
"send"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/XMPP/Message.php#L104-L112 |
20,236 | surebert/surebert-framework | src/sb/XMPP/Message.php | Message.setSubject | public function setSubject($subject)
{
$node = $this->getSubject(false);
if(!$node){
$node = $this->createElement('subject');
$this->doc->appendChild($node);
}
$node->nodeValue = htmlspecialchars($subject);
} | php | public function setSubject($subject)
{
$node = $this->getSubject(false);
if(!$node){
$node = $this->createElement('subject');
$this->doc->appendChild($node);
}
$node->nodeValue = htmlspecialchars($subject);
} | [
"public",
"function",
"setSubject",
"(",
"$",
"subject",
")",
"{",
"$",
"node",
"=",
"$",
"this",
"->",
"getSubject",
"(",
"false",
")",
";",
"if",
"(",
"!",
"$",
"node",
")",
"{",
"$",
"node",
"=",
"$",
"this",
"->",
"createElement",
"(",
"'subjec... | Set the subject of the message
@param string $subject | [
"Set",
"the",
"subject",
"of",
"the",
"message"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/XMPP/Message.php#L118-L126 |
20,237 | surebert/surebert-framework | src/sb/XMPP/Message.php | Message.setHTML | public function setHTML($html)
{
$node = $this->createDocumentFragment();
$node->appendXML('<html xmlns="http://www.w3.org/1999/xhtml">'.$html.'</html>');
$this->doc->appendChild($node);
} | php | public function setHTML($html)
{
$node = $this->createDocumentFragment();
$node->appendXML('<html xmlns="http://www.w3.org/1999/xhtml">'.$html.'</html>');
$this->doc->appendChild($node);
} | [
"public",
"function",
"setHTML",
"(",
"$",
"html",
")",
"{",
"$",
"node",
"=",
"$",
"this",
"->",
"createDocumentFragment",
"(",
")",
";",
"$",
"node",
"->",
"appendXML",
"(",
"'<html xmlns=\"http://www.w3.org/1999/xhtml\">'",
".",
"$",
"html",
".",
"'</html>'... | Sets the html node of the message, expiremental
@param string $html | [
"Sets",
"the",
"html",
"node",
"of",
"the",
"message",
"expiremental"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/XMPP/Message.php#L132-L137 |
20,238 | surebert/surebert-framework | src/sb/XMPP/Message.php | Message.reply | public function reply($str)
{
$message = new \sb\XMPP\Message();
$message->setTo($this->getFrom());
$message->setFrom($this->getTo());
$message->setBody($str);
$this->client->sendMessage($message);
} | php | public function reply($str)
{
$message = new \sb\XMPP\Message();
$message->setTo($this->getFrom());
$message->setFrom($this->getTo());
$message->setBody($str);
$this->client->sendMessage($message);
} | [
"public",
"function",
"reply",
"(",
"$",
"str",
")",
"{",
"$",
"message",
"=",
"new",
"\\",
"sb",
"\\",
"XMPP",
"\\",
"Message",
"(",
")",
";",
"$",
"message",
"->",
"setTo",
"(",
"$",
"this",
"->",
"getFrom",
"(",
")",
")",
";",
"$",
"message",
... | Creates a reply message and sends it to the user that sent the
original message. This can be used only on \sb\XMPP\Message instances
that came over the socket and were passed to the onMessage method.
@param string $str | [
"Creates",
"a",
"reply",
"message",
"and",
"sends",
"it",
"to",
"the",
"user",
"that",
"sent",
"the",
"original",
"message",
".",
"This",
"can",
"be",
"used",
"only",
"on",
"\\",
"sb",
"\\",
"XMPP",
"\\",
"Message",
"instances",
"that",
"came",
"over",
... | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/XMPP/Message.php#L145-L152 |
20,239 | ekuiter/feature-php | FeaturePhp/Helper/Logic.php | Logic.is | public static function is($feature) {
return function ($features) use ($feature) {
return fphp\Model\Feature::has($features, $feature);
};
} | php | public static function is($feature) {
return function ($features) use ($feature) {
return fphp\Model\Feature::has($features, $feature);
};
} | [
"public",
"static",
"function",
"is",
"(",
"$",
"feature",
")",
"{",
"return",
"function",
"(",
"$",
"features",
")",
"use",
"(",
"$",
"feature",
")",
"{",
"return",
"fphp",
"\\",
"Model",
"\\",
"Feature",
"::",
"has",
"(",
"$",
"features",
",",
"$",... | Returns a formula that tests for the presence of a feature.
@param Feature $feature
@return callable | [
"Returns",
"a",
"formula",
"that",
"tests",
"for",
"the",
"presence",
"of",
"a",
"feature",
"."
] | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Helper/Logic.php#L27-L31 |
20,240 | ekuiter/feature-php | FeaturePhp/Helper/Logic.php | Logic._and | public static function _and(/* ... */) {
$args = func_get_args();
return function ($features) use ($args) {
$acc = true;
foreach ($args as $arg)
$acc = $acc && $arg($features);
return $acc;
};
} | php | public static function _and(/* ... */) {
$args = func_get_args();
return function ($features) use ($args) {
$acc = true;
foreach ($args as $arg)
$acc = $acc && $arg($features);
return $acc;
};
} | [
"public",
"static",
"function",
"_and",
"(",
"/* ... */",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"return",
"function",
"(",
"$",
"features",
")",
"use",
"(",
"$",
"args",
")",
"{",
"$",
"acc",
"=",
"true",
";",
"foreach",
"(",
... | Returns a formula that is the conjunction of other formulas.
Formulas can be supplied variadically.
@return callable | [
"Returns",
"a",
"formula",
"that",
"is",
"the",
"conjunction",
"of",
"other",
"formulas",
".",
"Formulas",
"can",
"be",
"supplied",
"variadically",
"."
] | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Helper/Logic.php#L49-L57 |
20,241 | ekuiter/feature-php | FeaturePhp/Helper/Logic.php | Logic._or | public static function _or(/* ... */) {
$args = func_get_args();
return function ($features) use ($args) {
$acc = false;
foreach ($args as $arg)
$acc = $acc || $arg($features);
return $acc;
};
} | php | public static function _or(/* ... */) {
$args = func_get_args();
return function ($features) use ($args) {
$acc = false;
foreach ($args as $arg)
$acc = $acc || $arg($features);
return $acc;
};
} | [
"public",
"static",
"function",
"_or",
"(",
"/* ... */",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"return",
"function",
"(",
"$",
"features",
")",
"use",
"(",
"$",
"args",
")",
"{",
"$",
"acc",
"=",
"false",
";",
"foreach",
"(",
... | Returns a formula that is the disjunction of other formulas.
Formulas can be supplied variadically.
@return callable | [
"Returns",
"a",
"formula",
"that",
"is",
"the",
"disjunction",
"of",
"other",
"formulas",
".",
"Formulas",
"can",
"be",
"supplied",
"variadically",
"."
] | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Helper/Logic.php#L64-L72 |
20,242 | ekuiter/feature-php | FeaturePhp/Helper/Logic.php | Logic.equiv | public static function equiv($constraintA, $constraintB) {
return function ($features) use ($constraintA, $constraintB) {
return $constraintA($features) === $constraintB($features);
};
} | php | public static function equiv($constraintA, $constraintB) {
return function ($features) use ($constraintA, $constraintB) {
return $constraintA($features) === $constraintB($features);
};
} | [
"public",
"static",
"function",
"equiv",
"(",
"$",
"constraintA",
",",
"$",
"constraintB",
")",
"{",
"return",
"function",
"(",
"$",
"features",
")",
"use",
"(",
"$",
"constraintA",
",",
"$",
"constraintB",
")",
"{",
"return",
"$",
"constraintA",
"(",
"$... | Returns a formula that is the biconditional of two formulas.
@param callable $constraintA
@param callable $constraintB
@return callable | [
"Returns",
"a",
"formula",
"that",
"is",
"the",
"biconditional",
"of",
"two",
"formulas",
"."
] | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Helper/Logic.php#L80-L84 |
20,243 | ekuiter/feature-php | FeaturePhp/Helper/Logic.php | Logic.implies | public static function implies($constraintA, $constraintB) {
return function ($features) use ($constraintA, $constraintB) {
return !$constraintA($features) || $constraintB($features);
};
} | php | public static function implies($constraintA, $constraintB) {
return function ($features) use ($constraintA, $constraintB) {
return !$constraintA($features) || $constraintB($features);
};
} | [
"public",
"static",
"function",
"implies",
"(",
"$",
"constraintA",
",",
"$",
"constraintB",
")",
"{",
"return",
"function",
"(",
"$",
"features",
")",
"use",
"(",
"$",
"constraintA",
",",
"$",
"constraintB",
")",
"{",
"return",
"!",
"$",
"constraintA",
... | Returns a formula that is the material conditional of two formulas.
@param callable $constraintA
@param callable $constraintB
@return callable | [
"Returns",
"a",
"formula",
"that",
"is",
"the",
"material",
"conditional",
"of",
"two",
"formulas",
"."
] | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Helper/Logic.php#L92-L96 |
20,244 | Eresus/EresusCMS | src/core/Feed/Writer.php | Eresus_Feed_Writer.generateHead | private function generateHead()
{
$out = '<?xml version="1.0" encoding="utf-8"?>' . "\n";
if ($this->version == self::RSS2)
{
$out .= '<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
>' . PHP_EOL;
}
elseif ($thi... | php | private function generateHead()
{
$out = '<?xml version="1.0" encoding="utf-8"?>' . "\n";
if ($this->version == self::RSS2)
{
$out .= '<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
>' . PHP_EOL;
}
elseif ($thi... | [
"private",
"function",
"generateHead",
"(",
")",
"{",
"$",
"out",
"=",
"'<?xml version=\"1.0\" encoding=\"utf-8\"?>'",
".",
"\"\\n\"",
";",
"if",
"(",
"$",
"this",
"->",
"version",
"==",
"self",
"::",
"RSS2",
")",
"{",
"$",
"out",
".=",
"'<rss version=\"2.0\"\... | Prints the xml and rss namespace
@return string | [
"Prints",
"the",
"xml",
"and",
"rss",
"namespace"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Feed/Writer.php#L254-L278 |
20,245 | Eresus/EresusCMS | src/core/Feed/Writer.php | Eresus_Feed_Writer.makeNode | private function makeNode($tagName, $tagContent, $attributes = null)
{
$nodeText = '';
$attrText = '';
if (is_array($attributes))
{
foreach ($attributes as $key => $value)
{
$attrText .= " $key=\"$value\" ";
}
}
if (is_array($tagContent) && $this->version == self::RSS1)
{
$attrText = ' ... | php | private function makeNode($tagName, $tagContent, $attributes = null)
{
$nodeText = '';
$attrText = '';
if (is_array($attributes))
{
foreach ($attributes as $key => $value)
{
$attrText .= " $key=\"$value\" ";
}
}
if (is_array($tagContent) && $this->version == self::RSS1)
{
$attrText = ' ... | [
"private",
"function",
"makeNode",
"(",
"$",
"tagName",
",",
"$",
"tagContent",
",",
"$",
"attributes",
"=",
"null",
")",
"{",
"$",
"nodeText",
"=",
"''",
";",
"$",
"attrText",
"=",
"''",
";",
"if",
"(",
"is_array",
"(",
"$",
"attributes",
")",
")",
... | Creates a single node as xml format
@param string $tagName name of the tag
@param mixed $tagContent tag value as string or array of nested tags in 'tagName' => 'tagValue' format
@param array $attributes Attributes (if any) in 'attrName' => 'attrValue' format
@return string formatted xml tag | [
"Creates",
"a",
"single",
"node",
"as",
"xml",
"format"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Feed/Writer.php#L316-L357 |
20,246 | texthtml/oauth2-provider | src/OAuth2AuthenticationListener.php | OAuth2AuthenticationListener.handle | public function handle(GetResponseEvent $event)
{
$request = BridgeRequest::createFromRequest($event->getRequest());
$response = new BridgeResponse;
if (!$this->oauth2Server->verifyResourceRequest($request, $response)) {
return;
}
try {
$token = $thi... | php | public function handle(GetResponseEvent $event)
{
$request = BridgeRequest::createFromRequest($event->getRequest());
$response = new BridgeResponse;
if (!$this->oauth2Server->verifyResourceRequest($request, $response)) {
return;
}
try {
$token = $thi... | [
"public",
"function",
"handle",
"(",
"GetResponseEvent",
"$",
"event",
")",
"{",
"$",
"request",
"=",
"BridgeRequest",
"::",
"createFromRequest",
"(",
"$",
"event",
"->",
"getRequest",
"(",
")",
")",
";",
"$",
"response",
"=",
"new",
"BridgeResponse",
";",
... | Handles basic authentication.
@param GetResponseEvent $event A GetResponseEvent instance | [
"Handles",
"basic",
"authentication",
"."
] | a216205b8466ae16e0b8e17249ce89b90db1f5d4 | https://github.com/texthtml/oauth2-provider/blob/a216205b8466ae16e0b8e17249ce89b90db1f5d4/src/OAuth2AuthenticationListener.php#L52-L77 |
20,247 | Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Block/Plugin.php | Dwoo_Block_Plugin.preProcessing | public static function preProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $type)
{
return Dwoo_Compiler::PHP_OPEN.$prepend.'$this->addStack("'.$type.'", array('.Dwoo_Compiler::implode_r($compiler->getCompiledParams($params)).'));'.$append.Dwoo_Compiler::PHP_CLOSE;
} | php | public static function preProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $type)
{
return Dwoo_Compiler::PHP_OPEN.$prepend.'$this->addStack("'.$type.'", array('.Dwoo_Compiler::implode_r($compiler->getCompiledParams($params)).'));'.$append.Dwoo_Compiler::PHP_CLOSE;
} | [
"public",
"static",
"function",
"preProcessing",
"(",
"Dwoo_Compiler",
"$",
"compiler",
",",
"array",
"$",
"params",
",",
"$",
"prepend",
",",
"$",
"append",
",",
"$",
"type",
")",
"{",
"return",
"Dwoo_Compiler",
"::",
"PHP_OPEN",
".",
"$",
"prepend",
".",... | called at compile time to define what the block should output in the compiled template code, happens when the block is declared
basically this will replace the {block arg arg arg} tag in the template
@param Dwoo_Compiler $compiler the compiler instance that calls this function
@param array $params an array containing... | [
"called",
"at",
"compile",
"time",
"to",
"define",
"what",
"the",
"block",
"should",
"output",
"in",
"the",
"compiled",
"template",
"code",
"happens",
"when",
"the",
"block",
"is",
"declared"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Block/Plugin.php#L78-L81 |
20,248 | ekuiter/feature-php | FeaturePhp/Exporter/DownloadZipExporter.php | DownloadZipExporter.download | private function download($productLineName) {
$productLineName = str_replace("\"", "", $productLineName);
if (headers_sent())
throw new DownloadZipExporterException("could download zip archive");
header("Content-Type: application/zip");
header("Content-Disposition: attachment... | php | private function download($productLineName) {
$productLineName = str_replace("\"", "", $productLineName);
if (headers_sent())
throw new DownloadZipExporterException("could download zip archive");
header("Content-Type: application/zip");
header("Content-Disposition: attachment... | [
"private",
"function",
"download",
"(",
"$",
"productLineName",
")",
"{",
"$",
"productLineName",
"=",
"str_replace",
"(",
"\"\\\"\"",
",",
"\"\"",
",",
"$",
"productLineName",
")",
";",
"if",
"(",
"headers_sent",
"(",
")",
")",
"throw",
"new",
"DownloadZipE... | Downloads the temporary ZIP archive.
This only works when no headers and no output have been sent yet, otherwise users receive
corrupted ZIP files.
@param string $productLineName the name of the product line, used as the ZIP archive file name | [
"Downloads",
"the",
"temporary",
"ZIP",
"archive",
".",
"This",
"only",
"works",
"when",
"no",
"headers",
"and",
"no",
"output",
"have",
"been",
"sent",
"yet",
"otherwise",
"users",
"receive",
"corrupted",
"ZIP",
"files",
"."
] | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Exporter/DownloadZipExporter.php#L55-L68 |
20,249 | ekuiter/feature-php | FeaturePhp/Exporter/DownloadZipExporter.php | DownloadZipExporter.export | public function export($product) {
try {
parent::export($product);
$this->download($product->getProductLine()->getName());
} catch (\Exception $e) {}
try {
$this->remove();
} catch (\Exception $e) {}
} | php | public function export($product) {
try {
parent::export($product);
$this->download($product->getProductLine()->getName());
} catch (\Exception $e) {}
try {
$this->remove();
} catch (\Exception $e) {}
} | [
"public",
"function",
"export",
"(",
"$",
"product",
")",
"{",
"try",
"{",
"parent",
"::",
"export",
"(",
"$",
"product",
")",
";",
"$",
"this",
"->",
"download",
"(",
"$",
"product",
"->",
"getProductLine",
"(",
")",
"->",
"getName",
"(",
")",
")",
... | Exports a product as a ZIP archive and offers it for downloading.
This only works when no headers and no output have been sent yet.
Note that any occurring errors are ignored so that the downloaded archive will not be
corrupted. There is currently no way to obtain error information in this case because
feature-php does... | [
"Exports",
"a",
"product",
"as",
"a",
"ZIP",
"archive",
"and",
"offers",
"it",
"for",
"downloading",
".",
"This",
"only",
"works",
"when",
"no",
"headers",
"and",
"no",
"output",
"have",
"been",
"sent",
"yet",
".",
"Note",
"that",
"any",
"occurring",
"er... | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Exporter/DownloadZipExporter.php#L78-L87 |
20,250 | VincentChalnot/SidusDataGridBundle | DependencyInjection/SidusDataGridExtension.php | SidusDataGridExtension.finalizeConfiguration | protected function finalizeConfiguration(
string $code,
array $dataGridConfiguration
): array {
// Handle possible parent configuration @todo find a better way to do this
if (isset($dataGridConfiguration['parent'])) {
$parent = $dataGridConfiguration['parent'];
... | php | protected function finalizeConfiguration(
string $code,
array $dataGridConfiguration
): array {
// Handle possible parent configuration @todo find a better way to do this
if (isset($dataGridConfiguration['parent'])) {
$parent = $dataGridConfiguration['parent'];
... | [
"protected",
"function",
"finalizeConfiguration",
"(",
"string",
"$",
"code",
",",
"array",
"$",
"dataGridConfiguration",
")",
":",
"array",
"{",
"// Handle possible parent configuration @todo find a better way to do this",
"if",
"(",
"isset",
"(",
"$",
"dataGridConfigurati... | Handle configuration parsing logic not handled by the semantic configuration definition
@param string $code
@param array $dataGridConfiguration
@throws \Exception
@return array | [
"Handle",
"configuration",
"parsing",
"logic",
"not",
"handled",
"by",
"the",
"semantic",
"configuration",
"definition"
] | aa929113e2208ed335f514d2891affaf7fddf3f6 | https://github.com/VincentChalnot/SidusDataGridBundle/blob/aa929113e2208ed335f514d2891affaf7fddf3f6/DependencyInjection/SidusDataGridExtension.php#L62-L110 |
20,251 | SachaMorard/phalcon-model-annotations | Library/Phalcon/Annotations/ModelListener.php | ModelListener.afterInitialize | public function afterInitialize(Event $event, ModelsManager $manager, $model)
{
//Reflector
/** @var \Phalcon\Annotations\Reflection $reflector */
$reflector = $this->annotations->get($model);
/**
* Read the annotations in the class' docblock
*/
$annotations... | php | public function afterInitialize(Event $event, ModelsManager $manager, $model)
{
//Reflector
/** @var \Phalcon\Annotations\Reflection $reflector */
$reflector = $this->annotations->get($model);
/**
* Read the annotations in the class' docblock
*/
$annotations... | [
"public",
"function",
"afterInitialize",
"(",
"Event",
"$",
"event",
",",
"ModelsManager",
"$",
"manager",
",",
"$",
"model",
")",
"{",
"//Reflector",
"/** @var \\Phalcon\\Annotations\\Reflection $reflector */",
"$",
"reflector",
"=",
"$",
"this",
"->",
"annotations",... | This is called after initialize the model
@param Event $event
@param ModelsManager $manager
@param $model | [
"This",
"is",
"called",
"after",
"initialize",
"the",
"model"
] | 64cb04903f101c1fd85e8067c0dcdfc6ca133fb5 | https://github.com/SachaMorard/phalcon-model-annotations/blob/64cb04903f101c1fd85e8067c0dcdfc6ca133fb5/Library/Phalcon/Annotations/ModelListener.php#L25-L91 |
20,252 | krakphp/job | src/Queue/Doctrine/DoctrineQueue.php | DoctrineQueue.dequeue | public function dequeue() {
if (!count($this->cached_jobs)) {
$this->cached_jobs = $this->repo->getAvailableJobs($this->name);
}
if (!count($this->cached_jobs)) {
return;
}
$job_row = array_shift($this->cached_jobs);
$job = Job\WrappedJob::fromStr... | php | public function dequeue() {
if (!count($this->cached_jobs)) {
$this->cached_jobs = $this->repo->getAvailableJobs($this->name);
}
if (!count($this->cached_jobs)) {
return;
}
$job_row = array_shift($this->cached_jobs);
$job = Job\WrappedJob::fromStr... | [
"public",
"function",
"dequeue",
"(",
")",
"{",
"if",
"(",
"!",
"count",
"(",
"$",
"this",
"->",
"cached_jobs",
")",
")",
"{",
"$",
"this",
"->",
"cached_jobs",
"=",
"$",
"this",
"->",
"repo",
"->",
"getAvailableJobs",
"(",
"$",
"this",
"->",
"name",... | take a job off of the queue | [
"take",
"a",
"job",
"off",
"of",
"the",
"queue"
] | 0c16020c1baa13d91f819ecba8334861ba7c4d6c | https://github.com/krakphp/job/blob/0c16020c1baa13d91f819ecba8334861ba7c4d6c/src/Queue/Doctrine/DoctrineQueue.php#L24-L38 |
20,253 | shabbyrobe/amiss | src/Filter.php | Filter.getChildren | public function getChildren($objects, $path)
{
$array = array();
if (!is_array($path)) {
$path = explode('/', $path);
}
if (!is_array($objects)) {
$objects = array($objects);
}
$ret = $objects;
foreach ($path as $child) {
... | php | public function getChildren($objects, $path)
{
$array = array();
if (!is_array($path)) {
$path = explode('/', $path);
}
if (!is_array($objects)) {
$objects = array($objects);
}
$ret = $objects;
foreach ($path as $child) {
... | [
"public",
"function",
"getChildren",
"(",
"$",
"objects",
",",
"$",
"path",
")",
"{",
"$",
"array",
"=",
"array",
"(",
")",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"path",
")",
")",
"{",
"$",
"path",
"=",
"explode",
"(",
"'/'",
",",
"$",
"pa... | Retrieve all object child values through a property path.
Path can be an array: ['prop', 'childProp', 'veryChildProp']
Or a '/' delimited string: prop/childProp/veryChildProp
@param object[] $objects
@param string|array $path
@return array | [
"Retrieve",
"all",
"object",
"child",
"values",
"through",
"a",
"property",
"path",
"."
] | ba261f0d1f985ed36e9fd2903ac0df86c5b9498d | https://github.com/shabbyrobe/amiss/blob/ba261f0d1f985ed36e9fd2903ac0df86c5b9498d/src/Filter.php#L23-L68 |
20,254 | shabbyrobe/amiss | src/Filter.php | Filter.indexBy | public function indexBy($list, $property, $meta=null, $allowDupes=null, $ignoreNulls=null)
{
$allowDupes = $allowDupes !== null ? $allowDupes : false;
$ignoreNulls = $ignoreNulls !== null ? $ignoreNulls : true;
if (!$list) {
return [];
}
if ($meta) {
... | php | public function indexBy($list, $property, $meta=null, $allowDupes=null, $ignoreNulls=null)
{
$allowDupes = $allowDupes !== null ? $allowDupes : false;
$ignoreNulls = $ignoreNulls !== null ? $ignoreNulls : true;
if (!$list) {
return [];
}
if ($meta) {
... | [
"public",
"function",
"indexBy",
"(",
"$",
"list",
",",
"$",
"property",
",",
"$",
"meta",
"=",
"null",
",",
"$",
"allowDupes",
"=",
"null",
",",
"$",
"ignoreNulls",
"=",
"null",
")",
"{",
"$",
"allowDupes",
"=",
"$",
"allowDupes",
"!==",
"null",
"?"... | Iterate over an array of objects and returns an array of objects
indexed by a property
@return array | [
"Iterate",
"over",
"an",
"array",
"of",
"objects",
"and",
"returns",
"an",
"array",
"of",
"objects",
"indexed",
"by",
"a",
"property"
] | ba261f0d1f985ed36e9fd2903ac0df86c5b9498d | https://github.com/shabbyrobe/amiss/blob/ba261f0d1f985ed36e9fd2903ac0df86c5b9498d/src/Filter.php#L76-L113 |
20,255 | shabbyrobe/amiss | src/Filter.php | Filter.groupBy | public function groupBy($list, $property, $meta=null)
{
if (!$list) {
return [];
}
if (!$meta) {
if (!($first = current($list))) {
throw new \UnexpectedValueException();
}
$meta = $this->mapper->getMeta(get_class($first));
... | php | public function groupBy($list, $property, $meta=null)
{
if (!$list) {
return [];
}
if (!$meta) {
if (!($first = current($list))) {
throw new \UnexpectedValueException();
}
$meta = $this->mapper->getMeta(get_class($first));
... | [
"public",
"function",
"groupBy",
"(",
"$",
"list",
",",
"$",
"property",
",",
"$",
"meta",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"list",
")",
"{",
"return",
"[",
"]",
";",
"}",
"if",
"(",
"!",
"$",
"meta",
")",
"{",
"if",
"(",
"!",
"(... | Iterate over an array of objects and group them by the value of a property
@return array[group] = class[] | [
"Iterate",
"over",
"an",
"array",
"of",
"objects",
"and",
"group",
"them",
"by",
"the",
"value",
"of",
"a",
"property"
] | ba261f0d1f985ed36e9fd2903ac0df86c5b9498d | https://github.com/shabbyrobe/amiss/blob/ba261f0d1f985ed36e9fd2903ac0df86c5b9498d/src/Filter.php#L120-L144 |
20,256 | mridang/magazine | lib/magento/Archive/Helper/File/Bz.php | Mage_Archive_Helper_File_Bz._open | protected function _open($mode)
{
$this->_fileHandler = @bzopen($this->_filePath, $mode);
if (false === $this->_fileHandler) {
throw new Mage_Exception('Failed to open file ' . $this->_filePath);
}
} | php | protected function _open($mode)
{
$this->_fileHandler = @bzopen($this->_filePath, $mode);
if (false === $this->_fileHandler) {
throw new Mage_Exception('Failed to open file ' . $this->_filePath);
}
} | [
"protected",
"function",
"_open",
"(",
"$",
"mode",
")",
"{",
"$",
"this",
"->",
"_fileHandler",
"=",
"@",
"bzopen",
"(",
"$",
"this",
"->",
"_filePath",
",",
"$",
"mode",
")",
";",
"if",
"(",
"false",
"===",
"$",
"this",
"->",
"_fileHandler",
")",
... | Open bz archive file
@throws Mage_Exception
@param string $mode | [
"Open",
"bz",
"archive",
"file"
] | 5b3cfecc472c61fde6af63efe62690a30a267a04 | https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Archive/Helper/File/Bz.php#L42-L49 |
20,257 | mridang/magazine | lib/magento/Archive/Helper/File/Bz.php | Mage_Archive_Helper_File_Bz._read | protected function _read($length)
{
$data = bzread($this->_fileHandler, $length);
if (false === $data) {
throw new Mage_Exception('Failed to read data from ' . $this->_filePath);
}
return $data;
} | php | protected function _read($length)
{
$data = bzread($this->_fileHandler, $length);
if (false === $data) {
throw new Mage_Exception('Failed to read data from ' . $this->_filePath);
}
return $data;
} | [
"protected",
"function",
"_read",
"(",
"$",
"length",
")",
"{",
"$",
"data",
"=",
"bzread",
"(",
"$",
"this",
"->",
"_fileHandler",
",",
"$",
"length",
")",
";",
"if",
"(",
"false",
"===",
"$",
"data",
")",
"{",
"throw",
"new",
"Mage_Exception",
"(",... | Read data from bz archive
@throws Mage_Exception
@param int $length
@return string | [
"Read",
"data",
"from",
"bz",
"archive"
] | 5b3cfecc472c61fde6af63efe62690a30a267a04 | https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Archive/Helper/File/Bz.php#L73-L82 |
20,258 | oroinc/OroLayoutComponent | OptionValueBag.php | OptionValueBag.buildValue | public function buildValue()
{
$actions = [
'add' => [],
'replace' => [],
'remove' => [],
];
foreach ($this->actions as $action) {
switch ($action->getName()) {
case 'add':
$actions['add'][] = [$action->getA... | php | public function buildValue()
{
$actions = [
'add' => [],
'replace' => [],
'remove' => [],
];
foreach ($this->actions as $action) {
switch ($action->getName()) {
case 'add':
$actions['add'][] = [$action->getA... | [
"public",
"function",
"buildValue",
"(",
")",
"{",
"$",
"actions",
"=",
"[",
"'add'",
"=>",
"[",
"]",
",",
"'replace'",
"=>",
"[",
"]",
",",
"'remove'",
"=>",
"[",
"]",
",",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"actions",
"as",
"$",
"acti... | Builds a block option value using the given builder
@return mixed The built value | [
"Builds",
"a",
"block",
"option",
"value",
"using",
"the",
"given",
"builder"
] | 682a96672393d81c63728e47c4a4c3618c515be0 | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/OptionValueBag.php#L59-L90 |
20,259 | oroinc/OroLayoutComponent | OptionValueBag.php | OptionValueBag.getBuilder | protected function getBuilder()
{
$isArray = false;
// guess builder type based on arguments
if ($this->actions) {
/** @var Action $action */
$action = reset($this->actions);
$arguments = $action->getArguments();
if ($arguments) {
... | php | protected function getBuilder()
{
$isArray = false;
// guess builder type based on arguments
if ($this->actions) {
/** @var Action $action */
$action = reset($this->actions);
$arguments = $action->getArguments();
if ($arguments) {
... | [
"protected",
"function",
"getBuilder",
"(",
")",
"{",
"$",
"isArray",
"=",
"false",
";",
"// guess builder type based on arguments",
"if",
"(",
"$",
"this",
"->",
"actions",
")",
"{",
"/** @var Action $action */",
"$",
"action",
"=",
"reset",
"(",
"$",
"this",
... | Returns options builder based on values in value bag
@return OptionValueBuilderInterface | [
"Returns",
"options",
"builder",
"based",
"on",
"values",
"in",
"value",
"bag"
] | 682a96672393d81c63728e47c4a4c3618c515be0 | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/OptionValueBag.php#L97-L119 |
20,260 | phpnfe/tools | src/Certificado/Dom.php | Dom.getNodeValue | public function getNodeValue($nodeName, $itemNum = 0, $extraTextBefore = '', $extraTextAfter = '')
{
$node = $this->getElementsByTagName($nodeName)->item($itemNum);
if (isset($node)) {
$texto = html_entity_decode(trim($node->nodeValue), ENT_QUOTES, 'UTF-8');
return $extraTex... | php | public function getNodeValue($nodeName, $itemNum = 0, $extraTextBefore = '', $extraTextAfter = '')
{
$node = $this->getElementsByTagName($nodeName)->item($itemNum);
if (isset($node)) {
$texto = html_entity_decode(trim($node->nodeValue), ENT_QUOTES, 'UTF-8');
return $extraTex... | [
"public",
"function",
"getNodeValue",
"(",
"$",
"nodeName",
",",
"$",
"itemNum",
"=",
"0",
",",
"$",
"extraTextBefore",
"=",
"''",
",",
"$",
"extraTextAfter",
"=",
"''",
")",
"{",
"$",
"node",
"=",
"$",
"this",
"->",
"getElementsByTagName",
"(",
"$",
"... | getNodeValue.
Extrai o valor do node DOM.
@param string $nodeName identificador da TAG do xml
@param int $itemNum numero do item a ser retornado
@param string $extraTextBefore prefixo do retorno
@param string $extraTextAfter sufixo do retorno
@return string | [
"getNodeValue",
".",
"Extrai",
"o",
"valor",
"do",
"node",
"DOM",
"."
] | 303ca311989e0b345071f61b71d2b3bf7ee80454 | https://github.com/phpnfe/tools/blob/303ca311989e0b345071f61b71d2b3bf7ee80454/src/Certificado/Dom.php#L53-L63 |
20,261 | phpnfe/tools | src/Certificado/Dom.php | Dom.getNode | public function getNode($nodeName, $itemNum = 0)
{
$node = $this->getElementsByTagName($nodeName)->item($itemNum);
if (isset($node)) {
return $node;
}
return '';
} | php | public function getNode($nodeName, $itemNum = 0)
{
$node = $this->getElementsByTagName($nodeName)->item($itemNum);
if (isset($node)) {
return $node;
}
return '';
} | [
"public",
"function",
"getNode",
"(",
"$",
"nodeName",
",",
"$",
"itemNum",
"=",
"0",
")",
"{",
"$",
"node",
"=",
"$",
"this",
"->",
"getElementsByTagName",
"(",
"$",
"nodeName",
")",
"->",
"item",
"(",
"$",
"itemNum",
")",
";",
"if",
"(",
"isset",
... | getNode
Retorna o node solicitado.
@param string $nodeName
@param int $itemNum
@return DOMElement se existir ou string vazia se não | [
"getNode",
"Retorna",
"o",
"node",
"solicitado",
"."
] | 303ca311989e0b345071f61b71d2b3bf7ee80454 | https://github.com/phpnfe/tools/blob/303ca311989e0b345071f61b71d2b3bf7ee80454/src/Certificado/Dom.php#L89-L97 |
20,262 | phpnfe/tools | src/Certificado/Dom.php | Dom.appChild | public function appChild(&$parent, $child, $msg = '')
{
if (empty($parent)) {
throw new Exception($msg);
}
if (! empty($child)) {
$parent->appendChild($child);
}
} | php | public function appChild(&$parent, $child, $msg = '')
{
if (empty($parent)) {
throw new Exception($msg);
}
if (! empty($child)) {
$parent->appendChild($child);
}
} | [
"public",
"function",
"appChild",
"(",
"&",
"$",
"parent",
",",
"$",
"child",
",",
"$",
"msg",
"=",
"''",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"parent",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"$",
"msg",
")",
";",
"}",
"if",
"(",
... | appChild
Acrescenta DOMElement a pai DOMElement
Caso o pai esteja vazio retorna uma exception com a mensagem
O parametro "child" pode ser vazio.
@param \DOMNode $parent
@param \DOMNode $child
@param string $msg
@return void
@throws Exception | [
"appChild",
"Acrescenta",
"DOMElement",
"a",
"pai",
"DOMElement",
"Caso",
"o",
"pai",
"esteja",
"vazio",
"retorna",
"uma",
"exception",
"com",
"a",
"mensagem",
"O",
"parametro",
"child",
"pode",
"ser",
"vazio",
"."
] | 303ca311989e0b345071f61b71d2b3bf7ee80454 | https://github.com/phpnfe/tools/blob/303ca311989e0b345071f61b71d2b3bf7ee80454/src/Certificado/Dom.php#L158-L166 |
20,263 | phpnfe/tools | src/Certificado/Dom.php | Dom.addArrayChild | public function addArrayChild(&$parent, $arr)
{
$num = 0;
if (! empty($arr) && ! empty($parent)) {
foreach ($arr as $node) {
$this->appChild($parent, $node, '');
$num++;
}
}
return $num;
} | php | public function addArrayChild(&$parent, $arr)
{
$num = 0;
if (! empty($arr) && ! empty($parent)) {
foreach ($arr as $node) {
$this->appChild($parent, $node, '');
$num++;
}
}
return $num;
} | [
"public",
"function",
"addArrayChild",
"(",
"&",
"$",
"parent",
",",
"$",
"arr",
")",
"{",
"$",
"num",
"=",
"0",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"arr",
")",
"&&",
"!",
"empty",
"(",
"$",
"parent",
")",
")",
"{",
"foreach",
"(",
"$",
"... | addArrayChild
Adiciona a um DOMNode parent, outros elementos passados em um array de DOMElements.
@param DOMElement $parent
@param array $arr
@return int | [
"addArrayChild",
"Adiciona",
"a",
"um",
"DOMNode",
"parent",
"outros",
"elementos",
"passados",
"em",
"um",
"array",
"de",
"DOMElements",
"."
] | 303ca311989e0b345071f61b71d2b3bf7ee80454 | https://github.com/phpnfe/tools/blob/303ca311989e0b345071f61b71d2b3bf7ee80454/src/Certificado/Dom.php#L175-L186 |
20,264 | bzarzuela/modelfilter | src/ModelFilter.php | ModelFilter.setKey | public function setKey($key)
{
$this->key = $key;
// Initialize if we're the first instance.
if (! session()->has('bzarzuela.filters')) {
session(['bzarzuela.filters' => [$key => []]]);
}
return $this;
} | php | public function setKey($key)
{
$this->key = $key;
// Initialize if we're the first instance.
if (! session()->has('bzarzuela.filters')) {
session(['bzarzuela.filters' => [$key => []]]);
}
return $this;
} | [
"public",
"function",
"setKey",
"(",
"$",
"key",
")",
"{",
"$",
"this",
"->",
"key",
"=",
"$",
"key",
";",
"// Initialize if we're the first instance.",
"if",
"(",
"!",
"session",
"(",
")",
"->",
"has",
"(",
"'bzarzuela.filters'",
")",
")",
"{",
"session",... | Sets a unique key to hold the filter form data in the session.
@param string $key Key name. Usually the model's table name | [
"Sets",
"a",
"unique",
"key",
"to",
"hold",
"the",
"filter",
"form",
"data",
"in",
"the",
"session",
"."
] | 2ca04409934245b8bf5a0a9684da2f45b234dfa7 | https://github.com/bzarzuela/modelfilter/blob/2ca04409934245b8bf5a0a9684da2f45b234dfa7/src/ModelFilter.php#L31-L41 |
20,265 | bzarzuela/modelfilter | src/ModelFilter.php | ModelFilter.getFormData | public function getFormData($field = null)
{
$filters = session('bzarzuela.filters');
if (isset($filters[$this->key]['form_data'])) {
if (! is_null($field)) {
if (! isset($filters[$this->key]['form_data'][$field])) {
return null;
}
... | php | public function getFormData($field = null)
{
$filters = session('bzarzuela.filters');
if (isset($filters[$this->key]['form_data'])) {
if (! is_null($field)) {
if (! isset($filters[$this->key]['form_data'][$field])) {
return null;
}
... | [
"public",
"function",
"getFormData",
"(",
"$",
"field",
"=",
"null",
")",
"{",
"$",
"filters",
"=",
"session",
"(",
"'bzarzuela.filters'",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"filters",
"[",
"$",
"this",
"->",
"key",
"]",
"[",
"'form_data'",
"]",
... | Gets either the whole form data or just a field inside.
@param null $field
@return array|null | [
"Gets",
"either",
"the",
"whole",
"form",
"data",
"or",
"just",
"a",
"field",
"inside",
"."
] | 2ca04409934245b8bf5a0a9684da2f45b234dfa7 | https://github.com/bzarzuela/modelfilter/blob/2ca04409934245b8bf5a0a9684da2f45b234dfa7/src/ModelFilter.php#L87-L110 |
20,266 | alexandresalome/journal-extension | src/Behat/JournalExtension/Formatter/JournalFormatter.php | JournalFormatter.afterStep | public function afterStep(StepEvent $event) {
$color = $this->getResultColorCode($event->getResult());
$capture = $this->captureAll || $color == 'failed';
if ($capture) {
try {
$screenshot = $this->driver->getScreenshot();
if ($screenshot) {
... | php | public function afterStep(StepEvent $event) {
$color = $this->getResultColorCode($event->getResult());
$capture = $this->captureAll || $color == 'failed';
if ($capture) {
try {
$screenshot = $this->driver->getScreenshot();
if ($screenshot) {
... | [
"public",
"function",
"afterStep",
"(",
"StepEvent",
"$",
"event",
")",
"{",
"$",
"color",
"=",
"$",
"this",
"->",
"getResultColorCode",
"(",
"$",
"event",
"->",
"getResult",
"(",
")",
")",
";",
"$",
"capture",
"=",
"$",
"this",
"->",
"captureAll",
"||... | Listens to "step.after" event.
@param StepEvent $event
@uses printStep() | [
"Listens",
"to",
"step",
".",
"after",
"event",
"."
] | de87304abb52abfa6905f1b83d2e35cc7bc52c0d | https://github.com/alexandresalome/journal-extension/blob/de87304abb52abfa6905f1b83d2e35cc7bc52c0d/src/Behat/JournalExtension/Formatter/JournalFormatter.php#L68-L110 |
20,267 | JimmDiGrizli/phalcon-config-loader | src/ConfigLoader.php | ConfigLoader.importResource | protected function importResource(BaseConfig $baseConfig)
{
foreach ($baseConfig as $key => $value) {
if ($value instanceof BaseConfig) {
$this->importResource($value);
} elseif (is_string($value)) {
if ($key === self::RESOURCES_KEY) {
... | php | protected function importResource(BaseConfig $baseConfig)
{
foreach ($baseConfig as $key => $value) {
if ($value instanceof BaseConfig) {
$this->importResource($value);
} elseif (is_string($value)) {
if ($key === self::RESOURCES_KEY) {
... | [
"protected",
"function",
"importResource",
"(",
"BaseConfig",
"$",
"baseConfig",
")",
"{",
"foreach",
"(",
"$",
"baseConfig",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"instanceof",
"BaseConfig",
")",
"{",
"$",
"this",
"->"... | Import encountered files in the configuration
@param Config $baseConfig
@throws AdapterNotFoundException
@throws ConstantDirNotFoundException
@throws ExtensionNotFoundException | [
"Import",
"encountered",
"files",
"in",
"the",
"configuration"
] | 9a68dc02057f16aa2431681675ca0bb876a7d571 | https://github.com/JimmDiGrizli/phalcon-config-loader/blob/9a68dc02057f16aa2431681675ca0bb876a7d571/src/ConfigLoader.php#L156-L204 |
20,268 | JimmDiGrizli/phalcon-config-loader | src/ConfigLoader.php | ConfigLoader.clear | public function clear(Config $means, Config $target)
{
foreach ($target as $key => $value) {
if ($value instanceof BaseConfig && isset($means[$key])) {
$this->clear($means[$key], $value);
} else {
if (isset($means[$key])) {
$target-... | php | public function clear(Config $means, Config $target)
{
foreach ($target as $key => $value) {
if ($value instanceof BaseConfig && isset($means[$key])) {
$this->clear($means[$key], $value);
} else {
if (isset($means[$key])) {
$target-... | [
"public",
"function",
"clear",
"(",
"Config",
"$",
"means",
",",
"Config",
"$",
"target",
")",
"{",
"foreach",
"(",
"$",
"target",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"instanceof",
"BaseConfig",
"&&",
"isset",
"("... | Delete variables that are already defined in the main configuration file
@param Config $means Main configuration file
@param Config $target Imported configuration file
@return Config | [
"Delete",
"variables",
"that",
"are",
"already",
"defined",
"in",
"the",
"main",
"configuration",
"file"
] | 9a68dc02057f16aa2431681675ca0bb876a7d571 | https://github.com/JimmDiGrizli/phalcon-config-loader/blob/9a68dc02057f16aa2431681675ca0bb876a7d571/src/ConfigLoader.php#L213-L226 |
20,269 | JimmDiGrizli/phalcon-config-loader | src/ConfigLoader.php | ConfigLoader.moduleConfigCreate | protected function moduleConfigCreate($path)
{
$value = explode('::', $path);
$ref = new ReflectionClass($value[0]);
if ($ref->hasConstant('DIR') === false) {
throw new ConstantDirNotFoundException(
'Not found constant DIR in class ' . $value[0]
);
... | php | protected function moduleConfigCreate($path)
{
$value = explode('::', $path);
$ref = new ReflectionClass($value[0]);
if ($ref->hasConstant('DIR') === false) {
throw new ConstantDirNotFoundException(
'Not found constant DIR in class ' . $value[0]
);
... | [
"protected",
"function",
"moduleConfigCreate",
"(",
"$",
"path",
")",
"{",
"$",
"value",
"=",
"explode",
"(",
"'::'",
",",
"$",
"path",
")",
";",
"$",
"ref",
"=",
"new",
"ReflectionClass",
"(",
"$",
"value",
"[",
"0",
"]",
")",
";",
"if",
"(",
"$",... | Create a configuration of the module for further imports
@param $path
@return Config
@throws AdapterNotFoundException
@throws ConstantDirNotFoundException
@throws ExtensionNotFoundException | [
"Create",
"a",
"configuration",
"of",
"the",
"module",
"for",
"further",
"imports"
] | 9a68dc02057f16aa2431681675ca0bb876a7d571 | https://github.com/JimmDiGrizli/phalcon-config-loader/blob/9a68dc02057f16aa2431681675ca0bb876a7d571/src/ConfigLoader.php#L237-L250 |
20,270 | webdevvie/pheanstalk-task-queue-bundle | Service/PheanstalkConnection.php | PheanstalkConnection.put | public function put(
$data,
$priority = \Pheanstalk_PheanstalkInterface::DEFAULT_PRIORITY,
$delay = \Pheanstalk_PheanstalkInterface::DEFAULT_DELAY,
$timeToRun = \Pheanstalk_PheanstalkInterface::DEFAULT_TTR
) {
$this->pheanstalk->put($data, $priority, $delay, $timeToRun);
... | php | public function put(
$data,
$priority = \Pheanstalk_PheanstalkInterface::DEFAULT_PRIORITY,
$delay = \Pheanstalk_PheanstalkInterface::DEFAULT_DELAY,
$timeToRun = \Pheanstalk_PheanstalkInterface::DEFAULT_TTR
) {
$this->pheanstalk->put($data, $priority, $delay, $timeToRun);
... | [
"public",
"function",
"put",
"(",
"$",
"data",
",",
"$",
"priority",
"=",
"\\",
"Pheanstalk_PheanstalkInterface",
"::",
"DEFAULT_PRIORITY",
",",
"$",
"delay",
"=",
"\\",
"Pheanstalk_PheanstalkInterface",
"::",
"DEFAULT_DELAY",
",",
"$",
"timeToRun",
"=",
"\\",
"... | Puts a task string into the current
@param $data
@param int $priority
@param int $delay
@param int $timeToRun
@return $this | [
"Puts",
"a",
"task",
"string",
"into",
"the",
"current"
] | db5e63a8f844e345dc2e69ce8e94b32d851020eb | https://github.com/webdevvie/pheanstalk-task-queue-bundle/blob/db5e63a8f844e345dc2e69ce8e94b32d851020eb/Service/PheanstalkConnection.php#L40-L48 |
20,271 | andromeda-framework/doctrine | src/Doctrine/Tracy/Panel.php | Panel.getTab | public function getTab(): string
{
return '<span title="Doctrine 2">'
. '<svg viewBox="0 0 2048 2048"><path fill="#aaa" d="M1024 896q237 0 443-43t325-127v170q0 69-103 128t-280 93.5-385 34.5-385-34.5-280'
. '-93.5-103-128v-170q119 84 325 127t443 43zm0 768q237 0 443-43t325-127v170q0 69-103 128t-280 93.5-385 34.5... | php | public function getTab(): string
{
return '<span title="Doctrine 2">'
. '<svg viewBox="0 0 2048 2048"><path fill="#aaa" d="M1024 896q237 0 443-43t325-127v170q0 69-103 128t-280 93.5-385 34.5-385-34.5-280'
. '-93.5-103-128v-170q119 84 325 127t443 43zm0 768q237 0 443-43t325-127v170q0 69-103 128t-280 93.5-385 34.5... | [
"public",
"function",
"getTab",
"(",
")",
":",
"string",
"{",
"return",
"'<span title=\"Doctrine 2\">'",
".",
"'<svg viewBox=\"0 0 2048 2048\"><path fill=\"#aaa\" d=\"M1024 896q237 0 443-43t325-127v170q0 69-103 128t-280 93.5-385 34.5-385-34.5-280'",
".",
"'-93.5-103-128v-170q119 84 325 127... | Renders tab for Tracy Debug Bar.
@return string | [
"Renders",
"tab",
"for",
"Tracy",
"Debug",
"Bar",
"."
] | 46924d91c09e0b9fbe5764518cbad70e467ffad4 | https://github.com/andromeda-framework/doctrine/blob/46924d91c09e0b9fbe5764518cbad70e467ffad4/src/Doctrine/Tracy/Panel.php#L73-L85 |
20,272 | andromeda-framework/doctrine | src/Doctrine/Tracy/Panel.php | Panel.getPanel | public function getPanel(): string
{
if (empty($this->queries)) {
return '';
}
$params = $this->connection->getParams();
$host = ($params['driver'] === 'pdo_sqlite' && isset($params['path']))
? 'path: ' . basename($params['path'])
: sprintf('host: %s%s/%s', $this->connection->getHost(),
(($p = $t... | php | public function getPanel(): string
{
if (empty($this->queries)) {
return '';
}
$params = $this->connection->getParams();
$host = ($params['driver'] === 'pdo_sqlite' && isset($params['path']))
? 'path: ' . basename($params['path'])
: sprintf('host: %s%s/%s', $this->connection->getHost(),
(($p = $t... | [
"public",
"function",
"getPanel",
"(",
")",
":",
"string",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"queries",
")",
")",
"{",
"return",
"''",
";",
"}",
"$",
"params",
"=",
"$",
"this",
"->",
"connection",
"->",
"getParams",
"(",
")",
";",
... | Renders panel for Tracy Debug Bar.
@return string | [
"Renders",
"panel",
"for",
"Tracy",
"Debug",
"Bar",
"."
] | 46924d91c09e0b9fbe5764518cbad70e467ffad4 | https://github.com/andromeda-framework/doctrine/blob/46924d91c09e0b9fbe5764518cbad70e467ffad4/src/Doctrine/Tracy/Panel.php#L93-L119 |
20,273 | andromeda-framework/doctrine | src/Doctrine/Tracy/Panel.php | Panel.renderPanelCacheStatistics | private function renderPanelCacheStatistics(): string
{
if (empty($this->entityManager)) {
return '';
}
$config = $this->entityManager->getConfiguration();
if (!$config->isSecondLevelCacheEnabled()) {
return '';
}
$loggerChain = $config->getSecondLevelCacheConfiguration()->getCacheLogger();
if (... | php | private function renderPanelCacheStatistics(): string
{
if (empty($this->entityManager)) {
return '';
}
$config = $this->entityManager->getConfiguration();
if (!$config->isSecondLevelCacheEnabled()) {
return '';
}
$loggerChain = $config->getSecondLevelCacheConfiguration()->getCacheLogger();
if (... | [
"private",
"function",
"renderPanelCacheStatistics",
"(",
")",
":",
"string",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"entityManager",
")",
")",
"{",
"return",
"''",
";",
"}",
"$",
"config",
"=",
"$",
"this",
"->",
"entityManager",
"->",
"getCon... | Renders cache statistics.
@return string | [
"Renders",
"cache",
"statistics",
"."
] | 46924d91c09e0b9fbe5764518cbad70e467ffad4 | https://github.com/andromeda-framework/doctrine/blob/46924d91c09e0b9fbe5764518cbad70e467ffad4/src/Doctrine/Tracy/Panel.php#L127-L149 |
20,274 | andromeda-framework/doctrine | src/Doctrine/Tracy/Panel.php | Panel.renderPanelQueries | private function renderPanelQueries(): string
{
if (empty($this->queries)) {
return '';
}
$s = '';
foreach ($this->queries as $query) {
[$sql, $params, $time, $types, $source] = $query;
$q = SqlDumper::dump($sql, $params);
$q .= $source ? Helpers::editorLink($source[0], $source[1]) : '';
$s .= ... | php | private function renderPanelQueries(): string
{
if (empty($this->queries)) {
return '';
}
$s = '';
foreach ($this->queries as $query) {
[$sql, $params, $time, $types, $source] = $query;
$q = SqlDumper::dump($sql, $params);
$q .= $source ? Helpers::editorLink($source[0], $source[1]) : '';
$s .= ... | [
"private",
"function",
"renderPanelQueries",
"(",
")",
":",
"string",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"queries",
")",
")",
"{",
"return",
"''",
";",
"}",
"$",
"s",
"=",
"''",
";",
"foreach",
"(",
"$",
"this",
"->",
"queries",
"as",... | Renders SQL queries.
@return string | [
"Renders",
"SQL",
"queries",
"."
] | 46924d91c09e0b9fbe5764518cbad70e467ffad4 | https://github.com/andromeda-framework/doctrine/blob/46924d91c09e0b9fbe5764518cbad70e467ffad4/src/Doctrine/Tracy/Panel.php#L157-L172 |
20,275 | andromeda-framework/doctrine | src/Doctrine/Tracy/Panel.php | Panel.setEntityManager | public function setEntityManager(EntityManager $entityManager)
{
$this->entityManager = $entityManager;
$this->connection = $entityManager->getConnection();
$bar = Debugger::getBar();
$bar->addPanel($this);
$config = $this->connection->getConfiguration();
$logger = $config->getSQLLogger();
if ($logger ... | php | public function setEntityManager(EntityManager $entityManager)
{
$this->entityManager = $entityManager;
$this->connection = $entityManager->getConnection();
$bar = Debugger::getBar();
$bar->addPanel($this);
$config = $this->connection->getConfiguration();
$logger = $config->getSQLLogger();
if ($logger ... | [
"public",
"function",
"setEntityManager",
"(",
"EntityManager",
"$",
"entityManager",
")",
"{",
"$",
"this",
"->",
"entityManager",
"=",
"$",
"entityManager",
";",
"$",
"this",
"->",
"connection",
"=",
"$",
"entityManager",
"->",
"getConnection",
"(",
")",
";"... | Sets entity manager.
@param EntityManager $entityManager The Doctrine Entity Manager | [
"Sets",
"entity",
"manager",
"."
] | 46924d91c09e0b9fbe5764518cbad70e467ffad4 | https://github.com/andromeda-framework/doctrine/blob/46924d91c09e0b9fbe5764518cbad70e467ffad4/src/Doctrine/Tracy/Panel.php#L236-L251 |
20,276 | GrupaZero/api | src/Gzero/Api/Controller/Admin/OptionController.php | OptionController.show | public function show($key)
{
$this->authorize('read', Option::class);
try {
$option = $this->optionRepo->getOptions($key);
return $this->respondWithSuccess($option, new OptionTransformer);
} catch (RepositoryValidationException $e) {
return $this->respondW... | php | public function show($key)
{
$this->authorize('read', Option::class);
try {
$option = $this->optionRepo->getOptions($key);
return $this->respondWithSuccess($option, new OptionTransformer);
} catch (RepositoryValidationException $e) {
return $this->respondW... | [
"public",
"function",
"show",
"(",
"$",
"key",
")",
"{",
"$",
"this",
"->",
"authorize",
"(",
"'read'",
",",
"Option",
"::",
"class",
")",
";",
"try",
"{",
"$",
"option",
"=",
"$",
"this",
"->",
"optionRepo",
"->",
"getOptions",
"(",
"$",
"key",
")... | Display all options from selected category.
@param string $key option category key
@return \Illuminate\Http\JsonResponse | [
"Display",
"all",
"options",
"from",
"selected",
"category",
"."
] | fc544bb6057274e9d5e7b617346c3f854ea5effd | https://github.com/GrupaZero/api/blob/fc544bb6057274e9d5e7b617346c3f854ea5effd/src/Gzero/Api/Controller/Admin/OptionController.php#L67-L76 |
20,277 | phPoirot/psr7 | HttpMessage.php | HttpMessage.isValid | static function isValid($value)
{
if (!\Poirot\Std\isStringify($value))
throw new \InvalidArgumentException(sprintf(
'Header value must be string; given: (%s).'
, \Poirot\Std\flatten($value)
));
$value = (string) $value;
// Look for:... | php | static function isValid($value)
{
if (!\Poirot\Std\isStringify($value))
throw new \InvalidArgumentException(sprintf(
'Header value must be string; given: (%s).'
, \Poirot\Std\flatten($value)
));
$value = (string) $value;
// Look for:... | [
"static",
"function",
"isValid",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"\\",
"Poirot",
"\\",
"Std",
"\\",
"isStringify",
"(",
"$",
"value",
")",
")",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'Header value must be string;... | Validate a header value.
Per RFC 7230, only VISIBLE ASCII characters, spaces, and horizontal
tabs are allowed in values; header continuations MUST consist of
a single CRLF sequence followed by a space or horizontal tab.
@see http://en.wikipedia.org/wiki/HTTP_response_splitting
@param string $value
@return bool | [
"Validate",
"a",
"header",
"value",
"."
] | e90295e806dc2eb0cc422f315075f673c63a0780 | https://github.com/phPoirot/psr7/blob/e90295e806dc2eb0cc422f315075f673c63a0780/HttpMessage.php#L320-L350 |
20,278 | xiewulong/yii2-fileupload | oss/libs/guzzle/http/Guzzle/Http/Url.php | Url.addPath | public function addPath($relativePath)
{
if (!$relativePath || $relativePath == '/') {
return $this;
}
// Add a leading slash if needed
if ($relativePath[0] != '/') {
$relativePath = '/' . $relativePath;
}
return $this->setPath(str_replace('/... | php | public function addPath($relativePath)
{
if (!$relativePath || $relativePath == '/') {
return $this;
}
// Add a leading slash if needed
if ($relativePath[0] != '/') {
$relativePath = '/' . $relativePath;
}
return $this->setPath(str_replace('/... | [
"public",
"function",
"addPath",
"(",
"$",
"relativePath",
")",
"{",
"if",
"(",
"!",
"$",
"relativePath",
"||",
"$",
"relativePath",
"==",
"'/'",
")",
"{",
"return",
"$",
"this",
";",
"}",
"// Add a leading slash if needed",
"if",
"(",
"$",
"relativePath",
... | Add a relative path to the currently set path
@param string $relativePath Relative path to add
@return Url | [
"Add",
"a",
"relative",
"path",
"to",
"the",
"currently",
"set",
"path"
] | 3e75b17a4a18dd8466e3f57c63136de03470ca82 | https://github.com/xiewulong/yii2-fileupload/blob/3e75b17a4a18dd8466e3f57c63136de03470ca82/oss/libs/guzzle/http/Guzzle/Http/Url.php#L332-L344 |
20,279 | philiplb/Valdi | src/Valdi/Validator/AbstractParametrizedValidator.php | AbstractParametrizedValidator.validateParameterCount | protected function validateParameterCount($name, $parameterAmount, array $parameters) {
if (count($parameters) !== $parameterAmount) {
throw new ValidationException('"'.$name.'" expects '.$parameterAmount.' parameter.');
}
} | php | protected function validateParameterCount($name, $parameterAmount, array $parameters) {
if (count($parameters) !== $parameterAmount) {
throw new ValidationException('"'.$name.'" expects '.$parameterAmount.' parameter.');
}
} | [
"protected",
"function",
"validateParameterCount",
"(",
"$",
"name",
",",
"$",
"parameterAmount",
",",
"array",
"$",
"parameters",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"parameters",
")",
"!==",
"$",
"parameterAmount",
")",
"{",
"throw",
"new",
"Validation... | Throws an exception if the parameters don't fulfill the expected
parameter count.
@param string $name
the name of the validator
@param integer $parameterAmount
the amount of expected parameters
@param string[] $parameters
the parameters
@throws ValidationException
thrown if the amount of parameters isn't the expected... | [
"Throws",
"an",
"exception",
"if",
"the",
"parameters",
"don",
"t",
"fulfill",
"the",
"expected",
"parameter",
"count",
"."
] | 9927ec34a2cb00cec705e952d3c2374e2dc3c972 | https://github.com/philiplb/Valdi/blob/9927ec34a2cb00cec705e952d3c2374e2dc3c972/src/Valdi/Validator/AbstractParametrizedValidator.php#L35-L39 |
20,280 | interactivesolutions/honeycomb-core | src/errors/HCLog.php | HCLog.emergency | public function emergency(string $id, string $message, int $status = 400)
{
Log::error($id . ' : ' . $message);
return response ()->json (['success' => false, 'id' => $id, 'message' => $message], $status);
} | php | public function emergency(string $id, string $message, int $status = 400)
{
Log::error($id . ' : ' . $message);
return response ()->json (['success' => false, 'id' => $id, 'message' => $message], $status);
} | [
"public",
"function",
"emergency",
"(",
"string",
"$",
"id",
",",
"string",
"$",
"message",
",",
"int",
"$",
"status",
"=",
"400",
")",
"{",
"Log",
"::",
"error",
"(",
"$",
"id",
".",
"' : '",
".",
"$",
"message",
")",
";",
"return",
"response",
"(... | Create emergency response
@param string $id
@param string $message
@param int $status
@return \Illuminate\Http\JsonResponse | [
"Create",
"emergency",
"response"
] | 06b8d88bb285e73a1a286e60411ca5f41863f39f | https://github.com/interactivesolutions/honeycomb-core/blob/06b8d88bb285e73a1a286e60411ca5f41863f39f/src/errors/HCLog.php#L17-L22 |
20,281 | interactivesolutions/honeycomb-core | src/errors/HCLog.php | HCLog.notice | public function notice(string $id, string $message, int $status = 400)
{
Log::info($id . ' : ' . $message);
return response ()->json (['success' => false, 'id' => $id, 'message' => $message], $status);
} | php | public function notice(string $id, string $message, int $status = 400)
{
Log::info($id . ' : ' . $message);
return response ()->json (['success' => false, 'id' => $id, 'message' => $message], $status);
} | [
"public",
"function",
"notice",
"(",
"string",
"$",
"id",
",",
"string",
"$",
"message",
",",
"int",
"$",
"status",
"=",
"400",
")",
"{",
"Log",
"::",
"info",
"(",
"$",
"id",
".",
"' : '",
".",
"$",
"message",
")",
";",
"return",
"response",
"(",
... | Create notice response
@param string $id
@param string $message
@param int $status
@return \Illuminate\Http\JsonResponse | [
"Create",
"notice",
"response"
] | 06b8d88bb285e73a1a286e60411ca5f41863f39f | https://github.com/interactivesolutions/honeycomb-core/blob/06b8d88bb285e73a1a286e60411ca5f41863f39f/src/errors/HCLog.php#L92-L97 |
20,282 | interactivesolutions/honeycomb-core | src/errors/HCLog.php | HCLog.success | public function success(string $id, string $message, int $status = 200)
{
Log::info($id . ' : ' . $message);
return response ()->json (['success' => true, 'id' => $id, 'message' => $message], $status);
} | php | public function success(string $id, string $message, int $status = 200)
{
Log::info($id . ' : ' . $message);
return response ()->json (['success' => true, 'id' => $id, 'message' => $message], $status);
} | [
"public",
"function",
"success",
"(",
"string",
"$",
"id",
",",
"string",
"$",
"message",
",",
"int",
"$",
"status",
"=",
"200",
")",
"{",
"Log",
"::",
"info",
"(",
"$",
"id",
".",
"' : '",
".",
"$",
"message",
")",
";",
"return",
"response",
"(",
... | Create success response
@param string $id
@param string $message
@param int $status
@return \Illuminate\Http\JsonResponse | [
"Create",
"success",
"response"
] | 06b8d88bb285e73a1a286e60411ca5f41863f39f | https://github.com/interactivesolutions/honeycomb-core/blob/06b8d88bb285e73a1a286e60411ca5f41863f39f/src/errors/HCLog.php#L135-L140 |
20,283 | academic/VipaBibTexBundle | Helper/Bibtex.php | Bibtex.setOption | function setOption($option, $value)
{
$ret = true;
if (array_key_exists($option, $this->_options)) {
$this->_options[$option] = $value;
} else {
throw new InvalidArgumentException('Unknown option ' . $option);
}
} | php | function setOption($option, $value)
{
$ret = true;
if (array_key_exists($option, $this->_options)) {
$this->_options[$option] = $value;
} else {
throw new InvalidArgumentException('Unknown option ' . $option);
}
} | [
"function",
"setOption",
"(",
"$",
"option",
",",
"$",
"value",
")",
"{",
"$",
"ret",
"=",
"true",
";",
"if",
"(",
"array_key_exists",
"(",
"$",
"option",
",",
"$",
"this",
"->",
"_options",
")",
")",
"{",
"$",
"this",
"->",
"_options",
"[",
"$",
... | Sets run-time configuration options
@access public
@param string $option option name
@param mixed $value value for the option
@return mixed true on success
@throws InvalidArgumentException | [
"Sets",
"run",
"-",
"time",
"configuration",
"options"
] | 1cd82b0961e1a9fee804a85fd774d1384c3e089b | https://github.com/academic/VipaBibTexBundle/blob/1cd82b0961e1a9fee804a85fd774d1384c3e089b/Helper/Bibtex.php#L197-L205 |
20,284 | academic/VipaBibTexBundle | Helper/Bibtex.php | Bibtex.loadFile | function loadFile($filename)
{
if (file_exists($filename)) {
if (($this->content = @file_get_contents($filename)) === false) {
throw new BibtexException('Could not open file ' . $filename);
} else {
$this->_pos = 0;
$this->_oldpos = 0;
... | php | function loadFile($filename)
{
if (file_exists($filename)) {
if (($this->content = @file_get_contents($filename)) === false) {
throw new BibtexException('Could not open file ' . $filename);
} else {
$this->_pos = 0;
$this->_oldpos = 0;
... | [
"function",
"loadFile",
"(",
"$",
"filename",
")",
"{",
"if",
"(",
"file_exists",
"(",
"$",
"filename",
")",
")",
"{",
"if",
"(",
"(",
"$",
"this",
"->",
"content",
"=",
"@",
"file_get_contents",
"(",
"$",
"filename",
")",
")",
"===",
"false",
")",
... | Reads a give BibTex File
@access public
@param string $filename Name of the file
@return mixed true on success
@throws BibtexException | [
"Reads",
"a",
"give",
"BibTex",
"File"
] | 1cd82b0961e1a9fee804a85fd774d1384c3e089b | https://github.com/academic/VipaBibTexBundle/blob/1cd82b0961e1a9fee804a85fd774d1384c3e089b/Helper/Bibtex.php#L215-L228 |
20,285 | academic/VipaBibTexBundle | Helper/Bibtex.php | Bibtex._checkEqualSign | function _checkEqualSign($entry, $position)
{
$ret = true;
//This is getting tricky
//We check the string backwards until the position and count the closing an opening braces
//If we reach the position the amount of opening and closing braces should be equal
$length = strlen(... | php | function _checkEqualSign($entry, $position)
{
$ret = true;
//This is getting tricky
//We check the string backwards until the position and count the closing an opening braces
//If we reach the position the amount of opening and closing braces should be equal
$length = strlen(... | [
"function",
"_checkEqualSign",
"(",
"$",
"entry",
",",
"$",
"position",
")",
"{",
"$",
"ret",
"=",
"true",
";",
"//This is getting tricky",
"//We check the string backwards until the position and count the closing an opening braces",
"//If we reach the position the amount of openin... | Checking whether the position of the '=' is correct
Sometimes there is a problem if a '=' is used inside an entry (for example abstract).
This method checks if the '=' is outside braces then the '=' is correct and true is returned.
If the '=' is inside braces it contains to a equation and therefore false is returned.
... | [
"Checking",
"whether",
"the",
"position",
"of",
"the",
"=",
"is",
"correct"
] | 1cd82b0961e1a9fee804a85fd774d1384c3e089b | https://github.com/academic/VipaBibTexBundle/blob/1cd82b0961e1a9fee804a85fd774d1384c3e089b/Helper/Bibtex.php#L445-L494 |
20,286 | academic/VipaBibTexBundle | Helper/Bibtex.php | Bibtex._checkAt | function _checkAt($entry)
{
$ret = false;
$opening = array_keys($this->_delimiters);
$closing = array_values($this->_delimiters);
//Getting the value (at is only allowd in values)
if (strrpos($entry, '=') !== false) {
$position = strrpos($entry, '=');
... | php | function _checkAt($entry)
{
$ret = false;
$opening = array_keys($this->_delimiters);
$closing = array_values($this->_delimiters);
//Getting the value (at is only allowd in values)
if (strrpos($entry, '=') !== false) {
$position = strrpos($entry, '=');
... | [
"function",
"_checkAt",
"(",
"$",
"entry",
")",
"{",
"$",
"ret",
"=",
"false",
";",
"$",
"opening",
"=",
"array_keys",
"(",
"$",
"this",
"->",
"_delimiters",
")",
";",
"$",
"closing",
"=",
"array_values",
"(",
"$",
"this",
"->",
"_delimiters",
")",
"... | Checking whether an at is outside an entry
Sometimes an entry misses an entry brace. Then the at of the next entry seems to be
inside an entry. This is checked here. When it is most likely that the at is an opening
at of the next entry this method returns true.
@access private
@param string $entry The text of the ent... | [
"Checking",
"whether",
"an",
"at",
"is",
"outside",
"an",
"entry"
] | 1cd82b0961e1a9fee804a85fd774d1384c3e089b | https://github.com/academic/VipaBibTexBundle/blob/1cd82b0961e1a9fee804a85fd774d1384c3e089b/Helper/Bibtex.php#L519-L558 |
20,287 | academic/VipaBibTexBundle | Helper/Bibtex.php | Bibtex._wordwrap | function _wordwrap($entry)
{
if (('' != $entry) && (is_string($entry))) {
$entry = wordwrap($entry, $this->_options['wordWrapWidth'], $this->_options['wordWrapBreak'], $this->_options['wordWrapCut']);
}
return $entry;
} | php | function _wordwrap($entry)
{
if (('' != $entry) && (is_string($entry))) {
$entry = wordwrap($entry, $this->_options['wordWrapWidth'], $this->_options['wordWrapBreak'], $this->_options['wordWrapCut']);
}
return $entry;
} | [
"function",
"_wordwrap",
"(",
"$",
"entry",
")",
"{",
"if",
"(",
"(",
"''",
"!=",
"$",
"entry",
")",
"&&",
"(",
"is_string",
"(",
"$",
"entry",
")",
")",
")",
"{",
"$",
"entry",
"=",
"wordwrap",
"(",
"$",
"entry",
",",
"$",
"this",
"->",
"_opti... | Wordwrap an entry
@access private
@param string $entry The entry to wrap
@return string wrapped entry | [
"Wordwrap",
"an",
"entry"
] | 1cd82b0961e1a9fee804a85fd774d1384c3e089b | https://github.com/academic/VipaBibTexBundle/blob/1cd82b0961e1a9fee804a85fd774d1384c3e089b/Helper/Bibtex.php#L605-L611 |
20,288 | academic/VipaBibTexBundle | Helper/Bibtex.php | Bibtex._determineCase | function _determineCase($word)
{
$ret = -1;
$trimmedword = trim($word);
/*We need this variable. Without the next of would not work
(trim changes the variable automatically to a string!)*/
if (is_string($word) && (strlen($trimmedword) > 0)) {
$i = 0;
... | php | function _determineCase($word)
{
$ret = -1;
$trimmedword = trim($word);
/*We need this variable. Without the next of would not work
(trim changes the variable automatically to a string!)*/
if (is_string($word) && (strlen($trimmedword) > 0)) {
$i = 0;
... | [
"function",
"_determineCase",
"(",
"$",
"word",
")",
"{",
"$",
"ret",
"=",
"-",
"1",
";",
"$",
"trimmedword",
"=",
"trim",
"(",
"$",
"word",
")",
";",
"/*We need this variable. Without the next of would not work\n (trim changes the variable automatically to a stri... | Case Determination according to the needs of BibTex
To parse the Author(s) correctly a determination is needed
to get the Case of a word. There are three possible values:
- Upper Case (return value 1)
- Lower Case (return value 0)
- Caseless (return value -1)
@access private
@param string $word
@return int The Case... | [
"Case",
"Determination",
"according",
"to",
"the",
"needs",
"of",
"BibTex"
] | 1cd82b0961e1a9fee804a85fd774d1384c3e089b | https://github.com/academic/VipaBibTexBundle/blob/1cd82b0961e1a9fee804a85fd774d1384c3e089b/Helper/Bibtex.php#L769-L802 |
20,289 | academic/VipaBibTexBundle | Helper/Bibtex.php | Bibtex._validateValue | function _validateValue($entry, $wholeentry)
{
//There is no @ allowed if the entry is enclosed by braces
if (preg_match('/^{.*@.*}$/', $entry)) {
$this->_generateWarning('WARNING_AT_IN_BRACES', $entry, $wholeentry);
}
//No escaped " allowed if the entry is enclosed by do... | php | function _validateValue($entry, $wholeentry)
{
//There is no @ allowed if the entry is enclosed by braces
if (preg_match('/^{.*@.*}$/', $entry)) {
$this->_generateWarning('WARNING_AT_IN_BRACES', $entry, $wholeentry);
}
//No escaped " allowed if the entry is enclosed by do... | [
"function",
"_validateValue",
"(",
"$",
"entry",
",",
"$",
"wholeentry",
")",
"{",
"//There is no @ allowed if the entry is enclosed by braces",
"if",
"(",
"preg_match",
"(",
"'/^{.*@.*}$/'",
",",
"$",
"entry",
")",
")",
"{",
"$",
"this",
"->",
"_generateWarning",
... | Validation of a value
There may be several problems with the value of a field.
These problems exist but do not break the parsing.
If a problem is detected a warning is appended to the array warnings.
@access private
@param string $entry The entry aka one line which which should be validated
@param string $wholeentry ... | [
"Validation",
"of",
"a",
"value"
] | 1cd82b0961e1a9fee804a85fd774d1384c3e089b | https://github.com/academic/VipaBibTexBundle/blob/1cd82b0961e1a9fee804a85fd774d1384c3e089b/Helper/Bibtex.php#L816-L843 |
20,290 | academic/VipaBibTexBundle | Helper/Bibtex.php | Bibtex._removeCurlyBraces | function _removeCurlyBraces($value)
{
//First we save the delimiters
$beginningdels = array_keys($this->_delimiters);
$firstchar = substr($value, 0, 1);
$lastchar = substr($value, -1, 1);
$begin = '';
$end = '';
while (in_array($firstchar, $beginningdels)) { /... | php | function _removeCurlyBraces($value)
{
//First we save the delimiters
$beginningdels = array_keys($this->_delimiters);
$firstchar = substr($value, 0, 1);
$lastchar = substr($value, -1, 1);
$begin = '';
$end = '';
while (in_array($firstchar, $beginningdels)) { /... | [
"function",
"_removeCurlyBraces",
"(",
"$",
"value",
")",
"{",
"//First we save the delimiters",
"$",
"beginningdels",
"=",
"array_keys",
"(",
"$",
"this",
"->",
"_delimiters",
")",
";",
"$",
"firstchar",
"=",
"substr",
"(",
"$",
"value",
",",
"0",
",",
"1",... | Remove curly braces from entry
@access private
@param string $value The value in which curly braces to be removed
@param string Value with removed curly braces | [
"Remove",
"curly",
"braces",
"from",
"entry"
] | 1cd82b0961e1a9fee804a85fd774d1384c3e089b | https://github.com/academic/VipaBibTexBundle/blob/1cd82b0961e1a9fee804a85fd774d1384c3e089b/Helper/Bibtex.php#L852-L878 |
20,291 | academic/VipaBibTexBundle | Helper/Bibtex.php | Bibtex._generateWarning | function _generateWarning($type, $entry, $wholeentry = '')
{
$warning['warning'] = $type;
$warning['entry'] = $entry;
$warning['wholeentry'] = $wholeentry;
$this->warnings[] = $warning;
} | php | function _generateWarning($type, $entry, $wholeentry = '')
{
$warning['warning'] = $type;
$warning['entry'] = $entry;
$warning['wholeentry'] = $wholeentry;
$this->warnings[] = $warning;
} | [
"function",
"_generateWarning",
"(",
"$",
"type",
",",
"$",
"entry",
",",
"$",
"wholeentry",
"=",
"''",
")",
"{",
"$",
"warning",
"[",
"'warning'",
"]",
"=",
"$",
"type",
";",
"$",
"warning",
"[",
"'entry'",
"]",
"=",
"$",
"entry",
";",
"$",
"warni... | Generates a warning
@access private
@param string $type The type of the warning
@param string $entry The line of the entry where the warning occurred
@param string $wholeentry OPTIONAL The whole entry where the warning occurred | [
"Generates",
"a",
"warning"
] | 1cd82b0961e1a9fee804a85fd774d1384c3e089b | https://github.com/academic/VipaBibTexBundle/blob/1cd82b0961e1a9fee804a85fd774d1384c3e089b/Helper/Bibtex.php#L888-L894 |
20,292 | academic/VipaBibTexBundle | Helper/Bibtex.php | Bibtex._formatAuthor | function _formatAuthor($array)
{
if (!array_key_exists('von', $array)) {
$array['von'] = '';
} else {
$array['von'] = trim($array['von']);
}
if (!array_key_exists('last', $array)) {
$array['last'] = '';
} else {
$array['last'] =... | php | function _formatAuthor($array)
{
if (!array_key_exists('von', $array)) {
$array['von'] = '';
} else {
$array['von'] = trim($array['von']);
}
if (!array_key_exists('last', $array)) {
$array['last'] = '';
} else {
$array['last'] =... | [
"function",
"_formatAuthor",
"(",
"$",
"array",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"'von'",
",",
"$",
"array",
")",
")",
"{",
"$",
"array",
"[",
"'von'",
"]",
"=",
"''",
";",
"}",
"else",
"{",
"$",
"array",
"[",
"'von'",
"]",
"=",... | Returns the author formatted
The Author is formatted as setted in the authorstring
@access private
@param array $array Author array
@return string the formatted author string | [
"Returns",
"the",
"author",
"formatted"
] | 1cd82b0961e1a9fee804a85fd774d1384c3e089b | https://github.com/academic/VipaBibTexBundle/blob/1cd82b0961e1a9fee804a85fd774d1384c3e089b/Helper/Bibtex.php#L938-L967 |
20,293 | academic/VipaBibTexBundle | Helper/Bibtex.php | Bibtex.bibTex | function bibTex()
{
$bibtex = '';
foreach ($this->data as $entry) {
//Intro
$bibtex .= '@' . strtolower($entry['entryType']) . ' { ' . $entry['cite'] . ",\n";
//Other fields except author
foreach ($entry as $key => $val) {
if ($this->_o... | php | function bibTex()
{
$bibtex = '';
foreach ($this->data as $entry) {
//Intro
$bibtex .= '@' . strtolower($entry['entryType']) . ' { ' . $entry['cite'] . ",\n";
//Other fields except author
foreach ($entry as $key => $val) {
if ($this->_o... | [
"function",
"bibTex",
"(",
")",
"{",
"$",
"bibtex",
"=",
"''",
";",
"foreach",
"(",
"$",
"this",
"->",
"data",
"as",
"$",
"entry",
")",
"{",
"//Intro",
"$",
"bibtex",
".=",
"'@'",
".",
"strtolower",
"(",
"$",
"entry",
"[",
"'entryType'",
"]",
")",
... | Converts the stored BibTex entries to a BibTex String
In the field list, the author is the last field.
@access public
@return string The BibTex string | [
"Converts",
"the",
"stored",
"BibTex",
"entries",
"to",
"a",
"BibTex",
"String"
] | 1cd82b0961e1a9fee804a85fd774d1384c3e089b | https://github.com/academic/VipaBibTexBundle/blob/1cd82b0961e1a9fee804a85fd774d1384c3e089b/Helper/Bibtex.php#L977-L1013 |
20,294 | academic/VipaBibTexBundle | Helper/Bibtex.php | Bibtex.rtf | function rtf()
{
$ret = "{\\rtf\n";
foreach ($this->data as $entry) {
$line = $this->rtfstring;
$title = '';
$journal = '';
$year = '';
$authors = '';
if (array_key_exists('title', $entry)) {
$title = $this->_unw... | php | function rtf()
{
$ret = "{\\rtf\n";
foreach ($this->data as $entry) {
$line = $this->rtfstring;
$title = '';
$journal = '';
$year = '';
$authors = '';
if (array_key_exists('title', $entry)) {
$title = $this->_unw... | [
"function",
"rtf",
"(",
")",
"{",
"$",
"ret",
"=",
"\"{\\\\rtf\\n\"",
";",
"foreach",
"(",
"$",
"this",
"->",
"data",
"as",
"$",
"entry",
")",
"{",
"$",
"line",
"=",
"$",
"this",
"->",
"rtfstring",
";",
"$",
"title",
"=",
"''",
";",
"$",
"journal... | Returns the stored data in RTF format
This method simply returns a RTF formatted string. This is done very
simple and is not intended for heavy using and fine formatting. This
should be done by BibTex! It is intended to give some kind of quick
preview or to send someone a reference list as word/rtf format (even
some p... | [
"Returns",
"the",
"stored",
"data",
"in",
"RTF",
"format"
] | 1cd82b0961e1a9fee804a85fd774d1384c3e089b | https://github.com/academic/VipaBibTexBundle/blob/1cd82b0961e1a9fee804a85fd774d1384c3e089b/Helper/Bibtex.php#L1063-L1105 |
20,295 | academic/VipaBibTexBundle | Helper/Bibtex.php | Bibtex._escape_tex | function _escape_tex($tex)
{
$tex = str_replace("\\", "\\\\", $tex);
$tex = str_replace('#', '\#', $tex);
$tex = str_replace('$', '\$', $tex);
$tex = str_replace('%', '\%', $tex);
$tex = str_replace('^', '\^', $tex);
$tex = str_replace('&', '\&', $tex);
$tex =... | php | function _escape_tex($tex)
{
$tex = str_replace("\\", "\\\\", $tex);
$tex = str_replace('#', '\#', $tex);
$tex = str_replace('$', '\$', $tex);
$tex = str_replace('%', '\%', $tex);
$tex = str_replace('^', '\^', $tex);
$tex = str_replace('&', '\&', $tex);
$tex =... | [
"function",
"_escape_tex",
"(",
"$",
"tex",
")",
"{",
"$",
"tex",
"=",
"str_replace",
"(",
"\"\\\\\"",
",",
"\"\\\\\\\\\"",
",",
"$",
"tex",
")",
";",
"$",
"tex",
"=",
"str_replace",
"(",
"'#'",
",",
"'\\#'",
",",
"$",
"tex",
")",
";",
"$",
"tex",
... | Returns a string with special TeX characters escaped.
This method is to be used with any method which is exporting TeX, such
as the bibTex method. A series of string replace operations are
performed on the input string, and the escaped string is returned.
This code is taken from the Text_Wiki Pear package.
@author J... | [
"Returns",
"a",
"string",
"with",
"special",
"TeX",
"characters",
"escaped",
"."
] | 1cd82b0961e1a9fee804a85fd774d1384c3e089b | https://github.com/academic/VipaBibTexBundle/blob/1cd82b0961e1a9fee804a85fd774d1384c3e089b/Helper/Bibtex.php#L1179-L1191 |
20,296 | zicht/z | src/Zicht/Tool/Script/Tokenizer.php | Tokenizer.getTokens | public function getTokens($string, &$needle = 0)
{
$exprTokenizer = new ExpressionTokenizer();
$ret = array();
$depth = 0;
$needle = 0;
$len = strlen($string);
while ($needle < $len) {
$before = $needle;
$substr = substr($string, $needle);
... | php | public function getTokens($string, &$needle = 0)
{
$exprTokenizer = new ExpressionTokenizer();
$ret = array();
$depth = 0;
$needle = 0;
$len = strlen($string);
while ($needle < $len) {
$before = $needle;
$substr = substr($string, $needle);
... | [
"public",
"function",
"getTokens",
"(",
"$",
"string",
",",
"&",
"$",
"needle",
"=",
"0",
")",
"{",
"$",
"exprTokenizer",
"=",
"new",
"ExpressionTokenizer",
"(",
")",
";",
"$",
"ret",
"=",
"array",
"(",
")",
";",
"$",
"depth",
"=",
"0",
";",
"$",
... | Returns an array of tokens
@param string $string
@param int &$needle
@throws \UnexpectedValueException
@return array | [
"Returns",
"an",
"array",
"of",
"tokens"
] | 6a1731dad20b018555a96b726a61d4bf8ec8c886 | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Script/Tokenizer.php#L34-L87 |
20,297 | AOEpeople/Aoe_Layout | app/code/local/Aoe/Layout/Controller/Model.php | Aoe_Layout_Controller_Model.indexAction | public function indexAction()
{
if ($this->getRequest()->isAjax()) {
try {
$this->loadLayout(null, false, false);
$this->getLayout()->getUpdate()->setCacheId(null);
$this->getLayout()->getUpdate()->addHandle(strtolower($this->getFullActionName()) .... | php | public function indexAction()
{
if ($this->getRequest()->isAjax()) {
try {
$this->loadLayout(null, false, false);
$this->getLayout()->getUpdate()->setCacheId(null);
$this->getLayout()->getUpdate()->addHandle(strtolower($this->getFullActionName()) .... | [
"public",
"function",
"indexAction",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"isAjax",
"(",
")",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"loadLayout",
"(",
"null",
",",
"false",
",",
"false",
")",
";",
"$",
"th... | List existing records via a grid | [
"List",
"existing",
"records",
"via",
"a",
"grid"
] | d88ba3406cf12dbaf09548477133c3cb27d155ed | https://github.com/AOEpeople/Aoe_Layout/blob/d88ba3406cf12dbaf09548477133c3cb27d155ed/app/code/local/Aoe/Layout/Controller/Model.php#L8-L24 |
20,298 | AOEpeople/Aoe_Layout | app/code/local/Aoe/Layout/Controller/Model.php | Aoe_Layout_Controller_Model.viewAction | public function viewAction()
{
$model = $this->loadModel();
if (!$model->getId()) {
$this->_forward('noroute');
return;
}
$this->loadLayout();
$this->renderLayout();
} | php | public function viewAction()
{
$model = $this->loadModel();
if (!$model->getId()) {
$this->_forward('noroute');
return;
}
$this->loadLayout();
$this->renderLayout();
} | [
"public",
"function",
"viewAction",
"(",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"loadModel",
"(",
")",
";",
"if",
"(",
"!",
"$",
"model",
"->",
"getId",
"(",
")",
")",
"{",
"$",
"this",
"->",
"_forward",
"(",
"'noroute'",
")",
";",
"retu... | View existing record | [
"View",
"existing",
"record"
] | d88ba3406cf12dbaf09548477133c3cb27d155ed | https://github.com/AOEpeople/Aoe_Layout/blob/d88ba3406cf12dbaf09548477133c3cb27d155ed/app/code/local/Aoe/Layout/Controller/Model.php#L29-L39 |
20,299 | odiaseo/pagebuilder | src/PageBuilder/Util/Widget.php | Widget.widgetExist | public function widgetExist($name)
{
$name = strtolower($name);
return isset($this->dataStore[0][$name]) ? $this->dataStore[0][$name] : false;
} | php | public function widgetExist($name)
{
$name = strtolower($name);
return isset($this->dataStore[0][$name]) ? $this->dataStore[0][$name] : false;
} | [
"public",
"function",
"widgetExist",
"(",
"$",
"name",
")",
"{",
"$",
"name",
"=",
"strtolower",
"(",
"$",
"name",
")",
";",
"return",
"isset",
"(",
"$",
"this",
"->",
"dataStore",
"[",
"0",
"]",
"[",
"$",
"name",
"]",
")",
"?",
"$",
"this",
"->"... | Checks if a widget exists
@param $name
@return bool | [
"Checks",
"if",
"a",
"widget",
"exists"
] | 88ef7cccf305368561307efe4ca07fac8e5774f3 | https://github.com/odiaseo/pagebuilder/blob/88ef7cccf305368561307efe4ca07fac8e5774f3/src/PageBuilder/Util/Widget.php#L143-L148 |
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.