id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
20,600 | WellCommerce/AppBundle | Service/Currency/Importer/AbstractExchangeRatesImporter.php | AbstractExchangeRatesImporter.addUpdateExchangeRate | protected function addUpdateExchangeRate($currencyFrom, $currencyTo, $rate)
{
if (!in_array($currencyTo, $this->managedCurrencies)) {
return false;
}
$exchangeRate = $this->currencyRateRepository->findOneBy([
'currencyFrom' => $currencyFrom,
'curr... | php | protected function addUpdateExchangeRate($currencyFrom, $currencyTo, $rate)
{
if (!in_array($currencyTo, $this->managedCurrencies)) {
return false;
}
$exchangeRate = $this->currencyRateRepository->findOneBy([
'currencyFrom' => $currencyFrom,
'curr... | [
"protected",
"function",
"addUpdateExchangeRate",
"(",
"$",
"currencyFrom",
",",
"$",
"currencyTo",
",",
"$",
"rate",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"currencyTo",
",",
"$",
"this",
"->",
"managedCurrencies",
")",
")",
"{",
"return",
"false... | Adds new rate or updates existing one
@param string $currencyFrom
@param string $currencyTo
@param float $rate | [
"Adds",
"new",
"rate",
"or",
"updates",
"existing",
"one"
] | 2add687d1c898dd0b24afd611d896e3811a0eac3 | https://github.com/WellCommerce/AppBundle/blob/2add687d1c898dd0b24afd611d896e3811a0eac3/Service/Currency/Importer/AbstractExchangeRatesImporter.php#L72-L94 |
20,601 | tystuyfzand/flysystem-seaweedfs | src/Mapping/CacheMapper.php | CacheMapper.store | public function store($path, $fileId, $mimeType, $size) {
$this->cache->put('seaweedfs.' . md5($path), [
'fid' => $fileId,
'mimeType' => $mimeType,
'size' => $size
]);
} | php | public function store($path, $fileId, $mimeType, $size) {
$this->cache->put('seaweedfs.' . md5($path), [
'fid' => $fileId,
'mimeType' => $mimeType,
'size' => $size
]);
} | [
"public",
"function",
"store",
"(",
"$",
"path",
",",
"$",
"fileId",
",",
"$",
"mimeType",
",",
"$",
"size",
")",
"{",
"$",
"this",
"->",
"cache",
"->",
"put",
"(",
"'seaweedfs.'",
".",
"md5",
"(",
"$",
"path",
")",
",",
"[",
"'fid'",
"=>",
"$",
... | Store a path to a seaweedfs file id
@param $path
@param $fileId
@param $mimeType
@param $size
@return mixed | [
"Store",
"a",
"path",
"to",
"a",
"seaweedfs",
"file",
"id"
] | 992334ba1d8e26fe6bbb9e33feedbf66b4872613 | https://github.com/tystuyfzand/flysystem-seaweedfs/blob/992334ba1d8e26fe6bbb9e33feedbf66b4872613/src/Mapping/CacheMapper.php#L32-L38 |
20,602 | zhouyl/mellivora | Mellivora/View/Factory.php | Factory.render | public function render($view, $data = [], $mergeData = [])
{
return $this->make($view, $this->parseData($data), $mergeData)->render();
} | php | public function render($view, $data = [], $mergeData = [])
{
return $this->make($view, $this->parseData($data), $mergeData)->render();
} | [
"public",
"function",
"render",
"(",
"$",
"view",
",",
"$",
"data",
"=",
"[",
"]",
",",
"$",
"mergeData",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"make",
"(",
"$",
"view",
",",
"$",
"this",
"->",
"parseData",
"(",
"$",
"data",
")"... | Get the rendered content of the view based
@param string $view
@param array $data
@param array $mergeData
@return string | [
"Get",
"the",
"rendered",
"content",
"of",
"the",
"view",
"based"
] | 79f844c5c9c25ffbe18d142062e9bc3df00b36a1 | https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/View/Factory.php#L149-L152 |
20,603 | gpupo/common-schema | src/ORM/Entity/Banking/Report/Report.php | Report.addRecord | public function addRecord(\Gpupo\CommonSchema\ORM\Entity\Banking\Report\Record $record)
{
$this->records[] = $record;
return $this;
} | php | public function addRecord(\Gpupo\CommonSchema\ORM\Entity\Banking\Report\Record $record)
{
$this->records[] = $record;
return $this;
} | [
"public",
"function",
"addRecord",
"(",
"\\",
"Gpupo",
"\\",
"CommonSchema",
"\\",
"ORM",
"\\",
"Entity",
"\\",
"Banking",
"\\",
"Report",
"\\",
"Record",
"$",
"record",
")",
"{",
"$",
"this",
"->",
"records",
"[",
"]",
"=",
"$",
"record",
";",
"return... | Add record.
@param \Gpupo\CommonSchema\ORM\Entity\Banking\Report\Record $record
@return Report | [
"Add",
"record",
"."
] | a762d2eb3063b7317c72c69cbb463b1f95b86b0a | https://github.com/gpupo/common-schema/blob/a762d2eb3063b7317c72c69cbb463b1f95b86b0a/src/ORM/Entity/Banking/Report/Report.php#L403-L408 |
20,604 | gpupo/common-schema | src/ORM/Entity/Banking/Report/Report.php | Report.removeRecord | public function removeRecord(\Gpupo\CommonSchema\ORM\Entity\Banking\Report\Record $record)
{
return $this->records->removeElement($record);
} | php | public function removeRecord(\Gpupo\CommonSchema\ORM\Entity\Banking\Report\Record $record)
{
return $this->records->removeElement($record);
} | [
"public",
"function",
"removeRecord",
"(",
"\\",
"Gpupo",
"\\",
"CommonSchema",
"\\",
"ORM",
"\\",
"Entity",
"\\",
"Banking",
"\\",
"Report",
"\\",
"Record",
"$",
"record",
")",
"{",
"return",
"$",
"this",
"->",
"records",
"->",
"removeElement",
"(",
"$",
... | Remove record.
@param \Gpupo\CommonSchema\ORM\Entity\Banking\Report\Record $record
@return bool TRUE if this collection contained the specified element, FALSE otherwise | [
"Remove",
"record",
"."
] | a762d2eb3063b7317c72c69cbb463b1f95b86b0a | https://github.com/gpupo/common-schema/blob/a762d2eb3063b7317c72c69cbb463b1f95b86b0a/src/ORM/Entity/Banking/Report/Report.php#L417-L420 |
20,605 | nabab/bbn | src/bbn/file/system2.php | system2._check_filter | private function _check_filter($item, $filter): bool
{
if ( $filter ){
if ( is_string($filter) ){
return strtolower(substr(\is_array($item) ? $item['path'] : $item, - strlen($filter))) === strtolower($filter);
}
if ( is_callable($filter) ){
return $filter($item);
}
}
... | php | private function _check_filter($item, $filter): bool
{
if ( $filter ){
if ( is_string($filter) ){
return strtolower(substr(\is_array($item) ? $item['path'] : $item, - strlen($filter))) === strtolower($filter);
}
if ( is_callable($filter) ){
return $filter($item);
}
}
... | [
"private",
"function",
"_check_filter",
"(",
"$",
"item",
",",
"$",
"filter",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"filter",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"filter",
")",
")",
"{",
"return",
"strtolower",
"(",
"substr",
"(",
"\\",
"i... | Checks if the given files name ends with the given suffix string
@param array|string $item
@param callable|string $filter
@return bool | [
"Checks",
"if",
"the",
"given",
"files",
"name",
"ends",
"with",
"the",
"given",
"suffix",
"string"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/file/system2.php#L142-L153 |
20,606 | surebert/surebert-framework | src/sb/Email.php | Email.addIcalendarEvent | public function addIcalendarEvent(\sb\ICalendar\Event $event)
{
$a = new \sb\Email\Attachment();
$a->mime_type = 'text/calendar;';
$a->setEncoding('8bit');
$a->name = 'event.ics';
$a->contents = $event->__toString();
$this->addAttachment($a);
} | php | public function addIcalendarEvent(\sb\ICalendar\Event $event)
{
$a = new \sb\Email\Attachment();
$a->mime_type = 'text/calendar;';
$a->setEncoding('8bit');
$a->name = 'event.ics';
$a->contents = $event->__toString();
$this->addAttachment($a);
} | [
"public",
"function",
"addIcalendarEvent",
"(",
"\\",
"sb",
"\\",
"ICalendar",
"\\",
"Event",
"$",
"event",
")",
"{",
"$",
"a",
"=",
"new",
"\\",
"sb",
"\\",
"Email",
"\\",
"Attachment",
"(",
")",
";",
"$",
"a",
"->",
"mime_type",
"=",
"'text/calendar;... | Add an \sb\ICalendar\Event request
@param \sb\ICalendar\Event $event | [
"Add",
"an",
"\\",
"sb",
"\\",
"ICalendar",
"\\",
"Event",
"request"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Email.php#L234-L244 |
20,607 | surebert/surebert-framework | src/sb/Email.php | Email.onBeforeSend | public function onBeforeSend()
{
if(!isset($this->__added_sent_by_stamp)){
$this->body .= "\n\nSent Using Surebert Mail"
." recorded: \nSending IP: " . \sb\Gateway::$remote_addr
. " \nSending Host: " . \sb\Gateway::$http_host;
if (!empty($this->body_... | php | public function onBeforeSend()
{
if(!isset($this->__added_sent_by_stamp)){
$this->body .= "\n\nSent Using Surebert Mail"
." recorded: \nSending IP: " . \sb\Gateway::$remote_addr
. " \nSending Host: " . \sb\Gateway::$http_host;
if (!empty($this->body_... | [
"public",
"function",
"onBeforeSend",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"__added_sent_by_stamp",
")",
")",
"{",
"$",
"this",
"->",
"body",
".=",
"\"\\n\\nSent Using Surebert Mail\"",
".",
"\" recorded: \\nSending IP: \"",
".",
"\\",... | Fires before sending, if returns false, then sending does not occur
@return boolean | [
"Fires",
"before",
"sending",
"if",
"returns",
"false",
"then",
"sending",
"does",
"not",
"occur"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Email.php#L256-L275 |
20,608 | surebert/surebert-framework | src/sb/Email.php | Email.send | public function send($outbox=null)
{
if($outbox instanceof Writer){
self::$outbox = $outbox;
} elseif(!self::$outbox){
self::$outbox = new Writer();
}
if($this->onBeforeSend($this) !== false){
self::$outbox->addEmailToOutbox($this);
... | php | public function send($outbox=null)
{
if($outbox instanceof Writer){
self::$outbox = $outbox;
} elseif(!self::$outbox){
self::$outbox = new Writer();
}
if($this->onBeforeSend($this) !== false){
self::$outbox->addEmailToOutbox($this);
... | [
"public",
"function",
"send",
"(",
"$",
"outbox",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"outbox",
"instanceof",
"Writer",
")",
"{",
"self",
"::",
"$",
"outbox",
"=",
"$",
"outbox",
";",
"}",
"elseif",
"(",
"!",
"self",
"::",
"$",
"outbox",
")",
... | Uses sb_Email_Writer to send the email | [
"Uses",
"sb_Email_Writer",
"to",
"send",
"the",
"email"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Email.php#L279-L296 |
20,609 | gedex/php-janrain-api | lib/Janrain/Api/Engage/Mapping.php | Mapping.map | public function map(array $params)
{
if (!isset($params['ientifier'])) {
throw new MissingArgumentException('identifier');
}
if (!isset($params['primaryKey'])) {
throw new MissingArgumentException('primaryKey');
}
if (!isset($params['format'])) {
$params['format'] = 'json';
}
return $this->po... | php | public function map(array $params)
{
if (!isset($params['ientifier'])) {
throw new MissingArgumentException('identifier');
}
if (!isset($params['primaryKey'])) {
throw new MissingArgumentException('primaryKey');
}
if (!isset($params['format'])) {
$params['format'] = 'json';
}
return $this->po... | [
"public",
"function",
"map",
"(",
"array",
"$",
"params",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"params",
"[",
"'ientifier'",
"]",
")",
")",
"{",
"throw",
"new",
"MissingArgumentException",
"(",
"'identifier'",
")",
";",
"}",
"if",
"(",
"!",
"... | Associates a primary key with a user's social identity.
@param array $params | [
"Associates",
"a",
"primary",
"key",
"with",
"a",
"user",
"s",
"social",
"identity",
"."
] | 6283f68454e0ad5211ac620f1d337df38cd49597 | https://github.com/gedex/php-janrain-api/blob/6283f68454e0ad5211ac620f1d337df38cd49597/lib/Janrain/Api/Engage/Mapping.php#L27-L42 |
20,610 | gedex/php-janrain-api | lib/Janrain/Api/Engage/Mapping.php | Mapping.unmap | public function unmap(array $params)
{
if (!isset($params['ientifier'])) {
throw new MissingArgumentException('identifier');
}
if (!isset($params['all_identifiers'])) {
throw new MissingArgumentException('all_identifiers');
}
if (!isset($params['primaryKey'])) {
throw new MissingArgumentException(... | php | public function unmap(array $params)
{
if (!isset($params['ientifier'])) {
throw new MissingArgumentException('identifier');
}
if (!isset($params['all_identifiers'])) {
throw new MissingArgumentException('all_identifiers');
}
if (!isset($params['primaryKey'])) {
throw new MissingArgumentException(... | [
"public",
"function",
"unmap",
"(",
"array",
"$",
"params",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"params",
"[",
"'ientifier'",
"]",
")",
")",
"{",
"throw",
"new",
"MissingArgumentException",
"(",
"'identifier'",
")",
";",
"}",
"if",
"(",
"!",
... | Removes an identity provider from a primary key as well as allowing you to
optionally unlink your application from the user's account with the provider.
@param array $params | [
"Removes",
"an",
"identity",
"provider",
"from",
"a",
"primary",
"key",
"as",
"well",
"as",
"allowing",
"you",
"to",
"optionally",
"unlink",
"your",
"application",
"from",
"the",
"user",
"s",
"account",
"with",
"the",
"provider",
"."
] | 6283f68454e0ad5211ac620f1d337df38cd49597 | https://github.com/gedex/php-janrain-api/blob/6283f68454e0ad5211ac620f1d337df38cd49597/lib/Janrain/Api/Engage/Mapping.php#L62-L85 |
20,611 | odiaseo/pagebuilder | src/PageBuilder/Controller/PageController.php | PageController.get | public function get($id)
{
return $this->_sendPayload(
$this->_getService($this->_pageServiceKey)->getPageLayout($id)
);
} | php | public function get($id)
{
return $this->_sendPayload(
$this->_getService($this->_pageServiceKey)->getPageLayout($id)
);
} | [
"public",
"function",
"get",
"(",
"$",
"id",
")",
"{",
"return",
"$",
"this",
"->",
"_sendPayload",
"(",
"$",
"this",
"->",
"_getService",
"(",
"$",
"this",
"->",
"_pageServiceKey",
")",
"->",
"getPageLayout",
"(",
"$",
"id",
")",
")",
";",
"}"
] | Get page layout details
@param mixed $id
@return mixed|\Zend\View\Model\ModelInterface | [
"Get",
"page",
"layout",
"details"
] | 88ef7cccf305368561307efe4ca07fac8e5774f3 | https://github.com/odiaseo/pagebuilder/blob/88ef7cccf305368561307efe4ca07fac8e5774f3/src/PageBuilder/Controller/PageController.php#L19-L24 |
20,612 | gpupo/common-schema | src/ORM/Entity/Banking/Report/Record.php | Record.setReport | public function setReport(\Gpupo\CommonSchema\ORM\Entity\Banking\Report\Report $report = null)
{
$this->report = $report;
return $this;
} | php | public function setReport(\Gpupo\CommonSchema\ORM\Entity\Banking\Report\Report $report = null)
{
$this->report = $report;
return $this;
} | [
"public",
"function",
"setReport",
"(",
"\\",
"Gpupo",
"\\",
"CommonSchema",
"\\",
"ORM",
"\\",
"Entity",
"\\",
"Banking",
"\\",
"Report",
"\\",
"Report",
"$",
"report",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"report",
"=",
"$",
"report",
";",
"retu... | Set report.
@param null|\Gpupo\CommonSchema\ORM\Entity\Banking\Report\Report $report
@return Record | [
"Set",
"report",
"."
] | a762d2eb3063b7317c72c69cbb463b1f95b86b0a | https://github.com/gpupo/common-schema/blob/a762d2eb3063b7317c72c69cbb463b1f95b86b0a/src/ORM/Entity/Banking/Report/Record.php#L615-L620 |
20,613 | oroinc/OroLayoutComponent | ContextDataCollection.php | ContextDataCollection.get | public function get($name)
{
if (!isset($this->items[$name])
&& !array_key_exists($name, $this->items)
&& !$this->applyDefaultValue($name)
) {
throw new \OutOfBoundsException(sprintf('Undefined data item index: %s.', $name));
};
return $this->item... | php | public function get($name)
{
if (!isset($this->items[$name])
&& !array_key_exists($name, $this->items)
&& !$this->applyDefaultValue($name)
) {
throw new \OutOfBoundsException(sprintf('Undefined data item index: %s.', $name));
};
return $this->item... | [
"public",
"function",
"get",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"items",
"[",
"$",
"name",
"]",
")",
"&&",
"!",
"array_key_exists",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"items",
")",
"&&",
"!",
"$"... | Gets a value stored in the context data variable.
@param string $name The data item name
@return mixed
@throws \OutOfBoundsException if the data item does not exist | [
"Gets",
"a",
"value",
"stored",
"in",
"the",
"context",
"data",
"variable",
"."
] | 682a96672393d81c63728e47c4a4c3618c515be0 | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/ContextDataCollection.php#L48-L58 |
20,614 | webdevvie/pheanstalk-task-queue-bundle | Command/AbstractWorker.php | AbstractWorker.logException | protected function logException(\Exception $exception)
{
$this->logger->error(
$exception->getMessage(),
array(
'class'=>get_class($exception),
'message'=>$exception->getMessage(),
'file'=>$exception->getMessage(),
'line... | php | protected function logException(\Exception $exception)
{
$this->logger->error(
$exception->getMessage(),
array(
'class'=>get_class($exception),
'message'=>$exception->getMessage(),
'file'=>$exception->getMessage(),
'line... | [
"protected",
"function",
"logException",
"(",
"\\",
"Exception",
"$",
"exception",
")",
"{",
"$",
"this",
"->",
"logger",
"->",
"error",
"(",
"$",
"exception",
"->",
"getMessage",
"(",
")",
",",
"array",
"(",
"'class'",
"=>",
"get_class",
"(",
"$",
"exce... | Logs an exception to the logger
@param \Exception $exception
@return void | [
"Logs",
"an",
"exception",
"to",
"the",
"logger"
] | db5e63a8f844e345dc2e69ce8e94b32d851020eb | https://github.com/webdevvie/pheanstalk-task-queue-bundle/blob/db5e63a8f844e345dc2e69ce8e94b32d851020eb/Command/AbstractWorker.php#L133-L145 |
20,615 | surebert/surebert-framework | src/sb/Validate/ContactInfo.php | ContactInfo.zip | public static function zip($zip, $check_usps = true) {
$result = new \sb\Validate\Results();
$result->value = $zip;
$result->is_valid = false;
if (preg_match("/^(\d{5})(-\d{4})*$/", $zip)) {
$result->message = "Valid zip code format";
$result->is_valid = true;
... | php | public static function zip($zip, $check_usps = true) {
$result = new \sb\Validate\Results();
$result->value = $zip;
$result->is_valid = false;
if (preg_match("/^(\d{5})(-\d{4})*$/", $zip)) {
$result->message = "Valid zip code format";
$result->is_valid = true;
... | [
"public",
"static",
"function",
"zip",
"(",
"$",
"zip",
",",
"$",
"check_usps",
"=",
"true",
")",
"{",
"$",
"result",
"=",
"new",
"\\",
"sb",
"\\",
"Validate",
"\\",
"Results",
"(",
")",
";",
"$",
"result",
"->",
"value",
"=",
"$",
"zip",
";",
"$... | Validates a zip code
@author paul.visco@roswellpark.org
@version 1.2 13/18/2008
@param string $zip The zip code to validate in xxxxx or xxxxx-xxxx format
@param boolean check_usps Check the usps sie look for validation
@return \sb\Validate_Results The message property includes the city if it exists | [
"Validates",
"a",
"zip",
"code"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Validate/ContactInfo.php#L133-L169 |
20,616 | PayBreak/foundation | src/Decision/Risk.php | Risk.normalize | public static function normalize($risk)
{
return (float) max(min($risk, self::MAXIMUM_RISK), self::MINIMUM_RISK);
} | php | public static function normalize($risk)
{
return (float) max(min($risk, self::MAXIMUM_RISK), self::MINIMUM_RISK);
} | [
"public",
"static",
"function",
"normalize",
"(",
"$",
"risk",
")",
"{",
"return",
"(",
"float",
")",
"max",
"(",
"min",
"(",
"$",
"risk",
",",
"self",
"::",
"MAXIMUM_RISK",
")",
",",
"self",
"::",
"MINIMUM_RISK",
")",
";",
"}"
] | Normalize Risk - make sure that risk will be in bound
@author WN
@param $risk
@return float <0,1> | [
"Normalize",
"Risk",
"-",
"make",
"sure",
"that",
"risk",
"will",
"be",
"in",
"bound"
] | 3dc5a5791e0c95abefa2a415a7f9fdb5abb62ca4 | https://github.com/PayBreak/foundation/blob/3dc5a5791e0c95abefa2a415a7f9fdb5abb62ca4/src/Decision/Risk.php#L65-L68 |
20,617 | Smile-SA/EzUICronBundle | Controller/StatusController.php | StatusController.listAction | public function listAction()
{
$this->performAccessChecks();
$crons = $this->cronService->listCronsStatus();
$cronRows = array();
foreach ($crons as $cron) {
$cronRows[] = array(
'alias' => $cron->getAlias(),
'queued' => $cron instanceof ... | php | public function listAction()
{
$this->performAccessChecks();
$crons = $this->cronService->listCronsStatus();
$cronRows = array();
foreach ($crons as $cron) {
$cronRows[] = array(
'alias' => $cron->getAlias(),
'queued' => $cron instanceof ... | [
"public",
"function",
"listAction",
"(",
")",
"{",
"$",
"this",
"->",
"performAccessChecks",
"(",
")",
";",
"$",
"crons",
"=",
"$",
"this",
"->",
"cronService",
"->",
"listCronsStatus",
"(",
")",
";",
"$",
"cronRows",
"=",
"array",
"(",
")",
";",
"fore... | List crons status
@return \Symfony\Component\HttpFoundation\Response | [
"List",
"crons",
"status"
] | c62fc6a3ab0b39e3f911742d9affe4aade90cf66 | https://github.com/Smile-SA/EzUICronBundle/blob/c62fc6a3ab0b39e3f911742d9affe4aade90cf66/Controller/StatusController.php#L33-L59 |
20,618 | philiplb/Valdi | src/Valdi/Validator.php | Validator.createValidators | protected function createValidators(array $validators) {
$this->availableValidators = [];
foreach ($validators as $name => $type) {
$class = '\\Valdi\\Validator\\'.$type;
$this->availableValidators[$name] = new $class();
}
} | php | protected function createValidators(array $validators) {
$this->availableValidators = [];
foreach ($validators as $name => $type) {
$class = '\\Valdi\\Validator\\'.$type;
$this->availableValidators[$name] = new $class();
}
} | [
"protected",
"function",
"createValidators",
"(",
"array",
"$",
"validators",
")",
"{",
"$",
"this",
"->",
"availableValidators",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"validators",
"as",
"$",
"name",
"=>",
"$",
"type",
")",
"{",
"$",
"class",
"=",
... | Creates instances of the available validators.
@param array $validators
the validators to load, key = name, value = classname within the
namespace "\Valdi\Validator" | [
"Creates",
"instances",
"of",
"the",
"available",
"validators",
"."
] | 9927ec34a2cb00cec705e952d3c2374e2dc3c972 | https://github.com/philiplb/Valdi/blob/9927ec34a2cb00cec705e952d3c2374e2dc3c972/src/Valdi/Validator.php#L34-L40 |
20,619 | philiplb/Valdi | src/Valdi/Validator.php | Validator.isValidRule | protected function isValidRule($validator, $parameters, $value) {
if (!array_key_exists($validator, $this->availableValidators)) {
throw new ValidatorException('"'.$validator.'" not found as available validator.');
}
return $this->availableValidators[$validator]->isValid($value, $par... | php | protected function isValidRule($validator, $parameters, $value) {
if (!array_key_exists($validator, $this->availableValidators)) {
throw new ValidatorException('"'.$validator.'" not found as available validator.');
}
return $this->availableValidators[$validator]->isValid($value, $par... | [
"protected",
"function",
"isValidRule",
"(",
"$",
"validator",
",",
"$",
"parameters",
",",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"validator",
",",
"$",
"this",
"->",
"availableValidators",
")",
")",
"{",
"throw",
"new",
"... | Validates a single rule.
@param string $validator
the validator to use
@param string[] $parameters
the validation parameters, depending on the validator
@param string $value
the value to validate
@return boolean
true if the value is valid
@throws ValidationException
thrown if the validator is not available | [
"Validates",
"a",
"single",
"rule",
"."
] | 9927ec34a2cb00cec705e952d3c2374e2dc3c972 | https://github.com/philiplb/Valdi/blob/9927ec34a2cb00cec705e952d3c2374e2dc3c972/src/Valdi/Validator.php#L58-L64 |
20,620 | philiplb/Valdi | src/Valdi/Validator.php | Validator.isValidValue | public function isValidValue($rules, $value) {
$result = [];
foreach ($rules as $rule) {
$parameters = $rule;
$name = array_shift($parameters);
$valid = $this->isValidRule($name, $parameters, $value);
if ($valid !== null) {
$resu... | php | public function isValidValue($rules, $value) {
$result = [];
foreach ($rules as $rule) {
$parameters = $rule;
$name = array_shift($parameters);
$valid = $this->isValidRule($name, $parameters, $value);
if ($valid !== null) {
$resu... | [
"public",
"function",
"isValidValue",
"(",
"$",
"rules",
",",
"$",
"value",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"rules",
"as",
"$",
"rule",
")",
"{",
"$",
"parameters",
"=",
"$",
"rule",
";",
"$",
"name",
"=",
"array... | Validates a value via the given rules.
@param array $rules
the validation rules
@param string $value
the value to validate
@return string[]
the fields where the validation failed | [
"Validates",
"a",
"value",
"via",
"the",
"given",
"rules",
"."
] | 9927ec34a2cb00cec705e952d3c2374e2dc3c972 | https://github.com/philiplb/Valdi/blob/9927ec34a2cb00cec705e952d3c2374e2dc3c972/src/Valdi/Validator.php#L114-L125 |
20,621 | philiplb/Valdi | src/Valdi/Validator.php | Validator.isValid | public function isValid(array $rules, array $data) {
$errors = [];
foreach ($rules as $field => $fieldRules) {
$value = isset($data[$field]) ? $data[$field] : null;
$fieldErrors = $this->isValidValue($fieldRules, $value);
if (!empty($fieldErrors)) {
... | php | public function isValid(array $rules, array $data) {
$errors = [];
foreach ($rules as $field => $fieldRules) {
$value = isset($data[$field]) ? $data[$field] : null;
$fieldErrors = $this->isValidValue($fieldRules, $value);
if (!empty($fieldErrors)) {
... | [
"public",
"function",
"isValid",
"(",
"array",
"$",
"rules",
",",
"array",
"$",
"data",
")",
"{",
"$",
"errors",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"rules",
"as",
"$",
"field",
"=>",
"$",
"fieldRules",
")",
"{",
"$",
"value",
"=",
"isset",
... | Performs the actual validation.
@param array $rules
the validation rules: an array with a field name as key and an array
of rules to use for this field; each rule is an array with the validator
name as first element and parameters as following elements; example:
array('a' => array(array('required')), 'b' => array(arra... | [
"Performs",
"the",
"actual",
"validation",
"."
] | 9927ec34a2cb00cec705e952d3c2374e2dc3c972 | https://github.com/philiplb/Valdi/blob/9927ec34a2cb00cec705e952d3c2374e2dc3c972/src/Valdi/Validator.php#L148-L161 |
20,622 | mrgarry/yii2-omj-fidavista | FidavistaStatement.php | FidavistaStatement.saveToDb | public function saveToDb($incomingOnly = false) {
$count = ($incomingOnly) ? $this->dbInterface->executeDataImportIncoming() : $this->dbInterface->executeDataImport();
return $count;
} | php | public function saveToDb($incomingOnly = false) {
$count = ($incomingOnly) ? $this->dbInterface->executeDataImportIncoming() : $this->dbInterface->executeDataImport();
return $count;
} | [
"public",
"function",
"saveToDb",
"(",
"$",
"incomingOnly",
"=",
"false",
")",
"{",
"$",
"count",
"=",
"(",
"$",
"incomingOnly",
")",
"?",
"$",
"this",
"->",
"dbInterface",
"->",
"executeDataImportIncoming",
"(",
")",
":",
"$",
"this",
"->",
"dbInterface",... | Saves the data to DB using iAccountStatementDbController
@param bool $incomingOnly
@return int Optinally can be implemented in iAccountStatementDbController - num of rows imported | [
"Saves",
"the",
"data",
"to",
"DB",
"using",
"iAccountStatementDbController"
] | ee4ecadd6648b68e891352c214ff33a72622941b | https://github.com/mrgarry/yii2-omj-fidavista/blob/ee4ecadd6648b68e891352c214ff33a72622941b/FidavistaStatement.php#L259-L262 |
20,623 | zhouyl/mellivora | Mellivora/View/Concerns/ManagesLoops.php | ManagesLoops.addLoop | public function addLoop($data)
{
$length = is_array($data) || $data instanceof Countable ? count($data) : null;
$parent = Arr::last($this->loopsStack);
$this->loopsStack[] = [
'iteration' => 0,
'index' => 0,
'remaining' => isset($length) ? $length : ... | php | public function addLoop($data)
{
$length = is_array($data) || $data instanceof Countable ? count($data) : null;
$parent = Arr::last($this->loopsStack);
$this->loopsStack[] = [
'iteration' => 0,
'index' => 0,
'remaining' => isset($length) ? $length : ... | [
"public",
"function",
"addLoop",
"(",
"$",
"data",
")",
"{",
"$",
"length",
"=",
"is_array",
"(",
"$",
"data",
")",
"||",
"$",
"data",
"instanceof",
"Countable",
"?",
"count",
"(",
"$",
"data",
")",
":",
"null",
";",
"$",
"parent",
"=",
"Arr",
"::"... | Add new loop to the stack.
@param array|\Countable $data
@return void | [
"Add",
"new",
"loop",
"to",
"the",
"stack",
"."
] | 79f844c5c9c25ffbe18d142062e9bc3df00b36a1 | https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/View/Concerns/ManagesLoops.php#L24-L40 |
20,624 | zhouyl/mellivora | Mellivora/View/Concerns/ManagesLoops.php | ManagesLoops.incrementLoopIndices | public function incrementLoopIndices()
{
$loop = $this->loopsStack[$index = count($this->loopsStack) - 1];
$this->loopsStack[$index] = array_merge($this->loopsStack[$index], [
'iteration' => $loop['iteration'] + 1,
'index' => $loop['iteration'],
'first' =... | php | public function incrementLoopIndices()
{
$loop = $this->loopsStack[$index = count($this->loopsStack) - 1];
$this->loopsStack[$index] = array_merge($this->loopsStack[$index], [
'iteration' => $loop['iteration'] + 1,
'index' => $loop['iteration'],
'first' =... | [
"public",
"function",
"incrementLoopIndices",
"(",
")",
"{",
"$",
"loop",
"=",
"$",
"this",
"->",
"loopsStack",
"[",
"$",
"index",
"=",
"count",
"(",
"$",
"this",
"->",
"loopsStack",
")",
"-",
"1",
"]",
";",
"$",
"this",
"->",
"loopsStack",
"[",
"$",... | Increment the top loop's indices.
@return void | [
"Increment",
"the",
"top",
"loop",
"s",
"indices",
"."
] | 79f844c5c9c25ffbe18d142062e9bc3df00b36a1 | https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/View/Concerns/ManagesLoops.php#L47-L58 |
20,625 | expectation-php/expect | src/MatcherEvaluator.php | MatcherEvaluator.evaluate | public function evaluate($actual)
{
$matcherResult = $this->matcher->match($actual);
$expected = $this->negated ? false : true;
$result = $matcherResult === $expected;
return new Result($actual, $this->negated, $this->matcher, $result);
} | php | public function evaluate($actual)
{
$matcherResult = $this->matcher->match($actual);
$expected = $this->negated ? false : true;
$result = $matcherResult === $expected;
return new Result($actual, $this->negated, $this->matcher, $result);
} | [
"public",
"function",
"evaluate",
"(",
"$",
"actual",
")",
"{",
"$",
"matcherResult",
"=",
"$",
"this",
"->",
"matcher",
"->",
"match",
"(",
"$",
"actual",
")",
";",
"$",
"expected",
"=",
"$",
"this",
"->",
"negated",
"?",
"false",
":",
"true",
";",
... | Evaluate the value of actual.
@param mixed $actual value of actual
@return \expect\Result | [
"Evaluate",
"the",
"value",
"of",
"actual",
"."
] | 1a32c5af37f3dc8dabe4e8eedeeb21aea16ce139 | https://github.com/expectation-php/expect/blob/1a32c5af37f3dc8dabe4e8eedeeb21aea16ce139/src/MatcherEvaluator.php#L92-L100 |
20,626 | ronaldborla/chikka | src/Borla/Chikka/Support/Utilities.php | Utilities.parseMobileNumber | static function parseMobileNumber($number) {
// Extract numerics
$numerics = static::extractNumerics($number);
// Set country code
$countryCode = '';
// Get last 10 digits
$short = static::right($numerics, 10, $countryCode);
// Set carrier code
$carriercode = '';
// Get number
$n... | php | static function parseMobileNumber($number) {
// Extract numerics
$numerics = static::extractNumerics($number);
// Set country code
$countryCode = '';
// Get last 10 digits
$short = static::right($numerics, 10, $countryCode);
// Set carrier code
$carriercode = '';
// Get number
$n... | [
"static",
"function",
"parseMobileNumber",
"(",
"$",
"number",
")",
"{",
"// Extract numerics",
"$",
"numerics",
"=",
"static",
"::",
"extractNumerics",
"(",
"$",
"number",
")",
";",
"// Set country code",
"$",
"countryCode",
"=",
"''",
";",
"// Get last 10 digits... | Parse mobile number | [
"Parse",
"mobile",
"number"
] | 446987706f81d5a0efbc8bd6b7d3b259d0527719 | https://github.com/ronaldborla/chikka/blob/446987706f81d5a0efbc8bd6b7d3b259d0527719/src/Borla/Chikka/Support/Utilities.php#L52-L65 |
20,627 | ronaldborla/chikka | src/Borla/Chikka/Support/Utilities.php | Utilities.arrayExtract | static function arrayExtract(array $keys, array $array, array $callbacks = []) {
// Set extracted
$extracted = [];
// Loop through keys
foreach ($keys as $key) {
// Add to extracted, only if it exists
if (array_key_exists($key, $array)) {
// Set item
$item = $array[$key];
... | php | static function arrayExtract(array $keys, array $array, array $callbacks = []) {
// Set extracted
$extracted = [];
// Loop through keys
foreach ($keys as $key) {
// Add to extracted, only if it exists
if (array_key_exists($key, $array)) {
// Set item
$item = $array[$key];
... | [
"static",
"function",
"arrayExtract",
"(",
"array",
"$",
"keys",
",",
"array",
"$",
"array",
",",
"array",
"$",
"callbacks",
"=",
"[",
"]",
")",
"{",
"// Set extracted",
"$",
"extracted",
"=",
"[",
"]",
";",
"// Loop through keys",
"foreach",
"(",
"$",
"... | Extract array from array with keys | [
"Extract",
"array",
"from",
"array",
"with",
"keys"
] | 446987706f81d5a0efbc8bd6b7d3b259d0527719 | https://github.com/ronaldborla/chikka/blob/446987706f81d5a0efbc8bd6b7d3b259d0527719/src/Borla/Chikka/Support/Utilities.php#L105-L125 |
20,628 | WellCommerce/AppBundle | EventListener/LayoutBoxSubscriber.php | LayoutBoxSubscriber.onLayoutBoxFormInit | public function onLayoutBoxFormInit(FormEvent $event)
{
$builder = $event->getFormBuilder();
$form = $event->getForm();
$configurators = $this->container->get('layout_box.configurator.collection')->all();
$resource = $event->getResource();
$boxSettings =... | php | public function onLayoutBoxFormInit(FormEvent $event)
{
$builder = $event->getFormBuilder();
$form = $event->getForm();
$configurators = $this->container->get('layout_box.configurator.collection')->all();
$resource = $event->getResource();
$boxSettings =... | [
"public",
"function",
"onLayoutBoxFormInit",
"(",
"FormEvent",
"$",
"event",
")",
"{",
"$",
"builder",
"=",
"$",
"event",
"->",
"getFormBuilder",
"(",
")",
";",
"$",
"form",
"=",
"$",
"event",
"->",
"getForm",
"(",
")",
";",
"$",
"configurators",
"=",
... | Adds configurator fields to main layout box edit form.
Loops through all configurators, renders the fieldset and sets default data
@param FormEvent $event | [
"Adds",
"configurator",
"fields",
"to",
"main",
"layout",
"box",
"edit",
"form",
".",
"Loops",
"through",
"all",
"configurators",
"renders",
"the",
"fieldset",
"and",
"sets",
"default",
"data"
] | 2add687d1c898dd0b24afd611d896e3811a0eac3 | https://github.com/WellCommerce/AppBundle/blob/2add687d1c898dd0b24afd611d896e3811a0eac3/EventListener/LayoutBoxSubscriber.php#L43-L61 |
20,629 | WellCommerce/AppBundle | EventListener/LayoutBoxSubscriber.php | LayoutBoxSubscriber.onLayoutBoxPreUpdate | public function onLayoutBoxPreUpdate(EntityEvent $event)
{
$resource = $event->getEntity();
if ($resource instanceof LayoutBox) {
$request = $this->getRequestHelper()->getCurrentRequest();
$settings = $this->getBoxSettingsFromRequest($request);
$settings = $this-... | php | public function onLayoutBoxPreUpdate(EntityEvent $event)
{
$resource = $event->getEntity();
if ($resource instanceof LayoutBox) {
$request = $this->getRequestHelper()->getCurrentRequest();
$settings = $this->getBoxSettingsFromRequest($request);
$settings = $this-... | [
"public",
"function",
"onLayoutBoxPreUpdate",
"(",
"EntityEvent",
"$",
"event",
")",
"{",
"$",
"resource",
"=",
"$",
"event",
"->",
"getEntity",
"(",
")",
";",
"if",
"(",
"$",
"resource",
"instanceof",
"LayoutBox",
")",
"{",
"$",
"request",
"=",
"$",
"th... | Sets resource settings fetched from fieldset corresponding to selected box type
@param EntityEvent $event | [
"Sets",
"resource",
"settings",
"fetched",
"from",
"fieldset",
"corresponding",
"to",
"selected",
"box",
"type"
] | 2add687d1c898dd0b24afd611d896e3811a0eac3 | https://github.com/WellCommerce/AppBundle/blob/2add687d1c898dd0b24afd611d896e3811a0eac3/EventListener/LayoutBoxSubscriber.php#L68-L77 |
20,630 | ekuiter/feature-php | FeaturePhp/Exporter/LocalExporter.php | LocalExporter.export | public function export($product) {
$files = $product->generateFiles();
mkdir($this->target, 0777, true);
foreach ($files as $file)
if (!$file->getContent()->copy(fphp\Helper\Path::join($this->target, $file->getTarget())))
throw new LocalExporterException("cou... | php | public function export($product) {
$files = $product->generateFiles();
mkdir($this->target, 0777, true);
foreach ($files as $file)
if (!$file->getContent()->copy(fphp\Helper\Path::join($this->target, $file->getTarget())))
throw new LocalExporterException("cou... | [
"public",
"function",
"export",
"(",
"$",
"product",
")",
"{",
"$",
"files",
"=",
"$",
"product",
"->",
"generateFiles",
"(",
")",
";",
"mkdir",
"(",
"$",
"this",
"->",
"target",
",",
"0777",
",",
"true",
")",
";",
"foreach",
"(",
"$",
"files",
"as... | Exports a product in the local filesystem.
Every generated file is copied to the filesystem at its target path.
@param \FeaturePhp\ProductLine\Product $product | [
"Exports",
"a",
"product",
"in",
"the",
"local",
"filesystem",
".",
"Every",
"generated",
"file",
"is",
"copied",
"to",
"the",
"filesystem",
"at",
"its",
"target",
"path",
"."
] | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Exporter/LocalExporter.php#L44-L51 |
20,631 | DevGroup-ru/yii2-users-module | src/scenarios/BaseAuthorizationPair.php | BaseAuthorizationPair.validatePassword | protected function validatePassword(LoginForm &$loginForm)
{
return [
'password',
function ($attribute) use (&$loginForm) {
if ($loginForm->user === null ||
!PasswordHelper::validate($loginForm->password, $loginForm->user->password_hash)
... | php | protected function validatePassword(LoginForm &$loginForm)
{
return [
'password',
function ($attribute) use (&$loginForm) {
if ($loginForm->user === null ||
!PasswordHelper::validate($loginForm->password, $loginForm->user->password_hash)
... | [
"protected",
"function",
"validatePassword",
"(",
"LoginForm",
"&",
"$",
"loginForm",
")",
"{",
"return",
"[",
"'password'",
",",
"function",
"(",
"$",
"attribute",
")",
"use",
"(",
"&",
"$",
"loginForm",
")",
"{",
"if",
"(",
"$",
"loginForm",
"->",
"use... | Adds password validation rule for login scenario
@param \DevGroup\Users\models\LoginForm $loginForm
@return array | [
"Adds",
"password",
"validation",
"rule",
"for",
"login",
"scenario"
] | ff0103dc55c3462627ccc704c33e70c96053f750 | https://github.com/DevGroup-ru/yii2-users-module/blob/ff0103dc55c3462627ccc704c33e70c96053f750/src/scenarios/BaseAuthorizationPair.php#L105-L117 |
20,632 | DevGroup-ru/yii2-users-module | src/scenarios/BaseAuthorizationPair.php | BaseAuthorizationPair.inactiveUsers | protected function inactiveUsers(LoginForm &$loginForm)
{
if (UsersModule::module()->allowLoginInactiveAccounts === false) {
return [];
}
return [
'username',
function ($attribute) use (&$loginForm) {
if ($loginForm->user !== null && $login... | php | protected function inactiveUsers(LoginForm &$loginForm)
{
if (UsersModule::module()->allowLoginInactiveAccounts === false) {
return [];
}
return [
'username',
function ($attribute) use (&$loginForm) {
if ($loginForm->user !== null && $login... | [
"protected",
"function",
"inactiveUsers",
"(",
"LoginForm",
"&",
"$",
"loginForm",
")",
"{",
"if",
"(",
"UsersModule",
"::",
"module",
"(",
")",
"->",
"allowLoginInactiveAccounts",
"===",
"false",
")",
"{",
"return",
"[",
"]",
";",
"}",
"return",
"[",
"'us... | Adds validation rule to not accept inactive users if such feature is toggled on in module configuration.
@param \DevGroup\Users\models\LoginForm $loginForm
@return array | [
"Adds",
"validation",
"rule",
"to",
"not",
"accept",
"inactive",
"users",
"if",
"such",
"feature",
"is",
"toggled",
"on",
"in",
"module",
"configuration",
"."
] | ff0103dc55c3462627ccc704c33e70c96053f750 | https://github.com/DevGroup-ru/yii2-users-module/blob/ff0103dc55c3462627ccc704c33e70c96053f750/src/scenarios/BaseAuthorizationPair.php#L126-L139 |
20,633 | mikebarlow/html-helper | src/Html.php | Html.tag | public function tag($tag, $attr = null, $content = null, $close = false)
{
$tag = strtolower($tag);
if (! empty($attr) && is_array($attr)) {
$attr = $this->Attr->attr($attr);
}
if ($close) {
return sprintf('<%s%s>%s</%1$s>', $tag, $attr, $content);
}... | php | public function tag($tag, $attr = null, $content = null, $close = false)
{
$tag = strtolower($tag);
if (! empty($attr) && is_array($attr)) {
$attr = $this->Attr->attr($attr);
}
if ($close) {
return sprintf('<%s%s>%s</%1$s>', $tag, $attr, $content);
}... | [
"public",
"function",
"tag",
"(",
"$",
"tag",
",",
"$",
"attr",
"=",
"null",
",",
"$",
"content",
"=",
"null",
",",
"$",
"close",
"=",
"false",
")",
"{",
"$",
"tag",
"=",
"strtolower",
"(",
"$",
"tag",
")",
";",
"if",
"(",
"!",
"empty",
"(",
... | render a tag
@param string tag to render
@param array attributes for the tag
@param string contents of tag when not self closing
@param bool close the tag?
@return string | [
"render",
"a",
"tag"
] | d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65 | https://github.com/mikebarlow/html-helper/blob/d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65/src/Html.php#L50-L63 |
20,634 | mikebarlow/html-helper | src/Html.php | Html.processList | public function processList($list, $subListType = 'ul')
{
$out = '';
foreach ($list as $key => $value) {
if (is_array($value) && (isset($value['list']) || isset($value['attr']))) {
$attr = (isset($value['attr'])) ? $value['attr'] : null;
$listAttr = (isse... | php | public function processList($list, $subListType = 'ul')
{
$out = '';
foreach ($list as $key => $value) {
if (is_array($value) && (isset($value['list']) || isset($value['attr']))) {
$attr = (isset($value['attr'])) ? $value['attr'] : null;
$listAttr = (isse... | [
"public",
"function",
"processList",
"(",
"$",
"list",
",",
"$",
"subListType",
"=",
"'ul'",
")",
"{",
"$",
"out",
"=",
"''",
";",
"foreach",
"(",
"$",
"list",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"valu... | process list items
@todo add ability to define sublists from within the list
@param array Array of list items to process
@param string method to use for sub-lists
@return string | [
"process",
"list",
"items"
] | d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65 | https://github.com/mikebarlow/html-helper/blob/d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65/src/Html.php#L137-L156 |
20,635 | mikebarlow/html-helper | src/Html.php | Html.image | public function image($src, $attr = array())
{
$src = $this->Assets->getImage($src);
$attr['src'] = $src;
return $this->tag('img', $attr);
} | php | public function image($src, $attr = array())
{
$src = $this->Assets->getImage($src);
$attr['src'] = $src;
return $this->tag('img', $attr);
} | [
"public",
"function",
"image",
"(",
"$",
"src",
",",
"$",
"attr",
"=",
"array",
"(",
")",
")",
"{",
"$",
"src",
"=",
"$",
"this",
"->",
"Assets",
"->",
"getImage",
"(",
"$",
"src",
")",
";",
"$",
"attr",
"[",
"'src'",
"]",
"=",
"$",
"src",
";... | create an image
@param mixed image path data - will be passed to the assets interface for processing
@param array attributes to be placed on the img tag
@return string | [
"create",
"an",
"image"
] | d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65 | https://github.com/mikebarlow/html-helper/blob/d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65/src/Html.php#L180-L185 |
20,636 | mikebarlow/html-helper | src/Html.php | Html.style | public function style($src, $attr = array())
{
$src = $this->Assets->getStyle($src);
$attr['href'] = $src;
$attr = array_merge(
array(
'media' => 'screen',
'rel' => 'stylesheet',
'type' => 'text/css'
),
$att... | php | public function style($src, $attr = array())
{
$src = $this->Assets->getStyle($src);
$attr['href'] = $src;
$attr = array_merge(
array(
'media' => 'screen',
'rel' => 'stylesheet',
'type' => 'text/css'
),
$att... | [
"public",
"function",
"style",
"(",
"$",
"src",
",",
"$",
"attr",
"=",
"array",
"(",
")",
")",
"{",
"$",
"src",
"=",
"$",
"this",
"->",
"Assets",
"->",
"getStyle",
"(",
"$",
"src",
")",
";",
"$",
"attr",
"[",
"'href'",
"]",
"=",
"$",
"src",
"... | create a style link
@param mixed style path data - will be passed to the assets interface for processing
@param array attributes to be placed on the link tag
@return string | [
"create",
"a",
"style",
"link"
] | d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65 | https://github.com/mikebarlow/html-helper/blob/d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65/src/Html.php#L194-L209 |
20,637 | mikebarlow/html-helper | src/Html.php | Html.script | public function script($src, $attr = array())
{
$src = $this->Assets->getScript($src);
$attr['src'] = $src;
return $this->tag('script', $attr, '', true);
} | php | public function script($src, $attr = array())
{
$src = $this->Assets->getScript($src);
$attr['src'] = $src;
return $this->tag('script', $attr, '', true);
} | [
"public",
"function",
"script",
"(",
"$",
"src",
",",
"$",
"attr",
"=",
"array",
"(",
")",
")",
"{",
"$",
"src",
"=",
"$",
"this",
"->",
"Assets",
"->",
"getScript",
"(",
"$",
"src",
")",
";",
"$",
"attr",
"[",
"'src'",
"]",
"=",
"$",
"src",
... | create a script tag
@param mixed script path data - will be passed to the assets interface for processing
@param array attributes to be placed on the script tag
@return string | [
"create",
"a",
"script",
"tag"
] | d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65 | https://github.com/mikebarlow/html-helper/blob/d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65/src/Html.php#L218-L223 |
20,638 | mikebarlow/html-helper | src/Html.php | Html.setRouter | public function setRouter($Router)
{
if (! is_object($Router) || ! $Router instanceof Router) {
throw new \InvalidArgumentException(
'The Router Interface must be a valid Router Object'
);
}
$this->Router = $Router;
return true;
} | php | public function setRouter($Router)
{
if (! is_object($Router) || ! $Router instanceof Router) {
throw new \InvalidArgumentException(
'The Router Interface must be a valid Router Object'
);
}
$this->Router = $Router;
return true;
} | [
"public",
"function",
"setRouter",
"(",
"$",
"Router",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"Router",
")",
"||",
"!",
"$",
"Router",
"instanceof",
"Router",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'The Router Interface m... | check and set the router interface
@param Object Instance of an Router
@return bool
@throws \InvalidArgumentException | [
"check",
"and",
"set",
"the",
"router",
"interface"
] | d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65 | https://github.com/mikebarlow/html-helper/blob/d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65/src/Html.php#L232-L242 |
20,639 | mikebarlow/html-helper | src/Html.php | Html.setAssets | public function setAssets($Assets)
{
if (! is_object($Assets) || ! $Assets instanceof Assets) {
throw new \InvalidArgumentException(
'The Assets Interface must be a valid Assets Object'
);
}
$this->Assets = $Assets;
return true;
} | php | public function setAssets($Assets)
{
if (! is_object($Assets) || ! $Assets instanceof Assets) {
throw new \InvalidArgumentException(
'The Assets Interface must be a valid Assets Object'
);
}
$this->Assets = $Assets;
return true;
} | [
"public",
"function",
"setAssets",
"(",
"$",
"Assets",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"Assets",
")",
"||",
"!",
"$",
"Assets",
"instanceof",
"Assets",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'The Assets Interface m... | check and set the Asset interface
@param Object Instance of an Assets
@return bool
@throws \InvalidArgumentException | [
"check",
"and",
"set",
"the",
"Asset",
"interface"
] | d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65 | https://github.com/mikebarlow/html-helper/blob/d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65/src/Html.php#L251-L261 |
20,640 | mikebarlow/html-helper | src/Html.php | Html.setForm | public function setForm($Form)
{
if (! is_object($Form) || ! $Form instanceof Helpers\Form) {
throw new \InvalidArgumentException(
'The Form Object must be a valid Helpers\Form Object'
);
}
$this->Form = $Form;
return true;
} | php | public function setForm($Form)
{
if (! is_object($Form) || ! $Form instanceof Helpers\Form) {
throw new \InvalidArgumentException(
'The Form Object must be a valid Helpers\Form Object'
);
}
$this->Form = $Form;
return true;
} | [
"public",
"function",
"setForm",
"(",
"$",
"Form",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"Form",
")",
"||",
"!",
"$",
"Form",
"instanceof",
"Helpers",
"\\",
"Form",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'The Form Ob... | check and set the Form Object
@param Object Instance of an Helpers\Form
@return bool
@throws \InvalidArgumentException | [
"check",
"and",
"set",
"the",
"Form",
"Object"
] | d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65 | https://github.com/mikebarlow/html-helper/blob/d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65/src/Html.php#L270-L280 |
20,641 | gpupo/common-schema | src/ORM/Entity/Trading/Trading.php | Trading.removePayment | public function removePayment(\Gpupo\CommonSchema\ORM\Entity\Trading\Payment\Payment $payment)
{
return $this->payments->removeElement($payment);
} | php | public function removePayment(\Gpupo\CommonSchema\ORM\Entity\Trading\Payment\Payment $payment)
{
return $this->payments->removeElement($payment);
} | [
"public",
"function",
"removePayment",
"(",
"\\",
"Gpupo",
"\\",
"CommonSchema",
"\\",
"ORM",
"\\",
"Entity",
"\\",
"Trading",
"\\",
"Payment",
"\\",
"Payment",
"$",
"payment",
")",
"{",
"return",
"$",
"this",
"->",
"payments",
"->",
"removeElement",
"(",
... | Remove payment.
@param \Gpupo\CommonSchema\ORM\Entity\Trading\Payment\Payment $payment
@return bool TRUE if this collection contained the specified element, FALSE otherwise | [
"Remove",
"payment",
"."
] | a762d2eb3063b7317c72c69cbb463b1f95b86b0a | https://github.com/gpupo/common-schema/blob/a762d2eb3063b7317c72c69cbb463b1f95b86b0a/src/ORM/Entity/Trading/Trading.php#L138-L141 |
20,642 | wenbinye/PhalconX | src/Mvc/ViewHelper.php | ViewHelper.baseUrl | public function baseUrl()
{
if (!$this->baseUrl) {
$this->baseUrl = $this->request->getScheme()
. '://' . $this->request->getHttpHost();
}
return $this->baseUrl;
} | php | public function baseUrl()
{
if (!$this->baseUrl) {
$this->baseUrl = $this->request->getScheme()
. '://' . $this->request->getHttpHost();
}
return $this->baseUrl;
} | [
"public",
"function",
"baseUrl",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"baseUrl",
")",
"{",
"$",
"this",
"->",
"baseUrl",
"=",
"$",
"this",
"->",
"request",
"->",
"getScheme",
"(",
")",
".",
"'://'",
".",
"$",
"this",
"->",
"request",
... | Gets the base url
@return string | [
"Gets",
"the",
"base",
"url"
] | 0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1 | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Mvc/ViewHelper.php#L66-L73 |
20,643 | wenbinye/PhalconX | src/Mvc/ViewHelper.php | ViewHelper.absoluteUrl | public function absoluteUrl($uri = null, $args = null)
{
if (isset($uri)) {
$uri = '/'. ltrim($uri, "/");
return $this->baseUrl() . $this->url->get($uri, $args);
} else {
return $this->baseUrl() . $this->url->getBaseUri();
}
} | php | public function absoluteUrl($uri = null, $args = null)
{
if (isset($uri)) {
$uri = '/'. ltrim($uri, "/");
return $this->baseUrl() . $this->url->get($uri, $args);
} else {
return $this->baseUrl() . $this->url->getBaseUri();
}
} | [
"public",
"function",
"absoluteUrl",
"(",
"$",
"uri",
"=",
"null",
",",
"$",
"args",
"=",
"null",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"uri",
")",
")",
"{",
"$",
"uri",
"=",
"'/'",
".",
"ltrim",
"(",
"$",
"uri",
",",
"\"/\"",
")",
";",
"re... | Gets absolute url
@return string | [
"Gets",
"absolute",
"url"
] | 0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1 | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Mvc/ViewHelper.php#L80-L88 |
20,644 | wenbinye/PhalconX | src/Mvc/ViewHelper.php | ViewHelper.ltrim | public function ltrim($str, $charlist = null)
{
return isset($charlist) ? ltrim($str, $charlist) : ltrim($str);
} | php | public function ltrim($str, $charlist = null)
{
return isset($charlist) ? ltrim($str, $charlist) : ltrim($str);
} | [
"public",
"function",
"ltrim",
"(",
"$",
"str",
",",
"$",
"charlist",
"=",
"null",
")",
"{",
"return",
"isset",
"(",
"$",
"charlist",
")",
"?",
"ltrim",
"(",
"$",
"str",
",",
"$",
"charlist",
")",
":",
"ltrim",
"(",
"$",
"str",
")",
";",
"}"
] | left trim string
@param string $str
@param array $charlist
@return string | [
"left",
"trim",
"string"
] | 0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1 | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Mvc/ViewHelper.php#L109-L112 |
20,645 | wenbinye/PhalconX | src/Mvc/ViewHelper.php | ViewHelper.rtrim | public function rtrim($str, $charlist = null)
{
return isset($charlist) ? rtrim($str, $charlist) : rtrim($str);
} | php | public function rtrim($str, $charlist = null)
{
return isset($charlist) ? rtrim($str, $charlist) : rtrim($str);
} | [
"public",
"function",
"rtrim",
"(",
"$",
"str",
",",
"$",
"charlist",
"=",
"null",
")",
"{",
"return",
"isset",
"(",
"$",
"charlist",
")",
"?",
"rtrim",
"(",
"$",
"str",
",",
"$",
"charlist",
")",
":",
"rtrim",
"(",
"$",
"str",
")",
";",
"}"
] | right trim string
@param string $str
@param array $charlist
@return string | [
"right",
"trim",
"string"
] | 0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1 | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Mvc/ViewHelper.php#L121-L124 |
20,646 | phpnfe/tools | src/Certificado/Pkcs12.php | Pkcs12.zSignatureExists | private function zSignatureExists($dom)
{
$signature = $dom->getElementsByTagName('Signature')->item(0);
if (! isset($signature)) {
return false;
}
return true;
} | php | private function zSignatureExists($dom)
{
$signature = $dom->getElementsByTagName('Signature')->item(0);
if (! isset($signature)) {
return false;
}
return true;
} | [
"private",
"function",
"zSignatureExists",
"(",
"$",
"dom",
")",
"{",
"$",
"signature",
"=",
"$",
"dom",
"->",
"getElementsByTagName",
"(",
"'Signature'",
")",
"->",
"item",
"(",
"0",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"signature",
")",
")",
... | signatureExists
Check se o xml possi a tag Signature.
@param DOMDocument $dom
@return bool | [
"signatureExists",
"Check",
"se",
"o",
"xml",
"possi",
"a",
"tag",
"Signature",
"."
] | 303ca311989e0b345071f61b71d2b3bf7ee80454 | https://github.com/phpnfe/tools/blob/303ca311989e0b345071f61b71d2b3bf7ee80454/src/Certificado/Pkcs12.php#L511-L519 |
20,647 | phpnfe/tools | src/Certificado/Pkcs12.php | Pkcs12.zLeaveParam | private function zLeaveParam()
{
$this->pfxCert = '';
$this->pubKey = '';
$this->priKey = '';
$this->certKey = '';
$this->pubKeyFile = '';
$this->priKeyFile = '';
$this->certKeyFile = '';
$this->expireTimestamp = '';
} | php | private function zLeaveParam()
{
$this->pfxCert = '';
$this->pubKey = '';
$this->priKey = '';
$this->certKey = '';
$this->pubKeyFile = '';
$this->priKeyFile = '';
$this->certKeyFile = '';
$this->expireTimestamp = '';
} | [
"private",
"function",
"zLeaveParam",
"(",
")",
"{",
"$",
"this",
"->",
"pfxCert",
"=",
"''",
";",
"$",
"this",
"->",
"pubKey",
"=",
"''",
";",
"$",
"this",
"->",
"priKey",
"=",
"''",
";",
"$",
"this",
"->",
"certKey",
"=",
"''",
";",
"$",
"this"... | zLeaveParam
Limpa os parametros da classe. | [
"zLeaveParam",
"Limpa",
"os",
"parametros",
"da",
"classe",
"."
] | 303ca311989e0b345071f61b71d2b3bf7ee80454 | https://github.com/phpnfe/tools/blob/303ca311989e0b345071f61b71d2b3bf7ee80454/src/Certificado/Pkcs12.php#L737-L747 |
20,648 | heidelpay/PhpDoc | src/phpDocumentor/Descriptor/DescriptorAbstract.php | DescriptorAbstract.getPackage | public function getPackage()
{
$inheritedElement = $this->getInheritedElement();
if ($this->package instanceof PackageDescriptor
&& ! ($this->package->getName() === '\\' && $inheritedElement)) {
return $this->package;
}
if ($inheritedElement instanceof Descri... | php | public function getPackage()
{
$inheritedElement = $this->getInheritedElement();
if ($this->package instanceof PackageDescriptor
&& ! ($this->package->getName() === '\\' && $inheritedElement)) {
return $this->package;
}
if ($inheritedElement instanceof Descri... | [
"public",
"function",
"getPackage",
"(",
")",
"{",
"$",
"inheritedElement",
"=",
"$",
"this",
"->",
"getInheritedElement",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"package",
"instanceof",
"PackageDescriptor",
"&&",
"!",
"(",
"$",
"this",
"->",
"packag... | Returns the package name for this element.
@return PackageDescriptor | [
"Returns",
"the",
"package",
"name",
"for",
"this",
"element",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/DescriptorAbstract.php#L306-L319 |
20,649 | wenbinye/PhalconX | src/Php/NodeVisitor.php | NodeVisitor.buildMethods | protected function buildMethods()
{
$refl = new \ReflectionClass($this);
$enterMethods = [];
$leaveMethods = [];
foreach ($refl->getMethods() as $method) {
$name = $method->getName();
if (preg_match('/^(enter|leave).+/', $name) && !preg_match('/^(enter|leave)... | php | protected function buildMethods()
{
$refl = new \ReflectionClass($this);
$enterMethods = [];
$leaveMethods = [];
foreach ($refl->getMethods() as $method) {
$name = $method->getName();
if (preg_match('/^(enter|leave).+/', $name) && !preg_match('/^(enter|leave)... | [
"protected",
"function",
"buildMethods",
"(",
")",
"{",
"$",
"refl",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"this",
")",
";",
"$",
"enterMethods",
"=",
"[",
"]",
";",
"$",
"leaveMethods",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"refl",
"->",... | collect all rule method according to node type of parameter | [
"collect",
"all",
"rule",
"method",
"according",
"to",
"node",
"type",
"of",
"parameter"
] | 0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1 | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Php/NodeVisitor.php#L57-L79 |
20,650 | trunda/SmfMenu | src/Smf/Menu/Renderer/BootstrapNavRenderer.php | BootstrapNavRenderer.setDefaults | protected function setDefaults(array $defaultOptions = array())
{
$defaultOptions = array_merge(array(
'depth' => null,
'ancestorCurrencyDepth' => null,
'currentClass' => 'active',
'ancestorClass' => 'active',
'firstClass' => null,
'las... | php | protected function setDefaults(array $defaultOptions = array())
{
$defaultOptions = array_merge(array(
'depth' => null,
'ancestorCurrencyDepth' => null,
'currentClass' => 'active',
'ancestorClass' => 'active',
'firstClass' => null,
'las... | [
"protected",
"function",
"setDefaults",
"(",
"array",
"$",
"defaultOptions",
"=",
"array",
"(",
")",
")",
"{",
"$",
"defaultOptions",
"=",
"array_merge",
"(",
"array",
"(",
"'depth'",
"=>",
"null",
",",
"'ancestorCurrencyDepth'",
"=>",
"null",
",",
"'currentCl... | Overwriting some options - classes, etc.
@param array $defaultOptions | [
"Overwriting",
"some",
"options",
"-",
"classes",
"etc",
"."
] | 739e74fb664c1f018b4a74142bd28d20c004bac6 | https://github.com/trunda/SmfMenu/blob/739e74fb664c1f018b4a74142bd28d20c004bac6/src/Smf/Menu/Renderer/BootstrapNavRenderer.php#L19-L31 |
20,651 | dragonmantank/fillet | src/Fillet/Writer/PostWriter.php | PostWriter.write | public function write($data)
{
$post_date_string = $data['post_date']->format('Y-m-d H:i:s');
$slug = $this->generateSlug($data['title']);
$filename = $data['post_date']->format('Y-m-d') . '-' . $slug;
$headerData = [
'title' => $data['title'],
'date' => $post_date_string,
'layou... | php | public function write($data)
{
$post_date_string = $data['post_date']->format('Y-m-d H:i:s');
$slug = $this->generateSlug($data['title']);
$filename = $data['post_date']->format('Y-m-d') . '-' . $slug;
$headerData = [
'title' => $data['title'],
'date' => $post_date_string,
'layou... | [
"public",
"function",
"write",
"(",
"$",
"data",
")",
"{",
"$",
"post_date_string",
"=",
"$",
"data",
"[",
"'post_date'",
"]",
"->",
"format",
"(",
"'Y-m-d H:i:s'",
")",
";",
"$",
"slug",
"=",
"$",
"this",
"->",
"generateSlug",
"(",
"$",
"data",
"[",
... | Write out a set of data into a file
@param array $data Data to use for constructing the page | [
"Write",
"out",
"a",
"set",
"of",
"data",
"into",
"a",
"file"
] | b197947608c05ac2318e8f6b296345494004d9c6 | https://github.com/dragonmantank/fillet/blob/b197947608c05ac2318e8f6b296345494004d9c6/src/Fillet/Writer/PostWriter.php#L19-L45 |
20,652 | kuria/url | src/Url.php | Url.parse | static function parse(string $url, ?int $preferredFormat = self::ABSOLUTE)
{
$components = parse_url($url);
if ($components === false) {
throw new InvalidUrlException(sprintf('The given URL "%s" is invalid', $url));
}
$query = [];
if (isset($components['query']... | php | static function parse(string $url, ?int $preferredFormat = self::ABSOLUTE)
{
$components = parse_url($url);
if ($components === false) {
throw new InvalidUrlException(sprintf('The given URL "%s" is invalid', $url));
}
$query = [];
if (isset($components['query']... | [
"static",
"function",
"parse",
"(",
"string",
"$",
"url",
",",
"?",
"int",
"$",
"preferredFormat",
"=",
"self",
"::",
"ABSOLUTE",
")",
"{",
"$",
"components",
"=",
"parse_url",
"(",
"$",
"url",
")",
";",
"if",
"(",
"$",
"components",
"===",
"false",
... | Parse an URL
@throws InvalidUrlException if the URL is invalid
@return static | [
"Parse",
"an",
"URL"
] | 5f405abb9bd4b722a907363b3d7c43207365c411 | https://github.com/kuria/url/blob/5f405abb9bd4b722a907363b3d7c43207365c411/src/Url.php#L63-L86 |
20,653 | kuria/url | src/Url.php | Url.getFullHost | function getFullHost(): ?string
{
if ($this->host === null) {
return null;
}
$fullHost = $this->host;
if ($this->port !== null) {
$fullHost .= ':' . $this->port;
}
return $fullHost;
} | php | function getFullHost(): ?string
{
if ($this->host === null) {
return null;
}
$fullHost = $this->host;
if ($this->port !== null) {
$fullHost .= ':' . $this->port;
}
return $fullHost;
} | [
"function",
"getFullHost",
"(",
")",
":",
"?",
"string",
"{",
"if",
"(",
"$",
"this",
"->",
"host",
"===",
"null",
")",
"{",
"return",
"null",
";",
"}",
"$",
"fullHost",
"=",
"$",
"this",
"->",
"host",
";",
"if",
"(",
"$",
"this",
"->",
"port",
... | Get host name, including the port, if defined
E.g. example.com:8080 | [
"Get",
"host",
"name",
"including",
"the",
"port",
"if",
"defined"
] | 5f405abb9bd4b722a907363b3d7c43207365c411 | https://github.com/kuria/url/blob/5f405abb9bd4b722a907363b3d7c43207365c411/src/Url.php#L113-L126 |
20,654 | kuria/url | src/Url.php | Url.add | function add(array $parameters): void
{
foreach ($parameters as $parameter => $value) {
$this->query[$parameter] = $value;
}
} | php | function add(array $parameters): void
{
foreach ($parameters as $parameter => $value) {
$this->query[$parameter] = $value;
}
} | [
"function",
"add",
"(",
"array",
"$",
"parameters",
")",
":",
"void",
"{",
"foreach",
"(",
"$",
"parameters",
"as",
"$",
"parameter",
"=>",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"query",
"[",
"$",
"parameter",
"]",
"=",
"$",
"value",
";",
"}",... | Add multiple query parameters
Already defined parameters with the same key will be overriden. | [
"Add",
"multiple",
"query",
"parameters"
] | 5f405abb9bd4b722a907363b3d7c43207365c411 | https://github.com/kuria/url/blob/5f405abb9bd4b722a907363b3d7c43207365c411/src/Url.php#L258-L263 |
20,655 | kuria/url | src/Url.php | Url.build | function build(): string
{
if ($this->host !== null && $this->preferredFormat === static::ABSOLUTE) {
return $this->buildAbsolute();
} else {
return $this->buildRelative();
}
} | php | function build(): string
{
if ($this->host !== null && $this->preferredFormat === static::ABSOLUTE) {
return $this->buildAbsolute();
} else {
return $this->buildRelative();
}
} | [
"function",
"build",
"(",
")",
":",
"string",
"{",
"if",
"(",
"$",
"this",
"->",
"host",
"!==",
"null",
"&&",
"$",
"this",
"->",
"preferredFormat",
"===",
"static",
"::",
"ABSOLUTE",
")",
"{",
"return",
"$",
"this",
"->",
"buildAbsolute",
"(",
")",
"... | Build an absolute or relative URL
- if no host is specified, a relative URL will be returned
- if the host is specified, an absolute URL will be returned
(unless the preferred format option is set to relative)
@see Url::setPreferredFormat() | [
"Build",
"an",
"absolute",
"or",
"relative",
"URL"
] | 5f405abb9bd4b722a907363b3d7c43207365c411 | https://github.com/kuria/url/blob/5f405abb9bd4b722a907363b3d7c43207365c411/src/Url.php#L292-L299 |
20,656 | kuria/url | src/Url.php | Url.buildAbsolute | function buildAbsolute(): string
{
$output = '';
if ($this->host === null) {
throw new IncompleteUrlException('No host specified');
}
// scheme
if ($this->scheme !== null) {
$output .= $this->scheme;
$output .= '://';
} else {
... | php | function buildAbsolute(): string
{
$output = '';
if ($this->host === null) {
throw new IncompleteUrlException('No host specified');
}
// scheme
if ($this->scheme !== null) {
$output .= $this->scheme;
$output .= '://';
} else {
... | [
"function",
"buildAbsolute",
"(",
")",
":",
"string",
"{",
"$",
"output",
"=",
"''",
";",
"if",
"(",
"$",
"this",
"->",
"host",
"===",
"null",
")",
"{",
"throw",
"new",
"IncompleteUrlException",
"(",
"'No host specified'",
")",
";",
"}",
"// scheme",
"if... | Build an absolute URL
@throws IncompleteUrlException if no host is specified | [
"Build",
"an",
"absolute",
"URL"
] | 5f405abb9bd4b722a907363b3d7c43207365c411 | https://github.com/kuria/url/blob/5f405abb9bd4b722a907363b3d7c43207365c411/src/Url.php#L306-L335 |
20,657 | kuria/url | src/Url.php | Url.buildRelative | function buildRelative(): string
{
$output = '';
// path
$output .= $this->path;
// query
if ($this->query) {
$output .= '?';
$output .= $this->getQueryString();
}
// fragment
if ($this->fragment !== null) {
$outp... | php | function buildRelative(): string
{
$output = '';
// path
$output .= $this->path;
// query
if ($this->query) {
$output .= '?';
$output .= $this->getQueryString();
}
// fragment
if ($this->fragment !== null) {
$outp... | [
"function",
"buildRelative",
"(",
")",
":",
"string",
"{",
"$",
"output",
"=",
"''",
";",
"// path",
"$",
"output",
".=",
"$",
"this",
"->",
"path",
";",
"// query",
"if",
"(",
"$",
"this",
"->",
"query",
")",
"{",
"$",
"output",
".=",
"'?'",
";",
... | Build a relative URL | [
"Build",
"a",
"relative",
"URL"
] | 5f405abb9bd4b722a907363b3d7c43207365c411 | https://github.com/kuria/url/blob/5f405abb9bd4b722a907363b3d7c43207365c411/src/Url.php#L340-L360 |
20,658 | mmanos/laravel-casset | src/Mmanos/Casset/Casset.php | Casset.container | public function container($container = 'default')
{
if (!isset($this->containers[$container])) {
$this->containers[$container] = new Container($container);
}
return $this->containers[$container];
} | php | public function container($container = 'default')
{
if (!isset($this->containers[$container])) {
$this->containers[$container] = new Container($container);
}
return $this->containers[$container];
} | [
"public",
"function",
"container",
"(",
"$",
"container",
"=",
"'default'",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"containers",
"[",
"$",
"container",
"]",
")",
")",
"{",
"$",
"this",
"->",
"containers",
"[",
"$",
"container",
"]... | Retrieve the requested asset container object.
@param string $container Name of container.
@return Container | [
"Retrieve",
"the",
"requested",
"asset",
"container",
"object",
"."
] | 0f7db71211c1daa99bde30afa41da2692a39b81c | https://github.com/mmanos/laravel-casset/blob/0f7db71211c1daa99bde30afa41da2692a39b81c/src/Mmanos/Casset/Casset.php#L19-L26 |
20,659 | xiewulong/yii2-fileupload | oss/libs/guzzle/http/Guzzle/Http/Client.php | Client.preparePharCacert | public function preparePharCacert($md5Check = true)
{
$from = __DIR__ . '/Resources/cacert.pem';
$certFile = sys_get_temp_dir() . '/guzzle-cacert.pem';
if (!file_exists($certFile) && !copy($from, $certFile)) {
throw new RuntimeException("Could not copy {$from} to {$certFile}: " .... | php | public function preparePharCacert($md5Check = true)
{
$from = __DIR__ . '/Resources/cacert.pem';
$certFile = sys_get_temp_dir() . '/guzzle-cacert.pem';
if (!file_exists($certFile) && !copy($from, $certFile)) {
throw new RuntimeException("Could not copy {$from} to {$certFile}: " .... | [
"public",
"function",
"preparePharCacert",
"(",
"$",
"md5Check",
"=",
"true",
")",
"{",
"$",
"from",
"=",
"__DIR__",
".",
"'/Resources/cacert.pem'",
";",
"$",
"certFile",
"=",
"sys_get_temp_dir",
"(",
")",
".",
"'/guzzle-cacert.pem'",
";",
"if",
"(",
"!",
"f... | Copy the cacert.pem file from the phar if it is not in the temp folder and validate the MD5 checksum
@param bool $md5Check Set to false to not perform the MD5 validation
@return string Returns the path to the extracted cacert
@throws RuntimeException if the file cannot be copied or there is a MD5 mismatch | [
"Copy",
"the",
"cacert",
".",
"pem",
"file",
"from",
"the",
"phar",
"if",
"it",
"is",
"not",
"in",
"the",
"temp",
"folder",
"and",
"validate",
"the",
"MD5",
"checksum"
] | 3e75b17a4a18dd8466e3f57c63136de03470ca82 | https://github.com/xiewulong/yii2-fileupload/blob/3e75b17a4a18dd8466e3f57c63136de03470ca82/oss/libs/guzzle/http/Guzzle/Http/Client.php#L344-L359 |
20,660 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Base/src/file.php | ezcBaseFile.findRecursiveCallback | static protected function findRecursiveCallback( ezcBaseFileFindContext $context, $sourceDir, $fileName, $fileInfo )
{
// ignore if we have a directory
if ( $fileInfo['mode'] & 0x4000 )
{
return;
}
// update the statistics
$context->elements[] = $sourceDi... | php | static protected function findRecursiveCallback( ezcBaseFileFindContext $context, $sourceDir, $fileName, $fileInfo )
{
// ignore if we have a directory
if ( $fileInfo['mode'] & 0x4000 )
{
return;
}
// update the statistics
$context->elements[] = $sourceDi... | [
"static",
"protected",
"function",
"findRecursiveCallback",
"(",
"ezcBaseFileFindContext",
"$",
"context",
",",
"$",
"sourceDir",
",",
"$",
"fileName",
",",
"$",
"fileInfo",
")",
"{",
"// ignore if we have a directory",
"if",
"(",
"$",
"fileInfo",
"[",
"'mode'",
"... | This is the callback used by findRecursive to collect data.
This callback method works together with walkRecursive() and is called
for every file/and or directory. The $context is a callback specific
container in which data can be stored and shared between the different
calls to the callback function. The walkRecursiv... | [
"This",
"is",
"the",
"callback",
"used",
"by",
"findRecursive",
"to",
"collect",
"data",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Base/src/file.php#L58-L70 |
20,661 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Base/src/file.php | ezcBaseFile.walkRecursive | static public function walkRecursive( $sourceDir, array $includeFilters = array(), array $excludeFilters = array(), $callback, &$callbackContext )
{
if ( !is_dir( $sourceDir ) )
{
throw new ezcBaseFileNotFoundException( $sourceDir, 'directory' );
}
$elements = array();
... | php | static public function walkRecursive( $sourceDir, array $includeFilters = array(), array $excludeFilters = array(), $callback, &$callbackContext )
{
if ( !is_dir( $sourceDir ) )
{
throw new ezcBaseFileNotFoundException( $sourceDir, 'directory' );
}
$elements = array();
... | [
"static",
"public",
"function",
"walkRecursive",
"(",
"$",
"sourceDir",
",",
"array",
"$",
"includeFilters",
"=",
"array",
"(",
")",
",",
"array",
"$",
"excludeFilters",
"=",
"array",
"(",
")",
",",
"$",
"callback",
",",
"&",
"$",
"callbackContext",
")",
... | Walks files and directories recursively on a file system
This method walks over a directory and calls a callback from every file
and directory it finds. You can use $includeFilters to include only
specific files, and $excludeFilters to exclude certain files from being
returned. The function will always go into subdire... | [
"Walks",
"files",
"and",
"directories",
"recursively",
"on",
"a",
"file",
"system"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Base/src/file.php#L113-L190 |
20,662 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Base/src/file.php | ezcBaseFile.findRecursive | static public function findRecursive( $sourceDir, array $includeFilters = array(), array $excludeFilters = array(), &$statistics = null )
{
// init statistics array
if ( !is_array( $statistics ) || !array_key_exists( 'size', $statistics ) || !array_key_exists( 'count', $statistics ) )
{
... | php | static public function findRecursive( $sourceDir, array $includeFilters = array(), array $excludeFilters = array(), &$statistics = null )
{
// init statistics array
if ( !is_array( $statistics ) || !array_key_exists( 'size', $statistics ) || !array_key_exists( 'count', $statistics ) )
{
... | [
"static",
"public",
"function",
"findRecursive",
"(",
"$",
"sourceDir",
",",
"array",
"$",
"includeFilters",
"=",
"array",
"(",
")",
",",
"array",
"$",
"excludeFilters",
"=",
"array",
"(",
")",
",",
"&",
"$",
"statistics",
"=",
"null",
")",
"{",
"// init... | Finds files recursively on a file system
With this method you can scan the file system for files. You can use
$includeFilters to include only specific files, and $excludeFilters to
exclude certain files from being returned. The function will always go
into subdirectories even if the entry would not have passed the fil... | [
"Finds",
"files",
"recursively",
"on",
"a",
"file",
"system"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Base/src/file.php#L222-L242 |
20,663 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Base/src/file.php | ezcBaseFile.removeRecursive | static public function removeRecursive( $directory )
{
$sourceDir = realpath( $directory );
if ( !$sourceDir )
{
throw new ezcBaseFileNotFoundException( $directory, 'directory' );
}
$d = @dir( $sourceDir );
if ( !$d )
{
throw new ezcBas... | php | static public function removeRecursive( $directory )
{
$sourceDir = realpath( $directory );
if ( !$sourceDir )
{
throw new ezcBaseFileNotFoundException( $directory, 'directory' );
}
$d = @dir( $sourceDir );
if ( !$d )
{
throw new ezcBas... | [
"static",
"public",
"function",
"removeRecursive",
"(",
"$",
"directory",
")",
"{",
"$",
"sourceDir",
"=",
"realpath",
"(",
"$",
"directory",
")",
";",
"if",
"(",
"!",
"$",
"sourceDir",
")",
"{",
"throw",
"new",
"ezcBaseFileNotFoundException",
"(",
"$",
"d... | Removes files and directories recursively from a file system
This method recursively removes the $directory and all its contents.
You should be <b>extremely</b> careful with this method as it has the
potential to erase everything that the current user has access to.
@param string $directory | [
"Removes",
"files",
"and",
"directories",
"recursively",
"from",
"a",
"file",
"system"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Base/src/file.php#L254-L294 |
20,664 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Base/src/file.php | ezcBaseFile.copyRecursive | static public function copyRecursive( $source, $destination, $depth = -1, $dirMode = 0775, $fileMode = 0664 )
{
// Check if source file exists at all.
if ( !is_file( $source ) && !is_dir( $source ) )
{
throw new ezcBaseFileNotFoundException( $source );
}
// Desti... | php | static public function copyRecursive( $source, $destination, $depth = -1, $dirMode = 0775, $fileMode = 0664 )
{
// Check if source file exists at all.
if ( !is_file( $source ) && !is_dir( $source ) )
{
throw new ezcBaseFileNotFoundException( $source );
}
// Desti... | [
"static",
"public",
"function",
"copyRecursive",
"(",
"$",
"source",
",",
"$",
"destination",
",",
"$",
"depth",
"=",
"-",
"1",
",",
"$",
"dirMode",
"=",
"0775",
",",
"$",
"fileMode",
"=",
"0664",
")",
"{",
"// Check if source file exists at all.",
"if",
"... | Recursively copy a file or directory.
Recursively copy a file or directory in $source to the given
destination. If a depth is given, the operation will stop, if the given
recursion depth is reached. A depth of -1 means no limit, while a depth
of 0 means, that only the current file or directory will be copied,
without ... | [
"Recursively",
"copy",
"a",
"file",
"or",
"directory",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Base/src/file.php#L320-L377 |
20,665 | shipmile/shipmile-api-php | lib/Shipmile/HttpClient/HttpClient.php | HttpClient.request | public function request($path, $body = null, $httpMethod = 'GET', array $options = array())
{
$headers = array();
$options = array_merge($this->options, $options);
if (isset($options['headers'])) {
$headers = $options['headers'];
unset($options['headers']);
... | php | public function request($path, $body = null, $httpMethod = 'GET', array $options = array())
{
$headers = array();
$options = array_merge($this->options, $options);
if (isset($options['headers'])) {
$headers = $options['headers'];
unset($options['headers']);
... | [
"public",
"function",
"request",
"(",
"$",
"path",
",",
"$",
"body",
"=",
"null",
",",
"$",
"httpMethod",
"=",
"'GET'",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"headers",
"=",
"array",
"(",
")",
";",
"$",
"options",
"... | Intermediate function which does three main things
- Transforms the body of request into correct format
- Creates the requests with give parameters
- Returns response body after parsing it into correct format | [
"Intermediate",
"function",
"which",
"does",
"three",
"main",
"things"
] | b8272613b3a27f0f27e8722cbee277e41e9dfe59 | https://github.com/shipmile/shipmile-api-php/blob/b8272613b3a27f0f27e8722cbee277e41e9dfe59/lib/Shipmile/HttpClient/HttpClient.php#L99-L132 |
20,666 | shipmile/shipmile-api-php | lib/Shipmile/HttpClient/HttpClient.php | HttpClient.createRequest | public function createRequest($httpMethod, $path, $body = null, array $headers = array(), array $options = array())
{
$version = (isset($options['api_version']) ? "/".$options['api_version'] : "");
$path = $version.$path;
return $this->client->createRequest($httpMethod, $path, $headers,... | php | public function createRequest($httpMethod, $path, $body = null, array $headers = array(), array $options = array())
{
$version = (isset($options['api_version']) ? "/".$options['api_version'] : "");
$path = $version.$path;
return $this->client->createRequest($httpMethod, $path, $headers,... | [
"public",
"function",
"createRequest",
"(",
"$",
"httpMethod",
",",
"$",
"path",
",",
"$",
"body",
"=",
"null",
",",
"array",
"$",
"headers",
"=",
"array",
"(",
")",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"version",
"=... | Creating a request with the given arguments
If api_version is set, appends it immediately after host | [
"Creating",
"a",
"request",
"with",
"the",
"given",
"arguments"
] | b8272613b3a27f0f27e8722cbee277e41e9dfe59 | https://github.com/shipmile/shipmile-api-php/blob/b8272613b3a27f0f27e8722cbee277e41e9dfe59/lib/Shipmile/HttpClient/HttpClient.php#L139-L146 |
20,667 | shipmile/shipmile-api-php | lib/Shipmile/HttpClient/HttpClient.php | HttpClient.setBody | public function setBody(RequestInterface $request, $body, $options)
{
return RequestHandler::setBody($request, $body, $options);
} | php | public function setBody(RequestInterface $request, $body, $options)
{
return RequestHandler::setBody($request, $body, $options);
} | [
"public",
"function",
"setBody",
"(",
"RequestInterface",
"$",
"request",
",",
"$",
"body",
",",
"$",
"options",
")",
"{",
"return",
"RequestHandler",
"::",
"setBody",
"(",
"$",
"request",
",",
"$",
"body",
",",
"$",
"options",
")",
";",
"}"
] | Set request body in correct format | [
"Set",
"request",
"body",
"in",
"correct",
"format"
] | b8272613b3a27f0f27e8722cbee277e41e9dfe59 | https://github.com/shipmile/shipmile-api-php/blob/b8272613b3a27f0f27e8722cbee277e41e9dfe59/lib/Shipmile/HttpClient/HttpClient.php#L159-L162 |
20,668 | chemel/dom-parser-helper | src/HtmlDomParserHelper.php | HtmlDomParserHelper.getClient | public function getClient()
{
if (!$this->client) {
$client = new GuzzleHelper();
$this->configureClient($client);
return $this->client = $client->getClient();
}
return $this->client;
} | php | public function getClient()
{
if (!$this->client) {
$client = new GuzzleHelper();
$this->configureClient($client);
return $this->client = $client->getClient();
}
return $this->client;
} | [
"public",
"function",
"getClient",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"client",
")",
"{",
"$",
"client",
"=",
"new",
"GuzzleHelper",
"(",
")",
";",
"$",
"this",
"->",
"configureClient",
"(",
"$",
"client",
")",
";",
"return",
"$",
"t... | Get new Curl instance
@return Curl curl | [
"Get",
"new",
"Curl",
"instance"
] | 0ec7df13b19e3f3df4453023b37cba6bb16eb10a | https://github.com/chemel/dom-parser-helper/blob/0ec7df13b19e3f3df4453023b37cba6bb16eb10a/src/HtmlDomParserHelper.php#L36-L47 |
20,669 | chemel/dom-parser-helper | src/HtmlDomParserHelper.php | HtmlDomParserHelper.performRequest | public function performRequest($url)
{
$client = $this->getClient();
return $this->response = $client->get($url);
} | php | public function performRequest($url)
{
$client = $this->getClient();
return $this->response = $client->get($url);
} | [
"public",
"function",
"performRequest",
"(",
"$",
"url",
")",
"{",
"$",
"client",
"=",
"$",
"this",
"->",
"getClient",
"(",
")",
";",
"return",
"$",
"this",
"->",
"response",
"=",
"$",
"client",
"->",
"get",
"(",
"$",
"url",
")",
";",
"}"
] | Perform HTTP request
@param string url
@return CurlResponse response | [
"Perform",
"HTTP",
"request"
] | 0ec7df13b19e3f3df4453023b37cba6bb16eb10a | https://github.com/chemel/dom-parser-helper/blob/0ec7df13b19e3f3df4453023b37cba6bb16eb10a/src/HtmlDomParserHelper.php#L66-L71 |
20,670 | chemel/dom-parser-helper | src/HtmlDomParserHelper.php | HtmlDomParserHelper.getPageTitle | public function getPageTitle()
{
if (!$this->parser) {
return;
}
$node = $this->parser->find('title', 0);
if ($node) {
return $node->innertext;
}
} | php | public function getPageTitle()
{
if (!$this->parser) {
return;
}
$node = $this->parser->find('title', 0);
if ($node) {
return $node->innertext;
}
} | [
"public",
"function",
"getPageTitle",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"parser",
")",
"{",
"return",
";",
"}",
"$",
"node",
"=",
"$",
"this",
"->",
"parser",
"->",
"find",
"(",
"'title'",
",",
"0",
")",
";",
"if",
"(",
"$",
"no... | Get page title
@return string title | [
"Get",
"page",
"title"
] | 0ec7df13b19e3f3df4453023b37cba6bb16eb10a | https://github.com/chemel/dom-parser-helper/blob/0ec7df13b19e3f3df4453023b37cba6bb16eb10a/src/HtmlDomParserHelper.php#L136-L147 |
20,671 | chemel/dom-parser-helper | src/HtmlDomParserHelper.php | HtmlDomParserHelper.getPageDescription | public function getPageDescription()
{
if (!$this->parser) {
return;
}
$node = $this->parser->find('meta[name=description]', 0);
if ($node) {
return $node->getAttribute('content');
}
} | php | public function getPageDescription()
{
if (!$this->parser) {
return;
}
$node = $this->parser->find('meta[name=description]', 0);
if ($node) {
return $node->getAttribute('content');
}
} | [
"public",
"function",
"getPageDescription",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"parser",
")",
"{",
"return",
";",
"}",
"$",
"node",
"=",
"$",
"this",
"->",
"parser",
"->",
"find",
"(",
"'meta[name=description]'",
",",
"0",
")",
";",
"i... | Get page description
@return string description | [
"Get",
"page",
"description"
] | 0ec7df13b19e3f3df4453023b37cba6bb16eb10a | https://github.com/chemel/dom-parser-helper/blob/0ec7df13b19e3f3df4453023b37cba6bb16eb10a/src/HtmlDomParserHelper.php#L154-L165 |
20,672 | chemel/dom-parser-helper | src/HtmlDomParserHelper.php | HtmlDomParserHelper.getPageKeywords | public function getPageKeywords()
{
if (!$this->parser) {
return;
}
$node = $this->parser->find('meta[name=keywords]', 0);
if ($node) {
return $node->getAttribute('content');
}
} | php | public function getPageKeywords()
{
if (!$this->parser) {
return;
}
$node = $this->parser->find('meta[name=keywords]', 0);
if ($node) {
return $node->getAttribute('content');
}
} | [
"public",
"function",
"getPageKeywords",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"parser",
")",
"{",
"return",
";",
"}",
"$",
"node",
"=",
"$",
"this",
"->",
"parser",
"->",
"find",
"(",
"'meta[name=keywords]'",
",",
"0",
")",
";",
"if",
... | Get page keywords
@return string url | [
"Get",
"page",
"keywords"
] | 0ec7df13b19e3f3df4453023b37cba6bb16eb10a | https://github.com/chemel/dom-parser-helper/blob/0ec7df13b19e3f3df4453023b37cba6bb16eb10a/src/HtmlDomParserHelper.php#L172-L183 |
20,673 | chemel/dom-parser-helper | src/HtmlDomParserHelper.php | HtmlDomParserHelper.getPageCanonical | public function getPageCanonical()
{
if (!$this->parser) {
return;
}
$node = $this->parser->find('link[rel=canonical]', 0);
if ($node) {
return $node->getAttribute('href');
}
} | php | public function getPageCanonical()
{
if (!$this->parser) {
return;
}
$node = $this->parser->find('link[rel=canonical]', 0);
if ($node) {
return $node->getAttribute('href');
}
} | [
"public",
"function",
"getPageCanonical",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"parser",
")",
"{",
"return",
";",
"}",
"$",
"node",
"=",
"$",
"this",
"->",
"parser",
"->",
"find",
"(",
"'link[rel=canonical]'",
",",
"0",
")",
";",
"if",
... | Get page canonical url
@return string url | [
"Get",
"page",
"canonical",
"url"
] | 0ec7df13b19e3f3df4453023b37cba6bb16eb10a | https://github.com/chemel/dom-parser-helper/blob/0ec7df13b19e3f3df4453023b37cba6bb16eb10a/src/HtmlDomParserHelper.php#L190-L201 |
20,674 | chemel/dom-parser-helper | src/HtmlDomParserHelper.php | HtmlDomParserHelper.getPageFavicon | public function getPageFavicon()
{
if (!$this->parser) {
return;
}
$node = $this->parser->find('link[rel=shortcut], link[rel=icon], link[rel=shortcut icon]', 0);
if ($node) {
return $node->getAttribute('href');
}
} | php | public function getPageFavicon()
{
if (!$this->parser) {
return;
}
$node = $this->parser->find('link[rel=shortcut], link[rel=icon], link[rel=shortcut icon]', 0);
if ($node) {
return $node->getAttribute('href');
}
} | [
"public",
"function",
"getPageFavicon",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"parser",
")",
"{",
"return",
";",
"}",
"$",
"node",
"=",
"$",
"this",
"->",
"parser",
"->",
"find",
"(",
"'link[rel=shortcut], link[rel=icon], link[rel=shortcut icon]'",... | Get page favicon url
@return string url | [
"Get",
"page",
"favicon",
"url"
] | 0ec7df13b19e3f3df4453023b37cba6bb16eb10a | https://github.com/chemel/dom-parser-helper/blob/0ec7df13b19e3f3df4453023b37cba6bb16eb10a/src/HtmlDomParserHelper.php#L208-L219 |
20,675 | chemel/dom-parser-helper | src/HtmlDomParserHelper.php | HtmlDomParserHelper.getPageMetas | public function getPageMetas()
{
if (!$this->parser) {
return;
}
$nodes = $this->parser->find('meta');
$metas = array();
foreach ($nodes as $node) {
if ($node->hasAttribute('name')) {
$metas[ $node->getAttribute('name') ] = $node->ge... | php | public function getPageMetas()
{
if (!$this->parser) {
return;
}
$nodes = $this->parser->find('meta');
$metas = array();
foreach ($nodes as $node) {
if ($node->hasAttribute('name')) {
$metas[ $node->getAttribute('name') ] = $node->ge... | [
"public",
"function",
"getPageMetas",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"parser",
")",
"{",
"return",
";",
"}",
"$",
"nodes",
"=",
"$",
"this",
"->",
"parser",
"->",
"find",
"(",
"'meta'",
")",
";",
"$",
"metas",
"=",
"array",
"("... | Get meta description
@return array metas | [
"Get",
"meta",
"description"
] | 0ec7df13b19e3f3df4453023b37cba6bb16eb10a | https://github.com/chemel/dom-parser-helper/blob/0ec7df13b19e3f3df4453023b37cba6bb16eb10a/src/HtmlDomParserHelper.php#L226-L245 |
20,676 | chemel/dom-parser-helper | src/HtmlDomParserHelper.php | HtmlDomParserHelper.getPageFeeds | public function getPageFeeds()
{
if (!$this->parser) {
return;
}
$nodes = $this->parser->find('link');
$feeds = array();
$types = array(
'application/rss+xml',
'application/atom+xml',
'text/xml',
);
foreach (... | php | public function getPageFeeds()
{
if (!$this->parser) {
return;
}
$nodes = $this->parser->find('link');
$feeds = array();
$types = array(
'application/rss+xml',
'application/atom+xml',
'text/xml',
);
foreach (... | [
"public",
"function",
"getPageFeeds",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"parser",
")",
"{",
"return",
";",
"}",
"$",
"nodes",
"=",
"$",
"this",
"->",
"parser",
"->",
"find",
"(",
"'link'",
")",
";",
"$",
"feeds",
"=",
"array",
"("... | Get rss feeds urls
@return array feeds | [
"Get",
"rss",
"feeds",
"urls"
] | 0ec7df13b19e3f3df4453023b37cba6bb16eb10a | https://github.com/chemel/dom-parser-helper/blob/0ec7df13b19e3f3df4453023b37cba6bb16eb10a/src/HtmlDomParserHelper.php#L252-L277 |
20,677 | chemel/dom-parser-helper | src/HtmlDomParserHelper.php | HtmlDomParserHelper.clear | public function clear()
{
$this->response = null;
if ($this->parser) {
$this->parser->clear();
}
$this->parser = null;
} | php | public function clear()
{
$this->response = null;
if ($this->parser) {
$this->parser->clear();
}
$this->parser = null;
} | [
"public",
"function",
"clear",
"(",
")",
"{",
"$",
"this",
"->",
"response",
"=",
"null",
";",
"if",
"(",
"$",
"this",
"->",
"parser",
")",
"{",
"$",
"this",
"->",
"parser",
"->",
"clear",
"(",
")",
";",
"}",
"$",
"this",
"->",
"parser",
"=",
"... | Clean up memory | [
"Clean",
"up",
"memory"
] | 0ec7df13b19e3f3df4453023b37cba6bb16eb10a | https://github.com/chemel/dom-parser-helper/blob/0ec7df13b19e3f3df4453023b37cba6bb16eb10a/src/HtmlDomParserHelper.php#L336-L345 |
20,678 | hametuha/wpametu | src/WPametu/DB/Column.php | Column.data_type | private static function data_type($column){
/** @var $wpdb \wpdb */
global $wpdb;
// Let's create query
$sql = $column['type'];
// Is DECIMAL?
if( self::DECIMAL == $column['type'] ){
$sql .= sprintf('(%d, %d)', $column['max_digit'], $column['float']);
... | php | private static function data_type($column){
/** @var $wpdb \wpdb */
global $wpdb;
// Let's create query
$sql = $column['type'];
// Is DECIMAL?
if( self::DECIMAL == $column['type'] ){
$sql .= sprintf('(%d, %d)', $column['max_digit'], $column['float']);
... | [
"private",
"static",
"function",
"data_type",
"(",
"$",
"column",
")",
"{",
"/** @var $wpdb \\wpdb */",
"global",
"$",
"wpdb",
";",
"// Let's create query",
"$",
"sql",
"=",
"$",
"column",
"[",
"'type'",
"]",
";",
"// Is DECIMAL?",
"if",
"(",
"self",
"::",
"... | Build data type on create statement
@param array $column
@return string | [
"Build",
"data",
"type",
"on",
"create",
"statement"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/DB/Column.php#L149-L204 |
20,679 | hametuha/wpametu | src/WPametu/DB/Column.php | Column.filter | public static function filter($column){
$column = wp_parse_args($column, [
'type' => '',
'null' => false,
]);
// Type required.
if( !self::exists($column['type']) ){
throw new \Exception('You must properly specify the data type of column.');
}
... | php | public static function filter($column){
$column = wp_parse_args($column, [
'type' => '',
'null' => false,
]);
// Type required.
if( !self::exists($column['type']) ){
throw new \Exception('You must properly specify the data type of column.');
}
... | [
"public",
"static",
"function",
"filter",
"(",
"$",
"column",
")",
"{",
"$",
"column",
"=",
"wp_parse_args",
"(",
"$",
"column",
",",
"[",
"'type'",
"=>",
"''",
",",
"'null'",
"=>",
"false",
",",
"]",
")",
";",
"// Type required.",
"if",
"(",
"!",
"s... | Filter column array
@param array $column
@return array
@throws \Exception | [
"Filter",
"column",
"array"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/DB/Column.php#L213-L241 |
20,680 | f1nder/SolutionPipelineBuilder | src/Solution/MongoAggregation/Pipeline/Query.php | Query.convertArgs | protected function convertArgs($step)
{
if ($step instanceof Operator) {
$arguments = $step->getArguments();
} else {
$arguments = $step;
}
if (is_array($arguments)) {
$values = [];
foreach ($arguments as $key => $args) {
... | php | protected function convertArgs($step)
{
if ($step instanceof Operator) {
$arguments = $step->getArguments();
} else {
$arguments = $step;
}
if (is_array($arguments)) {
$values = [];
foreach ($arguments as $key => $args) {
... | [
"protected",
"function",
"convertArgs",
"(",
"$",
"step",
")",
"{",
"if",
"(",
"$",
"step",
"instanceof",
"Operator",
")",
"{",
"$",
"arguments",
"=",
"$",
"step",
"->",
"getArguments",
"(",
")",
";",
"}",
"else",
"{",
"$",
"arguments",
"=",
"$",
"st... | Recursive convert args
@todo refactor
@param $step
@return array|string | [
"Recursive",
"convert",
"args"
] | aca3cdfb2262fb3ceea82310b903c908c4c9b983 | https://github.com/f1nder/SolutionPipelineBuilder/blob/aca3cdfb2262fb3ceea82310b903c908c4c9b983/src/Solution/MongoAggregation/Pipeline/Query.php#L70-L103 |
20,681 | impensavel/essence | src/SOAP.php | SOAP.makeCall | public function makeCall(array $input)
{
$input = array_replace_recursive(array(
'function' => null,
), $input, array(
'arguments' => array(),
'options' => array(),
'headers' => array(),
));
if (empty($input['function'])) {
... | php | public function makeCall(array $input)
{
$input = array_replace_recursive(array(
'function' => null,
), $input, array(
'arguments' => array(),
'options' => array(),
'headers' => array(),
));
if (empty($input['function'])) {
... | [
"public",
"function",
"makeCall",
"(",
"array",
"$",
"input",
")",
"{",
"$",
"input",
"=",
"array_replace_recursive",
"(",
"array",
"(",
"'function'",
"=>",
"null",
",",
")",
",",
"$",
"input",
",",
"array",
"(",
"'arguments'",
"=>",
"array",
"(",
")",
... | Make SOAP call
@param array $input Input data
@throws EssenceException
@return string | [
"Make",
"SOAP",
"call"
] | e74969e55ac889e8c2cab9a915f82e93a72e629e | https://github.com/impensavel/essence/blob/e74969e55ac889e8c2cab9a915f82e93a72e629e/src/SOAP.php#L110-L143 |
20,682 | unclecheese/silverstripe-blubber | code/Outputter.php | Outputter.ask | public function ask($question, $weight = "y") {
$question = self::format($question);
$y = $weight == 'y' ? 'Y' : 'y';
$n = $weight == 'n' ? 'N' : 'n';
$answer = $this->prompt("$question [$y/$n]");
$line = trim(strtolower($answer));
if(empty($line)) {
$line = $weight;
}
return in_array($line, arra... | php | public function ask($question, $weight = "y") {
$question = self::format($question);
$y = $weight == 'y' ? 'Y' : 'y';
$n = $weight == 'n' ? 'N' : 'n';
$answer = $this->prompt("$question [$y/$n]");
$line = trim(strtolower($answer));
if(empty($line)) {
$line = $weight;
}
return in_array($line, arra... | [
"public",
"function",
"ask",
"(",
"$",
"question",
",",
"$",
"weight",
"=",
"\"y\"",
")",
"{",
"$",
"question",
"=",
"self",
"::",
"format",
"(",
"$",
"question",
")",
";",
"$",
"y",
"=",
"$",
"weight",
"==",
"'y'",
"?",
"'Y'",
":",
"'y'",
";",
... | Asks the user a question. If a 'y' value is entered, returns true
@param string $question
@param string $weight Either 'y' or 'n' can have the default value (on enter key)
@return boolean | [
"Asks",
"the",
"user",
"a",
"question",
".",
"If",
"a",
"y",
"value",
"is",
"entered",
"returns",
"true"
] | f2549bd5eddeb0ca0303a3c09be4a8136fcc6661 | https://github.com/unclecheese/silverstripe-blubber/blob/f2549bd5eddeb0ca0303a3c09be4a8136fcc6661/code/Outputter.php#L79-L91 |
20,683 | unclecheese/silverstripe-blubber | code/Outputter.php | Outputter.prompt | public function prompt($question) {
$question = self::format($question);
$this->write("$question: ");
$handle = fopen("php://stdin","r");
return fgets($handle);
} | php | public function prompt($question) {
$question = self::format($question);
$this->write("$question: ");
$handle = fopen("php://stdin","r");
return fgets($handle);
} | [
"public",
"function",
"prompt",
"(",
"$",
"question",
")",
"{",
"$",
"question",
"=",
"self",
"::",
"format",
"(",
"$",
"question",
")",
";",
"$",
"this",
"->",
"write",
"(",
"\"$question: \"",
")",
";",
"$",
"handle",
"=",
"fopen",
"(",
"\"php://stdin... | Prompts the user for input
@param string $question
@return string | [
"Prompts",
"the",
"user",
"for",
"input"
] | f2549bd5eddeb0ca0303a3c09be4a8136fcc6661 | https://github.com/unclecheese/silverstripe-blubber/blob/f2549bd5eddeb0ca0303a3c09be4a8136fcc6661/code/Outputter.php#L99-L105 |
20,684 | unclecheese/silverstripe-blubber | code/Outputter.php | Outputter.updateProgress | public function updateProgress($text) {
$text = self::format($text);
if($this->progressValue) {
$len = strlen($this->progressValue);
fwrite(STDOUT, "\033[{$len}D");
}
$this->progressValue = $text;
fwrite(STDOUT, $this->progressValue);
} | php | public function updateProgress($text) {
$text = self::format($text);
if($this->progressValue) {
$len = strlen($this->progressValue);
fwrite(STDOUT, "\033[{$len}D");
}
$this->progressValue = $text;
fwrite(STDOUT, $this->progressValue);
} | [
"public",
"function",
"updateProgress",
"(",
"$",
"text",
")",
"{",
"$",
"text",
"=",
"self",
"::",
"format",
"(",
"$",
"text",
")",
";",
"if",
"(",
"$",
"this",
"->",
"progressValue",
")",
"{",
"$",
"len",
"=",
"strlen",
"(",
"$",
"this",
"->",
... | Updates the output with new text
@param string $text | [
"Updates",
"the",
"output",
"with",
"new",
"text"
] | f2549bd5eddeb0ca0303a3c09be4a8136fcc6661 | https://github.com/unclecheese/silverstripe-blubber/blob/f2549bd5eddeb0ca0303a3c09be4a8136fcc6661/code/Outputter.php#L112-L121 |
20,685 | gedex/php-janrain-api | lib/Janrain/Api/Engage/ConfigureRP.php | ConfigureRP.setBackplaneProperties | public function setBackplaneProperties(array $params)
{
if (!isset($params['server'])) {
throw new MissingArgumentException('server');
}
if (!isset($params['bus'])) {
throw new MissingArgumentException('bus');
}
return $this->post('set_backplane_properties', $params);
} | php | public function setBackplaneProperties(array $params)
{
if (!isset($params['server'])) {
throw new MissingArgumentException('server');
}
if (!isset($params['bus'])) {
throw new MissingArgumentException('bus');
}
return $this->post('set_backplane_properties', $params);
} | [
"public",
"function",
"setBackplaneProperties",
"(",
"array",
"$",
"params",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"params",
"[",
"'server'",
"]",
")",
")",
"{",
"throw",
"new",
"MissingArgumentException",
"(",
"'server'",
")",
";",
"}",
"if",
"("... | Configures Backplane server used to communicate with all of the Backplane
enabled widgets on a page.
@param array $params
@link http://developers.janrain.com/documentation/api-methods/engage/configure-rp/set_backplane_properties/ | [
"Configures",
"Backplane",
"server",
"used",
"to",
"communicate",
"with",
"all",
"of",
"the",
"Backplane",
"enabled",
"widgets",
"on",
"a",
"page",
"."
] | 6283f68454e0ad5211ac620f1d337df38cd49597 | https://github.com/gedex/php-janrain-api/blob/6283f68454e0ad5211ac620f1d337df38cd49597/lib/Janrain/Api/Engage/ConfigureRP.php#L64-L75 |
20,686 | NuclearCMS/Hierarchy | src/Builders/FormBuilder.php | FormBuilder.build | public function build($name, Collection $fields = null)
{
$path = $this->getClassFilePath($name);
$contents = view('_hierarchy::entities.form', [
'name' => $this->getClassName($name),
'fields' => $fields ?: []
])->render();
$this->write($path, $contents);
... | php | public function build($name, Collection $fields = null)
{
$path = $this->getClassFilePath($name);
$contents = view('_hierarchy::entities.form', [
'name' => $this->getClassName($name),
'fields' => $fields ?: []
])->render();
$this->write($path, $contents);
... | [
"public",
"function",
"build",
"(",
"$",
"name",
",",
"Collection",
"$",
"fields",
"=",
"null",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"getClassFilePath",
"(",
"$",
"name",
")",
";",
"$",
"contents",
"=",
"view",
"(",
"'_hierarchy::entities.form'... | Builds a source form
@param string $name
@param Collection|null $fields | [
"Builds",
"a",
"source",
"form"
] | 535171c5e2db72265313fd2110aec8456e46f459 | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Builders/FormBuilder.php#L20-L30 |
20,687 | endorphin-studio/browser-detector-data | src/Storage/FileStorage.php | FileStorage.getFileNames | protected function getFileNames(string $directory = 'default'): array
{
$directoryIterator = $this->getDirectoryIterator($directory);
$files = [];
foreach ($directoryIterator as $file) {
$this->resolveFile($file, $files);
}
return $files;
} | php | protected function getFileNames(string $directory = 'default'): array
{
$directoryIterator = $this->getDirectoryIterator($directory);
$files = [];
foreach ($directoryIterator as $file) {
$this->resolveFile($file, $files);
}
return $files;
} | [
"protected",
"function",
"getFileNames",
"(",
"string",
"$",
"directory",
"=",
"'default'",
")",
":",
"array",
"{",
"$",
"directoryIterator",
"=",
"$",
"this",
"->",
"getDirectoryIterator",
"(",
"$",
"directory",
")",
";",
"$",
"files",
"=",
"[",
"]",
";",... | Get list of paths in directory
@param string $directory
@return array | [
"Get",
"list",
"of",
"paths",
"in",
"directory"
] | cb1ace9f52f9677616c89f3b80c5148936d47b82 | https://github.com/endorphin-studio/browser-detector-data/blob/cb1ace9f52f9677616c89f3b80c5148936d47b82/src/Storage/FileStorage.php#L35-L43 |
20,688 | endorphin-studio/browser-detector-data | src/Storage/FileStorage.php | FileStorage.resolveFile | private function resolveFile(\DirectoryIterator $file, array &$files)
{
if ($file->isDir() && !$file->isDot()) {
$files = Tools::resolvePath($files, $this->getFileNames());
}
if ($file->isFile() && !$file->isLink() && $file->isReadable()) {
$files = Tools::resolvePat... | php | private function resolveFile(\DirectoryIterator $file, array &$files)
{
if ($file->isDir() && !$file->isDot()) {
$files = Tools::resolvePath($files, $this->getFileNames());
}
if ($file->isFile() && !$file->isLink() && $file->isReadable()) {
$files = Tools::resolvePat... | [
"private",
"function",
"resolveFile",
"(",
"\\",
"DirectoryIterator",
"$",
"file",
",",
"array",
"&",
"$",
"files",
")",
"{",
"if",
"(",
"$",
"file",
"->",
"isDir",
"(",
")",
"&&",
"!",
"$",
"file",
"->",
"isDot",
"(",
")",
")",
"{",
"$",
"files",
... | Add file to list or scan directory
@param \DirectoryIterator $file
@param array $files | [
"Add",
"file",
"to",
"list",
"or",
"scan",
"directory"
] | cb1ace9f52f9677616c89f3b80c5148936d47b82 | https://github.com/endorphin-studio/browser-detector-data/blob/cb1ace9f52f9677616c89f3b80c5148936d47b82/src/Storage/FileStorage.php#L50-L59 |
20,689 | endorphin-studio/browser-detector-data | src/Storage/FileStorage.php | FileStorage.getDirectoryIterator | private function getDirectoryIterator(string $directory): \DirectoryIterator
{
if ($directory === 'default') {
return new \DirectoryIterator($this->dataDirectory);
}
return new \DirectoryIterator($directory);
} | php | private function getDirectoryIterator(string $directory): \DirectoryIterator
{
if ($directory === 'default') {
return new \DirectoryIterator($this->dataDirectory);
}
return new \DirectoryIterator($directory);
} | [
"private",
"function",
"getDirectoryIterator",
"(",
"string",
"$",
"directory",
")",
":",
"\\",
"DirectoryIterator",
"{",
"if",
"(",
"$",
"directory",
"===",
"'default'",
")",
"{",
"return",
"new",
"\\",
"DirectoryIterator",
"(",
"$",
"this",
"->",
"dataDirect... | Get Directory Iterator
@param string $directory
@return \DirectoryIterator | [
"Get",
"Directory",
"Iterator"
] | cb1ace9f52f9677616c89f3b80c5148936d47b82 | https://github.com/endorphin-studio/browser-detector-data/blob/cb1ace9f52f9677616c89f3b80c5148936d47b82/src/Storage/FileStorage.php#L66-L72 |
20,690 | philiplb/Valdi | src/Valdi/Validator/AbstractDateTimeComparator.php | AbstractDateTimeComparator.getDateTimeFormat | protected function getDateTimeFormat($parameters) {
$format = 'Y-m-d H:i:s';
$parametersCount = count($parameters);
if ($parametersCount > $this->amountOfParameters) {
$format = $parameters[$parametersCount - 1];
}
return $format;
} | php | protected function getDateTimeFormat($parameters) {
$format = 'Y-m-d H:i:s';
$parametersCount = count($parameters);
if ($parametersCount > $this->amountOfParameters) {
$format = $parameters[$parametersCount - 1];
}
return $format;
} | [
"protected",
"function",
"getDateTimeFormat",
"(",
"$",
"parameters",
")",
"{",
"$",
"format",
"=",
"'Y-m-d H:i:s'",
";",
"$",
"parametersCount",
"=",
"count",
"(",
"$",
"parameters",
")",
";",
"if",
"(",
"$",
"parametersCount",
">",
"$",
"this",
"->",
"am... | Gets a date time format from the parameters if given or a default one.
@param string[] $parameters
the parameters
@return string
the date time format | [
"Gets",
"a",
"date",
"time",
"format",
"from",
"the",
"parameters",
"if",
"given",
"or",
"a",
"default",
"one",
"."
] | 9927ec34a2cb00cec705e952d3c2374e2dc3c972 | https://github.com/philiplb/Valdi/blob/9927ec34a2cb00cec705e952d3c2374e2dc3c972/src/Valdi/Validator/AbstractDateTimeComparator.php#L63-L70 |
20,691 | philiplb/Valdi | src/Valdi/Validator/AbstractDateTimeComparator.php | AbstractDateTimeComparator.getDateTimes | protected function getDateTimes(array $parameters, $format) {
if (!$this->dateTimeParameters) {
return [];
}
$datetimes = [];
for ($i = 0; $i < $this->amountOfParameters; ++$i) {
$datetime = \DateTime::createFromFormat($format, $parameters[$i]);
if ($d... | php | protected function getDateTimes(array $parameters, $format) {
if (!$this->dateTimeParameters) {
return [];
}
$datetimes = [];
for ($i = 0; $i < $this->amountOfParameters; ++$i) {
$datetime = \DateTime::createFromFormat($format, $parameters[$i]);
if ($d... | [
"protected",
"function",
"getDateTimes",
"(",
"array",
"$",
"parameters",
",",
"$",
"format",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"dateTimeParameters",
")",
"{",
"return",
"[",
"]",
";",
"}",
"$",
"datetimes",
"=",
"[",
"]",
";",
"for",
"(",... | Interprets the given parameters as date times and returns them.
@param array $parameters
the parameters
@param string $format
the date time format
@return \DateTime[]
the date times
@throws ValidationException
thrown if one of the parameters is not a date in the given format | [
"Interprets",
"the",
"given",
"parameters",
"as",
"date",
"times",
"and",
"returns",
"them",
"."
] | 9927ec34a2cb00cec705e952d3c2374e2dc3c972 | https://github.com/philiplb/Valdi/blob/9927ec34a2cb00cec705e952d3c2374e2dc3c972/src/Valdi/Validator/AbstractDateTimeComparator.php#L86-L99 |
20,692 | ouropencode/dachi | src/Model.php | Model.jsonSerialize | public function jsonSerialize() {
$json = array();
foreach(get_object_vars($this) as $var => $val) {
if($val instanceof \DateTime)
$json[$var] = $val->getTimestamp();
else
$json[$var] = $val;
}
return $json;
} | php | public function jsonSerialize() {
$json = array();
foreach(get_object_vars($this) as $var => $val) {
if($val instanceof \DateTime)
$json[$var] = $val->getTimestamp();
else
$json[$var] = $val;
}
return $json;
} | [
"public",
"function",
"jsonSerialize",
"(",
")",
"{",
"$",
"json",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"get_object_vars",
"(",
"$",
"this",
")",
"as",
"$",
"var",
"=>",
"$",
"val",
")",
"{",
"if",
"(",
"$",
"val",
"instanceof",
"\\",
"Date... | Get a json serialized version of this object.
@return array | [
"Get",
"a",
"json",
"serialized",
"version",
"of",
"this",
"object",
"."
] | a0e1daf269d0345afbb859ce20ef9da6decd7efe | https://github.com/ouropencode/dachi/blob/a0e1daf269d0345afbb859ce20ef9da6decd7efe/src/Model.php#L18-L29 |
20,693 | andromeda-framework/doctrine | src/Doctrine/Cache/Cache.php | Cache.doSaveDependingOnFiles | protected function doSaveDependingOnFiles($id, $data, array $files, $lifeTime = 0)
{
$dependencies = [
NetteCache::TAGS => ['doctrine'],
NetteCache::FILES => $files
];
if ($lifeTime != 0) {
$dependencies[NetteCache::EXPIRE] = time() + $lifeTime;
}
$this->cache->save($id, $data, $dependencies);
re... | php | protected function doSaveDependingOnFiles($id, $data, array $files, $lifeTime = 0)
{
$dependencies = [
NetteCache::TAGS => ['doctrine'],
NetteCache::FILES => $files
];
if ($lifeTime != 0) {
$dependencies[NetteCache::EXPIRE] = time() + $lifeTime;
}
$this->cache->save($id, $data, $dependencies);
re... | [
"protected",
"function",
"doSaveDependingOnFiles",
"(",
"$",
"id",
",",
"$",
"data",
",",
"array",
"$",
"files",
",",
"$",
"lifeTime",
"=",
"0",
")",
"{",
"$",
"dependencies",
"=",
"[",
"NetteCache",
"::",
"TAGS",
"=>",
"[",
"'doctrine'",
"]",
",",
"Ne... | Puts data into the cache and makes them depending on the files.
@param string $id the cache id
@param string $data the cache entry/data
@param string[] $files the list of files the data are depending on
@param int $lifeTime the lifetime. If != 0, sets a specific lifetime for this cache entry (0 => infinite l... | [
"Puts",
"data",
"into",
"the",
"cache",
"and",
"makes",
"them",
"depending",
"on",
"the",
"files",
"."
] | 46924d91c09e0b9fbe5764518cbad70e467ffad4 | https://github.com/andromeda-framework/doctrine/blob/46924d91c09e0b9fbe5764518cbad70e467ffad4/src/Doctrine/Cache/Cache.php#L126-L138 |
20,694 | dragonmantank/fillet | src/Fillet/Writer/AbstractWriter.php | AbstractWriter.toMarkdown | protected function toMarkdown($content)
{
$tmpfname = tempnam(sys_get_temp_dir(), 'fillet'); // good
file_put_contents($tmpfname, $content);
$cmd = $this->config['pandoc']['bin'] . ' --no-wrap -f html -t markdown ' . $tmpfname;
$content = shell_exec($cmd);
unlink($tmpfname);
... | php | protected function toMarkdown($content)
{
$tmpfname = tempnam(sys_get_temp_dir(), 'fillet'); // good
file_put_contents($tmpfname, $content);
$cmd = $this->config['pandoc']['bin'] . ' --no-wrap -f html -t markdown ' . $tmpfname;
$content = shell_exec($cmd);
unlink($tmpfname);
... | [
"protected",
"function",
"toMarkdown",
"(",
"$",
"content",
")",
"{",
"$",
"tmpfname",
"=",
"tempnam",
"(",
"sys_get_temp_dir",
"(",
")",
",",
"'fillet'",
")",
";",
"// good",
"file_put_contents",
"(",
"$",
"tmpfname",
",",
"$",
"content",
")",
";",
"$",
... | Converts content from HTML to Markdown via pandoc
@param $content
@return string | [
"Converts",
"content",
"from",
"HTML",
"to",
"Markdown",
"via",
"pandoc"
] | b197947608c05ac2318e8f6b296345494004d9c6 | https://github.com/dragonmantank/fillet/blob/b197947608c05ac2318e8f6b296345494004d9c6/src/Fillet/Writer/AbstractWriter.php#L44-L52 |
20,695 | willhoffmann/domuserp-php | src/Resources/Addresses/Secondary/Streets.php | Streets.get | public function get($id)
{
$resource = self::$BASE_URI . '/' . $this->cityId . '/bairros/' . $this->neighborhoodId . '/logradouro/' . $id;
$data = $this->execute(self::HTTP_GET, $resource);
return $data;
} | php | public function get($id)
{
$resource = self::$BASE_URI . '/' . $this->cityId . '/bairros/' . $this->neighborhoodId . '/logradouro/' . $id;
$data = $this->execute(self::HTTP_GET, $resource);
return $data;
} | [
"public",
"function",
"get",
"(",
"$",
"id",
")",
"{",
"$",
"resource",
"=",
"self",
"::",
"$",
"BASE_URI",
".",
"'/'",
".",
"$",
"this",
"->",
"cityId",
".",
"'/bairros/'",
".",
"$",
"this",
"->",
"neighborhoodId",
".",
"'/logradouro/'",
".",
"$",
"... | Gets the street data according to the id parameter
@param int $id
@return array|string
@throws \GuzzleHttp\Exception\GuzzleException | [
"Gets",
"the",
"street",
"data",
"according",
"to",
"the",
"id",
"parameter"
] | 44e77a4f02b0252bc26cae4c0e6b2b7d578f10a6 | https://github.com/willhoffmann/domuserp-php/blob/44e77a4f02b0252bc26cae4c0e6b2b7d578f10a6/src/Resources/Addresses/Secondary/Streets.php#L64-L70 |
20,696 | gitiki/Gitiki | src/RouteCollection.php | RouteCollection.addBefore | public function addBefore($before, $name, SymfonyRoute $route)
{
$newRoute = $route;
foreach ($this->all() as $routeName => $route) {
if (null !== $newRoute && $before === $routeName) {
$this->add($name, $newRoute);
$newRoute = null;
}
... | php | public function addBefore($before, $name, SymfonyRoute $route)
{
$newRoute = $route;
foreach ($this->all() as $routeName => $route) {
if (null !== $newRoute && $before === $routeName) {
$this->add($name, $newRoute);
$newRoute = null;
}
... | [
"public",
"function",
"addBefore",
"(",
"$",
"before",
",",
"$",
"name",
",",
"SymfonyRoute",
"$",
"route",
")",
"{",
"$",
"newRoute",
"=",
"$",
"route",
";",
"foreach",
"(",
"$",
"this",
"->",
"all",
"(",
")",
"as",
"$",
"routeName",
"=>",
"$",
"r... | Adds a route before another.
@param string $before The before route name
@param string $name The route name
@param Route $route A Route instance
@throws \InvalidArgumentException If the before route name cannot be found | [
"Adds",
"a",
"route",
"before",
"another",
"."
] | f017672d4f5d0ef6015fad44724f05e3b1f08463 | https://github.com/gitiki/Gitiki/blob/f017672d4f5d0ef6015fad44724f05e3b1f08463/src/RouteCollection.php#L20-L38 |
20,697 | hametuha/wpametu | src/WPametu/Utility/IteratorWalker.php | IteratorWalker.key_search | public function key_search( array $array, $key, $value ) {
foreach ( $array as $key => $a ) {
if ( isset( $a[ $key ] ) && $a[ $key ] == $value ) {
return $key;
}
}
return false;
} | php | public function key_search( array $array, $key, $value ) {
foreach ( $array as $key => $a ) {
if ( isset( $a[ $key ] ) && $a[ $key ] == $value ) {
return $key;
}
}
return false;
} | [
"public",
"function",
"key_search",
"(",
"array",
"$",
"array",
",",
"$",
"key",
",",
"$",
"value",
")",
"{",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"$",
"a",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"a",
"[",
"$",
"key",
"]",
"... | Get index of array member with specified key
@param array $array
@param string $key
@param mixed $value
@return false|int|string | [
"Get",
"index",
"of",
"array",
"member",
"with",
"specified",
"key"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/Utility/IteratorWalker.php#L36-L44 |
20,698 | hametuha/wpametu | src/WPametu/Utility/IteratorWalker.php | IteratorWalker.prop_search | public function prop_search( array $array, $property, $value ) {
foreach ( $array as $key => $a ) {
if ( property_exists( $a, $property ) && $a->{$property} == $value ) {
return $key;
}
}
return false;
} | php | public function prop_search( array $array, $property, $value ) {
foreach ( $array as $key => $a ) {
if ( property_exists( $a, $property ) && $a->{$property} == $value ) {
return $key;
}
}
return false;
} | [
"public",
"function",
"prop_search",
"(",
"array",
"$",
"array",
",",
"$",
"property",
",",
"$",
"value",
")",
"{",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"$",
"a",
")",
"{",
"if",
"(",
"property_exists",
"(",
"$",
"a",
",",
"$",
"... | Search array member with specified property
@param array $array
@param string $property
@param mixed $value
@return false|int|string | [
"Search",
"array",
"member",
"with",
"specified",
"property"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/Utility/IteratorWalker.php#L68-L76 |
20,699 | krakphp/job | src/Kernel.php | Kernel.queueConfigs | private function queueConfigs() {
$config = $this->getConfig();
if (!isset($config['schedulers'])) {
yield $config;
return;
}
foreach ($config['schedulers'] as $child_config) {
yield mergeConfigOptions($config, $child_config);
}
} | php | private function queueConfigs() {
$config = $this->getConfig();
if (!isset($config['schedulers'])) {
yield $config;
return;
}
foreach ($config['schedulers'] as $child_config) {
yield mergeConfigOptions($config, $child_config);
}
} | [
"private",
"function",
"queueConfigs",
"(",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"getConfig",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"config",
"[",
"'schedulers'",
"]",
")",
")",
"{",
"yield",
"$",
"config",
";",
"return",
";... | return only the normalized queue configurations | [
"return",
"only",
"the",
"normalized",
"queue",
"configurations"
] | 0c16020c1baa13d91f819ecba8334861ba7c4d6c | https://github.com/krakphp/job/blob/0c16020c1baa13d91f819ecba8334861ba7c4d6c/src/Kernel.php#L65-L75 |
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.