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,500 | kevinkhill/FontAwesomePHP | src/FontAwesomeList.php | FontAwesomeList.addItem | private function addItem($icon, $liVal)
{
if ($icon === null) {
$this->lines[] = array($this->icon, $liVal);
} else {
$this->lines[] = array($icon, $liVal);
}
return $this;
} | php | private function addItem($icon, $liVal)
{
if ($icon === null) {
$this->lines[] = array($this->icon, $liVal);
} else {
$this->lines[] = array($icon, $liVal);
}
return $this;
} | [
"private",
"function",
"addItem",
"(",
"$",
"icon",
",",
"$",
"liVal",
")",
"{",
"if",
"(",
"$",
"icon",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"lines",
"[",
"]",
"=",
"array",
"(",
"$",
"this",
"->",
"icon",
",",
"$",
"liVal",
")",
";",
... | Add an item to the list
@param string $icon Icon to assign the list item
@param string $liVal Value of the list item
@return self | [
"Add",
"an",
"item",
"to",
"the",
"list"
] | e7d12d7422b23a5c3a09715d9ca3e24ff811c073 | https://github.com/kevinkhill/FontAwesomePHP/blob/e7d12d7422b23a5c3a09715d9ca3e24ff811c073/src/FontAwesomeList.php#L125-L134 |
226,501 | kevinkhill/FontAwesomePHP | src/FontAwesomeList.php | FontAwesomeList.addItems | private function addItems(array $lineArray)
{
foreach ($lineArray as $icon => $liVal) {
$icon = is_string($icon) ? $icon : null;
$this->addItem($icon, $liVal);
}
return $this;
} | php | private function addItems(array $lineArray)
{
foreach ($lineArray as $icon => $liVal) {
$icon = is_string($icon) ? $icon : null;
$this->addItem($icon, $liVal);
}
return $this;
} | [
"private",
"function",
"addItems",
"(",
"array",
"$",
"lineArray",
")",
"{",
"foreach",
"(",
"$",
"lineArray",
"as",
"$",
"icon",
"=>",
"$",
"liVal",
")",
"{",
"$",
"icon",
"=",
"is_string",
"(",
"$",
"icon",
")",
"?",
"$",
"icon",
":",
"null",
";"... | Add multiple items to list
@param array $lineArray Array of lines to add to list
@return self
@throws \Khill\FontAwesome\Exceptions\IncompleteListException | [
"Add",
"multiple",
"items",
"to",
"list"
] | e7d12d7422b23a5c3a09715d9ca3e24ff811c073 | https://github.com/kevinkhill/FontAwesomePHP/blob/e7d12d7422b23a5c3a09715d9ca3e24ff811c073/src/FontAwesomeList.php#L143-L152 |
226,502 | phergie/phergie-irc-bot-react | src/PluginProcessor/LoopInjector.php | LoopInjector.process | public function process(PluginInterface $plugin, Bot $bot)
{
$client = $bot->getClient();
if ($plugin instanceof LoopAwareInterface
&& $client instanceof LoopAccessorInterface) {
$plugin->setLoop($client->getLoop());
}
} | php | public function process(PluginInterface $plugin, Bot $bot)
{
$client = $bot->getClient();
if ($plugin instanceof LoopAwareInterface
&& $client instanceof LoopAccessorInterface) {
$plugin->setLoop($client->getLoop());
}
} | [
"public",
"function",
"process",
"(",
"PluginInterface",
"$",
"plugin",
",",
"Bot",
"$",
"bot",
")",
"{",
"$",
"client",
"=",
"$",
"bot",
"->",
"getClient",
"(",
")",
";",
"if",
"(",
"$",
"plugin",
"instanceof",
"LoopAwareInterface",
"&&",
"$",
"client",... | Injects the event loop of the bot's client into the plugin if it implements
\Phergie\Irc\Bot\React\LoopInterface.
@param \Phergie\Irc\Bot\React\PluginInterface $plugin Loaded plugin
@param \Phergie\Irc\Bot\React\Bot $bot Bot that loaded the plugin | [
"Injects",
"the",
"event",
"loop",
"of",
"the",
"bot",
"s",
"client",
"into",
"the",
"plugin",
"if",
"it",
"implements",
"\\",
"Phergie",
"\\",
"Irc",
"\\",
"Bot",
"\\",
"React",
"\\",
"LoopInterface",
"."
] | 17745ef6b846513258af3dbd86e5612d3deb19b7 | https://github.com/phergie/phergie-irc-bot-react/blob/17745ef6b846513258af3dbd86e5612d3deb19b7/src/PluginProcessor/LoopInjector.php#L34-L41 |
226,503 | jasny/db-mysql | src/Jasny/MySQL/DB.php | DB.conn | public static function conn()
{
// Auto connect using Jasny's Config class
if (!isset(self::$connection)) {
if (!class_exists('Jasny\Config') || !isset(\Jasny\Config::i()->db)) throw new DB_Exception("Unable to create DB connection: not configured");
new static(\Jasny\Config:... | php | public static function conn()
{
// Auto connect using Jasny's Config class
if (!isset(self::$connection)) {
if (!class_exists('Jasny\Config') || !isset(\Jasny\Config::i()->db)) throw new DB_Exception("Unable to create DB connection: not configured");
new static(\Jasny\Config:... | [
"public",
"static",
"function",
"conn",
"(",
")",
"{",
"// Auto connect using Jasny's Config class",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"connection",
")",
")",
"{",
"if",
"(",
"!",
"class_exists",
"(",
"'Jasny\\Config'",
")",
"||",
"!",
"isset"... | Get the DB connection.
@return DB | [
"Get",
"the",
"DB",
"connection",
"."
] | da03c9eaec386bd8f30919d0b33be4e91eec5c8c | https://github.com/jasny/db-mysql/blob/da03c9eaec386bd8f30919d0b33be4e91eec5c8c/src/Jasny/MySQL/DB.php#L49-L58 |
226,504 | jasny/db-mysql | src/Jasny/MySQL/DB.php | DB.fetchColumn | public function fetchColumn($query)
{
if (func_num_args() > 1) $query = call_user_func_array(array(get_class(), 'bind'), func_get_args());
$result = $query instanceof \mysqli_result ? $query : $this->query($query);
$values = array();
while (list($value) = $result->fetch_row()) {
... | php | public function fetchColumn($query)
{
if (func_num_args() > 1) $query = call_user_func_array(array(get_class(), 'bind'), func_get_args());
$result = $query instanceof \mysqli_result ? $query : $this->query($query);
$values = array();
while (list($value) = $result->fetch_row()) {
... | [
"public",
"function",
"fetchColumn",
"(",
"$",
"query",
")",
"{",
"if",
"(",
"func_num_args",
"(",
")",
">",
"1",
")",
"$",
"query",
"=",
"call_user_func_array",
"(",
"array",
"(",
"get_class",
"(",
")",
",",
"'bind'",
")",
",",
"func_get_args",
"(",
"... | Query and fetch a single column from all result rows.
@example DB::conn()->fetchColumn("SELECT name FROM mytable");
@example DB::conn()->fetchColumn("SELECT name FROM mytable WHERE group=?", $group);
@param string|\mysqli_result $query SQL Query or DB result
@param string $field The field position or... | [
"Query",
"and",
"fetch",
"a",
"single",
"column",
"from",
"all",
"result",
"rows",
"."
] | da03c9eaec386bd8f30919d0b33be4e91eec5c8c | https://github.com/jasny/db-mysql/blob/da03c9eaec386bd8f30919d0b33be4e91eec5c8c/src/Jasny/MySQL/DB.php#L186-L198 |
226,505 | jasny/db-mysql | src/Jasny/MySQL/DB.php | DB.fetchValue | public function fetchValue($query)
{
if (func_num_args() > 1) $query = call_user_func_array(array(get_class(), 'bind'), func_get_args());
$result = $query instanceof \mysqli_result ? $query : $this->query($query);
list($value) = $result->fetch_row();
return $value;
} | php | public function fetchValue($query)
{
if (func_num_args() > 1) $query = call_user_func_array(array(get_class(), 'bind'), func_get_args());
$result = $query instanceof \mysqli_result ? $query : $this->query($query);
list($value) = $result->fetch_row();
return $value;
} | [
"public",
"function",
"fetchValue",
"(",
"$",
"query",
")",
"{",
"if",
"(",
"func_num_args",
"(",
")",
">",
"1",
")",
"$",
"query",
"=",
"call_user_func_array",
"(",
"array",
"(",
"get_class",
"(",
")",
",",
"'bind'",
")",
",",
"func_get_args",
"(",
")... | Query and fetch a single value.
@example DB::conn()->fetchValue("SELECT SUM(foo) FROM mytable");
@example DB::conn()->fetchValue("SELECT name FROM mytable WHERE id=?", $id);
@param string|\mysqli_result $query SQL Query or DB result
@param string $field The field position or name to fetch
@return arr... | [
"Query",
"and",
"fetch",
"a",
"single",
"value",
"."
] | da03c9eaec386bd8f30919d0b33be4e91eec5c8c | https://github.com/jasny/db-mysql/blob/da03c9eaec386bd8f30919d0b33be4e91eec5c8c/src/Jasny/MySQL/DB.php#L233-L241 |
226,506 | jasny/db-mysql | src/Jasny/MySQL/DB.php | DB.save | public function save($table, array $values = array(), $update = true)
{
if (!is_array(reset($values))) $values = array($values); // Make sure that $values is a set of rows
$fields = array();
$query_values = array();
$query_update = array();
foreach (array_keys(reset($values... | php | public function save($table, array $values = array(), $update = true)
{
if (!is_array(reset($values))) $values = array($values); // Make sure that $values is a set of rows
$fields = array();
$query_values = array();
$query_update = array();
foreach (array_keys(reset($values... | [
"public",
"function",
"save",
"(",
"$",
"table",
",",
"array",
"$",
"values",
"=",
"array",
"(",
")",
",",
"$",
"update",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"reset",
"(",
"$",
"values",
")",
")",
")",
"$",
"values",
"=",
"a... | Insert or update a record.
All rows should have the same keys in the same order.
@example $db->save('mytable', $row)
@example $db->save('mytable', array($row1, $row2, $row3))
@example $db->save('mytable', array($row1, $row2, $row3), DB::SKIP_EXISTING)
@param string $table
@param array $values One or multiple rows... | [
"Insert",
"or",
"update",
"a",
"record",
".",
"All",
"rows",
"should",
"have",
"the",
"same",
"keys",
"in",
"the",
"same",
"order",
"."
] | da03c9eaec386bd8f30919d0b33be4e91eec5c8c | https://github.com/jasny/db-mysql/blob/da03c9eaec386bd8f30919d0b33be4e91eec5c8c/src/Jasny/MySQL/DB.php#L257-L284 |
226,507 | jasny/db-mysql | src/Jasny/MySQL/DB.php | DB.quote | public static function quote($value, $empty = 'NULL')
{
if (is_array($value)) return '(' . join(', ', array_map(array(get_class(), 'quote'), $value)) . ')';
if (is_null($value)) return $empty;
if (is_bool($value)) return $value ? 'TRUE' : 'FALSE';
if (is_int($value) || is_float($val... | php | public static function quote($value, $empty = 'NULL')
{
if (is_array($value)) return '(' . join(', ', array_map(array(get_class(), 'quote'), $value)) . ')';
if (is_null($value)) return $empty;
if (is_bool($value)) return $value ? 'TRUE' : 'FALSE';
if (is_int($value) || is_float($val... | [
"public",
"static",
"function",
"quote",
"(",
"$",
"value",
",",
"$",
"empty",
"=",
"'NULL'",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
")",
"return",
"'('",
".",
"join",
"(",
"', '",
",",
"array_map",
"(",
"array",
"(",
"get_class",
... | Quote a value so it can be savely used in a query.
@param mixed $value
@param string $empty Return $empty if $value is null
@return string | [
"Quote",
"a",
"value",
"so",
"it",
"can",
"be",
"savely",
"used",
"in",
"a",
"query",
"."
] | da03c9eaec386bd8f30919d0b33be4e91eec5c8c | https://github.com/jasny/db-mysql/blob/da03c9eaec386bd8f30919d0b33be4e91eec5c8c/src/Jasny/MySQL/DB.php#L294-L302 |
226,508 | gigaai/framework | src/Core/Config.php | Config.loadFromFile | private function loadFromFile($path)
{
if ( ! is_file($path)) {
return;
}
$config = require_once $path;
if (is_array($config)) {
$this->config = $config;
}
} | php | private function loadFromFile($path)
{
if ( ! is_file($path)) {
return;
}
$config = require_once $path;
if (is_array($config)) {
$this->config = $config;
}
} | [
"private",
"function",
"loadFromFile",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"!",
"is_file",
"(",
"$",
"path",
")",
")",
"{",
"return",
";",
"}",
"$",
"config",
"=",
"require_once",
"$",
"path",
";",
"if",
"(",
"is_array",
"(",
"$",
"config",
")",... | Load configuration from file. The file should returns an array of settings.
@param String $path File path
@return $this|void | [
"Load",
"configuration",
"from",
"file",
".",
"The",
"file",
"should",
"returns",
"an",
"array",
"of",
"settings",
"."
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Core/Config.php#L74-L85 |
226,509 | gigaai/framework | src/Http/Http.php | Http.post | public static function post($url, $data = [], $method = 'POST')
{
$ch = curl_init();
if ( ! empty($data)) {
$data = http_build_query($data);
}
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($ch,... | php | public static function post($url, $data = [], $method = 'POST')
{
$ch = curl_init();
if ( ! empty($data)) {
$data = http_build_query($data);
}
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($ch,... | [
"public",
"static",
"function",
"post",
"(",
"$",
"url",
",",
"$",
"data",
"=",
"[",
"]",
",",
"$",
"method",
"=",
"'POST'",
")",
"{",
"$",
"ch",
"=",
"curl_init",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"data",
")",
")",
"{",
"$",
... | Make a POST request to the end point
@param String $url Url End point
@param array $data Data to be send
@return Mixed | [
"Make",
"a",
"POST",
"request",
"to",
"the",
"end",
"point"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Http/Http.php#L20-L48 |
226,510 | thelia-modules/Atos | Model/Map/AtosCurrencyTableMap.php | AtosCurrencyTableMap.doDelete | public static function doDelete($values, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(AtosCurrencyTableMap::DATABASE_NAME);
}
if ($values instanceof Criteria) {
// rename for clarity
$cr... | php | public static function doDelete($values, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(AtosCurrencyTableMap::DATABASE_NAME);
}
if ($values instanceof Criteria) {
// rename for clarity
$cr... | [
"public",
"static",
"function",
"doDelete",
"(",
"$",
"values",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"con",
")",
"{",
"$",
"con",
"=",
"Propel",
"::",
"getServiceContainer",
"(",
")",
"->",
"getW... | Performs a DELETE on the database, given a AtosCurrency or Criteria object OR a primary key value.
@param mixed $values Criteria or AtosCurrency object or primary key or array of primary keys
which is used to create the DELETE statement
@param ConnectionInterface $con the connection to use
@return i... | [
"Performs",
"a",
"DELETE",
"on",
"the",
"database",
"given",
"a",
"AtosCurrency",
"or",
"Criteria",
"object",
"OR",
"a",
"primary",
"key",
"value",
"."
] | 1084b7728bf8f914001e8515f88e2e5c007cc487 | https://github.com/thelia-modules/Atos/blob/1084b7728bf8f914001e8515f88e2e5c007cc487/Model/Map/AtosCurrencyTableMap.php#L331-L357 |
226,511 | botman/driver-hangouts | src/HangoutsDriver.php | HangoutsDriver.loadMessages | protected function loadMessages()
{
$message = $this->event->get('message');
$text = $message['text'];
if ($this->config->get('strip_annotations') === true && isset($message['annotations'])) {
$start = $message['annotations'][0]['startIndex'];
$length = $message['an... | php | protected function loadMessages()
{
$message = $this->event->get('message');
$text = $message['text'];
if ($this->config->get('strip_annotations') === true && isset($message['annotations'])) {
$start = $message['annotations'][0]['startIndex'];
$length = $message['an... | [
"protected",
"function",
"loadMessages",
"(",
")",
"{",
"$",
"message",
"=",
"$",
"this",
"->",
"event",
"->",
"get",
"(",
"'message'",
")",
";",
"$",
"text",
"=",
"$",
"message",
"[",
"'text'",
"]",
";",
"if",
"(",
"$",
"this",
"->",
"config",
"->... | Load the messages from the incoming payload. | [
"Load",
"the",
"messages",
"from",
"the",
"incoming",
"payload",
"."
] | 2e88f1a1589d4d09e5626652a42fef843eef5600 | https://github.com/botman/driver-hangouts/blob/2e88f1a1589d4d09e5626652a42fef843eef5600/src/HangoutsDriver.php#L80-L93 |
226,512 | thelia-modules/Atos | Model/Base/AtosCurrencyQuery.php | AtosCurrencyQuery.create | public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Atos\Model\AtosCurrencyQuery) {
return $criteria;
}
$query = new \Atos\Model\AtosCurrencyQuery();
if (null !== $modelAlias) {
$query->setModelAlias($modelAlias);
... | php | public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Atos\Model\AtosCurrencyQuery) {
return $criteria;
}
$query = new \Atos\Model\AtosCurrencyQuery();
if (null !== $modelAlias) {
$query->setModelAlias($modelAlias);
... | [
"public",
"static",
"function",
"create",
"(",
"$",
"modelAlias",
"=",
"null",
",",
"$",
"criteria",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"criteria",
"instanceof",
"\\",
"Atos",
"\\",
"Model",
"\\",
"AtosCurrencyQuery",
")",
"{",
"return",
"$",
"criter... | Returns a new ChildAtosCurrencyQuery object.
@param string $modelAlias The alias of a model in the query
@param Criteria $criteria Optional Criteria to build the query from
@return ChildAtosCurrencyQuery | [
"Returns",
"a",
"new",
"ChildAtosCurrencyQuery",
"object",
"."
] | 1084b7728bf8f914001e8515f88e2e5c007cc487 | https://github.com/thelia-modules/Atos/blob/1084b7728bf8f914001e8515f88e2e5c007cc487/Model/Base/AtosCurrencyQuery.php#L68-L82 |
226,513 | thelia-modules/Atos | Model/Base/AtosCurrencyQuery.php | AtosCurrencyQuery.filterByAtosCode | public function filterByAtosCode($atosCode = null, $comparison = null)
{
if (is_array($atosCode)) {
$useMinMax = false;
if (isset($atosCode['min'])) {
$this->addUsingAlias(AtosCurrencyTableMap::ATOS_CODE, $atosCode['min'], Criteria::GREATER_EQUAL);
$us... | php | public function filterByAtosCode($atosCode = null, $comparison = null)
{
if (is_array($atosCode)) {
$useMinMax = false;
if (isset($atosCode['min'])) {
$this->addUsingAlias(AtosCurrencyTableMap::ATOS_CODE, $atosCode['min'], Criteria::GREATER_EQUAL);
$us... | [
"public",
"function",
"filterByAtosCode",
"(",
"$",
"atosCode",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"atosCode",
")",
")",
"{",
"$",
"useMinMax",
"=",
"false",
";",
"if",
"(",
"isset",
"(",
"$",... | Filter the query on the atos_code column
Example usage:
<code>
$query->filterByAtosCode(1234); // WHERE atos_code = 1234
$query->filterByAtosCode(array(12, 34)); // WHERE atos_code IN (12, 34)
$query->filterByAtosCode(array('min' => 12)); // WHERE atos_code > 12
</code>
@param mixed $atosCode The value to use as f... | [
"Filter",
"the",
"query",
"on",
"the",
"atos_code",
"column"
] | 1084b7728bf8f914001e8515f88e2e5c007cc487 | https://github.com/thelia-modules/Atos/blob/1084b7728bf8f914001e8515f88e2e5c007cc487/Model/Base/AtosCurrencyQuery.php#L265-L286 |
226,514 | thelia-modules/Atos | Model/Base/AtosCurrencyQuery.php | AtosCurrencyQuery.filterByDecimals | public function filterByDecimals($decimals = null, $comparison = null)
{
if (is_array($decimals)) {
$useMinMax = false;
if (isset($decimals['min'])) {
$this->addUsingAlias(AtosCurrencyTableMap::DECIMALS, $decimals['min'], Criteria::GREATER_EQUAL);
$use... | php | public function filterByDecimals($decimals = null, $comparison = null)
{
if (is_array($decimals)) {
$useMinMax = false;
if (isset($decimals['min'])) {
$this->addUsingAlias(AtosCurrencyTableMap::DECIMALS, $decimals['min'], Criteria::GREATER_EQUAL);
$use... | [
"public",
"function",
"filterByDecimals",
"(",
"$",
"decimals",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"decimals",
")",
")",
"{",
"$",
"useMinMax",
"=",
"false",
";",
"if",
"(",
"isset",
"(",
"$",... | Filter the query on the decimals column
Example usage:
<code>
$query->filterByDecimals(1234); // WHERE decimals = 1234
$query->filterByDecimals(array(12, 34)); // WHERE decimals IN (12, 34)
$query->filterByDecimals(array('min' => 12)); // WHERE decimals > 12
</code>
@param mixed $decimals The value to use as filte... | [
"Filter",
"the",
"query",
"on",
"the",
"decimals",
"column"
] | 1084b7728bf8f914001e8515f88e2e5c007cc487 | https://github.com/thelia-modules/Atos/blob/1084b7728bf8f914001e8515f88e2e5c007cc487/Model/Base/AtosCurrencyQuery.php#L306-L327 |
226,515 | phergie/phergie-irc-bot-react | src/Bot.php | Bot.setLogger | public function setLogger(LoggerInterface $logger)
{
$this->logger = $logger;
$this->getClient()->setLogger($logger);
} | php | public function setLogger(LoggerInterface $logger)
{
$this->logger = $logger;
$this->getClient()->setLogger($logger);
} | [
"public",
"function",
"setLogger",
"(",
"LoggerInterface",
"$",
"logger",
")",
"{",
"$",
"this",
"->",
"logger",
"=",
"$",
"logger",
";",
"$",
"this",
"->",
"getClient",
"(",
")",
"->",
"setLogger",
"(",
"$",
"logger",
")",
";",
"}"
] | Sets the logger in use by the bot.
@param \Psr\Log\LoggerInterface $logger | [
"Sets",
"the",
"logger",
"in",
"use",
"by",
"the",
"bot",
"."
] | 17745ef6b846513258af3dbd86e5612d3deb19b7 | https://github.com/phergie/phergie-irc-bot-react/blob/17745ef6b846513258af3dbd86e5612d3deb19b7/src/Bot.php#L137-L141 |
226,516 | phergie/phergie-irc-bot-react | src/Bot.php | Bot.getLogger | public function getLogger()
{
if (!$this->logger) {
$this->logger = $this->getClient()->getLogger();
}
return $this->logger;
} | php | public function getLogger()
{
if (!$this->logger) {
$this->logger = $this->getClient()->getLogger();
}
return $this->logger;
} | [
"public",
"function",
"getLogger",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"logger",
")",
"{",
"$",
"this",
"->",
"logger",
"=",
"$",
"this",
"->",
"getClient",
"(",
")",
"->",
"getLogger",
"(",
")",
";",
"}",
"return",
"$",
"this",
"->... | Returns the logger in use by the bot.
@return \Psr\Log\LoggerInterface | [
"Returns",
"the",
"logger",
"in",
"use",
"by",
"the",
"bot",
"."
] | 17745ef6b846513258af3dbd86e5612d3deb19b7 | https://github.com/phergie/phergie-irc-bot-react/blob/17745ef6b846513258af3dbd86e5612d3deb19b7/src/Bot.php#L148-L154 |
226,517 | phergie/phergie-irc-bot-react | src/Bot.php | Bot.run | public function run($autorun = true)
{
$this->setDependencyOverrides($this->config);
$this->getPlugins($this->config);
$connections = $this->getConnections($this->config);
$this->getClient()->run($connections, $autorun);
} | php | public function run($autorun = true)
{
$this->setDependencyOverrides($this->config);
$this->getPlugins($this->config);
$connections = $this->getConnections($this->config);
$this->getClient()->run($connections, $autorun);
} | [
"public",
"function",
"run",
"(",
"$",
"autorun",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"setDependencyOverrides",
"(",
"$",
"this",
"->",
"config",
")",
";",
"$",
"this",
"->",
"getPlugins",
"(",
"$",
"this",
"->",
"config",
")",
";",
"$",
"conne... | Initiates an event loop for the bot in which it will connect to servers
and monitor those connections for events to forward to plugins.
@param bool $autorun
@throws \RuntimeException if configuration is inconsistent with
expected structure | [
"Initiates",
"an",
"event",
"loop",
"for",
"the",
"bot",
"in",
"which",
"it",
"will",
"connect",
"to",
"servers",
"and",
"monitor",
"those",
"connections",
"for",
"events",
"to",
"forward",
"to",
"plugins",
"."
] | 17745ef6b846513258af3dbd86e5612d3deb19b7 | https://github.com/phergie/phergie-irc-bot-react/blob/17745ef6b846513258af3dbd86e5612d3deb19b7/src/Bot.php#L234-L240 |
226,518 | phergie/phergie-irc-bot-react | src/Bot.php | Bot.setDependencyOverrides | protected function setDependencyOverrides(array $config)
{
if (isset($config['client'])) {
$this->setClient($config['client']);
}
if (isset($config['logger'])) {
$this->setLogger($config['logger']);
}
if (isset($config['parser'])) {
$this... | php | protected function setDependencyOverrides(array $config)
{
if (isset($config['client'])) {
$this->setClient($config['client']);
}
if (isset($config['logger'])) {
$this->setLogger($config['logger']);
}
if (isset($config['parser'])) {
$this... | [
"protected",
"function",
"setDependencyOverrides",
"(",
"array",
"$",
"config",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"config",
"[",
"'client'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"setClient",
"(",
"$",
"config",
"[",
"'client'",
"]",
")",
";",
... | Sets dependencies from configuration.
@param array $config | [
"Sets",
"dependencies",
"from",
"configuration",
"."
] | 17745ef6b846513258af3dbd86e5612d3deb19b7 | https://github.com/phergie/phergie-irc-bot-react/blob/17745ef6b846513258af3dbd86e5612d3deb19b7/src/Bot.php#L247-L268 |
226,519 | phergie/phergie-irc-bot-react | src/Bot.php | Bot.getConnections | protected function getConnections(array $config)
{
if (!isset($config['connections'])) {
throw new \RuntimeException('Configuration must contain a "connections" key');
}
if (!is_array($config['connections']) || !$config['connections']) {
throw new \RuntimeException('... | php | protected function getConnections(array $config)
{
if (!isset($config['connections'])) {
throw new \RuntimeException('Configuration must contain a "connections" key');
}
if (!is_array($config['connections']) || !$config['connections']) {
throw new \RuntimeException('... | [
"protected",
"function",
"getConnections",
"(",
"array",
"$",
"config",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"config",
"[",
"'connections'",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'Configuration must contain a \"connections\"... | Extracts connections from configuration.
@param array $config Associative array keyed by setting name
@return \Phergie\Irc\ConnectionInterface[] | [
"Extracts",
"connections",
"from",
"configuration",
"."
] | 17745ef6b846513258af3dbd86e5612d3deb19b7 | https://github.com/phergie/phergie-irc-bot-react/blob/17745ef6b846513258af3dbd86e5612d3deb19b7/src/Bot.php#L276-L299 |
226,520 | phergie/phergie-irc-bot-react | src/Bot.php | Bot.getPlugins | protected function getPlugins(array $config)
{
if (!isset($config['plugins'])) {
throw new \RuntimeException('Configuration must contain a "plugins" key');
}
if (!is_array($config['plugins'])) {
throw new \RuntimeException('Configuration "plugins" key must reference ... | php | protected function getPlugins(array $config)
{
if (!isset($config['plugins'])) {
throw new \RuntimeException('Configuration must contain a "plugins" key');
}
if (!is_array($config['plugins'])) {
throw new \RuntimeException('Configuration "plugins" key must reference ... | [
"protected",
"function",
"getPlugins",
"(",
"array",
"$",
"config",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"config",
"[",
"'plugins'",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'Configuration must contain a \"plugins\" key'",
")... | Extracts plugins from configuration.
@param array $config Associative array keyed by setting name
@throws \RuntimeException if any plugin event callback is invalid
@return \Phergie\Irc\Bot\React\PluginInterface[] | [
"Extracts",
"plugins",
"from",
"configuration",
"."
] | 17745ef6b846513258af3dbd86e5612d3deb19b7 | https://github.com/phergie/phergie-irc-bot-react/blob/17745ef6b846513258af3dbd86e5612d3deb19b7/src/Bot.php#L308-L336 |
226,521 | phergie/phergie-irc-bot-react | src/Bot.php | Bot.processPlugins | protected function processPlugins(array $plugins, array $processors, \SplObjectStorage $processedPlugins = null)
{
// Initialise store of already-processed plugins, to prevent container-based endless recursion
if ($processedPlugins === null) {
$processedPlugins = new \SplObjectStorage;
... | php | protected function processPlugins(array $plugins, array $processors, \SplObjectStorage $processedPlugins = null)
{
// Initialise store of already-processed plugins, to prevent container-based endless recursion
if ($processedPlugins === null) {
$processedPlugins = new \SplObjectStorage;
... | [
"protected",
"function",
"processPlugins",
"(",
"array",
"$",
"plugins",
",",
"array",
"$",
"processors",
",",
"\\",
"SplObjectStorage",
"$",
"processedPlugins",
"=",
"null",
")",
"{",
"// Initialise store of already-processed plugins, to prevent container-based endless recur... | Processes a list of plugins for use.
@param \Phergie\Irc\Bot\React\PluginInterface[]
@param \Phergie\Irc\Bot\React\PluginProcessor\PluginProcessorInterface[]
@param \SplObjectStorage $processedPlugins | [
"Processes",
"a",
"list",
"of",
"plugins",
"for",
"use",
"."
] | 17745ef6b846513258af3dbd86e5612d3deb19b7 | https://github.com/phergie/phergie-irc-bot-react/blob/17745ef6b846513258af3dbd86e5612d3deb19b7/src/Bot.php#L345-L363 |
226,522 | phergie/phergie-irc-bot-react | src/Bot.php | Bot.getPluginProcessors | protected function getPluginProcessors(array $config)
{
$processors = isset($config['pluginProcessors'])
? $config['pluginProcessors']
: $this->getDefaultPluginProcessors();
if (!is_array($processors)) {
throw new \RuntimeException('Configuration "pluginProcessor... | php | protected function getPluginProcessors(array $config)
{
$processors = isset($config['pluginProcessors'])
? $config['pluginProcessors']
: $this->getDefaultPluginProcessors();
if (!is_array($processors)) {
throw new \RuntimeException('Configuration "pluginProcessor... | [
"protected",
"function",
"getPluginProcessors",
"(",
"array",
"$",
"config",
")",
"{",
"$",
"processors",
"=",
"isset",
"(",
"$",
"config",
"[",
"'pluginProcessors'",
"]",
")",
"?",
"$",
"config",
"[",
"'pluginProcessors'",
"]",
":",
"$",
"this",
"->",
"ge... | Returns a list of processors for plugins.
@param array $config Associative array keyed by setting name | [
"Returns",
"a",
"list",
"of",
"processors",
"for",
"plugins",
"."
] | 17745ef6b846513258af3dbd86e5612d3deb19b7 | https://github.com/phergie/phergie-irc-bot-react/blob/17745ef6b846513258af3dbd86e5612d3deb19b7/src/Bot.php#L370-L396 |
226,523 | phergie/phergie-irc-bot-react | src/Bot.php | Bot.validatePluginEvents | protected function validatePluginEvents(PluginInterface $plugin)
{
$events = $plugin->getSubscribedEvents();
if (!is_array($events)) {
throw new \RuntimeException(
'Plugin of class ' . get_class($plugin) .
' has getSubscribedEvents() implementation' .
... | php | protected function validatePluginEvents(PluginInterface $plugin)
{
$events = $plugin->getSubscribedEvents();
if (!is_array($events)) {
throw new \RuntimeException(
'Plugin of class ' . get_class($plugin) .
' has getSubscribedEvents() implementation' .
... | [
"protected",
"function",
"validatePluginEvents",
"(",
"PluginInterface",
"$",
"plugin",
")",
"{",
"$",
"events",
"=",
"$",
"plugin",
"->",
"getSubscribedEvents",
"(",
")",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"events",
")",
")",
"{",
"throw",
"new",
... | Validates a plugin's event callbacks.
@param \Phergie\Irc\Bot\React\PluginInterface $plugin
@throws \RuntimeException if any event callback is invalid | [
"Validates",
"a",
"plugin",
"s",
"event",
"callbacks",
"."
] | 17745ef6b846513258af3dbd86e5612d3deb19b7 | https://github.com/phergie/phergie-irc-bot-react/blob/17745ef6b846513258af3dbd86e5612d3deb19b7/src/Bot.php#L423-L444 |
226,524 | phergie/phergie-irc-bot-react | src/Bot.php | Bot.registerClientSubscribers | protected function registerClientSubscribers(ClientInterface $client)
{
$client->on('irc.received', function ($message, $write, $connection) {
$this->processClientEvent('irc.received', $message, $connection, $write);
});
$client->on('irc.sent', function ($message, $write, $conne... | php | protected function registerClientSubscribers(ClientInterface $client)
{
$client->on('irc.received', function ($message, $write, $connection) {
$this->processClientEvent('irc.received', $message, $connection, $write);
});
$client->on('irc.sent', function ($message, $write, $conne... | [
"protected",
"function",
"registerClientSubscribers",
"(",
"ClientInterface",
"$",
"client",
")",
"{",
"$",
"client",
"->",
"on",
"(",
"'irc.received'",
",",
"function",
"(",
"$",
"message",
",",
"$",
"write",
",",
"$",
"connection",
")",
"{",
"$",
"this",
... | Configures the client to emit events for specific types of messages.
@param \Phergie\Irc\Client\React\ClientInterface $client Client for
which to configure events | [
"Configures",
"the",
"client",
"to",
"emit",
"events",
"for",
"specific",
"types",
"of",
"messages",
"."
] | 17745ef6b846513258af3dbd86e5612d3deb19b7 | https://github.com/phergie/phergie-irc-bot-react/blob/17745ef6b846513258af3dbd86e5612d3deb19b7/src/Bot.php#L452-L469 |
226,525 | phergie/phergie-irc-bot-react | src/Bot.php | Bot.processClientEvent | public function processClientEvent($event, array $message, ConnectionInterface $connection, WriteStream $write)
{
$converter = $this->getConverter();
$converted = $converter->convert($message);
$converted->setConnection($connection);
$client = $this->getClient();
$queue = $t... | php | public function processClientEvent($event, array $message, ConnectionInterface $connection, WriteStream $write)
{
$converter = $this->getConverter();
$converted = $converter->convert($message);
$converted->setConnection($connection);
$client = $this->getClient();
$queue = $t... | [
"public",
"function",
"processClientEvent",
"(",
"$",
"event",
",",
"array",
"$",
"message",
",",
"ConnectionInterface",
"$",
"connection",
",",
"WriteStream",
"$",
"write",
")",
"{",
"$",
"converter",
"=",
"$",
"this",
"->",
"getConverter",
"(",
")",
";",
... | Callback to process client events. Not intended to be called from
outside this class.
@param string $event Received client event
@param array $message Parsed message
@param \Phergie\Irc\ConnectionInterface $connection Connection on which
the event occurred
@param \Phergie\Irc\Client\React\WriteStream $write Stream use... | [
"Callback",
"to",
"process",
"client",
"events",
".",
"Not",
"intended",
"to",
"be",
"called",
"from",
"outside",
"this",
"class",
"."
] | 17745ef6b846513258af3dbd86e5612d3deb19b7 | https://github.com/phergie/phergie-irc-bot-react/blob/17745ef6b846513258af3dbd86e5612d3deb19b7/src/Bot.php#L482-L496 |
226,526 | phergie/phergie-irc-bot-react | src/Bot.php | Bot.processOutgoingEvents | public function processOutgoingEvents(ConnectionInterface $connection, WriteStream $write)
{
$client = $this->getClient();
$queue = $this->getEventQueueFactory()->getEventQueue($connection);
$client->emit('irc.sending.all', [ $queue ]);
while ($extracted = $queue->extract()) {
... | php | public function processOutgoingEvents(ConnectionInterface $connection, WriteStream $write)
{
$client = $this->getClient();
$queue = $this->getEventQueueFactory()->getEventQueue($connection);
$client->emit('irc.sending.all', [ $queue ]);
while ($extracted = $queue->extract()) {
... | [
"public",
"function",
"processOutgoingEvents",
"(",
"ConnectionInterface",
"$",
"connection",
",",
"WriteStream",
"$",
"write",
")",
"{",
"$",
"client",
"=",
"$",
"this",
"->",
"getClient",
"(",
")",
";",
"$",
"queue",
"=",
"$",
"this",
"->",
"getEventQueueF... | Callback to process any queued outgoing events. Not intended to be
called from outside thie class.
@param \Phergie\Irc\ConnectionInterface $connection Connection on which
the event occurred
@param \Phergie\Irc\Client\React\WriteStream $write Stream used to send
commands to the server | [
"Callback",
"to",
"process",
"any",
"queued",
"outgoing",
"events",
".",
"Not",
"intended",
"to",
"be",
"called",
"from",
"outside",
"thie",
"class",
"."
] | 17745ef6b846513258af3dbd86e5612d3deb19b7 | https://github.com/phergie/phergie-irc-bot-react/blob/17745ef6b846513258af3dbd86e5612d3deb19b7/src/Bot.php#L507-L533 |
226,527 | phergie/phergie-irc-bot-react | src/Bot.php | Bot.getEventSubtype | protected function getEventSubtype(EventInterface $event)
{
$subevent = '';
if ($event instanceof CtcpEvent) {
$subevent = 'ctcp.' . strtolower($event->getCtcpCommand());
} elseif ($event instanceof UserEvent) {
$subevent = strtolower($event->getCommand());
} ... | php | protected function getEventSubtype(EventInterface $event)
{
$subevent = '';
if ($event instanceof CtcpEvent) {
$subevent = 'ctcp.' . strtolower($event->getCtcpCommand());
} elseif ($event instanceof UserEvent) {
$subevent = strtolower($event->getCommand());
} ... | [
"protected",
"function",
"getEventSubtype",
"(",
"EventInterface",
"$",
"event",
")",
"{",
"$",
"subevent",
"=",
"''",
";",
"if",
"(",
"$",
"event",
"instanceof",
"CtcpEvent",
")",
"{",
"$",
"subevent",
"=",
"'ctcp.'",
".",
"strtolower",
"(",
"$",
"event",... | Returns an event subtype corresponding to a given event object, used to
generate event names when emitting events.
@param \Phergie\Irc\Event\EventInterface $event
@return string | [
"Returns",
"an",
"event",
"subtype",
"corresponding",
"to",
"a",
"given",
"event",
"object",
"used",
"to",
"generate",
"event",
"names",
"when",
"emitting",
"events",
"."
] | 17745ef6b846513258af3dbd86e5612d3deb19b7 | https://github.com/phergie/phergie-irc-bot-react/blob/17745ef6b846513258af3dbd86e5612d3deb19b7/src/Bot.php#L542-L553 |
226,528 | phergie/phergie-irc-bot-react | src/Bot.php | Bot.registerPluginSubscribers | protected function registerPluginSubscribers(array $plugins)
{
$client = $this->getClient();
foreach ($plugins as $plugin) {
$this->validatePluginEvents($plugin);
$callbacks = $plugin->getSubscribedEvents();
foreach ($callbacks as $event => $callback) {
... | php | protected function registerPluginSubscribers(array $plugins)
{
$client = $this->getClient();
foreach ($plugins as $plugin) {
$this->validatePluginEvents($plugin);
$callbacks = $plugin->getSubscribedEvents();
foreach ($callbacks as $event => $callback) {
... | [
"protected",
"function",
"registerPluginSubscribers",
"(",
"array",
"$",
"plugins",
")",
"{",
"$",
"client",
"=",
"$",
"this",
"->",
"getClient",
"(",
")",
";",
"foreach",
"(",
"$",
"plugins",
"as",
"$",
"plugin",
")",
"{",
"$",
"this",
"->",
"validatePl... | Registers event callbacks from plugins.
@param \Phergie\Irc\Bot\React\PluginInterface[] $plugins Plugins from
which to get callbacks | [
"Registers",
"event",
"callbacks",
"from",
"plugins",
"."
] | 17745ef6b846513258af3dbd86e5612d3deb19b7 | https://github.com/phergie/phergie-irc-bot-react/blob/17745ef6b846513258af3dbd86e5612d3deb19b7/src/Bot.php#L561-L575 |
226,529 | gigaai/framework | src/Storage/Eloquent/HasMeta.php | HasMeta.getMeta | public function getMeta($key = null, $default = null)
{
if ($key === null) {
return $this->meta;
}
return isset($this->meta[$key]) ? $this->meta[$key] : $default;
} | php | public function getMeta($key = null, $default = null)
{
if ($key === null) {
return $this->meta;
}
return isset($this->meta[$key]) ? $this->meta[$key] : $default;
} | [
"public",
"function",
"getMeta",
"(",
"$",
"key",
"=",
"null",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"key",
"===",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"meta",
";",
"}",
"return",
"isset",
"(",
"$",
"this",
"->",
... | Get Meta Data
@param String $key Meta Key
@param Mixed $default Default value
@return mixed | [
"Get",
"Meta",
"Data"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Storage/Eloquent/HasMeta.php#L32-L39 |
226,530 | snowplow-archive/symfony2-paypal-ipn | src/Orderly/PayPalIpnBundle/Document/IpnOrderItems.php | IpnOrderItems.setUpdatedAtValue | public function setUpdatedAtValue(\DateTime $updatedAt = null)
{
if($updatedAt==null && $this->updatedAt == null){
$this->updatedAt = new \DateTime();
}else if($updatedAt instanceof \DateTime){
$this->updatedAt = $updatedAt;
}else{
$this->updatedAt = new \... | php | public function setUpdatedAtValue(\DateTime $updatedAt = null)
{
if($updatedAt==null && $this->updatedAt == null){
$this->updatedAt = new \DateTime();
}else if($updatedAt instanceof \DateTime){
$this->updatedAt = $updatedAt;
}else{
$this->updatedAt = new \... | [
"public",
"function",
"setUpdatedAtValue",
"(",
"\\",
"DateTime",
"$",
"updatedAt",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"updatedAt",
"==",
"null",
"&&",
"$",
"this",
"->",
"updatedAt",
"==",
"null",
")",
"{",
"$",
"this",
"->",
"updatedAt",
"=",
"ne... | PrePersist and PreUpdate UpdatedAt-Value
@MongoDB\PreUpdate
@MongoDB\PrePersist | [
"PrePersist",
"and",
"PreUpdate",
"UpdatedAt",
"-",
"Value"
] | e46d947cda5a11743ff1e215846e7d06ac939d42 | https://github.com/snowplow-archive/symfony2-paypal-ipn/blob/e46d947cda5a11743ff1e215846e7d06ac939d42/src/Orderly/PayPalIpnBundle/Document/IpnOrderItems.php#L775-L784 |
226,531 | loco/swizzle | src/ModelCollection.php | ModelCollection.has | public function has($key)
{
return isset($this->data[$key]) || array_key_exists($key, $this->data);
} | php | public function has($key)
{
return isset($this->data[$key]) || array_key_exists($key, $this->data);
} | [
"public",
"function",
"has",
"(",
"$",
"key",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"data",
"[",
"$",
"key",
"]",
")",
"||",
"array_key_exists",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"data",
")",
";",
"}"
] | Test if key was found in original JSON, even if empty
@param string $key
@return bool | [
"Test",
"if",
"key",
"was",
"found",
"in",
"original",
"JSON",
"even",
"if",
"empty"
] | 539db44bc2341f3da403582052b770686c86a516 | https://github.com/loco/swizzle/blob/539db44bc2341f3da403582052b770686c86a516/src/ModelCollection.php#L72-L75 |
226,532 | gigaai/framework | src/Broadcast/Channel.php | Channel.create | public function create($name)
{
$response = giga_facebook_post('me/custom_labels', compact('name'));
if (isset($response->error)) {
$message = isset($response->error->error_user_msg) ? $response->error->error_user_msg : $response->message;
throw new \Exception($message);
... | php | public function create($name)
{
$response = giga_facebook_post('me/custom_labels', compact('name'));
if (isset($response->error)) {
$message = isset($response->error->error_user_msg) ? $response->error->error_user_msg : $response->message;
throw new \Exception($message);
... | [
"public",
"function",
"create",
"(",
"$",
"name",
")",
"{",
"$",
"response",
"=",
"giga_facebook_post",
"(",
"'me/custom_labels'",
",",
"compact",
"(",
"'name'",
")",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"response",
"->",
"error",
")",
")",
"{",
"$"... | Create new Facebook Label
@param String $name
@return Label ID | [
"Create",
"new",
"Facebook",
"Label"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Broadcast/Channel.php#L13-L25 |
226,533 | gigaai/framework | src/Broadcast/Channel.php | Channel.addLead | public function addLead($labelId, $leadId)
{
$response = giga_facebook_post($labelId . '/label', [
'user' => $leadId
]);
return isset($response->success);
} | php | public function addLead($labelId, $leadId)
{
$response = giga_facebook_post($labelId . '/label', [
'user' => $leadId
]);
return isset($response->success);
} | [
"public",
"function",
"addLead",
"(",
"$",
"labelId",
",",
"$",
"leadId",
")",
"{",
"$",
"response",
"=",
"giga_facebook_post",
"(",
"$",
"labelId",
".",
"'/label'",
",",
"[",
"'user'",
"=>",
"$",
"leadId",
"]",
")",
";",
"return",
"isset",
"(",
"$",
... | Add lead to Facebook label
@return bool | [
"Add",
"lead",
"to",
"Facebook",
"label"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Broadcast/Channel.php#L32-L39 |
226,534 | gigaai/framework | src/Broadcast/Channel.php | Channel.addLeads | public function addLeads($labelId, array $leadIds)
{
$batch = [];
foreach ($leadIds as $user) {
$batch[] = [
'method' => 'POST',
'relative_url' => $labelId . '/label',
'body' => http_build_query(compact('user'))
];
}
... | php | public function addLeads($labelId, array $leadIds)
{
$batch = [];
foreach ($leadIds as $user) {
$batch[] = [
'method' => 'POST',
'relative_url' => $labelId . '/label',
'body' => http_build_query(compact('user'))
];
}
... | [
"public",
"function",
"addLeads",
"(",
"$",
"labelId",
",",
"array",
"$",
"leadIds",
")",
"{",
"$",
"batch",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"leadIds",
"as",
"$",
"user",
")",
"{",
"$",
"batch",
"[",
"]",
"=",
"[",
"'method'",
"=>",
"'PO... | Add many leads to Facebook Label | [
"Add",
"many",
"leads",
"to",
"Facebook",
"Label"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Broadcast/Channel.php#L44-L59 |
226,535 | gigaai/framework | src/Broadcast/Channel.php | Channel.removeLead | public function removeLead($labelId, $leadId)
{
$response = giga_facebook_delete($labelId . '/label', [
'user' => $leadId
]);
return isset($response->success);
} | php | public function removeLead($labelId, $leadId)
{
$response = giga_facebook_delete($labelId . '/label', [
'user' => $leadId
]);
return isset($response->success);
} | [
"public",
"function",
"removeLead",
"(",
"$",
"labelId",
",",
"$",
"leadId",
")",
"{",
"$",
"response",
"=",
"giga_facebook_delete",
"(",
"$",
"labelId",
".",
"'/label'",
",",
"[",
"'user'",
"=>",
"$",
"leadId",
"]",
")",
";",
"return",
"isset",
"(",
"... | Remove lead from FB label
@return bool | [
"Remove",
"lead",
"from",
"FB",
"label"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Broadcast/Channel.php#L66-L73 |
226,536 | gigaai/framework | src/Broadcast/Channel.php | Channel.ofLead | public function ofLead($leadId)
{
$response = giga_facebook_get($leadId . '/custom_labels');
if (!isset($response->data) || !is_array($response->data)) {
return false;
}
$channels = $response->data;
$channelIds = [];
foreach ($channels as $channel) {
... | php | public function ofLead($leadId)
{
$response = giga_facebook_get($leadId . '/custom_labels');
if (!isset($response->data) || !is_array($response->data)) {
return false;
}
$channels = $response->data;
$channelIds = [];
foreach ($channels as $channel) {
... | [
"public",
"function",
"ofLead",
"(",
"$",
"leadId",
")",
"{",
"$",
"response",
"=",
"giga_facebook_get",
"(",
"$",
"leadId",
".",
"'/custom_labels'",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"response",
"->",
"data",
")",
"||",
"!",
"is_array",
"("... | Get all labels of lead
@return mixed | [
"Get",
"all",
"labels",
"of",
"lead"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Broadcast/Channel.php#L96-L112 |
226,537 | gigaai/framework | src/Broadcast/Channel.php | Channel.all | public function all()
{
$response = giga_facebook_get('/me/custom_labels?fields=name');
$channels = [];
foreach ($response->data as $channel) {
$channels[$channel->id] = $channel->name;
}
return $channels; // [id => name]
} | php | public function all()
{
$response = giga_facebook_get('/me/custom_labels?fields=name');
$channels = [];
foreach ($response->data as $channel) {
$channels[$channel->id] = $channel->name;
}
return $channels; // [id => name]
} | [
"public",
"function",
"all",
"(",
")",
"{",
"$",
"response",
"=",
"giga_facebook_get",
"(",
"'/me/custom_labels?fields=name'",
")",
";",
"$",
"channels",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"response",
"->",
"data",
"as",
"$",
"channel",
")",
"{",
"... | Get all label of a page
@return array | [
"Get",
"all",
"label",
"of",
"a",
"page"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Broadcast/Channel.php#L131-L141 |
226,538 | pug-php/js-phpize | src/JsPhpize/Lexer/Lexer.php | Lexer.unexpected | public function unexpected($token, $className = '\\JsPhpize\\Lexer\\Exception')
{
return new $className('Unexpected ' . $token->type . rtrim(' ' . ($token->value ?: '')) . $this->exceptionInfos(), 8);
} | php | public function unexpected($token, $className = '\\JsPhpize\\Lexer\\Exception')
{
return new $className('Unexpected ' . $token->type . rtrim(' ' . ($token->value ?: '')) . $this->exceptionInfos(), 8);
} | [
"public",
"function",
"unexpected",
"(",
"$",
"token",
",",
"$",
"className",
"=",
"'\\\\JsPhpize\\\\Lexer\\\\Exception'",
")",
"{",
"return",
"new",
"$",
"className",
"(",
"'Unexpected '",
".",
"$",
"token",
"->",
"type",
".",
"rtrim",
"(",
"' '",
".",
"(",... | Return a unexpected exception for a given token.
@param $token
@return Exception | [
"Return",
"a",
"unexpected",
"exception",
"for",
"a",
"given",
"token",
"."
] | c41102da1be243ba9439b90af8b7032016585537 | https://github.com/pug-php/js-phpize/blob/c41102da1be243ba9439b90af8b7032016585537/src/JsPhpize/Lexer/Lexer.php#L109-L112 |
226,539 | loco/swizzle | src/Result/BaseResponse.php | BaseResponse.getApiPaths | public function getApiPaths()
{
$paths = [];
if ($apis = $this->get('apis')) {
foreach ($apis as $api) {
if (isset($api['path'])) {
$paths[] = $api['path'];
}
}
}
return $paths;
} | php | public function getApiPaths()
{
$paths = [];
if ($apis = $this->get('apis')) {
foreach ($apis as $api) {
if (isset($api['path'])) {
$paths[] = $api['path'];
}
}
}
return $paths;
} | [
"public",
"function",
"getApiPaths",
"(",
")",
"{",
"$",
"paths",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"apis",
"=",
"$",
"this",
"->",
"get",
"(",
"'apis'",
")",
")",
"{",
"foreach",
"(",
"$",
"apis",
"as",
"$",
"api",
")",
"{",
"if",
"(",
"is... | Get all path strings in objects under apis
@return array | [
"Get",
"all",
"path",
"strings",
"in",
"objects",
"under",
"apis"
] | 539db44bc2341f3da403582052b770686c86a516 | https://github.com/loco/swizzle/blob/539db44bc2341f3da403582052b770686c86a516/src/Result/BaseResponse.php#L71-L82 |
226,540 | gigaai/framework | src/Conversation/Nlp.php | Nlp.filter | public function filter($filter)
{
preg_match_all("/(#\w+)/", $filter, $entityNames);
preg_match_all("/(:\w+)/", $filter, $positions);
$entityName = is_array($entityNames[0]) && isset($entityNames[0][0]) ? ltrim($entityNames[0][0], '#') : null;
$position = is_array($positions[0]) &... | php | public function filter($filter)
{
preg_match_all("/(#\w+)/", $filter, $entityNames);
preg_match_all("/(:\w+)/", $filter, $positions);
$entityName = is_array($entityNames[0]) && isset($entityNames[0][0]) ? ltrim($entityNames[0][0], '#') : null;
$position = is_array($positions[0]) &... | [
"public",
"function",
"filter",
"(",
"$",
"filter",
")",
"{",
"preg_match_all",
"(",
"\"/(#\\w+)/\"",
",",
"$",
"filter",
",",
"$",
"entityNames",
")",
";",
"preg_match_all",
"(",
"\"/(:\\w+)/\"",
",",
"$",
"filter",
",",
"$",
"positions",
")",
";",
"$",
... | Get entities by their name or position
@param null $filter
@return Nlp | [
"Get",
"entities",
"by",
"their",
"name",
"or",
"position"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Conversation/Nlp.php#L52-L83 |
226,541 | gigaai/framework | src/Conversation/Nlp.php | Nlp.get | public function get($field)
{
if (!is_null($this->filtered) && ! is_null($this->filtered[0])) {
return isset($this->filtered[0][0][$field]) ? $this->filtered[0][0][$field] : null;
}
// Todo: Get values of entities
} | php | public function get($field)
{
if (!is_null($this->filtered) && ! is_null($this->filtered[0])) {
return isset($this->filtered[0][0][$field]) ? $this->filtered[0][0][$field] : null;
}
// Todo: Get values of entities
} | [
"public",
"function",
"get",
"(",
"$",
"field",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
"->",
"filtered",
")",
"&&",
"!",
"is_null",
"(",
"$",
"this",
"->",
"filtered",
"[",
"0",
"]",
")",
")",
"{",
"return",
"isset",
"(",
"$",
"... | Get a fields value
@param $field
@return mixed | [
"Get",
"a",
"fields",
"value"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Conversation/Nlp.php#L139-L146 |
226,542 | snowplow-archive/symfony2-paypal-ipn | src/Orderly/PayPalIpnBundle/Pdt.php | Pdt.getPdt | public function getPdt($transactionID)
{
$this->transactionID = $transactionID;
// Now we need to ask PayPal to tell us if it sent this notification
$pdtResponse = $this->_postData($this->pdtURL, array('cmd' => '_notify-synch', 'tx' => $transactionID, 'at' => $this->pdtToken));
... | php | public function getPdt($transactionID)
{
$this->transactionID = $transactionID;
// Now we need to ask PayPal to tell us if it sent this notification
$pdtResponse = $this->_postData($this->pdtURL, array('cmd' => '_notify-synch', 'tx' => $transactionID, 'at' => $this->pdtToken));
... | [
"public",
"function",
"getPdt",
"(",
"$",
"transactionID",
")",
"{",
"$",
"this",
"->",
"transactionID",
"=",
"$",
"transactionID",
";",
"// Now we need to ask PayPal to tell us if it sent this notification",
"$",
"pdtResponse",
"=",
"$",
"this",
"->",
"_postData",
"(... | The key functionality in this library. Gets the data from Paypal with a transaction id obtained from an IPN call.
@param string $transactionID Transaction Id returned from an IPN call.
@return array | [
"The",
"key",
"functionality",
"in",
"this",
"library",
".",
"Gets",
"the",
"data",
"from",
"Paypal",
"with",
"a",
"transaction",
"id",
"obtained",
"from",
"an",
"IPN",
"call",
"."
] | e46d947cda5a11743ff1e215846e7d06ac939d42 | https://github.com/snowplow-archive/symfony2-paypal-ipn/blob/e46d947cda5a11743ff1e215846e7d06ac939d42/src/Orderly/PayPalIpnBundle/Pdt.php#L58-L71 |
226,543 | snowplow-archive/symfony2-paypal-ipn | src/Orderly/PayPalIpnBundle/Pdt.php | Pdt._postData | function _postData($url, $postData)
{
if ($this->mockResponse !== null) {
return $this->mockResponse;
}
// Put the postData into a string
$postString = '';
foreach ($postData as $field => $value) {
$postString .= $field . '=' . urlencode(stripslashes(... | php | function _postData($url, $postData)
{
if ($this->mockResponse !== null) {
return $this->mockResponse;
}
// Put the postData into a string
$postString = '';
foreach ($postData as $field => $value) {
$postString .= $field . '=' . urlencode(stripslashes(... | [
"function",
"_postData",
"(",
"$",
"url",
",",
"$",
"postData",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"mockResponse",
"!==",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"mockResponse",
";",
"}",
"// Put the postData into a string",
"$",
"postString",
... | Sending data to PayPal PDT service
@param string $url
@param array $postData
@return string | [
"Sending",
"data",
"to",
"PayPal",
"PDT",
"service"
] | e46d947cda5a11743ff1e215846e7d06ac939d42 | https://github.com/snowplow-archive/symfony2-paypal-ipn/blob/e46d947cda5a11743ff1e215846e7d06ac939d42/src/Orderly/PayPalIpnBundle/Pdt.php#L81-L142 |
226,544 | johannesschobel/dingoquerymapper | src/JohannesSchobel/DingoQueryMapper/Parser/DingoQueryMapper.php | DingoQueryMapper.createFromCollection | public function createFromCollection(Collection $collection)
{
$this->operator = new CollectionOperator($collection, $this->request);
$this->prepare();
return $this;
} | php | public function createFromCollection(Collection $collection)
{
$this->operator = new CollectionOperator($collection, $this->request);
$this->prepare();
return $this;
} | [
"public",
"function",
"createFromCollection",
"(",
"Collection",
"$",
"collection",
")",
"{",
"$",
"this",
"->",
"operator",
"=",
"new",
"CollectionOperator",
"(",
"$",
"collection",
",",
"$",
"this",
"->",
"request",
")",
";",
"$",
"this",
"->",
"prepare",
... | Create the result based on a collection
@param Collection $collection
@return $this | [
"Create",
"the",
"result",
"based",
"on",
"a",
"collection"
] | 0ae2c1a0b5e7e7cf405ced9ced605907a5809c0e | https://github.com/johannesschobel/dingoquerymapper/blob/0ae2c1a0b5e7e7cf405ced9ced605907a5809c0e/src/JohannesSchobel/DingoQueryMapper/Parser/DingoQueryMapper.php#L54-L60 |
226,545 | johannesschobel/dingoquerymapper | src/JohannesSchobel/DingoQueryMapper/Parser/DingoQueryMapper.php | DingoQueryMapper.filter | private function filter()
{
if ($this->allowsFilter()) {
if ($this->hasFilters()) {
$tmp = [];
foreach ($this->filters as $filter) {
// check, if it is a "forbidden" query parameter
if ($this->isExcludedParameter($filter['ke... | php | private function filter()
{
if ($this->allowsFilter()) {
if ($this->hasFilters()) {
$tmp = [];
foreach ($this->filters as $filter) {
// check, if it is a "forbidden" query parameter
if ($this->isExcludedParameter($filter['ke... | [
"private",
"function",
"filter",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"allowsFilter",
"(",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasFilters",
"(",
")",
")",
"{",
"$",
"tmp",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",... | Filter the result. Operator implements actual logic.
@return mixed | [
"Filter",
"the",
"result",
".",
"Operator",
"implements",
"actual",
"logic",
"."
] | 0ae2c1a0b5e7e7cf405ced9ced605907a5809c0e | https://github.com/johannesschobel/dingoquerymapper/blob/0ae2c1a0b5e7e7cf405ced9ced605907a5809c0e/src/JohannesSchobel/DingoQueryMapper/Parser/DingoQueryMapper.php#L83-L101 |
226,546 | johannesschobel/dingoquerymapper | src/JohannesSchobel/DingoQueryMapper/Parser/DingoQueryMapper.php | DingoQueryMapper.prepareConstant | private function prepareConstant($parameter)
{
if (!$this->uriParser->hasQueryParameter($parameter)) {
return;
}
$callback = [$this, $this->setterMethodName($parameter)];
$callbackParameter = $this->uriParser->queryParameter($parameter);
call_user_func($callback... | php | private function prepareConstant($parameter)
{
if (!$this->uriParser->hasQueryParameter($parameter)) {
return;
}
$callback = [$this, $this->setterMethodName($parameter)];
$callbackParameter = $this->uriParser->queryParameter($parameter);
call_user_func($callback... | [
"private",
"function",
"prepareConstant",
"(",
"$",
"parameter",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"uriParser",
"->",
"hasQueryParameter",
"(",
"$",
"parameter",
")",
")",
"{",
"return",
";",
"}",
"$",
"callback",
"=",
"[",
"$",
"this",
",",... | Calls respective setXXX Method for the predefined parameters
@param $parameter | [
"Calls",
"respective",
"setXXX",
"Method",
"for",
"the",
"predefined",
"parameters"
] | 0ae2c1a0b5e7e7cf405ced9ced605907a5809c0e | https://github.com/johannesschobel/dingoquerymapper/blob/0ae2c1a0b5e7e7cf405ced9ced605907a5809c0e/src/JohannesSchobel/DingoQueryMapper/Parser/DingoQueryMapper.php#L138-L148 |
226,547 | netgen/NetgenEzFormsBundle | bundle/Form/DataMapper.php | DataMapper.shouldSkipForEmptyUpdate | protected function shouldSkipForEmptyUpdate(FormInterface $form, $value, $fieldDefinitionIdentifier)
{
return
$value === null &&
(
$form->getRoot()->has("ezforms_skip_empty_update_{$fieldDefinitionIdentifier}") &&
$form->getRoot()->get("ezforms_skip_em... | php | protected function shouldSkipForEmptyUpdate(FormInterface $form, $value, $fieldDefinitionIdentifier)
{
return
$value === null &&
(
$form->getRoot()->has("ezforms_skip_empty_update_{$fieldDefinitionIdentifier}") &&
$form->getRoot()->get("ezforms_skip_em... | [
"protected",
"function",
"shouldSkipForEmptyUpdate",
"(",
"FormInterface",
"$",
"form",
",",
"$",
"value",
",",
"$",
"fieldDefinitionIdentifier",
")",
"{",
"return",
"$",
"value",
"===",
"null",
"&&",
"(",
"$",
"form",
"->",
"getRoot",
"(",
")",
"->",
"has",... | Returns if the update should be skipped for empty value.
@param \Symfony\Component\Form\FormInterface $form
@param mixed $value
@param string $fieldDefinitionIdentifier
@return bool | [
"Returns",
"if",
"the",
"update",
"should",
"be",
"skipped",
"for",
"empty",
"value",
"."
] | c4d2355e14a41353ac40eafc386f203b3d94ea9e | https://github.com/netgen/NetgenEzFormsBundle/blob/c4d2355e14a41353ac40eafc386f203b3d94ea9e/bundle/Form/DataMapper.php#L164-L173 |
226,548 | gigaai/framework | src/Shortcodes/PostGeneric.php | PostGeneric.parse_query_args | private function parse_query_args( $atts )
{
// If is json. Parse it!
if ( ! is_array( $atts['query_args'] ) ) {
$arr = @json_decode( $atts['query_args'], true );
if ( is_array( $arr ) ) {
$atts['query_args'] = $arr;
}
}
$query_ar... | php | private function parse_query_args( $atts )
{
// If is json. Parse it!
if ( ! is_array( $atts['query_args'] ) ) {
$arr = @json_decode( $atts['query_args'], true );
if ( is_array( $arr ) ) {
$atts['query_args'] = $arr;
}
}
$query_ar... | [
"private",
"function",
"parse_query_args",
"(",
"$",
"atts",
")",
"{",
"// If is json. Parse it!",
"if",
"(",
"!",
"is_array",
"(",
"$",
"atts",
"[",
"'query_args'",
"]",
")",
")",
"{",
"$",
"arr",
"=",
"@",
"json_decode",
"(",
"$",
"atts",
"[",
"'query_... | Parse simple query args.
@param $atts
@return array|mixed|object | [
"Parse",
"simple",
"query",
"args",
"."
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Shortcodes/PostGeneric.php#L139-L163 |
226,549 | egeriis/laravel-jsonapi | src/EchoIt/JsonApi/Response.php | Response.toJsonResponse | public function toJsonResponse($bodyKey = 'data', $options = 0)
{
return new JsonResponse(array_merge(
[ $bodyKey => $this->body ],
array_filter($this->responseData)
), $this->httpStatusCode, ['Content-Type' => 'application/vnd.api+json'], $options);
} | php | public function toJsonResponse($bodyKey = 'data', $options = 0)
{
return new JsonResponse(array_merge(
[ $bodyKey => $this->body ],
array_filter($this->responseData)
), $this->httpStatusCode, ['Content-Type' => 'application/vnd.api+json'], $options);
} | [
"public",
"function",
"toJsonResponse",
"(",
"$",
"bodyKey",
"=",
"'data'",
",",
"$",
"options",
"=",
"0",
")",
"{",
"return",
"new",
"JsonResponse",
"(",
"array_merge",
"(",
"[",
"$",
"bodyKey",
"=>",
"$",
"this",
"->",
"body",
"]",
",",
"array_filter",... | Returns a JsonResponse with the set parameters and body.
@param string $bodyKey The key on which to set the main response.
@return \Illuminate\Http\JsonResponse | [
"Returns",
"a",
"JsonResponse",
"with",
"the",
"set",
"parameters",
"and",
"body",
"."
] | 6d58e14cba26c0624d38f75273cff86fd4678289 | https://github.com/egeriis/laravel-jsonapi/blob/6d58e14cba26c0624d38f75273cff86fd4678289/src/EchoIt/JsonApi/Response.php#L66-L72 |
226,550 | Gameye/gameye-sdk-php | src/sdk/GameyeSelector.php | GameyeSelector.selectMatchList | public static function selectMatchList(
$matchState
) {
$matchState = (object) $matchState;
$matchList = [];
foreach ($matchState->match as $matchKey => $matchItem) {
$matchList[$matchKey] = $matchItem;
}
return $matchList;
} | php | public static function selectMatchList(
$matchState
) {
$matchState = (object) $matchState;
$matchList = [];
foreach ($matchState->match as $matchKey => $matchItem) {
$matchList[$matchKey] = $matchItem;
}
return $matchList;
} | [
"public",
"static",
"function",
"selectMatchList",
"(",
"$",
"matchState",
")",
"{",
"$",
"matchState",
"=",
"(",
"object",
")",
"$",
"matchState",
";",
"$",
"matchList",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"matchState",
"->",
"match",
"as",
"$",
... | Select a list of active matches.
@param object $matchState
@return array | [
"Select",
"a",
"list",
"of",
"active",
"matches",
"."
] | 71ed33f411e58eb4ef23cb8317825a0d3113c5f0 | https://github.com/Gameye/gameye-sdk-php/blob/71ed33f411e58eb4ef23cb8317825a0d3113c5f0/src/sdk/GameyeSelector.php#L23-L34 |
226,551 | Gameye/gameye-sdk-php | src/sdk/GameyeSelector.php | GameyeSelector.selectMatchListForGame | public static function selectMatchListForGame(
$matchState,
$gameKey
) {
$matchState = (object) $matchState;
$gameKey = (string) $gameKey;
$matchList = [];
foreach ($matchState->match as $matchKey => $matchItem) {
if ($matchItem->gameKey != $gameKey) {
... | php | public static function selectMatchListForGame(
$matchState,
$gameKey
) {
$matchState = (object) $matchState;
$gameKey = (string) $gameKey;
$matchList = [];
foreach ($matchState->match as $matchKey => $matchItem) {
if ($matchItem->gameKey != $gameKey) {
... | [
"public",
"static",
"function",
"selectMatchListForGame",
"(",
"$",
"matchState",
",",
"$",
"gameKey",
")",
"{",
"$",
"matchState",
"=",
"(",
"object",
")",
"$",
"matchState",
";",
"$",
"gameKey",
"=",
"(",
"string",
")",
"$",
"gameKey",
";",
"$",
"match... | Select a list of active matches for a game.
@param object $matchState
@param string $gameKey
@return array | [
"Select",
"a",
"list",
"of",
"active",
"matches",
"for",
"a",
"game",
"."
] | 71ed33f411e58eb4ef23cb8317825a0d3113c5f0 | https://github.com/Gameye/gameye-sdk-php/blob/71ed33f411e58eb4ef23cb8317825a0d3113c5f0/src/sdk/GameyeSelector.php#L44-L61 |
226,552 | Gameye/gameye-sdk-php | src/sdk/GameyeSelector.php | GameyeSelector.selectMatchItem | public static function selectMatchItem(
$matchState,
$matchKey
) {
$matchState = (object) $matchState;
$matchKey = (string) $matchKey;
$matchItem = $matchState->match->$matchKey;
return $matchItem;
} | php | public static function selectMatchItem(
$matchState,
$matchKey
) {
$matchState = (object) $matchState;
$matchKey = (string) $matchKey;
$matchItem = $matchState->match->$matchKey;
return $matchItem;
} | [
"public",
"static",
"function",
"selectMatchItem",
"(",
"$",
"matchState",
",",
"$",
"matchKey",
")",
"{",
"$",
"matchState",
"=",
"(",
"object",
")",
"$",
"matchState",
";",
"$",
"matchKey",
"=",
"(",
"string",
")",
"$",
"matchKey",
";",
"$",
"matchItem... | Get details about a single match from a match-state as returned by
the gameye api.
@param object $matchState
@param string $matchKey
@return object | [
"Get",
"details",
"about",
"a",
"single",
"match",
"from",
"a",
"match",
"-",
"state",
"as",
"returned",
"by",
"the",
"gameye",
"api",
"."
] | 71ed33f411e58eb4ef23cb8317825a0d3113c5f0 | https://github.com/Gameye/gameye-sdk-php/blob/71ed33f411e58eb4ef23cb8317825a0d3113c5f0/src/sdk/GameyeSelector.php#L72-L82 |
226,553 | Gameye/gameye-sdk-php | src/sdk/GameyeSelector.php | GameyeSelector.selectLocationListForGame | public static function selectLocationListForGame(
$gameState,
$gameKey
) {
$gameState = (object) $gameState;
$gameKey = (string) $gameKey;
$locationList = [];
foreach ($gameState->game->$gameKey->location as $locationKey => $hasLocation) {
if (!$hasLocati... | php | public static function selectLocationListForGame(
$gameState,
$gameKey
) {
$gameState = (object) $gameState;
$gameKey = (string) $gameKey;
$locationList = [];
foreach ($gameState->game->$gameKey->location as $locationKey => $hasLocation) {
if (!$hasLocati... | [
"public",
"static",
"function",
"selectLocationListForGame",
"(",
"$",
"gameState",
",",
"$",
"gameKey",
")",
"{",
"$",
"gameState",
"=",
"(",
"object",
")",
"$",
"gameState",
";",
"$",
"gameKey",
"=",
"(",
"string",
")",
"$",
"gameKey",
";",
"$",
"locat... | Selects all locations for a given game.
@param object $gameState
@param string $gameKey
@return array | [
"Selects",
"all",
"locations",
"for",
"a",
"given",
"game",
"."
] | 71ed33f411e58eb4ef23cb8317825a0d3113c5f0 | https://github.com/Gameye/gameye-sdk-php/blob/71ed33f411e58eb4ef23cb8317825a0d3113c5f0/src/sdk/GameyeSelector.php#L96-L114 |
226,554 | Gameye/gameye-sdk-php | src/sdk/GameyeSelector.php | GameyeSelector.selectTemplateList | public static function selectTemplateList(
$templateState
) {
$templateState = (object) $templateState;
$templateList = [];
foreach ($templateState->template as $templateKey => $templateItem) {
$templateList[$templateKey] = $templateItem;
}
return $templ... | php | public static function selectTemplateList(
$templateState
) {
$templateState = (object) $templateState;
$templateList = [];
foreach ($templateState->template as $templateKey => $templateItem) {
$templateList[$templateKey] = $templateItem;
}
return $templ... | [
"public",
"static",
"function",
"selectTemplateList",
"(",
"$",
"templateState",
")",
"{",
"$",
"templateState",
"=",
"(",
"object",
")",
"$",
"templateState",
";",
"$",
"templateList",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"templateState",
"->",
"templat... | Select a list of templates.
@param object $templateState
@return array | [
"Select",
"a",
"list",
"of",
"templates",
"."
] | 71ed33f411e58eb4ef23cb8317825a0d3113c5f0 | https://github.com/Gameye/gameye-sdk-php/blob/71ed33f411e58eb4ef23cb8317825a0d3113c5f0/src/sdk/GameyeSelector.php#L127-L138 |
226,555 | Gameye/gameye-sdk-php | src/sdk/GameyeSelector.php | GameyeSelector.selectTemplateItem | public static function selectTemplateItem(
$templateState,
$templateKey
) {
$templateState = (object) $templateState;
$templateKey = (string) $templateKey;
$templateItem = $templateState->template->$templateKey;
return $templateItem;
} | php | public static function selectTemplateItem(
$templateState,
$templateKey
) {
$templateState = (object) $templateState;
$templateKey = (string) $templateKey;
$templateItem = $templateState->template->$templateKey;
return $templateItem;
} | [
"public",
"static",
"function",
"selectTemplateItem",
"(",
"$",
"templateState",
",",
"$",
"templateKey",
")",
"{",
"$",
"templateState",
"=",
"(",
"object",
")",
"$",
"templateState",
";",
"$",
"templateKey",
"=",
"(",
"string",
")",
"$",
"templateKey",
";"... | Get details about a single template from a template-state as returned by
the gameye api.
@param object $templateState
@param string $templateKey
@return object | [
"Get",
"details",
"about",
"a",
"single",
"template",
"from",
"a",
"template",
"-",
"state",
"as",
"returned",
"by",
"the",
"gameye",
"api",
"."
] | 71ed33f411e58eb4ef23cb8317825a0d3113c5f0 | https://github.com/Gameye/gameye-sdk-php/blob/71ed33f411e58eb4ef23cb8317825a0d3113c5f0/src/sdk/GameyeSelector.php#L149-L159 |
226,556 | Gameye/gameye-sdk-php | src/sdk/GameyeSelector.php | GameyeSelector.selectTeamList | public static function selectTeamList(
$statisticState
) {
$statisticState = (object) $statisticState;
$teamList = [];
foreach ($statisticState->team as $teamKey => $teamItem) {
$teamList[$teamKey] = $teamItem;
}
return $teamList;
} | php | public static function selectTeamList(
$statisticState
) {
$statisticState = (object) $statisticState;
$teamList = [];
foreach ($statisticState->team as $teamKey => $teamItem) {
$teamList[$teamKey] = $teamItem;
}
return $teamList;
} | [
"public",
"static",
"function",
"selectTeamList",
"(",
"$",
"statisticState",
")",
"{",
"$",
"statisticState",
"=",
"(",
"object",
")",
"$",
"statisticState",
";",
"$",
"teamList",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"statisticState",
"->",
"team",
"a... | Get a list of all teams in the statistic-state.
@param object $statisticState
@return array | [
"Get",
"a",
"list",
"of",
"all",
"teams",
"in",
"the",
"statistic",
"-",
"state",
"."
] | 71ed33f411e58eb4ef23cb8317825a0d3113c5f0 | https://github.com/Gameye/gameye-sdk-php/blob/71ed33f411e58eb4ef23cb8317825a0d3113c5f0/src/sdk/GameyeSelector.php#L172-L183 |
226,557 | Gameye/gameye-sdk-php | src/sdk/GameyeSelector.php | GameyeSelector.selectTeamItem | public static function selectTeamItem(
$statisticState,
$teamKey
) {
$statisticState = (object) $statisticState;
$teamKey = (string) $teamKey;
$teamItem = $statisticState->team->$teamKey;
return $teamItem;
} | php | public static function selectTeamItem(
$statisticState,
$teamKey
) {
$statisticState = (object) $statisticState;
$teamKey = (string) $teamKey;
$teamItem = $statisticState->team->$teamKey;
return $teamItem;
} | [
"public",
"static",
"function",
"selectTeamItem",
"(",
"$",
"statisticState",
",",
"$",
"teamKey",
")",
"{",
"$",
"statisticState",
"=",
"(",
"object",
")",
"$",
"statisticState",
";",
"$",
"teamKey",
"=",
"(",
"string",
")",
"$",
"teamKey",
";",
"$",
"t... | Get a single team from the statistic-state.
@param object $statisticState
@param string $teamKey name of the team
@return object | [
"Get",
"a",
"single",
"team",
"from",
"the",
"statistic",
"-",
"state",
"."
] | 71ed33f411e58eb4ef23cb8317825a0d3113c5f0 | https://github.com/Gameye/gameye-sdk-php/blob/71ed33f411e58eb4ef23cb8317825a0d3113c5f0/src/sdk/GameyeSelector.php#L193-L203 |
226,558 | Gameye/gameye-sdk-php | src/sdk/GameyeSelector.php | GameyeSelector.selectPlayerList | public static function selectPlayerList(
$statisticState
) {
$statisticState = (object) $statisticState;
$playerList = [];
foreach ($statisticState->player as $playerKey => $playerItem) {
$playerList[$playerKey] = $playerItem;
}
return $playerList;
} | php | public static function selectPlayerList(
$statisticState
) {
$statisticState = (object) $statisticState;
$playerList = [];
foreach ($statisticState->player as $playerKey => $playerItem) {
$playerList[$playerKey] = $playerItem;
}
return $playerList;
} | [
"public",
"static",
"function",
"selectPlayerList",
"(",
"$",
"statisticState",
")",
"{",
"$",
"statisticState",
"=",
"(",
"object",
")",
"$",
"statisticState",
";",
"$",
"playerList",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"statisticState",
"->",
"player"... | List all players in the match.
@param object $statisticState
@return array | [
"List",
"all",
"players",
"in",
"the",
"match",
"."
] | 71ed33f411e58eb4ef23cb8317825a0d3113c5f0 | https://github.com/Gameye/gameye-sdk-php/blob/71ed33f411e58eb4ef23cb8317825a0d3113c5f0/src/sdk/GameyeSelector.php#L216-L227 |
226,559 | Gameye/gameye-sdk-php | src/sdk/GameyeSelector.php | GameyeSelector.selectPlayerListForTeam | public static function selectPlayerListForTeam(
$statisticState,
$teamKey
) {
$statisticState = (object) $statisticState;
$playerList = [];
foreach ($statisticState->team->$teamKey->player as $playerKey => $playerEnabled) {
$playerItem = $statisticState->player->... | php | public static function selectPlayerListForTeam(
$statisticState,
$teamKey
) {
$statisticState = (object) $statisticState;
$playerList = [];
foreach ($statisticState->team->$teamKey->player as $playerKey => $playerEnabled) {
$playerItem = $statisticState->player->... | [
"public",
"static",
"function",
"selectPlayerListForTeam",
"(",
"$",
"statisticState",
",",
"$",
"teamKey",
")",
"{",
"$",
"statisticState",
"=",
"(",
"object",
")",
"$",
"statisticState",
";",
"$",
"playerList",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"s... | Get a list if all players in a team.
@param object $statisticState
@param string $teamKey name of the team
@return array | [
"Get",
"a",
"list",
"if",
"all",
"players",
"in",
"a",
"team",
"."
] | 71ed33f411e58eb4ef23cb8317825a0d3113c5f0 | https://github.com/Gameye/gameye-sdk-php/blob/71ed33f411e58eb4ef23cb8317825a0d3113c5f0/src/sdk/GameyeSelector.php#L237-L250 |
226,560 | Gameye/gameye-sdk-php | src/sdk/GameyeSelector.php | GameyeSelector.selectPlayerItem | public static function selectPlayerItem(
$statisticState,
$playerKey
) {
$statisticState = (object) $statisticState;
$playerKey = (string) $playerKey;
$playerItem = $statisticState->player->$playerKey;
return $playerItem;
} | php | public static function selectPlayerItem(
$statisticState,
$playerKey
) {
$statisticState = (object) $statisticState;
$playerKey = (string) $playerKey;
$playerItem = $statisticState->player->$playerKey;
return $playerItem;
} | [
"public",
"static",
"function",
"selectPlayerItem",
"(",
"$",
"statisticState",
",",
"$",
"playerKey",
")",
"{",
"$",
"statisticState",
"=",
"(",
"object",
")",
"$",
"statisticState",
";",
"$",
"playerKey",
"=",
"(",
"string",
")",
"$",
"playerKey",
";",
"... | Get a single player in the match.
@param object $statisticState
@return object | [
"Get",
"a",
"single",
"player",
"in",
"the",
"match",
"."
] | 71ed33f411e58eb4ef23cb8317825a0d3113c5f0 | https://github.com/Gameye/gameye-sdk-php/blob/71ed33f411e58eb4ef23cb8317825a0d3113c5f0/src/sdk/GameyeSelector.php#L259-L269 |
226,561 | gigaai/framework | src/Shortcodes/Lead.php | Lead.output | public function output()
{
// By default, the shortcode takes the current lead as the input
$lead = Conversation::get('lead');
// If id provided, the shortcode will find the lead with the id.
if (isset($this->attributes['id'])) {
$id = $this->attributes['id'];
... | php | public function output()
{
// By default, the shortcode takes the current lead as the input
$lead = Conversation::get('lead');
// If id provided, the shortcode will find the lead with the id.
if (isset($this->attributes['id'])) {
$id = $this->attributes['id'];
... | [
"public",
"function",
"output",
"(",
")",
"{",
"// By default, the shortcode takes the current lead as the input",
"$",
"lead",
"=",
"Conversation",
"::",
"get",
"(",
"'lead'",
")",
";",
"// If id provided, the shortcode will find the lead with the id.",
"if",
"(",
"isset",
... | Define the shortcode's output
@return mixed | [
"Define",
"the",
"shortcode",
"s",
"output"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Shortcodes/Lead.php#L40-L60 |
226,562 | gigaai/framework | src/Drivers/Facebook.php | Facebook.verifyToken | private function verifyToken()
{
$received = Request::getReceivedData();
if (is_array($received) && isset($received['hub_verify_token'])
&& strtolower($received['hub_verify_token']) == 'gigaai'
) {
echo $received['hub_challenge'];
exit;
}
} | php | private function verifyToken()
{
$received = Request::getReceivedData();
if (is_array($received) && isset($received['hub_verify_token'])
&& strtolower($received['hub_verify_token']) == 'gigaai'
) {
echo $received['hub_challenge'];
exit;
}
} | [
"private",
"function",
"verifyToken",
"(",
")",
"{",
"$",
"received",
"=",
"Request",
"::",
"getReceivedData",
"(",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"received",
")",
"&&",
"isset",
"(",
"$",
"received",
"[",
"'hub_verify_token'",
"]",
")",
"&&"... | Verify token from Facebook
@return void | [
"Verify",
"token",
"from",
"Facebook"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Drivers/Facebook.php#L24-L35 |
226,563 | gigaai/framework | src/Drivers/Facebook.php | Facebook.getUser | public function getUser($lead_id)
{
$end_point = $this->getResource() . "{$lead_id}?access_token=" . $this->getAccessToken();
$data = giga_remote_get($end_point);
return (array) $data;
} | php | public function getUser($lead_id)
{
$end_point = $this->getResource() . "{$lead_id}?access_token=" . $this->getAccessToken();
$data = giga_remote_get($end_point);
return (array) $data;
} | [
"public",
"function",
"getUser",
"(",
"$",
"lead_id",
")",
"{",
"$",
"end_point",
"=",
"$",
"this",
"->",
"getResource",
"(",
")",
".",
"\"{$lead_id}?access_token=\"",
".",
"$",
"this",
"->",
"getAccessToken",
"(",
")",
";",
"$",
"data",
"=",
"giga_remote_... | Get user data
@param String $lead_id
@return Array | [
"Get",
"user",
"data"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Drivers/Facebook.php#L146-L153 |
226,564 | gigaai/framework | src/Drivers/Facebook.php | Facebook.sendSubscribeRequest | public function sendSubscribeRequest($attributes)
{
$token = isset($attributes['access_token']) ? $attributes['access_token'] : $this->getAccessToken();
$page_id = $attributes['page_id'];
$end_point = $this->getResource() . '/' . $page_id . '/subscribed_apps?access_token=' . $token;... | php | public function sendSubscribeRequest($attributes)
{
$token = isset($attributes['access_token']) ? $attributes['access_token'] : $this->getAccessToken();
$page_id = $attributes['page_id'];
$end_point = $this->getResource() . '/' . $page_id . '/subscribed_apps?access_token=' . $token;... | [
"public",
"function",
"sendSubscribeRequest",
"(",
"$",
"attributes",
")",
"{",
"$",
"token",
"=",
"isset",
"(",
"$",
"attributes",
"[",
"'access_token'",
"]",
")",
"?",
"$",
"attributes",
"[",
"'access_token'",
"]",
":",
"$",
"this",
"->",
"getAccessToken",... | Send subscribe request to FB
@return json response | [
"Send",
"subscribe",
"request",
"to",
"FB"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Drivers/Facebook.php#L160-L170 |
226,565 | gigaai/framework | src/Drivers/Telegram.php | Telegram.formatIncomingRequest | public function formatIncomingRequest($telegram)
{
if ( ! empty($telegram) && is_array($telegram)) {
$sender_id = null;
$time = null;
if (isset($telegram['callback_query'])) {
$message = $telegram['callback_query'];
$sender_id = $teleg... | php | public function formatIncomingRequest($telegram)
{
if ( ! empty($telegram) && is_array($telegram)) {
$sender_id = null;
$time = null;
if (isset($telegram['callback_query'])) {
$message = $telegram['callback_query'];
$sender_id = $teleg... | [
"public",
"function",
"formatIncomingRequest",
"(",
"$",
"telegram",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"telegram",
")",
"&&",
"is_array",
"(",
"$",
"telegram",
")",
")",
"{",
"$",
"sender_id",
"=",
"null",
";",
"$",
"time",
"=",
"null",
";... | Convert Telegram to Facebook request
@see https://core.telegram.org/bots/api
@see https://developers.facebook.com/docs/messenger-platform/webhook-reference#format | [
"Convert",
"Telegram",
"to",
"Facebook",
"request"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Drivers/Telegram.php#L45-L99 |
226,566 | gigaai/framework | src/Drivers/Telegram.php | Telegram.sendMessage | public function sendMessage($body)
{
$action = 'sendMessage';
$telegram = [
'chat_id' => $body['recipient']['id']
];
$message = $body['message'];
// Send Text
if (isset($message['text'])) {
$telegram['text'] = $message['text'];
... | php | public function sendMessage($body)
{
$action = 'sendMessage';
$telegram = [
'chat_id' => $body['recipient']['id']
];
$message = $body['message'];
// Send Text
if (isset($message['text'])) {
$telegram['text'] = $message['text'];
... | [
"public",
"function",
"sendMessage",
"(",
"$",
"body",
")",
"{",
"$",
"action",
"=",
"'sendMessage'",
";",
"$",
"telegram",
"=",
"[",
"'chat_id'",
"=>",
"$",
"body",
"[",
"'recipient'",
"]",
"[",
"'id'",
"]",
"]",
";",
"$",
"message",
"=",
"$",
"body... | Convert Facebook request back to Telegram request
@param $body Body as Facebook format | [
"Convert",
"Facebook",
"request",
"back",
"to",
"Telegram",
"request"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Drivers/Telegram.php#L106-L192 |
226,567 | gigaai/framework | src/Drivers/Telegram.php | Telegram.callMethod | private function callMethod($method, $params)
{
$params['chat_id'] = Conversation::get('lead_id');
return giga_remote_post($this->getResource($method), $params);
} | php | private function callMethod($method, $params)
{
$params['chat_id'] = Conversation::get('lead_id');
return giga_remote_post($this->getResource($method), $params);
} | [
"private",
"function",
"callMethod",
"(",
"$",
"method",
",",
"$",
"params",
")",
"{",
"$",
"params",
"[",
"'chat_id'",
"]",
"=",
"Conversation",
"::",
"get",
"(",
"'lead_id'",
")",
";",
"return",
"giga_remote_post",
"(",
"$",
"this",
"->",
"getResource",
... | Call Telegram method via HTTP
@see https://core.telegram.org/bots/api#available-methods | [
"Call",
"Telegram",
"method",
"via",
"HTTP"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Drivers/Telegram.php#L199-L204 |
226,568 | gigaai/framework | src/Drivers/Telegram.php | Telegram.sendGeneric | private function sendGeneric($payload)
{
foreach ($payload['elements'] as $element) {
$generic = [];
if (isset($element['image_url'])) {
$generic['photo'] = $element['image_url'];
$generic['caption'] = $element['title'];
$keyboard ... | php | private function sendGeneric($payload)
{
foreach ($payload['elements'] as $element) {
$generic = [];
if (isset($element['image_url'])) {
$generic['photo'] = $element['image_url'];
$generic['caption'] = $element['title'];
$keyboard ... | [
"private",
"function",
"sendGeneric",
"(",
"$",
"payload",
")",
"{",
"foreach",
"(",
"$",
"payload",
"[",
"'elements'",
"]",
"as",
"$",
"element",
")",
"{",
"$",
"generic",
"=",
"[",
"]",
";",
"if",
"(",
"isset",
"(",
"$",
"element",
"[",
"'image_url... | Convert Generic to Photo with Caption + Buttons
@param Array $payload
@return Json | [
"Convert",
"Generic",
"to",
"Photo",
"with",
"Caption",
"+",
"Buttons"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Drivers/Telegram.php#L251-L270 |
226,569 | gigaai/framework | src/Drivers/Telegram.php | Telegram.sendTyping | public function sendTyping()
{
$lead_id = Conversation::get('lead_id');
$body = [
'chat_id' => $lead_id,
'action' => 'typing'
];
giga_remote_post($this->getResource('sendChatAction'), $body);
} | php | public function sendTyping()
{
$lead_id = Conversation::get('lead_id');
$body = [
'chat_id' => $lead_id,
'action' => 'typing'
];
giga_remote_post($this->getResource('sendChatAction'), $body);
} | [
"public",
"function",
"sendTyping",
"(",
")",
"{",
"$",
"lead_id",
"=",
"Conversation",
"::",
"get",
"(",
"'lead_id'",
")",
";",
"$",
"body",
"=",
"[",
"'chat_id'",
"=>",
"$",
"lead_id",
",",
"'action'",
"=>",
"'typing'",
"]",
";",
"giga_remote_post",
"(... | Send typing indicator | [
"Send",
"typing",
"indicator"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Drivers/Telegram.php#L275-L285 |
226,570 | gigaai/framework | src/Drivers/Telegram.php | Telegram.getUser | public function getUser($lead_id)
{
// Because the received data already contains user info so we don't need to make any request
$raw = Conversation::get('request_raw');
if (isset($raw['callback_query'])) {
$raw = $raw['callback_query'];
$user = $raw['from'];... | php | public function getUser($lead_id)
{
// Because the received data already contains user info so we don't need to make any request
$raw = Conversation::get('request_raw');
if (isset($raw['callback_query'])) {
$raw = $raw['callback_query'];
$user = $raw['from'];... | [
"public",
"function",
"getUser",
"(",
"$",
"lead_id",
")",
"{",
"// Because the received data already contains user info so we don't need to make any request",
"$",
"raw",
"=",
"Conversation",
"::",
"get",
"(",
"'request_raw'",
")",
";",
"if",
"(",
"isset",
"(",
"$",
... | Method to get current user
@return Array format as Facebook | [
"Method",
"to",
"get",
"current",
"user"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Drivers/Telegram.php#L292-L312 |
226,571 | gigaai/framework | src/Core/Model.php | Model.addNode | public function addNode($pattern, $answers = null, $attributes = [])
{
// Multiple nodes. If user like to use $patterns => $answers method
if (is_array($pattern) && is_null($answers)) {
$this->addNodes($pattern, $attributes);
return null;
}
$type_pattern ... | php | public function addNode($pattern, $answers = null, $attributes = [])
{
// Multiple nodes. If user like to use $patterns => $answers method
if (is_array($pattern) && is_null($answers)) {
$this->addNodes($pattern, $attributes);
return null;
}
$type_pattern ... | [
"public",
"function",
"addNode",
"(",
"$",
"pattern",
",",
"$",
"answers",
"=",
"null",
",",
"$",
"attributes",
"=",
"[",
"]",
")",
"{",
"// Multiple nodes. If user like to use $patterns => $answers method",
"if",
"(",
"is_array",
"(",
"$",
"pattern",
")",
"&&",... | Add Node to the Database
@param $pattern
@param null $answers
@param array $attributes
@return $this|null | [
"Add",
"Node",
"to",
"the",
"Database"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Core/Model.php#L77-L111 |
226,572 | gigaai/framework | src/Core/Model.php | Model.getNodeTypeAndPattern | private function getNodeTypeAndPattern($pattern)
{
$node_type = 'text';
// If user set payload, default, welcome message.
foreach (['payload', 'default', 'attachment'] as $type) {
if (strpos($pattern, $type . ':') !== false) {
$node_type = $type;
... | php | private function getNodeTypeAndPattern($pattern)
{
$node_type = 'text';
// If user set payload, default, welcome message.
foreach (['payload', 'default', 'attachment'] as $type) {
if (strpos($pattern, $type . ':') !== false) {
$node_type = $type;
... | [
"private",
"function",
"getNodeTypeAndPattern",
"(",
"$",
"pattern",
")",
"{",
"$",
"node_type",
"=",
"'text'",
";",
"// If user set payload, default, welcome message.",
"foreach",
"(",
"[",
"'payload'",
",",
"'default'",
",",
"'attachment'",
"]",
"as",
"$",
"type",... | Get Node type and Pattern
@param $pattern
@return array | [
"Get",
"Node",
"type",
"and",
"Pattern"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Core/Model.php#L120-L138 |
226,573 | gigaai/framework | src/Core/Model.php | Model.addNodes | public function addNodes($nodes, $attributes = [])
{
foreach ($nodes as $pattern => $answers) {
$this->addNode($pattern, $answers, $attributes);
}
} | php | public function addNodes($nodes, $attributes = [])
{
foreach ($nodes as $pattern => $answers) {
$this->addNode($pattern, $answers, $attributes);
}
} | [
"public",
"function",
"addNodes",
"(",
"$",
"nodes",
",",
"$",
"attributes",
"=",
"[",
"]",
")",
"{",
"foreach",
"(",
"$",
"nodes",
"as",
"$",
"pattern",
"=>",
"$",
"answers",
")",
"{",
"$",
"this",
"->",
"addNode",
"(",
"$",
"pattern",
",",
"$",
... | Add Multiple Nodes
@param $nodes | [
"Add",
"Multiple",
"Nodes"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Core/Model.php#L145-L150 |
226,574 | gigaai/framework | src/Core/Model.php | Model.persistNode | public function persistNode(array $answers, $node_type, $pattern = null, $attributes = [])
{
foreach ($answers as $index => $answer) {
if (isset($answer['type']) && isset($answer['content']) && is_callable($answer['content'])) {
$answer['content'] = is_string($answer['content']) ... | php | public function persistNode(array $answers, $node_type, $pattern = null, $attributes = [])
{
foreach ($answers as $index => $answer) {
if (isset($answer['type']) && isset($answer['content']) && is_callable($answer['content'])) {
$answer['content'] = is_string($answer['content']) ... | [
"public",
"function",
"persistNode",
"(",
"array",
"$",
"answers",
",",
"$",
"node_type",
",",
"$",
"pattern",
"=",
"null",
",",
"$",
"attributes",
"=",
"[",
"]",
")",
"{",
"foreach",
"(",
"$",
"answers",
"as",
"$",
"index",
"=>",
"$",
"answer",
")",... | Add answer to node
@param Mixed $answers Message
@param String $node_type Node Type
@param null $pattern Question
@return Node | [
"Add",
"answer",
"to",
"node"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Core/Model.php#L161-L173 |
226,575 | gigaai/framework | src/Core/Model.php | Model.parse | public function parse($answers)
{
// Iterate through answers and parse it if possible
// Also, move quick replies to the last answer
$parsed = [];
$previous_index = 0;
if ($this->isSingularResponse($answers)) {
$answers = [$answers];
}
f... | php | public function parse($answers)
{
// Iterate through answers and parse it if possible
// Also, move quick replies to the last answer
$parsed = [];
$previous_index = 0;
if ($this->isSingularResponse($answers)) {
$answers = [$answers];
}
f... | [
"public",
"function",
"parse",
"(",
"$",
"answers",
")",
"{",
"// Iterate through answers and parse it if possible",
"// Also, move quick replies to the last answer",
"$",
"parsed",
"=",
"[",
"]",
";",
"$",
"previous_index",
"=",
"0",
";",
"if",
"(",
"$",
"this",
"-... | Parse the answers to correct FB Format. | [
"Parse",
"the",
"answers",
"to",
"correct",
"FB",
"Format",
"."
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Core/Model.php#L207-L279 |
226,576 | gigaai/framework | src/Core/Model.php | Model.parseAttachmentMessage | private function parseAttachmentMessage($index, $answer)
{
$templateType = null;
if (isset($answer['type'])) {
$templateType = $answer['type'];
}
$attachment = $index === 'attachment' ? $answer : $answer['attachment'];
if (isset($attachment['payload']) && isset... | php | private function parseAttachmentMessage($index, $answer)
{
$templateType = null;
if (isset($answer['type'])) {
$templateType = $answer['type'];
}
$attachment = $index === 'attachment' ? $answer : $answer['attachment'];
if (isset($attachment['payload']) && isset... | [
"private",
"function",
"parseAttachmentMessage",
"(",
"$",
"index",
",",
"$",
"answer",
")",
"{",
"$",
"templateType",
"=",
"null",
";",
"if",
"(",
"isset",
"(",
"$",
"answer",
"[",
"'type'",
"]",
")",
")",
"{",
"$",
"templateType",
"=",
"$",
"answer",... | If message starts with `attachment` parameter. We'll keep everything inside that param and
only check message type.
@return array | [
"If",
"message",
"starts",
"with",
"attachment",
"parameter",
".",
"We",
"ll",
"keep",
"everything",
"inside",
"that",
"param",
"and",
"only",
"check",
"message",
"type",
"."
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Core/Model.php#L287-L305 |
226,577 | gigaai/framework | src/Core/Model.php | Model.isSingularResponse | private function isSingularResponse($answer)
{
return (
is_string($answer) ||
is_callable($answer) ||
array_key_exists('buttons', $answer) ||
array_key_exists('elements', $answer) || // For Generic or Receipt
(is_array($answer) && isset($answer[0])... | php | private function isSingularResponse($answer)
{
return (
is_string($answer) ||
is_callable($answer) ||
array_key_exists('buttons', $answer) ||
array_key_exists('elements', $answer) || // For Generic or Receipt
(is_array($answer) && isset($answer[0])... | [
"private",
"function",
"isSingularResponse",
"(",
"$",
"answer",
")",
"{",
"return",
"(",
"is_string",
"(",
"$",
"answer",
")",
"||",
"is_callable",
"(",
"$",
"answer",
")",
"||",
"array_key_exists",
"(",
"'buttons'",
",",
"$",
"answer",
")",
"||",
"array_... | Check if answers input is single answer
@param $answer
@return bool | [
"Check",
"if",
"answers",
"input",
"is",
"single",
"answer"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Core/Model.php#L314-L329 |
226,578 | gigaai/framework | src/Core/Model.php | Model.addIntendedAction | public function addIntendedAction($action)
{
if (empty($this->current_node->type) || $this->current_node->type == 'welcome') {
return;
}
// If it's ->then() intended action. We'll save next action as id
if (is_callable($action)) {
$related = $this->current_no... | php | public function addIntendedAction($action)
{
if (empty($this->current_node->type) || $this->current_node->type == 'welcome') {
return;
}
// If it's ->then() intended action. We'll save next action as id
if (is_callable($action)) {
$related = $this->current_no... | [
"public",
"function",
"addIntendedAction",
"(",
"$",
"action",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"current_node",
"->",
"type",
")",
"||",
"$",
"this",
"->",
"current_node",
"->",
"type",
"==",
"'welcome'",
")",
"{",
"return",
";",
"... | Add intended action for current node
@param $action | [
"Add",
"intended",
"action",
"for",
"current",
"node"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Core/Model.php#L336-L361 |
226,579 | gigaai/framework | src/Core/Model.php | Model.taggedAs | public function taggedAs($tag)
{
if (empty($this->current_node)) {
return;
}
$this->current_node->tags = $tag;
$this->current_node->save();
} | php | public function taggedAs($tag)
{
if (empty($this->current_node)) {
return;
}
$this->current_node->tags = $tag;
$this->current_node->save();
} | [
"public",
"function",
"taggedAs",
"(",
"$",
"tag",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"current_node",
")",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"current_node",
"->",
"tags",
"=",
"$",
"tag",
";",
"$",
"this",
"->",
... | Tag a node
@param $tag | [
"Tag",
"a",
"node"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Core/Model.php#L368-L376 |
226,580 | gigaai/framework | src/Message/Attachment.php | Attachment.normalize | public function normalize()
{
$url = $this->getMediaUrl($this->mediaType);
return [
'type' => $this->mediaType,
'content' => [
'attachment' => [
'type' => $this->mediaType,
'payload' => [
'... | php | public function normalize()
{
$url = $this->getMediaUrl($this->mediaType);
return [
'type' => $this->mediaType,
'content' => [
'attachment' => [
'type' => $this->mediaType,
'payload' => [
'... | [
"public",
"function",
"normalize",
"(",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"getMediaUrl",
"(",
"$",
"this",
"->",
"mediaType",
")",
";",
"return",
"[",
"'type'",
"=>",
"$",
"this",
"->",
"mediaType",
",",
"'content'",
"=>",
"[",
"'attachment... | Convert to Facebook format to response
@return Array | [
"Convert",
"to",
"Facebook",
"format",
"to",
"response"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Message/Attachment.php#L47-L63 |
226,581 | gigaai/framework | src/Message/Attachment.php | Attachment.detectMediaType | public function detectMediaType($url)
{
foreach ($this->availableTypes as $type) {
if (starts_with($url, $type . ':')) {
return $type;
}
}
if (giga_match('%(.jpg|.png|.bmp|.gif|.jpeg|.tiff|.gif)%', $url)) {
return 'image';
}
... | php | public function detectMediaType($url)
{
foreach ($this->availableTypes as $type) {
if (starts_with($url, $type . ':')) {
return $type;
}
}
if (giga_match('%(.jpg|.png|.bmp|.gif|.jpeg|.tiff|.gif)%', $url)) {
return 'image';
}
... | [
"public",
"function",
"detectMediaType",
"(",
"$",
"url",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"availableTypes",
"as",
"$",
"type",
")",
"{",
"if",
"(",
"starts_with",
"(",
"$",
"url",
",",
"$",
"type",
".",
"':'",
")",
")",
"{",
"return",
... | Guess media type from URL
return mixed | [
"Guess",
"media",
"type",
"from",
"URL"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Message/Attachment.php#L70-L91 |
226,582 | gigaai/framework | src/Message/Attachment.php | Attachment.expectedIs | public function expectedIs($type)
{
// If people set type = message type, return true
if (is_array($this->body) && isset($this->body['attachment']) && isset($this->body['attachment']['type'])) {
return true;
}
if (is_string($this->body)) {
$fileExtension = $t... | php | public function expectedIs($type)
{
// If people set type = message type, return true
if (is_array($this->body) && isset($this->body['attachment']) && isset($this->body['attachment']['type'])) {
return true;
}
if (is_string($this->body)) {
$fileExtension = $t... | [
"public",
"function",
"expectedIs",
"(",
"$",
"type",
")",
"{",
"// If people set type = message type, return true",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"body",
")",
"&&",
"isset",
"(",
"$",
"this",
"->",
"body",
"[",
"'attachment'",
"]",
")",
"&&... | Check current message format
@return bool | [
"Check",
"current",
"message",
"format"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Message/Attachment.php#L98-L117 |
226,583 | gigaai/framework | src/Message/Attachment.php | Attachment.getMediaUrl | public function getMediaUrl($mediaType)
{
$url = $this->body;
if (is_array($this->body) && isset($this->body['attachment']['payload']['url']) && is_string($this->body['attachment']['payload']['url'])) {
$url = $this->body['attachment']['payload']['url'];
}
$url = str_re... | php | public function getMediaUrl($mediaType)
{
$url = $this->body;
if (is_array($this->body) && isset($this->body['attachment']['payload']['url']) && is_string($this->body['attachment']['payload']['url'])) {
$url = $this->body['attachment']['payload']['url'];
}
$url = str_re... | [
"public",
"function",
"getMediaUrl",
"(",
"$",
"mediaType",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"body",
";",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"body",
")",
"&&",
"isset",
"(",
"$",
"this",
"->",
"body",
"[",
"'attachment'",
"... | Get media URL
@return String | [
"Get",
"media",
"URL"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Message/Attachment.php#L124-L135 |
226,584 | CedrickOka/oka-pagination | src/Service/PaginationManager.php | PaginationManager.getManagerConfig | public function getManagerConfig($name)
{
if ($this->managerBag->has($name)) {
$config = $this->managerBag->get($name);
if (null === $config['template']) {
$config['template'] = $this->defaultManagerConfig['template'];
}
} elseif (class_exists($name)) {
$config = $this->defaultManagerConfig;
... | php | public function getManagerConfig($name)
{
if ($this->managerBag->has($name)) {
$config = $this->managerBag->get($name);
if (null === $config['template']) {
$config['template'] = $this->defaultManagerConfig['template'];
}
} elseif (class_exists($name)) {
$config = $this->defaultManagerConfig;
... | [
"public",
"function",
"getManagerConfig",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"managerBag",
"->",
"has",
"(",
"$",
"name",
")",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"managerBag",
"->",
"get",
"(",
"$",
"name",
")",... | Get pagination manager config
@param string $name The pagination manager name
@throws \InvalidArgumentException
@return array | [
"Get",
"pagination",
"manager",
"config"
] | d31dcdda62a60cc5e679993c90f02c61e8131c92 | https://github.com/CedrickOka/oka-pagination/blob/d31dcdda62a60cc5e679993c90f02c61e8131c92/src/Service/PaginationManager.php#L74-L90 |
226,585 | varspool/sphpdox | lib/Sphpdox/Element/Element.php | Element.indent | protected function indent($output, $spaces = 3, $rewrap = false)
{
if (!$output) {
return '';
}
$line = 78;
$spaces = str_pad(' ', $spaces);
if ($rewrap) {
$existing_indent = '';
if (preg_match('/^( +)/', $output, $matches)) {
... | php | protected function indent($output, $spaces = 3, $rewrap = false)
{
if (!$output) {
return '';
}
$line = 78;
$spaces = str_pad(' ', $spaces);
if ($rewrap) {
$existing_indent = '';
if (preg_match('/^( +)/', $output, $matches)) {
... | [
"protected",
"function",
"indent",
"(",
"$",
"output",
",",
"$",
"spaces",
"=",
"3",
",",
"$",
"rewrap",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"output",
")",
"{",
"return",
"''",
";",
"}",
"$",
"line",
"=",
"78",
";",
"$",
"spaces",
"=",... | Indents the given lines
@param string $output
@param int $level | [
"Indents",
"the",
"given",
"lines"
] | 7867503e1fc0acc47b4512fbd89bf742e03f79ba | https://github.com/varspool/sphpdox/blob/7867503e1fc0acc47b4512fbd89bf742e03f79ba/lib/Sphpdox/Element/Element.php#L44-L65 |
226,586 | gigaai/framework | src/Http/Request.php | Request.load | private function load($simulate = [])
{
// Get the received data from request
$stream = json_decode(file_get_contents('php://input'), true);
self::$received = (!empty($stream)) ? $stream : $_REQUEST;
if (!empty($simulate)) {
self::$received = $simulate;
}... | php | private function load($simulate = [])
{
// Get the received data from request
$stream = json_decode(file_get_contents('php://input'), true);
self::$received = (!empty($stream)) ? $stream : $_REQUEST;
if (!empty($simulate)) {
self::$received = $simulate;
}... | [
"private",
"function",
"load",
"(",
"$",
"simulate",
"=",
"[",
"]",
")",
"{",
"// Get the received data from request",
"$",
"stream",
"=",
"json_decode",
"(",
"file_get_contents",
"(",
"'php://input'",
")",
",",
"true",
")",
";",
"self",
"::",
"$",
"received",... | Setup data and run command based on received data | [
"Setup",
"data",
"and",
"run",
"command",
"based",
"on",
"received",
"data"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Http/Request.php#L45-L66 |
226,587 | gigaai/framework | src/Http/Request.php | Request.getReceivedData | private function getReceivedData($key = null)
{
$received = self::$received;
if ($key !== null) {
if (is_array($received) && isset($received[$key])) {
return $received[$key];
}
if (isset($received->$key)) {
return $received->$key;... | php | private function getReceivedData($key = null)
{
$received = self::$received;
if ($key !== null) {
if (is_array($received) && isset($received[$key])) {
return $received[$key];
}
if (isset($received->$key)) {
return $received->$key;... | [
"private",
"function",
"getReceivedData",
"(",
"$",
"key",
"=",
"null",
")",
"{",
"$",
"received",
"=",
"self",
"::",
"$",
"received",
";",
"if",
"(",
"$",
"key",
"!==",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"received",
")",
"&&",
"iss... | Get received request
@param null $key
@return mixed | [
"Get",
"received",
"request"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Http/Request.php#L75-L92 |
226,588 | gigaai/framework | src/Http/Request.php | Request.sendMessages | private function sendMessages($messages, $attributes = [], $lead = null)
{
$accessToken = Config::get('access_token');
if ($accessToken === null && $lead !== null) {
$instance = $lead->instance()->first();
if ($instance !== null) {
Config::set($i... | php | private function sendMessages($messages, $attributes = [], $lead = null)
{
$accessToken = Config::get('access_token');
if ($accessToken === null && $lead !== null) {
$instance = $lead->instance()->first();
if ($instance !== null) {
Config::set($i... | [
"private",
"function",
"sendMessages",
"(",
"$",
"messages",
",",
"$",
"attributes",
"=",
"[",
"]",
",",
"$",
"lead",
"=",
"null",
")",
"{",
"$",
"accessToken",
"=",
"Config",
"::",
"get",
"(",
"'access_token'",
")",
";",
"if",
"(",
"$",
"accessToken",... | Send multiple messages
@param $messages
@param mixed $lead | [
"Send",
"multiple",
"messages"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Http/Request.php#L240-L265 |
226,589 | gigaai/framework | src/Http/Request.php | Request.getTypeAndPattern | private function getTypeAndPattern($event)
{
$type = 'text';
$pattern = '';
// For Text Message
if (isset($event['message']) && isset($event['message']['text'])) {
$pattern = $event['message']['text'];
}
// For Attachment Message
if (isset($ev... | php | private function getTypeAndPattern($event)
{
$type = 'text';
$pattern = '';
// For Text Message
if (isset($event['message']) && isset($event['message']['text'])) {
$pattern = $event['message']['text'];
}
// For Attachment Message
if (isset($ev... | [
"private",
"function",
"getTypeAndPattern",
"(",
"$",
"event",
")",
"{",
"$",
"type",
"=",
"'text'",
";",
"$",
"pattern",
"=",
"''",
";",
"// For Text Message",
"if",
"(",
"isset",
"(",
"$",
"event",
"[",
"'message'",
"]",
")",
"&&",
"isset",
"(",
"$",... | Get Message Type and Pattern of an Event
@param $event
@return array | [
"Get",
"Message",
"Type",
"and",
"Pattern",
"of",
"an",
"Event"
] | 57380d93baf57bfdb8067e96c68ba72e4e993d96 | https://github.com/gigaai/framework/blob/57380d93baf57bfdb8067e96c68ba72e4e993d96/src/Http/Request.php#L274-L307 |
226,590 | kevinkhill/FontAwesomePHP | src/FontAwesomeText.php | FontAwesomeText.output | protected function output()
{
$attrs = '';
$classes = 'fa-layers-text';
$transforms = '';
if (!empty($this->classes) && count($this->classes) > 0) {
$classes .= ' ' . implode(' ', $this->classes);
}
if (!empty($this->attributes) && count($this->attribu... | php | protected function output()
{
$attrs = '';
$classes = 'fa-layers-text';
$transforms = '';
if (!empty($this->classes) && count($this->classes) > 0) {
$classes .= ' ' . implode(' ', $this->classes);
}
if (!empty($this->attributes) && count($this->attribu... | [
"protected",
"function",
"output",
"(",
")",
"{",
"$",
"attrs",
"=",
"''",
";",
"$",
"classes",
"=",
"'fa-layers-text'",
";",
"$",
"transforms",
"=",
"''",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"classes",
")",
"&&",
"count",
"(",
"$... | Outputs the FontAwesomeText object as an HTML string
@access protected
@return string HTML string of text element | [
"Outputs",
"the",
"FontAwesomeText",
"object",
"as",
"an",
"HTML",
"string"
] | e7d12d7422b23a5c3a09715d9ca3e24ff811c073 | https://github.com/kevinkhill/FontAwesomePHP/blob/e7d12d7422b23a5c3a09715d9ca3e24ff811c073/src/FontAwesomeText.php#L45-L70 |
226,591 | cviebrock/eloquent-typecast | src/EloquentTypecastTrait.php | EloquentTypecastTrait.bootEloquentTypecastTrait | protected static function bootEloquentTypecastTrait()
{
$class = get_called_class();
$instance = new $class();
foreach($instance->getCastAttributes() as $attribute=>$type)
{
static::$mutatorCache[$class][] = $attribute;
}
} | php | protected static function bootEloquentTypecastTrait()
{
$class = get_called_class();
$instance = new $class();
foreach($instance->getCastAttributes() as $attribute=>$type)
{
static::$mutatorCache[$class][] = $attribute;
}
} | [
"protected",
"static",
"function",
"bootEloquentTypecastTrait",
"(",
")",
"{",
"$",
"class",
"=",
"get_called_class",
"(",
")",
";",
"$",
"instance",
"=",
"new",
"$",
"class",
"(",
")",
";",
"foreach",
"(",
"$",
"instance",
"->",
"getCastAttributes",
"(",
... | Boot the typecasting trait for a model, which will add all our typecast-able
attributes to the mutator cache. This way, they get mutated without
us needing to write a mutator function for each one.
@return void | [
"Boot",
"the",
"typecasting",
"trait",
"for",
"a",
"model",
"which",
"will",
"add",
"all",
"our",
"typecast",
"-",
"able",
"attributes",
"to",
"the",
"mutator",
"cache",
".",
"This",
"way",
"they",
"get",
"mutated",
"without",
"us",
"needing",
"to",
"write... | de74d085cd3fbedfaf0bb974041cd60faceb9126 | https://github.com/cviebrock/eloquent-typecast/blob/de74d085cd3fbedfaf0bb974041cd60faceb9126/src/EloquentTypecastTrait.php#L23-L33 |
226,592 | cviebrock/eloquent-typecast | src/EloquentTypecastTrait.php | EloquentTypecastTrait.mutateAttribute | protected function mutateAttribute($key, $value)
{
if ($this->isCastableAttribute($key))
{
return $this->castAttribute($key, $value);
}
return parent::mutateAttribute($key, $value);
} | php | protected function mutateAttribute($key, $value)
{
if ($this->isCastableAttribute($key))
{
return $this->castAttribute($key, $value);
}
return parent::mutateAttribute($key, $value);
} | [
"protected",
"function",
"mutateAttribute",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isCastableAttribute",
"(",
"$",
"key",
")",
")",
"{",
"return",
"$",
"this",
"->",
"castAttribute",
"(",
"$",
"key",
",",
"$",
"v... | Get the value of an attribute using its mutator. If the attribute
is typecast-able, then return the cast value instead.
@param string $key
@param mixed $value
@return mixed
@see Illuminate\Database\Eloquent\Model::mutateAttribute() | [
"Get",
"the",
"value",
"of",
"an",
"attribute",
"using",
"its",
"mutator",
".",
"If",
"the",
"attribute",
"is",
"typecast",
"-",
"able",
"then",
"return",
"the",
"cast",
"value",
"instead",
"."
] | de74d085cd3fbedfaf0bb974041cd60faceb9126 | https://github.com/cviebrock/eloquent-typecast/blob/de74d085cd3fbedfaf0bb974041cd60faceb9126/src/EloquentTypecastTrait.php#L45-L53 |
226,593 | cviebrock/eloquent-typecast | src/EloquentTypecastTrait.php | EloquentTypecastTrait.setAttribute | public function setAttribute($key, $value)
{
if ($this->castOnSet() && $this->isCastableAttribute($key))
{
$value = $this->castAttribute($key, $value);
}
return parent::setAttribute($key, $value);
} | php | public function setAttribute($key, $value)
{
if ($this->castOnSet() && $this->isCastableAttribute($key))
{
$value = $this->castAttribute($key, $value);
}
return parent::setAttribute($key, $value);
} | [
"public",
"function",
"setAttribute",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"castOnSet",
"(",
")",
"&&",
"$",
"this",
"->",
"isCastableAttribute",
"(",
"$",
"key",
")",
")",
"{",
"$",
"value",
"=",
"$",
"this",... | Set a given attribute on the model. If the attribute is typecast-able,
then cast the value before setting it.
@param string $key
@param mixed $value
@return void
@see Illuminate\Database\Eloquent\Model::setAttribute() | [
"Set",
"a",
"given",
"attribute",
"on",
"the",
"model",
".",
"If",
"the",
"attribute",
"is",
"typecast",
"-",
"able",
"then",
"cast",
"the",
"value",
"before",
"setting",
"it",
"."
] | de74d085cd3fbedfaf0bb974041cd60faceb9126 | https://github.com/cviebrock/eloquent-typecast/blob/de74d085cd3fbedfaf0bb974041cd60faceb9126/src/EloquentTypecastTrait.php#L65-L72 |
226,594 | cviebrock/eloquent-typecast | src/EloquentTypecastTrait.php | EloquentTypecastTrait.getAttributeValue | protected function getAttributeValue($key)
{
$value = parent::getAttributeValue($key);
if ($this->isCastableAttribute($key))
{
$value = $this->castAttribute($key, $value);
}
return $value;
} | php | protected function getAttributeValue($key)
{
$value = parent::getAttributeValue($key);
if ($this->isCastableAttribute($key))
{
$value = $this->castAttribute($key, $value);
}
return $value;
} | [
"protected",
"function",
"getAttributeValue",
"(",
"$",
"key",
")",
"{",
"$",
"value",
"=",
"parent",
"::",
"getAttributeValue",
"(",
"$",
"key",
")",
";",
"if",
"(",
"$",
"this",
"->",
"isCastableAttribute",
"(",
"$",
"key",
")",
")",
"{",
"$",
"value... | Get a given attribute on the model. If the attribute is typecast-able,
then cast the value before getting it.
@param string $key
@return mixed | [
"Get",
"a",
"given",
"attribute",
"on",
"the",
"model",
".",
"If",
"the",
"attribute",
"is",
"typecast",
"-",
"able",
"then",
"cast",
"the",
"value",
"before",
"getting",
"it",
"."
] | de74d085cd3fbedfaf0bb974041cd60faceb9126 | https://github.com/cviebrock/eloquent-typecast/blob/de74d085cd3fbedfaf0bb974041cd60faceb9126/src/EloquentTypecastTrait.php#L81-L91 |
226,595 | cviebrock/eloquent-typecast | src/EloquentTypecastTrait.php | EloquentTypecastTrait.castAttribute | protected function castAttribute($key, $value)
{
$type = $this->cast[$key];
try {
if ( is_null($value) ) {
return null;
}
if ( settype($value, $type) ) {
return $value;
}
throw new EloquentTypecastException("Value could not be cast to type \"$type\"", 1);
} catch (\Exception $e) {
... | php | protected function castAttribute($key, $value)
{
$type = $this->cast[$key];
try {
if ( is_null($value) ) {
return null;
}
if ( settype($value, $type) ) {
return $value;
}
throw new EloquentTypecastException("Value could not be cast to type \"$type\"", 1);
} catch (\Exception $e) {
... | [
"protected",
"function",
"castAttribute",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"$",
"type",
"=",
"$",
"this",
"->",
"cast",
"[",
"$",
"key",
"]",
";",
"try",
"{",
"if",
"(",
"is_null",
"(",
"$",
"value",
")",
")",
"{",
"return",
"null",
... | Cast an attribute to a PHP variable type.
@param string $key
@param mixed $value
@throws EloquentTypecastException
@return mixed | [
"Cast",
"an",
"attribute",
"to",
"a",
"PHP",
"variable",
"type",
"."
] | de74d085cd3fbedfaf0bb974041cd60faceb9126 | https://github.com/cviebrock/eloquent-typecast/blob/de74d085cd3fbedfaf0bb974041cd60faceb9126/src/EloquentTypecastTrait.php#L134-L150 |
226,596 | pug-php/js-phpize | src/JsPhpize/JsPhpizeOptions.php | JsPhpizeOptions.removePatterns | public function removePatterns($removeFunction)
{
$this->clearPatternsCache();
$this->options['patterns'] = array_filter($this->options['patterns'], $removeFunction);
return $this;
} | php | public function removePatterns($removeFunction)
{
$this->clearPatternsCache();
$this->options['patterns'] = array_filter($this->options['patterns'], $removeFunction);
return $this;
} | [
"public",
"function",
"removePatterns",
"(",
"$",
"removeFunction",
")",
"{",
"$",
"this",
"->",
"clearPatternsCache",
"(",
")",
";",
"$",
"this",
"->",
"options",
"[",
"'patterns'",
"]",
"=",
"array_filter",
"(",
"$",
"this",
"->",
"options",
"[",
"'patte... | Remove patterns using a filter function.
@param callable $removeFunction
@return $this | [
"Remove",
"patterns",
"using",
"a",
"filter",
"function",
"."
] | c41102da1be243ba9439b90af8b7032016585537 | https://github.com/pug-php/js-phpize/blob/c41102da1be243ba9439b90af8b7032016585537/src/JsPhpize/JsPhpizeOptions.php#L97-L104 |
226,597 | pug-php/js-phpize | src/JsPhpize/JsPhpizeOptions.php | JsPhpizeOptions.getPatterns | public function getPatterns()
{
if (!$this->patternsCache) {
$this->patternsCache = $this->getOption('patterns');
usort($this->patternsCache, function (Pattern $first, Pattern $second) {
return $first->priority - $second->priority;
});
}
r... | php | public function getPatterns()
{
if (!$this->patternsCache) {
$this->patternsCache = $this->getOption('patterns');
usort($this->patternsCache, function (Pattern $first, Pattern $second) {
return $first->priority - $second->priority;
});
}
r... | [
"public",
"function",
"getPatterns",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"patternsCache",
")",
"{",
"$",
"this",
"->",
"patternsCache",
"=",
"$",
"this",
"->",
"getOption",
"(",
"'patterns'",
")",
";",
"usort",
"(",
"$",
"this",
"->",
"... | Return cached and ordered patterns list.
@return array | [
"Return",
"cached",
"and",
"ordered",
"patterns",
"list",
"."
] | c41102da1be243ba9439b90af8b7032016585537 | https://github.com/pug-php/js-phpize/blob/c41102da1be243ba9439b90af8b7032016585537/src/JsPhpize/JsPhpizeOptions.php#L111-L121 |
226,598 | pug-php/js-phpize | src/JsPhpize/JsPhpizeOptions.php | JsPhpizeOptions.getHelperName | public function getHelperName($key)
{
$helpers = $this->getOption('helpers', []);
return is_array($helpers) && isset($helpers[$key])
? $helpers[$key]
: $key;
} | php | public function getHelperName($key)
{
$helpers = $this->getOption('helpers', []);
return is_array($helpers) && isset($helpers[$key])
? $helpers[$key]
: $key;
} | [
"public",
"function",
"getHelperName",
"(",
"$",
"key",
")",
"{",
"$",
"helpers",
"=",
"$",
"this",
"->",
"getOption",
"(",
"'helpers'",
",",
"[",
"]",
")",
";",
"return",
"is_array",
"(",
"$",
"helpers",
")",
"&&",
"isset",
"(",
"$",
"helpers",
"[",... | Retrieve the prefix of specific variables.
@return string | [
"Retrieve",
"the",
"prefix",
"of",
"specific",
"variables",
"."
] | c41102da1be243ba9439b90af8b7032016585537 | https://github.com/pug-php/js-phpize/blob/c41102da1be243ba9439b90af8b7032016585537/src/JsPhpize/JsPhpizeOptions.php#L163-L170 |
226,599 | CedrickOka/oka-pagination | src/Util/PaginationQuery.php | PaginationQuery.createCountQuery | protected function createCountQuery(array $fields = [], array $criteria = [], $distinct = true)
{
if ($this->objectManager instanceof \Doctrine\ORM\EntityManager) {
/** @var \Doctrine\ORM\QueryBuilder $builder */
$builder = $this->objectManager->createQueryBuilder();
if (empty($fields)) {
/** @var \... | php | protected function createCountQuery(array $fields = [], array $criteria = [], $distinct = true)
{
if ($this->objectManager instanceof \Doctrine\ORM\EntityManager) {
/** @var \Doctrine\ORM\QueryBuilder $builder */
$builder = $this->objectManager->createQueryBuilder();
if (empty($fields)) {
/** @var \... | [
"protected",
"function",
"createCountQuery",
"(",
"array",
"$",
"fields",
"=",
"[",
"]",
",",
"array",
"$",
"criteria",
"=",
"[",
"]",
",",
"$",
"distinct",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"objectManager",
"instanceof",
"\\",
"Doct... | Create internal count items query
@param array $fields
@param array $criteria
@param bool $distinct
@return \Doctrine\ORM\AbstractQuery|\Doctrine\ODM\MongoDB\Query\Query | [
"Create",
"internal",
"count",
"items",
"query"
] | d31dcdda62a60cc5e679993c90f02c61e8131c92 | https://github.com/CedrickOka/oka-pagination/blob/d31dcdda62a60cc5e679993c90f02c61e8131c92/src/Util/PaginationQuery.php#L372-L404 |
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.