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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
226,600 | CedrickOka/oka-pagination | src/Util/PaginationQuery.php | PaginationQuery.createSelectQuery | protected function createSelectQuery(array $fields = [], array $criteria = [], array $orderBy = [], $distinct = true)
{
if ($this->objectManager instanceof \Doctrine\ORM\EntityManager) {
/** @var \Doctrine\ORM\QueryBuilder $builder */
$builder = $this->objectManager->createQueryBuilder();
$builder->select(e... | php | protected function createSelectQuery(array $fields = [], array $criteria = [], array $orderBy = [], $distinct = true)
{
if ($this->objectManager instanceof \Doctrine\ORM\EntityManager) {
/** @var \Doctrine\ORM\QueryBuilder $builder */
$builder = $this->objectManager->createQueryBuilder();
$builder->select(e... | [
"protected",
"function",
"createSelectQuery",
"(",
"array",
"$",
"fields",
"=",
"[",
"]",
",",
"array",
"$",
"criteria",
"=",
"[",
"]",
",",
"array",
"$",
"orderBy",
"=",
"[",
"]",
",",
"$",
"distinct",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"this"... | Create internal select items query
@param array $fields
@param array $criteria
@param array $orderBy
@param bool $distinct
@return \Doctrine\ORM\AbstractQuery|\Doctrine\ODM\MongoDB\Query\Query | [
"Create",
"internal",
"select",
"items",
"query"
] | d31dcdda62a60cc5e679993c90f02c61e8131c92 | https://github.com/CedrickOka/oka-pagination/blob/d31dcdda62a60cc5e679993c90f02c61e8131c92/src/Util/PaginationQuery.php#L415-L454 |
226,601 | jpcercal/environment | src/Resource/ArrayResource.php | ArrayResource.removeChar | protected function removeChar($string, $charStart = null, $charEnd = null)
{
if (!is_null($charStart) && (is_string($charStart) || is_array($charStart))) {
if (is_string($charStart)) {
$charStart = [$charStart];
}
foreach ($charStart as $char) {
... | php | protected function removeChar($string, $charStart = null, $charEnd = null)
{
if (!is_null($charStart) && (is_string($charStart) || is_array($charStart))) {
if (is_string($charStart)) {
$charStart = [$charStart];
}
foreach ($charStart as $char) {
... | [
"protected",
"function",
"removeChar",
"(",
"$",
"string",
",",
"$",
"charStart",
"=",
"null",
",",
"$",
"charEnd",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"charStart",
")",
"&&",
"(",
"is_string",
"(",
"$",
"charStart",
")",
"||"... | Remove char at start or end position of a string.
@param string $string
@param string|null|array $charStart
@param string|null|array $charEnd
@return string | [
"Remove",
"char",
"at",
"start",
"or",
"end",
"position",
"of",
"a",
"string",
"."
] | 6be36b0585b1c856a86247e5d335063ba4f150f9 | https://github.com/jpcercal/environment/blob/6be36b0585b1c856a86247e5d335063ba4f150f9/src/Resource/ArrayResource.php#L21-L48 |
226,602 | jpcercal/environment | src/Resource/ArrayResource.php | ArrayResource.handleError | protected function handleError($type, $message, $file, $line)
{
throw new ResourceException(sprintf(
'%s: "%s" in %s on line %d',
$type,
$message,
$file,
$line
));
} | php | protected function handleError($type, $message, $file, $line)
{
throw new ResourceException(sprintf(
'%s: "%s" in %s on line %d',
$type,
$message,
$file,
$line
));
} | [
"protected",
"function",
"handleError",
"(",
"$",
"type",
",",
"$",
"message",
",",
"$",
"file",
",",
"$",
"line",
")",
"{",
"throw",
"new",
"ResourceException",
"(",
"sprintf",
"(",
"'%s: \"%s\" in %s on line %d'",
",",
"$",
"type",
",",
"$",
"message",
"... | Handle error and throw a new ResourceException.
@param int $type
@param string $message
@param string $file
@param int $line
@throws ResourceException | [
"Handle",
"error",
"and",
"throw",
"a",
"new",
"ResourceException",
"."
] | 6be36b0585b1c856a86247e5d335063ba4f150f9 | https://github.com/jpcercal/environment/blob/6be36b0585b1c856a86247e5d335063ba4f150f9/src/Resource/ArrayResource.php#L60-L69 |
226,603 | jpcercal/environment | src/Resource/ArrayResource.php | ArrayResource.filterItems | protected function filterItems(array $items)
{
$data = [];
foreach ($items as $item) {
$item = trim($item);
if (empty($item)) {
continue;
}
$item = $this->removeChar($item, '[', ']');
if ($this->itemIsSerialized($item)) ... | php | protected function filterItems(array $items)
{
$data = [];
foreach ($items as $item) {
$item = trim($item);
if (empty($item)) {
continue;
}
$item = $this->removeChar($item, '[', ']');
if ($this->itemIsSerialized($item)) ... | [
"protected",
"function",
"filterItems",
"(",
"array",
"$",
"items",
")",
"{",
"$",
"data",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"items",
"as",
"$",
"item",
")",
"{",
"$",
"item",
"=",
"trim",
"(",
"$",
"item",
")",
";",
"if",
"(",
"empty",
... | Filter the items.
@param array $items
@return array | [
"Filter",
"the",
"items",
"."
] | 6be36b0585b1c856a86247e5d335063ba4f150f9 | https://github.com/jpcercal/environment/blob/6be36b0585b1c856a86247e5d335063ba4f150f9/src/Resource/ArrayResource.php#L90-L123 |
226,604 | jpcercal/environment | src/Resource/ArrayResource.php | ArrayResource.parseArray | protected function parseArray($data)
{
$pattern = '/(\[[^\[\]]*\])/';
set_error_handler([__CLASS__, 'handleError']);
while (true) {
if (!preg_match($pattern, $data, $matches) > 0) {
break;
}
$stringMatches = trim($matches[0]);
... | php | protected function parseArray($data)
{
$pattern = '/(\[[^\[\]]*\])/';
set_error_handler([__CLASS__, 'handleError']);
while (true) {
if (!preg_match($pattern, $data, $matches) > 0) {
break;
}
$stringMatches = trim($matches[0]);
... | [
"protected",
"function",
"parseArray",
"(",
"$",
"data",
")",
"{",
"$",
"pattern",
"=",
"'/(\\[[^\\[\\]]*\\])/'",
";",
"set_error_handler",
"(",
"[",
"__CLASS__",
",",
"'handleError'",
"]",
")",
";",
"while",
"(",
"true",
")",
"{",
"if",
"(",
"!",
"preg_ma... | Parse a string that represents an array statement to create an array data.
@param string $data
@return array | [
"Parse",
"a",
"string",
"that",
"represents",
"an",
"array",
"statement",
"to",
"create",
"an",
"array",
"data",
"."
] | 6be36b0585b1c856a86247e5d335063ba4f150f9 | https://github.com/jpcercal/environment/blob/6be36b0585b1c856a86247e5d335063ba4f150f9/src/Resource/ArrayResource.php#L132-L158 |
226,605 | phergie/phergie-irc-bot-react | src/EventQueueFactory.php | EventQueueFactory.getEventQueue | public function getEventQueue(ConnectionInterface $connection)
{
if (!isset($this->queues[$connection])) {
$this->queues[$connection] = new EventQueue;
}
return $this->queues[$connection];
} | php | public function getEventQueue(ConnectionInterface $connection)
{
if (!isset($this->queues[$connection])) {
$this->queues[$connection] = new EventQueue;
}
return $this->queues[$connection];
} | [
"public",
"function",
"getEventQueue",
"(",
"ConnectionInterface",
"$",
"connection",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"queues",
"[",
"$",
"connection",
"]",
")",
")",
"{",
"$",
"this",
"->",
"queues",
"[",
"$",
"connection",
... | Returns the event queue for a specified connection.
@param \Phergie\Irc\ConnectionInterface $connection
@return \Phergie\Irc\Bot\React\EventQueueInterface | [
"Returns",
"the",
"event",
"queue",
"for",
"a",
"specified",
"connection",
"."
] | 17745ef6b846513258af3dbd86e5612d3deb19b7 | https://github.com/phergie/phergie-irc-bot-react/blob/17745ef6b846513258af3dbd86e5612d3deb19b7/src/EventQueueFactory.php#L43-L49 |
226,606 | gigaai/framework | src/Storage/Eloquent/Lead.php | Lead.linkedUser | public function linkedUser($props = [])
{
if (!$this->isLinked() && isset($props['try_matching']) && $props['try_matching'] === true) {
return Matching::matchCurrentLead();
}
return $this->belongsTo($this->getUserModel(), 'linked_account', $this->getUserModelKey());
} | php | public function linkedUser($props = [])
{
if (!$this->isLinked() && isset($props['try_matching']) && $props['try_matching'] === true) {
return Matching::matchCurrentLead();
}
return $this->belongsTo($this->getUserModel(), 'linked_account', $this->getUserModelKey());
} | [
"public",
"function",
"linkedUser",
"(",
"$",
"props",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isLinked",
"(",
")",
"&&",
"isset",
"(",
"$",
"props",
"[",
"'try_matching'",
"]",
")",
"&&",
"$",
"props",
"[",
"'try_matching'",
"... | Laravel linked user
@param $props
@return mixed | [
"Laravel",
"linked",
"user"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Storage/Eloquent/Lead.php#L121-L128 |
226,607 | gigaai/framework | src/Storage/Eloquent/Lead.php | Lead.user | public function user($props = [])
{
if (!$this->isLinked() && isset($props['try_matching']) && $props['try_matching'] === true) {
return Matching::matchCurrentLead();
}
return $this->linkedUser()->first();
} | php | public function user($props = [])
{
if (!$this->isLinked() && isset($props['try_matching']) && $props['try_matching'] === true) {
return Matching::matchCurrentLead();
}
return $this->linkedUser()->first();
} | [
"public",
"function",
"user",
"(",
"$",
"props",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isLinked",
"(",
")",
"&&",
"isset",
"(",
"$",
"props",
"[",
"'try_matching'",
"]",
")",
"&&",
"$",
"props",
"[",
"'try_matching'",
"]",
... | Linked user relationship
@param array $props
@return null | [
"Linked",
"user",
"relationship"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Storage/Eloquent/Lead.php#L136-L143 |
226,608 | gigaai/framework | src/MessengerBot.php | MessengerBot.run | public function run()
{
$received = $this->request->getReceivedData();
if (!$received || empty($received['object']) || $received['object'] != 'page') {
return;
}
$this->received = $received;
if (!isset($received['entry'])) {
return;
}
... | php | public function run()
{
$received = $this->request->getReceivedData();
if (!$received || empty($received['object']) || $received['object'] != 'page') {
return;
}
$this->received = $received;
if (!isset($received['entry'])) {
return;
}
... | [
"public",
"function",
"run",
"(",
")",
"{",
"$",
"received",
"=",
"$",
"this",
"->",
"request",
"->",
"getReceivedData",
"(",
")",
";",
"if",
"(",
"!",
"$",
"received",
"||",
"empty",
"(",
"$",
"received",
"[",
"'object'",
"]",
")",
"||",
"$",
"rec... | Run the bot | [
"Run",
"the",
"bot"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/MessengerBot.php#L152-L181 |
226,609 | gigaai/framework | src/MessengerBot.php | MessengerBot.processEvent | public function processEvent($event)
{
// Pass thread control to Inbox if Page Administrators move from Done to Inbox
if (isset($event['request_thread_control'])) {
return $this->passToInbox();
}
// Handle Account Linking and Unlinking
if (isset($event['account_l... | php | public function processEvent($event)
{
// Pass thread control to Inbox if Page Administrators move from Done to Inbox
if (isset($event['request_thread_control'])) {
return $this->passToInbox();
}
// Handle Account Linking and Unlinking
if (isset($event['account_l... | [
"public",
"function",
"processEvent",
"(",
"$",
"event",
")",
"{",
"// Pass thread control to Inbox if Page Administrators move from Done to Inbox",
"if",
"(",
"isset",
"(",
"$",
"event",
"[",
"'request_thread_control'",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->"... | Process the event and response
@param Array $event
@return void | [
"Process",
"the",
"event",
"and",
"response"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/MessengerBot.php#L190-L263 |
226,610 | gigaai/framework | src/MessengerBot.php | MessengerBot.initNlp | private function initNlp($message)
{
if (isset($message['nlp']) && is_array($message['nlp'])) {
$this->nlp = new Nlp($message['nlp']);
Conversation::set('nlp', $this->nlp);
}
} | php | private function initNlp($message)
{
if (isset($message['nlp']) && is_array($message['nlp'])) {
$this->nlp = new Nlp($message['nlp']);
Conversation::set('nlp', $this->nlp);
}
} | [
"private",
"function",
"initNlp",
"(",
"$",
"message",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"message",
"[",
"'nlp'",
"]",
")",
"&&",
"is_array",
"(",
"$",
"message",
"[",
"'nlp'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"nlp",
"=",
"new",
"Nlp"... | Load NLP Data
@return void | [
"Load",
"NLP",
"Data"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/MessengerBot.php#L270-L276 |
226,611 | gigaai/framework | src/MessengerBot.php | MessengerBot.response | public function response($nodes, $lead_id = null)
{
foreach ($nodes as $node) {
// Set intended action if this node has
if (!empty($node->wait)) {
$lead = $this->conversation->get('lead');
$lead->data('_wait', $node->wait);
}
... | php | public function response($nodes, $lead_id = null)
{
foreach ($nodes as $node) {
// Set intended action if this node has
if (!empty($node->wait)) {
$lead = $this->conversation->get('lead');
$lead->data('_wait', $node->wait);
}
... | [
"public",
"function",
"response",
"(",
"$",
"nodes",
",",
"$",
"lead_id",
"=",
"null",
")",
"{",
"foreach",
"(",
"$",
"nodes",
"as",
"$",
"node",
")",
"{",
"// Set intended action if this node has",
"if",
"(",
"!",
"empty",
"(",
"$",
"node",
"->",
"wait"... | Response sender message
@param $nodes
@param null $lead_id | [
"Response",
"sender",
"message"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/MessengerBot.php#L296-L312 |
226,612 | gigaai/framework | src/MessengerBot.php | MessengerBot.findNodes | public function findNodes($message_type, $ask)
{
$nodes = Node::findByTypeAndPattern($message_type, $ask);
if ($nodes->count() === 0) {
$nodes = Node::findByTypeAndPattern('default');
}
return $nodes->filter(function ($node) {
$pageId = Conversation::get('pa... | php | public function findNodes($message_type, $ask)
{
$nodes = Node::findByTypeAndPattern($message_type, $ask);
if ($nodes->count() === 0) {
$nodes = Node::findByTypeAndPattern('default');
}
return $nodes->filter(function ($node) {
$pageId = Conversation::get('pa... | [
"public",
"function",
"findNodes",
"(",
"$",
"message_type",
",",
"$",
"ask",
")",
"{",
"$",
"nodes",
"=",
"Node",
"::",
"findByTypeAndPattern",
"(",
"$",
"message_type",
",",
"$",
"ask",
")",
";",
"if",
"(",
"$",
"nodes",
"->",
"count",
"(",
")",
"=... | Find a response for current request
@param String $message_type text or payload
@param String $ask Message or Payload name
@return Node[] | [
"Find",
"a",
"response",
"for",
"current",
"request"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/MessengerBot.php#L322-L336 |
226,613 | gigaai/framework | src/MessengerBot.php | MessengerBot.responseIntendedAction | private function responseIntendedAction()
{
$lead = $this->conversation->get('lead');
$waiting = $lead->_wait;
// We set previous_waiting to back to support $bot->keep() method
$this->conversation->set('previous_intended_action', $waiting);
if (!empty($waiting)) {
... | php | private function responseIntendedAction()
{
$lead = $this->conversation->get('lead');
$waiting = $lead->_wait;
// We set previous_waiting to back to support $bot->keep() method
$this->conversation->set('previous_intended_action', $waiting);
if (!empty($waiting)) {
... | [
"private",
"function",
"responseIntendedAction",
"(",
")",
"{",
"$",
"lead",
"=",
"$",
"this",
"->",
"conversation",
"->",
"get",
"(",
"'lead'",
")",
";",
"$",
"waiting",
"=",
"$",
"lead",
"->",
"_wait",
";",
"// We set previous_waiting to back to support $bot->... | Response for intended actions
@return bool | [
"Response",
"for",
"intended",
"actions"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/MessengerBot.php#L343-L374 |
226,614 | gigaai/framework | src/MessengerBot.php | MessengerBot.getLocation | public function getLocation($output = '')
{
$attachments = $this->getAttachments();
$location = new \stdClass();
if (!empty($attachments) && isset($attachments[0]['type']) && $attachments[0]['type'] === 'location') {
$location = $attachments[0]['payload']->coordinates;
... | php | public function getLocation($output = '')
{
$attachments = $this->getAttachments();
$location = new \stdClass();
if (!empty($attachments) && isset($attachments[0]['type']) && $attachments[0]['type'] === 'location') {
$location = $attachments[0]['payload']->coordinates;
... | [
"public",
"function",
"getLocation",
"(",
"$",
"output",
"=",
"''",
")",
"{",
"$",
"attachments",
"=",
"$",
"this",
"->",
"getAttachments",
"(",
")",
";",
"$",
"location",
"=",
"new",
"\\",
"stdClass",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"... | Get user sent location
@param string $output If provided, returns either `lat` or `long` of current location
@return mixed | [
"Get",
"user",
"sent",
"location"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/MessengerBot.php#L383-L398 |
226,615 | gigaai/framework | src/MessengerBot.php | MessengerBot.getAttachments | public function getAttachments()
{
if ($this->isUserMessage() && isset($this->message->attachments)) {
return $this->message->attachments;
}
return null;
} | php | public function getAttachments()
{
if ($this->isUserMessage() && isset($this->message->attachments)) {
return $this->message->attachments;
}
return null;
} | [
"public",
"function",
"getAttachments",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isUserMessage",
"(",
")",
"&&",
"isset",
"(",
"$",
"this",
"->",
"message",
"->",
"attachments",
")",
")",
"{",
"return",
"$",
"this",
"->",
"message",
"->",
"attachm... | Get user attachments
@return mixed | [
"Get",
"user",
"attachments"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/MessengerBot.php#L405-L412 |
226,616 | gigaai/framework | src/MessengerBot.php | MessengerBot.getReceivedText | public function getReceivedText()
{
if ($this->isUserMessage()) {
return isset($this->message->text) ? $this->message->text : '';
}
return '';
} | php | public function getReceivedText()
{
if ($this->isUserMessage()) {
return isset($this->message->text) ? $this->message->text : '';
}
return '';
} | [
"public",
"function",
"getReceivedText",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isUserMessage",
"(",
")",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"message",
"->",
"text",
")",
"?",
"$",
"this",
"->",
"message",
"->",
"text",
":",
... | Get user sent text
@return string | [
"Get",
"user",
"sent",
"text"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/MessengerBot.php#L419-L426 |
226,617 | gigaai/framework | src/MessengerBot.php | MessengerBot.isUserMessage | private function isUserMessage()
{
if (!empty($this->message) && isset($this->message['metadata'])) {
return $this->message['metadata'] != 'SENT_BY_GIGA_AI';
}
return true;
} | php | private function isUserMessage()
{
if (!empty($this->message) && isset($this->message['metadata'])) {
return $this->message['metadata'] != 'SENT_BY_GIGA_AI';
}
return true;
} | [
"private",
"function",
"isUserMessage",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"message",
")",
"&&",
"isset",
"(",
"$",
"this",
"->",
"message",
"[",
"'metadata'",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"message",
... | Check if current message is sent by user
@return boolean | [
"Check",
"if",
"current",
"message",
"is",
"sent",
"by",
"user"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/MessengerBot.php#L455-L462 |
226,618 | gigaai/framework | src/Message/Message.php | Message.load | public static function load($body, $flags = [])
{
$instance = new static($body);
if (!isset($flags['skip_detection']) || !$flags['skip_detection']) {
if (!$instance->expectedFormat()) {
return false;
}
}
return $instance->normalize();
} | php | public static function load($body, $flags = [])
{
$instance = new static($body);
if (!isset($flags['skip_detection']) || !$flags['skip_detection']) {
if (!$instance->expectedFormat()) {
return false;
}
}
return $instance->normalize();
} | [
"public",
"static",
"function",
"load",
"(",
"$",
"body",
",",
"$",
"flags",
"=",
"[",
"]",
")",
"{",
"$",
"instance",
"=",
"new",
"static",
"(",
"$",
"body",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"flags",
"[",
"'skip_detection'",
"]",
")"... | Load the message to parse and return
@param $body
@return mixed | [
"Load",
"the",
"message",
"to",
"parse",
"and",
"return"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Message/Message.php#L35-L46 |
226,619 | gigaai/framework | src/Shortcodes/Shortcode.php | Shortcode.parse | public static function parse($answer)
{
if ( ! is_array($answer)) {
return;
}
foreach ($answer as $key => $value) {
$parsed = is_array($value) ? self::parse($value) : self::process($value);
if ( ! empty($parsed)) {
$answer[$key] = $parsed... | php | public static function parse($answer)
{
if ( ! is_array($answer)) {
return;
}
foreach ($answer as $key => $value) {
$parsed = is_array($value) ? self::parse($value) : self::process($value);
if ( ! empty($parsed)) {
$answer[$key] = $parsed... | [
"public",
"static",
"function",
"parse",
"(",
"$",
"answer",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"answer",
")",
")",
"{",
"return",
";",
"}",
"foreach",
"(",
"$",
"answer",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"parsed"... | Recursive parse shortcode from array
@param $answer
@return mixed | [
"Recursive",
"parse",
"shortcode",
"from",
"array"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Shortcodes/Shortcode.php#L86-L103 |
226,620 | pug-php/js-phpize | src/JsPhpize/JsPhpize.php | JsPhpize.render | public function render($input, $filename = null, array $variables = [])
{
if (is_array($filename)) {
$variables = $filename;
$filename = null;
}
if (!in_array($this->stream, $this->streamsRegistered)) {
$this->streamsRegistered[] = $this->stream;
... | php | public function render($input, $filename = null, array $variables = [])
{
if (is_array($filename)) {
$variables = $filename;
$filename = null;
}
if (!in_array($this->stream, $this->streamsRegistered)) {
$this->streamsRegistered[] = $this->stream;
... | [
"public",
"function",
"render",
"(",
"$",
"input",
",",
"$",
"filename",
"=",
"null",
",",
"array",
"$",
"variables",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"filename",
")",
")",
"{",
"$",
"variables",
"=",
"$",
"filename",
";",
... | Compile and return the code execution result.
@param string $input file or content
@param string $filename if specified, input is used as content and filename as its name
@param array $variables variables to be used in rendered code
@return mixed | [
"Compile",
"and",
"return",
"the",
"code",
"execution",
"result",
"."
] | c41102da1be243ba9439b90af8b7032016585537 | https://github.com/pug-php/js-phpize/blob/c41102da1be243ba9439b90af8b7032016585537/src/JsPhpize/JsPhpize.php#L140-L189 |
226,621 | pug-php/js-phpize | src/JsPhpize/JsPhpize.php | JsPhpize.share | public function share($variables, $value = null)
{
if (!is_array($variables)) {
$variables = [strval($variables) => $value];
}
$this->sharedVariables = array_merge($this->sharedVariables, $variables);
} | php | public function share($variables, $value = null)
{
if (!is_array($variables)) {
$variables = [strval($variables) => $value];
}
$this->sharedVariables = array_merge($this->sharedVariables, $variables);
} | [
"public",
"function",
"share",
"(",
"$",
"variables",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"variables",
")",
")",
"{",
"$",
"variables",
"=",
"[",
"strval",
"(",
"$",
"variables",
")",
"=>",
"$",
"value",
... | Add a variable or an array of variables to be shared with all templates that will be rendered
by the instance of Pug.
@param array|string $variables|$key an associatives array of variable names and values, or a
variable name if you wish to sahre only one
@param mixed $value if you pass an array as firs... | [
"Add",
"a",
"variable",
"or",
"an",
"array",
"of",
"variables",
"to",
"be",
"shared",
"with",
"all",
"templates",
"that",
"will",
"be",
"rendered",
"by",
"the",
"instance",
"of",
"Pug",
"."
] | c41102da1be243ba9439b90af8b7032016585537 | https://github.com/pug-php/js-phpize/blob/c41102da1be243ba9439b90af8b7032016585537/src/JsPhpize/JsPhpize.php#L228-L234 |
226,622 | egeriis/laravel-jsonapi | src/EchoIt/JsonApi/Handler.php | Handler.fulfillRequest | public function fulfillRequest()
{
if (! $this->supportsMethod($this->request->method)) {
throw new Exception(
'Method not allowed',
static::ERROR_SCOPE | static::ERROR_HTTP_METHOD_NOT_ALLOWED,
BaseResponse::HTTP_METHOD_NOT_ALLOWED
);
... | php | public function fulfillRequest()
{
if (! $this->supportsMethod($this->request->method)) {
throw new Exception(
'Method not allowed',
static::ERROR_SCOPE | static::ERROR_HTTP_METHOD_NOT_ALLOWED,
BaseResponse::HTTP_METHOD_NOT_ALLOWED
);
... | [
"public",
"function",
"fulfillRequest",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"supportsMethod",
"(",
"$",
"this",
"->",
"request",
"->",
"method",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'Method not allowed'",
",",
"static",
"::",
"... | Fulfill the API request and return a response.
@return \EchoIT\JsonApi\Response
@throws Exception | [
"Fulfill",
"the",
"API",
"request",
"and",
"return",
"a",
"response",
"."
] | 6d58e14cba26c0624d38f75273cff86fd4678289 | https://github.com/egeriis/laravel-jsonapi/blob/6d58e14cba26c0624d38f75273cff86fd4678289/src/EchoIt/JsonApi/Handler.php#L63-L113 |
226,623 | egeriis/laravel-jsonapi | src/EchoIt/JsonApi/Handler.php | Handler.loadRelatedModels | protected function loadRelatedModels(Model $model) {
// get the relations to load
$relations = $this->exposedRelationsFromRequest($model);
foreach ($relations as $relation) {
// if this relation is loaded via a method, then call said method
if (in_array($relation, $model... | php | protected function loadRelatedModels(Model $model) {
// get the relations to load
$relations = $this->exposedRelationsFromRequest($model);
foreach ($relations as $relation) {
// if this relation is loaded via a method, then call said method
if (in_array($relation, $model... | [
"protected",
"function",
"loadRelatedModels",
"(",
"Model",
"$",
"model",
")",
"{",
"// get the relations to load",
"$",
"relations",
"=",
"$",
"this",
"->",
"exposedRelationsFromRequest",
"(",
"$",
"model",
")",
";",
"foreach",
"(",
"$",
"relations",
"as",
"$",... | Load a model's relations
@param Model $model the model to load relations of
@return void | [
"Load",
"a",
"model",
"s",
"relations"
] | 6d58e14cba26c0624d38f75273cff86fd4678289 | https://github.com/egeriis/laravel-jsonapi/blob/6d58e14cba26c0624d38f75273cff86fd4678289/src/EchoIt/JsonApi/Handler.php#L121-L134 |
226,624 | egeriis/laravel-jsonapi | src/EchoIt/JsonApi/Handler.php | Handler.exposedRelationsFromRequest | protected function exposedRelationsFromRequest($model = null)
{
$exposedRelations = static::$exposedRelations;
// if no relations are to be included by request
if (count($this->request->include) == 0) {
// and if we have a model
if ($model !== null && $model instance... | php | protected function exposedRelationsFromRequest($model = null)
{
$exposedRelations = static::$exposedRelations;
// if no relations are to be included by request
if (count($this->request->include) == 0) {
// and if we have a model
if ($model !== null && $model instance... | [
"protected",
"function",
"exposedRelationsFromRequest",
"(",
"$",
"model",
"=",
"null",
")",
"{",
"$",
"exposedRelations",
"=",
"static",
"::",
"$",
"exposedRelations",
";",
"// if no relations are to be included by request",
"if",
"(",
"count",
"(",
"$",
"this",
"-... | Returns which requested resources are available to include.
@param Model $model
@return array | [
"Returns",
"which",
"requested",
"resources",
"are",
"available",
"to",
"include",
"."
] | 6d58e14cba26c0624d38f75273cff86fd4678289 | https://github.com/egeriis/laravel-jsonapi/blob/6d58e14cba26c0624d38f75273cff86fd4678289/src/EchoIt/JsonApi/Handler.php#L142-L164 |
226,625 | egeriis/laravel-jsonapi | src/EchoIt/JsonApi/Handler.php | Handler.getIncludedModels | protected function getIncludedModels($models)
{
$links = new Collection();
$models = $models instanceof Collection ? $models : [$models];
foreach ($models as $model) {
foreach ($this->exposedRelationsFromRequest($model) as $relationName) {
$value = static::getMod... | php | protected function getIncludedModels($models)
{
$links = new Collection();
$models = $models instanceof Collection ? $models : [$models];
foreach ($models as $model) {
foreach ($this->exposedRelationsFromRequest($model) as $relationName) {
$value = static::getMod... | [
"protected",
"function",
"getIncludedModels",
"(",
"$",
"models",
")",
"{",
"$",
"links",
"=",
"new",
"Collection",
"(",
")",
";",
"$",
"models",
"=",
"$",
"models",
"instanceof",
"Collection",
"?",
"$",
"models",
":",
"[",
"$",
"models",
"]",
";",
"fo... | Iterate through result set to fetch the requested resources to include.
@param \Illuminate\Database\Eloquent\Collection|\EchoIT\JsonApi\Model $models
@return array | [
"Iterate",
"through",
"result",
"set",
"to",
"fetch",
"the",
"requested",
"resources",
"to",
"include",
"."
] | 6d58e14cba26c0624d38f75273cff86fd4678289 | https://github.com/egeriis/laravel-jsonapi/blob/6d58e14cba26c0624d38f75273cff86fd4678289/src/EchoIt/JsonApi/Handler.php#L182-L223 |
226,626 | egeriis/laravel-jsonapi | src/EchoIt/JsonApi/Handler.php | Handler.getPaginationLinks | protected function getPaginationLinks($paginator)
{
$links = [];
$links['self'] = urldecode($paginator->url($paginator->currentPage()));
$links['first'] = urldecode($paginator->url(1));
$links['last'] = urldecode($paginator->url($paginator->lastPage()));
$links['prev'] = ur... | php | protected function getPaginationLinks($paginator)
{
$links = [];
$links['self'] = urldecode($paginator->url($paginator->currentPage()));
$links['first'] = urldecode($paginator->url(1));
$links['last'] = urldecode($paginator->url($paginator->lastPage()));
$links['prev'] = ur... | [
"protected",
"function",
"getPaginationLinks",
"(",
"$",
"paginator",
")",
"{",
"$",
"links",
"=",
"[",
"]",
";",
"$",
"links",
"[",
"'self'",
"]",
"=",
"urldecode",
"(",
"$",
"paginator",
"->",
"url",
"(",
"$",
"paginator",
"->",
"currentPage",
"(",
"... | Return pagination links as array
@param LengthAwarePaginator $paginator
@return array | [
"Return",
"pagination",
"links",
"as",
"array"
] | 6d58e14cba26c0624d38f75273cff86fd4678289 | https://github.com/egeriis/laravel-jsonapi/blob/6d58e14cba26c0624d38f75273cff86fd4678289/src/EchoIt/JsonApi/Handler.php#L230-L247 |
226,627 | egeriis/laravel-jsonapi | src/EchoIt/JsonApi/Handler.php | Handler.getNonBreakingErrors | protected function getNonBreakingErrors()
{
$errors = [];
$unknownRelations = $this->unknownRelationsFromRequest();
if (count($unknownRelations) > 0) {
$errors[] = [
'code' => static::ERROR_UNKNOWN_LINKED_RESOURCES,
'title' => 'Unknown included re... | php | protected function getNonBreakingErrors()
{
$errors = [];
$unknownRelations = $this->unknownRelationsFromRequest();
if (count($unknownRelations) > 0) {
$errors[] = [
'code' => static::ERROR_UNKNOWN_LINKED_RESOURCES,
'title' => 'Unknown included re... | [
"protected",
"function",
"getNonBreakingErrors",
"(",
")",
"{",
"$",
"errors",
"=",
"[",
"]",
";",
"$",
"unknownRelations",
"=",
"$",
"this",
"->",
"unknownRelationsFromRequest",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"unknownRelations",
")",
">",
"0... | Return errors which did not prevent the API from returning a result set.
@return array | [
"Return",
"errors",
"which",
"did",
"not",
"prevent",
"the",
"API",
"from",
"returning",
"a",
"result",
"set",
"."
] | 6d58e14cba26c0624d38f75273cff86fd4678289 | https://github.com/egeriis/laravel-jsonapi/blob/6d58e14cba26c0624d38f75273cff86fd4678289/src/EchoIt/JsonApi/Handler.php#L254-L268 |
226,628 | egeriis/laravel-jsonapi | src/EchoIt/JsonApi/Handler.php | Handler.successfulHttpStatusCode | public static function successfulHttpStatusCode($method, $model = null)
{
// if we did a put request, we need to ensure that the model wasn't
// changed in other ways than those specified by the request
// Ref: http://jsonapi.org/format/#crud-updating-responses-200
if (($method =... | php | public static function successfulHttpStatusCode($method, $model = null)
{
// if we did a put request, we need to ensure that the model wasn't
// changed in other ways than those specified by the request
// Ref: http://jsonapi.org/format/#crud-updating-responses-200
if (($method =... | [
"public",
"static",
"function",
"successfulHttpStatusCode",
"(",
"$",
"method",
",",
"$",
"model",
"=",
"null",
")",
"{",
"// if we did a put request, we need to ensure that the model wasn't",
"// changed in other ways than those specified by the request",
"// Ref: http://jsonapi... | A method for getting the proper HTTP status code for a successful request
@param string $method "PUT", "POST", "DELETE" or "GET"
@param Model|null $model The model that a PUT request was executed against
@return int | [
"A",
"method",
"for",
"getting",
"the",
"proper",
"HTTP",
"status",
"code",
"for",
"a",
"successful",
"request"
] | 6d58e14cba26c0624d38f75273cff86fd4678289 | https://github.com/egeriis/laravel-jsonapi/blob/6d58e14cba26c0624d38f75273cff86fd4678289/src/EchoIt/JsonApi/Handler.php#L277-L304 |
226,629 | egeriis/laravel-jsonapi | src/EchoIt/JsonApi/Handler.php | Handler.getModelsForRelation | protected static function getModelsForRelation($model, $relationKey)
{
if (!method_exists($model, $relationKey)) {
throw new Exception(
'Relation "' . $relationKey . '" does not exist in model',
static::ERROR_SCOPE | static::ERROR_UNKNOWN_ID,
... | php | protected static function getModelsForRelation($model, $relationKey)
{
if (!method_exists($model, $relationKey)) {
throw new Exception(
'Relation "' . $relationKey . '" does not exist in model',
static::ERROR_SCOPE | static::ERROR_UNKNOWN_ID,
... | [
"protected",
"static",
"function",
"getModelsForRelation",
"(",
"$",
"model",
",",
"$",
"relationKey",
")",
"{",
"if",
"(",
"!",
"method_exists",
"(",
"$",
"model",
",",
"$",
"relationKey",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'Relation \"'",
... | Returns the models from a relationship. Will always return as array.
@param \Illuminate\Database\Eloquent\Model $model
@param string $relationKey
@return array|\Illuminate\Database\Eloquent\Collection
@throws Exception | [
"Returns",
"the",
"models",
"from",
"a",
"relationship",
".",
"Will",
"always",
"return",
"as",
"array",
"."
] | 6d58e14cba26c0624d38f75273cff86fd4678289 | https://github.com/egeriis/laravel-jsonapi/blob/6d58e14cba26c0624d38f75273cff86fd4678289/src/EchoIt/JsonApi/Handler.php#L325-L344 |
226,630 | egeriis/laravel-jsonapi | src/EchoIt/JsonApi/Handler.php | Handler.handleSortRequest | protected function handleSortRequest($cols, $model)
{
foreach ($cols as $col) {
$dir = 'asc';
if (substr($col, 0, 1) == '-') {
$dir = 'desc';
$col = substr($col, 1);
}
$model = $model->orderBy($col, $dir);
}
re... | php | protected function handleSortRequest($cols, $model)
{
foreach ($cols as $col) {
$dir = 'asc';
if (substr($col, 0, 1) == '-') {
$dir = 'desc';
$col = substr($col, 1);
}
$model = $model->orderBy($col, $dir);
}
re... | [
"protected",
"function",
"handleSortRequest",
"(",
"$",
"cols",
",",
"$",
"model",
")",
"{",
"foreach",
"(",
"$",
"cols",
"as",
"$",
"col",
")",
"{",
"$",
"dir",
"=",
"'asc'",
";",
"if",
"(",
"substr",
"(",
"$",
"col",
",",
"0",
",",
"1",
")",
... | Function to handle sorting requests.
@param array $cols list of column names to sort on
@param \EchoIt\JsonApi\Model $model
@return \EchoIt\JsonApi\Model
@throws Exception | [
"Function",
"to",
"handle",
"sorting",
"requests",
"."
] | 6d58e14cba26c0624d38f75273cff86fd4678289 | https://github.com/egeriis/laravel-jsonapi/blob/6d58e14cba26c0624d38f75273cff86fd4678289/src/EchoIt/JsonApi/Handler.php#L384-L397 |
226,631 | egeriis/laravel-jsonapi | src/EchoIt/JsonApi/Handler.php | Handler.parseRequestContent | protected function parseRequestContent($content, $type)
{
$content = json_decode($content, true);
if (empty($content['data'])) {
throw new Exception(
'Payload either contains misformed JSON or missing "data" parameter.',
static::ERROR_SCOPE | static::ERROR... | php | protected function parseRequestContent($content, $type)
{
$content = json_decode($content, true);
if (empty($content['data'])) {
throw new Exception(
'Payload either contains misformed JSON or missing "data" parameter.',
static::ERROR_SCOPE | static::ERROR... | [
"protected",
"function",
"parseRequestContent",
"(",
"$",
"content",
",",
"$",
"type",
")",
"{",
"$",
"content",
"=",
"json_decode",
"(",
"$",
"content",
",",
"true",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"content",
"[",
"'data'",
"]",
")",
")",
"{... | Parses content from request into an array of values.
@param string $content
@param string $type the type the content is expected to be.
@return array
@throws Exception | [
"Parses",
"content",
"from",
"request",
"into",
"an",
"array",
"of",
"values",
"."
] | 6d58e14cba26c0624d38f75273cff86fd4678289 | https://github.com/egeriis/laravel-jsonapi/blob/6d58e14cba26c0624d38f75273cff86fd4678289/src/EchoIt/JsonApi/Handler.php#L407-L436 |
226,632 | egeriis/laravel-jsonapi | src/EchoIt/JsonApi/Handler.php | Handler.handlePaginationRequest | protected function handlePaginationRequest($request, $model, $total = null)
{
$page = $request->pageNumber;
$perPage = $request->pageSize;
if (!$total) {
$total = $model->count();
}
$results = $model->forPage($page, $perPage)->get(array('*'));
$paginator =... | php | protected function handlePaginationRequest($request, $model, $total = null)
{
$page = $request->pageNumber;
$perPage = $request->pageSize;
if (!$total) {
$total = $model->count();
}
$results = $model->forPage($page, $perPage)->get(array('*'));
$paginator =... | [
"protected",
"function",
"handlePaginationRequest",
"(",
"$",
"request",
",",
"$",
"model",
",",
"$",
"total",
"=",
"null",
")",
"{",
"$",
"page",
"=",
"$",
"request",
"->",
"pageNumber",
";",
"$",
"perPage",
"=",
"$",
"request",
"->",
"pageSize",
";",
... | Function to handle pagination requests.
@param \EchoIt\JsonApi\Request $request
@param \EchoIt\JsonApi\Model $model
@param integer $total the total number of records
@return \Illuminate\Pagination\LengthAwarePaginator | [
"Function",
"to",
"handle",
"pagination",
"requests",
"."
] | 6d58e14cba26c0624d38f75273cff86fd4678289 | https://github.com/egeriis/laravel-jsonapi/blob/6d58e14cba26c0624d38f75273cff86fd4678289/src/EchoIt/JsonApi/Handler.php#L446-L469 |
226,633 | egeriis/laravel-jsonapi | src/EchoIt/JsonApi/Handler.php | Handler.handleFilterRequest | protected function handleFilterRequest($filters, $model)
{
foreach ($filters as $key=>$value) {
$model = $model->where($key, '=', $value);
}
return $model;
} | php | protected function handleFilterRequest($filters, $model)
{
foreach ($filters as $key=>$value) {
$model = $model->where($key, '=', $value);
}
return $model;
} | [
"protected",
"function",
"handleFilterRequest",
"(",
"$",
"filters",
",",
"$",
"model",
")",
"{",
"foreach",
"(",
"$",
"filters",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"model",
"=",
"$",
"model",
"->",
"where",
"(",
"$",
"key",
",",
... | Function to handle filtering requests.
@param array $filters key=>value pairs of column and value to filter on
@param \EchoIt\JsonApi\Model $model
@return \EchoIt\JsonApi\Model | [
"Function",
"to",
"handle",
"filtering",
"requests",
"."
] | 6d58e14cba26c0624d38f75273cff86fd4678289 | https://github.com/egeriis/laravel-jsonapi/blob/6d58e14cba26c0624d38f75273cff86fd4678289/src/EchoIt/JsonApi/Handler.php#L478-L484 |
226,634 | egeriis/laravel-jsonapi | src/EchoIt/JsonApi/Handler.php | Handler.handleGetDefault | protected function handleGetDefault(Request $request, $model)
{
$total = null;
if (empty($request->id)) {
if (!empty($request->filter)) {
$model = $this->handleFilterRequest($request->filter, $model);
}
if (!empty($request->sort)) {
... | php | protected function handleGetDefault(Request $request, $model)
{
$total = null;
if (empty($request->id)) {
if (!empty($request->filter)) {
$model = $this->handleFilterRequest($request->filter, $model);
}
if (!empty($request->sort)) {
... | [
"protected",
"function",
"handleGetDefault",
"(",
"Request",
"$",
"request",
",",
"$",
"model",
")",
"{",
"$",
"total",
"=",
"null",
";",
"if",
"(",
"empty",
"(",
"$",
"request",
"->",
"id",
")",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"reques... | Default handling of GET request.
Must be called explicitly in handleGet function.
@param \EchoIt\JsonApi\Request $request
@param \EchoIt\JsonApi\Model $model
@return \EchoIt\JsonApi\Model|\Illuminate\Pagination\LengthAwarePaginator
@throws Exception | [
"Default",
"handling",
"of",
"GET",
"request",
".",
"Must",
"be",
"called",
"explicitly",
"in",
"handleGet",
"function",
"."
] | 6d58e14cba26c0624d38f75273cff86fd4678289 | https://github.com/egeriis/laravel-jsonapi/blob/6d58e14cba26c0624d38f75273cff86fd4678289/src/EchoIt/JsonApi/Handler.php#L495-L528 |
226,635 | egeriis/laravel-jsonapi | src/EchoIt/JsonApi/Handler.php | Handler.validateModelData | protected function validateModelData(Model $model, Array $values)
{
$validationResponse = $model->validateArray($values);
if ($validationResponse === true) {
return true;
}
throw new Exception\Validation(
'Bad Request',
static::ERROR_SCOPE | stat... | php | protected function validateModelData(Model $model, Array $values)
{
$validationResponse = $model->validateArray($values);
if ($validationResponse === true) {
return true;
}
throw new Exception\Validation(
'Bad Request',
static::ERROR_SCOPE | stat... | [
"protected",
"function",
"validateModelData",
"(",
"Model",
"$",
"model",
",",
"Array",
"$",
"values",
")",
"{",
"$",
"validationResponse",
"=",
"$",
"model",
"->",
"validateArray",
"(",
"$",
"values",
")",
";",
"if",
"(",
"$",
"validationResponse",
"===",
... | Validates passed data against a model
Validation performed safely and only if model provides rules
@param \EchoIt\JsonApi\Model $model model to validate against
@param Array $values passed array of values
@throws Exception\Validation Exception thrown when validation fails
@return Bool ... | [
"Validates",
"passed",
"data",
"against",
"a",
"model",
"Validation",
"performed",
"safely",
"and",
"only",
"if",
"model",
"provides",
"rules"
] | 6d58e14cba26c0624d38f75273cff86fd4678289 | https://github.com/egeriis/laravel-jsonapi/blob/6d58e14cba26c0624d38f75273cff86fd4678289/src/EchoIt/JsonApi/Handler.php#L541-L555 |
226,636 | egeriis/laravel-jsonapi | src/EchoIt/JsonApi/Handler.php | Handler.handlePostDefault | public function handlePostDefault(Request $request, $model)
{
$values = $this->parseRequestContent($request->content, $model->getResourceType());
$this->validateModelData($model, $values);
$model->fill($values);
if (!$model->save()) {
throw new Exception(
... | php | public function handlePostDefault(Request $request, $model)
{
$values = $this->parseRequestContent($request->content, $model->getResourceType());
$this->validateModelData($model, $values);
$model->fill($values);
if (!$model->save()) {
throw new Exception(
... | [
"public",
"function",
"handlePostDefault",
"(",
"Request",
"$",
"request",
",",
"$",
"model",
")",
"{",
"$",
"values",
"=",
"$",
"this",
"->",
"parseRequestContent",
"(",
"$",
"request",
"->",
"content",
",",
"$",
"model",
"->",
"getResourceType",
"(",
")"... | Default handling of POST request.
Must be called explicitly in handlePost function.
@param \EchoIt\JsonApi\Request $request
@param \EchoIt\JsonApi\Model $model
@return \EchoIt\JsonApi\Model
@throws Exception | [
"Default",
"handling",
"of",
"POST",
"request",
".",
"Must",
"be",
"called",
"explicitly",
"in",
"handlePost",
"function",
"."
] | 6d58e14cba26c0624d38f75273cff86fd4678289 | https://github.com/egeriis/laravel-jsonapi/blob/6d58e14cba26c0624d38f75273cff86fd4678289/src/EchoIt/JsonApi/Handler.php#L566-L582 |
226,637 | egeriis/laravel-jsonapi | src/EchoIt/JsonApi/Handler.php | Handler.handlePutDefault | public function handlePutDefault(Request $request, $model)
{
if (empty($request->id)) {
throw new Exception(
'No ID provided',
static::ERROR_SCOPE | static::ERROR_NO_ID,
BaseResponse::HTTP_BAD_REQUEST
);
}
$updates = $t... | php | public function handlePutDefault(Request $request, $model)
{
if (empty($request->id)) {
throw new Exception(
'No ID provided',
static::ERROR_SCOPE | static::ERROR_NO_ID,
BaseResponse::HTTP_BAD_REQUEST
);
}
$updates = $t... | [
"public",
"function",
"handlePutDefault",
"(",
"Request",
"$",
"request",
",",
"$",
"model",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"request",
"->",
"id",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'No ID provided'",
",",
"static",
"::",
"ERROR_S... | Default handling of PUT request.
Must be called explicitly in handlePut function.
@param \EchoIt\JsonApi\Request $request
@param \EchoIt\JsonApi\Model $model
@return \EchoIt\JsonApi\Model
@throws Exception | [
"Default",
"handling",
"of",
"PUT",
"request",
".",
"Must",
"be",
"called",
"explicitly",
"in",
"handlePut",
"function",
"."
] | 6d58e14cba26c0624d38f75273cff86fd4678289 | https://github.com/egeriis/laravel-jsonapi/blob/6d58e14cba26c0624d38f75273cff86fd4678289/src/EchoIt/JsonApi/Handler.php#L593-L638 |
226,638 | egeriis/laravel-jsonapi | src/EchoIt/JsonApi/Handler.php | Handler.handleDeleteDefault | public function handleDeleteDefault(Request $request, $model)
{
if (empty($request->id)) {
throw new Exception(
'No ID provided',
static::ERROR_SCOPE | static::ERROR_NO_ID,
BaseResponse::HTTP_BAD_REQUEST
);
}
$model = $... | php | public function handleDeleteDefault(Request $request, $model)
{
if (empty($request->id)) {
throw new Exception(
'No ID provided',
static::ERROR_SCOPE | static::ERROR_NO_ID,
BaseResponse::HTTP_BAD_REQUEST
);
}
$model = $... | [
"public",
"function",
"handleDeleteDefault",
"(",
"Request",
"$",
"request",
",",
"$",
"model",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"request",
"->",
"id",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'No ID provided'",
",",
"static",
"::",
"ERRO... | Default handling of DELETE request.
Must be called explicitly in handleDelete function.
@param \EchoIt\JsonApi\Request $request
@param \EchoIt\JsonApi\Model $model
@return \EchoIt\JsonApi\Model
@throws Exception | [
"Default",
"handling",
"of",
"DELETE",
"request",
".",
"Must",
"be",
"called",
"explicitly",
"in",
"handleDelete",
"function",
"."
] | 6d58e14cba26c0624d38f75273cff86fd4678289 | https://github.com/egeriis/laravel-jsonapi/blob/6d58e14cba26c0624d38f75273cff86fd4678289/src/EchoIt/JsonApi/Handler.php#L649-L667 |
226,639 | kevinkhill/FontAwesomePHP | src/FontAwesomeStack.php | FontAwesomeStack.on | public function on($icon, array $classes = array(), $style='fas')
{
if (is_string($icon) === false) {
throw new \InvalidArgumentException(
'Icon label must be a string.'
);
}
if (is_string($style) === false) {
throw new \InvalidArgumentExce... | php | public function on($icon, array $classes = array(), $style='fas')
{
if (is_string($icon) === false) {
throw new \InvalidArgumentException(
'Icon label must be a string.'
);
}
if (is_string($style) === false) {
throw new \InvalidArgumentExce... | [
"public",
"function",
"on",
"(",
"$",
"icon",
",",
"array",
"$",
"classes",
"=",
"array",
"(",
")",
",",
"$",
"style",
"=",
"'fas'",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"icon",
")",
"===",
"false",
")",
"{",
"throw",
"new",
"\\",
"Invalid... | Finishes the stack after created by the main FontAwesome class stack method
creates the stack object.
@param string $icon
@param string $style
@param array $classes
@return self | [
"Finishes",
"the",
"stack",
"after",
"created",
"by",
"the",
"main",
"FontAwesome",
"class",
"stack",
"method",
"creates",
"the",
"stack",
"object",
"."
] | e7d12d7422b23a5c3a09715d9ca3e24ff811c073 | https://github.com/kevinkhill/FontAwesomePHP/blob/e7d12d7422b23a5c3a09715d9ca3e24ff811c073/src/FontAwesomeStack.php#L88-L117 |
226,640 | varspool/sphpdox | lib/Sphpdox/CommentParser.php | CommentParser.parse | protected function parse()
{
$content = $this->comment;
// Rewrite newlines
$content = preg_replace('/\r\n/', "\n", $content);
// Rewrite tabs
$content = preg_replace('/\t/', ' ', $content);
// Remove initial whitespace
$content = preg_replace('/^\s*/m',... | php | protected function parse()
{
$content = $this->comment;
// Rewrite newlines
$content = preg_replace('/\r\n/', "\n", $content);
// Rewrite tabs
$content = preg_replace('/\t/', ' ', $content);
// Remove initial whitespace
$content = preg_replace('/^\s*/m',... | [
"protected",
"function",
"parse",
"(",
")",
"{",
"$",
"content",
"=",
"$",
"this",
"->",
"comment",
";",
"// Rewrite newlines",
"$",
"content",
"=",
"preg_replace",
"(",
"'/\\r\\n/'",
",",
"\"\\n\"",
",",
"$",
"content",
")",
";",
"// Rewrite tabs",
"$",
"... | Parses the docblock | [
"Parses",
"the",
"docblock"
] | 7867503e1fc0acc47b4512fbd89bf742e03f79ba | https://github.com/varspool/sphpdox/blob/7867503e1fc0acc47b4512fbd89bf742e03f79ba/lib/Sphpdox/CommentParser.php#L35-L57 |
226,641 | varspool/sphpdox | lib/Sphpdox/CommentParser.php | CommentParser.getDescription | public function getDescription()
{
$description = $this->getShortDescription();
if ($this->hasLongDescription()) {
$description .= "\n\n" . $this->getLongDescription();
}
return $description;
} | php | public function getDescription()
{
$description = $this->getShortDescription();
if ($this->hasLongDescription()) {
$description .= "\n\n" . $this->getLongDescription();
}
return $description;
} | [
"public",
"function",
"getDescription",
"(",
")",
"{",
"$",
"description",
"=",
"$",
"this",
"->",
"getShortDescription",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"hasLongDescription",
"(",
")",
")",
"{",
"$",
"description",
".=",
"\"\\n\\n\"",
".",
... | Gets the short and long description in the comment
The full comment if you like. If this docblock were processed,
the former paragraph and this one would be returned.
@return string | [
"Gets",
"the",
"short",
"and",
"long",
"description",
"in",
"the",
"comment"
] | 7867503e1fc0acc47b4512fbd89bf742e03f79ba | https://github.com/varspool/sphpdox/blob/7867503e1fc0acc47b4512fbd89bf742e03f79ba/lib/Sphpdox/CommentParser.php#L168-L175 |
226,642 | loco/swizzle | src/SwaggerClient.php | SwaggerClient.factory | public static function factory(array $config = [])
{
// Swagger docs URI is required
$required = ['base_uri'];
if ($missing = array_diff($required, array_keys($config))) {
throw new \InvalidArgumentException('Config is missing the following keys: '.implode(', ', $missing));
... | php | public static function factory(array $config = [])
{
// Swagger docs URI is required
$required = ['base_uri'];
if ($missing = array_diff($required, array_keys($config))) {
throw new \InvalidArgumentException('Config is missing the following keys: '.implode(', ', $missing));
... | [
"public",
"static",
"function",
"factory",
"(",
"array",
"$",
"config",
"=",
"[",
"]",
")",
"{",
"// Swagger docs URI is required",
"$",
"required",
"=",
"[",
"'base_uri'",
"]",
";",
"if",
"(",
"$",
"missing",
"=",
"array_diff",
"(",
"$",
"required",
",",
... | Factory method to create a new Swagger Docs client.
@param array $config Configuration data
@return SwaggerClient
@throws \InvalidArgumentException | [
"Factory",
"method",
"to",
"create",
"a",
"new",
"Swagger",
"Docs",
"client",
"."
] | 539db44bc2341f3da403582052b770686c86a516 | https://github.com/loco/swizzle/blob/539db44bc2341f3da403582052b770686c86a516/src/SwaggerClient.php#L28-L58 |
226,643 | oleglfed/laravel-ddd | src/LaravelDddServiceProvider.php | LaravelDddServiceProvider.register | public function register()
{
$this->config = $this->app->make('config');
$this->packages = $this->config->get('domains.user-binding');
$files = \File::allFiles(config_path('domains'));
foreach ($files as $file) {
if ($bindings = $this->config->get('domains.'.basename($f... | php | public function register()
{
$this->config = $this->app->make('config');
$this->packages = $this->config->get('domains.user-binding');
$files = \File::allFiles(config_path('domains'));
foreach ($files as $file) {
if ($bindings = $this->config->get('domains.'.basename($f... | [
"public",
"function",
"register",
"(",
")",
"{",
"$",
"this",
"->",
"config",
"=",
"$",
"this",
"->",
"app",
"->",
"make",
"(",
"'config'",
")",
";",
"$",
"this",
"->",
"packages",
"=",
"$",
"this",
"->",
"config",
"->",
"get",
"(",
"'domains.user-bi... | Register the API doc commands.
@return void | [
"Register",
"the",
"API",
"doc",
"commands",
"."
] | 4e60759d29086fe041b2c158c8ae3a79eeeb70f7 | https://github.com/oleglfed/laravel-ddd/blob/4e60759d29086fe041b2c158c8ae3a79eeeb70f7/src/LaravelDddServiceProvider.php#L24-L52 |
226,644 | oleglfed/laravel-ddd | src/LaravelDddServiceProvider.php | LaravelDddServiceProvider.provideRepositories | private function provideRepositories(array $repositories)
{
foreach ($repositories as $name => $provider) {
$this->app->bind($name, $provider);
}
} | php | private function provideRepositories(array $repositories)
{
foreach ($repositories as $name => $provider) {
$this->app->bind($name, $provider);
}
} | [
"private",
"function",
"provideRepositories",
"(",
"array",
"$",
"repositories",
")",
"{",
"foreach",
"(",
"$",
"repositories",
"as",
"$",
"name",
"=>",
"$",
"provider",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"bind",
"(",
"$",
"name",
",",
"$",
"pro... | Provide repositories from packages.
@param array $repositories
@return void | [
"Provide",
"repositories",
"from",
"packages",
"."
] | 4e60759d29086fe041b2c158c8ae3a79eeeb70f7 | https://github.com/oleglfed/laravel-ddd/blob/4e60759d29086fe041b2c158c8ae3a79eeeb70f7/src/LaravelDddServiceProvider.php#L85-L90 |
226,645 | phergie/phergie-irc-bot-react | src/PluginProcessor/EventEmitterInjector.php | EventEmitterInjector.process | public function process(PluginInterface $plugin, Bot $bot)
{
if ($plugin instanceof EventEmitterAwareInterface) {
$plugin->setEventEmitter($bot->getClient());
}
} | php | public function process(PluginInterface $plugin, Bot $bot)
{
if ($plugin instanceof EventEmitterAwareInterface) {
$plugin->setEventEmitter($bot->getClient());
}
} | [
"public",
"function",
"process",
"(",
"PluginInterface",
"$",
"plugin",
",",
"Bot",
"$",
"bot",
")",
"{",
"if",
"(",
"$",
"plugin",
"instanceof",
"EventEmitterAwareInterface",
")",
"{",
"$",
"plugin",
"->",
"setEventEmitter",
"(",
"$",
"bot",
"->",
"getClien... | Injects the bot's event emitter into the plugin if it implements
\Phergie\Irc\Bot\React\EventEmitterAwareInterface.
@param \Phergie\Irc\Bot\React\PluginInterface $plugin Loaded plugin
@param \Phergie\Irc\Bot\React\Bot $bot Bot that loaded the plugin | [
"Injects",
"the",
"bot",
"s",
"event",
"emitter",
"into",
"the",
"plugin",
"if",
"it",
"implements",
"\\",
"Phergie",
"\\",
"Irc",
"\\",
"Bot",
"\\",
"React",
"\\",
"EventEmitterAwareInterface",
"."
] | 17745ef6b846513258af3dbd86e5612d3deb19b7 | https://github.com/phergie/phergie-irc-bot-react/blob/17745ef6b846513258af3dbd86e5612d3deb19b7/src/PluginProcessor/EventEmitterInjector.php#L33-L38 |
226,646 | oleglfed/laravel-ddd | src/Traits/GeneratorTrait.php | GeneratorTrait.getAppNamespace | protected function getAppNamespace()
{
$composer = json_decode(file_get_contents(base_path().'/composer.json'), true);
foreach ((array) data_get($composer, 'autoload.psr-4') as $namespace => $path) {
foreach ((array) $path as $pathChoice) {
if (realpath(app_path()) == re... | php | protected function getAppNamespace()
{
$composer = json_decode(file_get_contents(base_path().'/composer.json'), true);
foreach ((array) data_get($composer, 'autoload.psr-4') as $namespace => $path) {
foreach ((array) $path as $pathChoice) {
if (realpath(app_path()) == re... | [
"protected",
"function",
"getAppNamespace",
"(",
")",
"{",
"$",
"composer",
"=",
"json_decode",
"(",
"file_get_contents",
"(",
"base_path",
"(",
")",
".",
"'/composer.json'",
")",
",",
"true",
")",
";",
"foreach",
"(",
"(",
"array",
")",
"data_get",
"(",
"... | Returns App namespace.
@return int|string | [
"Returns",
"App",
"namespace",
"."
] | 4e60759d29086fe041b2c158c8ae3a79eeeb70f7 | https://github.com/oleglfed/laravel-ddd/blob/4e60759d29086fe041b2c158c8ae3a79eeeb70f7/src/Traits/GeneratorTrait.php#L298-L311 |
226,647 | phergie/phergie-irc-bot-react | src/AbstractPlugin.php | AbstractPlugin.escapeParam | public function escapeParam($string)
{
foreach ([ "\r\n", "\r", "\n" ] as $badBytes) {
if (false !== strpos($string, $badBytes)) {
$string = str_replace($badBytes, " ", $string);
}
}
if (false !== strpos($string, "\0")) {
$string = str_rep... | php | public function escapeParam($string)
{
foreach ([ "\r\n", "\r", "\n" ] as $badBytes) {
if (false !== strpos($string, $badBytes)) {
$string = str_replace($badBytes, " ", $string);
}
}
if (false !== strpos($string, "\0")) {
$string = str_rep... | [
"public",
"function",
"escapeParam",
"(",
"$",
"string",
")",
"{",
"foreach",
"(",
"[",
"\"\\r\\n\"",
",",
"\"\\r\"",
",",
"\"\\n\"",
"]",
"as",
"$",
"badBytes",
")",
"{",
"if",
"(",
"false",
"!==",
"strpos",
"(",
"$",
"string",
",",
"$",
"badBytes",
... | Replaces bytes in a string that might cause it to be truncated or
otherwise misinterpreted by the server.
@param string $string
@return string | [
"Replaces",
"bytes",
"in",
"a",
"string",
"that",
"might",
"cause",
"it",
"to",
"be",
"truncated",
"or",
"otherwise",
"misinterpreted",
"by",
"the",
"server",
"."
] | 17745ef6b846513258af3dbd86e5612d3deb19b7 | https://github.com/phergie/phergie-irc-bot-react/blob/17745ef6b846513258af3dbd86e5612d3deb19b7/src/AbstractPlugin.php#L178-L191 |
226,648 | varspool/sphpdox | lib/Sphpdox/Element/MethodElement.php | MethodElement.getParameterInfo | protected function getParameterInfo()
{
$params = array();
$parameters = $this->reflection->getParameters();
foreach ($parameters as $parameter) {
$params[$parameter->getName()] = array(
'name' => $parameter->getName(),
'hint_type' => $parame... | php | protected function getParameterInfo()
{
$params = array();
$parameters = $this->reflection->getParameters();
foreach ($parameters as $parameter) {
$params[$parameter->getName()] = array(
'name' => $parameter->getName(),
'hint_type' => $parame... | [
"protected",
"function",
"getParameterInfo",
"(",
")",
"{",
"$",
"params",
"=",
"array",
"(",
")",
";",
"$",
"parameters",
"=",
"$",
"this",
"->",
"reflection",
"->",
"getParameters",
"(",
")",
";",
"foreach",
"(",
"$",
"parameters",
"as",
"$",
"paramete... | Gets an array of simplified information about the parameters of this
method
@return array | [
"Gets",
"an",
"array",
"of",
"simplified",
"information",
"about",
"the",
"parameters",
"of",
"this",
"method"
] | 7867503e1fc0acc47b4512fbd89bf742e03f79ba | https://github.com/varspool/sphpdox/blob/7867503e1fc0acc47b4512fbd89bf742e03f79ba/lib/Sphpdox/Element/MethodElement.php#L29-L77 |
226,649 | varspool/sphpdox | lib/Sphpdox/Element/MethodElement.php | MethodElement.getParameters | protected function getParameters()
{
$strings = array();
foreach ($this->getParameterInfo() as $name => $parameter) {
if ($parameter['type']) {
$strings[] = ':type $' . $name . ': ' . $parameter['type'];
}
$string = ':param $' . $name . ':';
... | php | protected function getParameters()
{
$strings = array();
foreach ($this->getParameterInfo() as $name => $parameter) {
if ($parameter['type']) {
$strings[] = ':type $' . $name . ': ' . $parameter['type'];
}
$string = ':param $' . $name . ':';
... | [
"protected",
"function",
"getParameters",
"(",
")",
"{",
"$",
"strings",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getParameterInfo",
"(",
")",
"as",
"$",
"name",
"=>",
"$",
"parameter",
")",
"{",
"if",
"(",
"$",
"parameter",
"... | Gets an array of parameter information, in ReST format
@return array | [
"Gets",
"an",
"array",
"of",
"parameter",
"information",
"in",
"ReST",
"format"
] | 7867503e1fc0acc47b4512fbd89bf742e03f79ba | https://github.com/varspool/sphpdox/blob/7867503e1fc0acc47b4512fbd89bf742e03f79ba/lib/Sphpdox/Element/MethodElement.php#L115-L134 |
226,650 | varspool/sphpdox | lib/Sphpdox/Element/MethodElement.php | MethodElement.getReturnValue | protected function getReturnValue()
{
$annotations = array_filter($this->getParser()->getAnnotations(), function ($v) {
$e = explode(' ', $v);
return isset($e[0]) && $e[0] == '@return';
});
foreach ($annotations as $parameter) {
$parts = explode(' ', $para... | php | protected function getReturnValue()
{
$annotations = array_filter($this->getParser()->getAnnotations(), function ($v) {
$e = explode(' ', $v);
return isset($e[0]) && $e[0] == '@return';
});
foreach ($annotations as $parameter) {
$parts = explode(' ', $para... | [
"protected",
"function",
"getReturnValue",
"(",
")",
"{",
"$",
"annotations",
"=",
"array_filter",
"(",
"$",
"this",
"->",
"getParser",
"(",
")",
"->",
"getAnnotations",
"(",
")",
",",
"function",
"(",
"$",
"v",
")",
"{",
"$",
"e",
"=",
"explode",
"(",... | Gets the return value ReST notation
@return boolean|string | [
"Gets",
"the",
"return",
"value",
"ReST",
"notation"
] | 7867503e1fc0acc47b4512fbd89bf742e03f79ba | https://github.com/varspool/sphpdox/blob/7867503e1fc0acc47b4512fbd89bf742e03f79ba/lib/Sphpdox/Element/MethodElement.php#L141-L169 |
226,651 | gigaai/framework | src/Storage/Eloquent/Node.php | Node.findByTypeAndPattern | public static function findByTypeAndPattern($type = '', $pattern = '')
{
$where = '1 = 1';
$where_type = '';
$where_like = '';
$where_rlike = '';
$placeholder = [];
// Check type, pattern is email or phone number when passing from quick replies
if ($... | php | public static function findByTypeAndPattern($type = '', $pattern = '')
{
$where = '1 = 1';
$where_type = '';
$where_like = '';
$where_rlike = '';
$placeholder = [];
// Check type, pattern is email or phone number when passing from quick replies
if ($... | [
"public",
"static",
"function",
"findByTypeAndPattern",
"(",
"$",
"type",
"=",
"''",
",",
"$",
"pattern",
"=",
"''",
")",
"{",
"$",
"where",
"=",
"'1 = 1'",
";",
"$",
"where_type",
"=",
"''",
";",
"$",
"where_like",
"=",
"''",
";",
"$",
"where_rlike",
... | Get node by node type and pattern
@param $type
@param $pattern
@return Node[] | [
"Get",
"node",
"by",
"node",
"type",
"and",
"pattern"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Storage/Eloquent/Node.php#L42-L97 |
226,652 | gigaai/framework | src/Storage/Eloquent/Node.php | Node.setAnswersAttribute | public function setAnswersAttribute($value)
{
if (is_array($value)) {
$value = giga_array_filter($value);
$this->attributes['answers'] = json_encode($value, JSON_UNESCAPED_UNICODE);
} else {
$this->attributes['answers'] = $value;
}
... | php | public function setAnswersAttribute($value)
{
if (is_array($value)) {
$value = giga_array_filter($value);
$this->attributes['answers'] = json_encode($value, JSON_UNESCAPED_UNICODE);
} else {
$this->attributes['answers'] = $value;
}
... | [
"public",
"function",
"setAnswersAttribute",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"$",
"value",
"=",
"giga_array_filter",
"(",
"$",
"value",
")",
";",
"$",
"this",
"->",
"attributes",
"[",
"'answers'",
"... | Auto json encode the answers attribute
@param $value | [
"Auto",
"json",
"encode",
"the",
"answers",
"attribute"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Storage/Eloquent/Node.php#L163-L171 |
226,653 | netgen/NetgenEzFormsBundle | bundle/Form/FieldTypeHandler.php | FieldTypeHandler.skipEmptyUpdate | protected function skipEmptyUpdate(FormBuilderInterface $formBuilder, $fieldDefinitionIdentifier)
{
$options = array(
'mapped' => false,
'data' => 'yes',
);
$formBuilder->add(
"ezforms_skip_empty_update_{$fieldDefinitionIdentifier}",
HiddenTyp... | php | protected function skipEmptyUpdate(FormBuilderInterface $formBuilder, $fieldDefinitionIdentifier)
{
$options = array(
'mapped' => false,
'data' => 'yes',
);
$formBuilder->add(
"ezforms_skip_empty_update_{$fieldDefinitionIdentifier}",
HiddenTyp... | [
"protected",
"function",
"skipEmptyUpdate",
"(",
"FormBuilderInterface",
"$",
"formBuilder",
",",
"$",
"fieldDefinitionIdentifier",
")",
"{",
"$",
"options",
"=",
"array",
"(",
"'mapped'",
"=>",
"false",
",",
"'data'",
"=>",
"'yes'",
",",
")",
";",
"$",
"formB... | Adds a hidden field to the from, indicating that empty value passed
for update should be ignored.
@param \Symfony\Component\Form\FormBuilderInterface $formBuilder
@param string $fieldDefinitionIdentifier | [
"Adds",
"a",
"hidden",
"field",
"to",
"the",
"from",
"indicating",
"that",
"empty",
"value",
"passed",
"for",
"update",
"should",
"be",
"ignored",
"."
] | c4d2355e14a41353ac40eafc386f203b3d94ea9e | https://github.com/netgen/NetgenEzFormsBundle/blob/c4d2355e14a41353ac40eafc386f203b3d94ea9e/bundle/Form/FieldTypeHandler.php#L126-L138 |
226,654 | gigaai/framework | src/Core/AccountLinking.php | AccountLinking.process | public static function process($event)
{
// Link Lead with User
if ($event->account_linking->status === 'linked') {
$authorization_code = $event->account_linking->authorization_code;
$user_id = str_replace('user_id:', '', $authorization_code);
return ... | php | public static function process($event)
{
// Link Lead with User
if ($event->account_linking->status === 'linked') {
$authorization_code = $event->account_linking->authorization_code;
$user_id = str_replace('user_id:', '', $authorization_code);
return ... | [
"public",
"static",
"function",
"process",
"(",
"$",
"event",
")",
"{",
"// Link Lead with User",
"if",
"(",
"$",
"event",
"->",
"account_linking",
"->",
"status",
"===",
"'linked'",
")",
"{",
"$",
"authorization_code",
"=",
"$",
"event",
"->",
"account_linkin... | Process the account linking
@param Array $event
@return bool | [
"Process",
"the",
"account",
"linking"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Core/AccountLinking.php#L15-L26 |
226,655 | gigaai/framework | src/Drivers/Driver.php | Driver.detect | public function detect($request)
{
// Facebook driver by default
$this->driver = new Facebook;
// Loop through all available drivers
foreach ($this->drivers as $driver_class) {
// If driver format matches understand the request, then create new instance
if ((... | php | public function detect($request)
{
// Facebook driver by default
$this->driver = new Facebook;
// Loop through all available drivers
foreach ($this->drivers as $driver_class) {
// If driver format matches understand the request, then create new instance
if ((... | [
"public",
"function",
"detect",
"(",
"$",
"request",
")",
"{",
"// Facebook driver by default",
"$",
"this",
"->",
"driver",
"=",
"new",
"Facebook",
";",
"// Loop through all available drivers",
"foreach",
"(",
"$",
"this",
"->",
"drivers",
"as",
"$",
"driver_clas... | Detect driver based on incoming request
@param Array $request
@return void | [
"Detect",
"driver",
"based",
"on",
"incoming",
"request"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Drivers/Driver.php#L36-L49 |
226,656 | gigaai/framework | src/Drivers/Driver.php | Driver.run | public function run(&$request)
{
$this->detect($request);
$request = $this->driver->formatIncomingRequest($request);
} | php | public function run(&$request)
{
$this->detect($request);
$request = $this->driver->formatIncomingRequest($request);
} | [
"public",
"function",
"run",
"(",
"&",
"$",
"request",
")",
"{",
"$",
"this",
"->",
"detect",
"(",
"$",
"request",
")",
";",
"$",
"request",
"=",
"$",
"this",
"->",
"driver",
"->",
"formatIncomingRequest",
"(",
"$",
"request",
")",
";",
"}"
] | Detect the driver and format the request to Facebook format
@param Mixed $request
@return void | [
"Detect",
"the",
"driver",
"and",
"format",
"the",
"request",
"to",
"Facebook",
"format"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Drivers/Driver.php#L62-L66 |
226,657 | egeriis/laravel-jsonapi | src/EchoIt/JsonApi/Model.php | Model.validateArray | public function validateArray(Array $values)
{
if (count($this->getValidationRules())) {
$validator = Validator::make($values, $this->getValidationRules());
if ($validator->fails()) {
return $validator->errors();
}
}
return True;
} | php | public function validateArray(Array $values)
{
if (count($this->getValidationRules())) {
$validator = Validator::make($values, $this->getValidationRules());
if ($validator->fails()) {
return $validator->errors();
}
}
return True;
} | [
"public",
"function",
"validateArray",
"(",
"Array",
"$",
"values",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"getValidationRules",
"(",
")",
")",
")",
"{",
"$",
"validator",
"=",
"Validator",
"::",
"make",
"(",
"$",
"values",
",",
"$",
"... | Validate passed values
@param Array $values user passed values (request data)
@return bool|\Illuminate\Support\MessageBag True on pass, MessageBag of errors on fail | [
"Validate",
"passed",
"values"
] | 6d58e14cba26c0624d38f75273cff86fd4678289 | https://github.com/egeriis/laravel-jsonapi/blob/6d58e14cba26c0624d38f75273cff86fd4678289/src/EchoIt/JsonApi/Model.php#L133-L144 |
226,658 | egeriis/laravel-jsonapi | src/EchoIt/JsonApi/Model.php | Model.toArray | public function toArray()
{
$relations = [];
$arrayableRelations = [];
// include any relations exposed by default
foreach ($this->exposedRelations as $relation) {
// skip loading a relation if it is from a method
if (in_array($relation, $this->relationsFromMe... | php | public function toArray()
{
$relations = [];
$arrayableRelations = [];
// include any relations exposed by default
foreach ($this->exposedRelations as $relation) {
// skip loading a relation if it is from a method
if (in_array($relation, $this->relationsFromMe... | [
"public",
"function",
"toArray",
"(",
")",
"{",
"$",
"relations",
"=",
"[",
"]",
";",
"$",
"arrayableRelations",
"=",
"[",
"]",
";",
"// include any relations exposed by default",
"foreach",
"(",
"$",
"this",
"->",
"exposedRelations",
"as",
"$",
"relation",
")... | Convert the model instance to an array. This method overrides that of
Eloquent to prevent relations to be serialize into output array.
@return array | [
"Convert",
"the",
"model",
"instance",
"to",
"an",
"array",
".",
"This",
"method",
"overrides",
"that",
"of",
"Eloquent",
"to",
"prevent",
"relations",
"to",
"be",
"serialize",
"into",
"output",
"array",
"."
] | 6d58e14cba26c0624d38f75273cff86fd4678289 | https://github.com/egeriis/laravel-jsonapi/blob/6d58e14cba26c0624d38f75273cff86fd4678289/src/EchoIt/JsonApi/Model.php#L163-L232 |
226,659 | LanKit/DatatablesBundle | Datatables/Datatable.php | Datatable.setRelatedEntityColumnInfo | protected function setRelatedEntityColumnInfo(array &$association, array $fields) {
$mdataName = implode('.', $fields);
$lastField = Container::camelize(array_pop($fields));
$joinName = $this->tableName;
$entityName = '';
$columnName = '';
// loop through the related ent... | php | protected function setRelatedEntityColumnInfo(array &$association, array $fields) {
$mdataName = implode('.', $fields);
$lastField = Container::camelize(array_pop($fields));
$joinName = $this->tableName;
$entityName = '';
$columnName = '';
// loop through the related ent... | [
"protected",
"function",
"setRelatedEntityColumnInfo",
"(",
"array",
"&",
"$",
"association",
",",
"array",
"$",
"fields",
")",
"{",
"$",
"mdataName",
"=",
"implode",
"(",
"'.'",
",",
"$",
"fields",
")",
";",
"$",
"lastField",
"=",
"Container",
"::",
"came... | Parse a dotted-notation column format from the mData, and sets association
information
@param array Association information for a column (by reference)
@param array The column fields from dotted notation | [
"Parse",
"a",
"dotted",
"-",
"notation",
"column",
"format",
"from",
"the",
"mData",
"and",
"sets",
"association",
"information"
] | f9cadfeeef4adb152c97e88d539e69ee32512d80 | https://github.com/LanKit/DatatablesBundle/blob/f9cadfeeef4adb152c97e88d539e69ee32512d80/Datatables/Datatable.php#L296-L347 |
226,660 | LanKit/DatatablesBundle | Datatables/Datatable.php | Datatable.setSingleFieldColumnInfo | protected function setSingleFieldColumnInfo(array &$association, $fieldName) {
$fieldName = Container::camelize($fieldName);
if (!$this->metadata->hasField(lcfirst($fieldName))) {
throw new Exception(
"Field '$fieldName' not found.)",
'404'
);
... | php | protected function setSingleFieldColumnInfo(array &$association, $fieldName) {
$fieldName = Container::camelize($fieldName);
if (!$this->metadata->hasField(lcfirst($fieldName))) {
throw new Exception(
"Field '$fieldName' not found.)",
'404'
);
... | [
"protected",
"function",
"setSingleFieldColumnInfo",
"(",
"array",
"&",
"$",
"association",
",",
"$",
"fieldName",
")",
"{",
"$",
"fieldName",
"=",
"Container",
"::",
"camelize",
"(",
"$",
"fieldName",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"metadata... | Configures association information for a single field request from the main entity
@param array The association information as a reference
@param string The field name on the main entity | [
"Configures",
"association",
"information",
"for",
"a",
"single",
"field",
"request",
"from",
"the",
"main",
"entity"
] | f9cadfeeef4adb152c97e88d539e69ee32512d80 | https://github.com/LanKit/DatatablesBundle/blob/f9cadfeeef4adb152c97e88d539e69ee32512d80/Datatables/Datatable.php#L355-L368 |
226,661 | LanKit/DatatablesBundle | Datatables/Datatable.php | Datatable.getJoinName | protected function getJoinName(ClassMetadata $metadata, $tableName, $entityName)
{
$joinName = $tableName;
// If it is self-referencing then we must avoid collisions
if ($metadata->getName() == $this->metadata->getName()) {
$joinName .= "_$entityName";
}
retu... | php | protected function getJoinName(ClassMetadata $metadata, $tableName, $entityName)
{
$joinName = $tableName;
// If it is self-referencing then we must avoid collisions
if ($metadata->getName() == $this->metadata->getName()) {
$joinName .= "_$entityName";
}
retu... | [
"protected",
"function",
"getJoinName",
"(",
"ClassMetadata",
"$",
"metadata",
",",
"$",
"tableName",
",",
"$",
"entityName",
")",
"{",
"$",
"joinName",
"=",
"$",
"tableName",
";",
"// If it is self-referencing then we must avoid collisions",
"if",
"(",
"$",
"metada... | Based on association information and metadata, construct the join name
@param ClassMetadata Doctrine metadata for an association
@param string The table name for the join
@param string The entity name of the table | [
"Based",
"on",
"association",
"information",
"and",
"metadata",
"construct",
"the",
"join",
"name"
] | f9cadfeeef4adb152c97e88d539e69ee32512d80 | https://github.com/LanKit/DatatablesBundle/blob/f9cadfeeef4adb152c97e88d539e69ee32512d80/Datatables/Datatable.php#L377-L387 |
226,662 | LanKit/DatatablesBundle | Datatables/Datatable.php | Datatable.setDefaultJoinType | public function setDefaultJoinType($joinType)
{
if (defined('self::JOIN_' . strtoupper($joinType))) {
$this->defaultJoinType = constant('self::JOIN_' . strtoupper($joinType));
}
return $this;
} | php | public function setDefaultJoinType($joinType)
{
if (defined('self::JOIN_' . strtoupper($joinType))) {
$this->defaultJoinType = constant('self::JOIN_' . strtoupper($joinType));
}
return $this;
} | [
"public",
"function",
"setDefaultJoinType",
"(",
"$",
"joinType",
")",
"{",
"if",
"(",
"defined",
"(",
"'self::JOIN_'",
".",
"strtoupper",
"(",
"$",
"joinType",
")",
")",
")",
"{",
"$",
"this",
"->",
"defaultJoinType",
"=",
"constant",
"(",
"'self::JOIN_'",
... | Set the default join type to use for associations. Defaults to JOIN_INNER
@param string The join type to use, should be of either constant: JOIN_INNER, JOIN_LEFT | [
"Set",
"the",
"default",
"join",
"type",
"to",
"use",
"for",
"associations",
".",
"Defaults",
"to",
"JOIN_INNER"
] | f9cadfeeef4adb152c97e88d539e69ee32512d80 | https://github.com/LanKit/DatatablesBundle/blob/f9cadfeeef4adb152c97e88d539e69ee32512d80/Datatables/Datatable.php#L405-L412 |
226,663 | LanKit/DatatablesBundle | Datatables/Datatable.php | Datatable.setLimit | public function setLimit(QueryBuilder $qb)
{
if (isset($this->offset) && $this->amount != '-1') {
$qb->setFirstResult($this->offset)->setMaxResults($this->amount);
}
} | php | public function setLimit(QueryBuilder $qb)
{
if (isset($this->offset) && $this->amount != '-1') {
$qb->setFirstResult($this->offset)->setMaxResults($this->amount);
}
} | [
"public",
"function",
"setLimit",
"(",
"QueryBuilder",
"$",
"qb",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"offset",
")",
"&&",
"$",
"this",
"->",
"amount",
"!=",
"'-1'",
")",
"{",
"$",
"qb",
"->",
"setFirstResult",
"(",
"$",
"this",
"... | Set the scope of the result set
@param QueryBuilder The Doctrine QueryBuilder object | [
"Set",
"the",
"scope",
"of",
"the",
"result",
"set"
] | f9cadfeeef4adb152c97e88d539e69ee32512d80 | https://github.com/LanKit/DatatablesBundle/blob/f9cadfeeef4adb152c97e88d539e69ee32512d80/Datatables/Datatable.php#L444-L449 |
226,664 | LanKit/DatatablesBundle | Datatables/Datatable.php | Datatable.setOrderBy | public function setOrderBy(QueryBuilder $qb)
{
if (isset($this->request['iSortCol_0'])) {
for ($i = 0; $i < intval($this->request['iSortingCols']); $i++) {
if ($this->request['bSortable_'.intval($this->request['iSortCol_'. $i])] == "true") {
$qb->addOrderBy(
... | php | public function setOrderBy(QueryBuilder $qb)
{
if (isset($this->request['iSortCol_0'])) {
for ($i = 0; $i < intval($this->request['iSortingCols']); $i++) {
if ($this->request['bSortable_'.intval($this->request['iSortCol_'. $i])] == "true") {
$qb->addOrderBy(
... | [
"public",
"function",
"setOrderBy",
"(",
"QueryBuilder",
"$",
"qb",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"request",
"[",
"'iSortCol_0'",
"]",
")",
")",
"{",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"intval",
"(",
"$",
... | Set any column ordering that has been requested
@param QueryBuilder The Doctrine QueryBuilder object | [
"Set",
"any",
"column",
"ordering",
"that",
"has",
"been",
"requested"
] | f9cadfeeef4adb152c97e88d539e69ee32512d80 | https://github.com/LanKit/DatatablesBundle/blob/f9cadfeeef4adb152c97e88d539e69ee32512d80/Datatables/Datatable.php#L456-L468 |
226,665 | LanKit/DatatablesBundle | Datatables/Datatable.php | Datatable.setWhere | public function setWhere(QueryBuilder $qb)
{
// Global filtering
if ($this->search != '') {
$orExpr = $qb->expr()->orX();
for ($i=0 ; $i < count($this->parameters); $i++) {
if (isset($this->request['bSearchable_'.$i]) && $this->request['bSearchable_'.$i] == "t... | php | public function setWhere(QueryBuilder $qb)
{
// Global filtering
if ($this->search != '') {
$orExpr = $qb->expr()->orX();
for ($i=0 ; $i < count($this->parameters); $i++) {
if (isset($this->request['bSearchable_'.$i]) && $this->request['bSearchable_'.$i] == "t... | [
"public",
"function",
"setWhere",
"(",
"QueryBuilder",
"$",
"qb",
")",
"{",
"// Global filtering",
"if",
"(",
"$",
"this",
"->",
"search",
"!=",
"''",
")",
"{",
"$",
"orExpr",
"=",
"$",
"qb",
"->",
"expr",
"(",
")",
"->",
"orX",
"(",
")",
";",
"for... | Configure the WHERE clause for the Doctrine QueryBuilder if any searches are specified
@param QueryBuilder The Doctrine QueryBuilder object | [
"Configure",
"the",
"WHERE",
"clause",
"for",
"the",
"Doctrine",
"QueryBuilder",
"if",
"any",
"searches",
"are",
"specified"
] | f9cadfeeef4adb152c97e88d539e69ee32512d80 | https://github.com/LanKit/DatatablesBundle/blob/f9cadfeeef4adb152c97e88d539e69ee32512d80/Datatables/Datatable.php#L475-L514 |
226,666 | LanKit/DatatablesBundle | Datatables/Datatable.php | Datatable.setAssociations | public function setAssociations(QueryBuilder $qb)
{
foreach ($this->assignedJoins as $joinName => $joinInfo) {
$joinType = isset($this->joinTypes[$joinInfo['mdataColumn']]) ?
$this->joinTypes[$joinInfo['mdataColumn']] : $this->defaultJoinType;
call_user_func_array(ar... | php | public function setAssociations(QueryBuilder $qb)
{
foreach ($this->assignedJoins as $joinName => $joinInfo) {
$joinType = isset($this->joinTypes[$joinInfo['mdataColumn']]) ?
$this->joinTypes[$joinInfo['mdataColumn']] : $this->defaultJoinType;
call_user_func_array(ar... | [
"public",
"function",
"setAssociations",
"(",
"QueryBuilder",
"$",
"qb",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"assignedJoins",
"as",
"$",
"joinName",
"=>",
"$",
"joinInfo",
")",
"{",
"$",
"joinType",
"=",
"isset",
"(",
"$",
"this",
"->",
"joinTyp... | Configure joins for entity associations
@param QueryBuilder The Doctrine QueryBuilder object | [
"Configure",
"joins",
"for",
"entity",
"associations"
] | f9cadfeeef4adb152c97e88d539e69ee32512d80 | https://github.com/LanKit/DatatablesBundle/blob/f9cadfeeef4adb152c97e88d539e69ee32512d80/Datatables/Datatable.php#L521-L531 |
226,667 | LanKit/DatatablesBundle | Datatables/Datatable.php | Datatable.setSelect | public function setSelect(QueryBuilder $qb)
{
$columns = array();
$partials = array();
// Make sure all related joins are added as needed columns. A column many entities deep may rely on a
// column not specifically requested in the mData
foreach (array_keys($this->assignedJ... | php | public function setSelect(QueryBuilder $qb)
{
$columns = array();
$partials = array();
// Make sure all related joins are added as needed columns. A column many entities deep may rely on a
// column not specifically requested in the mData
foreach (array_keys($this->assignedJ... | [
"public",
"function",
"setSelect",
"(",
"QueryBuilder",
"$",
"qb",
")",
"{",
"$",
"columns",
"=",
"array",
"(",
")",
";",
"$",
"partials",
"=",
"array",
"(",
")",
";",
"// Make sure all related joins are added as needed columns. A column many entities deep may rely on a... | Configure the specific columns to select for the query
@param QueryBuilder The Doctrine QueryBuilder object | [
"Configure",
"the",
"specific",
"columns",
"to",
"select",
"for",
"the",
"query"
] | f9cadfeeef4adb152c97e88d539e69ee32512d80 | https://github.com/LanKit/DatatablesBundle/blob/f9cadfeeef4adb152c97e88d539e69ee32512d80/Datatables/Datatable.php#L538-L573 |
226,668 | LanKit/DatatablesBundle | Datatables/Datatable.php | Datatable.executeSearch | public function executeSearch()
{
$output = array("aaData" => array());
$query = $this->qb->getQuery()->setHydrationMode(Query::HYDRATE_ARRAY);
$items = $this->useDoctrinePaginator ?
new Paginator($query, $this->doesQueryContainCollections()) : $query->execute();
foreac... | php | public function executeSearch()
{
$output = array("aaData" => array());
$query = $this->qb->getQuery()->setHydrationMode(Query::HYDRATE_ARRAY);
$items = $this->useDoctrinePaginator ?
new Paginator($query, $this->doesQueryContainCollections()) : $query->execute();
foreac... | [
"public",
"function",
"executeSearch",
"(",
")",
"{",
"$",
"output",
"=",
"array",
"(",
"\"aaData\"",
"=>",
"array",
"(",
")",
")",
";",
"$",
"query",
"=",
"$",
"this",
"->",
"qb",
"->",
"getQuery",
"(",
")",
"->",
"setHydrationMode",
"(",
"Query",
"... | Execute the QueryBuilder object, parse and save the results | [
"Execute",
"the",
"QueryBuilder",
"object",
"parse",
"and",
"save",
"the",
"results"
] | f9cadfeeef4adb152c97e88d539e69ee32512d80 | https://github.com/LanKit/DatatablesBundle/blob/f9cadfeeef4adb152c97e88d539e69ee32512d80/Datatables/Datatable.php#L604-L654 |
226,669 | LanKit/DatatablesBundle | Datatables/Datatable.php | Datatable.setDefaultResultType | public function setDefaultResultType($resultType)
{
if (defined('self::RESULT_' . strtoupper($resultType))) {
$this->defaultResultType = constant('self::RESULT_' . strtoupper($resultType));
}
return $this;
} | php | public function setDefaultResultType($resultType)
{
if (defined('self::RESULT_' . strtoupper($resultType))) {
$this->defaultResultType = constant('self::RESULT_' . strtoupper($resultType));
}
return $this;
} | [
"public",
"function",
"setDefaultResultType",
"(",
"$",
"resultType",
")",
"{",
"if",
"(",
"defined",
"(",
"'self::RESULT_'",
".",
"strtoupper",
"(",
"$",
"resultType",
")",
")",
")",
"{",
"$",
"this",
"->",
"defaultResultType",
"=",
"constant",
"(",
"'self:... | Set the default result type to use when calling getSearchResults
@param string The result type to use, should be one of: RESULT_JSON, RESULT_ARRAY, RESULT_RESPONSE | [
"Set",
"the",
"default",
"result",
"type",
"to",
"use",
"when",
"calling",
"getSearchResults"
] | f9cadfeeef4adb152c97e88d539e69ee32512d80 | https://github.com/LanKit/DatatablesBundle/blob/f9cadfeeef4adb152c97e88d539e69ee32512d80/Datatables/Datatable.php#L674-L681 |
226,670 | LanKit/DatatablesBundle | Datatables/Datatable.php | Datatable.getSearchResults | public function getSearchResults($resultType = '')
{
if (empty($resultType) || !defined('self::RESULT_' . strtoupper($resultType))) {
$resultType = $this->defaultResultType;
}
else {
$resultType = constant('self::RESULT_' . strtoupper($resultType));
}
... | php | public function getSearchResults($resultType = '')
{
if (empty($resultType) || !defined('self::RESULT_' . strtoupper($resultType))) {
$resultType = $this->defaultResultType;
}
else {
$resultType = constant('self::RESULT_' . strtoupper($resultType));
}
... | [
"public",
"function",
"getSearchResults",
"(",
"$",
"resultType",
"=",
"''",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"resultType",
")",
"||",
"!",
"defined",
"(",
"'self::RESULT_'",
".",
"strtoupper",
"(",
"$",
"resultType",
")",
")",
")",
"{",
"$",
"r... | Creates and executes the DataTables search, returns data in the requested format
@param string The result type to use, should be one of: RESULT_JSON, RESULT_ARRAY, RESULT_RESPONSE
@return mixed The DataTables data in the requested/default format | [
"Creates",
"and",
"executes",
"the",
"DataTables",
"search",
"returns",
"data",
"in",
"the",
"requested",
"format"
] | f9cadfeeef4adb152c97e88d539e69ee32512d80 | https://github.com/LanKit/DatatablesBundle/blob/f9cadfeeef4adb152c97e88d539e69ee32512d80/Datatables/Datatable.php#L689-L704 |
226,671 | LanKit/DatatablesBundle | Datatables/DatatableManager.php | DatatableManager.getClassName | protected function getClassName($className) {
if (strpos($className, ':') !== false) {
list($namespaceAlias, $simpleClassName) = explode(':', $className);
$className = $this->doctrine->getManager()->getConfiguration()
->getEntityNamespace($namespaceAlias) . '\\' . $simpl... | php | protected function getClassName($className) {
if (strpos($className, ':') !== false) {
list($namespaceAlias, $simpleClassName) = explode(':', $className);
$className = $this->doctrine->getManager()->getConfiguration()
->getEntityNamespace($namespaceAlias) . '\\' . $simpl... | [
"protected",
"function",
"getClassName",
"(",
"$",
"className",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"className",
",",
"':'",
")",
"!==",
"false",
")",
"{",
"list",
"(",
"$",
"namespaceAlias",
",",
"$",
"simpleClassName",
")",
"=",
"explode",
"(",
... | Given an entity class name or possible alias, convert it to the full class name
@param string The entity class name or alias
@return string The entity class name | [
"Given",
"an",
"entity",
"class",
"name",
"or",
"possible",
"alias",
"convert",
"it",
"to",
"the",
"full",
"class",
"name"
] | f9cadfeeef4adb152c97e88d539e69ee32512d80 | https://github.com/LanKit/DatatablesBundle/blob/f9cadfeeef4adb152c97e88d539e69ee32512d80/Datatables/DatatableManager.php#L38-L45 |
226,672 | gigaai/framework | src/Storage/Storage.php | Storage.addNode | private function addNode($answers, $node_type, $ask = '', array $attributes = [])
{
$node = Node::where(['type' => $node_type, 'pattern' => $ask])->first();
if (is_null($node)) {
$node = Node::create(array_merge([
'type' => $node_type,
'pattern' => $ask,
... | php | private function addNode($answers, $node_type, $ask = '', array $attributes = [])
{
$node = Node::where(['type' => $node_type, 'pattern' => $ask])->first();
if (is_null($node)) {
$node = Node::create(array_merge([
'type' => $node_type,
'pattern' => $ask,
... | [
"private",
"function",
"addNode",
"(",
"$",
"answers",
",",
"$",
"node_type",
",",
"$",
"ask",
"=",
"''",
",",
"array",
"$",
"attributes",
"=",
"[",
"]",
")",
"{",
"$",
"node",
"=",
"Node",
"::",
"where",
"(",
"[",
"'type'",
"=>",
"$",
"node_type",... | Add Answer to the database
@param mixed $answers
@param string $node_type
@param string $ask
@param array $attributes
@return Node | [
"Add",
"Answer",
"to",
"the",
"database"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Storage/Storage.php#L156-L180 |
226,673 | johannesschobel/dingoquerymapper | src/JohannesSchobel/DingoQueryMapper/Parser/UriParser.php | UriParser.queryParameter | public function queryParameter($key)
{
$keys = array_pluck($this->queryParameters, 'key');
$queryParameters = array_combine($keys, $this->queryParameters);
return $queryParameters[$key];
} | php | public function queryParameter($key)
{
$keys = array_pluck($this->queryParameters, 'key');
$queryParameters = array_combine($keys, $this->queryParameters);
return $queryParameters[$key];
} | [
"public",
"function",
"queryParameter",
"(",
"$",
"key",
")",
"{",
"$",
"keys",
"=",
"array_pluck",
"(",
"$",
"this",
"->",
"queryParameters",
",",
"'key'",
")",
";",
"$",
"queryParameters",
"=",
"array_combine",
"(",
"$",
"keys",
",",
"$",
"this",
"->",... | Gets the respective parameter
@param $key
@return mixed | [
"Gets",
"the",
"respective",
"parameter"
] | 0ae2c1a0b5e7e7cf405ced9ced605907a5809c0e | https://github.com/johannesschobel/dingoquerymapper/blob/0ae2c1a0b5e7e7cf405ced9ced605907a5809c0e/src/JohannesSchobel/DingoQueryMapper/Parser/UriParser.php#L76-L82 |
226,674 | johannesschobel/dingoquerymapper | src/JohannesSchobel/DingoQueryMapper/Parser/UriParser.php | UriParser.whereParameters | public function whereParameters()
{
return array_filter(
$this->queryParameters,
function ($queryParameter) {
$key = $queryParameter['key'];
return (! in_array($key, $this->predefinedParams));
}
);
} | php | public function whereParameters()
{
return array_filter(
$this->queryParameters,
function ($queryParameter) {
$key = $queryParameter['key'];
return (! in_array($key, $this->predefinedParams));
}
);
} | [
"public",
"function",
"whereParameters",
"(",
")",
"{",
"return",
"array_filter",
"(",
"$",
"this",
"->",
"queryParameters",
",",
"function",
"(",
"$",
"queryParameter",
")",
"{",
"$",
"key",
"=",
"$",
"queryParameter",
"[",
"'key'",
"]",
";",
"return",
"(... | Gets the WHERE parameters
@return array | [
"Gets",
"the",
"WHERE",
"parameters"
] | 0ae2c1a0b5e7e7cf405ced9ced605907a5809c0e | https://github.com/johannesschobel/dingoquerymapper/blob/0ae2c1a0b5e7e7cf405ced9ced605907a5809c0e/src/JohannesSchobel/DingoQueryMapper/Parser/UriParser.php#L99-L108 |
226,675 | johannesschobel/dingoquerymapper | src/JohannesSchobel/DingoQueryMapper/Parser/UriParser.php | UriParser.setQueryParameters | private function setQueryParameters($query)
{
// escaping
$query = addslashes($query);
$queryParameters = array_filter(explode('&', $query));
array_map([$this, 'appendQueryParameter'], $queryParameters);
} | php | private function setQueryParameters($query)
{
// escaping
$query = addslashes($query);
$queryParameters = array_filter(explode('&', $query));
array_map([$this, 'appendQueryParameter'], $queryParameters);
} | [
"private",
"function",
"setQueryParameters",
"(",
"$",
"query",
")",
"{",
"// escaping",
"$",
"query",
"=",
"addslashes",
"(",
"$",
"query",
")",
";",
"$",
"queryParameters",
"=",
"array_filter",
"(",
"explode",
"(",
"'&'",
",",
"$",
"query",
")",
")",
"... | Sets the query parameters
@param $query | [
"Sets",
"the",
"query",
"parameters"
] | 0ae2c1a0b5e7e7cf405ced9ced605907a5809c0e | https://github.com/johannesschobel/dingoquerymapper/blob/0ae2c1a0b5e7e7cf405ced9ced605907a5809c0e/src/JohannesSchobel/DingoQueryMapper/Parser/UriParser.php#L115-L123 |
226,676 | johannesschobel/dingoquerymapper | src/JohannesSchobel/DingoQueryMapper/Parser/UriParser.php | UriParser.appendQueryParameter | private function appendQueryParameter($parameter)
{
preg_match($this->pattern, $parameter, $matches);
if (empty($matches)) {
return;
}
$operator = $matches[0];
list($key, $value) = explode($operator, $parameter);
if (strlen($value) == 0) {
... | php | private function appendQueryParameter($parameter)
{
preg_match($this->pattern, $parameter, $matches);
if (empty($matches)) {
return;
}
$operator = $matches[0];
list($key, $value) = explode($operator, $parameter);
if (strlen($value) == 0) {
... | [
"private",
"function",
"appendQueryParameter",
"(",
"$",
"parameter",
")",
"{",
"preg_match",
"(",
"$",
"this",
"->",
"pattern",
",",
"$",
"parameter",
",",
"$",
"matches",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"matches",
")",
")",
"{",
"return",
";"... | Appends one parameter to the builder
@param $parameter | [
"Appends",
"one",
"parameter",
"to",
"the",
"builder"
] | 0ae2c1a0b5e7e7cf405ced9ced605907a5809c0e | https://github.com/johannesschobel/dingoquerymapper/blob/0ae2c1a0b5e7e7cf405ced9ced605907a5809c0e/src/JohannesSchobel/DingoQueryMapper/Parser/UriParser.php#L130-L162 |
226,677 | phergie/phergie-irc-bot-react | src/EventQueueInternal.php | EventQueueInternal.compare | public function compare($priority1, $priority2)
{
if (!$priority1 instanceof EventQueuePriority || !$priority2 instanceof EventQueuePriority) {
return parent::compare($priority1, $priority2);
}
$priority = $priority1->value - $priority2->value;
if (!$priority) {
... | php | public function compare($priority1, $priority2)
{
if (!$priority1 instanceof EventQueuePriority || !$priority2 instanceof EventQueuePriority) {
return parent::compare($priority1, $priority2);
}
$priority = $priority1->value - $priority2->value;
if (!$priority) {
... | [
"public",
"function",
"compare",
"(",
"$",
"priority1",
",",
"$",
"priority2",
")",
"{",
"if",
"(",
"!",
"$",
"priority1",
"instanceof",
"EventQueuePriority",
"||",
"!",
"$",
"priority2",
"instanceof",
"EventQueuePriority",
")",
"{",
"return",
"parent",
"::",
... | Overrides native default comparison logic to assign higher priority to
events inserted earlier.
@param \Phergie\Irc\Bot\React\EventQueuePriority $priority1
@param \Phergie\Irc\Bot\React\EventQueuePriority $priority2
@return int | [
"Overrides",
"native",
"default",
"comparison",
"logic",
"to",
"assign",
"higher",
"priority",
"to",
"events",
"inserted",
"earlier",
"."
] | 17745ef6b846513258af3dbd86e5612d3deb19b7 | https://github.com/phergie/phergie-irc-bot-react/blob/17745ef6b846513258af3dbd86e5612d3deb19b7/src/EventQueueInternal.php#L28-L39 |
226,678 | gigaai/framework | src/Storage/Eloquent/Group.php | Group.hasPermission | public function hasPermission($permission)
{
return (is_array($this->permissions) &&
isset($this->permissions[$permission]) &&
$this->permissions[$permission] == true
) ||
(
isset($this->permissions['administrator']) &&
... | php | public function hasPermission($permission)
{
return (is_array($this->permissions) &&
isset($this->permissions[$permission]) &&
$this->permissions[$permission] == true
) ||
(
isset($this->permissions['administrator']) &&
... | [
"public",
"function",
"hasPermission",
"(",
"$",
"permission",
")",
"{",
"return",
"(",
"is_array",
"(",
"$",
"this",
"->",
"permissions",
")",
"&&",
"isset",
"(",
"$",
"this",
"->",
"permissions",
"[",
"$",
"permission",
"]",
")",
"&&",
"$",
"this",
"... | Check if group has specified permission
@param String $permission
@return bool | [
"Check",
"if",
"group",
"has",
"specified",
"permission"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Storage/Eloquent/Group.php#L31-L41 |
226,679 | gigaai/framework | src/Http/MessengerProfile.php | MessengerProfile.updateMessengerProfile | public static function updateMessengerProfile()
{
$update = [];
$delete = [];
$irregular = [
'get_started' => 'get_started_button_payload',
];
$resource = self::getResourceUrl();
foreach (self::$fields as $field_name) {
... | php | public static function updateMessengerProfile()
{
$update = [];
$delete = [];
$irregular = [
'get_started' => 'get_started_button_payload',
];
$resource = self::getResourceUrl();
foreach (self::$fields as $field_name) {
... | [
"public",
"static",
"function",
"updateMessengerProfile",
"(",
")",
"{",
"$",
"update",
"=",
"[",
"]",
";",
"$",
"delete",
"=",
"[",
"]",
";",
"$",
"irregular",
"=",
"[",
"'get_started'",
"=>",
"'get_started_button_payload'",
",",
"]",
";",
"$",
"resource"... | Update all fields
@return mixed | [
"Update",
"all",
"fields"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Http/MessengerProfile.php#L38-L83 |
226,680 | gigaai/framework | src/Http/MessengerProfile.php | MessengerProfile.updateField | public static function updateField($field_name)
{
$irregular = [
'get_started' => 'get_started_button_payload',
'greeting' => 'greeting_text'
];
if ( ! isset($irregular[$field_name])) {
$field_value = Instance::get($field_name);
} else ... | php | public static function updateField($field_name)
{
$irregular = [
'get_started' => 'get_started_button_payload',
'greeting' => 'greeting_text'
];
if ( ! isset($irregular[$field_name])) {
$field_value = Instance::get($field_name);
} else ... | [
"public",
"static",
"function",
"updateField",
"(",
"$",
"field_name",
")",
"{",
"$",
"irregular",
"=",
"[",
"'get_started'",
"=>",
"'get_started_button_payload'",
",",
"'greeting'",
"=>",
"'greeting_text'",
"]",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"irregu... | Update each fields separately
@param String $field_name
@return mixed | [
"Update",
"each",
"fields",
"separately"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Http/MessengerProfile.php#L114-L147 |
226,681 | snowplow-archive/symfony2-paypal-ipn | src/Orderly/PayPalIpnBundle/Ipn.php | Ipn._getCachedIPN | function _getCachedIPN()
{
$om = $this->objectManager;
if (!($cache = $om->getRepository($this->clsIpnLog)
->findOneBy(array('listenerName' => 'IPN', 'transactionType' => 'cache')))) {
return FALSE;
} else {
return unserialize($cache->getDetail());
... | php | function _getCachedIPN()
{
$om = $this->objectManager;
if (!($cache = $om->getRepository($this->clsIpnLog)
->findOneBy(array('listenerName' => 'IPN', 'transactionType' => 'cache')))) {
return FALSE;
} else {
return unserialize($cache->getDetail());
... | [
"function",
"_getCachedIPN",
"(",
")",
"{",
"$",
"om",
"=",
"$",
"this",
"->",
"objectManager",
";",
"if",
"(",
"!",
"(",
"$",
"cache",
"=",
"$",
"om",
"->",
"getRepository",
"(",
"$",
"this",
"->",
"clsIpnLog",
")",
"->",
"findOneBy",
"(",
"array",
... | Retrieve the cached IPN record if there is one, false if there isn't
@return array | [
"Retrieve",
"the",
"cached",
"IPN",
"record",
"if",
"there",
"is",
"one",
"false",
"if",
"there",
"isn",
"t"
] | e46d947cda5a11743ff1e215846e7d06ac939d42 | https://github.com/snowplow-archive/symfony2-paypal-ipn/blob/e46d947cda5a11743ff1e215846e7d06ac939d42/src/Orderly/PayPalIpnBundle/Ipn.php#L463-L473 |
226,682 | varspool/sphpdox | lib/Sphpdox/Element/NamespaceElement.php | NamespaceElement.ensureBuildDir | protected function ensureBuildDir($path, OutputInterface $output)
{
$parts = explode(DIRECTORY_SEPARATOR, $this->getPath());
foreach ($parts as $part) {
if (!$part) continue;
$path .= DIRECTORY_SEPARATOR . $part;
if (!file_exists($path)) {
$outp... | php | protected function ensureBuildDir($path, OutputInterface $output)
{
$parts = explode(DIRECTORY_SEPARATOR, $this->getPath());
foreach ($parts as $part) {
if (!$part) continue;
$path .= DIRECTORY_SEPARATOR . $part;
if (!file_exists($path)) {
$outp... | [
"protected",
"function",
"ensureBuildDir",
"(",
"$",
"path",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"parts",
"=",
"explode",
"(",
"DIRECTORY_SEPARATOR",
",",
"$",
"this",
"->",
"getPath",
"(",
")",
")",
";",
"foreach",
"(",
"$",
"parts",
"... | Ensures the build directory is in place
@param string $path
@param OutputInterface $output
@return string The directory | [
"Ensures",
"the",
"build",
"directory",
"is",
"in",
"place"
] | 7867503e1fc0acc47b4512fbd89bf742e03f79ba | https://github.com/varspool/sphpdox/blob/7867503e1fc0acc47b4512fbd89bf742e03f79ba/lib/Sphpdox/Element/NamespaceElement.php#L75-L91 |
226,683 | varspool/sphpdox | lib/Sphpdox/Element/NamespaceElement.php | NamespaceElement.buildClasses | public function buildClasses($basedir, OutputInterface $output)
{
$target = $this->ensureBuildDir($basedir, $output);
foreach ($this->getClasses() as $element) {
$element->build($target, $output);
}
} | php | public function buildClasses($basedir, OutputInterface $output)
{
$target = $this->ensureBuildDir($basedir, $output);
foreach ($this->getClasses() as $element) {
$element->build($target, $output);
}
} | [
"public",
"function",
"buildClasses",
"(",
"$",
"basedir",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"target",
"=",
"$",
"this",
"->",
"ensureBuildDir",
"(",
"$",
"basedir",
",",
"$",
"output",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"... | Builds the class information
@param unknown $basedir
@param OutputInterface $output | [
"Builds",
"the",
"class",
"information"
] | 7867503e1fc0acc47b4512fbd89bf742e03f79ba | https://github.com/varspool/sphpdox/blob/7867503e1fc0acc47b4512fbd89bf742e03f79ba/lib/Sphpdox/Element/NamespaceElement.php#L99-L106 |
226,684 | varspool/sphpdox | lib/Sphpdox/Element/NamespaceElement.php | NamespaceElement.buildIndex | public function buildIndex($basedir, OutputInterface $output, array $options = array())
{
$target = $this->ensureBuildDir($basedir, $output);
$built_iterator = new DirectoryIterator($target);
$index = $target . DIRECTORY_SEPARATOR . 'index.rst';
$title = str_replace('\\', '\\\\', $... | php | public function buildIndex($basedir, OutputInterface $output, array $options = array())
{
$target = $this->ensureBuildDir($basedir, $output);
$built_iterator = new DirectoryIterator($target);
$index = $target . DIRECTORY_SEPARATOR . 'index.rst';
$title = str_replace('\\', '\\\\', $... | [
"public",
"function",
"buildIndex",
"(",
"$",
"basedir",
",",
"OutputInterface",
"$",
"output",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"target",
"=",
"$",
"this",
"->",
"ensureBuildDir",
"(",
"$",
"basedir",
",",
"$",
"out... | Builds the index file | [
"Builds",
"the",
"index",
"file"
] | 7867503e1fc0acc47b4512fbd89bf742e03f79ba | https://github.com/varspool/sphpdox/blob/7867503e1fc0acc47b4512fbd89bf742e03f79ba/lib/Sphpdox/Element/NamespaceElement.php#L111-L148 |
226,685 | ivmelo/suap-api-php | src/Ivmelo/SUAP/SUAP.php | SUAP.getMeuBoletim | public function getMeuBoletim($year, $term)
{
$url = $this->endpoint.'minhas-informacoes/boletim/'.$year.'/'.$term.'/';
return $this->doGetRequest($url);
} | php | public function getMeuBoletim($year, $term)
{
$url = $this->endpoint.'minhas-informacoes/boletim/'.$year.'/'.$term.'/';
return $this->doGetRequest($url);
} | [
"public",
"function",
"getMeuBoletim",
"(",
"$",
"year",
",",
"$",
"term",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"endpoint",
".",
"'minhas-informacoes/boletim/'",
".",
"$",
"year",
".",
"'/'",
".",
"$",
"term",
".",
"'/'",
";",
"return",
"$",
... | Pega o boletim do aluno autenticado.
@param int $year Ano letivo.
@param int $term Período letivo.
@return array $data Boletim do aluno. | [
"Pega",
"o",
"boletim",
"do",
"aluno",
"autenticado",
"."
] | 0c1f01ef6afce49c9700246e1e3ddd8b7b34b377 | https://github.com/ivmelo/suap-api-php/blob/0c1f01ef6afce49c9700246e1e3ddd8b7b34b377/src/Ivmelo/SUAP/SUAP.php#L144-L149 |
226,686 | ivmelo/suap-api-php | src/Ivmelo/SUAP/SUAP.php | SUAP.doGetRequest | private function doGetRequest($url)
{
$response = $this->client->request('GET', $url, [
'headers' => [
'Authorization' => 'JWT '.$this->token,
],
]);
$data = false;
if ($response->getStatusCode() == 200) {
$data = json_decode($res... | php | private function doGetRequest($url)
{
$response = $this->client->request('GET', $url, [
'headers' => [
'Authorization' => 'JWT '.$this->token,
],
]);
$data = false;
if ($response->getStatusCode() == 200) {
$data = json_decode($res... | [
"private",
"function",
"doGetRequest",
"(",
"$",
"url",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"client",
"->",
"request",
"(",
"'GET'",
",",
"$",
"url",
",",
"[",
"'headers'",
"=>",
"[",
"'Authorization'",
"=>",
"'JWT '",
".",
"$",
"this",
... | Faz um request GET para um endpoint definido.
@param string $url Url para fazer o request.
@return array $data Dados retornados pela API. | [
"Faz",
"um",
"request",
"GET",
"para",
"um",
"endpoint",
"definido",
"."
] | 0c1f01ef6afce49c9700246e1e3ddd8b7b34b377 | https://github.com/ivmelo/suap-api-php/blob/0c1f01ef6afce49c9700246e1e3ddd8b7b34b377/src/Ivmelo/SUAP/SUAP.php#L251-L266 |
226,687 | gigaai/framework | src/Storage/Eloquent/WPUser.php | WPUser.inGroup | public function inGroup($slug)
{
return $this->groups->contains(function ($group) use ($slug) {
return $group->slug === $slug || $group->id === $slug;
});
} | php | public function inGroup($slug)
{
return $this->groups->contains(function ($group) use ($slug) {
return $group->slug === $slug || $group->id === $slug;
});
} | [
"public",
"function",
"inGroup",
"(",
"$",
"slug",
")",
"{",
"return",
"$",
"this",
"->",
"groups",
"->",
"contains",
"(",
"function",
"(",
"$",
"group",
")",
"use",
"(",
"$",
"slug",
")",
"{",
"return",
"$",
"group",
"->",
"slug",
"===",
"$",
"slu... | Check if current user in group by id or slug
@param Integer/String $slug
@return bool | [
"Check",
"if",
"current",
"user",
"in",
"group",
"by",
"id",
"or",
"slug"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Storage/Eloquent/WPUser.php#L90-L95 |
226,688 | gigaai/framework | src/Storage/Eloquent/WPUser.php | WPUser.getFacebookPages | public function getFacebookPages()
{
// Returns null if they haven't connected to Facebook
if ($this->isConnectedToFacebook() !== true) {
return null;
}
$response = Facebook::load()->get('/me/accounts', $this->data('access_token'));
$chunks = [];
... | php | public function getFacebookPages()
{
// Returns null if they haven't connected to Facebook
if ($this->isConnectedToFacebook() !== true) {
return null;
}
$response = Facebook::load()->get('/me/accounts', $this->data('access_token'));
$chunks = [];
... | [
"public",
"function",
"getFacebookPages",
"(",
")",
"{",
"// Returns null if they haven't connected to Facebook",
"if",
"(",
"$",
"this",
"->",
"isConnectedToFacebook",
"(",
")",
"!==",
"true",
")",
"{",
"return",
"null",
";",
"}",
"$",
"response",
"=",
"Facebook"... | Get Facebook Pages of current user if connected to Facebook
@return mixed | [
"Get",
"Facebook",
"Pages",
"of",
"current",
"user",
"if",
"connected",
"to",
"Facebook"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Storage/Eloquent/WPUser.php#L110-L148 |
226,689 | phergie/phergie-irc-bot-react | src/PluginProcessor/LoggerInjector.php | LoggerInjector.process | public function process(PluginInterface $plugin, Bot $bot)
{
if ($plugin instanceof LoggerAwareInterface) {
$plugin->setLogger($bot->getLogger());
}
} | php | public function process(PluginInterface $plugin, Bot $bot)
{
if ($plugin instanceof LoggerAwareInterface) {
$plugin->setLogger($bot->getLogger());
}
} | [
"public",
"function",
"process",
"(",
"PluginInterface",
"$",
"plugin",
",",
"Bot",
"$",
"bot",
")",
"{",
"if",
"(",
"$",
"plugin",
"instanceof",
"LoggerAwareInterface",
")",
"{",
"$",
"plugin",
"->",
"setLogger",
"(",
"$",
"bot",
"->",
"getLogger",
"(",
... | Injects the bot's logger into the plugin if it implements
\Psr\Log\LoggerAwareInterface.
@param \Phergie\Irc\Bot\React\PluginInterface $plugin Loaded plugin
@param \Phergie\Irc\Bot\React\Bot $bot Bot that loaded the plugin | [
"Injects",
"the",
"bot",
"s",
"logger",
"into",
"the",
"plugin",
"if",
"it",
"implements",
"\\",
"Psr",
"\\",
"Log",
"\\",
"LoggerAwareInterface",
"."
] | 17745ef6b846513258af3dbd86e5612d3deb19b7 | https://github.com/phergie/phergie-irc-bot-react/blob/17745ef6b846513258af3dbd86e5612d3deb19b7/src/PluginProcessor/LoggerInjector.php#L32-L37 |
226,690 | jpcercal/environment | src/EnvironmentVariable.php | EnvironmentVariable.get | public function get($key, $defaultValue = null)
{
$rawValue = $this->getEnvironmentVariable($key);
return $this->getValue($rawValue, $defaultValue);
} | php | public function get($key, $defaultValue = null)
{
$rawValue = $this->getEnvironmentVariable($key);
return $this->getValue($rawValue, $defaultValue);
} | [
"public",
"function",
"get",
"(",
"$",
"key",
",",
"$",
"defaultValue",
"=",
"null",
")",
"{",
"$",
"rawValue",
"=",
"$",
"this",
"->",
"getEnvironmentVariable",
"(",
"$",
"key",
")",
";",
"return",
"$",
"this",
"->",
"getValue",
"(",
"$",
"rawValue",
... | Get value from environment.
@param string $key
@param mixed $defaultValue
@return mixed | [
"Get",
"value",
"from",
"environment",
"."
] | 6be36b0585b1c856a86247e5d335063ba4f150f9 | https://github.com/jpcercal/environment/blob/6be36b0585b1c856a86247e5d335063ba4f150f9/src/EnvironmentVariable.php#L72-L77 |
226,691 | johannesschobel/dingoquerymapper | src/JohannesSchobel/DingoQueryMapper/Parser/DingoQueryMapperBuilder.php | DingoQueryMapperBuilder.createFromBuilder | public function createFromBuilder(Builder $builder)
{
$this->model = $builder->getModel();
$this->query = $builder;
$this->build();
return $this;
} | php | public function createFromBuilder(Builder $builder)
{
$this->model = $builder->getModel();
$this->query = $builder;
$this->build();
return $this;
} | [
"public",
"function",
"createFromBuilder",
"(",
"Builder",
"$",
"builder",
")",
"{",
"$",
"this",
"->",
"model",
"=",
"$",
"builder",
"->",
"getModel",
"(",
")",
";",
"$",
"this",
"->",
"query",
"=",
"$",
"builder",
";",
"$",
"this",
"->",
"build",
"... | Create the Query from an existing builder
@param Builder $builder
@return $this | [
"Create",
"the",
"Query",
"from",
"an",
"existing",
"builder"
] | 0ae2c1a0b5e7e7cf405ced9ced605907a5809c0e | https://github.com/johannesschobel/dingoquerymapper/blob/0ae2c1a0b5e7e7cf405ced9ced605907a5809c0e/src/JohannesSchobel/DingoQueryMapper/Parser/DingoQueryMapperBuilder.php#L95-L103 |
226,692 | johannesschobel/dingoquerymapper | src/JohannesSchobel/DingoQueryMapper/Parser/DingoQueryMapperBuilder.php | DingoQueryMapperBuilder.createFromModel | public function createFromModel(Model $model)
{
$this->model = $model;
$this->query = $this->model->newQuery();
return $this;
} | php | public function createFromModel(Model $model)
{
$this->model = $model;
$this->query = $this->model->newQuery();
return $this;
} | [
"public",
"function",
"createFromModel",
"(",
"Model",
"$",
"model",
")",
"{",
"$",
"this",
"->",
"model",
"=",
"$",
"model",
";",
"$",
"this",
"->",
"query",
"=",
"$",
"this",
"->",
"model",
"->",
"newQuery",
"(",
")",
";",
"return",
"$",
"this",
... | Create the query from an empty model
@param Model $model
@return $this | [
"Create",
"the",
"query",
"from",
"an",
"empty",
"model"
] | 0ae2c1a0b5e7e7cf405ced9ced605907a5809c0e | https://github.com/johannesschobel/dingoquerymapper/blob/0ae2c1a0b5e7e7cf405ced9ced605907a5809c0e/src/JohannesSchobel/DingoQueryMapper/Parser/DingoQueryMapperBuilder.php#L111-L117 |
226,693 | kevinkhill/FontAwesomePHP | src/FontAwesomeHtmlEntity.php | FontAwesomeHtmlEntity.setIcon | protected function setIcon($icon)
{
if (is_string($icon) === false) {
throw new \InvalidArgumentException(
'The icon label must be a string.'
);
}
$this->icon = $icon;
return $this;
} | php | protected function setIcon($icon)
{
if (is_string($icon) === false) {
throw new \InvalidArgumentException(
'The icon label must be a string.'
);
}
$this->icon = $icon;
return $this;
} | [
"protected",
"function",
"setIcon",
"(",
"$",
"icon",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"icon",
")",
"===",
"false",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'The icon label must be a string.'",
")",
";",
"}",
"$",
"this",
... | Sets icon label
@access protected
@param string $icon Icon label, omitting the "fa-" prefix
@return self
@throws \InvalidArgumentException | [
"Sets",
"icon",
"label"
] | e7d12d7422b23a5c3a09715d9ca3e24ff811c073 | https://github.com/kevinkhill/FontAwesomePHP/blob/e7d12d7422b23a5c3a09715d9ca3e24ff811c073/src/FontAwesomeHtmlEntity.php#L149-L160 |
226,694 | kevinkhill/FontAwesomePHP | src/FontAwesomeHtmlEntity.php | FontAwesomeHtmlEntity.setMask | protected function setMask($icon, $style='fas')
{
if (is_string($icon) === false) {
throw new \InvalidArgumentException(
'The mask icon label must be a string.'
);
}
if (is_string($style) === false) {
throw new \InvalidArgumentException(
... | php | protected function setMask($icon, $style='fas')
{
if (is_string($icon) === false) {
throw new \InvalidArgumentException(
'The mask icon label must be a string.'
);
}
if (is_string($style) === false) {
throw new \InvalidArgumentException(
... | [
"protected",
"function",
"setMask",
"(",
"$",
"icon",
",",
"$",
"style",
"=",
"'fas'",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"icon",
")",
"===",
"false",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'The mask icon label must be a s... | Sets mask label
@access protected
@param string $icon Icon label, omitting the "fa-" prefix
@param string $style Style label
@return self
@throws \InvalidArgumentException | [
"Sets",
"mask",
"label"
] | e7d12d7422b23a5c3a09715d9ca3e24ff811c073 | https://github.com/kevinkhill/FontAwesomePHP/blob/e7d12d7422b23a5c3a09715d9ca3e24ff811c073/src/FontAwesomeHtmlEntity.php#L171-L192 |
226,695 | kevinkhill/FontAwesomePHP | src/FontAwesomeHtmlEntity.php | FontAwesomeHtmlEntity.setStyle | protected function setStyle($style)
{
if (is_string($style) === false) {
throw new \InvalidArgumentException(
'The style label must be a string.'
);
}
if (!in_array($style, $this->STYLES)) {
throw new \InvalidArgumentException(
... | php | protected function setStyle($style)
{
if (is_string($style) === false) {
throw new \InvalidArgumentException(
'The style label must be a string.'
);
}
if (!in_array($style, $this->STYLES)) {
throw new \InvalidArgumentException(
... | [
"protected",
"function",
"setStyle",
"(",
"$",
"style",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"style",
")",
"===",
"false",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'The style label must be a string.'",
")",
";",
"}",
"if",
"("... | Sets style label
@access protected
@param string $style Font Awesome style ('fas', 'far', 'fal', 'fab')
@return self
@throws \InvalidArgumentException | [
"Sets",
"style",
"label"
] | e7d12d7422b23a5c3a09715d9ca3e24ff811c073 | https://github.com/kevinkhill/FontAwesomePHP/blob/e7d12d7422b23a5c3a09715d9ca3e24ff811c073/src/FontAwesomeHtmlEntity.php#L202-L218 |
226,696 | kevinkhill/FontAwesomePHP | src/FontAwesomeHtmlEntity.php | FontAwesomeHtmlEntity.addAttr | public function addAttr($attr, $val)
{
if (is_string($attr) === false) {
throw new \InvalidArgumentException;
}
$this->attributes[$attr] = $val;
return $this;
} | php | public function addAttr($attr, $val)
{
if (is_string($attr) === false) {
throw new \InvalidArgumentException;
}
$this->attributes[$attr] = $val;
return $this;
} | [
"public",
"function",
"addAttr",
"(",
"$",
"attr",
",",
"$",
"val",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"attr",
")",
"===",
"false",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
";",
"}",
"$",
"this",
"->",
"attributes",
"[",
"... | Adds an attribute to the icon, useful for title or id
@since 1.1.0
@param string $attr Which attribute to add
@param mixed $val The value of the attribute
@return self
@throws \InvalidArgumentException | [
"Adds",
"an",
"attribute",
"to",
"the",
"icon",
"useful",
"for",
"title",
"or",
"id"
] | e7d12d7422b23a5c3a09715d9ca3e24ff811c073 | https://github.com/kevinkhill/FontAwesomePHP/blob/e7d12d7422b23a5c3a09715d9ca3e24ff811c073/src/FontAwesomeHtmlEntity.php#L246-L255 |
226,697 | kevinkhill/FontAwesomePHP | src/FontAwesomeHtmlEntity.php | FontAwesomeHtmlEntity.addAttrs | public function addAttrs(array $attrs)
{
foreach ($attrs as $attr => $val) {
$this->addAttr($attr, $val);
}
return $this;
} | php | public function addAttrs(array $attrs)
{
foreach ($attrs as $attr => $val) {
$this->addAttr($attr, $val);
}
return $this;
} | [
"public",
"function",
"addAttrs",
"(",
"array",
"$",
"attrs",
")",
"{",
"foreach",
"(",
"$",
"attrs",
"as",
"$",
"attr",
"=>",
"$",
"val",
")",
"{",
"$",
"this",
"->",
"addAttr",
"(",
"$",
"attr",
",",
"$",
"val",
")",
";",
"}",
"return",
"$",
... | Batch adds an attributes to the icon
@since 1.1.0
@param array $attrs Array of attributes to add
@return self
@throws \InvalidArgumentException | [
"Batch",
"adds",
"an",
"attributes",
"to",
"the",
"icon"
] | e7d12d7422b23a5c3a09715d9ca3e24ff811c073 | https://github.com/kevinkhill/FontAwesomePHP/blob/e7d12d7422b23a5c3a09715d9ca3e24ff811c073/src/FontAwesomeHtmlEntity.php#L265-L272 |
226,698 | oleglfed/laravel-ddd | src/Commands/GenerateDomain.php | GenerateDomain.createDirectories | public function createDirectories()
{
if (!file_exists($this->getDomainPath())) {
mkdir($this->getDomainPath(), 0777);
}
if (!file_exists($this->getInfrastructurePath())) {
mkdir($this->getInfrastructurePath(), 0777);
}
if (!file_exists($this->getTes... | php | public function createDirectories()
{
if (!file_exists($this->getDomainPath())) {
mkdir($this->getDomainPath(), 0777);
}
if (!file_exists($this->getInfrastructurePath())) {
mkdir($this->getInfrastructurePath(), 0777);
}
if (!file_exists($this->getTes... | [
"public",
"function",
"createDirectories",
"(",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"this",
"->",
"getDomainPath",
"(",
")",
")",
")",
"{",
"mkdir",
"(",
"$",
"this",
"->",
"getDomainPath",
"(",
")",
",",
"0777",
")",
";",
"}",
"if",
... | Prepare directories.
@return bool | [
"Prepare",
"directories",
"."
] | 4e60759d29086fe041b2c158c8ae3a79eeeb70f7 | https://github.com/oleglfed/laravel-ddd/blob/4e60759d29086fe041b2c158c8ae3a79eeeb70f7/src/Commands/GenerateDomain.php#L158-L195 |
226,699 | oleglfed/laravel-ddd | src/Commands/GenerateDomain.php | GenerateDomain.copyDomain | public function copyDomain($name)
{
file_put_contents(
$this->getDomainPath("/Contracts/{$name}Interface.php"),
$this->prepare(file_get_contents($this->domainInterfaceContract))
);
file_put_contents(
$this->getDomainPath("/Contracts/{$name}RepositoryInter... | php | public function copyDomain($name)
{
file_put_contents(
$this->getDomainPath("/Contracts/{$name}Interface.php"),
$this->prepare(file_get_contents($this->domainInterfaceContract))
);
file_put_contents(
$this->getDomainPath("/Contracts/{$name}RepositoryInter... | [
"public",
"function",
"copyDomain",
"(",
"$",
"name",
")",
"{",
"file_put_contents",
"(",
"$",
"this",
"->",
"getDomainPath",
"(",
"\"/Contracts/{$name}Interface.php\"",
")",
",",
"$",
"this",
"->",
"prepare",
"(",
"file_get_contents",
"(",
"$",
"this",
"->",
... | Copy domains.
@param $name
@return bool | [
"Copy",
"domains",
"."
] | 4e60759d29086fe041b2c158c8ae3a79eeeb70f7 | https://github.com/oleglfed/laravel-ddd/blob/4e60759d29086fe041b2c158c8ae3a79eeeb70f7/src/Commands/GenerateDomain.php#L278-L300 |
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.