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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
23,700 | alevilar/ristorantino-vendor | Acl/Controller/Component/AclManagerComponent.php | AclManagerComponent.get_model_instance | private function get_model_instance($model_classname)
{
if(!isset($this->controller->{$model_classname}))
{
/*
* Do not use $this->controller->loadModel, as calling it from a plugin may prevent correct loading of behaviors
*/
$model_instance = ClassRegistry :: init($model_classname);
}
else
... | php | private function get_model_instance($model_classname)
{
if(!isset($this->controller->{$model_classname}))
{
/*
* Do not use $this->controller->loadModel, as calling it from a plugin may prevent correct loading of behaviors
*/
$model_instance = ClassRegistry :: init($model_classname);
}
else
... | [
"private",
"function",
"get_model_instance",
"(",
"$",
"model_classname",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"controller",
"->",
"{",
"$",
"model_classname",
"}",
")",
")",
"{",
"/*\n\t\t\t * Do not use $this->controller->loadModel, as callin... | Return an instance of the given model name
@param string $model_classname
@return Model | [
"Return",
"an",
"instance",
"of",
"the",
"given",
"model",
"name"
] | 6b91a1e20cc0ba09a1968d77e3de6512cfa2d966 | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Acl/Controller/Component/AclManagerComponent.php#L136-L151 |
23,701 | alevilar/ristorantino-vendor | Acl/Controller/Component/AclManagerComponent.php | AclManagerComponent.get_stored_controllers_hashes | public function get_stored_controllers_hashes()
{
$file = new File($this->controllers_hash_file);
$file_content = $file->read();
if(!empty($file_content))
{
$stored_controller_hashes = unserialize($file_content);
}
else
{
$stored_controller_hashes = array();
}
return $stored_controller... | php | public function get_stored_controllers_hashes()
{
$file = new File($this->controllers_hash_file);
$file_content = $file->read();
if(!empty($file_content))
{
$stored_controller_hashes = unserialize($file_content);
}
else
{
$stored_controller_hashes = array();
}
return $stored_controller... | [
"public",
"function",
"get_stored_controllers_hashes",
"(",
")",
"{",
"$",
"file",
"=",
"new",
"File",
"(",
"$",
"this",
"->",
"controllers_hash_file",
")",
";",
"$",
"file_content",
"=",
"$",
"file",
"->",
"read",
"(",
")",
";",
"if",
"(",
"!",
"empty",... | return the stored array of controllers hashes
@return array | [
"return",
"the",
"stored",
"array",
"of",
"controllers",
"hashes"
] | 6b91a1e20cc0ba09a1968d77e3de6512cfa2d966 | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Acl/Controller/Component/AclManagerComponent.php#L158-L173 |
23,702 | alevilar/ristorantino-vendor | Acl/Controller/Component/AclManagerComponent.php | AclManagerComponent.get_current_controllers_hashes | public function get_current_controllers_hashes()
{
$controllers = $this->AclReflector->get_all_controllers();
$current_controller_hashes = array();
foreach($controllers as $controller)
{
$ctler_file = new File($controller['file']);
$current_controller_hashes[$controlle... | php | public function get_current_controllers_hashes()
{
$controllers = $this->AclReflector->get_all_controllers();
$current_controller_hashes = array();
foreach($controllers as $controller)
{
$ctler_file = new File($controller['file']);
$current_controller_hashes[$controlle... | [
"public",
"function",
"get_current_controllers_hashes",
"(",
")",
"{",
"$",
"controllers",
"=",
"$",
"this",
"->",
"AclReflector",
"->",
"get_all_controllers",
"(",
")",
";",
"$",
"current_controller_hashes",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"... | return an array of all controllers hashes
@return array | [
"return",
"an",
"array",
"of",
"all",
"controllers",
"hashes"
] | 6b91a1e20cc0ba09a1968d77e3de6512cfa2d966 | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Acl/Controller/Component/AclManagerComponent.php#L180-L193 |
23,703 | alevilar/ristorantino-vendor | Acl/Controller/Component/AclManagerComponent.php | AclManagerComponent.get_missing_acos | public function get_missing_acos($update_hash_file = true)
{
if($this->check_controller_hash_tmp_file())
{
$missing_aco_nodes = array();
$stored_controller_hashes = $this->get_stored_controllers_hashes();
$current_controller_hashes = $this->get_current_controllers_hashes();
... | php | public function get_missing_acos($update_hash_file = true)
{
if($this->check_controller_hash_tmp_file())
{
$missing_aco_nodes = array();
$stored_controller_hashes = $this->get_stored_controllers_hashes();
$current_controller_hashes = $this->get_current_controllers_hashes();
... | [
"public",
"function",
"get_missing_acos",
"(",
"$",
"update_hash_file",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"check_controller_hash_tmp_file",
"(",
")",
")",
"{",
"$",
"missing_aco_nodes",
"=",
"array",
"(",
")",
";",
"$",
"stored_controller_ha... | Get a list of plugins, controllers and actions that don't have any corresponding ACO.
To run faster, the method only checks controllers that have not already been checked or that have been modified.
Depending on the $update_hash_file, the method may return the missing ACOs only once
(in order to show the alert message... | [
"Get",
"a",
"list",
"of",
"plugins",
"controllers",
"and",
"actions",
"that",
"don",
"t",
"have",
"any",
"corresponding",
"ACO",
".",
"To",
"run",
"faster",
"the",
"method",
"only",
"checks",
"controllers",
"that",
"have",
"not",
"already",
"been",
"checked"... | 6b91a1e20cc0ba09a1968d77e3de6512cfa2d966 | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Acl/Controller/Component/AclManagerComponent.php#L205-L255 |
23,704 | gedex/php-janrain-api | lib/Janrain/Api/Engage/LegacySharing.php | LegacySharing.setStatus | public function setStatus(array $params)
{
if (!isset($params['identifier'])) {
throw new MissingArgumentException('identifier');
}
if (!isset($params['status'])) {
throw new MissingArgumentException('status');
}
return $this->post('set_status', $params);
} | php | public function setStatus(array $params)
{
if (!isset($params['identifier'])) {
throw new MissingArgumentException('identifier');
}
if (!isset($params['status'])) {
throw new MissingArgumentException('status');
}
return $this->post('set_status', $params);
} | [
"public",
"function",
"setStatus",
"(",
"array",
"$",
"params",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"params",
"[",
"'identifier'",
"]",
")",
")",
"{",
"throw",
"new",
"MissingArgumentException",
"(",
"'identifier'",
")",
";",
"}",
"if",
"(",
"... | Updates the user status using the current signed in identity provider.
@param array $params
@link http://developers.janrain.com/documentation/api-methods/engage/legacy/set_status/ | [
"Updates",
"the",
"user",
"status",
"using",
"the",
"current",
"signed",
"in",
"identity",
"provider",
"."
] | 6283f68454e0ad5211ac620f1d337df38cd49597 | https://github.com/gedex/php-janrain-api/blob/6283f68454e0ad5211ac620f1d337df38cd49597/lib/Janrain/Api/Engage/LegacySharing.php#L51-L62 |
23,705 | ajgarlag/AjglSessionConcurrency | src/Http/Session/Registry/Storage/PdoSessionRegistryStorage.php | PdoSessionRegistryStorage.createTable | public function createTable()
{
// connect if we are not yet
$this->getConnection();
switch ($this->driver) {
case 'mysql':
// We use varbinary for the ID column because it prevents unwanted conversions:
// - character set conversions between serv... | php | public function createTable()
{
// connect if we are not yet
$this->getConnection();
switch ($this->driver) {
case 'mysql':
// We use varbinary for the ID column because it prevents unwanted conversions:
// - character set conversions between serv... | [
"public",
"function",
"createTable",
"(",
")",
"{",
"// connect if we are not yet",
"$",
"this",
"->",
"getConnection",
"(",
")",
";",
"switch",
"(",
"$",
"this",
"->",
"driver",
")",
"{",
"case",
"'mysql'",
":",
"// We use varbinary for the ID column because it pre... | Creates the table to store sessions which can be called once for setup.
Session ID is saved in a column of maximum length 128 because that is enough even
for a 512 bit configured session.hash_function like Whirlpool. Session username is
saved in a varchar of maximun length 256 because any valid email should fit into i... | [
"Creates",
"the",
"table",
"to",
"store",
"sessions",
"which",
"can",
"be",
"called",
"once",
"for",
"setup",
"."
] | daa3b1ff3ad4951947f7192e12b2496555e135fb | https://github.com/ajgarlag/AjglSessionConcurrency/blob/daa3b1ff3ad4951947f7192e12b2496555e135fb/src/Http/Session/Registry/Storage/PdoSessionRegistryStorage.php#L134-L169 |
23,706 | zeropingheroes/steam-browser-protocol | src/Zeropingheroes/SteamBrowserProtocol/SteamBrowserProtocol.php | SteamBrowserProtocol.connectToServer | public function connectToServer($address, $options = array())
{
$parameters = NULL;
if ( array_key_exists('port', $options) )
{
$parameters = ':'.$options['port'];
}
if ( array_key_exists('password', $options) )
{
$parameters .= '/'.$options['password'];
}
return $this->protocol.'connect/'.$ad... | php | public function connectToServer($address, $options = array())
{
$parameters = NULL;
if ( array_key_exists('port', $options) )
{
$parameters = ':'.$options['port'];
}
if ( array_key_exists('password', $options) )
{
$parameters .= '/'.$options['password'];
}
return $this->protocol.'connect/'.$ad... | [
"public",
"function",
"connectToServer",
"(",
"$",
"address",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"parameters",
"=",
"NULL",
";",
"if",
"(",
"array_key_exists",
"(",
"'port'",
",",
"$",
"options",
")",
")",
"{",
"$",
"parameters... | Generates a link to connecto the specified server
@param string $address Server IP or hostname
@param array $options Server port and password
@return string | [
"Generates",
"a",
"link",
"to",
"connecto",
"the",
"specified",
"server"
] | 1fce6740f2aed27480be5231351656aadcbf1d39 | https://github.com/zeropingheroes/steam-browser-protocol/blob/1fce6740f2aed27480be5231351656aadcbf1d39/src/Zeropingheroes/SteamBrowserProtocol/SteamBrowserProtocol.php#L112-L125 |
23,707 | zeropingheroes/steam-browser-protocol | src/Zeropingheroes/SteamBrowserProtocol/SteamBrowserProtocol.php | SteamBrowserProtocol.openSteamPage | public function openSteamPage($page, $parameter = NULL)
{
if( in_array($page, $this->steamPages) )
{
return $this->protocol.'url/'.$page.'/'.$parameter;
}
} | php | public function openSteamPage($page, $parameter = NULL)
{
if( in_array($page, $this->steamPages) )
{
return $this->protocol.'url/'.$page.'/'.$parameter;
}
} | [
"public",
"function",
"openSteamPage",
"(",
"$",
"page",
",",
"$",
"parameter",
"=",
"NULL",
")",
"{",
"if",
"(",
"in_array",
"(",
"$",
"page",
",",
"$",
"this",
"->",
"steamPages",
")",
")",
"{",
"return",
"$",
"this",
"->",
"protocol",
".",
"'url/'... | Generates a link to open the specified named page
@param string $page Page
@param array $parameter Additional parameter
@return string | [
"Generates",
"a",
"link",
"to",
"open",
"the",
"specified",
"named",
"page"
] | 1fce6740f2aed27480be5231351656aadcbf1d39 | https://github.com/zeropingheroes/steam-browser-protocol/blob/1fce6740f2aed27480be5231351656aadcbf1d39/src/Zeropingheroes/SteamBrowserProtocol/SteamBrowserProtocol.php#L295-L301 |
23,708 | songshenzong/log | src/DataCollector/QueryCollector.php | QueryCollector.findSource | protected function findSource()
{
$stack = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS | DEBUG_BACKTRACE_PROVIDE_OBJECT);
$sources = [];
foreach ($stack as $index => $trace) {
$sources[] = $this->parseTrace($index, $trace);
}
return array_filter($sources);
... | php | protected function findSource()
{
$stack = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS | DEBUG_BACKTRACE_PROVIDE_OBJECT);
$sources = [];
foreach ($stack as $index => $trace) {
$sources[] = $this->parseTrace($index, $trace);
}
return array_filter($sources);
... | [
"protected",
"function",
"findSource",
"(",
")",
"{",
"$",
"stack",
"=",
"debug_backtrace",
"(",
"DEBUG_BACKTRACE_IGNORE_ARGS",
"|",
"DEBUG_BACKTRACE_PROVIDE_OBJECT",
")",
";",
"$",
"sources",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"stack",
"as",
"$",
"index... | Use a backtrace to search for the origins of the query.
@return array | [
"Use",
"a",
"backtrace",
"to",
"search",
"for",
"the",
"origins",
"of",
"the",
"query",
"."
] | b1e01f7994da47737866eabf82367490eab17c46 | https://github.com/songshenzong/log/blob/b1e01f7994da47737866eabf82367490eab17c46/src/DataCollector/QueryCollector.php#L215-L226 |
23,709 | songshenzong/log | src/DataCollector/QueryCollector.php | QueryCollector.parseTrace | protected function parseTrace($index, array $trace)
{
$frame = (object) [
'index' => $index,
'namespace' => null,
'name' => null,
'line' => isset($trace['line']) ? $trace['line'] : '?',
];
if (isset($trace['function']) && $trace[... | php | protected function parseTrace($index, array $trace)
{
$frame = (object) [
'index' => $index,
'namespace' => null,
'name' => null,
'line' => isset($trace['line']) ? $trace['line'] : '?',
];
if (isset($trace['function']) && $trace[... | [
"protected",
"function",
"parseTrace",
"(",
"$",
"index",
",",
"array",
"$",
"trace",
")",
"{",
"$",
"frame",
"=",
"(",
"object",
")",
"[",
"'index'",
"=>",
"$",
"index",
",",
"'namespace'",
"=>",
"null",
",",
"'name'",
"=>",
"null",
",",
"'line'",
"... | Parse a trace element from the backtrace stack.
@param int $index
@param array $trace
@return object|bool | [
"Parse",
"a",
"trace",
"element",
"from",
"the",
"backtrace",
"stack",
"."
] | b1e01f7994da47737866eabf82367490eab17c46 | https://github.com/songshenzong/log/blob/b1e01f7994da47737866eabf82367490eab17c46/src/DataCollector/QueryCollector.php#L236-L292 |
23,710 | weew/http | src/Weew/Http/HttpHeaders.php | HttpHeaders.find | public function find($key, $default = null) {
$key = $this->formatKey($key);
$headers = array_get($this->headers, $key, $default);
if (is_array($headers)) {
$headers = array_pop($headers);
}
return $headers;
} | php | public function find($key, $default = null) {
$key = $this->formatKey($key);
$headers = array_get($this->headers, $key, $default);
if (is_array($headers)) {
$headers = array_pop($headers);
}
return $headers;
} | [
"public",
"function",
"find",
"(",
"$",
"key",
",",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"formatKey",
"(",
"$",
"key",
")",
";",
"$",
"headers",
"=",
"array_get",
"(",
"$",
"this",
"->",
"headers",
",",
"$",
... | Find the last added header.
@param $key
@param null $default
@return string | [
"Find",
"the",
"last",
"added",
"header",
"."
] | fd34d3d5643ca01c8e0946e888224a8e8dcc3c0d | https://github.com/weew/http/blob/fd34d3d5643ca01c8e0946e888224a8e8dcc3c0d/src/Weew/Http/HttpHeaders.php#L56-L65 |
23,711 | weew/http | src/Weew/Http/HttpHeaders.php | HttpHeaders.set | public function set($key, $value) {
$key = $this->formatKey($key);
array_set($this->headers, $key, [$value]);
} | php | public function set($key, $value) {
$key = $this->formatKey($key);
array_set($this->headers, $key, [$value]);
} | [
"public",
"function",
"set",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"formatKey",
"(",
"$",
"key",
")",
";",
"array_set",
"(",
"$",
"this",
"->",
"headers",
",",
"$",
"key",
",",
"[",
"$",
"value",
"]",... | Replace all previous headers with this one.
@param $key
@param $value | [
"Replace",
"all",
"previous",
"headers",
"with",
"this",
"one",
"."
] | fd34d3d5643ca01c8e0946e888224a8e8dcc3c0d | https://github.com/weew/http/blob/fd34d3d5643ca01c8e0946e888224a8e8dcc3c0d/src/Weew/Http/HttpHeaders.php#L73-L76 |
23,712 | weew/http | src/Weew/Http/HttpHeaders.php | HttpHeaders.get | public function get($key) {
$key = $this->formatKey($key);
return array_get($this->headers, $key, []);
} | php | public function get($key) {
$key = $this->formatKey($key);
return array_get($this->headers, $key, []);
} | [
"public",
"function",
"get",
"(",
"$",
"key",
")",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"formatKey",
"(",
"$",
"key",
")",
";",
"return",
"array_get",
"(",
"$",
"this",
"->",
"headers",
",",
"$",
"key",
",",
"[",
"]",
")",
";",
"}"
] | Get all headers by key.
@param $key
@return array | [
"Get",
"all",
"headers",
"by",
"key",
"."
] | fd34d3d5643ca01c8e0946e888224a8e8dcc3c0d | https://github.com/weew/http/blob/fd34d3d5643ca01c8e0946e888224a8e8dcc3c0d/src/Weew/Http/HttpHeaders.php#L85-L88 |
23,713 | weew/http | src/Weew/Http/HttpHeaders.php | HttpHeaders.has | public function has($key) {
$key = $this->formatKey($key);
return array_has($this->headers, $key);
} | php | public function has($key) {
$key = $this->formatKey($key);
return array_has($this->headers, $key);
} | [
"public",
"function",
"has",
"(",
"$",
"key",
")",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"formatKey",
"(",
"$",
"key",
")",
";",
"return",
"array_has",
"(",
"$",
"this",
"->",
"headers",
",",
"$",
"key",
")",
";",
"}"
] | Check if there are any headers.
@param $key
@return bool | [
"Check",
"if",
"there",
"are",
"any",
"headers",
"."
] | fd34d3d5643ca01c8e0946e888224a8e8dcc3c0d | https://github.com/weew/http/blob/fd34d3d5643ca01c8e0946e888224a8e8dcc3c0d/src/Weew/Http/HttpHeaders.php#L97-L100 |
23,714 | weew/http | src/Weew/Http/HttpHeaders.php | HttpHeaders.remove | public function remove($key) {
$key = $this->formatKey($key);
array_remove($this->headers, $key);
} | php | public function remove($key) {
$key = $this->formatKey($key);
array_remove($this->headers, $key);
} | [
"public",
"function",
"remove",
"(",
"$",
"key",
")",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"formatKey",
"(",
"$",
"key",
")",
";",
"array_remove",
"(",
"$",
"this",
"->",
"headers",
",",
"$",
"key",
")",
";",
"}"
] | Remove all registered headers.
@param $key | [
"Remove",
"all",
"registered",
"headers",
"."
] | fd34d3d5643ca01c8e0946e888224a8e8dcc3c0d | https://github.com/weew/http/blob/fd34d3d5643ca01c8e0946e888224a8e8dcc3c0d/src/Weew/Http/HttpHeaders.php#L107-L110 |
23,715 | weew/http | src/Weew/Http/HttpHeaders.php | HttpHeaders.toFlatArray | public function toFlatArray() {
$array = [];
foreach ($this->headers as $key => $headers) {
foreach ($headers as $header) {
$array[] = $this->formatHeader($key, $header);
}
}
return $array;
} | php | public function toFlatArray() {
$array = [];
foreach ($this->headers as $key => $headers) {
foreach ($headers as $header) {
$array[] = $this->formatHeader($key, $header);
}
}
return $array;
} | [
"public",
"function",
"toFlatArray",
"(",
")",
"{",
"$",
"array",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"headers",
"as",
"$",
"key",
"=>",
"$",
"headers",
")",
"{",
"foreach",
"(",
"$",
"headers",
"as",
"$",
"header",
")",
"{",
"... | Get a list of formatted header strings.
@return array | [
"Get",
"a",
"list",
"of",
"formatted",
"header",
"strings",
"."
] | fd34d3d5643ca01c8e0946e888224a8e8dcc3c0d | https://github.com/weew/http/blob/fd34d3d5643ca01c8e0946e888224a8e8dcc3c0d/src/Weew/Http/HttpHeaders.php#L160-L170 |
23,716 | SporkCode/Spork | src/Mvc/Controller/AbstractRestfulTableController.php | AbstractRestfulTableController.toArray | protected function toArray($data)
{
if (is_array($data)) {
return $data;
}
if (is_object($data)) {
if (method_exists($data, 'toArray')) {
return $data->toArray();
}
if ($data instanceof \Traversable) {
return iterator_to_array($data);
... | php | protected function toArray($data)
{
if (is_array($data)) {
return $data;
}
if (is_object($data)) {
if (method_exists($data, 'toArray')) {
return $data->toArray();
}
if ($data instanceof \Traversable) {
return iterator_to_array($data);
... | [
"protected",
"function",
"toArray",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"data",
")",
")",
"{",
"return",
"$",
"data",
";",
"}",
"if",
"(",
"is_object",
"(",
"$",
"data",
")",
")",
"{",
"if",
"(",
"method_exists",
"(",
"$"... | Convert a result set to an array
@param unknown $data | [
"Convert",
"a",
"result",
"set",
"to",
"an",
"array"
] | 7f569efdc0ceb4a9c1c7a8b648b6a7ed50d2088a | https://github.com/SporkCode/Spork/blob/7f569efdc0ceb4a9c1c7a8b648b6a7ed50d2088a/src/Mvc/Controller/AbstractRestfulTableController.php#L120-L136 |
23,717 | loevgaard/altapay-php-sdk | src/Payload/PaymentRequest.php | PaymentRequest.parseCookieParts | public static function parseCookieParts(array $cookieParts)
{
$cookie = '';
foreach ($cookieParts as $key => $val) {
$cookie .= $key.'='.rawurlencode($val).';';
}
$cookie = trim($cookie, ';');
return $cookie;
} | php | public static function parseCookieParts(array $cookieParts)
{
$cookie = '';
foreach ($cookieParts as $key => $val) {
$cookie .= $key.'='.rawurlencode($val).';';
}
$cookie = trim($cookie, ';');
return $cookie;
} | [
"public",
"static",
"function",
"parseCookieParts",
"(",
"array",
"$",
"cookieParts",
")",
"{",
"$",
"cookie",
"=",
"''",
";",
"foreach",
"(",
"$",
"cookieParts",
"as",
"$",
"key",
"=>",
"$",
"val",
")",
"{",
"$",
"cookie",
".=",
"$",
"key",
".",
"'=... | Takes an array of cookie parts and returns an urlencoded string ready to send
@param array $cookieParts
@return string | [
"Takes",
"an",
"array",
"of",
"cookie",
"parts",
"and",
"returns",
"an",
"urlencoded",
"string",
"ready",
"to",
"send"
] | 476664e8725407249c04ca7ae76f92882e4f4583 | https://github.com/loevgaard/altapay-php-sdk/blob/476664e8725407249c04ca7ae76f92882e4f4583/src/Payload/PaymentRequest.php#L212-L221 |
23,718 | heidelpay/PhpDoc | src/phpDocumentor/Translator/ServiceProvider.php | ServiceProvider.register | public function register(Application $app)
{
/** @var ApplicationConfiguration $config */
$config = $app['config'];
$app['translator.locale'] = $config->getTranslator()->getLocale();
$app['translator'] = $app->share(
function ($app) {
$translator = new T... | php | public function register(Application $app)
{
/** @var ApplicationConfiguration $config */
$config = $app['config'];
$app['translator.locale'] = $config->getTranslator()->getLocale();
$app['translator'] = $app->share(
function ($app) {
$translator = new T... | [
"public",
"function",
"register",
"(",
"Application",
"$",
"app",
")",
"{",
"/** @var ApplicationConfiguration $config */",
"$",
"config",
"=",
"$",
"app",
"[",
"'config'",
"]",
";",
"$",
"app",
"[",
"'translator.locale'",
"]",
"=",
"$",
"config",
"->",
"getTr... | Registers the translator using the currently active locale.
@param Application $app | [
"Registers",
"the",
"translator",
"using",
"the",
"currently",
"active",
"locale",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Translator/ServiceProvider.php#L36-L51 |
23,719 | lukasz-adamski/teamspeak3-framework | src/TeamSpeak3/Node/Channel.php | Channel.clientGetById | public function clientGetById($clid)
{
if(!array_key_exists($clid, $this->clientList()))
{
throw new Exception("invalid clientID", 0x200);
}
return $this->clientList[intval($clid)];
} | php | public function clientGetById($clid)
{
if(!array_key_exists($clid, $this->clientList()))
{
throw new Exception("invalid clientID", 0x200);
}
return $this->clientList[intval($clid)];
} | [
"public",
"function",
"clientGetById",
"(",
"$",
"clid",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"clid",
",",
"$",
"this",
"->",
"clientList",
"(",
")",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"\"invalid clientID\"",
",",
"0x200"... | Returns the Client object matching the given ID.
@param integer $clid
@throws Exception
@return Client | [
"Returns",
"the",
"Client",
"object",
"matching",
"the",
"given",
"ID",
"."
] | 39a56eca608da6b56b6aa386a7b5b31dc576c41a | https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Node/Channel.php#L146-L154 |
23,720 | xiewulong/yii2-fileupload | oss/libs/symfony/event-dispatcher/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php | ContainerAwareEventDispatcher.lazyLoad | protected function lazyLoad($eventName)
{
if (isset($this->listenerIds[$eventName])) {
foreach ($this->listenerIds[$eventName] as $args) {
list($serviceId, $method, $priority) = $args;
$listener = $this->container->get($serviceId);
$key = $service... | php | protected function lazyLoad($eventName)
{
if (isset($this->listenerIds[$eventName])) {
foreach ($this->listenerIds[$eventName] as $args) {
list($serviceId, $method, $priority) = $args;
$listener = $this->container->get($serviceId);
$key = $service... | [
"protected",
"function",
"lazyLoad",
"(",
"$",
"eventName",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"listenerIds",
"[",
"$",
"eventName",
"]",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"listenerIds",
"[",
"$",
"eventName",
"]",
... | Lazily loads listeners for this event from the dependency injection
container.
@param string $eventName The name of the event to dispatch. The name of
the event is the name of the method that is
invoked on listeners. | [
"Lazily",
"loads",
"listeners",
"for",
"this",
"event",
"from",
"the",
"dependency",
"injection",
"container",
"."
] | 3e75b17a4a18dd8466e3f57c63136de03470ca82 | https://github.com/xiewulong/yii2-fileupload/blob/3e75b17a4a18dd8466e3f57c63136de03470ca82/oss/libs/symfony/event-dispatcher/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php#L183-L201 |
23,721 | CalderaWP/metaplate-core | src/render.php | render.helpers | private function helpers( $handlebars ) {
$helpers = $this->default_helpers();
/**
*
* @param array $helpers {
* Name, class & callback for the helper.
*
* @type string $name Name of helper to use in Handlebars.
* @type string $class Class containing callback function.
* @type ... | php | private function helpers( $handlebars ) {
$helpers = $this->default_helpers();
/**
*
* @param array $helpers {
* Name, class & callback for the helper.
*
* @type string $name Name of helper to use in Handlebars.
* @type string $class Class containing callback function.
* @type ... | [
"private",
"function",
"helpers",
"(",
"$",
"handlebars",
")",
"{",
"$",
"helpers",
"=",
"$",
"this",
"->",
"default_helpers",
"(",
")",
";",
"/**\n\t\t *\n\t\t * @param array $helpers {\n\t\t * Name, class & callback for the helper.\n\t\t *\n\t\t * @type string $name Nam... | Register helpers.
Adds the default helpers, plus any set on "caldera_metaplate_handlebars_helpers" filter.
@param obj|\Handlebars\Handlebars $handlebars Current instance of Handlebars.
@return \Handlebars\Handlebars Current instance of Handlebars with the additional helpers added on. | [
"Register",
"helpers",
"."
] | 15ede9c4250ab23112a32f8e45d5393f8278bbb8 | https://github.com/CalderaWP/metaplate-core/blob/15ede9c4250ab23112a32f8e45d5393f8278bbb8/src/render.php#L183-L207 |
23,722 | oroinc/OroLayoutComponent | Extension/AbstractExtension.php | AbstractExtension.initTypes | private function initTypes()
{
$this->types = [];
foreach ($this->loadTypes() as $type) {
if (!$type instanceof BlockTypeInterface) {
throw new Exception\UnexpectedTypeException(
$type,
'Oro\Component\Layout\BlockTypeInterface'
... | php | private function initTypes()
{
$this->types = [];
foreach ($this->loadTypes() as $type) {
if (!$type instanceof BlockTypeInterface) {
throw new Exception\UnexpectedTypeException(
$type,
'Oro\Component\Layout\BlockTypeInterface'
... | [
"private",
"function",
"initTypes",
"(",
")",
"{",
"$",
"this",
"->",
"types",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"loadTypes",
"(",
")",
"as",
"$",
"type",
")",
"{",
"if",
"(",
"!",
"$",
"type",
"instanceof",
"BlockTypeInterface",... | Initializes block types.
@throws Exception\UnexpectedTypeException if any registered block type is not
an instance of BlockTypeInterface | [
"Initializes",
"block",
"types",
"."
] | 682a96672393d81c63728e47c4a4c3618c515be0 | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/Extension/AbstractExtension.php#L278-L292 |
23,723 | oroinc/OroLayoutComponent | Extension/AbstractExtension.php | AbstractExtension.initTypeExtensions | private function initTypeExtensions()
{
$this->typeExtensions = [];
foreach ($this->loadTypeExtensions() as $extension) {
if (!$extension instanceof BlockTypeExtensionInterface) {
throw new Exception\UnexpectedTypeException(
$extension,
... | php | private function initTypeExtensions()
{
$this->typeExtensions = [];
foreach ($this->loadTypeExtensions() as $extension) {
if (!$extension instanceof BlockTypeExtensionInterface) {
throw new Exception\UnexpectedTypeException(
$extension,
... | [
"private",
"function",
"initTypeExtensions",
"(",
")",
"{",
"$",
"this",
"->",
"typeExtensions",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"loadTypeExtensions",
"(",
")",
"as",
"$",
"extension",
")",
"{",
"if",
"(",
"!",
"$",
"extension",
... | Initializes block type extensions.
@throws Exception\UnexpectedTypeException if any registered block type extension is not
an instance of BlockTypeExtensionInterface | [
"Initializes",
"block",
"type",
"extensions",
"."
] | 682a96672393d81c63728e47c4a4c3618c515be0 | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/Extension/AbstractExtension.php#L300-L316 |
23,724 | oroinc/OroLayoutComponent | Extension/AbstractExtension.php | AbstractExtension.initLayoutUpdates | private function initLayoutUpdates(ContextInterface $context)
{
$loadedLayoutUpdates = $this->loadLayoutUpdates($context);
foreach ($loadedLayoutUpdates as $id => $layoutUpdates) {
if (!is_string($id)) {
throw new Exception\UnexpectedTypeException(
$id... | php | private function initLayoutUpdates(ContextInterface $context)
{
$loadedLayoutUpdates = $this->loadLayoutUpdates($context);
foreach ($loadedLayoutUpdates as $id => $layoutUpdates) {
if (!is_string($id)) {
throw new Exception\UnexpectedTypeException(
$id... | [
"private",
"function",
"initLayoutUpdates",
"(",
"ContextInterface",
"$",
"context",
")",
"{",
"$",
"loadedLayoutUpdates",
"=",
"$",
"this",
"->",
"loadLayoutUpdates",
"(",
"$",
"context",
")",
";",
"foreach",
"(",
"$",
"loadedLayoutUpdates",
"as",
"$",
"id",
... | Initializes layout updates.
@param ContextInterface $context
@throws Exception\UnexpectedTypeException if any registered layout update is not
an instance of LayoutUpdateInterface
or layout item id is not a string | [
"Initializes",
"layout",
"updates",
"."
] | 682a96672393d81c63728e47c4a4c3618c515be0 | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/Extension/AbstractExtension.php#L327-L355 |
23,725 | oroinc/OroLayoutComponent | Extension/AbstractExtension.php | AbstractExtension.initContextConfigurators | private function initContextConfigurators()
{
$this->contextConfigurators = [];
foreach ($this->loadContextConfigurators() as $configurator) {
if (!$configurator instanceof ContextConfiguratorInterface) {
throw new Exception\UnexpectedTypeException(
$... | php | private function initContextConfigurators()
{
$this->contextConfigurators = [];
foreach ($this->loadContextConfigurators() as $configurator) {
if (!$configurator instanceof ContextConfiguratorInterface) {
throw new Exception\UnexpectedTypeException(
$... | [
"private",
"function",
"initContextConfigurators",
"(",
")",
"{",
"$",
"this",
"->",
"contextConfigurators",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"loadContextConfigurators",
"(",
")",
"as",
"$",
"configurator",
")",
"{",
"if",
"(",
"!",
"... | Initializes layout context configurators.
@throws Exception\UnexpectedTypeException if any registered context configurators is not
an instance of ContextConfiguratorInterface | [
"Initializes",
"layout",
"context",
"configurators",
"."
] | 682a96672393d81c63728e47c4a4c3618c515be0 | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/Extension/AbstractExtension.php#L363-L377 |
23,726 | oroinc/OroLayoutComponent | Extension/AbstractExtension.php | AbstractExtension.initDataProviders | private function initDataProviders()
{
$this->dataProviders = [];
foreach ($this->loadDataProviders() as $name => $dataProvider) {
$this->dataProviders[$name] = $dataProvider;
}
} | php | private function initDataProviders()
{
$this->dataProviders = [];
foreach ($this->loadDataProviders() as $name => $dataProvider) {
$this->dataProviders[$name] = $dataProvider;
}
} | [
"private",
"function",
"initDataProviders",
"(",
")",
"{",
"$",
"this",
"->",
"dataProviders",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"loadDataProviders",
"(",
")",
"as",
"$",
"name",
"=>",
"$",
"dataProvider",
")",
"{",
"$",
"this",
"-... | Initializes data providers. | [
"Initializes",
"data",
"providers",
"."
] | 682a96672393d81c63728e47c4a4c3618c515be0 | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/Extension/AbstractExtension.php#L382-L389 |
23,727 | josh-taylor/migrations-generator | src/SchemaArgumentBuilder.php | SchemaArgumentBuilder.create | public function create($schema)
{
$types = array_map(function ($column) {
return $column['name'] . ':' . $column['type'];
}, $schema);
return implode(', ', $types);
} | php | public function create($schema)
{
$types = array_map(function ($column) {
return $column['name'] . ':' . $column['type'];
}, $schema);
return implode(', ', $types);
} | [
"public",
"function",
"create",
"(",
"$",
"schema",
")",
"{",
"$",
"types",
"=",
"array_map",
"(",
"function",
"(",
"$",
"column",
")",
"{",
"return",
"$",
"column",
"[",
"'name'",
"]",
".",
"':'",
".",
"$",
"column",
"[",
"'type'",
"]",
";",
"}",
... | Return the argument string to use for the migration command.
@param $schema
@return string | [
"Return",
"the",
"argument",
"string",
"to",
"use",
"for",
"the",
"migration",
"command",
"."
] | bb6edc78773d11491881f12265a658bf058cb218 | https://github.com/josh-taylor/migrations-generator/blob/bb6edc78773d11491881f12265a658bf058cb218/src/SchemaArgumentBuilder.php#L13-L20 |
23,728 | PHPPowertools/HTML5 | src/PowerTools/HTML5/Parser/Scanner.php | HTML5_Parser_Scanner.next | public function next() {
$this->is->next();
if ($this->is->valid()) {
if ($this->debug)
fprintf(STDOUT, "> %s\n", $this->is->current());
return $this->is->current();
}
return false;
} | php | public function next() {
$this->is->next();
if ($this->is->valid()) {
if ($this->debug)
fprintf(STDOUT, "> %s\n", $this->is->current());
return $this->is->current();
}
return false;
} | [
"public",
"function",
"next",
"(",
")",
"{",
"$",
"this",
"->",
"is",
"->",
"next",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"is",
"->",
"valid",
"(",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"debug",
")",
"fprintf",
"(",
"STDOUT",
",... | Get the next character.
Note: This advances the pointer.
@return string The next character. | [
"Get",
"the",
"next",
"character",
"."
] | 4ea8caf5b2618a82ca5061dcbb7421b31065c1c7 | https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Scanner.php#L138-L147 |
23,729 | i-lateral/silverstripe-users | code/control/Users_Account_Controller.php | Users_Account_Controller.init | public function init()
{
parent::init();
// Check we are logged in as a user who can access front end management
if (!Permission::check("USERS_MANAGE_ACCOUNT")) {
Security::permissionFailure();
}
// Set our member object
$member = Member::currentUser();
... | php | public function init()
{
parent::init();
// Check we are logged in as a user who can access front end management
if (!Permission::check("USERS_MANAGE_ACCOUNT")) {
Security::permissionFailure();
}
// Set our member object
$member = Member::currentUser();
... | [
"public",
"function",
"init",
"(",
")",
"{",
"parent",
"::",
"init",
"(",
")",
";",
"// Check we are logged in as a user who can access front end management",
"if",
"(",
"!",
"Permission",
"::",
"check",
"(",
"\"USERS_MANAGE_ACCOUNT\"",
")",
")",
"{",
"Security",
":... | Perorm setup when this controller is initialised
@return void | [
"Perorm",
"setup",
"when",
"this",
"controller",
"is",
"initialised"
] | 27ddc38890fa2709ac419eccf854ab6b439f0d9a | https://github.com/i-lateral/silverstripe-users/blob/27ddc38890fa2709ac419eccf854ab6b439f0d9a/code/control/Users_Account_Controller.php#L83-L98 |
23,730 | i-lateral/silverstripe-users | code/control/Users_Account_Controller.php | Users_Account_Controller.index | public function index()
{
// Setup default profile summary sections
$sections = ArrayList::create();
$sections->push(
ArrayData::create(
array(
"Title" => "",
"Content" => $this->renderWith(
"UsersProfileSummary... | php | public function index()
{
// Setup default profile summary sections
$sections = ArrayList::create();
$sections->push(
ArrayData::create(
array(
"Title" => "",
"Content" => $this->renderWith(
"UsersProfileSummary... | [
"public",
"function",
"index",
"(",
")",
"{",
"// Setup default profile summary sections",
"$",
"sections",
"=",
"ArrayList",
"::",
"create",
"(",
")",
";",
"$",
"sections",
"->",
"push",
"(",
"ArrayData",
"::",
"create",
"(",
"array",
"(",
"\"Title\"",
"=>",
... | Display the currently outstanding orders for the current user
@return HTMLText | [
"Display",
"the",
"currently",
"outstanding",
"orders",
"for",
"the",
"current",
"user"
] | 27ddc38890fa2709ac419eccf854ab6b439f0d9a | https://github.com/i-lateral/silverstripe-users/blob/27ddc38890fa2709ac419eccf854ab6b439f0d9a/code/control/Users_Account_Controller.php#L174-L214 |
23,731 | i-lateral/silverstripe-users | code/control/Users_Account_Controller.php | Users_Account_Controller.ChangePasswordForm | public function ChangePasswordForm()
{
$form = ChangePasswordForm::create($this, "ChangePasswordForm");
$form
->Actions()
->find("name", "action_doChangePassword")
->addExtraClass("btn")
->addExtraClass("btn-green");
$cancel_btn = LiteralFiel... | php | public function ChangePasswordForm()
{
$form = ChangePasswordForm::create($this, "ChangePasswordForm");
$form
->Actions()
->find("name", "action_doChangePassword")
->addExtraClass("btn")
->addExtraClass("btn-green");
$cancel_btn = LiteralFiel... | [
"public",
"function",
"ChangePasswordForm",
"(",
")",
"{",
"$",
"form",
"=",
"ChangePasswordForm",
"::",
"create",
"(",
"$",
"this",
",",
"\"ChangePasswordForm\"",
")",
";",
"$",
"form",
"->",
"Actions",
"(",
")",
"->",
"find",
"(",
"\"name\"",
",",
"\"act... | Factory for generating a change password form. The form can be expanded
using an extension class and calling the updateChangePasswordForm method.
@return Form | [
"Factory",
"for",
"generating",
"a",
"change",
"password",
"form",
".",
"The",
"form",
"can",
"be",
"expanded",
"using",
"an",
"extension",
"class",
"and",
"calling",
"the",
"updateChangePasswordForm",
"method",
"."
] | 27ddc38890fa2709ac419eccf854ab6b439f0d9a | https://github.com/i-lateral/silverstripe-users/blob/27ddc38890fa2709ac419eccf854ab6b439f0d9a/code/control/Users_Account_Controller.php#L305-L327 |
23,732 | i-lateral/silverstripe-users | code/control/Users_Account_Controller.php | Users_Account_Controller.getAccountMenu | public function getAccountMenu()
{
$menu = ArrayList::create();
$curr_action = $this->request->param("Action");
$menu->add(
ArrayData::create(
array(
"ID" => 0,
"Title" => _t('Users.PROFILESUMMARY', "Profile Summary"),
... | php | public function getAccountMenu()
{
$menu = ArrayList::create();
$curr_action = $this->request->param("Action");
$menu->add(
ArrayData::create(
array(
"ID" => 0,
"Title" => _t('Users.PROFILESUMMARY', "Profile Summary"),
... | [
"public",
"function",
"getAccountMenu",
"(",
")",
"{",
"$",
"menu",
"=",
"ArrayList",
"::",
"create",
"(",
")",
";",
"$",
"curr_action",
"=",
"$",
"this",
"->",
"request",
"->",
"param",
"(",
"\"Action\"",
")",
";",
"$",
"menu",
"->",
"add",
"(",
"Ar... | Return a list of nav items for managing a users profile. You can add new
items to this menu using the "updateAccountMenu" extension
@return ArrayList | [
"Return",
"a",
"list",
"of",
"nav",
"items",
"for",
"managing",
"a",
"users",
"profile",
".",
"You",
"can",
"add",
"new",
"items",
"to",
"this",
"menu",
"using",
"the",
"updateAccountMenu",
"extension"
] | 27ddc38890fa2709ac419eccf854ab6b439f0d9a | https://github.com/i-lateral/silverstripe-users/blob/27ddc38890fa2709ac419eccf854ab6b439f0d9a/code/control/Users_Account_Controller.php#L335-L377 |
23,733 | arndtteunissen/column-layout | Classes/Hook/ColumnConfigurationGridsystemFlexFormHook.php | ColumnConfigurationGridsystemFlexFormHook.getDataStructureIdentifierPreProcess | public function getDataStructureIdentifierPreProcess(array $fieldTca, string $tableName, string $fieldName, array $row): array
{
if ($tableName != 'tt_content' || $fieldName != 'tx_column_layout_column_config') {
return [];
}
return [
'type' => 'tca',
'ta... | php | public function getDataStructureIdentifierPreProcess(array $fieldTca, string $tableName, string $fieldName, array $row): array
{
if ($tableName != 'tt_content' || $fieldName != 'tx_column_layout_column_config') {
return [];
}
return [
'type' => 'tca',
'ta... | [
"public",
"function",
"getDataStructureIdentifierPreProcess",
"(",
"array",
"$",
"fieldTca",
",",
"string",
"$",
"tableName",
",",
"string",
"$",
"fieldName",
",",
"array",
"$",
"row",
")",
":",
"array",
"{",
"if",
"(",
"$",
"tableName",
"!=",
"'tt_content'",
... | Generates a DataStructureIdentifier for the flexform in column configuration field
@param array $fieldTca
@param string $tableName
@param string $fieldName
@param array $row
@return array
@throws \TYPO3\CMS\Core\Exception | [
"Generates",
"a",
"DataStructureIdentifier",
"for",
"the",
"flexform",
"in",
"column",
"configuration",
"field"
] | ad737068eef3b084d4d0e3a48e6a3d8277af9560 | https://github.com/arndtteunissen/column-layout/blob/ad737068eef3b084d4d0e3a48e6a3d8277af9560/Classes/Hook/ColumnConfigurationGridsystemFlexFormHook.php#L32-L44 |
23,734 | heidelpay/PhpDoc | src/phpDocumentor/Plugin/Core/Transformer/Writer/Xsl.php | Xsl.transform | public function transform(ProjectDescriptor $project, Transformation $transformation)
{
$structure = $this->loadAst($this->getAstPath($transformation));
$proc = $this->getXslProcessor($transformation);
$proc->registerPHPFunctions();
$this->registerDefaultVariables($transformation, $... | php | public function transform(ProjectDescriptor $project, Transformation $transformation)
{
$structure = $this->loadAst($this->getAstPath($transformation));
$proc = $this->getXslProcessor($transformation);
$proc->registerPHPFunctions();
$this->registerDefaultVariables($transformation, $... | [
"public",
"function",
"transform",
"(",
"ProjectDescriptor",
"$",
"project",
",",
"Transformation",
"$",
"transformation",
")",
"{",
"$",
"structure",
"=",
"$",
"this",
"->",
"loadAst",
"(",
"$",
"this",
"->",
"getAstPath",
"(",
"$",
"transformation",
")",
"... | This method combines the structure.xml and the given target template
and creates a static html page at the artifact location.
@param ProjectDescriptor $project Document containing the structure.
@param Transformation $transformation Transformation to execute.
@throws \RuntimeException if the structure.xml f... | [
"This",
"method",
"combines",
"the",
"structure",
".",
"xml",
"and",
"the",
"given",
"target",
"template",
"and",
"creates",
"a",
"static",
"html",
"page",
"at",
"the",
"artifact",
"location",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Core/Transformer/Writer/Xsl.php#L96-L158 |
23,735 | heidelpay/PhpDoc | src/phpDocumentor/Plugin/Core/Transformer/Writer/Xsl.php | Xsl.getXsltUriFromFilename | protected function getXsltUriFromFilename($filename)
{
// Windows requires an additional / after the scheme. If not provided then errno 22 (I/O Error: Invalid
// Argument) will be raised. Thanks to @FnTmLV for finding the cause. See issue #284 for more information.
// An exception to the abo... | php | protected function getXsltUriFromFilename($filename)
{
// Windows requires an additional / after the scheme. If not provided then errno 22 (I/O Error: Invalid
// Argument) will be raised. Thanks to @FnTmLV for finding the cause. See issue #284 for more information.
// An exception to the abo... | [
"protected",
"function",
"getXsltUriFromFilename",
"(",
"$",
"filename",
")",
"{",
"// Windows requires an additional / after the scheme. If not provided then errno 22 (I/O Error: Invalid",
"// Argument) will be raised. Thanks to @FnTmLV for finding the cause. See issue #284 for more information."... | Takes the filename and converts it into a correct URI for XSLTProcessor.
@param string $filename
@return string | [
"Takes",
"the",
"filename",
"and",
"converts",
"it",
"into",
"a",
"correct",
"URI",
"for",
"XSLTProcessor",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Core/Transformer/Writer/Xsl.php#L167-L178 |
23,736 | david-mk/mail-map | src/MailMap/ConnectionFactory.php | ConnectionFactory.create | public function create($inbox = 'INBOX')
{
$stream = imap_open($this->connectionString($inbox), $this->user, $this->password);
return new Connection($stream);
} | php | public function create($inbox = 'INBOX')
{
$stream = imap_open($this->connectionString($inbox), $this->user, $this->password);
return new Connection($stream);
} | [
"public",
"function",
"create",
"(",
"$",
"inbox",
"=",
"'INBOX'",
")",
"{",
"$",
"stream",
"=",
"imap_open",
"(",
"$",
"this",
"->",
"connectionString",
"(",
"$",
"inbox",
")",
",",
"$",
"this",
"->",
"user",
",",
"$",
"this",
"->",
"password",
")",... | Create new IMAP connection
@param string $inbox
@return \MailMap\Contracts\ConnectionContract | [
"Create",
"new",
"IMAP",
"connection"
] | 4eea346ece9fa35c0d309b5a909f657ad83e1e6a | https://github.com/david-mk/mail-map/blob/4eea346ece9fa35c0d309b5a909f657ad83e1e6a/src/MailMap/ConnectionFactory.php#L88-L93 |
23,737 | david-mk/mail-map | src/MailMap/ConnectionFactory.php | ConnectionFactory.mailboxes | public function mailboxes($mailboxSearch = '*', $withConnection = false)
{
$connectionString = $this->connectionString();
$stream = imap_open($connectionString, $this->user, $this->password);
$mailboxes = imap_list($stream, $connectionString, $mailboxSearch);
if ($withConnection) {
... | php | public function mailboxes($mailboxSearch = '*', $withConnection = false)
{
$connectionString = $this->connectionString();
$stream = imap_open($connectionString, $this->user, $this->password);
$mailboxes = imap_list($stream, $connectionString, $mailboxSearch);
if ($withConnection) {
... | [
"public",
"function",
"mailboxes",
"(",
"$",
"mailboxSearch",
"=",
"'*'",
",",
"$",
"withConnection",
"=",
"false",
")",
"{",
"$",
"connectionString",
"=",
"$",
"this",
"->",
"connectionString",
"(",
")",
";",
"$",
"stream",
"=",
"imap_open",
"(",
"$",
"... | Get a list of mailboxes on the mail server.
@param string $mailboxSearch Pattern from http://php.net/manual/en/function.imap-list.php
@param bool $withConnection Will strip off connection string from mailboxes by default
@return array List of mailboxes | [
"Get",
"a",
"list",
"of",
"mailboxes",
"on",
"the",
"mail",
"server",
"."
] | 4eea346ece9fa35c0d309b5a909f657ad83e1e6a | https://github.com/david-mk/mail-map/blob/4eea346ece9fa35c0d309b5a909f657ad83e1e6a/src/MailMap/ConnectionFactory.php#L102-L115 |
23,738 | david-mk/mail-map | src/MailMap/ConnectionFactory.php | ConnectionFactory.connectionString | protected function connectionString($inbox = '')
{
return sprintf(static::$connectionFormat, $this->host, $this->port, $this->service, $this->enc, $inbox);
} | php | protected function connectionString($inbox = '')
{
return sprintf(static::$connectionFormat, $this->host, $this->port, $this->service, $this->enc, $inbox);
} | [
"protected",
"function",
"connectionString",
"(",
"$",
"inbox",
"=",
"''",
")",
"{",
"return",
"sprintf",
"(",
"static",
"::",
"$",
"connectionFormat",
",",
"$",
"this",
"->",
"host",
",",
"$",
"this",
"->",
"port",
",",
"$",
"this",
"->",
"service",
"... | Make the IMAP connection string from configuration
@param string $inbox
@return string The connection string | [
"Make",
"the",
"IMAP",
"connection",
"string",
"from",
"configuration"
] | 4eea346ece9fa35c0d309b5a909f657ad83e1e6a | https://github.com/david-mk/mail-map/blob/4eea346ece9fa35c0d309b5a909f657ad83e1e6a/src/MailMap/ConnectionFactory.php#L123-L126 |
23,739 | mridang/magazine | lib/magento/Archive/Helper/File.php | Mage_Archive_Helper_File.read | public function read($length = 4096)
{
$data = false;
$this->_checkFileOpened();
if ($length > 0) {
$data = $this->_read($length);
}
return $data;
} | php | public function read($length = 4096)
{
$data = false;
$this->_checkFileOpened();
if ($length > 0) {
$data = $this->_read($length);
}
return $data;
} | [
"public",
"function",
"read",
"(",
"$",
"length",
"=",
"4096",
")",
"{",
"$",
"data",
"=",
"false",
";",
"$",
"this",
"->",
"_checkFileOpened",
"(",
")",
";",
"if",
"(",
"$",
"length",
">",
"0",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"_... | Read data from file
@param int $length
@return string|boolean | [
"Read",
"data",
"from",
"file"
] | 5b3cfecc472c61fde6af63efe62690a30a267a04 | https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Archive/Helper/File.php#L146-L155 |
23,740 | mridang/magazine | lib/magento/Archive/Helper/File.php | Mage_Archive_Helper_File._open | protected function _open($mode)
{
$this->_fileHandler = @fopen($this->_filePath, $mode);
if (false === $this->_fileHandler) {
throw new Mage_Exception('Failed to open file ' . $this->_filePath);
}
} | php | protected function _open($mode)
{
$this->_fileHandler = @fopen($this->_filePath, $mode);
if (false === $this->_fileHandler) {
throw new Mage_Exception('Failed to open file ' . $this->_filePath);
}
} | [
"protected",
"function",
"_open",
"(",
"$",
"mode",
")",
"{",
"$",
"this",
"->",
"_fileHandler",
"=",
"@",
"fopen",
"(",
"$",
"this",
"->",
"_filePath",
",",
"$",
"mode",
")",
";",
"if",
"(",
"false",
"===",
"$",
"this",
"->",
"_fileHandler",
")",
... | Implementation of file opening
@param string $mode
@throws Mage_Exception | [
"Implementation",
"of",
"file",
"opening"
] | 5b3cfecc472c61fde6af63efe62690a30a267a04 | https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Archive/Helper/File.php#L185-L192 |
23,741 | mridang/magazine | lib/magento/Archive/Helper/File.php | Mage_Archive_Helper_File._write | protected function _write($data)
{
$result = @fwrite($this->_fileHandler, $data);
if (false === $result) {
throw new Mage_Exception('Failed to write data to ' . $this->_filePath);
}
} | php | protected function _write($data)
{
$result = @fwrite($this->_fileHandler, $data);
if (false === $result) {
throw new Mage_Exception('Failed to write data to ' . $this->_filePath);
}
} | [
"protected",
"function",
"_write",
"(",
"$",
"data",
")",
"{",
"$",
"result",
"=",
"@",
"fwrite",
"(",
"$",
"this",
"->",
"_fileHandler",
",",
"$",
"data",
")",
";",
"if",
"(",
"false",
"===",
"$",
"result",
")",
"{",
"throw",
"new",
"Mage_Exception"... | Implementation of writing data to file
@param string $data
@throws Mage_Exception | [
"Implementation",
"of",
"writing",
"data",
"to",
"file"
] | 5b3cfecc472c61fde6af63efe62690a30a267a04 | https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Archive/Helper/File.php#L200-L207 |
23,742 | mridang/magazine | lib/magento/Archive/Helper/File.php | Mage_Archive_Helper_File._read | protected function _read($length)
{
$result = fread($this->_fileHandler, $length);
if (false === $result) {
throw new Mage_Exception('Failed to read data from ' . $this->_filePath);
}
return $result;
} | php | protected function _read($length)
{
$result = fread($this->_fileHandler, $length);
if (false === $result) {
throw new Mage_Exception('Failed to read data from ' . $this->_filePath);
}
return $result;
} | [
"protected",
"function",
"_read",
"(",
"$",
"length",
")",
"{",
"$",
"result",
"=",
"fread",
"(",
"$",
"this",
"->",
"_fileHandler",
",",
"$",
"length",
")",
";",
"if",
"(",
"false",
"===",
"$",
"result",
")",
"{",
"throw",
"new",
"Mage_Exception",
"... | Implementation of file reading
@param int $length
@throws Mage_Exception | [
"Implementation",
"of",
"file",
"reading"
] | 5b3cfecc472c61fde6af63efe62690a30a267a04 | https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Archive/Helper/File.php#L215-L224 |
23,743 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/parts/multipart.php | ezcMailMultipart.generateBody | public function generateBody()
{
$data = $this->noMimeMessage . ezcMailTools::lineBreak();
foreach ( $this->parts as $part )
{
$data .= ezcMailTools::lineBreak() . '--' . $this->boundary . ezcMailTools::lineBreak();
$data .= $part->generate();
}
$data ... | php | public function generateBody()
{
$data = $this->noMimeMessage . ezcMailTools::lineBreak();
foreach ( $this->parts as $part )
{
$data .= ezcMailTools::lineBreak() . '--' . $this->boundary . ezcMailTools::lineBreak();
$data .= $part->generate();
}
$data ... | [
"public",
"function",
"generateBody",
"(",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"noMimeMessage",
".",
"ezcMailTools",
"::",
"lineBreak",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"parts",
"as",
"$",
"part",
")",
"{",
"$",
"data",
".... | Returns the generated body for all multipart types.
@return string | [
"Returns",
"the",
"generated",
"body",
"for",
"all",
"multipart",
"types",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/parts/multipart.php#L167-L177 |
23,744 | Laralum/Events | src/Models/Event.php | Event.hasResponsible | public function hasResponsible($user)
{
return $this->users()->where('user_id', $user->id)->first()->pivot->responsible;
} | php | public function hasResponsible($user)
{
return $this->users()->where('user_id', $user->id)->first()->pivot->responsible;
} | [
"public",
"function",
"hasResponsible",
"(",
"$",
"user",
")",
"{",
"return",
"$",
"this",
"->",
"users",
"(",
")",
"->",
"where",
"(",
"'user_id'",
",",
"$",
"user",
"->",
"id",
")",
"->",
"first",
"(",
")",
"->",
"pivot",
"->",
"responsible",
";",
... | Returns true if the event have the specified user as responsible.
@param mixed $user | [
"Returns",
"true",
"if",
"the",
"event",
"have",
"the",
"specified",
"user",
"as",
"responsible",
"."
] | 9dc36468f4253e7d040863a115ea94cded0e6aa5 | https://github.com/Laralum/Events/blob/9dc36468f4253e7d040863a115ea94cded0e6aa5/src/Models/Event.php#L58-L61 |
23,745 | Laralum/Events | src/Models/Event.php | Event.startDatetime | public function startDatetime()
{
$date = explode('-', $this->start_date);
$time = explode(':', $this->start_time);
$start_datetime = Carbon::create($date[0], $date[1], $date[2], $time[0], $time[1]);
return $start_datetime;
} | php | public function startDatetime()
{
$date = explode('-', $this->start_date);
$time = explode(':', $this->start_time);
$start_datetime = Carbon::create($date[0], $date[1], $date[2], $time[0], $time[1]);
return $start_datetime;
} | [
"public",
"function",
"startDatetime",
"(",
")",
"{",
"$",
"date",
"=",
"explode",
"(",
"'-'",
",",
"$",
"this",
"->",
"start_date",
")",
";",
"$",
"time",
"=",
"explode",
"(",
"':'",
",",
"$",
"this",
"->",
"start_time",
")",
";",
"$",
"start_dateti... | Get Carbon start datetime.
@return \Carbon\Carbon | [
"Get",
"Carbon",
"start",
"datetime",
"."
] | 9dc36468f4253e7d040863a115ea94cded0e6aa5 | https://github.com/Laralum/Events/blob/9dc36468f4253e7d040863a115ea94cded0e6aa5/src/Models/Event.php#L150-L157 |
23,746 | Laralum/Events | src/Models/Event.php | Event.endDatetime | public function endDatetime()
{
$date = explode('-', $this->end_date);
$time = explode(':', $this->end_time);
$end_datetime = Carbon::create($date[0], $date[1], $date[2], $time[0], $time[1]);
return $end_datetime;
} | php | public function endDatetime()
{
$date = explode('-', $this->end_date);
$time = explode(':', $this->end_time);
$end_datetime = Carbon::create($date[0], $date[1], $date[2], $time[0], $time[1]);
return $end_datetime;
} | [
"public",
"function",
"endDatetime",
"(",
")",
"{",
"$",
"date",
"=",
"explode",
"(",
"'-'",
",",
"$",
"this",
"->",
"end_date",
")",
";",
"$",
"time",
"=",
"explode",
"(",
"':'",
",",
"$",
"this",
"->",
"end_time",
")",
";",
"$",
"end_datetime",
"... | Get Carbon end datetime.
@return \Carbon\Carbon | [
"Get",
"Carbon",
"end",
"datetime",
"."
] | 9dc36468f4253e7d040863a115ea94cded0e6aa5 | https://github.com/Laralum/Events/blob/9dc36468f4253e7d040863a115ea94cded0e6aa5/src/Models/Event.php#L164-L171 |
23,747 | lukasz-adamski/teamspeak3-framework | src/TeamSpeak3/Adapter/ServerQuery.php | ServerQuery.syn | protected function syn()
{
$this->initTransport($this->options);
$this->transport->setAdapter($this);
Profiler::init(spl_object_hash($this));
$rdy = $this->getTransport()->readLine();
if(!$rdy->startsWith(TeamSpeak3::TS3_PROTO_IDENT) && !$rdy->startsWith(TeamSpeak3::TEA_PROTO_IDENT) && !(define... | php | protected function syn()
{
$this->initTransport($this->options);
$this->transport->setAdapter($this);
Profiler::init(spl_object_hash($this));
$rdy = $this->getTransport()->readLine();
if(!$rdy->startsWith(TeamSpeak3::TS3_PROTO_IDENT) && !$rdy->startsWith(TeamSpeak3::TEA_PROTO_IDENT) && !(define... | [
"protected",
"function",
"syn",
"(",
")",
"{",
"$",
"this",
"->",
"initTransport",
"(",
"$",
"this",
"->",
"options",
")",
";",
"$",
"this",
"->",
"transport",
"->",
"setAdapter",
"(",
"$",
"this",
")",
";",
"Profiler",
"::",
"init",
"(",
"spl_object_h... | Connects the Transport object and performs initial actions on the remote
server.
@throws AdapterException
@return void | [
"Connects",
"the",
"Transport",
"object",
"and",
"performs",
"initial",
"actions",
"on",
"the",
"remote",
"server",
"."
] | 39a56eca608da6b56b6aa386a7b5b31dc576c41a | https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Adapter/ServerQuery.php#L81-L96 |
23,748 | ronaldborla/chikka | src/Borla/Chikka/Models/Cost.php | Cost.adjust | public function adjust(Carrier $carrier = null) {
// If there's carrier
if ($carrier !== null) {
// Set carrier
$this->carrier = $carrier;
}
// If there's no carrier
if ( ! isset($this->carrier)) {
// Throw error
throw new MissingCarrier('Carrier is required to adjust cost');... | php | public function adjust(Carrier $carrier = null) {
// If there's carrier
if ($carrier !== null) {
// Set carrier
$this->carrier = $carrier;
}
// If there's no carrier
if ( ! isset($this->carrier)) {
// Throw error
throw new MissingCarrier('Carrier is required to adjust cost');... | [
"public",
"function",
"adjust",
"(",
"Carrier",
"$",
"carrier",
"=",
"null",
")",
"{",
"// If there's carrier",
"if",
"(",
"$",
"carrier",
"!==",
"null",
")",
"{",
"// Set carrier",
"$",
"this",
"->",
"carrier",
"=",
"$",
"carrier",
";",
"}",
"// If there'... | Adjust cost amount for a given carrier | [
"Adjust",
"cost",
"amount",
"for",
"a",
"given",
"carrier"
] | 446987706f81d5a0efbc8bd6b7d3b259d0527719 | https://github.com/ronaldborla/chikka/blob/446987706f81d5a0efbc8bd6b7d3b259d0527719/src/Borla/Chikka/Models/Cost.php#L79-L109 |
23,749 | ronaldborla/chikka | src/Borla/Chikka/Models/Cost.php | Cost.fix | public function fix($mobileOrCarrier) {
// If instance of carrier
if ($mobileOrCarrier instanceof Carrier) {
// Use
$this->carrier = $mobileOrCarrier;
}
// If instance of mobile
elseif ($mobileOrCarrier instanceof Mobile) {
// Get carrier
$this->carrier = $mobileOrCarrier->ca... | php | public function fix($mobileOrCarrier) {
// If instance of carrier
if ($mobileOrCarrier instanceof Carrier) {
// Use
$this->carrier = $mobileOrCarrier;
}
// If instance of mobile
elseif ($mobileOrCarrier instanceof Mobile) {
// Get carrier
$this->carrier = $mobileOrCarrier->ca... | [
"public",
"function",
"fix",
"(",
"$",
"mobileOrCarrier",
")",
"{",
"// If instance of carrier",
"if",
"(",
"$",
"mobileOrCarrier",
"instanceof",
"Carrier",
")",
"{",
"// Use",
"$",
"this",
"->",
"carrier",
"=",
"$",
"mobileOrCarrier",
";",
"}",
"// If instance ... | Fix cost by mobile or carrier
@param int|string|Mobile|Carrier $mobileOrCarrier Can be mobile number or instance of Mobile or Carrier | [
"Fix",
"cost",
"by",
"mobile",
"or",
"carrier"
] | 446987706f81d5a0efbc8bd6b7d3b259d0527719 | https://github.com/ronaldborla/chikka/blob/446987706f81d5a0efbc8bd6b7d3b259d0527719/src/Borla/Chikka/Models/Cost.php#L115-L133 |
23,750 | KodiComponents/Support | src/Http/CollectionFilters.php | CollectionFilters.apply | public function apply(Collection $collection)
{
$this->collection = $collection;
foreach ($this->filters() as $name => $value) {
if (! method_exists($this, $name)) {
continue;
}
if (is_array($value) or trim($value)) {
$this->colle... | php | public function apply(Collection $collection)
{
$this->collection = $collection;
foreach ($this->filters() as $name => $value) {
if (! method_exists($this, $name)) {
continue;
}
if (is_array($value) or trim($value)) {
$this->colle... | [
"public",
"function",
"apply",
"(",
"Collection",
"$",
"collection",
")",
"{",
"$",
"this",
"->",
"collection",
"=",
"$",
"collection",
";",
"foreach",
"(",
"$",
"this",
"->",
"filters",
"(",
")",
"as",
"$",
"name",
"=>",
"$",
"value",
")",
"{",
"if"... | Apply the filters to the collection.
@param Collection $collection
@return Collection | [
"Apply",
"the",
"filters",
"to",
"the",
"collection",
"."
] | 9090543605a2354c7454d707650a0abdb815b60a | https://github.com/KodiComponents/Support/blob/9090543605a2354c7454d707650a0abdb815b60a/src/Http/CollectionFilters.php#L41-L58 |
23,751 | ekuiter/feature-php | FeaturePhp/Generator/FileGenerator.php | FileGenerator.getFileOrDirectorySettings | private function getFileOrDirectorySettings($settings, $key) {
$filesOrDirectories = $settings->getOptional($key, array());
if (!is_array($filesOrDirectories))
$filesOrDirectories = array($filesOrDirectories);
return $filesOrDirectories;
} | php | private function getFileOrDirectorySettings($settings, $key) {
$filesOrDirectories = $settings->getOptional($key, array());
if (!is_array($filesOrDirectories))
$filesOrDirectories = array($filesOrDirectories);
return $filesOrDirectories;
} | [
"private",
"function",
"getFileOrDirectorySettings",
"(",
"$",
"settings",
",",
"$",
"key",
")",
"{",
"$",
"filesOrDirectories",
"=",
"$",
"settings",
"->",
"getOptional",
"(",
"$",
"key",
",",
"array",
"(",
")",
")",
";",
"if",
"(",
"!",
"is_array",
"("... | Returns plain settings arrays with file or directory specifications.
@param Settings $settings
@param string $key
@return array[] | [
"Returns",
"plain",
"settings",
"arrays",
"with",
"file",
"or",
"directory",
"specifications",
"."
] | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Generator/FileGenerator.php#L35-L40 |
23,752 | ekuiter/feature-php | FeaturePhp/Generator/FileGenerator.php | FileGenerator._generateFiles | protected function _generateFiles() {
foreach ($this->selectedArtifacts as $artifact) {
$settings = $artifact->getGeneratorSettings(static::getKey());
foreach ($this->getFileOrDirectorySettings($settings, "files") as $file)
$this->_processFileSpecification(
... | php | protected function _generateFiles() {
foreach ($this->selectedArtifacts as $artifact) {
$settings = $artifact->getGeneratorSettings(static::getKey());
foreach ($this->getFileOrDirectorySettings($settings, "files") as $file)
$this->_processFileSpecification(
... | [
"protected",
"function",
"_generateFiles",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"selectedArtifacts",
"as",
"$",
"artifact",
")",
"{",
"$",
"settings",
"=",
"$",
"artifact",
"->",
"getGeneratorSettings",
"(",
"static",
"::",
"getKey",
"(",
")",
... | Processes the files and directories. | [
"Processes",
"the",
"files",
"and",
"directories",
"."
] | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Generator/FileGenerator.php#L45-L60 |
23,753 | ekuiter/feature-php | FeaturePhp/Generator/FileGenerator.php | FileGenerator._processFileSpecification | private function _processFileSpecification($artifact, $fileSpecification) {
if (!in_array(basename($fileSpecification->getSource()), $this->exclude))
$this->processFileSpecification($artifact, $fileSpecification);
} | php | private function _processFileSpecification($artifact, $fileSpecification) {
if (!in_array(basename($fileSpecification->getSource()), $this->exclude))
$this->processFileSpecification($artifact, $fileSpecification);
} | [
"private",
"function",
"_processFileSpecification",
"(",
"$",
"artifact",
",",
"$",
"fileSpecification",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"basename",
"(",
"$",
"fileSpecification",
"->",
"getSource",
"(",
")",
")",
",",
"$",
"this",
"->",
"exclude"... | Processes a file from a specification.
Considers globally excluded files. Only exact file names are supported.
@param \FeaturePhp\Artifact\Artifact $artifact
@param \FeaturePhp\Specification\FileSpecification $fileSpecification | [
"Processes",
"a",
"file",
"from",
"a",
"specification",
".",
"Considers",
"globally",
"excluded",
"files",
".",
"Only",
"exact",
"file",
"names",
"are",
"supported",
"."
] | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Generator/FileGenerator.php#L68-L71 |
23,754 | inhere/php-librarys | src/Traits/LiteContainerStaticTrait.php | LiteContainerStaticTrait.get | public static function get($name, $call = true)
{
if (!isset(self::$services[$name])) {
throw new \RuntimeException("The service [$name] don't register.");
}
$service = self::$services[$name];
if (\is_object($service) && $service instanceof \Closure && $call) {
... | php | public static function get($name, $call = true)
{
if (!isset(self::$services[$name])) {
throw new \RuntimeException("The service [$name] don't register.");
}
$service = self::$services[$name];
if (\is_object($service) && $service instanceof \Closure && $call) {
... | [
"public",
"static",
"function",
"get",
"(",
"$",
"name",
",",
"$",
"call",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"services",
"[",
"$",
"name",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"\... | get a app service by name
if is a closure, only run once.
@param string $name
@param bool $call if service is 'Closure', call it.
@return mixed
@throws \RuntimeException | [
"get",
"a",
"app",
"service",
"by",
"name",
"if",
"is",
"a",
"closure",
"only",
"run",
"once",
"."
] | e6ca598685469794f310e3ab0e2bc19519cd0ae6 | https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Traits/LiteContainerStaticTrait.php#L76-L93 |
23,755 | inhere/php-librarys | src/Traits/LiteContainerStaticTrait.php | LiteContainerStaticTrait.factory | public static function factory($name)
{
if (!isset(self::$services[$name])) {
throw new \RuntimeException("The service [$name] don't register.");
}
$service = self::$services[$name];
if (\is_object($service) && method_exists($service, '__invoke')) {
return $... | php | public static function factory($name)
{
if (!isset(self::$services[$name])) {
throw new \RuntimeException("The service [$name] don't register.");
}
$service = self::$services[$name];
if (\is_object($service) && method_exists($service, '__invoke')) {
return $... | [
"public",
"static",
"function",
"factory",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"services",
"[",
"$",
"name",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"\"The service [$name] don't register.\... | create a app service by name
it always return a new instance.
@param string $name
@return mixed
@throws \RuntimeException | [
"create",
"a",
"app",
"service",
"by",
"name",
"it",
"always",
"return",
"a",
"new",
"instance",
"."
] | e6ca598685469794f310e3ab0e2bc19519cd0ae6 | https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Traits/LiteContainerStaticTrait.php#L116-L129 |
23,756 | i-lateral/silverstripe-modeladminplus | src/ModelAdminSnippet.php | ModelAdminSnippet.addExtraClasses | public function addExtraClasses($classes)
{
if (!is_array($classes)) {
$classes = explode(" ", $classes);
}
$this->extra_classes = array_merge(
$this->extra_classes,
$classes
);
return $this;
} | php | public function addExtraClasses($classes)
{
if (!is_array($classes)) {
$classes = explode(" ", $classes);
}
$this->extra_classes = array_merge(
$this->extra_classes,
$classes
);
return $this;
} | [
"public",
"function",
"addExtraClasses",
"(",
"$",
"classes",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"classes",
")",
")",
"{",
"$",
"classes",
"=",
"explode",
"(",
"\" \"",
",",
"$",
"classes",
")",
";",
"}",
"$",
"this",
"->",
"extra_classe... | Add additional css classes
@param array|string $extra_classes extra CSS classes
@return self | [
"Add",
"additional",
"css",
"classes"
] | c5209d9610cdb36ddc7b9231fad342df7e75ffc0 | https://github.com/i-lateral/silverstripe-modeladminplus/blob/c5209d9610cdb36ddc7b9231fad342df7e75ffc0/src/ModelAdminSnippet.php#L170-L182 |
23,757 | i-lateral/silverstripe-modeladminplus | src/ModelAdminSnippet.php | ModelAdminSnippet.removeExtraClasses | public function removeExtraClasses($classes)
{
if (!is_array($classes)) {
$classes = explode(" ", $classes);
}
foreach ($classes as $class) {
if (isset($this->extra_classes[$class])) {
unset($this->extra_classes[$class]);
}
}
... | php | public function removeExtraClasses($classes)
{
if (!is_array($classes)) {
$classes = explode(" ", $classes);
}
foreach ($classes as $class) {
if (isset($this->extra_classes[$class])) {
unset($this->extra_classes[$class]);
}
}
... | [
"public",
"function",
"removeExtraClasses",
"(",
"$",
"classes",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"classes",
")",
")",
"{",
"$",
"classes",
"=",
"explode",
"(",
"\" \"",
",",
"$",
"classes",
")",
";",
"}",
"foreach",
"(",
"$",
"classes... | Remove provided CSS classes
@param array|string $extra_classes extra CSS classes
@return self | [
"Remove",
"provided",
"CSS",
"classes"
] | c5209d9610cdb36ddc7b9231fad342df7e75ffc0 | https://github.com/i-lateral/silverstripe-modeladminplus/blob/c5209d9610cdb36ddc7b9231fad342df7e75ffc0/src/ModelAdminSnippet.php#L191-L204 |
23,758 | kusanagi/katana-sdk-php7 | src/Api/Factory/MiddlewareApiFactory.php | MiddlewareApiFactory.build | public function build(
$action,
array $data,
CliInput $input,
Mapping $mapping
)
{
$payloadMeta = $this->mapper->getPayloadMeta($data);
if ($action === 'request') {
return new RequestApi(
$this->logger->getRequestLogger($payloadMeta->ge... | php | public function build(
$action,
array $data,
CliInput $input,
Mapping $mapping
)
{
$payloadMeta = $this->mapper->getPayloadMeta($data);
if ($action === 'request') {
return new RequestApi(
$this->logger->getRequestLogger($payloadMeta->ge... | [
"public",
"function",
"build",
"(",
"$",
"action",
",",
"array",
"$",
"data",
",",
"CliInput",
"$",
"input",
",",
"Mapping",
"$",
"mapping",
")",
"{",
"$",
"payloadMeta",
"=",
"$",
"this",
"->",
"mapper",
"->",
"getPayloadMeta",
"(",
"$",
"data",
")",
... | Build a Request Api class instance
@param string $action
@param array $data
@param CliInput $input
@param Mapping $mapping
@return Api | [
"Build",
"a",
"Request",
"Api",
"class",
"instance"
] | 91e7860a1852c3ce79a7034f8c36f41840e69e1f | https://github.com/kusanagi/katana-sdk-php7/blob/91e7860a1852c3ce79a7034f8c36f41840e69e1f/src/Api/Factory/MiddlewareApiFactory.php#L38-L82 |
23,759 | NuclearCMS/Hierarchy | src/NodeSourceExtension.php | NodeSourceExtension.getAttribute | public function getAttribute($key)
{
if (isset($this->mutations[$key]))
{
return $this->mutations[$key];
}
if (array_key_exists($key, $mutatables = static::getMutatables()))
{
return $this->mutateExtensionAttribute($key, $mutatables[$key]);
}
... | php | public function getAttribute($key)
{
if (isset($this->mutations[$key]))
{
return $this->mutations[$key];
}
if (array_key_exists($key, $mutatables = static::getMutatables()))
{
return $this->mutateExtensionAttribute($key, $mutatables[$key]);
}
... | [
"public",
"function",
"getAttribute",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"mutations",
"[",
"$",
"key",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"mutations",
"[",
"$",
"key",
"]",
";",
"}",
"if",
"(",
... | Get an attribute from the model with custom accessor.
@param string $key
@return mixed | [
"Get",
"an",
"attribute",
"from",
"the",
"model",
"with",
"custom",
"accessor",
"."
] | 535171c5e2db72265313fd2110aec8456e46f459 | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/NodeSourceExtension.php#L42-L55 |
23,760 | NuclearCMS/Hierarchy | src/NodeSourceExtension.php | NodeSourceExtension.mutateExtensionAttribute | protected function mutateExtensionAttribute($key, $type)
{
$value = $this->getAttributeFromArray($key);
$mutation = $this->{'make' . studly_case($type) . 'TypeMutation'}($value);
$this->mutations[$key] = $mutation;
return $mutation;
} | php | protected function mutateExtensionAttribute($key, $type)
{
$value = $this->getAttributeFromArray($key);
$mutation = $this->{'make' . studly_case($type) . 'TypeMutation'}($value);
$this->mutations[$key] = $mutation;
return $mutation;
} | [
"protected",
"function",
"mutateExtensionAttribute",
"(",
"$",
"key",
",",
"$",
"type",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"getAttributeFromArray",
"(",
"$",
"key",
")",
";",
"$",
"mutation",
"=",
"$",
"this",
"->",
"{",
"'make'",
".",
"st... | Mutates and stores an attribute in array
@param string $key
@param string $type
@return mixed | [
"Mutates",
"and",
"stores",
"an",
"attribute",
"in",
"array"
] | 535171c5e2db72265313fd2110aec8456e46f459 | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/NodeSourceExtension.php#L81-L90 |
23,761 | surebert/surebert-framework | src/sb/Controller/Command/Line.php | Line.setLogger | public function setLogger(\sb\Logger\Base $logger, $logname=''){
$this->logger = $logger;
$this->log_name = $logname ? $logname : get_called_class();
$this->log_name = preg_replace("~[^\w+]~", "_", $this->log_name);
} | php | public function setLogger(\sb\Logger\Base $logger, $logname=''){
$this->logger = $logger;
$this->log_name = $logname ? $logname : get_called_class();
$this->log_name = preg_replace("~[^\w+]~", "_", $this->log_name);
} | [
"public",
"function",
"setLogger",
"(",
"\\",
"sb",
"\\",
"Logger",
"\\",
"Base",
"$",
"logger",
",",
"$",
"logname",
"=",
"''",
")",
"{",
"$",
"this",
"->",
"logger",
"=",
"$",
"logger",
";",
"$",
"this",
"->",
"log_name",
"=",
"$",
"logname",
"?"... | Set the logger that logs the full log message stream
when the destructor runs
@param \sb\Logger\Base $logger | [
"Set",
"the",
"logger",
"that",
"logs",
"the",
"full",
"log",
"message",
"stream",
"when",
"the",
"destructor",
"runs"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Controller/Command/Line.php#L141-L145 |
23,762 | surebert/surebert-framework | src/sb/Controller/Command/Line.php | Line.log | public function log($message, $type = "MESSAGE", $text_attributes = [])
{
$type = strtoupper($type);
switch ($type) {
case 'RAW':
break;
case 'ERROR':
$this->number_of_errors++;
$this->onError($message);
default:... | php | public function log($message, $type = "MESSAGE", $text_attributes = [])
{
$type = strtoupper($type);
switch ($type) {
case 'RAW':
break;
case 'ERROR':
$this->number_of_errors++;
$this->onError($message);
default:... | [
"public",
"function",
"log",
"(",
"$",
"message",
",",
"$",
"type",
"=",
"\"MESSAGE\"",
",",
"$",
"text_attributes",
"=",
"[",
"]",
")",
"{",
"$",
"type",
"=",
"strtoupper",
"(",
"$",
"type",
")",
";",
"switch",
"(",
"$",
"type",
")",
"{",
"case",
... | Logs to std out
@param string $message The message of the line
@param string $type The prefix of the line, if ERROR, encrements error count
@param array|string $text_attributes, used to describe how output should look
e.g. ['fgcolor' => 'red', 'bgcolor' => 'yellow', 'bold' => true, 'underline' => true, 'keep' => false]... | [
"Logs",
"to",
"std",
"out"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Controller/Command/Line.php#L202-L262 |
23,763 | surebert/surebert-framework | src/sb/Controller/Command/Line.php | Line.logToFile | protected function logToFile($message){
if(isset($this->logger) && $this->logger instanceof \sb\Logger\Base){
return $this->logger->{$this->log_name}($message);
}
} | php | protected function logToFile($message){
if(isset($this->logger) && $this->logger instanceof \sb\Logger\Base){
return $this->logger->{$this->log_name}($message);
}
} | [
"protected",
"function",
"logToFile",
"(",
"$",
"message",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"logger",
")",
"&&",
"$",
"this",
"->",
"logger",
"instanceof",
"\\",
"sb",
"\\",
"Logger",
"\\",
"Base",
")",
"{",
"return",
"$",
"this"... | Logs to file
@param string $message
@return string | [
"Logs",
"to",
"file"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Controller/Command/Line.php#L269-L273 |
23,764 | surebert/surebert-framework | src/sb/Controller/Command/Line.php | Line.getCommandlineInvocation | public function getCommandlineInvocation($method_name, $http_host=null, $http_args=[])
{
$command_prefix = "php " . ROOT . "/public/index.php";
// Match fully-qualified method name: e.g. \Foo\Controllers\Jobs\Bar::baz()
preg_match('/Controllers.([^:]+)::([A-Za-z_]+)/', $method_name, $matche... | php | public function getCommandlineInvocation($method_name, $http_host=null, $http_args=[])
{
$command_prefix = "php " . ROOT . "/public/index.php";
// Match fully-qualified method name: e.g. \Foo\Controllers\Jobs\Bar::baz()
preg_match('/Controllers.([^:]+)::([A-Za-z_]+)/', $method_name, $matche... | [
"public",
"function",
"getCommandlineInvocation",
"(",
"$",
"method_name",
",",
"$",
"http_host",
"=",
"null",
",",
"$",
"http_args",
"=",
"[",
"]",
")",
"{",
"$",
"command_prefix",
"=",
"\"php \"",
".",
"ROOT",
".",
"\"/public/index.php\"",
";",
"// Match ful... | Returns the name of a controller method in a format that can
be used in a commandline invocation.
@param string $method_name Fully qualified name to method whose invocation is being generated
@param string $http_host --http_host arg, optional, defaults to Gateway::$http_host
@param array $http_args Query stri... | [
"Returns",
"the",
"name",
"of",
"a",
"controller",
"method",
"in",
"a",
"format",
"that",
"can",
"be",
"used",
"in",
"a",
"commandline",
"invocation",
"."
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Controller/Command/Line.php#L316-L341 |
23,765 | technote-space/wordpress-plugin-base | src/traits/hook.php | Hook.load_cache_settings | private function load_cache_settings() {
if ( $this->app->isset_shared_object( 'is_valid_hook_cache' ) ) {
return;
}
$this->app->set_shared_object( 'is_valid_hook_cache', ! empty( $this->app->get_config( 'config', 'cache_filter_result' ) ) );
$prevent_cache = $this->app->get_config( 'config', 'cache_filter_... | php | private function load_cache_settings() {
if ( $this->app->isset_shared_object( 'is_valid_hook_cache' ) ) {
return;
}
$this->app->set_shared_object( 'is_valid_hook_cache', ! empty( $this->app->get_config( 'config', 'cache_filter_result' ) ) );
$prevent_cache = $this->app->get_config( 'config', 'cache_filter_... | [
"private",
"function",
"load_cache_settings",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"app",
"->",
"isset_shared_object",
"(",
"'is_valid_hook_cache'",
")",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"app",
"->",
"set_shared_object",
"(",
"'is_val... | load cache settings | [
"load",
"cache",
"settings"
] | 02cfcba358432a2539af07a69d9db00ff7c14eac | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/traits/hook.php#L30-L43 |
23,766 | mslib/resource-proxy | Msl/ResourceProxy/Source/SourceFactory.php | SourceFactory.getSourceInstance | public function getSourceInstance($type, $name, array $parameters, array $globalParameters = array())
{
// The source object variable
$sourceObj = null;
// Getting SourceConfig object for an Imap Source object
$sourceConfig = $this->getSourceConfig($name, $type, $parameters, $global... | php | public function getSourceInstance($type, $name, array $parameters, array $globalParameters = array())
{
// The source object variable
$sourceObj = null;
// Getting SourceConfig object for an Imap Source object
$sourceConfig = $this->getSourceConfig($name, $type, $parameters, $global... | [
"public",
"function",
"getSourceInstance",
"(",
"$",
"type",
",",
"$",
"name",
",",
"array",
"$",
"parameters",
",",
"array",
"$",
"globalParameters",
"=",
"array",
"(",
")",
")",
"{",
"// The source object variable",
"$",
"sourceObj",
"=",
"null",
";",
"// ... | Gets a Source instance according to the type.
@param string $type type of the required Source instance (e.g. 'imap')
@param string $name name of the returned Source instance (e.g. 'imap.main.account')
@param array $parameters configuration parameters to initialize a Source instance
@param array $globalPar... | [
"Gets",
"a",
"Source",
"instance",
"according",
"to",
"the",
"type",
"."
] | be3f8589753f738f5114443a3465f5e84aecd156 | https://github.com/mslib/resource-proxy/blob/be3f8589753f738f5114443a3465f5e84aecd156/Msl/ResourceProxy/Source/SourceFactory.php#L36-L90 |
23,767 | shabbyrobe/amiss | src/Sql/Query/Select.php | Select.buildOrder | public function buildOrder($meta, $tableAlias=null)
{
// Careful! $meta might be null.
$metaFields = $meta ? $meta->fields : null;
$order = $this->order;
if ($meta && $meta->defaultOrder && $order !== null) {
$order = $meta->defaultOrder;
}
if ($... | php | public function buildOrder($meta, $tableAlias=null)
{
// Careful! $meta might be null.
$metaFields = $meta ? $meta->fields : null;
$order = $this->order;
if ($meta && $meta->defaultOrder && $order !== null) {
$order = $meta->defaultOrder;
}
if ($... | [
"public",
"function",
"buildOrder",
"(",
"$",
"meta",
",",
"$",
"tableAlias",
"=",
"null",
")",
"{",
"// Careful! $meta might be null.",
"$",
"metaFields",
"=",
"$",
"meta",
"?",
"$",
"meta",
"->",
"fields",
":",
"null",
";",
"$",
"order",
"=",
"$",
"thi... | damn, this is pretty much identical to the above. FIXME, etc. | [
"damn",
"this",
"is",
"pretty",
"much",
"identical",
"to",
"the",
"above",
".",
"FIXME",
"etc",
"."
] | ba261f0d1f985ed36e9fd2903ac0df86c5b9498d | https://github.com/shabbyrobe/amiss/blob/ba261f0d1f985ed36e9fd2903ac0df86c5b9498d/src/Sql/Query/Select.php#L94-L143 |
23,768 | zhouyl/mellivora | Mellivora/Events/Dispatcher.php | Dispatcher.queueHandler | protected function queueHandler($class, $method, $arguments)
{
list($listener, $job) = $this->createListenerAndJob($class, $method, $arguments);
$connection = $this->resolveQueue()->connection(
isset($listener->connection) ? $listener->connection : null
);
$queue = isse... | php | protected function queueHandler($class, $method, $arguments)
{
list($listener, $job) = $this->createListenerAndJob($class, $method, $arguments);
$connection = $this->resolveQueue()->connection(
isset($listener->connection) ? $listener->connection : null
);
$queue = isse... | [
"protected",
"function",
"queueHandler",
"(",
"$",
"class",
",",
"$",
"method",
",",
"$",
"arguments",
")",
"{",
"list",
"(",
"$",
"listener",
",",
"$",
"job",
")",
"=",
"$",
"this",
"->",
"createListenerAndJob",
"(",
"$",
"class",
",",
"$",
"method",
... | Queue the handler class.
@param string $class
@param string $method
@param array $arguments
@return void | [
"Queue",
"the",
"handler",
"class",
"."
] | 79f844c5c9c25ffbe18d142062e9bc3df00b36a1 | https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Events/Dispatcher.php#L448-L461 |
23,769 | zhouyl/mellivora | Mellivora/Events/Dispatcher.php | Dispatcher.createListenerAndJob | protected function createListenerAndJob($class, $method, $arguments)
{
$listener = (new ReflectionClass($class))->newInstanceWithoutConstructor();
return [$listener, $this->propogateListenerOptions(
$listener,
new CallQueuedListener($class, $method, $arguments)
)];
... | php | protected function createListenerAndJob($class, $method, $arguments)
{
$listener = (new ReflectionClass($class))->newInstanceWithoutConstructor();
return [$listener, $this->propogateListenerOptions(
$listener,
new CallQueuedListener($class, $method, $arguments)
)];
... | [
"protected",
"function",
"createListenerAndJob",
"(",
"$",
"class",
",",
"$",
"method",
",",
"$",
"arguments",
")",
"{",
"$",
"listener",
"=",
"(",
"new",
"ReflectionClass",
"(",
"$",
"class",
")",
")",
"->",
"newInstanceWithoutConstructor",
"(",
")",
";",
... | Create the listener and job for a queued listener.
@param string $class
@param string $method
@param array $arguments
@return array | [
"Create",
"the",
"listener",
"and",
"job",
"for",
"a",
"queued",
"listener",
"."
] | 79f844c5c9c25ffbe18d142062e9bc3df00b36a1 | https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Events/Dispatcher.php#L472-L480 |
23,770 | zhouyl/mellivora | Mellivora/Events/Dispatcher.php | Dispatcher.propogateListenerOptions | protected function propogateListenerOptions($listener, $job)
{
return tap($job, function ($job) use ($listener) {
$job->tries = isset($listener->tries) ? $listener->tries : null;
$job->timeout = isset($listener->timeout) ? $listener->timeout : null;
});
} | php | protected function propogateListenerOptions($listener, $job)
{
return tap($job, function ($job) use ($listener) {
$job->tries = isset($listener->tries) ? $listener->tries : null;
$job->timeout = isset($listener->timeout) ? $listener->timeout : null;
});
} | [
"protected",
"function",
"propogateListenerOptions",
"(",
"$",
"listener",
",",
"$",
"job",
")",
"{",
"return",
"tap",
"(",
"$",
"job",
",",
"function",
"(",
"$",
"job",
")",
"use",
"(",
"$",
"listener",
")",
"{",
"$",
"job",
"->",
"tries",
"=",
"iss... | Propogate listener options to the job.
@param mixed $listener
@param mixed $job
@return mixed | [
"Propogate",
"listener",
"options",
"to",
"the",
"job",
"."
] | 79f844c5c9c25ffbe18d142062e9bc3df00b36a1 | https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Events/Dispatcher.php#L490-L496 |
23,771 | ClementIV/yii-rest-rbac2.0 | models/User.php | User.isAccessTokenValid | public static function isAccessTokenValid($token)
{
if (empty($token)) {
return false;
}
$data = Yii::$app->jwt->getValidationData(); // It will use the current time to validate (iat, nbf and exp)
$data->setIssuer(Yii::getAlias("@restIssuer"));
$data->setAudience(... | php | public static function isAccessTokenValid($token)
{
if (empty($token)) {
return false;
}
$data = Yii::$app->jwt->getValidationData(); // It will use the current time to validate (iat, nbf and exp)
$data->setIssuer(Yii::getAlias("@restIssuer"));
$data->setAudience(... | [
"public",
"static",
"function",
"isAccessTokenValid",
"(",
"$",
"token",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"token",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"data",
"=",
"Yii",
"::",
"$",
"app",
"->",
"jwt",
"->",
"getValidationData",
"... | Validates access_token.
@param string $token token to validate
@return bool if token provided is valid for current user | [
"Validates",
"access_token",
"."
] | 435ffceca8d51b4d369182db3a06c20f336e9ac4 | https://github.com/ClementIV/yii-rest-rbac2.0/blob/435ffceca8d51b4d369182db3a06c20f336e9ac4/models/User.php#L151-L164 |
23,772 | ClementIV/yii-rest-rbac2.0 | models/User.php | User.generateAccessToken | public function generateAccessToken()
{
// $this->access_token = Yii::$app->security->generateRandomString() . '_' . time();
$signer = new Sha256();
$token = Yii::$app->jwt->getBuilder()->setIssuer(Yii::getAlias("@restIssuer"))// Configures the issuer (iss claim)
->setAudience(Yii::... | php | public function generateAccessToken()
{
// $this->access_token = Yii::$app->security->generateRandomString() . '_' . time();
$signer = new Sha256();
$token = Yii::$app->jwt->getBuilder()->setIssuer(Yii::getAlias("@restIssuer"))// Configures the issuer (iss claim)
->setAudience(Yii::... | [
"public",
"function",
"generateAccessToken",
"(",
")",
"{",
"// $this->access_token = Yii::$app->security->generateRandomString() . '_' . time();",
"$",
"signer",
"=",
"new",
"Sha256",
"(",
")",
";",
"$",
"token",
"=",
"Yii",
"::",
"$",
"app",
"->",
"jwt",
"->",
"ge... | Generates new api access token. | [
"Generates",
"new",
"api",
"access",
"token",
"."
] | 435ffceca8d51b4d369182db3a06c20f336e9ac4 | https://github.com/ClementIV/yii-rest-rbac2.0/blob/435ffceca8d51b4d369182db3a06c20f336e9ac4/models/User.php#L231-L246 |
23,773 | zicht/z | src/Zicht/Tool/Script/Dumper.php | Dumper.getAst | public function getAst(Node\Node $b, $path = '')
{
$ret = array(
'type' => str_replace('Zicht\Tool\Script\Node\\', '', get_class($b))
);
if ($b instanceof Node\Branch) {
if (count($b->nodes)) {
$ret['nodes'] = array();
foreach ($b->nod... | php | public function getAst(Node\Node $b, $path = '')
{
$ret = array(
'type' => str_replace('Zicht\Tool\Script\Node\\', '', get_class($b))
);
if ($b instanceof Node\Branch) {
if (count($b->nodes)) {
$ret['nodes'] = array();
foreach ($b->nod... | [
"public",
"function",
"getAst",
"(",
"Node",
"\\",
"Node",
"$",
"b",
",",
"$",
"path",
"=",
"''",
")",
"{",
"$",
"ret",
"=",
"array",
"(",
"'type'",
"=>",
"str_replace",
"(",
"'Zicht\\Tool\\Script\\Node\\\\'",
",",
"''",
",",
"get_class",
"(",
"$",
"b"... | Returns the AST for a specified node as an array representation
@param Node\Node $b
@param string $path
@return array | [
"Returns",
"the",
"AST",
"for",
"a",
"specified",
"node",
"as",
"an",
"array",
"representation"
] | 6a1731dad20b018555a96b726a61d4bf8ec8c886 | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Script/Dumper.php#L24-L47 |
23,774 | Smile-SA/CronBundle | Cron/CronAbstract.php | CronAbstract.isDue | public function isDue()
{
$expression = $this->getExpression();
$cron = CronExpression::factory($expression);
return $cron->isDue();
} | php | public function isDue()
{
$expression = $this->getExpression();
$cron = CronExpression::factory($expression);
return $cron->isDue();
} | [
"public",
"function",
"isDue",
"(",
")",
"{",
"$",
"expression",
"=",
"$",
"this",
"->",
"getExpression",
"(",
")",
";",
"$",
"cron",
"=",
"CronExpression",
"::",
"factory",
"(",
"$",
"expression",
")",
";",
"return",
"$",
"cron",
"->",
"isDue",
"(",
... | Check cron expression
@return bool true if cron should be executed | [
"Check",
"cron",
"expression"
] | 3e6d29112915fa957cc04386ba9c6d1fc134d31f | https://github.com/Smile-SA/CronBundle/blob/3e6d29112915fa957cc04386ba9c6d1fc134d31f/Cron/CronAbstract.php#L68-L73 |
23,775 | Smile-SA/CronBundle | Cron/CronAbstract.php | CronAbstract.getExpression | public function getExpression()
{
$expression = array(
$this->minute,
$this->hour,
$this->dayOfMonth,
$this->month,
$this->dayOfWeek
);
return implode(' ', $expression);
} | php | public function getExpression()
{
$expression = array(
$this->minute,
$this->hour,
$this->dayOfMonth,
$this->month,
$this->dayOfWeek
);
return implode(' ', $expression);
} | [
"public",
"function",
"getExpression",
"(",
")",
"{",
"$",
"expression",
"=",
"array",
"(",
"$",
"this",
"->",
"minute",
",",
"$",
"this",
"->",
"hour",
",",
"$",
"this",
"->",
"dayOfMonth",
",",
"$",
"this",
"->",
"month",
",",
"$",
"this",
"->",
... | Return the cron expression
@return string cron expression | [
"Return",
"the",
"cron",
"expression"
] | 3e6d29112915fa957cc04386ba9c6d1fc134d31f | https://github.com/Smile-SA/CronBundle/blob/3e6d29112915fa957cc04386ba9c6d1fc134d31f/Cron/CronAbstract.php#L80-L91 |
23,776 | Smile-SA/CronBundle | Cron/CronAbstract.php | CronAbstract.getArgument | public function getArgument(InputInterface $input, $key)
{
if ($input->hasArgument($key)) {
return $input->getArgument($key);
}
if (isset($this->arguments[$key])) {
return $this->arguments[$key];
}
return false;
} | php | public function getArgument(InputInterface $input, $key)
{
if ($input->hasArgument($key)) {
return $input->getArgument($key);
}
if (isset($this->arguments[$key])) {
return $this->arguments[$key];
}
return false;
} | [
"public",
"function",
"getArgument",
"(",
"InputInterface",
"$",
"input",
",",
"$",
"key",
")",
"{",
"if",
"(",
"$",
"input",
"->",
"hasArgument",
"(",
"$",
"key",
")",
")",
"{",
"return",
"$",
"input",
"->",
"getArgument",
"(",
"$",
"key",
")",
";",... | Get Cron arguments
@param InputInterface $input Input interface
@param string $key
@return mixed return argument from input or tag settings | [
"Get",
"Cron",
"arguments"
] | 3e6d29112915fa957cc04386ba9c6d1fc134d31f | https://github.com/Smile-SA/CronBundle/blob/3e6d29112915fa957cc04386ba9c6d1fc134d31f/Cron/CronAbstract.php#L143-L154 |
23,777 | zicht/z | src/Zicht/Tool/Container/Executor.php | Executor.execute | public function execute($cmd, &$captureOutput = null)
{
$isInteractive = $this->container->get('INTERACTIVE');
$process = $this->createProcess($isInteractive);
if ($isInteractive) {
$process->setCommandLine(sprintf('/bin/bash -c \'%s\'', $cmd));
} else {
$pro... | php | public function execute($cmd, &$captureOutput = null)
{
$isInteractive = $this->container->get('INTERACTIVE');
$process = $this->createProcess($isInteractive);
if ($isInteractive) {
$process->setCommandLine(sprintf('/bin/bash -c \'%s\'', $cmd));
} else {
$pro... | [
"public",
"function",
"execute",
"(",
"$",
"cmd",
",",
"&",
"$",
"captureOutput",
"=",
"null",
")",
"{",
"$",
"isInteractive",
"=",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
"'INTERACTIVE'",
")",
";",
"$",
"process",
"=",
"$",
"this",
"->",
"... | Executes the passed command line in the shell.
@param string $cmd
@param null &$captureOutput
@param string $captureOutput
@return int
@throws ExecutionAbortedException
@throws \UnexpectedValueException | [
"Executes",
"the",
"passed",
"command",
"line",
"in",
"the",
"shell",
"."
] | 6a1731dad20b018555a96b726a61d4bf8ec8c886 | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Container/Executor.php#L38-L67 |
23,778 | zicht/z | src/Zicht/Tool/Container/Executor.php | Executor.createProcess | protected function createProcess($interactive = false)
{
$process = new Process($this->container->resolve('SHELL'), null, null, null, null, []);
if ($interactive) {
$process->setTty(true);
} else {
if ($this->container->has('TIMEOUT') && $timeout = $this->container->... | php | protected function createProcess($interactive = false)
{
$process = new Process($this->container->resolve('SHELL'), null, null, null, null, []);
if ($interactive) {
$process->setTty(true);
} else {
if ($this->container->has('TIMEOUT') && $timeout = $this->container->... | [
"protected",
"function",
"createProcess",
"(",
"$",
"interactive",
"=",
"false",
")",
"{",
"$",
"process",
"=",
"new",
"Process",
"(",
"$",
"this",
"->",
"container",
"->",
"resolve",
"(",
"'SHELL'",
")",
",",
"null",
",",
"null",
",",
"null",
",",
"nu... | Create the process instance to use for non-interactive handling
@var bool $interactive
@return \Symfony\Component\Process\Process | [
"Create",
"the",
"process",
"instance",
"to",
"use",
"for",
"non",
"-",
"interactive",
"handling"
] | 6a1731dad20b018555a96b726a61d4bf8ec8c886 | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Container/Executor.php#L76-L89 |
23,779 | zicht/z | src/Zicht/Tool/Container/Executor.php | Executor.processCallback | public function processCallback($mode, $data)
{
if (isset($this->container->output)) {
$this->container->output->write($data);
}
} | php | public function processCallback($mode, $data)
{
if (isset($this->container->output)) {
$this->container->output->write($data);
}
} | [
"public",
"function",
"processCallback",
"(",
"$",
"mode",
",",
"$",
"data",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"container",
"->",
"output",
")",
")",
"{",
"$",
"this",
"->",
"container",
"->",
"output",
"->",
"write",
"(",
"$",
... | The callback used for the process executed by Process
@param mixed $mode
@param string $data
@return void | [
"The",
"callback",
"used",
"for",
"the",
"process",
"executed",
"by",
"Process"
] | 6a1731dad20b018555a96b726a61d4bf8ec8c886 | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Container/Executor.php#L99-L104 |
23,780 | heidelpay/PhpDoc | src/phpDocumentor/Plugin/Scrybe/ServiceProvider.php | ServiceProvider.addCommands | protected function addCommands(Application $app)
{
$app->command(
new Command\Manual\ToHtmlCommand(null, $app[self::TEMPLATE_FACTORY], $app[self::CONVERTER_FACTORY])
);
// FIXME: Disabled the ToLatex and ToPdf commands for now to prevent confusion of users.
// $this->com... | php | protected function addCommands(Application $app)
{
$app->command(
new Command\Manual\ToHtmlCommand(null, $app[self::TEMPLATE_FACTORY], $app[self::CONVERTER_FACTORY])
);
// FIXME: Disabled the ToLatex and ToPdf commands for now to prevent confusion of users.
// $this->com... | [
"protected",
"function",
"addCommands",
"(",
"Application",
"$",
"app",
")",
"{",
"$",
"app",
"->",
"command",
"(",
"new",
"Command",
"\\",
"Manual",
"\\",
"ToHtmlCommand",
"(",
"null",
",",
"$",
"app",
"[",
"self",
"::",
"TEMPLATE_FACTORY",
"]",
",",
"$... | Method responsible for adding the commands for this application.
@param Application $app
@return void | [
"Method",
"responsible",
"for",
"adding",
"the",
"commands",
"for",
"this",
"application",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Scrybe/ServiceProvider.php#L83-L92 |
23,781 | brick/di | src/Definition.php | Definition.get | public function get(Container $container)
{
if ($this->scope === null) {
$this->scope = $this->getDefaultScope();
}
return $this->scope->get($this, $container);
} | php | public function get(Container $container)
{
if ($this->scope === null) {
$this->scope = $this->getDefaultScope();
}
return $this->scope->get($this, $container);
} | [
"public",
"function",
"get",
"(",
"Container",
"$",
"container",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"scope",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"scope",
"=",
"$",
"this",
"->",
"getDefaultScope",
"(",
")",
";",
"}",
"return",
"$",
"th... | Resolves the value of this definition, according to the current scope.
This method is for internal use by the Container.
@internal
@param Container $container
@return mixed | [
"Resolves",
"the",
"value",
"of",
"this",
"definition",
"according",
"to",
"the",
"current",
"scope",
"."
] | 6ced82ab3623b8f1470317d38cbd2de855e7aa3d | https://github.com/brick/di/blob/6ced82ab3623b8f1470317d38cbd2de855e7aa3d/src/Definition.php#L42-L49 |
23,782 | bpolaszek/simple-dbal | src/Model/Adapter/PDO/PDOAdapter.php | PDOAdapter.reconnect | private function reconnect()
{
if (0 === (int) $this->getOption(self::OPT_MAX_RECONNECT_ATTEMPTS)) {
throw new MaxConnectAttempsException("Connection lost.");
} elseif ($this->reconnectAttempts === (int) $this->getOption(self::OPT_MAX_RECONNECT_ATTEMPTS)) {
throw new MaxConne... | php | private function reconnect()
{
if (0 === (int) $this->getOption(self::OPT_MAX_RECONNECT_ATTEMPTS)) {
throw new MaxConnectAttempsException("Connection lost.");
} elseif ($this->reconnectAttempts === (int) $this->getOption(self::OPT_MAX_RECONNECT_ATTEMPTS)) {
throw new MaxConne... | [
"private",
"function",
"reconnect",
"(",
")",
"{",
"if",
"(",
"0",
"===",
"(",
"int",
")",
"$",
"this",
"->",
"getOption",
"(",
"self",
"::",
"OPT_MAX_RECONNECT_ATTEMPTS",
")",
")",
"{",
"throw",
"new",
"MaxConnectAttempsException",
"(",
"\"Connection lost.\""... | Tries to reconnect to database. | [
"Tries",
"to",
"reconnect",
"to",
"database",
"."
] | 52cb50d326ba5854191814b470f5e84950ebb6e6 | https://github.com/bpolaszek/simple-dbal/blob/52cb50d326ba5854191814b470f5e84950ebb6e6/src/Model/Adapter/PDO/PDOAdapter.php#L101-L126 |
23,783 | interactivesolutions/honeycomb-core | src/models/HCMultiLanguageModel.php | HCMultiLanguageModel.translation | public function translation()
{
if (is_null($this->translationsClass))
$this->translationsClass = get_class($this) . 'Translations';
return $this->hasOne($this->translationsClass, 'record_id', 'id')->where('language_code', app()->getLocale());
} | php | public function translation()
{
if (is_null($this->translationsClass))
$this->translationsClass = get_class($this) . 'Translations';
return $this->hasOne($this->translationsClass, 'record_id', 'id')->where('language_code', app()->getLocale());
} | [
"public",
"function",
"translation",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"translationsClass",
")",
")",
"$",
"this",
"->",
"translationsClass",
"=",
"get_class",
"(",
"$",
"this",
")",
".",
"'Translations'",
";",
"return",
"$",
"... | Single translation only
@return \Illuminate\Database\Eloquent\Relations\HasOne | [
"Single",
"translation",
"only"
] | 06b8d88bb285e73a1a286e60411ca5f41863f39f | https://github.com/interactivesolutions/honeycomb-core/blob/06b8d88bb285e73a1a286e60411ca5f41863f39f/src/models/HCMultiLanguageModel.php#L32-L38 |
23,784 | interactivesolutions/honeycomb-core | src/models/HCMultiLanguageModel.php | HCMultiLanguageModel.translatedList | public static function translatedList(string $nameKey = "name")
{
return (new static())->with('translations')->get()->map(function ($item, $key) use ($nameKey) {
return [
'id' => $item->id,
'label' => get_translation_name(
$nameKey, app()->g... | php | public static function translatedList(string $nameKey = "name")
{
return (new static())->with('translations')->get()->map(function ($item, $key) use ($nameKey) {
return [
'id' => $item->id,
'label' => get_translation_name(
$nameKey, app()->g... | [
"public",
"static",
"function",
"translatedList",
"(",
"string",
"$",
"nameKey",
"=",
"\"name\"",
")",
"{",
"return",
"(",
"new",
"static",
"(",
")",
")",
"->",
"with",
"(",
"'translations'",
")",
"->",
"get",
"(",
")",
"->",
"map",
"(",
"function",
"(... | Get translated id -> value names
@param string $nameKey
@return mixed | [
"Get",
"translated",
"id",
"-",
">",
"value",
"names"
] | 06b8d88bb285e73a1a286e60411ca5f41863f39f | https://github.com/interactivesolutions/honeycomb-core/blob/06b8d88bb285e73a1a286e60411ca5f41863f39f/src/models/HCMultiLanguageModel.php#L79-L89 |
23,785 | inhere/php-librarys | src/Components/DatabaseClient.php | DatabaseClient.insert | public function insert(string $from, array $data, array $options = [])
{
if (!$data) {
throw new \RuntimeException('The data inserted into the database cannot be empty');
}
list($statement, $bindings) = $this->compileInsert($from, $data);
if (isset($options['dumpSql']))... | php | public function insert(string $from, array $data, array $options = [])
{
if (!$data) {
throw new \RuntimeException('The data inserted into the database cannot be empty');
}
list($statement, $bindings) = $this->compileInsert($from, $data);
if (isset($options['dumpSql']))... | [
"public",
"function",
"insert",
"(",
"string",
"$",
"from",
",",
"array",
"$",
"data",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"$",
"data",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'The data inserted into... | Run a statement for insert a row
@param string $from
@param array $data <column => value>
@param array $options
@return int|array
@throws \RuntimeException | [
"Run",
"a",
"statement",
"for",
"insert",
"a",
"row"
] | e6ca598685469794f310e3ab0e2bc19519cd0ae6 | https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Components/DatabaseClient.php#L378-L394 |
23,786 | inhere/php-librarys | src/Components/DatabaseClient.php | DatabaseClient.ping | public function ping()
{
try {
$this->connect();
$this->pdo->query('select 1')->fetchColumn();
} catch (\PDOException $e) {
if (strpos($e->getMessage(), 'server has gone away') !== false) {
return false;
}
}
return true... | php | public function ping()
{
try {
$this->connect();
$this->pdo->query('select 1')->fetchColumn();
} catch (\PDOException $e) {
if (strpos($e->getMessage(), 'server has gone away') !== false) {
return false;
}
}
return true... | [
"public",
"function",
"ping",
"(",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"connect",
"(",
")",
";",
"$",
"this",
"->",
"pdo",
"->",
"query",
"(",
"'select 1'",
")",
"->",
"fetchColumn",
"(",
")",
";",
"}",
"catch",
"(",
"\\",
"PDOException",
"$",... | Check whether the connection is available
@return bool
@throws \PDOException
@throws \RuntimeException | [
"Check",
"whether",
"the",
"connection",
"is",
"available"
] | e6ca598685469794f310e3ab0e2bc19519cd0ae6 | https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Components/DatabaseClient.php#L1025-L1037 |
23,787 | songshenzong/log | src/ServiceProvider.php | ServiceProvider.isEnabled | public function isEnabled()
{
if ($this->enabled === null) {
$environments = config('songshenzong-log.env', ['dev', 'local', 'production']);
$this->enabled = in_array(env('APP_ENV'), $environments, true);
}
return $this->enabled;
} | php | public function isEnabled()
{
if ($this->enabled === null) {
$environments = config('songshenzong-log.env', ['dev', 'local', 'production']);
$this->enabled = in_array(env('APP_ENV'), $environments, true);
}
return $this->enabled;
} | [
"public",
"function",
"isEnabled",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"enabled",
"===",
"null",
")",
"{",
"$",
"environments",
"=",
"config",
"(",
"'songshenzong-log.env'",
",",
"[",
"'dev'",
",",
"'local'",
",",
"'production'",
"]",
")",
";",
... | Check if is enabled
@return boolean | [
"Check",
"if",
"is",
"enabled"
] | b1e01f7994da47737866eabf82367490eab17c46 | https://github.com/songshenzong/log/blob/b1e01f7994da47737866eabf82367490eab17c46/src/ServiceProvider.php#L62-L70 |
23,788 | petrica/php-statsd-system | Gauge/ProcessesGauge.php | ProcessesGauge.getProcesses | protected function getProcesses()
{
$data = $this->getCommand()->run();
$parser = new TopProcessParser($data);
$parser->parse();
return $parser->getProcesses();
} | php | protected function getProcesses()
{
$data = $this->getCommand()->run();
$parser = new TopProcessParser($data);
$parser->parse();
return $parser->getProcesses();
} | [
"protected",
"function",
"getProcesses",
"(",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"getCommand",
"(",
")",
"->",
"run",
"(",
")",
";",
"$",
"parser",
"=",
"new",
"TopProcessParser",
"(",
"$",
"data",
")",
";",
"$",
"parser",
"->",
"parse",
... | Return parsed data for processes | [
"Return",
"parsed",
"data",
"for",
"processes"
] | c476be3514a631a605737888bb8f6eb096789c9d | https://github.com/petrica/php-statsd-system/blob/c476be3514a631a605737888bb8f6eb096789c9d/Gauge/ProcessesGauge.php#L96-L104 |
23,789 | petrica/php-statsd-system | Gauge/ProcessesGauge.php | ProcessesGauge.aggregateCpu | protected function aggregateCpu($processes)
{
$cpus = array();
foreach ($processes as $process) {
if (isset($cpus[$process->getName()])) {
$cpus[$process->getName()] += $process->getCpu();
}
else {
$cpus[$process->getName()] = $pro... | php | protected function aggregateCpu($processes)
{
$cpus = array();
foreach ($processes as $process) {
if (isset($cpus[$process->getName()])) {
$cpus[$process->getName()] += $process->getCpu();
}
else {
$cpus[$process->getName()] = $pro... | [
"protected",
"function",
"aggregateCpu",
"(",
"$",
"processes",
")",
"{",
"$",
"cpus",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"processes",
"as",
"$",
"process",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"cpus",
"[",
"$",
"process",
"->",
"... | Aggregate CPU for processes with the same name
@param $processes Process[] | [
"Aggregate",
"CPU",
"for",
"processes",
"with",
"the",
"same",
"name"
] | c476be3514a631a605737888bb8f6eb096789c9d | https://github.com/petrica/php-statsd-system/blob/c476be3514a631a605737888bb8f6eb096789c9d/Gauge/ProcessesGauge.php#L124-L138 |
23,790 | petrica/php-statsd-system | Gauge/ProcessesGauge.php | ProcessesGauge.aggregateMemory | protected function aggregateMemory($processes)
{
$memory = array();
foreach ($processes as $process) {
if (isset($memory[$process->getName()])) {
$memory[$process->getName()] += $process->getMemory();
}
else {
$memory[$process->get... | php | protected function aggregateMemory($processes)
{
$memory = array();
foreach ($processes as $process) {
if (isset($memory[$process->getName()])) {
$memory[$process->getName()] += $process->getMemory();
}
else {
$memory[$process->get... | [
"protected",
"function",
"aggregateMemory",
"(",
"$",
"processes",
")",
"{",
"$",
"memory",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"processes",
"as",
"$",
"process",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"memory",
"[",
"$",
"process",
"-... | Aggregate memory for processes with the same name
@param $processes Process[]
@return array | [
"Aggregate",
"memory",
"for",
"processes",
"with",
"the",
"same",
"name"
] | c476be3514a631a605737888bb8f6eb096789c9d | https://github.com/petrica/php-statsd-system/blob/c476be3514a631a605737888bb8f6eb096789c9d/Gauge/ProcessesGauge.php#L146-L160 |
23,791 | petrica/php-statsd-system | Gauge/ProcessesGauge.php | ProcessesGauge.persistCollection | protected function persistCollection($collection)
{
$cache = new FilesystemAdapter($this->namespace);
$item = $cache->getItem('collection');
$item->set($collection);
$cache->save($item);
} | php | protected function persistCollection($collection)
{
$cache = new FilesystemAdapter($this->namespace);
$item = $cache->getItem('collection');
$item->set($collection);
$cache->save($item);
} | [
"protected",
"function",
"persistCollection",
"(",
"$",
"collection",
")",
"{",
"$",
"cache",
"=",
"new",
"FilesystemAdapter",
"(",
"$",
"this",
"->",
"namespace",
")",
";",
"$",
"item",
"=",
"$",
"cache",
"->",
"getItem",
"(",
"'collection'",
")",
";",
... | Persist collection values to a temporary storage
key is the command string value
@param $collection | [
"Persist",
"collection",
"values",
"to",
"a",
"temporary",
"storage",
"key",
"is",
"the",
"command",
"string",
"value"
] | c476be3514a631a605737888bb8f6eb096789c9d | https://github.com/petrica/php-statsd-system/blob/c476be3514a631a605737888bb8f6eb096789c9d/Gauge/ProcessesGauge.php#L178-L184 |
23,792 | petrica/php-statsd-system | Gauge/ProcessesGauge.php | ProcessesGauge.retrieveCollection | protected function retrieveCollection()
{
$cache = new FilesystemAdapter($this->namespace);
$item = $cache->getItem('collection');
$collection = null;
if ($item->isHit()) {
$collection = $item->get('collection');
}
if (empty($collection) || !$collection ... | php | protected function retrieveCollection()
{
$cache = new FilesystemAdapter($this->namespace);
$item = $cache->getItem('collection');
$collection = null;
if ($item->isHit()) {
$collection = $item->get('collection');
}
if (empty($collection) || !$collection ... | [
"protected",
"function",
"retrieveCollection",
"(",
")",
"{",
"$",
"cache",
"=",
"new",
"FilesystemAdapter",
"(",
"$",
"this",
"->",
"namespace",
")",
";",
"$",
"item",
"=",
"$",
"cache",
"->",
"getItem",
"(",
"'collection'",
")",
";",
"$",
"collection",
... | \
Retrieve a new collection of a previous collection
@return mixed|ValuesCollection | [
"\\",
"Retrieve",
"a",
"new",
"collection",
"of",
"a",
"previous",
"collection"
] | c476be3514a631a605737888bb8f6eb096789c9d | https://github.com/petrica/php-statsd-system/blob/c476be3514a631a605737888bb8f6eb096789c9d/Gauge/ProcessesGauge.php#L191-L206 |
23,793 | petrica/php-statsd-system | Gauge/ProcessesGauge.php | ProcessesGauge.removeEmpty | protected function removeEmpty($collection) {
foreach ($collection as $key => $value) {
if (empty($value)) {
unset($collection[$key]);
}
}
return $collection;
} | php | protected function removeEmpty($collection) {
foreach ($collection as $key => $value) {
if (empty($value)) {
unset($collection[$key]);
}
}
return $collection;
} | [
"protected",
"function",
"removeEmpty",
"(",
"$",
"collection",
")",
"{",
"foreach",
"(",
"$",
"collection",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"value",
")",
")",
"{",
"unset",
"(",
"$",
"collection",
"[",
... | Remove empty values from collection
@param $collection | [
"Remove",
"empty",
"values",
"from",
"collection"
] | c476be3514a631a605737888bb8f6eb096789c9d | https://github.com/petrica/php-statsd-system/blob/c476be3514a631a605737888bb8f6eb096789c9d/Gauge/ProcessesGauge.php#L228-L236 |
23,794 | raideer/twitch-api | src/Resources/Teams.php | Teams.getTeams | public function getTeams($params = [])
{
$defaults = [
'limit' => 25,
'offset' => 0,
];
return $this->wrapper->request('GET', 'teams', ['query' => $this->resolveOptions($params, $defaults)]);
} | php | public function getTeams($params = [])
{
$defaults = [
'limit' => 25,
'offset' => 0,
];
return $this->wrapper->request('GET', 'teams', ['query' => $this->resolveOptions($params, $defaults)]);
} | [
"public",
"function",
"getTeams",
"(",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"defaults",
"=",
"[",
"'limit'",
"=>",
"25",
",",
"'offset'",
"=>",
"0",
",",
"]",
";",
"return",
"$",
"this",
"->",
"wrapper",
"->",
"request",
"(",
"'GET'",
",",
... | Returns a list of active teams.
Learn more:
https://github.com/justintv/Twitch-API/blob/master/v3_resources/teams.md#get-teams
@param array $params Optiona params
@return array | [
"Returns",
"a",
"list",
"of",
"active",
"teams",
"."
] | 27ebf1dcb0315206300d507600b6a82ebe33d57e | https://github.com/raideer/twitch-api/blob/27ebf1dcb0315206300d507600b6a82ebe33d57e/src/Resources/Teams.php#L30-L38 |
23,795 | hametuha/wpametu | src/WPametu/UI/Field/Text.php | Text.build_input | protected function build_input($data, array $fields = [] ){
return parent::build_input($data, $fields).$this->length_helper($data);
} | php | protected function build_input($data, array $fields = [] ){
return parent::build_input($data, $fields).$this->length_helper($data);
} | [
"protected",
"function",
"build_input",
"(",
"$",
"data",
",",
"array",
"$",
"fields",
"=",
"[",
"]",
")",
"{",
"return",
"parent",
"::",
"build_input",
"(",
"$",
"data",
",",
"$",
"fields",
")",
".",
"$",
"this",
"->",
"length_helper",
"(",
"$",
"da... | Return input field
@param mixed $data
@param array $fields
@return string | [
"Return",
"input",
"field"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/UI/Field/Text.php#L46-L48 |
23,796 | hametuha/wpametu | src/WPametu/UI/Field/Text.php | Text.length_helper | protected function length_helper($data){
if ( ($this->min || $this->max) && $this->length_helper ){
$notice = [];
$class_name = 'ok';
if( $this->min ){
$notice[] = sprintf($this->__('%s chars or more'), number_format($this->min));
if( $this->min >... | php | protected function length_helper($data){
if ( ($this->min || $this->max) && $this->length_helper ){
$notice = [];
$class_name = 'ok';
if( $this->min ){
$notice[] = sprintf($this->__('%s chars or more'), number_format($this->min));
if( $this->min >... | [
"protected",
"function",
"length_helper",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"(",
"$",
"this",
"->",
"min",
"||",
"$",
"this",
"->",
"max",
")",
"&&",
"$",
"this",
"->",
"length_helper",
")",
"{",
"$",
"notice",
"=",
"[",
"]",
";",
"$",
"clas... | Returns length helper
@param string $data
@return string | [
"Returns",
"length",
"helper"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/UI/Field/Text.php#L56-L78 |
23,797 | mr-luke/configuration | src/Host.php | Host.get | public function get(string $key, $default = null)
{
$result = $this->iterateConfig($key);
return is_null($result) ? $default : $result;
} | php | public function get(string $key, $default = null)
{
$result = $this->iterateConfig($key);
return is_null($result) ? $default : $result;
} | [
"public",
"function",
"get",
"(",
"string",
"$",
"key",
",",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"iterateConfig",
"(",
"$",
"key",
")",
";",
"return",
"is_null",
"(",
"$",
"result",
")",
"?",
"$",
"default"... | Return given key from array.
@param string $key
@param mixed $default
@return mixed | [
"Return",
"given",
"key",
"from",
"array",
"."
] | 487c90011dc15556787785ed60c60ea92655beac | https://github.com/mr-luke/configuration/blob/487c90011dc15556787785ed60c60ea92655beac/src/Host.php#L43-L48 |
23,798 | mr-luke/configuration | src/Host.php | Host.has | public function has(string $key): bool
{
$result = $this->iterateConfig($key);
return !($result === null);
} | php | public function has(string $key): bool
{
$result = $this->iterateConfig($key);
return !($result === null);
} | [
"public",
"function",
"has",
"(",
"string",
"$",
"key",
")",
":",
"bool",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"iterateConfig",
"(",
"$",
"key",
")",
";",
"return",
"!",
"(",
"$",
"result",
"===",
"null",
")",
";",
"}"
] | Return of givent key is present.
@param string $key
@return boolean | [
"Return",
"of",
"givent",
"key",
"is",
"present",
"."
] | 487c90011dc15556787785ed60c60ea92655beac | https://github.com/mr-luke/configuration/blob/487c90011dc15556787785ed60c60ea92655beac/src/Host.php#L56-L61 |
23,799 | mr-luke/configuration | src/Host.php | Host.iterateConfig | protected function iterateConfig(string $key)
{
$result = $this->config;
foreach (explode('.', $key) as $p) {
if (!isset($result[$p])) {
return null;
}
$result = $result[$p];
}
return $result;
} | php | protected function iterateConfig(string $key)
{
$result = $this->config;
foreach (explode('.', $key) as $p) {
if (!isset($result[$p])) {
return null;
}
$result = $result[$p];
}
return $result;
} | [
"protected",
"function",
"iterateConfig",
"(",
"string",
"$",
"key",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"config",
";",
"foreach",
"(",
"explode",
"(",
"'.'",
",",
"$",
"key",
")",
"as",
"$",
"p",
")",
"{",
"if",
"(",
"!",
"isset",
"... | Iterate through configuration.
@param string $key
@return mixed | [
"Iterate",
"through",
"configuration",
"."
] | 487c90011dc15556787785ed60c60ea92655beac | https://github.com/mr-luke/configuration/blob/487c90011dc15556787785ed60c60ea92655beac/src/Host.php#L90-L103 |
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.