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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
22,100 | codezero-be/curl | src/OptionParser.php | OptionParser.parseUrl | public function parseUrl($url, array $data)
{
return (empty($data)) ? $url : $url . '?' . $this->parseData($data);
} | php | public function parseUrl($url, array $data)
{
return (empty($data)) ? $url : $url . '?' . $this->parseData($data);
} | [
"public",
"function",
"parseUrl",
"(",
"$",
"url",
",",
"array",
"$",
"data",
")",
"{",
"return",
"(",
"empty",
"(",
"$",
"data",
")",
")",
"?",
"$",
"url",
":",
"$",
"url",
".",
"'?'",
".",
"$",
"this",
"->",
"parseData",
"(",
"$",
"data",
")"... | Build URL with query string
@param string $url
@param array $data
@return string | [
"Build",
"URL",
"with",
"query",
"string"
] | c1385479886662b6276c18dd9140df529959d95c | https://github.com/codezero-be/curl/blob/c1385479886662b6276c18dd9140df529959d95c/src/OptionParser.php#L13-L16 |
22,101 | heidelpay/PhpDoc | src/phpDocumentor/Descriptor/Filter/ClassFactory.php | ClassFactory.getChainFor | public function getChainFor($fqcn)
{
if (!isset($this->chains[$fqcn])) {
$this->chains[$fqcn] = new FilterChain();
}
return $this->chains[$fqcn];
} | php | public function getChainFor($fqcn)
{
if (!isset($this->chains[$fqcn])) {
$this->chains[$fqcn] = new FilterChain();
}
return $this->chains[$fqcn];
} | [
"public",
"function",
"getChainFor",
"(",
"$",
"fqcn",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"chains",
"[",
"$",
"fqcn",
"]",
")",
")",
"{",
"$",
"this",
"->",
"chains",
"[",
"$",
"fqcn",
"]",
"=",
"new",
"FilterChain",
"(",
... | Retrieves the filters for a class with a given FQCN.
@param string $fqcn
@return FilterChain | [
"Retrieves",
"the",
"filters",
"for",
"a",
"class",
"with",
"a",
"given",
"FQCN",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/Filter/ClassFactory.php#L31-L38 |
22,102 | mothership-ec/composer | src/Composer/Repository/Vcs/GitHubDriver.php | GitHubDriver.getRateLimit | protected function getRateLimit(array $headers)
{
$rateLimit = array(
'limit' => '?',
'reset' => '?',
);
foreach ($headers as $header) {
$header = trim($header);
if (false === strpos($header, 'X-RateLimit-')) {
continue;
... | php | protected function getRateLimit(array $headers)
{
$rateLimit = array(
'limit' => '?',
'reset' => '?',
);
foreach ($headers as $header) {
$header = trim($header);
if (false === strpos($header, 'X-RateLimit-')) {
continue;
... | [
"protected",
"function",
"getRateLimit",
"(",
"array",
"$",
"headers",
")",
"{",
"$",
"rateLimit",
"=",
"array",
"(",
"'limit'",
"=>",
"'?'",
",",
"'reset'",
"=>",
"'?'",
",",
")",
";",
"foreach",
"(",
"$",
"headers",
"as",
"$",
"header",
")",
"{",
"... | Extract ratelimit from response.
@param array $headers Headers from Composer\Downloader\TransportException.
@return array Associative array with the keys limit and reset. | [
"Extract",
"ratelimit",
"from",
"response",
"."
] | fa6ad031a939d8d33b211e428fdbdd28cfce238c | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/Repository/Vcs/GitHubDriver.php#L369-L393 |
22,103 | surebert/surebert-framework | src/sb/XMPP/Client.php | Client.connect | public function connect()
{
//if port is not set, try and determine based on transport
if(!is_numeric($this->port)){
if(substr($this->host, 0, 3) == 'ssl'){
$this->port = 5223;
$this->log("Connecting with SSL");
} else {
$th... | php | public function connect()
{
//if port is not set, try and determine based on transport
if(!is_numeric($this->port)){
if(substr($this->host, 0, 3) == 'ssl'){
$this->port = 5223;
$this->log("Connecting with SSL");
} else {
$th... | [
"public",
"function",
"connect",
"(",
")",
"{",
"//if port is not set, try and determine based on transport",
"if",
"(",
"!",
"is_numeric",
"(",
"$",
"this",
"->",
"port",
")",
")",
"{",
"if",
"(",
"substr",
"(",
"$",
"this",
"->",
"host",
",",
"0",
",",
"... | Connects to the XMPP server | [
"Connects",
"to",
"the",
"XMPP",
"server"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/XMPP/Client.php#L97-L124 |
22,104 | surebert/surebert-framework | src/sb/XMPP/Client.php | Client.login | public function login()
{
//connect if not connected
if(!$this->connected){
$this->reconnect();
}
//calc the jid from uname+host
$this->jid = $this->uname.'@'.substr($this->host, strpos($this->host, '//')+2);
if($this->pass){
$this->write("... | php | public function login()
{
//connect if not connected
if(!$this->connected){
$this->reconnect();
}
//calc the jid from uname+host
$this->jid = $this->uname.'@'.substr($this->host, strpos($this->host, '//')+2);
if($this->pass){
$this->write("... | [
"public",
"function",
"login",
"(",
")",
"{",
"//connect if not connected",
"if",
"(",
"!",
"$",
"this",
"->",
"connected",
")",
"{",
"$",
"this",
"->",
"reconnect",
"(",
")",
";",
"}",
"//calc the jid from uname+host",
"$",
"this",
"->",
"jid",
"=",
"$",
... | Login to the XMPP server as a user and set their precence to avaiable
@return boolean | [
"Login",
"to",
"the",
"XMPP",
"server",
"as",
"a",
"user",
"and",
"set",
"their",
"precence",
"to",
"avaiable"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/XMPP/Client.php#L141-L178 |
22,105 | surebert/surebert-framework | src/sb/XMPP/Client.php | Client.sendPresence | public function sendPresence(\sb\XMPP\Presence $presence)
{
$presence->setFrom($this->jid);
return $this->write($presence);
} | php | public function sendPresence(\sb\XMPP\Presence $presence)
{
$presence->setFrom($this->jid);
return $this->write($presence);
} | [
"public",
"function",
"sendPresence",
"(",
"\\",
"sb",
"\\",
"XMPP",
"\\",
"Presence",
"$",
"presence",
")",
"{",
"$",
"presence",
"->",
"setFrom",
"(",
"$",
"this",
"->",
"jid",
")",
";",
"return",
"$",
"this",
"->",
"write",
"(",
"$",
"presence",
"... | Converts a presense request instance to XML and sends it. It sets the from
to the bots jid for you
@param \sb\XMPP\Presence $presence The presence instance to send
@return boolean | [
"Converts",
"a",
"presense",
"request",
"instance",
"to",
"XML",
"and",
"sends",
"it",
".",
"It",
"sets",
"the",
"from",
"to",
"the",
"bots",
"jid",
"for",
"you"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/XMPP/Client.php#L187-L192 |
22,106 | surebert/surebert-framework | src/sb/XMPP/Client.php | Client.setStatus | public function setStatus($status=null)
{
$presence = new \sb\XMPP\Presence();
$presence->setStatus(is_string($status) ? $status : $this->status);
$this->sendPresence($presence);
} | php | public function setStatus($status=null)
{
$presence = new \sb\XMPP\Presence();
$presence->setStatus(is_string($status) ? $status : $this->status);
$this->sendPresence($presence);
} | [
"public",
"function",
"setStatus",
"(",
"$",
"status",
"=",
"null",
")",
"{",
"$",
"presence",
"=",
"new",
"\\",
"sb",
"\\",
"XMPP",
"\\",
"Presence",
"(",
")",
";",
"$",
"presence",
"->",
"setStatus",
"(",
"is_string",
"(",
"$",
"status",
")",
"?",
... | Sets status message
@param string $status The status message to send | [
"Sets",
"status",
"message"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/XMPP/Client.php#L198-L205 |
22,107 | surebert/surebert-framework | src/sb/XMPP/Client.php | Client.sendSimpleMessage | public function sendSimpleMessage($to, $body)
{
$message = new \sb\XMPP\Message();
$message->setTo($to);
$message->setBody($body);
$this->sendMessage($message);
} | php | public function sendSimpleMessage($to, $body)
{
$message = new \sb\XMPP\Message();
$message->setTo($to);
$message->setBody($body);
$this->sendMessage($message);
} | [
"public",
"function",
"sendSimpleMessage",
"(",
"$",
"to",
",",
"$",
"body",
")",
"{",
"$",
"message",
"=",
"new",
"\\",
"sb",
"\\",
"XMPP",
"\\",
"Message",
"(",
")",
";",
"$",
"message",
"->",
"setTo",
"(",
"$",
"to",
")",
";",
"$",
"message",
... | Sends simple string based text message
@param string $to The jid to send the message to
@param string $body The text to send | [
"Sends",
"simple",
"string",
"based",
"text",
"message"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/XMPP/Client.php#L213-L221 |
22,108 | surebert/surebert-framework | src/sb/XMPP/Client.php | Client.sendAcceptSubscriptionRequest | public function sendAcceptSubscriptionRequest($to)
{
$presence = new \sb\XMPP\Presence();
$presence->setType('subscribed');
$presence->setTo($to);
return $this->sendPresence($presence);
} | php | public function sendAcceptSubscriptionRequest($to)
{
$presence = new \sb\XMPP\Presence();
$presence->setType('subscribed');
$presence->setTo($to);
return $this->sendPresence($presence);
} | [
"public",
"function",
"sendAcceptSubscriptionRequest",
"(",
"$",
"to",
")",
"{",
"$",
"presence",
"=",
"new",
"\\",
"sb",
"\\",
"XMPP",
"\\",
"Presence",
"(",
")",
";",
"$",
"presence",
"->",
"setType",
"(",
"'subscribed'",
")",
";",
"$",
"presence",
"->... | Send a presence message accepting subscription request to a jid
@param string $to The jid of the person to send the acceptance request to
@return boolean | [
"Send",
"a",
"presence",
"message",
"accepting",
"subscription",
"request",
"to",
"a",
"jid"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/XMPP/Client.php#L228-L234 |
22,109 | surebert/surebert-framework | src/sb/XMPP/Client.php | Client.sendSubscriptionRequest | public function sendSubscriptionRequest($to)
{
$presence = new \sb\XMPP\Presence();
$presence->setTo($to);
$presence->setType('subscribe');
$presence->setFrom($this->jid);
return $this->sendPresence($presence);
} | php | public function sendSubscriptionRequest($to)
{
$presence = new \sb\XMPP\Presence();
$presence->setTo($to);
$presence->setType('subscribe');
$presence->setFrom($this->jid);
return $this->sendPresence($presence);
} | [
"public",
"function",
"sendSubscriptionRequest",
"(",
"$",
"to",
")",
"{",
"$",
"presence",
"=",
"new",
"\\",
"sb",
"\\",
"XMPP",
"\\",
"Presence",
"(",
")",
";",
"$",
"presence",
"->",
"setTo",
"(",
"$",
"to",
")",
";",
"$",
"presence",
"->",
"setTy... | Sends a subscription request to a jid
@param string $to The hid to send the subscription request to
@return boolean | [
"Sends",
"a",
"subscription",
"request",
"to",
"a",
"jid"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/XMPP/Client.php#L241-L250 |
22,110 | surebert/surebert-framework | src/sb/XMPP/Client.php | Client.sleep | public function sleep($secs)
{
$str = 'Going to sleep for '.$secs.'secs';
$this->log('NOTICE: '.$str);
$this->setStatus($str);
sleep($secs);
$this->setStatus($this->status ? $this->status : 'awake');
} | php | public function sleep($secs)
{
$str = 'Going to sleep for '.$secs.'secs';
$this->log('NOTICE: '.$str);
$this->setStatus($str);
sleep($secs);
$this->setStatus($this->status ? $this->status : 'awake');
} | [
"public",
"function",
"sleep",
"(",
"$",
"secs",
")",
"{",
"$",
"str",
"=",
"'Going to sleep for '",
".",
"$",
"secs",
".",
"'secs'",
";",
"$",
"this",
"->",
"log",
"(",
"'NOTICE: '",
".",
"$",
"str",
")",
";",
"$",
"this",
"->",
"setStatus",
"(",
... | Puts the bot to sleep for a while
@param integer $secs | [
"Puts",
"the",
"bot",
"to",
"sleep",
"for",
"a",
"while"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/XMPP/Client.php#L310-L317 |
22,111 | surebert/surebert-framework | src/sb/XMPP/Client.php | Client.composingStart | public function composingStart($to)
{
$message = new \sb\XMPP\Message();
$message->setTo($to);
$message->setFrom($this->jid);
$message->setType('chat');
$node = $message->createElement('composing');
$attr = $message->createAttribute('xmlns');
$node->appendChi... | php | public function composingStart($to)
{
$message = new \sb\XMPP\Message();
$message->setTo($to);
$message->setFrom($this->jid);
$message->setType('chat');
$node = $message->createElement('composing');
$attr = $message->createAttribute('xmlns');
$node->appendChi... | [
"public",
"function",
"composingStart",
"(",
"$",
"to",
")",
"{",
"$",
"message",
"=",
"new",
"\\",
"sb",
"\\",
"XMPP",
"\\",
"Message",
"(",
")",
";",
"$",
"message",
"->",
"setTo",
"(",
"$",
"to",
")",
";",
"$",
"message",
"->",
"setFrom",
"(",
... | Send an indication that the bot is composing text.
@param string $to The jid to send to | [
"Send",
"an",
"indication",
"that",
"the",
"bot",
"is",
"composing",
"text",
"."
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/XMPP/Client.php#L323-L338 |
22,112 | surebert/surebert-framework | src/sb/XMPP/Client.php | Client.read | final public function read($byte_count=null)
{
$buffer = '';
$read = array($this->socket);
$updated = @stream_select($read, $write, $except, 1);
if ($updated > 0) {
$data = fread($this->socket, 4096);
if($data) {
$buffer = $data;
... | php | final public function read($byte_count=null)
{
$buffer = '';
$read = array($this->socket);
$updated = @stream_select($read, $write, $except, 1);
if ($updated > 0) {
$data = fread($this->socket, 4096);
if($data) {
$buffer = $data;
... | [
"final",
"public",
"function",
"read",
"(",
"$",
"byte_count",
"=",
"null",
")",
"{",
"$",
"buffer",
"=",
"''",
";",
"$",
"read",
"=",
"array",
"(",
"$",
"this",
"->",
"socket",
")",
";",
"$",
"updated",
"=",
"@",
"stream_select",
"(",
"$",
"read",... | Reads from the socket, should be protected but can't because this is inherited as public
@return string The buffer data read from the socket | [
"Reads",
"from",
"the",
"socket",
"should",
"be",
"protected",
"but",
"can",
"t",
"because",
"this",
"is",
"inherited",
"as",
"public"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/XMPP/Client.php#L366-L387 |
22,113 | surebert/surebert-framework | src/sb/XMPP/Client.php | Client.listen | final public function listen()
{
$this->log("Listening...");
$x = 1;
while($x){
$x++;
$xml = $this->read(1024);
if(!empty($xml)){
if($this->onRead($xml) === false){
return false;
}
}
... | php | final public function listen()
{
$this->log("Listening...");
$x = 1;
while($x){
$x++;
$xml = $this->read(1024);
if(!empty($xml)){
if($this->onRead($xml) === false){
return false;
}
}
... | [
"final",
"public",
"function",
"listen",
"(",
")",
"{",
"$",
"this",
"->",
"log",
"(",
"\"Listening...\"",
")",
";",
"$",
"x",
"=",
"1",
";",
"while",
"(",
"$",
"x",
")",
"{",
"$",
"x",
"++",
";",
"$",
"xml",
"=",
"$",
"this",
"->",
"read",
"... | Listens for incoming chat on the socket | [
"Listens",
"for",
"incoming",
"chat",
"on",
"the",
"socket"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/XMPP/Client.php#L392-L456 |
22,114 | surebert/surebert-framework | src/sb/XMPP/Client.php | Client.write | final public function write($xml)
{
if($xml instanceof \SimpleXMLElement){
$xml = $xml->asXML();
} elseif($xml instanceof \DOMDocument){
$xml = $xml->saveXML();
}
$this->log("SENT: ".$xml);
return parent::write($xml);
} | php | final public function write($xml)
{
if($xml instanceof \SimpleXMLElement){
$xml = $xml->asXML();
} elseif($xml instanceof \DOMDocument){
$xml = $xml->saveXML();
}
$this->log("SENT: ".$xml);
return parent::write($xml);
} | [
"final",
"public",
"function",
"write",
"(",
"$",
"xml",
")",
"{",
"if",
"(",
"$",
"xml",
"instanceof",
"\\",
"SimpleXMLElement",
")",
"{",
"$",
"xml",
"=",
"$",
"xml",
"->",
"asXML",
"(",
")",
";",
"}",
"elseif",
"(",
"$",
"xml",
"instanceof",
"\\... | Writes XML to the socket client
@param mixed $xml Can be DOMDocument, SimpleXMLElement or string of XML
@return <type> | [
"Writes",
"XML",
"to",
"the",
"socket",
"client"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/XMPP/Client.php#L463-L475 |
22,115 | surebert/surebert-framework | src/sb/XMPP/Client.php | Client.close | final public function close()
{
$this->onCloseConnection();
if($this->socket){
$this->write("</stream:stream>");
parent::close();
$this->connected = false;
}
} | php | final public function close()
{
$this->onCloseConnection();
if($this->socket){
$this->write("</stream:stream>");
parent::close();
$this->connected = false;
}
} | [
"final",
"public",
"function",
"close",
"(",
")",
"{",
"$",
"this",
"->",
"onCloseConnection",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"socket",
")",
"{",
"$",
"this",
"->",
"write",
"(",
"\"</stream:stream>\"",
")",
";",
"parent",
"::",
"close",
... | Ends the stream and closes the connection | [
"Ends",
"the",
"stream",
"and",
"closes",
"the",
"connection"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/XMPP/Client.php#L505-L516 |
22,116 | GrupaZero/api | src/Gzero/Api/Controller/Admin/ContentController.php | ContentController.indexTree | public function indexTree($id = null)
{
$this->authorize('readList', Content::class);
$input = $this->validator->validate('tree');
$params = $this->processor->process($input)->getProcessedFields();
$this->getSerializer()->parseIncludes('children'); // We need to enable children incl... | php | public function indexTree($id = null)
{
$this->authorize('readList', Content::class);
$input = $this->validator->validate('tree');
$params = $this->processor->process($input)->getProcessedFields();
$this->getSerializer()->parseIncludes('children'); // We need to enable children incl... | [
"public",
"function",
"indexTree",
"(",
"$",
"id",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"authorize",
"(",
"'readList'",
",",
"Content",
"::",
"class",
")",
";",
"$",
"input",
"=",
"$",
"this",
"->",
"validator",
"->",
"validate",
"(",
"'tree'",
... | Display a listing of the resource as nested tree.
@param int|null $id Id used for nested resources
@return \Illuminate\Http\JsonResponse | [
"Display",
"a",
"listing",
"of",
"the",
"resource",
"as",
"nested",
"tree",
"."
] | fc544bb6057274e9d5e7b617346c3f854ea5effd | https://github.com/GrupaZero/api/blob/fc544bb6057274e9d5e7b617346c3f854ea5effd/src/Gzero/Api/Controller/Admin/ContentController.php#L132-L168 |
22,117 | GrupaZero/api | src/Gzero/Api/Controller/Admin/ContentController.php | ContentController.buildSyncData | protected function buildSyncData(array $input)
{
$syncData = [];
foreach ($input['data'] as $item) {
$syncData[$item['id']] = ['weight' => isset($item['weight']) ? $item['weight'] : 0];
}
return $syncData;
} | php | protected function buildSyncData(array $input)
{
$syncData = [];
foreach ($input['data'] as $item) {
$syncData[$item['id']] = ['weight' => isset($item['weight']) ? $item['weight'] : 0];
}
return $syncData;
} | [
"protected",
"function",
"buildSyncData",
"(",
"array",
"$",
"input",
")",
"{",
"$",
"syncData",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"input",
"[",
"'data'",
"]",
"as",
"$",
"item",
")",
"{",
"$",
"syncData",
"[",
"$",
"item",
"[",
"'id'",
"]",... | It builds syncData
@param array $input Validated input
@return mixed | [
"It",
"builds",
"syncData"
] | fc544bb6057274e9d5e7b617346c3f854ea5effd | https://github.com/GrupaZero/api/blob/fc544bb6057274e9d5e7b617346c3f854ea5effd/src/Gzero/Api/Controller/Admin/ContentController.php#L316-L323 |
22,118 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Cache/src/storage/memory.php | ezcCacheStorageMemory.getRemainingLifetime | public function getRemainingLifetime( $id, $attributes = array() )
{
if ( count( $found = $this->search( $id, $attributes ) ) > 0 )
{
$identifier = $found[0][2];
return $this->calcLifetime( $identifier );
}
return 0;
} | php | public function getRemainingLifetime( $id, $attributes = array() )
{
if ( count( $found = $this->search( $id, $attributes ) ) > 0 )
{
$identifier = $found[0][2];
return $this->calcLifetime( $identifier );
}
return 0;
} | [
"public",
"function",
"getRemainingLifetime",
"(",
"$",
"id",
",",
"$",
"attributes",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"found",
"=",
"$",
"this",
"->",
"search",
"(",
"$",
"id",
",",
"$",
"attributes",
")",
")",
">",
... | Returns the time in seconds which remains for a cache object, before it
gets outdated. In case the cache object is already outdated or does not
exists, this method returns 0.
@param string $id The item ID
@param array(string=>string) $attributes Attributes describing the data
@return int The remaining lifetime (0 if i... | [
"Returns",
"the",
"time",
"in",
"seconds",
"which",
"remains",
"for",
"a",
"cache",
"object",
"before",
"it",
"gets",
"outdated",
".",
"In",
"case",
"the",
"cache",
"object",
"is",
"already",
"outdated",
"or",
"does",
"not",
"exists",
"this",
"method",
"re... | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Cache/src/storage/memory.php#L291-L299 |
22,119 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Cache/src/storage/memory.php | ezcCacheStorageMemory.generateIdentifier | public function generateIdentifier( $id, $attributes = null )
{
$identifier = strtolower( $this->backendName )
. $this->properties['location']
. $id
. (
( $attributes !== null && !empty( $attributes ) )
? md5( serialize( $attributes ) )
... | php | public function generateIdentifier( $id, $attributes = null )
{
$identifier = strtolower( $this->backendName )
. $this->properties['location']
. $id
. (
( $attributes !== null && !empty( $attributes ) )
? md5( serialize( $attributes ) )
... | [
"public",
"function",
"generateIdentifier",
"(",
"$",
"id",
",",
"$",
"attributes",
"=",
"null",
")",
"{",
"$",
"identifier",
"=",
"strtolower",
"(",
"$",
"this",
"->",
"backendName",
")",
".",
"$",
"this",
"->",
"properties",
"[",
"'location'",
"]",
"."... | Generates the storage internal identifier from ID and attributes.
@param string $id The ID
@param array(string=>string) $attributes Attributes describing the data
@return string The generated identifier | [
"Generates",
"the",
"storage",
"internal",
"identifier",
"from",
"ID",
"and",
"attributes",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Cache/src/storage/memory.php#L308-L319 |
22,120 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Cache/src/storage/memory.php | ezcCacheStorageMemory.purge | public function purge( $limit = null )
{
$this->fetchSearchRegistry( true );
$purgedIds = array();
$ttl = $this->properties['options']->ttl;
foreach ( $this->searchRegistry[$this->properties['location']] as $id => $identifiers )
{
$deleted = false;
... | php | public function purge( $limit = null )
{
$this->fetchSearchRegistry( true );
$purgedIds = array();
$ttl = $this->properties['options']->ttl;
foreach ( $this->searchRegistry[$this->properties['location']] as $id => $identifiers )
{
$deleted = false;
... | [
"public",
"function",
"purge",
"(",
"$",
"limit",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"fetchSearchRegistry",
"(",
"true",
")",
";",
"$",
"purgedIds",
"=",
"array",
"(",
")",
";",
"$",
"ttl",
"=",
"$",
"this",
"->",
"properties",
"[",
"'options'... | Purge outdated data from the storage.
This method purges outdated data from the cache. If $limit is given, a
maximum of $limit items is purged. Otherwise all outdated items are
purged. The method returns an array containing the IDs of all cache
items that have been purged.
@param int $limit
@return array(string) | [
"Purge",
"outdated",
"data",
"from",
"the",
"storage",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Cache/src/storage/memory.php#L332-L366 |
22,121 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Cache/src/storage/memory.php | ezcCacheStorageMemory.reset | public function reset()
{
$this->backend->reset();
$this->registry = array();
$this->searchRegistry = array( $this->properties['location'] => null );
$this->storeSearchRegistry();
} | php | public function reset()
{
$this->backend->reset();
$this->registry = array();
$this->searchRegistry = array( $this->properties['location'] => null );
$this->storeSearchRegistry();
} | [
"public",
"function",
"reset",
"(",
")",
"{",
"$",
"this",
"->",
"backend",
"->",
"reset",
"(",
")",
";",
"$",
"this",
"->",
"registry",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"searchRegistry",
"=",
"array",
"(",
"$",
"this",
"->",
"proper... | Reset the complete storage.
This method resets the complete cache storage. All content (including
content stored with the {@link ezcCacheStackMetaDataStorage} interfacer) must
be deleted and the cache storage must appear as if it has just newly
been created.
@return void | [
"Reset",
"the",
"complete",
"storage",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Cache/src/storage/memory.php#L378-L384 |
22,122 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Cache/src/storage/memory.php | ezcCacheStorageMemory.registerIdentifier | protected function registerIdentifier( $id = null, $attributes = array(), $identifier = null )
{
$identifier = ( $identifier !== null ) ? $identifier : $this->generateIdentifier( $id, $attributes );
$location = $this->properties['location'];
$this->fetchSearchRegistry();
// Makes s... | php | protected function registerIdentifier( $id = null, $attributes = array(), $identifier = null )
{
$identifier = ( $identifier !== null ) ? $identifier : $this->generateIdentifier( $id, $attributes );
$location = $this->properties['location'];
$this->fetchSearchRegistry();
// Makes s... | [
"protected",
"function",
"registerIdentifier",
"(",
"$",
"id",
"=",
"null",
",",
"$",
"attributes",
"=",
"array",
"(",
")",
",",
"$",
"identifier",
"=",
"null",
")",
"{",
"$",
"identifier",
"=",
"(",
"$",
"identifier",
"!==",
"null",
")",
"?",
"$",
"... | Registers an identifier to facilitate searching.
@param string $id ID for the cache item
@param array $attributes Attributes for the cache item
@param string $identifier Identifier generated for the cache item | [
"Registers",
"an",
"identifier",
"to",
"facilitate",
"searching",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Cache/src/storage/memory.php#L513-L533 |
22,123 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Cache/src/storage/memory.php | ezcCacheStorageMemory.unRegisterIdentifier | protected function unRegisterIdentifier( $id = null, $attributes = array(), $identifier = null, $delayStore = false )
{
$identifier = ( $identifier !== null ) ? $identifier : $this->generateIdentifier( $id, $attributes );
$location = $this->properties['location'];
$this->fetchSearchRegistry... | php | protected function unRegisterIdentifier( $id = null, $attributes = array(), $identifier = null, $delayStore = false )
{
$identifier = ( $identifier !== null ) ? $identifier : $this->generateIdentifier( $id, $attributes );
$location = $this->properties['location'];
$this->fetchSearchRegistry... | [
"protected",
"function",
"unRegisterIdentifier",
"(",
"$",
"id",
"=",
"null",
",",
"$",
"attributes",
"=",
"array",
"(",
")",
",",
"$",
"identifier",
"=",
"null",
",",
"$",
"delayStore",
"=",
"false",
")",
"{",
"$",
"identifier",
"=",
"(",
"$",
"identi... | Un-registers a previously registered identifier.
@param string $id ID for the cache item
@param array $attributes Attributes for the cache item
@param string $identifier Identifier generated for the cache item
@param bool $delayStore Delays the storing of the updated search registry | [
"Un",
"-",
"registers",
"a",
"previously",
"registered",
"identifier",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Cache/src/storage/memory.php#L543-L563 |
22,124 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Cache/src/storage/memory.php | ezcCacheStorageMemory.fetchSearchRegistry | protected function fetchSearchRegistry( $requireFresh = false )
{
$location = $this->properties['location'];
if ( !is_array( $this->searchRegistry ) )
{
$this->searchRegistry = array();
}
if ( !isset( $this->searchRegistry[$location] )
|| !is_array( $... | php | protected function fetchSearchRegistry( $requireFresh = false )
{
$location = $this->properties['location'];
if ( !is_array( $this->searchRegistry ) )
{
$this->searchRegistry = array();
}
if ( !isset( $this->searchRegistry[$location] )
|| !is_array( $... | [
"protected",
"function",
"fetchSearchRegistry",
"(",
"$",
"requireFresh",
"=",
"false",
")",
"{",
"$",
"location",
"=",
"$",
"this",
"->",
"properties",
"[",
"'location'",
"]",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"this",
"->",
"searchRegistry",
")",... | Fetches the search registry from the backend or creates it if empty.
@param bool $requireFresh To create a new search registry or not | [
"Fetches",
"the",
"search",
"registry",
"from",
"the",
"backend",
"or",
"creates",
"it",
"if",
"empty",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Cache/src/storage/memory.php#L570-L589 |
22,125 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Cache/src/storage/memory.php | ezcCacheStorageMemory.storeSearchRegistry | protected function storeSearchRegistry()
{
$location = $this->properties['location'];
$this->backend->store( $this->registryName . '_' . urlencode( $location ), $this->searchRegistry[$location] );
$this->searchRegistry[$location] = null;
$this->fetchSearchRegistry( true );
} | php | protected function storeSearchRegistry()
{
$location = $this->properties['location'];
$this->backend->store( $this->registryName . '_' . urlencode( $location ), $this->searchRegistry[$location] );
$this->searchRegistry[$location] = null;
$this->fetchSearchRegistry( true );
} | [
"protected",
"function",
"storeSearchRegistry",
"(",
")",
"{",
"$",
"location",
"=",
"$",
"this",
"->",
"properties",
"[",
"'location'",
"]",
";",
"$",
"this",
"->",
"backend",
"->",
"store",
"(",
"$",
"this",
"->",
"registryName",
".",
"'_'",
".",
"urle... | Stores the search registry in the backend. | [
"Stores",
"the",
"search",
"registry",
"in",
"the",
"backend",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Cache/src/storage/memory.php#L594-L602 |
22,126 | interactivesolutions/honeycomb-core | src/http/controllers/HCBaseController.php | HCBaseController.apiStore | public function apiStore()
{
DB::beginTransaction();
try {
$record = $this->__apiStore();
} catch (\Exception $e) {
DB::rollback();
return HCLog::error('CORE-0002' . $e->getCode(), $e->getMessage());
}
DB::commit();
return respo... | php | public function apiStore()
{
DB::beginTransaction();
try {
$record = $this->__apiStore();
} catch (\Exception $e) {
DB::rollback();
return HCLog::error('CORE-0002' . $e->getCode(), $e->getMessage());
}
DB::commit();
return respo... | [
"public",
"function",
"apiStore",
"(",
")",
"{",
"DB",
"::",
"beginTransaction",
"(",
")",
";",
"try",
"{",
"$",
"record",
"=",
"$",
"this",
"->",
"__apiStore",
"(",
")",
";",
"}",
"catch",
"(",
"\\",
"Exception",
"$",
"e",
")",
"{",
"DB",
"::",
... | Function which will store new record
@return mixed | [
"Function",
"which",
"will",
"store",
"new",
"record"
] | 06b8d88bb285e73a1a286e60411ca5f41863f39f | https://github.com/interactivesolutions/honeycomb-core/blob/06b8d88bb285e73a1a286e60411ca5f41863f39f/src/http/controllers/HCBaseController.php#L100-L115 |
22,127 | interactivesolutions/honeycomb-core | src/http/controllers/HCBaseController.php | HCBaseController.apiUpdate | public function apiUpdate(string $id)
{
DB::beginTransaction();
try {
$record = $this->__apiUpdate($id);
} catch (\Exception $e) {
DB::rollback();
return HCLog::error('CORE-0003' . $e->getCode(), $e->getMessage());
}
DB::commit();
... | php | public function apiUpdate(string $id)
{
DB::beginTransaction();
try {
$record = $this->__apiUpdate($id);
} catch (\Exception $e) {
DB::rollback();
return HCLog::error('CORE-0003' . $e->getCode(), $e->getMessage());
}
DB::commit();
... | [
"public",
"function",
"apiUpdate",
"(",
"string",
"$",
"id",
")",
"{",
"DB",
"::",
"beginTransaction",
"(",
")",
";",
"try",
"{",
"$",
"record",
"=",
"$",
"this",
"->",
"__apiUpdate",
"(",
"$",
"id",
")",
";",
"}",
"catch",
"(",
"\\",
"Exception",
... | Function which will update record
@param $id
@return mixed | [
"Function",
"which",
"will",
"update",
"record"
] | 06b8d88bb285e73a1a286e60411ca5f41863f39f | https://github.com/interactivesolutions/honeycomb-core/blob/06b8d88bb285e73a1a286e60411ca5f41863f39f/src/http/controllers/HCBaseController.php#L138-L153 |
22,128 | interactivesolutions/honeycomb-core | src/http/controllers/HCBaseController.php | HCBaseController.apiUpdateStrict | public function apiUpdateStrict(string $id)
{
DB::beginTransaction();
try {
$record = $this->__apiUpdateStrict($id);
} catch (\Exception $e) {
DB::rollback();
return HCLog::error('CORE-0003' . $e->getCode(), $e->getMessage());
}
DB::comm... | php | public function apiUpdateStrict(string $id)
{
DB::beginTransaction();
try {
$record = $this->__apiUpdateStrict($id);
} catch (\Exception $e) {
DB::rollback();
return HCLog::error('CORE-0003' . $e->getCode(), $e->getMessage());
}
DB::comm... | [
"public",
"function",
"apiUpdateStrict",
"(",
"string",
"$",
"id",
")",
"{",
"DB",
"::",
"beginTransaction",
"(",
")",
";",
"try",
"{",
"$",
"record",
"=",
"$",
"this",
"->",
"__apiUpdateStrict",
"(",
"$",
"id",
")",
";",
"}",
"catch",
"(",
"\\",
"Ex... | Function which will update specific values of the record
@param $id
@return mixed | [
"Function",
"which",
"will",
"update",
"specific",
"values",
"of",
"the",
"record"
] | 06b8d88bb285e73a1a286e60411ca5f41863f39f | https://github.com/interactivesolutions/honeycomb-core/blob/06b8d88bb285e73a1a286e60411ca5f41863f39f/src/http/controllers/HCBaseController.php#L177-L192 |
22,129 | interactivesolutions/honeycomb-core | src/http/controllers/HCBaseController.php | HCBaseController.initializeDelete | private function initializeDelete(string $id = null, bool $soft)
{
if ($id)
$list = [$id];
else
$list = request()->input('list');
if (sizeOf($list) <= 0)
return HCLog::info('CORE-0004', trans('HCTranslations::core.nothing_to_delete'));
DB::beginT... | php | private function initializeDelete(string $id = null, bool $soft)
{
if ($id)
$list = [$id];
else
$list = request()->input('list');
if (sizeOf($list) <= 0)
return HCLog::info('CORE-0004', trans('HCTranslations::core.nothing_to_delete'));
DB::beginT... | [
"private",
"function",
"initializeDelete",
"(",
"string",
"$",
"id",
"=",
"null",
",",
"bool",
"$",
"soft",
")",
"{",
"if",
"(",
"$",
"id",
")",
"$",
"list",
"=",
"[",
"$",
"id",
"]",
";",
"else",
"$",
"list",
"=",
"request",
"(",
")",
"->",
"i... | Function which will actually call deletion function
@param string $id
@param bool $soft
@return array
@internal param $callback | [
"Function",
"which",
"will",
"actually",
"call",
"deletion",
"function"
] | 06b8d88bb285e73a1a286e60411ca5f41863f39f | https://github.com/interactivesolutions/honeycomb-core/blob/06b8d88bb285e73a1a286e60411ca5f41863f39f/src/http/controllers/HCBaseController.php#L245-L274 |
22,130 | interactivesolutions/honeycomb-core | src/http/controllers/HCBaseController.php | HCBaseController.apiRestore | public function apiRestore()
{
$toRestore = request()->input('list');
if (sizeOf($toRestore) <= 0)
return HCLog::info('CORE-0006', trans('HCTranslations::core.nothing_to_restore'));
$response = $this->__apiRestore($toRestore);
if (isset($response))
return $... | php | public function apiRestore()
{
$toRestore = request()->input('list');
if (sizeOf($toRestore) <= 0)
return HCLog::info('CORE-0006', trans('HCTranslations::core.nothing_to_restore'));
$response = $this->__apiRestore($toRestore);
if (isset($response))
return $... | [
"public",
"function",
"apiRestore",
"(",
")",
"{",
"$",
"toRestore",
"=",
"request",
"(",
")",
"->",
"input",
"(",
"'list'",
")",
";",
"if",
"(",
"sizeOf",
"(",
"$",
"toRestore",
")",
"<=",
"0",
")",
"return",
"HCLog",
"::",
"info",
"(",
"'CORE-0006'... | Recovers items from database by given id's
Just need to set wanted Model name with list parameter
@return mixed | [
"Recovers",
"items",
"from",
"database",
"by",
"given",
"id",
"s",
"Just",
"need",
"to",
"set",
"wanted",
"Model",
"name",
"with",
"list",
"parameter"
] | 06b8d88bb285e73a1a286e60411ca5f41863f39f | https://github.com/interactivesolutions/honeycomb-core/blob/06b8d88bb285e73a1a286e60411ca5f41863f39f/src/http/controllers/HCBaseController.php#L313-L326 |
22,131 | interactivesolutions/honeycomb-core | src/http/controllers/HCBaseController.php | HCBaseController.apiMerge | public function apiMerge()
{
DB::beginTransaction();
try {
$record = $this->__apiMerge();
} catch (\Exception $e) {
DB::rollback();
return HCLog::error('CORE-0007' . $e->getCode(), $e->getMessage());
}
DB::commit();
return $reco... | php | public function apiMerge()
{
DB::beginTransaction();
try {
$record = $this->__apiMerge();
} catch (\Exception $e) {
DB::rollback();
return HCLog::error('CORE-0007' . $e->getCode(), $e->getMessage());
}
DB::commit();
return $reco... | [
"public",
"function",
"apiMerge",
"(",
")",
"{",
"DB",
"::",
"beginTransaction",
"(",
")",
";",
"try",
"{",
"$",
"record",
"=",
"$",
"this",
"->",
"__apiMerge",
"(",
")",
";",
"}",
"catch",
"(",
"\\",
"Exception",
"$",
"e",
")",
"{",
"DB",
"::",
... | Function will can be used to merge multiple records into one
@return mixed | [
"Function",
"will",
"can",
"be",
"used",
"to",
"merge",
"multiple",
"records",
"into",
"one"
] | 06b8d88bb285e73a1a286e60411ca5f41863f39f | https://github.com/interactivesolutions/honeycomb-core/blob/06b8d88bb285e73a1a286e60411ca5f41863f39f/src/http/controllers/HCBaseController.php#L359-L374 |
22,132 | WellCommerce/AppBundle | Service/Currency/Importer/EcbRatesImporter.php | EcbRatesImporter.downloadExchangeRatesTable | protected function downloadExchangeRatesTable()
{
try {
$this->table[$this->baseCurrency] = 1;
$xml = simplexml_load_file($this->url, 'SimpleXMLElement', LIBXML_NOWARNING);
if ($xml instanceof \SimpleXMLElement) {
$data = $xml->xpath('//gesmes:Envelope/... | php | protected function downloadExchangeRatesTable()
{
try {
$this->table[$this->baseCurrency] = 1;
$xml = simplexml_load_file($this->url, 'SimpleXMLElement', LIBXML_NOWARNING);
if ($xml instanceof \SimpleXMLElement) {
$data = $xml->xpath('//gesmes:Envelope/... | [
"protected",
"function",
"downloadExchangeRatesTable",
"(",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"table",
"[",
"$",
"this",
"->",
"baseCurrency",
"]",
"=",
"1",
";",
"$",
"xml",
"=",
"simplexml_load_file",
"(",
"$",
"this",
"->",
"url",
",",
"'Simple... | Downloads exchange rates table from ECB | [
"Downloads",
"exchange",
"rates",
"table",
"from",
"ECB"
] | 2add687d1c898dd0b24afd611d896e3811a0eac3 | https://github.com/WellCommerce/AppBundle/blob/2add687d1c898dd0b24afd611d896e3811a0eac3/Service/Currency/Importer/EcbRatesImporter.php#L43-L63 |
22,133 | WellCommerce/AppBundle | Service/Currency/Importer/EcbRatesImporter.php | EcbRatesImporter.updateCurrencyRates | protected function updateCurrencyRates(Currency $currency)
{
$baseExchangeRate = $this->table[$currency->getCode()];
foreach ($this->table as $currencySymbol => $exchangeRate) {
$rate = $this->calculateExchangeRate($baseExchangeRate, $currencySymbol);
$this->addUpdateExchang... | php | protected function updateCurrencyRates(Currency $currency)
{
$baseExchangeRate = $this->table[$currency->getCode()];
foreach ($this->table as $currencySymbol => $exchangeRate) {
$rate = $this->calculateExchangeRate($baseExchangeRate, $currencySymbol);
$this->addUpdateExchang... | [
"protected",
"function",
"updateCurrencyRates",
"(",
"Currency",
"$",
"currency",
")",
"{",
"$",
"baseExchangeRate",
"=",
"$",
"this",
"->",
"table",
"[",
"$",
"currency",
"->",
"getCode",
"(",
")",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"table",
"... | Updates managed currency with exchange rates
@param Currency $currency | [
"Updates",
"managed",
"currency",
"with",
"exchange",
"rates"
] | 2add687d1c898dd0b24afd611d896e3811a0eac3 | https://github.com/WellCommerce/AppBundle/blob/2add687d1c898dd0b24afd611d896e3811a0eac3/Service/Currency/Importer/EcbRatesImporter.php#L70-L80 |
22,134 | motivatedsloth/noaa | noaa/NOAA.php | NOAA.point | protected function point(){
if(!$this->point->isLoaded()){
$url = str_replace("{point}", $this->point->getLat() . "," . $this->point->getLon(), self::POINT);
$res = $this->load($url, Point::TTL);
$this->point->setProperties($res);
}
return $this->point;
} | php | protected function point(){
if(!$this->point->isLoaded()){
$url = str_replace("{point}", $this->point->getLat() . "," . $this->point->getLon(), self::POINT);
$res = $this->load($url, Point::TTL);
$this->point->setProperties($res);
}
return $this->point;
} | [
"protected",
"function",
"point",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"point",
"->",
"isLoaded",
"(",
")",
")",
"{",
"$",
"url",
"=",
"str_replace",
"(",
"\"{point}\"",
",",
"$",
"this",
"->",
"point",
"->",
"getLat",
"(",
")",
".",
... | ensure point has data loaded | [
"ensure",
"point",
"has",
"data",
"loaded"
] | 621c8dab1d774ec2810a508941f568b716ce779a | https://github.com/motivatedsloth/noaa/blob/621c8dab1d774ec2810a508941f568b716ce779a/noaa/NOAA.php#L97-L104 |
22,135 | thelia-modules/CustomerGroup | Handler/CustomerGroupHandler.php | CustomerGroupHandler.getGroup | public function getGroup()
{
/** @var Request $request */
$request = $this->container->get('request');
$groupInfo = $request->getSession()->get(CustomerGroup::getModuleCode());
return $groupInfo;
} | php | public function getGroup()
{
/** @var Request $request */
$request = $this->container->get('request');
$groupInfo = $request->getSession()->get(CustomerGroup::getModuleCode());
return $groupInfo;
} | [
"public",
"function",
"getGroup",
"(",
")",
"{",
"/** @var Request $request */",
"$",
"request",
"=",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
"'request'",
")",
";",
"$",
"groupInfo",
"=",
"$",
"request",
"->",
"getSession",
"(",
")",
"->",
"get",... | Get CustomerGroup of the current customer
@return array|null | [
"Get",
"CustomerGroup",
"of",
"the",
"current",
"customer"
] | 672cc64c686812f6a95cf0d702111f93d8c0e850 | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Handler/CustomerGroupHandler.php#L33-L41 |
22,136 | thelia-modules/CustomerGroup | Handler/CustomerGroupHandler.php | CustomerGroupHandler.checkGroup | public function checkGroup($groupCode)
{
/** @var SecurityContext $securityContext */
$securityContext = $this->container->get('thelia.securityContext');
return $securityContext->hasCustomerUser() && $this->getGroupCode() === $groupCode;
} | php | public function checkGroup($groupCode)
{
/** @var SecurityContext $securityContext */
$securityContext = $this->container->get('thelia.securityContext');
return $securityContext->hasCustomerUser() && $this->getGroupCode() === $groupCode;
} | [
"public",
"function",
"checkGroup",
"(",
"$",
"groupCode",
")",
"{",
"/** @var SecurityContext $securityContext */",
"$",
"securityContext",
"=",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
"'thelia.securityContext'",
")",
";",
"return",
"$",
"securityContext",
... | Check if the current customer is in the asked group
@param string $groupCode Code for the group to check
@return boolean
@uses getGroupCode() | [
"Check",
"if",
"the",
"current",
"customer",
"is",
"in",
"the",
"asked",
"group"
] | 672cc64c686812f6a95cf0d702111f93d8c0e850 | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Handler/CustomerGroupHandler.php#L66-L72 |
22,137 | thelia-modules/CustomerGroup | Handler/CustomerGroupHandler.php | CustomerGroupHandler.checkCustomerHasGroup | public function checkCustomerHasGroup(Customer $customer, $groupCode)
{
$group = CustomerCustomerGroupQuery::create()
->filterByCustomer($customer)
->useCustomerGroupQuery()
->filterByCode($groupCode)
->endUse()
->findOne();
return $group ... | php | public function checkCustomerHasGroup(Customer $customer, $groupCode)
{
$group = CustomerCustomerGroupQuery::create()
->filterByCustomer($customer)
->useCustomerGroupQuery()
->filterByCode($groupCode)
->endUse()
->findOne();
return $group ... | [
"public",
"function",
"checkCustomerHasGroup",
"(",
"Customer",
"$",
"customer",
",",
"$",
"groupCode",
")",
"{",
"$",
"group",
"=",
"CustomerCustomerGroupQuery",
"::",
"create",
"(",
")",
"->",
"filterByCustomer",
"(",
"$",
"customer",
")",
"->",
"useCustomerGr... | Check that a customer belongs to a group.
@param Customer $customer
@param string $groupCode
@return bool | [
"Check",
"that",
"a",
"customer",
"belongs",
"to",
"a",
"group",
"."
] | 672cc64c686812f6a95cf0d702111f93d8c0e850 | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Handler/CustomerGroupHandler.php#L82-L92 |
22,138 | kenphp/ken | src/Application.php | Application.init | protected function init() {
$this->container->set('logger', function($c) {
$configuration = $c->get('configuration');
$logger = new Logger($configuration['logger']);
return $logger;
});
$this->container->set(MiddlewareFactory::class, function($c) {
... | php | protected function init() {
$this->container->set('logger', function($c) {
$configuration = $c->get('configuration');
$logger = new Logger($configuration['logger']);
return $logger;
});
$this->container->set(MiddlewareFactory::class, function($c) {
... | [
"protected",
"function",
"init",
"(",
")",
"{",
"$",
"this",
"->",
"container",
"->",
"set",
"(",
"'logger'",
",",
"function",
"(",
"$",
"c",
")",
"{",
"$",
"configuration",
"=",
"$",
"c",
"->",
"get",
"(",
"'configuration'",
")",
";",
"$",
"logger",... | Initializes application's components | [
"Initializes",
"application",
"s",
"components"
] | c454a86f0ab55c52c88e9bff5bc6fb4e7bd9e0eb | https://github.com/kenphp/ken/blob/c454a86f0ab55c52c88e9bff5bc6fb4e7bd9e0eb/src/Application.php#L62-L103 |
22,139 | kenphp/ken | src/Application.php | Application.registerErrorHandler | public function registerErrorHandler()
{
$whoops = new \Whoops\Run();
$configuration = $this->getConfiguration();
if (isset($configuration['debug']) && $configuration['debug']) {
$whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler());
} else {
$whoops-... | php | public function registerErrorHandler()
{
$whoops = new \Whoops\Run();
$configuration = $this->getConfiguration();
if (isset($configuration['debug']) && $configuration['debug']) {
$whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler());
} else {
$whoops-... | [
"public",
"function",
"registerErrorHandler",
"(",
")",
"{",
"$",
"whoops",
"=",
"new",
"\\",
"Whoops",
"\\",
"Run",
"(",
")",
";",
"$",
"configuration",
"=",
"$",
"this",
"->",
"getConfiguration",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"configur... | Registers error handler for this application | [
"Registers",
"error",
"handler",
"for",
"this",
"application"
] | c454a86f0ab55c52c88e9bff5bc6fb4e7bd9e0eb | https://github.com/kenphp/ken/blob/c454a86f0ab55c52c88e9bff5bc6fb4e7bd9e0eb/src/Application.php#L108-L147 |
22,140 | kenphp/ken | src/Application.php | Application.run | public function run()
{
$request = $this->request;
$response = $this->response;
$config = $this->configuration;
$httpMethod = $request->getMethod();
$pathInfo = $request->getUri()->getPath();
if (empty($pathInfo)) {
$pathInfo = '/';
}
$ro... | php | public function run()
{
$request = $this->request;
$response = $this->response;
$config = $this->configuration;
$httpMethod = $request->getMethod();
$pathInfo = $request->getUri()->getPath();
if (empty($pathInfo)) {
$pathInfo = '/';
}
$ro... | [
"public",
"function",
"run",
"(",
")",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"request",
";",
"$",
"response",
"=",
"$",
"this",
"->",
"response",
";",
"$",
"config",
"=",
"$",
"this",
"->",
"configuration",
";",
"$",
"httpMethod",
"=",
"$",
... | Runs application to handle request. | [
"Runs",
"application",
"to",
"handle",
"request",
"."
] | c454a86f0ab55c52c88e9bff5bc6fb4e7bd9e0eb | https://github.com/kenphp/ken/blob/c454a86f0ab55c52c88e9bff5bc6fb4e7bd9e0eb/src/Application.php#L196-L244 |
22,141 | kenphp/ken | src/Application.php | Application.emitResponse | protected function emitResponse(ResponseInterface $response) {
$this->logger->flush();
(new \Zend\HttpHandlerRunner\Emitter\SapiEmitter())->emit($response);
} | php | protected function emitResponse(ResponseInterface $response) {
$this->logger->flush();
(new \Zend\HttpHandlerRunner\Emitter\SapiEmitter())->emit($response);
} | [
"protected",
"function",
"emitResponse",
"(",
"ResponseInterface",
"$",
"response",
")",
"{",
"$",
"this",
"->",
"logger",
"->",
"flush",
"(",
")",
";",
"(",
"new",
"\\",
"Zend",
"\\",
"HttpHandlerRunner",
"\\",
"Emitter",
"\\",
"SapiEmitter",
"(",
")",
")... | Emits response to client
@param ResponseInterface $response | [
"Emits",
"response",
"to",
"client"
] | c454a86f0ab55c52c88e9bff5bc6fb4e7bd9e0eb | https://github.com/kenphp/ken/blob/c454a86f0ab55c52c88e9bff5bc6fb4e7bd9e0eb/src/Application.php#L250-L253 |
22,142 | kenphp/ken | src/Application.php | Application.convertCallbackToClosure | protected function convertCallbackToClosure($callback, $namespace)
{
if ($callback instanceof Closure || is_callable($callback)) {
return $callback;
} elseif (is_string($callback)) {
$namespace = rtrim($namespace, '\\').'\\';
$arrCallback = explode('::', $callback... | php | protected function convertCallbackToClosure($callback, $namespace)
{
if ($callback instanceof Closure || is_callable($callback)) {
return $callback;
} elseif (is_string($callback)) {
$namespace = rtrim($namespace, '\\').'\\';
$arrCallback = explode('::', $callback... | [
"protected",
"function",
"convertCallbackToClosure",
"(",
"$",
"callback",
",",
"$",
"namespace",
")",
"{",
"if",
"(",
"$",
"callback",
"instanceof",
"Closure",
"||",
"is_callable",
"(",
"$",
"callback",
")",
")",
"{",
"return",
"$",
"callback",
";",
"}",
... | Converts callback to Closure.
@param string|Closure $callback
@param string $namespace
@return Closure | [
"Converts",
"callback",
"to",
"Closure",
"."
] | c454a86f0ab55c52c88e9bff5bc6fb4e7bd9e0eb | https://github.com/kenphp/ken/blob/c454a86f0ab55c52c88e9bff5bc6fb4e7bd9e0eb/src/Application.php#L263-L282 |
22,143 | DesignPond/newsletter | src/Newsletter/Worker/CampagneWorker.php | CampagneWorker.arretsToHide | public function arretsToHide($newsletter_id = null)
{
$campagnes = $this->campagne->getAll($newsletter_id)->where('status','brouillon');
return $campagnes->flatMap(function ($campagne) {
return $campagne->content;
})->map(function ($content, $key) {
if($... | php | public function arretsToHide($newsletter_id = null)
{
$campagnes = $this->campagne->getAll($newsletter_id)->where('status','brouillon');
return $campagnes->flatMap(function ($campagne) {
return $campagne->content;
})->map(function ($content, $key) {
if($... | [
"public",
"function",
"arretsToHide",
"(",
"$",
"newsletter_id",
"=",
"null",
")",
"{",
"$",
"campagnes",
"=",
"$",
"this",
"->",
"campagne",
"->",
"getAll",
"(",
"$",
"newsletter_id",
")",
"->",
"where",
"(",
"'status'",
",",
"'brouillon'",
")",
";",
"r... | Interaction with site controllers
List of arrets in non sent campagne to hide on frontend | [
"Interaction",
"with",
"site",
"controllers",
"List",
"of",
"arrets",
"in",
"non",
"sent",
"campagne",
"to",
"hide",
"on",
"frontend"
] | 0bf0e7a8a42fa4b90a5e937771bb80058e0a91c3 | https://github.com/DesignPond/newsletter/blob/0bf0e7a8a42fa4b90a5e937771bb80058e0a91c3/src/Newsletter/Worker/CampagneWorker.php#L28-L45 |
22,144 | DesignPond/newsletter | src/Newsletter/Worker/CampagneWorker.php | CampagneWorker.siteCampagnes | public function siteCampagnes($site_id)
{
if(config('newsletter.multi')) {
$newsletters = $this->newsletter->getSite($site_id);
return $newsletters->map(function ($newsletter, $key) {
return $newsletter->campagnes;
})->flatten(1);
}
return... | php | public function siteCampagnes($site_id)
{
if(config('newsletter.multi')) {
$newsletters = $this->newsletter->getSite($site_id);
return $newsletters->map(function ($newsletter, $key) {
return $newsletter->campagnes;
})->flatten(1);
}
return... | [
"public",
"function",
"siteCampagnes",
"(",
"$",
"site_id",
")",
"{",
"if",
"(",
"config",
"(",
"'newsletter.multi'",
")",
")",
"{",
"$",
"newsletters",
"=",
"$",
"this",
"->",
"newsletter",
"->",
"getSite",
"(",
"$",
"site_id",
")",
";",
"return",
"$",
... | All campagnes for site | [
"All",
"campagnes",
"for",
"site"
] | 0bf0e7a8a42fa4b90a5e937771bb80058e0a91c3 | https://github.com/DesignPond/newsletter/blob/0bf0e7a8a42fa4b90a5e937771bb80058e0a91c3/src/Newsletter/Worker/CampagneWorker.php#L88-L98 |
22,145 | DesignPond/newsletter | src/Newsletter/Worker/CampagneWorker.php | CampagneWorker.html | public function html($id)
{
libxml_use_internal_errors(true);
$htmldoc = new InlineStyle(file_get_contents( url('campagne/'.$id)));
$htmldoc->applyStylesheet($htmldoc->extractStylesheets());
$html = $htmldoc->getHTML();
$html = preg_replace('#<script(.*?)>(.*?)</script>#is'... | php | public function html($id)
{
libxml_use_internal_errors(true);
$htmldoc = new InlineStyle(file_get_contents( url('campagne/'.$id)));
$htmldoc->applyStylesheet($htmldoc->extractStylesheets());
$html = $htmldoc->getHTML();
$html = preg_replace('#<script(.*?)>(.*?)</script>#is'... | [
"public",
"function",
"html",
"(",
"$",
"id",
")",
"{",
"libxml_use_internal_errors",
"(",
"true",
")",
";",
"$",
"htmldoc",
"=",
"new",
"InlineStyle",
"(",
"file_get_contents",
"(",
"url",
"(",
"'campagne/'",
".",
"$",
"id",
")",
")",
")",
";",
"$",
"... | Put styles inline for campagne
Used when sending cammpagne or test | [
"Put",
"styles",
"inline",
"for",
"campagne",
"Used",
"when",
"sending",
"cammpagne",
"or",
"test"
] | 0bf0e7a8a42fa4b90a5e937771bb80058e0a91c3 | https://github.com/DesignPond/newsletter/blob/0bf0e7a8a42fa4b90a5e937771bb80058e0a91c3/src/Newsletter/Worker/CampagneWorker.php#L114-L125 |
22,146 | nabab/bbn | src/bbn/appui/mapperv2.php | mapperv2.save_config | public function save_config(array $cfg, $description, $class = 'grid')
{
if ( isset($cfg['elements']) ){
$copy = $cfg;
unset($copy['elements']);
$obj_param = [
'id_project' => 1,
'class' => $class,
'description' => $description,
'configuration' => json_enc... | php | public function save_config(array $cfg, $description, $class = 'grid')
{
if ( isset($cfg['elements']) ){
$copy = $cfg;
unset($copy['elements']);
$obj_param = [
'id_project' => 1,
'class' => $class,
'description' => $description,
'configuration' => json_enc... | [
"public",
"function",
"save_config",
"(",
"array",
"$",
"cfg",
",",
"$",
"description",
",",
"$",
"class",
"=",
"'grid'",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"cfg",
"[",
"'elements'",
"]",
")",
")",
"{",
"$",
"copy",
"=",
"$",
"cfg",
";",
"un... | Saves the given configuration in the database and returns the new ID
@param array $cfg
@param string $class
@return int|false | [
"Saves",
"the",
"given",
"configuration",
"in",
"the",
"database",
"and",
"returns",
"the",
"new",
"ID"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/mapperv2.php#L122-L169 |
22,147 | Speicher210/monsum-api | src/Service/Subscription/SubscriptionService.php | SubscriptionService.getSubscriptionById | public function getSubscriptionById($subscriptionId)
{
$subscriptions = $this
->getSubscriptions(null, null, null, $subscriptionId)
->getResponse()
->getSubscriptions();
return count($subscriptions) ? reset($subscriptions) : null;
} | php | public function getSubscriptionById($subscriptionId)
{
$subscriptions = $this
->getSubscriptions(null, null, null, $subscriptionId)
->getResponse()
->getSubscriptions();
return count($subscriptions) ? reset($subscriptions) : null;
} | [
"public",
"function",
"getSubscriptionById",
"(",
"$",
"subscriptionId",
")",
"{",
"$",
"subscriptions",
"=",
"$",
"this",
"->",
"getSubscriptions",
"(",
"null",
",",
"null",
",",
"null",
",",
"$",
"subscriptionId",
")",
"->",
"getResponse",
"(",
")",
"->",
... | Get one subscription by using the Monsum subscription ID.
@param integer $subscriptionId The Monsum subscription ID.
@return Subscription|null | [
"Get",
"one",
"subscription",
"by",
"using",
"the",
"Monsum",
"subscription",
"ID",
"."
] | 4611a048097de5d2b0efe9d4426779c783c0af4d | https://github.com/Speicher210/monsum-api/blob/4611a048097de5d2b0efe9d4426779c783c0af4d/src/Service/Subscription/SubscriptionService.php#L21-L29 |
22,148 | Speicher210/monsum-api | src/Service/Subscription/SubscriptionService.php | SubscriptionService.getSubscriptions | public function getSubscriptions(
$customerId = null,
$externalCustomerId = null,
$subscriptionExternalId = null,
$subscriptionId = null
) {
$requestData = new Get\RequestData();
$requestData->setCustomerId($customerId);
$requestData->setExternalCustomerId($ex... | php | public function getSubscriptions(
$customerId = null,
$externalCustomerId = null,
$subscriptionExternalId = null,
$subscriptionId = null
) {
$requestData = new Get\RequestData();
$requestData->setCustomerId($customerId);
$requestData->setExternalCustomerId($ex... | [
"public",
"function",
"getSubscriptions",
"(",
"$",
"customerId",
"=",
"null",
",",
"$",
"externalCustomerId",
"=",
"null",
",",
"$",
"subscriptionExternalId",
"=",
"null",
",",
"$",
"subscriptionId",
"=",
"null",
")",
"{",
"$",
"requestData",
"=",
"new",
"G... | Get the subscriptions.
@param integer $customerId The customer ID.
@param string $externalCustomerId The external customer ID.
@param string $subscriptionExternalId The external subscription ID.
@param integer $subscriptionId The subscription ID.
@return Get\ApiResponse | [
"Get",
"the",
"subscriptions",
"."
] | 4611a048097de5d2b0efe9d4426779c783c0af4d | https://github.com/Speicher210/monsum-api/blob/4611a048097de5d2b0efe9d4426779c783c0af4d/src/Service/Subscription/SubscriptionService.php#L40-L55 |
22,149 | Speicher210/monsum-api | src/Service/Subscription/SubscriptionService.php | SubscriptionService.getAllSubscriptions | public function getAllSubscriptions()
{
$limit = RequestInterface::MAX_LIST_LIMIT;
$offset = 0;
$subscriptions = [[]];
while (true) {
$subscriptionBatch = $this->getSubscriptionsResponse($offset);
$subscriptions[] = $subscriptionBatch;
$offset += ... | php | public function getAllSubscriptions()
{
$limit = RequestInterface::MAX_LIST_LIMIT;
$offset = 0;
$subscriptions = [[]];
while (true) {
$subscriptionBatch = $this->getSubscriptionsResponse($offset);
$subscriptions[] = $subscriptionBatch;
$offset += ... | [
"public",
"function",
"getAllSubscriptions",
"(",
")",
"{",
"$",
"limit",
"=",
"RequestInterface",
"::",
"MAX_LIST_LIMIT",
";",
"$",
"offset",
"=",
"0",
";",
"$",
"subscriptions",
"=",
"[",
"[",
"]",
"]",
";",
"while",
"(",
"true",
")",
"{",
"$",
"subs... | Get all subscriptions.
@return Subscription[] | [
"Get",
"all",
"subscriptions",
"."
] | 4611a048097de5d2b0efe9d4426779c783c0af4d | https://github.com/Speicher210/monsum-api/blob/4611a048097de5d2b0efe9d4426779c783c0af4d/src/Service/Subscription/SubscriptionService.php#L62-L78 |
22,150 | Speicher210/monsum-api | src/Service/Subscription/SubscriptionService.php | SubscriptionService.createSubscription | public function createSubscription(Create\RequestData $requestData)
{
$request = new Create\Request($requestData);
return $this->sendRequest($request, Create\ApiResponse::class);
} | php | public function createSubscription(Create\RequestData $requestData)
{
$request = new Create\Request($requestData);
return $this->sendRequest($request, Create\ApiResponse::class);
} | [
"public",
"function",
"createSubscription",
"(",
"Create",
"\\",
"RequestData",
"$",
"requestData",
")",
"{",
"$",
"request",
"=",
"new",
"Create",
"\\",
"Request",
"(",
"$",
"requestData",
")",
";",
"return",
"$",
"this",
"->",
"sendRequest",
"(",
"$",
"r... | Create a subscription.
@param Create\RequestData $requestData The request data.
@return Create\ApiResponse | [
"Create",
"a",
"subscription",
"."
] | 4611a048097de5d2b0efe9d4426779c783c0af4d | https://github.com/Speicher210/monsum-api/blob/4611a048097de5d2b0efe9d4426779c783c0af4d/src/Service/Subscription/SubscriptionService.php#L86-L91 |
22,151 | Speicher210/monsum-api | src/Service/Subscription/SubscriptionService.php | SubscriptionService.updateSubscription | public function updateSubscription(
$subscriptionId,
$nextEvent = null,
$subscriptionExternalId = null,
$status = null,
array $xAttributes = [],
array $features = []
) {
$requestData = new Update\RequestData($subscriptionId);
$requestData->setSubscrip... | php | public function updateSubscription(
$subscriptionId,
$nextEvent = null,
$subscriptionExternalId = null,
$status = null,
array $xAttributes = [],
array $features = []
) {
$requestData = new Update\RequestData($subscriptionId);
$requestData->setSubscrip... | [
"public",
"function",
"updateSubscription",
"(",
"$",
"subscriptionId",
",",
"$",
"nextEvent",
"=",
"null",
",",
"$",
"subscriptionExternalId",
"=",
"null",
",",
"$",
"status",
"=",
"null",
",",
"array",
"$",
"xAttributes",
"=",
"[",
"]",
",",
"array",
"$"... | Update a subscription.
@param integer $subscriptionId The subscription ID.
@param \DateTime $nextEvent The next event date and time.
@param string $subscriptionExternalId The external subscription ID.
@param string $status The subscription status.
@param array $xAttributes The subscription x attributes.
@param Feature... | [
"Update",
"a",
"subscription",
"."
] | 4611a048097de5d2b0efe9d4426779c783c0af4d | https://github.com/Speicher210/monsum-api/blob/4611a048097de5d2b0efe9d4426779c783c0af4d/src/Service/Subscription/SubscriptionService.php#L104-L124 |
22,152 | Speicher210/monsum-api | src/Service/Subscription/SubscriptionService.php | SubscriptionService.changeSubscriptionArticle | public function changeSubscriptionArticle(ChangeArticle\RequestData $requestData)
{
$request = new ChangeArticle\Request($requestData);
return $this->sendRequest($request, ChangeArticle\ApiResponse::class);
} | php | public function changeSubscriptionArticle(ChangeArticle\RequestData $requestData)
{
$request = new ChangeArticle\Request($requestData);
return $this->sendRequest($request, ChangeArticle\ApiResponse::class);
} | [
"public",
"function",
"changeSubscriptionArticle",
"(",
"ChangeArticle",
"\\",
"RequestData",
"$",
"requestData",
")",
"{",
"$",
"request",
"=",
"new",
"ChangeArticle",
"\\",
"Request",
"(",
"$",
"requestData",
")",
";",
"return",
"$",
"this",
"->",
"sendRequest... | Change article of a subscription.
@param ChangeArticle\RequestData $requestData The request data.
@return ChangeArticle\ApiResponse | [
"Change",
"article",
"of",
"a",
"subscription",
"."
] | 4611a048097de5d2b0efe9d4426779c783c0af4d | https://github.com/Speicher210/monsum-api/blob/4611a048097de5d2b0efe9d4426779c783c0af4d/src/Service/Subscription/SubscriptionService.php#L132-L137 |
22,153 | Speicher210/monsum-api | src/Service/Subscription/SubscriptionService.php | SubscriptionService.setSubscriptionAddon | public function setSubscriptionAddon(SetAddon\RequestData $requestData)
{
$request = new SetAddon\Request($requestData);
return $this->sendRequest($request, SetAddon\ApiResponse::class);
} | php | public function setSubscriptionAddon(SetAddon\RequestData $requestData)
{
$request = new SetAddon\Request($requestData);
return $this->sendRequest($request, SetAddon\ApiResponse::class);
} | [
"public",
"function",
"setSubscriptionAddon",
"(",
"SetAddon",
"\\",
"RequestData",
"$",
"requestData",
")",
"{",
"$",
"request",
"=",
"new",
"SetAddon",
"\\",
"Request",
"(",
"$",
"requestData",
")",
";",
"return",
"$",
"this",
"->",
"sendRequest",
"(",
"$"... | Set the addon for a subscription.
@param SetAddon\RequestData $requestData The request data.
@return SetAddon\ApiResponse | [
"Set",
"the",
"addon",
"for",
"a",
"subscription",
"."
] | 4611a048097de5d2b0efe9d4426779c783c0af4d | https://github.com/Speicher210/monsum-api/blob/4611a048097de5d2b0efe9d4426779c783c0af4d/src/Service/Subscription/SubscriptionService.php#L145-L150 |
22,154 | Speicher210/monsum-api | src/Service/Subscription/SubscriptionService.php | SubscriptionService.setSubscriptionUsageData | public function setSubscriptionUsageData(SetUsageData\RequestData $requestData)
{
$request = new SetUsageData\Request($requestData);
return $this->sendRequest($request, SetUsageData\ApiResponse::class);
} | php | public function setSubscriptionUsageData(SetUsageData\RequestData $requestData)
{
$request = new SetUsageData\Request($requestData);
return $this->sendRequest($request, SetUsageData\ApiResponse::class);
} | [
"public",
"function",
"setSubscriptionUsageData",
"(",
"SetUsageData",
"\\",
"RequestData",
"$",
"requestData",
")",
"{",
"$",
"request",
"=",
"new",
"SetUsageData",
"\\",
"Request",
"(",
"$",
"requestData",
")",
";",
"return",
"$",
"this",
"->",
"sendRequest",
... | Set the usage data of a subscription.
@param SetUsageData\RequestData $requestData The request data.
@return SetUsageData\ApiResponse | [
"Set",
"the",
"usage",
"data",
"of",
"a",
"subscription",
"."
] | 4611a048097de5d2b0efe9d4426779c783c0af4d | https://github.com/Speicher210/monsum-api/blob/4611a048097de5d2b0efe9d4426779c783c0af4d/src/Service/Subscription/SubscriptionService.php#L158-L163 |
22,155 | Speicher210/monsum-api | src/Service/Subscription/SubscriptionService.php | SubscriptionService.getUpcomingAmount | public function getUpcomingAmount(GetUpcomingAmount\RequestData $requestData = null)
{
if ($requestData === null) {
$requestData = new GetUpcomingAmount\RequestData();
}
$request = new GetUpcomingAmount\Request($requestData);
return $this->sendRequest($request, GetUpcom... | php | public function getUpcomingAmount(GetUpcomingAmount\RequestData $requestData = null)
{
if ($requestData === null) {
$requestData = new GetUpcomingAmount\RequestData();
}
$request = new GetUpcomingAmount\Request($requestData);
return $this->sendRequest($request, GetUpcom... | [
"public",
"function",
"getUpcomingAmount",
"(",
"GetUpcomingAmount",
"\\",
"RequestData",
"$",
"requestData",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"requestData",
"===",
"null",
")",
"{",
"$",
"requestData",
"=",
"new",
"GetUpcomingAmount",
"\\",
"RequestData",... | Get the upcoming amount.
@param GetUpcomingAmount\RequestData $requestData The request data filter.
@return GetUpcomingAmount\ApiResponse | [
"Get",
"the",
"upcoming",
"amount",
"."
] | 4611a048097de5d2b0efe9d4426779c783c0af4d | https://github.com/Speicher210/monsum-api/blob/4611a048097de5d2b0efe9d4426779c783c0af4d/src/Service/Subscription/SubscriptionService.php#L209-L218 |
22,156 | Speicher210/monsum-api | src/Service/Subscription/SubscriptionService.php | SubscriptionService.postponeSubscription | public function postponeSubscription($subscriptionId, $month)
{
$requestData = new Postpone\RequestData($subscriptionId, $month);
$request = new Postpone\Request($requestData);
return $this->sendRequest($request, Postpone\ApiResponse::class);
} | php | public function postponeSubscription($subscriptionId, $month)
{
$requestData = new Postpone\RequestData($subscriptionId, $month);
$request = new Postpone\Request($requestData);
return $this->sendRequest($request, Postpone\ApiResponse::class);
} | [
"public",
"function",
"postponeSubscription",
"(",
"$",
"subscriptionId",
",",
"$",
"month",
")",
"{",
"$",
"requestData",
"=",
"new",
"Postpone",
"\\",
"RequestData",
"(",
"$",
"subscriptionId",
",",
"$",
"month",
")",
";",
"$",
"request",
"=",
"new",
"Po... | Postpone a subscription shipping.
@param integer $subscriptionId
@param integer $month The month to postpone.
@return Postpone\ApiResponse | [
"Postpone",
"a",
"subscription",
"shipping",
"."
] | 4611a048097de5d2b0efe9d4426779c783c0af4d | https://github.com/Speicher210/monsum-api/blob/4611a048097de5d2b0efe9d4426779c783c0af4d/src/Service/Subscription/SubscriptionService.php#L227-L233 |
22,157 | Speicher210/monsum-api | src/Service/Subscription/SubscriptionService.php | SubscriptionService.renewSubscription | public function renewSubscription($subscriptionId)
{
$requestData = new Renew\RequestData($subscriptionId);
$request = new Renew\Request($requestData);
return $this->sendRequest($request, Renew\ApiResponse::class);
} | php | public function renewSubscription($subscriptionId)
{
$requestData = new Renew\RequestData($subscriptionId);
$request = new Renew\Request($requestData);
return $this->sendRequest($request, Renew\ApiResponse::class);
} | [
"public",
"function",
"renewSubscription",
"(",
"$",
"subscriptionId",
")",
"{",
"$",
"requestData",
"=",
"new",
"Renew",
"\\",
"RequestData",
"(",
"$",
"subscriptionId",
")",
";",
"$",
"request",
"=",
"new",
"Renew",
"\\",
"Request",
"(",
"$",
"requestData"... | Renew a subscription.
@param integer $subscriptionId The subscription ID to renew.
@return Renew\ApiResponse | [
"Renew",
"a",
"subscription",
"."
] | 4611a048097de5d2b0efe9d4426779c783c0af4d | https://github.com/Speicher210/monsum-api/blob/4611a048097de5d2b0efe9d4426779c783c0af4d/src/Service/Subscription/SubscriptionService.php#L241-L247 |
22,158 | Speicher210/monsum-api | src/Service/Subscription/SubscriptionService.php | SubscriptionService.createSecureLink | public function createSecureLink($subscriptionId)
{
$requestData = new CreateSecureLink\RequestData($subscriptionId);
$request = new CreateSecureLink\Request($requestData);
return $this->sendRequest($request, CreateSecureLink\ApiResponse::class);
} | php | public function createSecureLink($subscriptionId)
{
$requestData = new CreateSecureLink\RequestData($subscriptionId);
$request = new CreateSecureLink\Request($requestData);
return $this->sendRequest($request, CreateSecureLink\ApiResponse::class);
} | [
"public",
"function",
"createSecureLink",
"(",
"$",
"subscriptionId",
")",
"{",
"$",
"requestData",
"=",
"new",
"CreateSecureLink",
"\\",
"RequestData",
"(",
"$",
"subscriptionId",
")",
";",
"$",
"request",
"=",
"new",
"CreateSecureLink",
"\\",
"Request",
"(",
... | Create a secure link for a subscription.
@param integer $subscriptionId The subscription ID for which to create the secure link.
@return CreateSecureLink\ApiResponse | [
"Create",
"a",
"secure",
"link",
"for",
"a",
"subscription",
"."
] | 4611a048097de5d2b0efe9d4426779c783c0af4d | https://github.com/Speicher210/monsum-api/blob/4611a048097de5d2b0efe9d4426779c783c0af4d/src/Service/Subscription/SubscriptionService.php#L255-L261 |
22,159 | Speicher210/monsum-api | src/Service/Subscription/SubscriptionService.php | SubscriptionService.cancelSubscription | public function cancelSubscription($subscriptionId, \DateTime $cancellationDate = null, $cancellationNote = null)
{
$requestData = new Cancel\RequestData($subscriptionId);
$requestData->setCancellationDate($cancellationDate);
$requestData->setCancellationNote($cancellationNote);
$re... | php | public function cancelSubscription($subscriptionId, \DateTime $cancellationDate = null, $cancellationNote = null)
{
$requestData = new Cancel\RequestData($subscriptionId);
$requestData->setCancellationDate($cancellationDate);
$requestData->setCancellationNote($cancellationNote);
$re... | [
"public",
"function",
"cancelSubscription",
"(",
"$",
"subscriptionId",
",",
"\\",
"DateTime",
"$",
"cancellationDate",
"=",
"null",
",",
"$",
"cancellationNote",
"=",
"null",
")",
"{",
"$",
"requestData",
"=",
"new",
"Cancel",
"\\",
"RequestData",
"(",
"$",
... | Cancel a subscription.
@param integer $subscriptionId The subscription ID.
@param \DateTime $cancellationDate The cancellation date and time.
@param string $cancellationNote The cancellation note.
@return Cancel\ApiResponse | [
"Cancel",
"a",
"subscription",
"."
] | 4611a048097de5d2b0efe9d4426779c783c0af4d | https://github.com/Speicher210/monsum-api/blob/4611a048097de5d2b0efe9d4426779c783c0af4d/src/Service/Subscription/SubscriptionService.php#L271-L280 |
22,160 | Speicher210/monsum-api | src/Service/Subscription/SubscriptionService.php | SubscriptionService.reactivateSubscription | public function reactivateSubscription($subscriptionId)
{
$requestData = new Reactivate\RequestData($subscriptionId);
$request = new Reactivate\Request($requestData);
return $this->sendRequest($request, Reactivate\ApiResponse::class);
} | php | public function reactivateSubscription($subscriptionId)
{
$requestData = new Reactivate\RequestData($subscriptionId);
$request = new Reactivate\Request($requestData);
return $this->sendRequest($request, Reactivate\ApiResponse::class);
} | [
"public",
"function",
"reactivateSubscription",
"(",
"$",
"subscriptionId",
")",
"{",
"$",
"requestData",
"=",
"new",
"Reactivate",
"\\",
"RequestData",
"(",
"$",
"subscriptionId",
")",
";",
"$",
"request",
"=",
"new",
"Reactivate",
"\\",
"Request",
"(",
"$",
... | Reactivate a subscription.
@param integer $subscriptionId The subscription ID to reactivate.
@return Reactivate\ApiResponse | [
"Reactivate",
"a",
"subscription",
"."
] | 4611a048097de5d2b0efe9d4426779c783c0af4d | https://github.com/Speicher210/monsum-api/blob/4611a048097de5d2b0efe9d4426779c783c0af4d/src/Service/Subscription/SubscriptionService.php#L288-L294 |
22,161 | ekuiter/feature-php | FeaturePhp/Helper/Path.php | Path.stripBase | public static function stripBase($path, $base = null) {
if ($base === null)
$base = getcwd();
if (substr($path, 0, strlen($base)) === $base)
return ltrim(substr($path, strlen($base) + 1), "/");
else
throw new PathException("\"$path\" does not contain base path... | php | public static function stripBase($path, $base = null) {
if ($base === null)
$base = getcwd();
if (substr($path, 0, strlen($base)) === $base)
return ltrim(substr($path, strlen($base) + 1), "/");
else
throw new PathException("\"$path\" does not contain base path... | [
"public",
"static",
"function",
"stripBase",
"(",
"$",
"path",
",",
"$",
"base",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"base",
"===",
"null",
")",
"$",
"base",
"=",
"getcwd",
"(",
")",
";",
"if",
"(",
"substr",
"(",
"$",
"path",
",",
"0",
",",... | Strips a base from a file or directory path.
If no base is supplied, the working directory is used.
@param string $path
@param string $base
@return string | [
"Strips",
"a",
"base",
"from",
"a",
"file",
"or",
"directory",
"path",
".",
"If",
"no",
"base",
"is",
"supplied",
"the",
"working",
"directory",
"is",
"used",
"."
] | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Helper/Path.php#L26-L33 |
22,162 | ekuiter/feature-php | FeaturePhp/Helper/Path.php | Path.rootPath | public static function rootPath($directory) {
$num = count(explode("/", $directory));
$path = "";
for ($i = 0; $i < $num; $i++)
$path = self::join("..", $path);
return $path;
} | php | public static function rootPath($directory) {
$num = count(explode("/", $directory));
$path = "";
for ($i = 0; $i < $num; $i++)
$path = self::join("..", $path);
return $path;
} | [
"public",
"static",
"function",
"rootPath",
"(",
"$",
"directory",
")",
"{",
"$",
"num",
"=",
"count",
"(",
"explode",
"(",
"\"/\"",
",",
"$",
"directory",
")",
")",
";",
"$",
"path",
"=",
"\"\"",
";",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
... | Builds a path referring to the root directory from a relative path.
@param string $directory
return string | [
"Builds",
"a",
"path",
"referring",
"to",
"the",
"root",
"directory",
"from",
"a",
"relative",
"path",
"."
] | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Helper/Path.php#L110-L116 |
22,163 | zicht/z | src/Zicht/Tool/Packager/Node/StaticStub.php | StaticStub.compileInitialization | protected function compileInitialization(Buffer $buffer)
{
$configurationLoader = new Configuration\ConfigurationLoader(
$this->staticConfig,
new FileLocator(array(getcwd())),
new Configuration\FileLoader(
new Configuration\PathDefaultFileLocator(
... | php | protected function compileInitialization(Buffer $buffer)
{
$configurationLoader = new Configuration\ConfigurationLoader(
$this->staticConfig,
new FileLocator(array(getcwd())),
new Configuration\FileLoader(
new Configuration\PathDefaultFileLocator(
... | [
"protected",
"function",
"compileInitialization",
"(",
"Buffer",
"$",
"buffer",
")",
"{",
"$",
"configurationLoader",
"=",
"new",
"Configuration",
"\\",
"ConfigurationLoader",
"(",
"$",
"this",
"->",
"staticConfig",
",",
"new",
"FileLocator",
"(",
"array",
"(",
... | Writes the initialization code for a static build of Z.
@param \Zicht\Tool\Script\Buffer $buffer
@return mixed|void | [
"Writes",
"the",
"initialization",
"code",
"for",
"a",
"static",
"build",
"of",
"Z",
"."
] | 6a1731dad20b018555a96b726a61d4bf8ec8c886 | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Packager/Node/StaticStub.php#L45-L83 |
22,164 | InfiniteSoftware/ISEcommpayPayum | Action/Api/Signer.php | Signer.getParamsToSign | private static function getParamsToSign(
array $params,
array $ignoreParamKeys = [],
int $currentLevel = 1,
string $prefix = ''
): array
{
$paramsToSign = [];
foreach ($params as $key => $value) {
if ((in_array($key, $ignoreParamKeys) && $currentLevel ... | php | private static function getParamsToSign(
array $params,
array $ignoreParamKeys = [],
int $currentLevel = 1,
string $prefix = ''
): array
{
$paramsToSign = [];
foreach ($params as $key => $value) {
if ((in_array($key, $ignoreParamKeys) && $currentLevel ... | [
"private",
"static",
"function",
"getParamsToSign",
"(",
"array",
"$",
"params",
",",
"array",
"$",
"ignoreParamKeys",
"=",
"[",
"]",
",",
"int",
"$",
"currentLevel",
"=",
"1",
",",
"string",
"$",
"prefix",
"=",
"''",
")",
":",
"array",
"{",
"$",
"para... | Get parameters to sign
@param array $params
@param array $ignoreParamKeys
@param int $currentLevel
@param string $prefix
@return array | [
"Get",
"parameters",
"to",
"sign"
] | 44a073e3d885d9007aa54d6ff13aea93a9e52e7c | https://github.com/InfiniteSoftware/ISEcommpayPayum/blob/44a073e3d885d9007aa54d6ff13aea93a9e52e7c/Action/Api/Signer.php#L39-L72 |
22,165 | heidelpay/PhpDoc | src/phpDocumentor/Descriptor/Builder/Reflector/FileAssembler.php | FileAssembler.addConstants | protected function addConstants($constants, $fileDescriptor)
{
foreach ($constants as $constant) {
$constantDescriptor = $this->getBuilder()->buildDescriptor($constant);
if ($constantDescriptor) {
$constantDescriptor->setLocation($fileDescriptor, $constant->getLineNum... | php | protected function addConstants($constants, $fileDescriptor)
{
foreach ($constants as $constant) {
$constantDescriptor = $this->getBuilder()->buildDescriptor($constant);
if ($constantDescriptor) {
$constantDescriptor->setLocation($fileDescriptor, $constant->getLineNum... | [
"protected",
"function",
"addConstants",
"(",
"$",
"constants",
",",
"$",
"fileDescriptor",
")",
"{",
"foreach",
"(",
"$",
"constants",
"as",
"$",
"constant",
")",
"{",
"$",
"constantDescriptor",
"=",
"$",
"this",
"->",
"getBuilder",
"(",
")",
"->",
"build... | Registers the child constants with the generated File Descriptor.
@param ConstantReflector[] $constants
@param FileDescriptor $fileDescriptor
@return void | [
"Registers",
"the",
"child",
"constants",
"with",
"the",
"generated",
"File",
"Descriptor",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/Builder/Reflector/FileAssembler.php#L71-L88 |
22,166 | heidelpay/PhpDoc | src/phpDocumentor/Descriptor/Builder/Reflector/FileAssembler.php | FileAssembler.addFunctions | protected function addFunctions($functions, $fileDescriptor)
{
foreach ($functions as $function) {
$functionDescriptor = $this->getBuilder()->buildDescriptor($function);
if ($functionDescriptor) {
$functionDescriptor->setLocation($fileDescriptor, $function->getLineNum... | php | protected function addFunctions($functions, $fileDescriptor)
{
foreach ($functions as $function) {
$functionDescriptor = $this->getBuilder()->buildDescriptor($function);
if ($functionDescriptor) {
$functionDescriptor->setLocation($fileDescriptor, $function->getLineNum... | [
"protected",
"function",
"addFunctions",
"(",
"$",
"functions",
",",
"$",
"fileDescriptor",
")",
"{",
"foreach",
"(",
"$",
"functions",
"as",
"$",
"function",
")",
"{",
"$",
"functionDescriptor",
"=",
"$",
"this",
"->",
"getBuilder",
"(",
")",
"->",
"build... | Registers the child functions with the generated File Descriptor.
@param FunctionReflector[] $functions
@param FileDescriptor $fileDescriptor
@return void | [
"Registers",
"the",
"child",
"functions",
"with",
"the",
"generated",
"File",
"Descriptor",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/Builder/Reflector/FileAssembler.php#L98-L115 |
22,167 | heidelpay/PhpDoc | src/phpDocumentor/Descriptor/Builder/Reflector/FileAssembler.php | FileAssembler.addInterfaces | protected function addInterfaces($interfaces, $fileDescriptor)
{
foreach ($interfaces as $interface) {
$interfaceDescriptor = $this->getBuilder()->buildDescriptor($interface);
if ($interfaceDescriptor) {
$interfaceDescriptor->setLocation($fileDescriptor, $interface->g... | php | protected function addInterfaces($interfaces, $fileDescriptor)
{
foreach ($interfaces as $interface) {
$interfaceDescriptor = $this->getBuilder()->buildDescriptor($interface);
if ($interfaceDescriptor) {
$interfaceDescriptor->setLocation($fileDescriptor, $interface->g... | [
"protected",
"function",
"addInterfaces",
"(",
"$",
"interfaces",
",",
"$",
"fileDescriptor",
")",
"{",
"foreach",
"(",
"$",
"interfaces",
"as",
"$",
"interface",
")",
"{",
"$",
"interfaceDescriptor",
"=",
"$",
"this",
"->",
"getBuilder",
"(",
")",
"->",
"... | Registers the child interfaces with the generated File Descriptor.
@param InterfaceReflector[] $interfaces
@param FileDescriptor $fileDescriptor
@return void | [
"Registers",
"the",
"child",
"interfaces",
"with",
"the",
"generated",
"File",
"Descriptor",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/Builder/Reflector/FileAssembler.php#L154-L171 |
22,168 | heidelpay/PhpDoc | src/phpDocumentor/Descriptor/Builder/Reflector/FileAssembler.php | FileAssembler.addTraits | protected function addTraits($traits, $fileDescriptor)
{
foreach ($traits as $trait) {
$traitDescriptor = $this->getBuilder()->buildDescriptor($trait);
if ($traitDescriptor) {
$traitDescriptor->setLocation($fileDescriptor, $trait->getLineNumber());
if ... | php | protected function addTraits($traits, $fileDescriptor)
{
foreach ($traits as $trait) {
$traitDescriptor = $this->getBuilder()->buildDescriptor($trait);
if ($traitDescriptor) {
$traitDescriptor->setLocation($fileDescriptor, $trait->getLineNumber());
if ... | [
"protected",
"function",
"addTraits",
"(",
"$",
"traits",
",",
"$",
"fileDescriptor",
")",
"{",
"foreach",
"(",
"$",
"traits",
"as",
"$",
"trait",
")",
"{",
"$",
"traitDescriptor",
"=",
"$",
"this",
"->",
"getBuilder",
"(",
")",
"->",
"buildDescriptor",
... | Registers the child traits with the generated File Descriptor.
@param TraitReflector[] $traits
@param FileDescriptor $fileDescriptor
@return void | [
"Registers",
"the",
"child",
"traits",
"with",
"the",
"generated",
"File",
"Descriptor",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/Builder/Reflector/FileAssembler.php#L181-L198 |
22,169 | heidelpay/PhpDoc | src/phpDocumentor/Descriptor/Builder/Reflector/FileAssembler.php | FileAssembler.addMarkers | protected function addMarkers($markers, $fileDescriptor)
{
foreach ($markers as $marker) {
list($type, $message, $line) = $marker;
$fileDescriptor->getMarkers()->add(
array(
'type' => $type,
'message' => $message,
... | php | protected function addMarkers($markers, $fileDescriptor)
{
foreach ($markers as $marker) {
list($type, $message, $line) = $marker;
$fileDescriptor->getMarkers()->add(
array(
'type' => $type,
'message' => $message,
... | [
"protected",
"function",
"addMarkers",
"(",
"$",
"markers",
",",
"$",
"fileDescriptor",
")",
"{",
"foreach",
"(",
"$",
"markers",
"as",
"$",
"marker",
")",
"{",
"list",
"(",
"$",
"type",
",",
"$",
"message",
",",
"$",
"line",
")",
"=",
"$",
"marker",... | Registers the markers that were found in a File with the File Descriptor.
@param string[] $markers
@param FileDescriptor $fileDescriptor
@return void | [
"Registers",
"the",
"markers",
"that",
"were",
"found",
"in",
"a",
"File",
"with",
"the",
"File",
"Descriptor",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/Builder/Reflector/FileAssembler.php#L208-L220 |
22,170 | bpolaszek/simple-dbal | src/Model/Adapter/PDO/Statement.php | Statement.bindNumericParameters | protected function bindNumericParameters(): void
{
$values = $this->getValues();
$cnt = count($values);
for ($index0 = 0, $index1 = 1; $index0 < $cnt; $index0++, $index1++) {
$value = $this->toScalar($values[$index0]);
$this->getWrappedStatement()->bindValue($index... | php | protected function bindNumericParameters(): void
{
$values = $this->getValues();
$cnt = count($values);
for ($index0 = 0, $index1 = 1; $index0 < $cnt; $index0++, $index1++) {
$value = $this->toScalar($values[$index0]);
$this->getWrappedStatement()->bindValue($index... | [
"protected",
"function",
"bindNumericParameters",
"(",
")",
":",
"void",
"{",
"$",
"values",
"=",
"$",
"this",
"->",
"getValues",
"(",
")",
";",
"$",
"cnt",
"=",
"count",
"(",
"$",
"values",
")",
";",
"for",
"(",
"$",
"index0",
"=",
"0",
",",
"$",
... | Bind ? parameters | [
"Bind",
"?",
"parameters"
] | 52cb50d326ba5854191814b470f5e84950ebb6e6 | https://github.com/bpolaszek/simple-dbal/blob/52cb50d326ba5854191814b470f5e84950ebb6e6/src/Model/Adapter/PDO/Statement.php#L92-L100 |
22,171 | thupan/framework | src/Service/Minifier.php | Minifier.loop | protected function loop()
{
while ($this->a !== false && !is_null($this->a) && $this->a !== '') {
switch ($this->a) {
// new lines
case "\n":
// if the next line is something that can't stand alone preserve the newline
if (... | php | protected function loop()
{
while ($this->a !== false && !is_null($this->a) && $this->a !== '') {
switch ($this->a) {
// new lines
case "\n":
// if the next line is something that can't stand alone preserve the newline
if (... | [
"protected",
"function",
"loop",
"(",
")",
"{",
"while",
"(",
"$",
"this",
"->",
"a",
"!==",
"false",
"&&",
"!",
"is_null",
"(",
"$",
"this",
"->",
"a",
")",
"&&",
"$",
"this",
"->",
"a",
"!==",
"''",
")",
"{",
"switch",
"(",
"$",
"this",
"->",... | The primary action occurs here. This function loops through the input string,
outputting anything that's relevant and discarding anything that is not. | [
"The",
"primary",
"action",
"occurs",
"here",
".",
"This",
"function",
"loops",
"through",
"the",
"input",
"string",
"outputting",
"anything",
"that",
"s",
"relevant",
"and",
"discarding",
"anything",
"that",
"is",
"not",
"."
] | 43193c67e87942930fb0cbc53aa069b60b27e749 | https://github.com/thupan/framework/blob/43193c67e87942930fb0cbc53aa069b60b27e749/src/Service/Minifier.php#L176-L242 |
22,172 | thupan/framework | src/Service/Minifier.php | Minifier.getChar | protected function getChar()
{
// Check to see if we had anything in the look ahead buffer and use that.
if (isset($this->c)) {
$char = $this->c;
unset($this->c);
// Otherwise we start pulling from the input.
} else {
$char = substr($this->input, ... | php | protected function getChar()
{
// Check to see if we had anything in the look ahead buffer and use that.
if (isset($this->c)) {
$char = $this->c;
unset($this->c);
// Otherwise we start pulling from the input.
} else {
$char = substr($this->input, ... | [
"protected",
"function",
"getChar",
"(",
")",
"{",
"// Check to see if we had anything in the look ahead buffer and use that.",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"c",
")",
")",
"{",
"$",
"char",
"=",
"$",
"this",
"->",
"c",
";",
"unset",
"(",
"$",
... | Returns the next string for processing based off of the current index.
@return string | [
"Returns",
"the",
"next",
"string",
"for",
"processing",
"based",
"off",
"of",
"the",
"current",
"index",
"."
] | 43193c67e87942930fb0cbc53aa069b60b27e749 | https://github.com/thupan/framework/blob/43193c67e87942930fb0cbc53aa069b60b27e749/src/Service/Minifier.php#L263-L290 |
22,173 | jasny/controller | src/Controller/Session/Flash.php | Flash.get | public function get()
{
if (!isset($this->data) && isset($this->session[$this->key])) {
$this->data = $this->session[$this->key];
unset($this->session[$this->key]);
}
return $this->data ? (object)$this->data : null;
} | php | public function get()
{
if (!isset($this->data) && isset($this->session[$this->key])) {
$this->data = $this->session[$this->key];
unset($this->session[$this->key]);
}
return $this->data ? (object)$this->data : null;
} | [
"public",
"function",
"get",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"data",
")",
"&&",
"isset",
"(",
"$",
"this",
"->",
"session",
"[",
"$",
"this",
"->",
"key",
"]",
")",
")",
"{",
"$",
"this",
"->",
"data",
"=",
"$"... | Get the flash.
@return object | [
"Get",
"the",
"flash",
"."
] | 28edf64343f1d8218c166c0c570128e1ee6153d8 | https://github.com/jasny/controller/blob/28edf64343f1d8218c166c0c570128e1ee6153d8/src/Controller/Session/Flash.php#L63-L71 |
22,174 | jasny/controller | src/Controller/Session/Flash.php | Flash.reissue | public function reissue()
{
if (!isset($this->data) && isset($this->session[$this->key])) {
$this->data = $this->session[$this->key];
} else {
$this->session[$this->key] = $this->data;
}
} | php | public function reissue()
{
if (!isset($this->data) && isset($this->session[$this->key])) {
$this->data = $this->session[$this->key];
} else {
$this->session[$this->key] = $this->data;
}
} | [
"public",
"function",
"reissue",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"data",
")",
"&&",
"isset",
"(",
"$",
"this",
"->",
"session",
"[",
"$",
"this",
"->",
"key",
"]",
")",
")",
"{",
"$",
"this",
"->",
"data",
"=",
... | Reissue the flash. | [
"Reissue",
"the",
"flash",
"."
] | 28edf64343f1d8218c166c0c570128e1ee6153d8 | https://github.com/jasny/controller/blob/28edf64343f1d8218c166c0c570128e1ee6153d8/src/Controller/Session/Flash.php#L76-L83 |
22,175 | hametuha/wpametu | src/WPametu/DB/QueryBuilder.php | QueryBuilder.build_query | final protected function build_query(){
$select = empty($this->_select) ? $this->default_select() : implode(', ', $this->_select);
$calc = $this->_calc_rows ? ' SQL_CALC_FOUND_ROWS' : '';
$distinct = $this->_distinct ? sprintf('DISTINCT(%s)', $this->escape_column_name($this->_distinct)) : '';
... | php | final protected function build_query(){
$select = empty($this->_select) ? $this->default_select() : implode(', ', $this->_select);
$calc = $this->_calc_rows ? ' SQL_CALC_FOUND_ROWS' : '';
$distinct = $this->_distinct ? sprintf('DISTINCT(%s)', $this->escape_column_name($this->_distinct)) : '';
... | [
"final",
"protected",
"function",
"build_query",
"(",
")",
"{",
"$",
"select",
"=",
"empty",
"(",
"$",
"this",
"->",
"_select",
")",
"?",
"$",
"this",
"->",
"default_select",
"(",
")",
":",
"implode",
"(",
"', '",
",",
"$",
"this",
"->",
"_select",
"... | Build query with current setting
@return string | [
"Build",
"query",
"with",
"current",
"setting"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/DB/QueryBuilder.php#L118-L174 |
22,176 | hametuha/wpametu | src/WPametu/DB/QueryBuilder.php | QueryBuilder.build_where | private function build_where(array $where_array){
$where_clause = [];
$counter = 0;
foreach( $where_array as list($glue, $where) ){
if( $counter ){
$where_clause[] = $glue;
}
if( is_array($where) ){
$where_clause[] = $this->buil... | php | private function build_where(array $where_array){
$where_clause = [];
$counter = 0;
foreach( $where_array as list($glue, $where) ){
if( $counter ){
$where_clause[] = $glue;
}
if( is_array($where) ){
$where_clause[] = $this->buil... | [
"private",
"function",
"build_where",
"(",
"array",
"$",
"where_array",
")",
"{",
"$",
"where_clause",
"=",
"[",
"]",
";",
"$",
"counter",
"=",
"0",
";",
"foreach",
"(",
"$",
"where_array",
"as",
"list",
"(",
"$",
"glue",
",",
"$",
"where",
")",
")",... | Build where clause
@param array $where_array
@return string | [
"Build",
"where",
"clause"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/DB/QueryBuilder.php#L182-L197 |
22,177 | hametuha/wpametu | src/WPametu/DB/QueryBuilder.php | QueryBuilder.select | final protected function select($name, $escape = true){
$this->_select[] = $escape
? $this->escape_column_name($name)
: $name;
return $this;
} | php | final protected function select($name, $escape = true){
$this->_select[] = $escape
? $this->escape_column_name($name)
: $name;
return $this;
} | [
"final",
"protected",
"function",
"select",
"(",
"$",
"name",
",",
"$",
"escape",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"_select",
"[",
"]",
"=",
"$",
"escape",
"?",
"$",
"this",
"->",
"escape_column_name",
"(",
"$",
"name",
")",
":",
"$",
"nam... | Set select param
@param string $name
@param bool $escape Default true
@return $this | [
"Set",
"select",
"param"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/DB/QueryBuilder.php#L206-L211 |
22,178 | hametuha/wpametu | src/WPametu/DB/QueryBuilder.php | QueryBuilder.where_not_null | final protected function where_not_null($column, $or = false){
$this->_wheres[] = [$this->and_or($or), sprintf("%s IS NOT NULL", $this->escape_column_name($column))];
return $this;
} | php | final protected function where_not_null($column, $or = false){
$this->_wheres[] = [$this->and_or($or), sprintf("%s IS NOT NULL", $this->escape_column_name($column))];
return $this;
} | [
"final",
"protected",
"function",
"where_not_null",
"(",
"$",
"column",
",",
"$",
"or",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"_wheres",
"[",
"]",
"=",
"[",
"$",
"this",
"->",
"and_or",
"(",
"$",
"or",
")",
",",
"sprintf",
"(",
"\"%s IS NOT NULL... | Add where not null clause
@param string $column
@param bool $or Default false
@return $this | [
"Add",
"where",
"not",
"null",
"clause"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/DB/QueryBuilder.php#L285-L288 |
22,179 | hametuha/wpametu | src/WPametu/DB/QueryBuilder.php | QueryBuilder.where_like | final protected function where_like($column, $replace, $position = 'both', $or = false){
switch( strtolower($position) ){
case 'left':
$replace = '%'.$replace;
break;
case 'right':
$replace = $replace.'%';
break;
... | php | final protected function where_like($column, $replace, $position = 'both', $or = false){
switch( strtolower($position) ){
case 'left':
$replace = '%'.$replace;
break;
case 'right':
$replace = $replace.'%';
break;
... | [
"final",
"protected",
"function",
"where_like",
"(",
"$",
"column",
",",
"$",
"replace",
",",
"$",
"position",
"=",
"'both'",
",",
"$",
"or",
"=",
"false",
")",
"{",
"switch",
"(",
"strtolower",
"(",
"$",
"position",
")",
")",
"{",
"case",
"'left'",
... | Add Where LIKE
@param string $column
@param string $replace
@param string $position Position of %. 'left', 'right' or 'both'
@param bool $or
@return $this | [
"Add",
"Where",
"LIKE"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/DB/QueryBuilder.php#L299-L314 |
22,180 | hametuha/wpametu | src/WPametu/DB/QueryBuilder.php | QueryBuilder.wheres | final protected function wheres(array $wheres, $or = false){
foreach($wheres as $where => $replace){
$this->where($where, $replace, $or);
}
return $this;
} | php | final protected function wheres(array $wheres, $or = false){
foreach($wheres as $where => $replace){
$this->where($where, $replace, $or);
}
return $this;
} | [
"final",
"protected",
"function",
"wheres",
"(",
"array",
"$",
"wheres",
",",
"$",
"or",
"=",
"false",
")",
"{",
"foreach",
"(",
"$",
"wheres",
"as",
"$",
"where",
"=>",
"$",
"replace",
")",
"{",
"$",
"this",
"->",
"where",
"(",
"$",
"where",
",",
... | Add where in one shot
@param array $wheres
@param bool $or
@return $this | [
"Add",
"where",
"in",
"one",
"shot"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/DB/QueryBuilder.php#L323-L328 |
22,181 | hametuha/wpametu | src/WPametu/DB/QueryBuilder.php | QueryBuilder.group_by | final protected function group_by($column, $order = 'ASC'){
$order = 'DESC' === strtoupper($order) ? 'DESC' : 'ASC';
$this->_group_by[] = sprintf('%s %s', $this->escape_column_name($column), $order);
return $this;
} | php | final protected function group_by($column, $order = 'ASC'){
$order = 'DESC' === strtoupper($order) ? 'DESC' : 'ASC';
$this->_group_by[] = sprintf('%s %s', $this->escape_column_name($column), $order);
return $this;
} | [
"final",
"protected",
"function",
"group_by",
"(",
"$",
"column",
",",
"$",
"order",
"=",
"'ASC'",
")",
"{",
"$",
"order",
"=",
"'DESC'",
"===",
"strtoupper",
"(",
"$",
"order",
")",
"?",
"'DESC'",
":",
"'ASC'",
";",
"$",
"this",
"->",
"_group_by",
"... | Add group by
@param string $column
@param string $order
@return $this | [
"Add",
"group",
"by"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/DB/QueryBuilder.php#L367-L371 |
22,182 | hametuha/wpametu | src/WPametu/DB/QueryBuilder.php | QueryBuilder.order_by | final protected function order_by($column, $order = 'ASC'){
$order = 'DESC' === strtoupper($order) ? 'DESC' : 'ASC';
$this->_order_by[] = sprintf('%s %s', $this->escape_column_name($column), $order);
return $this;
} | php | final protected function order_by($column, $order = 'ASC'){
$order = 'DESC' === strtoupper($order) ? 'DESC' : 'ASC';
$this->_order_by[] = sprintf('%s %s', $this->escape_column_name($column), $order);
return $this;
} | [
"final",
"protected",
"function",
"order_by",
"(",
"$",
"column",
",",
"$",
"order",
"=",
"'ASC'",
")",
"{",
"$",
"order",
"=",
"'DESC'",
"===",
"strtoupper",
"(",
"$",
"order",
")",
"?",
"'DESC'",
":",
"'ASC'",
";",
"$",
"this",
"->",
"_order_by",
"... | Add order by
@param string $column
@param string $order
@return $this | [
"Add",
"order",
"by"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/DB/QueryBuilder.php#L380-L384 |
22,183 | hametuha/wpametu | src/WPametu/DB/QueryBuilder.php | QueryBuilder.escape_column_name | private function escape_column_name($column_names){
$columns = [];
foreach( explode(',', $column_names) as $column_name ){
// trim
$column_name = trim($column_name);
// Remove special chars
$columns[] = preg_replace('/[`\'";\n\r\\\\\\0]/u', '', $column_nam... | php | private function escape_column_name($column_names){
$columns = [];
foreach( explode(',', $column_names) as $column_name ){
// trim
$column_name = trim($column_name);
// Remove special chars
$columns[] = preg_replace('/[`\'";\n\r\\\\\\0]/u', '', $column_nam... | [
"private",
"function",
"escape_column_name",
"(",
"$",
"column_names",
")",
"{",
"$",
"columns",
"=",
"[",
"]",
";",
"foreach",
"(",
"explode",
"(",
"','",
",",
"$",
"column_names",
")",
"as",
"$",
"column_name",
")",
"{",
"// trim",
"$",
"column_name",
... | Wrap table name with backtick
@param string $column_names
@return string | [
"Wrap",
"table",
"name",
"with",
"backtick"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/DB/QueryBuilder.php#L440-L449 |
22,184 | hametuha/wpametu | src/WPametu/DB/QueryBuilder.php | QueryBuilder.clear | final protected function clear(){
$this->_distinct = false;
$this->_select = [];
$this->_from = '';
$this->_join = [];
$this->_wheres = [];
$this->_group_by = [];
$this->_order_by = [];
$this->_limit = [];
} | php | final protected function clear(){
$this->_distinct = false;
$this->_select = [];
$this->_from = '';
$this->_join = [];
$this->_wheres = [];
$this->_group_by = [];
$this->_order_by = [];
$this->_limit = [];
} | [
"final",
"protected",
"function",
"clear",
"(",
")",
"{",
"$",
"this",
"->",
"_distinct",
"=",
"false",
";",
"$",
"this",
"->",
"_select",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"_from",
"=",
"''",
";",
"$",
"this",
"->",
"_join",
"=",
"[",
"]",
... | Clear all result | [
"Clear",
"all",
"result"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/DB/QueryBuilder.php#L491-L500 |
22,185 | hametuha/wpametu | src/WPametu/DB/QueryBuilder.php | QueryBuilder.cache_query | final protected function cache_query($sql, $result){
if( isset($this->query_cache[$sql]) ){
$this->query_cache[$sql] = $result;
}elseif( count($this->query_cache) >= $this->cache_limit ){
// Remove oldest cache
array_shift($this->query_cache);
// save quer... | php | final protected function cache_query($sql, $result){
if( isset($this->query_cache[$sql]) ){
$this->query_cache[$sql] = $result;
}elseif( count($this->query_cache) >= $this->cache_limit ){
// Remove oldest cache
array_shift($this->query_cache);
// save quer... | [
"final",
"protected",
"function",
"cache_query",
"(",
"$",
"sql",
",",
"$",
"result",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"query_cache",
"[",
"$",
"sql",
"]",
")",
")",
"{",
"$",
"this",
"->",
"query_cache",
"[",
"$",
"sql",
"]",
... | Save query cache
@param string $sql
@param mixed $result | [
"Save",
"query",
"cache"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/DB/QueryBuilder.php#L508-L517 |
22,186 | nabab/bbn | src/bbn/appui/chat.php | chat.create | public function create(array $users, int $public = 0): ?string
{
if ( $this->check() ){
$join = '';
$where = '';
$values = [$this->user->get_id(), $public];
foreach ( $users as $i => $u ){
$join .= "JOIN bbn_chats_users AS u$i ON u$i.id_chat = bbn_chats.id".PHP_EOL;
$where ... | php | public function create(array $users, int $public = 0): ?string
{
if ( $this->check() ){
$join = '';
$where = '';
$values = [$this->user->get_id(), $public];
foreach ( $users as $i => $u ){
$join .= "JOIN bbn_chats_users AS u$i ON u$i.id_chat = bbn_chats.id".PHP_EOL;
$where ... | [
"public",
"function",
"create",
"(",
"array",
"$",
"users",
",",
"int",
"$",
"public",
"=",
"0",
")",
":",
"?",
"string",
"{",
"if",
"(",
"$",
"this",
"->",
"check",
"(",
")",
")",
"{",
"$",
"join",
"=",
"''",
";",
"$",
"where",
"=",
"''",
";... | Creates a new chat with the current userr and another participant.
@param array $users
@param int $public
@return null|string | [
"Creates",
"a",
"new",
"chat",
"with",
"the",
"current",
"userr",
"and",
"another",
"participant",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/chat.php#L58-L104 |
22,187 | nabab/bbn | src/bbn/appui/chat.php | chat.make_admin | public function make_admin(string $id_chat, string $id_user): bool
{
if ( $this->is_admin($id_chat) ){
return (bool)$this->db->update_ignore('bbn_chats_users', [
'admin' => 1
], [
'id_chat' => $id_chat,
'id_user' => $id_user,
]);
}
return false;
} | php | public function make_admin(string $id_chat, string $id_user): bool
{
if ( $this->is_admin($id_chat) ){
return (bool)$this->db->update_ignore('bbn_chats_users', [
'admin' => 1
], [
'id_chat' => $id_chat,
'id_user' => $id_user,
]);
}
return false;
} | [
"public",
"function",
"make_admin",
"(",
"string",
"$",
"id_chat",
",",
"string",
"$",
"id_user",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"this",
"->",
"is_admin",
"(",
"$",
"id_chat",
")",
")",
"{",
"return",
"(",
"bool",
")",
"$",
"this",
"->",
"d... | Makes the given participant an admin of the given chat provided the current user is admin of this chat.
@param string $id_chat
@param string $id_user
@return bool | [
"Makes",
"the",
"given",
"participant",
"an",
"admin",
"of",
"the",
"given",
"chat",
"provided",
"the",
"current",
"user",
"is",
"admin",
"of",
"this",
"chat",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/chat.php#L133-L144 |
22,188 | nabab/bbn | src/bbn/appui/chat.php | chat.is_participant | public function is_participant(string $id_chat, string $id_user = null): ?bool
{
if ( $this->check() ){
return (bool)$this->db->count('bbn_chats_users', [
'id_chat' => $id_chat,
'id_user' => $id_user ?: $this->user->get_id()
]);
}
return null;
} | php | public function is_participant(string $id_chat, string $id_user = null): ?bool
{
if ( $this->check() ){
return (bool)$this->db->count('bbn_chats_users', [
'id_chat' => $id_chat,
'id_user' => $id_user ?: $this->user->get_id()
]);
}
return null;
} | [
"public",
"function",
"is_participant",
"(",
"string",
"$",
"id_chat",
",",
"string",
"$",
"id_user",
"=",
"null",
")",
":",
"?",
"bool",
"{",
"if",
"(",
"$",
"this",
"->",
"check",
"(",
")",
")",
"{",
"return",
"(",
"bool",
")",
"$",
"this",
"->",... | Checks whether the given user is participant of the given chat.
@param string $id_chat
@param string $id_user
@return bool|null | [
"Checks",
"whether",
"the",
"given",
"user",
"is",
"participant",
"of",
"the",
"given",
"chat",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/chat.php#L153-L162 |
22,189 | nabab/bbn | src/bbn/appui/chat.php | chat.info | public function info($id_chat): ?array
{
if ( $this->check() ){
return $this->db->rselect('bbn_chats', [], ['id' => $id_chat]) ?: null;
}
return null;
} | php | public function info($id_chat): ?array
{
if ( $this->check() ){
return $this->db->rselect('bbn_chats', [], ['id' => $id_chat]) ?: null;
}
return null;
} | [
"public",
"function",
"info",
"(",
"$",
"id_chat",
")",
":",
"?",
"array",
"{",
"if",
"(",
"$",
"this",
"->",
"check",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"db",
"->",
"rselect",
"(",
"'bbn_chats'",
",",
"[",
"]",
",",
"[",
"'id'",
... | Gets information about the given chat.
@param $id_chat
@return array|null | [
"Gets",
"information",
"about",
"the",
"given",
"chat",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/chat.php#L170-L176 |
22,190 | nabab/bbn | src/bbn/appui/chat.php | chat.get_participants | public function get_participants(string $id_chat): ?array
{
if ( $this->check() ){
return $this->db->get_field_values('bbn_chats_users', 'id_user', ['id_chat' => $id_chat]);
}
return null;
} | php | public function get_participants(string $id_chat): ?array
{
if ( $this->check() ){
return $this->db->get_field_values('bbn_chats_users', 'id_user', ['id_chat' => $id_chat]);
}
return null;
} | [
"public",
"function",
"get_participants",
"(",
"string",
"$",
"id_chat",
")",
":",
"?",
"array",
"{",
"if",
"(",
"$",
"this",
"->",
"check",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"db",
"->",
"get_field_values",
"(",
"'bbn_chats_users'",
",",
... | Returns the participants of the given chat as an array of id_user.
@param string $id_chat
@return array|null | [
"Returns",
"the",
"participants",
"of",
"the",
"given",
"chat",
"as",
"an",
"array",
"of",
"id_user",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/chat.php#L184-L190 |
22,191 | nabab/bbn | src/bbn/appui/chat.php | chat.talk | public function talk(string $id_chat, string $message): ?int
{
if ( $this->check() && ($chat = $this->info($id_chat)) && !$chat['blocked'] ){
$users = $this->get_participants($id_chat);
if ( \in_array($this->user->get_id(), $users, true) ){
$time = microtime(true);
$st = bbn\util\enc::... | php | public function talk(string $id_chat, string $message): ?int
{
if ( $this->check() && ($chat = $this->info($id_chat)) && !$chat['blocked'] ){
$users = $this->get_participants($id_chat);
if ( \in_array($this->user->get_id(), $users, true) ){
$time = microtime(true);
$st = bbn\util\enc::... | [
"public",
"function",
"talk",
"(",
"string",
"$",
"id_chat",
",",
"string",
"$",
"message",
")",
":",
"?",
"int",
"{",
"if",
"(",
"$",
"this",
"->",
"check",
"(",
")",
"&&",
"(",
"$",
"chat",
"=",
"$",
"this",
"->",
"info",
"(",
"$",
"id_chat",
... | Sends a new message from the current user in the given chat.
@param string $id_chat
@param string $message
@return int|null | [
"Sends",
"a",
"new",
"message",
"from",
"the",
"current",
"user",
"in",
"the",
"given",
"chat",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/chat.php#L199-L217 |
22,192 | nabab/bbn | src/bbn/appui/chat.php | chat.is_admin | public function is_admin($id_chat): ?bool
{
if ( $this->check() && ($chat = $this->info($id_chat)) && !$chat['blocked'] ){
return (bool)$this->db->count('bbn_chats_users', [
'id_chat' => $id_chat,
'id_user' => $this->user->get_id(),
'admin' => 1
]);
}
return null;
} | php | public function is_admin($id_chat): ?bool
{
if ( $this->check() && ($chat = $this->info($id_chat)) && !$chat['blocked'] ){
return (bool)$this->db->count('bbn_chats_users', [
'id_chat' => $id_chat,
'id_user' => $this->user->get_id(),
'admin' => 1
]);
}
return null;
} | [
"public",
"function",
"is_admin",
"(",
"$",
"id_chat",
")",
":",
"?",
"bool",
"{",
"if",
"(",
"$",
"this",
"->",
"check",
"(",
")",
"&&",
"(",
"$",
"chat",
"=",
"$",
"this",
"->",
"info",
"(",
"$",
"id_chat",
")",
")",
"&&",
"!",
"$",
"chat",
... | Checks whether the current user is an admin of the given chat or not.
@param $id_chat
@return bool|null | [
"Checks",
"whether",
"the",
"current",
"user",
"is",
"an",
"admin",
"of",
"the",
"given",
"chat",
"or",
"not",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/chat.php#L225-L235 |
22,193 | nabab/bbn | src/bbn/appui/chat.php | chat.block | public function block($id_chat): bool
{
if ( $this->is_admin($id_chat) ){
return (bool)$this->db->update('bbn_chats', ['blocked' => 1], ['id' => $id_chat]);
}
return false;
} | php | public function block($id_chat): bool
{
if ( $this->is_admin($id_chat) ){
return (bool)$this->db->update('bbn_chats', ['blocked' => 1], ['id' => $id_chat]);
}
return false;
} | [
"public",
"function",
"block",
"(",
"$",
"id_chat",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"this",
"->",
"is_admin",
"(",
"$",
"id_chat",
")",
")",
"{",
"return",
"(",
"bool",
")",
"$",
"this",
"->",
"db",
"->",
"update",
"(",
"'bbn_chats'",
",",
... | Close a chat by setting blocked to 1.
@param $id_chat
@return bool | [
"Close",
"a",
"chat",
"by",
"setting",
"blocked",
"to",
"1",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/chat.php#L243-L249 |
22,194 | ArrowSphere/Client | src/xAC.php | xAC.setApiVersion | public static function setApiVersion($version)
{
if (! in_array($version, [1,2])) {
throw new \Exception(sprintf("The %d version is not supported", $version));
}
self::$apiVersion = $version;
// Refresh services if version is changed and base url is defined
... | php | public static function setApiVersion($version)
{
if (! in_array($version, [1,2])) {
throw new \Exception(sprintf("The %d version is not supported", $version));
}
self::$apiVersion = $version;
// Refresh services if version is changed and base url is defined
... | [
"public",
"static",
"function",
"setApiVersion",
"(",
"$",
"version",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"version",
",",
"[",
"1",
",",
"2",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"sprintf",
"(",
"\"The %d version is n... | Define which API version to use
@param integer $version | [
"Define",
"which",
"API",
"version",
"to",
"use"
] | 6608f8257060375e7d3a27c485b23268b73f6ef7 | https://github.com/ArrowSphere/Client/blob/6608f8257060375e7d3a27c485b23268b73f6ef7/src/xAC.php#L137-L148 |
22,195 | ArrowSphere/Client | src/xAC.php | xAC.initServices | public static function initServices($refresh = false)
{
// Define full definition file path
$path = sprintf('%s%sxac-services-v%d.conf'
, ! empty(self::$logPath) ? self::$logPath : sys_get_temp_dir()
, DIRECTORY_SEPARATOR
, self::$apiVersion
);
... | php | public static function initServices($refresh = false)
{
// Define full definition file path
$path = sprintf('%s%sxac-services-v%d.conf'
, ! empty(self::$logPath) ? self::$logPath : sys_get_temp_dir()
, DIRECTORY_SEPARATOR
, self::$apiVersion
);
... | [
"public",
"static",
"function",
"initServices",
"(",
"$",
"refresh",
"=",
"false",
")",
"{",
"// Define full definition file path",
"$",
"path",
"=",
"sprintf",
"(",
"'%s%sxac-services-v%d.conf'",
",",
"!",
"empty",
"(",
"self",
"::",
"$",
"logPath",
")",
"?",
... | Retrieve definition of available API services
@param boolean $refresh | [
"Retrieve",
"definition",
"of",
"available",
"API",
"services"
] | 6608f8257060375e7d3a27c485b23268b73f6ef7 | https://github.com/ArrowSphere/Client/blob/6608f8257060375e7d3a27c485b23268b73f6ef7/src/xAC.php#L172-L196 |
22,196 | ArrowSphere/Client | src/xAC.php | xAC.call | public function call($endpoint, $method = 'GET', array $data = [])
{
if (substr($endpoint, -1) == '/') {
$endpoint = substr($endpoint, 0, strlen($endpoint)-1);
}
self::log("Calling $method /api/$endpoint");
$params = [
'headers'=> [
... | php | public function call($endpoint, $method = 'GET', array $data = [])
{
if (substr($endpoint, -1) == '/') {
$endpoint = substr($endpoint, 0, strlen($endpoint)-1);
}
self::log("Calling $method /api/$endpoint");
$params = [
'headers'=> [
... | [
"public",
"function",
"call",
"(",
"$",
"endpoint",
",",
"$",
"method",
"=",
"'GET'",
",",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"substr",
"(",
"$",
"endpoint",
",",
"-",
"1",
")",
"==",
"'/'",
")",
"{",
"$",
"endpoint",
"="... | Make a HTTP Request and return response
@param string $endpoint
@param string $method
@param array $data
@throws \Exception
@return array | [
"Make",
"a",
"HTTP",
"Request",
"and",
"return",
"response"
] | 6608f8257060375e7d3a27c485b23268b73f6ef7 | https://github.com/ArrowSphere/Client/blob/6608f8257060375e7d3a27c485b23268b73f6ef7/src/xAC.php#L227-L278 |
22,197 | ArrowSphere/Client | src/xAC.php | xAC.log | public static function log($message, $level = Logger::INFO)
{
if (! self::$logger) {
$logfile = sprintf('%s%sarrowsphere-client.log', sys_get_temp_dir(), DIRECTORY_SEPARATOR);
// create a log channel
self::$logger = new Logger('xAC');
self::$logge... | php | public static function log($message, $level = Logger::INFO)
{
if (! self::$logger) {
$logfile = sprintf('%s%sarrowsphere-client.log', sys_get_temp_dir(), DIRECTORY_SEPARATOR);
// create a log channel
self::$logger = new Logger('xAC');
self::$logge... | [
"public",
"static",
"function",
"log",
"(",
"$",
"message",
",",
"$",
"level",
"=",
"Logger",
"::",
"INFO",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"$",
"logger",
")",
"{",
"$",
"logfile",
"=",
"sprintf",
"(",
"'%s%sarrowsphere-client.log'",
",",
"sys_... | Log messages to client log file
@param string $message
@param integer $level
@return boolean | [
"Log",
"messages",
"to",
"client",
"log",
"file"
] | 6608f8257060375e7d3a27c485b23268b73f6ef7 | https://github.com/ArrowSphere/Client/blob/6608f8257060375e7d3a27c485b23268b73f6ef7/src/xAC.php#L295-L306 |
22,198 | ArrowSphere/Client | src/xAC.php | xAC.getInstance | public static function getInstance(HttpClient $transport = null)
{
if (is_null(self::$client)) {
self::$client = new self();
if (! is_null($transport)) {
self::$client->setTransport($transport);
}
}
return self::$client;
... | php | public static function getInstance(HttpClient $transport = null)
{
if (is_null(self::$client)) {
self::$client = new self();
if (! is_null($transport)) {
self::$client->setTransport($transport);
}
}
return self::$client;
... | [
"public",
"static",
"function",
"getInstance",
"(",
"HttpClient",
"$",
"transport",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"self",
"::",
"$",
"client",
")",
")",
"{",
"self",
"::",
"$",
"client",
"=",
"new",
"self",
"(",
")",
";",
"if",
... | Return a singleton instance of the class
@param GuzzleHttp\Client $transport
@return Arrowsphere\Client\xAC | [
"Return",
"a",
"singleton",
"instance",
"of",
"the",
"class"
] | 6608f8257060375e7d3a27c485b23268b73f6ef7 | https://github.com/ArrowSphere/Client/blob/6608f8257060375e7d3a27c485b23268b73f6ef7/src/xAC.php#L314-L325 |
22,199 | ArrowSphere/Client | src/xAC.php | xAC.getServicesList | public static function getServicesList()
{
$map = [
'GET' => 'get',
'POST' => 'create',
'PUT' => 'update',
'DELETE' => 'delete',
];
$table = new \Console_Table();
$table->setHeaders(['Method', 'Type', 'Description', 'Parameters']);
... | php | public static function getServicesList()
{
$map = [
'GET' => 'get',
'POST' => 'create',
'PUT' => 'update',
'DELETE' => 'delete',
];
$table = new \Console_Table();
$table->setHeaders(['Method', 'Type', 'Description', 'Parameters']);
... | [
"public",
"static",
"function",
"getServicesList",
"(",
")",
"{",
"$",
"map",
"=",
"[",
"'GET'",
"=>",
"'get'",
",",
"'POST'",
"=>",
"'create'",
",",
"'PUT'",
"=>",
"'update'",
",",
"'DELETE'",
"=>",
"'delete'",
",",
"]",
";",
"$",
"table",
"=",
"new",... | Display a list of available service on console
execute from the application folder:
php -r "require 'vendor/autoload.php'; Arrowsphere\Client\xAC::getServicesList();" | [
"Display",
"a",
"list",
"of",
"available",
"service",
"on",
"console"
] | 6608f8257060375e7d3a27c485b23268b73f6ef7 | https://github.com/ArrowSphere/Client/blob/6608f8257060375e7d3a27c485b23268b73f6ef7/src/xAC.php#L352-L381 |
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.