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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
205,800 | praxisnetau/silverware-navigation | src/Components/LevelNavigation.php | LevelNavigation.getLevel | public function getLevel()
{
if ($page = $this->getCurrentPage(Page::class)) {
if (!$page->Children()->exists()) {
$parent = $page->getParent();
while ($parent && !$parent->Children()->exists()) {
... | php | public function getLevel()
{
if ($page = $this->getCurrentPage(Page::class)) {
if (!$page->Children()->exists()) {
$parent = $page->getParent();
while ($parent && !$parent->Children()->exists()) {
... | [
"public",
"function",
"getLevel",
"(",
")",
"{",
"if",
"(",
"$",
"page",
"=",
"$",
"this",
"->",
"getCurrentPage",
"(",
"Page",
"::",
"class",
")",
")",
"{",
"if",
"(",
"!",
"$",
"page",
"->",
"Children",
"(",
")",
"->",
"exists",
"(",
")",
")",
... | Answers the page object at the current level.
@return SiteTree | [
"Answers",
"the",
"page",
"object",
"at",
"the",
"current",
"level",
"."
] | 04e6f3003c2871348d5bba7869d4fc273641627e | https://github.com/praxisnetau/silverware-navigation/blob/04e6f3003c2871348d5bba7869d4fc273641627e/src/Components/LevelNavigation.php#L264-L283 |
205,801 | Etenil/assegai | src/assegai/modules/ModuleContainer.php | ModuleContainer.batchRun | public function batchRun($is_hook, $method_name, array $params = NULL)
{
// Prevents annoying notices.
if($params == NULL) {
$params = array();
}
// We collect the results into an array.
$results = array();
if(!$this->modules) $this->modules = array();
foreach($this->... | php | public function batchRun($is_hook, $method_name, array $params = NULL)
{
// Prevents annoying notices.
if($params == NULL) {
$params = array();
}
// We collect the results into an array.
$results = array();
if(!$this->modules) $this->modules = array();
foreach($this->... | [
"public",
"function",
"batchRun",
"(",
"$",
"is_hook",
",",
"$",
"method_name",
",",
"array",
"$",
"params",
"=",
"NULL",
")",
"{",
"// Prevents annoying notices.",
"if",
"(",
"$",
"params",
"==",
"NULL",
")",
"{",
"$",
"params",
"=",
"array",
"(",
")",
... | Batch runs a method on all modules.
@param bool $is_hook specifies that this is a hook call.
@param string $method_name is the method to be used on all modules.
@param array $params is an array of parameters to pass to all methods. | [
"Batch",
"runs",
"a",
"method",
"on",
"all",
"modules",
"."
] | d43cce1a88f1c332f60dd0a4374b17764852af9e | https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/ModuleContainer.php#L149-L173 |
205,802 | RadialCorp/magento-core | src/lib/Radial/RiskService/Sdk/Payload.php | Radial_RiskService_Sdk_Payload.deserialize | public function deserialize($serializedPayload)
{
$xpath = $this->_helper->getPayloadAsXPath($serializedPayload, $this->_getXmlNamespace());
$this->_deserializeExtractionPaths($xpath)
->_deserializeOptionalExtractionPaths($xpath)
->_deserializeBooleanExtractionPaths($xpath)
->_deserializeLineItems($serial... | php | public function deserialize($serializedPayload)
{
$xpath = $this->_helper->getPayloadAsXPath($serializedPayload, $this->_getXmlNamespace());
$this->_deserializeExtractionPaths($xpath)
->_deserializeOptionalExtractionPaths($xpath)
->_deserializeBooleanExtractionPaths($xpath)
->_deserializeLineItems($serial... | [
"public",
"function",
"deserialize",
"(",
"$",
"serializedPayload",
")",
"{",
"$",
"xpath",
"=",
"$",
"this",
"->",
"_helper",
"->",
"getPayloadAsXPath",
"(",
"$",
"serializedPayload",
",",
"$",
"this",
"->",
"_getXmlNamespace",
"(",
")",
")",
";",
"$",
"t... | Fill out this payload object with data from the supplied string.
@throws Radial_RiskService_Sdk_Exception_Invalid_Payload_Exception
@param string
@return $this | [
"Fill",
"out",
"this",
"payload",
"object",
"with",
"data",
"from",
"the",
"supplied",
"string",
"."
] | 9bb5f218d9caf79eab8598f4f8447037a0cc6355 | https://github.com/RadialCorp/magento-core/blob/9bb5f218d9caf79eab8598f4f8447037a0cc6355/src/lib/Radial/RiskService/Sdk/Payload.php#L93-L104 |
205,803 | RadialCorp/magento-core | src/lib/Radial/RiskService/Sdk/Payload.php | Radial_RiskService_Sdk_Payload._deserializeOptionalExtractionPaths | protected function _deserializeOptionalExtractionPaths(DOMXPath $xpath)
{
foreach ($this->_optionalExtractionPaths as $setter => $path) {
$foundNode = $xpath->query($path)->item(0);
if ($foundNode) {
$this->$setter($foundNode->nodeValue);
}
}
return $this;
} | php | protected function _deserializeOptionalExtractionPaths(DOMXPath $xpath)
{
foreach ($this->_optionalExtractionPaths as $setter => $path) {
$foundNode = $xpath->query($path)->item(0);
if ($foundNode) {
$this->$setter($foundNode->nodeValue);
}
}
return $this;
} | [
"protected",
"function",
"_deserializeOptionalExtractionPaths",
"(",
"DOMXPath",
"$",
"xpath",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"_optionalExtractionPaths",
"as",
"$",
"setter",
"=>",
"$",
"path",
")",
"{",
"$",
"foundNode",
"=",
"$",
"xpath",
"->",... | When optional nodes are not included in the serialized data,
they should not be set in the payload. Fortunately, these
are all string values so no additional type conversion is necessary.
@param DOMXPath
@return self | [
"When",
"optional",
"nodes",
"are",
"not",
"included",
"in",
"the",
"serialized",
"data",
"they",
"should",
"not",
"be",
"set",
"in",
"the",
"payload",
".",
"Fortunately",
"these",
"are",
"all",
"string",
"values",
"so",
"no",
"additional",
"type",
"conversi... | 9bb5f218d9caf79eab8598f4f8447037a0cc6355 | https://github.com/RadialCorp/magento-core/blob/9bb5f218d9caf79eab8598f4f8447037a0cc6355/src/lib/Radial/RiskService/Sdk/Payload.php#L126-L135 |
205,804 | RadialCorp/magento-core | src/lib/Radial/RiskService/Sdk/Payload.php | Radial_RiskService_Sdk_Payload._deserializeBooleanExtractionPaths | protected function _deserializeBooleanExtractionPaths(DOMXPath $xpath)
{
foreach ($this->_booleanExtractionPaths as $setter => $path) {
$value = $xpath->evaluate($path);
$this->$setter($this->_helper->convertStringToBoolean($value));
}
return $this;
} | php | protected function _deserializeBooleanExtractionPaths(DOMXPath $xpath)
{
foreach ($this->_booleanExtractionPaths as $setter => $path) {
$value = $xpath->evaluate($path);
$this->$setter($this->_helper->convertStringToBoolean($value));
}
return $this;
} | [
"protected",
"function",
"_deserializeBooleanExtractionPaths",
"(",
"DOMXPath",
"$",
"xpath",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"_booleanExtractionPaths",
"as",
"$",
"setter",
"=>",
"$",
"path",
")",
"{",
"$",
"value",
"=",
"$",
"xpath",
"->",
"ev... | boolean values have to be handled specially
@param DOMXPath
@return self | [
"boolean",
"values",
"have",
"to",
"be",
"handled",
"specially"
] | 9bb5f218d9caf79eab8598f4f8447037a0cc6355 | https://github.com/RadialCorp/magento-core/blob/9bb5f218d9caf79eab8598f4f8447037a0cc6355/src/lib/Radial/RiskService/Sdk/Payload.php#L143-L150 |
205,805 | RadialCorp/magento-core | src/lib/Radial/RiskService/Sdk/Payload.php | Radial_RiskService_Sdk_Payload._deserializeDateTimeExtractionPaths | protected function _deserializeDateTimeExtractionPaths(DOMXPath $xpath)
{
foreach ($this->_dateTimeExtractionPaths as $setter => $path) {
$value = $xpath->evaluate($path);
if ($value) {
$this->$setter(new DateTime($value));
}
}
return $this;
} | php | protected function _deserializeDateTimeExtractionPaths(DOMXPath $xpath)
{
foreach ($this->_dateTimeExtractionPaths as $setter => $path) {
$value = $xpath->evaluate($path);
if ($value) {
$this->$setter(new DateTime($value));
}
}
return $this;
} | [
"protected",
"function",
"_deserializeDateTimeExtractionPaths",
"(",
"DOMXPath",
"$",
"xpath",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"_dateTimeExtractionPaths",
"as",
"$",
"setter",
"=>",
"$",
"path",
")",
"{",
"$",
"value",
"=",
"$",
"xpath",
"->",
"... | Ensure any date time string is instantiate
@param DOMXPath
@return self | [
"Ensure",
"any",
"date",
"time",
"string",
"is",
"instantiate"
] | 9bb5f218d9caf79eab8598f4f8447037a0cc6355 | https://github.com/RadialCorp/magento-core/blob/9bb5f218d9caf79eab8598f4f8447037a0cc6355/src/lib/Radial/RiskService/Sdk/Payload.php#L174-L183 |
205,806 | RadialCorp/magento-core | src/lib/Radial/RiskService/Sdk/Payload.php | Radial_RiskService_Sdk_Payload._serializeRootAttributes | protected function _serializeRootAttributes()
{
$rootAttributes = $this->_getRootAttributes();
$qualifyAttributes = function ($name) use ($rootAttributes) {
return sprintf('%s="%s"', $name, $rootAttributes[$name]);
};
$qualifiedAttributes = array_map($qualifyAttributes, array_keys($rootAttributes));
retur... | php | protected function _serializeRootAttributes()
{
$rootAttributes = $this->_getRootAttributes();
$qualifyAttributes = function ($name) use ($rootAttributes) {
return sprintf('%s="%s"', $name, $rootAttributes[$name]);
};
$qualifiedAttributes = array_map($qualifyAttributes, array_keys($rootAttributes));
retur... | [
"protected",
"function",
"_serializeRootAttributes",
"(",
")",
"{",
"$",
"rootAttributes",
"=",
"$",
"this",
"->",
"_getRootAttributes",
"(",
")",
";",
"$",
"qualifyAttributes",
"=",
"function",
"(",
"$",
"name",
")",
"use",
"(",
"$",
"rootAttributes",
")",
... | Serialize Root Attributes
@return string | [
"Serialize",
"Root",
"Attributes"
] | 9bb5f218d9caf79eab8598f4f8447037a0cc6355 | https://github.com/RadialCorp/magento-core/blob/9bb5f218d9caf79eab8598f4f8447037a0cc6355/src/lib/Radial/RiskService/Sdk/Payload.php#L277-L285 |
205,807 | RadialCorp/magento-core | src/lib/Radial/RiskService/Sdk/Payload.php | Radial_RiskService_Sdk_Payload._serializeNode | protected function _serializeNode($nodeName, $value)
{
return sprintf('<%s>%s</%1$s>', $nodeName, $this->xmlEncode($this->_helper->escapeHtml($value)));
} | php | protected function _serializeNode($nodeName, $value)
{
return sprintf('<%s>%s</%1$s>', $nodeName, $this->xmlEncode($this->_helper->escapeHtml($value)));
} | [
"protected",
"function",
"_serializeNode",
"(",
"$",
"nodeName",
",",
"$",
"value",
")",
"{",
"return",
"sprintf",
"(",
"'<%s>%s</%1$s>'",
",",
"$",
"nodeName",
",",
"$",
"this",
"->",
"xmlEncode",
"(",
"$",
"this",
"->",
"_helper",
"->",
"escapeHtml",
"("... | Serialize the value as an xml element with the given node name.
@param string
@param mixed
@return string | [
"Serialize",
"the",
"value",
"as",
"an",
"xml",
"element",
"with",
"the",
"given",
"node",
"name",
"."
] | 9bb5f218d9caf79eab8598f4f8447037a0cc6355 | https://github.com/RadialCorp/magento-core/blob/9bb5f218d9caf79eab8598f4f8447037a0cc6355/src/lib/Radial/RiskService/Sdk/Payload.php#L318-L321 |
205,808 | RadialCorp/magento-core | src/lib/Radial/RiskService/Sdk/Payload.php | Radial_RiskService_Sdk_Payload._serializeBooleanNode | protected function _serializeBooleanNode($nodeName, $value)
{
if(!$this->_helper->convertStringToBoolean($value))
{
return sprintf('<%s>0</%1$s>', $nodeName);
} else {
return sprintf('<%s>%s</%1$s>', $nodeName, $this->_helper->convertStringToBoolean($value));
}
} | php | protected function _serializeBooleanNode($nodeName, $value)
{
if(!$this->_helper->convertStringToBoolean($value))
{
return sprintf('<%s>0</%1$s>', $nodeName);
} else {
return sprintf('<%s>%s</%1$s>', $nodeName, $this->_helper->convertStringToBoolean($value));
}
} | [
"protected",
"function",
"_serializeBooleanNode",
"(",
"$",
"nodeName",
",",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_helper",
"->",
"convertStringToBoolean",
"(",
"$",
"value",
")",
")",
"{",
"return",
"sprintf",
"(",
"'<%s>0</%1$s>'",
... | Serialize the boolean value as an xml element with the given node name.
@param string
@param mixed
@return string | [
"Serialize",
"the",
"boolean",
"value",
"as",
"an",
"xml",
"element",
"with",
"the",
"given",
"node",
"name",
"."
] | 9bb5f218d9caf79eab8598f4f8447037a0cc6355 | https://github.com/RadialCorp/magento-core/blob/9bb5f218d9caf79eab8598f4f8447037a0cc6355/src/lib/Radial/RiskService/Sdk/Payload.php#L330-L338 |
205,809 | RadialCorp/magento-core | src/lib/Radial/RiskService/Sdk/Payload.php | Radial_RiskService_Sdk_Payload._serializeOptionalValue | protected function _serializeOptionalValue($nodeName, $value)
{
return (!is_null($value) && $value !== '') ? $this->_serializeNode($nodeName, $value) : '';
} | php | protected function _serializeOptionalValue($nodeName, $value)
{
return (!is_null($value) && $value !== '') ? $this->_serializeNode($nodeName, $value) : '';
} | [
"protected",
"function",
"_serializeOptionalValue",
"(",
"$",
"nodeName",
",",
"$",
"value",
")",
"{",
"return",
"(",
"!",
"is_null",
"(",
"$",
"value",
")",
"&&",
"$",
"value",
"!==",
"''",
")",
"?",
"$",
"this",
"->",
"_serializeNode",
"(",
"$",
"nod... | Serialize the value as an xml element with the given node name. When
given an empty value, returns an empty string instead of an empty
element.
@param string
@param mixed
@return string | [
"Serialize",
"the",
"value",
"as",
"an",
"xml",
"element",
"with",
"the",
"given",
"node",
"name",
".",
"When",
"given",
"an",
"empty",
"value",
"returns",
"an",
"empty",
"string",
"instead",
"of",
"an",
"empty",
"element",
"."
] | 9bb5f218d9caf79eab8598f4f8447037a0cc6355 | https://github.com/RadialCorp/magento-core/blob/9bb5f218d9caf79eab8598f4f8447037a0cc6355/src/lib/Radial/RiskService/Sdk/Payload.php#L359-L362 |
205,810 | RadialCorp/magento-core | src/lib/Radial/RiskService/Sdk/Payload.php | Radial_RiskService_Sdk_Payload._serializeOptionalAmount | protected function _serializeOptionalAmount($nodeName, $amount, $currencyCode=null)
{
if( $currencyCode)
{
return (!is_null($amount) && !is_nan($amount)) ? "<$nodeName currencyCode=\"$currencyCode\">{$this->_helper->formatAmount($amount)}</$nodeName>" : '';
} else {
return (!is_null($amount) && !is_nan($am... | php | protected function _serializeOptionalAmount($nodeName, $amount, $currencyCode=null)
{
if( $currencyCode)
{
return (!is_null($amount) && !is_nan($amount)) ? "<$nodeName currencyCode=\"$currencyCode\">{$this->_helper->formatAmount($amount)}</$nodeName>" : '';
} else {
return (!is_null($amount) && !is_nan($am... | [
"protected",
"function",
"_serializeOptionalAmount",
"(",
"$",
"nodeName",
",",
"$",
"amount",
",",
"$",
"currencyCode",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"currencyCode",
")",
"{",
"return",
"(",
"!",
"is_null",
"(",
"$",
"amount",
")",
"&&",
"!",
... | Serialize the currency amount as an XML node with the provided name.
When the amount is not set, returns an empty string.
@param string
@param float
@param string
@return string | [
"Serialize",
"the",
"currency",
"amount",
"as",
"an",
"XML",
"node",
"with",
"the",
"provided",
"name",
".",
"When",
"the",
"amount",
"is",
"not",
"set",
"returns",
"an",
"empty",
"string",
"."
] | 9bb5f218d9caf79eab8598f4f8447037a0cc6355 | https://github.com/RadialCorp/magento-core/blob/9bb5f218d9caf79eab8598f4f8447037a0cc6355/src/lib/Radial/RiskService/Sdk/Payload.php#L373-L381 |
205,811 | iron-bound-designs/wp-notifications | src/Queue/Storage/Options.php | Options.store_notifications | public function store_notifications( $queue_id, array $notifications, Strategy $strategy = null ) {
$all = get_option( $this->bucket, array() );
$found = empty( $all ) ? false : true;
if ( empty( $notifications ) ) {
return $this->clear_notifications( $queue_id );
}
$all[ $queue_id ] = array(
'notif... | php | public function store_notifications( $queue_id, array $notifications, Strategy $strategy = null ) {
$all = get_option( $this->bucket, array() );
$found = empty( $all ) ? false : true;
if ( empty( $notifications ) ) {
return $this->clear_notifications( $queue_id );
}
$all[ $queue_id ] = array(
'notif... | [
"public",
"function",
"store_notifications",
"(",
"$",
"queue_id",
",",
"array",
"$",
"notifications",
",",
"Strategy",
"$",
"strategy",
"=",
"null",
")",
"{",
"$",
"all",
"=",
"get_option",
"(",
"$",
"this",
"->",
"bucket",
",",
"array",
"(",
")",
")",
... | Store a set of notifications.
If notifications is empty, it will clear the set.
@since 1.0
@param string $queue_id
@param Notification[] $notifications
@param Strategy $strategy If null, previously set strategy will be used.
@return bool | [
"Store",
"a",
"set",
"of",
"notifications",
"."
] | 4fdf67d28d194576d35f86245b2f539c4815cde2 | https://github.com/iron-bound-designs/wp-notifications/blob/4fdf67d28d194576d35f86245b2f539c4815cde2/src/Queue/Storage/Options.php#L49-L72 |
205,812 | iron-bound-designs/wp-notifications | src/Queue/Storage/Options.php | Options.get_notifications | public function get_notifications( $queue_id ) {
$all = get_option( $this->bucket, array() );
if ( isset( $all[ $queue_id ]['notifications'] ) ) {
return $all[ $queue_id ]['notifications'];
} else {
return null;
}
} | php | public function get_notifications( $queue_id ) {
$all = get_option( $this->bucket, array() );
if ( isset( $all[ $queue_id ]['notifications'] ) ) {
return $all[ $queue_id ]['notifications'];
} else {
return null;
}
} | [
"public",
"function",
"get_notifications",
"(",
"$",
"queue_id",
")",
"{",
"$",
"all",
"=",
"get_option",
"(",
"$",
"this",
"->",
"bucket",
",",
"array",
"(",
")",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"all",
"[",
"$",
"queue_id",
"]",
"[",
"'not... | Get a set of notifications.
@since 1.0
@param string $queue_id
@return Notification[]|null | [
"Get",
"a",
"set",
"of",
"notifications",
"."
] | 4fdf67d28d194576d35f86245b2f539c4815cde2 | https://github.com/iron-bound-designs/wp-notifications/blob/4fdf67d28d194576d35f86245b2f539c4815cde2/src/Queue/Storage/Options.php#L83-L92 |
205,813 | iron-bound-designs/wp-notifications | src/Queue/Storage/Options.php | Options.get_notifications_strategy | public function get_notifications_strategy( $queue_id ) {
$all = get_option( $this->bucket, array() );
if ( isset( $all[ $queue_id ]['strategy'] ) ) {
return $all[ $queue_id ]['strategy'];
} else {
return null;
}
} | php | public function get_notifications_strategy( $queue_id ) {
$all = get_option( $this->bucket, array() );
if ( isset( $all[ $queue_id ]['strategy'] ) ) {
return $all[ $queue_id ]['strategy'];
} else {
return null;
}
} | [
"public",
"function",
"get_notifications_strategy",
"(",
"$",
"queue_id",
")",
"{",
"$",
"all",
"=",
"get_option",
"(",
"$",
"this",
"->",
"bucket",
",",
"array",
"(",
")",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"all",
"[",
"$",
"queue_id",
"]",
"["... | Get the strategy for a set of notifications.
@since 1.0
@param string $queue_id
@return Strategy|null | [
"Get",
"the",
"strategy",
"for",
"a",
"set",
"of",
"notifications",
"."
] | 4fdf67d28d194576d35f86245b2f539c4815cde2 | https://github.com/iron-bound-designs/wp-notifications/blob/4fdf67d28d194576d35f86245b2f539c4815cde2/src/Queue/Storage/Options.php#L103-L112 |
205,814 | iron-bound-designs/wp-notifications | src/Queue/Storage/Options.php | Options.clear_notifications | public function clear_notifications( $queue_id ) {
$all = get_option( $this->bucket, array() );
if ( ! isset( $all[ $queue_id ] ) ) {
return false;
}
unset( $all[ $queue_id ] );
if ( empty( $all ) ) {
delete_option( $this->bucket );
} else {
update_option( $this->bucket, $all );
}
return t... | php | public function clear_notifications( $queue_id ) {
$all = get_option( $this->bucket, array() );
if ( ! isset( $all[ $queue_id ] ) ) {
return false;
}
unset( $all[ $queue_id ] );
if ( empty( $all ) ) {
delete_option( $this->bucket );
} else {
update_option( $this->bucket, $all );
}
return t... | [
"public",
"function",
"clear_notifications",
"(",
"$",
"queue_id",
")",
"{",
"$",
"all",
"=",
"get_option",
"(",
"$",
"this",
"->",
"bucket",
",",
"array",
"(",
")",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"all",
"[",
"$",
"queue_id",
"]",
")"... | Clear a set of notifications.
@since 1.0
@param string $queue_id
@return bool | [
"Clear",
"a",
"set",
"of",
"notifications",
"."
] | 4fdf67d28d194576d35f86245b2f539c4815cde2 | https://github.com/iron-bound-designs/wp-notifications/blob/4fdf67d28d194576d35f86245b2f539c4815cde2/src/Queue/Storage/Options.php#L123-L140 |
205,815 | iron-bound-designs/wp-notifications | src/Queue/Storage/Options.php | Options.clear_notification | public function clear_notification( $queue_id, Notification $notification ) {
$notifications = $this->get_notifications( $queue_id );
$notification = array_search( $notification, $notifications );
if ( false === $notification ) {
return false;
}
unset( $notifications[ $notification ] );
return $this... | php | public function clear_notification( $queue_id, Notification $notification ) {
$notifications = $this->get_notifications( $queue_id );
$notification = array_search( $notification, $notifications );
if ( false === $notification ) {
return false;
}
unset( $notifications[ $notification ] );
return $this... | [
"public",
"function",
"clear_notification",
"(",
"$",
"queue_id",
",",
"Notification",
"$",
"notification",
")",
"{",
"$",
"notifications",
"=",
"$",
"this",
"->",
"get_notifications",
"(",
"$",
"queue_id",
")",
";",
"$",
"notification",
"=",
"array_search",
"... | Clear a single notification from storage.
@since 1.0
@param string $queue_id
@param Notification $notification
@return bool | [
"Clear",
"a",
"single",
"notification",
"from",
"storage",
"."
] | 4fdf67d28d194576d35f86245b2f539c4815cde2 | https://github.com/iron-bound-designs/wp-notifications/blob/4fdf67d28d194576d35f86245b2f539c4815cde2/src/Queue/Storage/Options.php#L152-L165 |
205,816 | mlocati/concrete5-translation-library | src/Gettext.php | Gettext.commandIsAvailable | public static function commandIsAvailable($command)
{
static $cache = array();
if (!isset($cache[$command])) {
$cache[$command] = false;
$safeMode = @ini_get('safe_mode');
if (empty($safeMode)) {
if (function_exists('exec')) {
i... | php | public static function commandIsAvailable($command)
{
static $cache = array();
if (!isset($cache[$command])) {
$cache[$command] = false;
$safeMode = @ini_get('safe_mode');
if (empty($safeMode)) {
if (function_exists('exec')) {
i... | [
"public",
"static",
"function",
"commandIsAvailable",
"(",
"$",
"command",
")",
"{",
"static",
"$",
"cache",
"=",
"array",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"cache",
"[",
"$",
"command",
"]",
")",
")",
"{",
"$",
"cache",
"[",
"$",
... | Checks if a gettext command is available.
@param string $command One of the gettext commands
@return bool | [
"Checks",
"if",
"a",
"gettext",
"command",
"is",
"available",
"."
] | 26f806c8c1ecb6ce63115a4058ab396303622e00 | https://github.com/mlocati/concrete5-translation-library/blob/26f806c8c1ecb6ce63115a4058ab396303622e00/src/Gettext.php#L17-L38 |
205,817 | pilipinews/common | src/Scraper.php | Scraper.html | protected function html(Crawler $crawler, $removables = array())
{
$converter = new Converter;
$html = trim($converter->convert($crawler->html()));
foreach ((array) $removables as $keyword)
{
$html = str_replace($keyword, '', $html);
}
$html = str_repla... | php | protected function html(Crawler $crawler, $removables = array())
{
$converter = new Converter;
$html = trim($converter->convert($crawler->html()));
foreach ((array) $removables as $keyword)
{
$html = str_replace($keyword, '', $html);
}
$html = str_repla... | [
"protected",
"function",
"html",
"(",
"Crawler",
"$",
"crawler",
",",
"$",
"removables",
"=",
"array",
"(",
")",
")",
"{",
"$",
"converter",
"=",
"new",
"Converter",
";",
"$",
"html",
"=",
"trim",
"(",
"$",
"converter",
"->",
"convert",
"(",
"$",
"cr... | Returns the HTML format of the body from the crawler.
@param \Pilipinews\Common\Crawler $crawler
@param string[] $removables
@return string | [
"Returns",
"the",
"HTML",
"format",
"of",
"the",
"body",
"from",
"the",
"crawler",
"."
] | a39f16e935b3b8e97b54b6e9348a1deab2d0a2a0 | https://github.com/pilipinews/common/blob/a39f16e935b3b8e97b54b6e9348a1deab2d0a2a0/src/Scraper.php#L40-L54 |
205,818 | pilipinews/common | src/Scraper.php | Scraper.prepare | protected function prepare($link)
{
$response = Client::request((string) $link);
$response = str_replace('<strong> </strong>', ' ', $response);
$this->crawler = new Crawler($response);
} | php | protected function prepare($link)
{
$response = Client::request((string) $link);
$response = str_replace('<strong> </strong>', ' ', $response);
$this->crawler = new Crawler($response);
} | [
"protected",
"function",
"prepare",
"(",
"$",
"link",
")",
"{",
"$",
"response",
"=",
"Client",
"::",
"request",
"(",
"(",
"string",
")",
"$",
"link",
")",
";",
"$",
"response",
"=",
"str_replace",
"(",
"'<strong> </strong>'",
",",
"' '",
",",
"$",
"re... | Initializes the crawler instance.
@param string $link
@return void | [
"Initializes",
"the",
"crawler",
"instance",
"."
] | a39f16e935b3b8e97b54b6e9348a1deab2d0a2a0 | https://github.com/pilipinews/common/blob/a39f16e935b3b8e97b54b6e9348a1deab2d0a2a0/src/Scraper.php#L62-L69 |
205,819 | pilipinews/common | src/Scraper.php | Scraper.remove | protected function remove($elements)
{
$callback = function ($crawler)
{
$node = $crawler->getNode((integer) 0);
$node->parentNode->removeChild($node);
};
foreach ((array) $elements as $removable)
{
$this->crawler->filter($removable)->eac... | php | protected function remove($elements)
{
$callback = function ($crawler)
{
$node = $crawler->getNode((integer) 0);
$node->parentNode->removeChild($node);
};
foreach ((array) $elements as $removable)
{
$this->crawler->filter($removable)->eac... | [
"protected",
"function",
"remove",
"(",
"$",
"elements",
")",
"{",
"$",
"callback",
"=",
"function",
"(",
"$",
"crawler",
")",
"{",
"$",
"node",
"=",
"$",
"crawler",
"->",
"getNode",
"(",
"(",
"integer",
")",
"0",
")",
";",
"$",
"node",
"->",
"pare... | Removes specified HTML tags from body.
@param string[] $elements
@return void | [
"Removes",
"specified",
"HTML",
"tags",
"from",
"body",
"."
] | a39f16e935b3b8e97b54b6e9348a1deab2d0a2a0 | https://github.com/pilipinews/common/blob/a39f16e935b3b8e97b54b6e9348a1deab2d0a2a0/src/Scraper.php#L77-L90 |
205,820 | pilipinews/common | src/Scraper.php | Scraper.replace | protected function replace(Crawler $crawler, $element, $callback)
{
$function = function (Crawler $crawler) use ($callback)
{
$node = $crawler->getNode(0);
$html = $node->ownerDocument->saveHtml($node);
$text = $callback($crawler, (string) $html);
r... | php | protected function replace(Crawler $crawler, $element, $callback)
{
$function = function (Crawler $crawler) use ($callback)
{
$node = $crawler->getNode(0);
$html = $node->ownerDocument->saveHtml($node);
$text = $callback($crawler, (string) $html);
r... | [
"protected",
"function",
"replace",
"(",
"Crawler",
"$",
"crawler",
",",
"$",
"element",
",",
"$",
"callback",
")",
"{",
"$",
"function",
"=",
"function",
"(",
"Crawler",
"$",
"crawler",
")",
"use",
"(",
"$",
"callback",
")",
"{",
"$",
"node",
"=",
"... | Replaces a specified HTML tag based from the given callback.
@param \Pilipinews\Common\Crawler $crawler
@param string $element
@param callable $callback
@return \Pilipinews\Common\Crawler | [
"Replaces",
"a",
"specified",
"HTML",
"tag",
"based",
"from",
"the",
"given",
"callback",
"."
] | a39f16e935b3b8e97b54b6e9348a1deab2d0a2a0 | https://github.com/pilipinews/common/blob/a39f16e935b3b8e97b54b6e9348a1deab2d0a2a0/src/Scraper.php#L100-L123 |
205,821 | pilipinews/common | src/Scraper.php | Scraper.title | protected function title($element, $removable = '')
{
$converter = new Converter;
$crawler = $this->crawler->filter($element);
$html = $crawler->first()->html();
$html = str_replace($removable, '', $html);
return $converter->convert((string) $html);
} | php | protected function title($element, $removable = '')
{
$converter = new Converter;
$crawler = $this->crawler->filter($element);
$html = $crawler->first()->html();
$html = str_replace($removable, '', $html);
return $converter->convert((string) $html);
} | [
"protected",
"function",
"title",
"(",
"$",
"element",
",",
"$",
"removable",
"=",
"''",
")",
"{",
"$",
"converter",
"=",
"new",
"Converter",
";",
"$",
"crawler",
"=",
"$",
"this",
"->",
"crawler",
"->",
"filter",
"(",
"$",
"element",
")",
";",
"$",
... | Returns the title text based from given HTML tag.
@param string $element
@param string $removable
@return string | [
"Returns",
"the",
"title",
"text",
"based",
"from",
"given",
"HTML",
"tag",
"."
] | a39f16e935b3b8e97b54b6e9348a1deab2d0a2a0 | https://github.com/pilipinews/common/blob/a39f16e935b3b8e97b54b6e9348a1deab2d0a2a0/src/Scraper.php#L132-L143 |
205,822 | digipolisgent/robo-digipolis-deploy | src/Ssh.php | Ssh.remoteDirectory | public function remoteDirectory($directory, $physical = false)
{
$this->remoteDir = $directory;
$this->physicalRemoteDir = $physical;
return $this;
} | php | public function remoteDirectory($directory, $physical = false)
{
$this->remoteDir = $directory;
$this->physicalRemoteDir = $physical;
return $this;
} | [
"public",
"function",
"remoteDirectory",
"(",
"$",
"directory",
",",
"$",
"physical",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"remoteDir",
"=",
"$",
"directory",
";",
"$",
"this",
"->",
"physicalRemoteDir",
"=",
"$",
"physical",
";",
"return",
"$",
"t... | Sets the remote directory.
@param string $directory
The remote directory.
@param bool $physical
Use the physical directory structure without following symbolic links
(-P argument for cd).
@return $this | [
"Sets",
"the",
"remote",
"directory",
"."
] | fafa8967d98ed4d3f2265b17f4b1abe53bf0b5ab | https://github.com/digipolisgent/robo-digipolis-deploy/blob/fafa8967d98ed4d3f2265b17f4b1abe53bf0b5ab/src/Ssh.php#L165-L171 |
205,823 | digipolisgent/robo-digipolis-deploy | src/Ssh.php | Ssh.commandCallback | protected function commandCallback($callback)
{
return (
function ($output) use ($callback) {
$this->output .= $output;
if (is_callable($callback)) {
return call_user_func($callback, $output);
}
}
);
} | php | protected function commandCallback($callback)
{
return (
function ($output) use ($callback) {
$this->output .= $output;
if (is_callable($callback)) {
return call_user_func($callback, $output);
}
}
);
} | [
"protected",
"function",
"commandCallback",
"(",
"$",
"callback",
")",
"{",
"return",
"(",
"function",
"(",
"$",
"output",
")",
"use",
"(",
"$",
"callback",
")",
"{",
"$",
"this",
"->",
"output",
".=",
"$",
"output",
";",
"if",
"(",
"is_callable",
"(",... | Wrap the callback so we can print the output.
@param callable $callback
The callback to wrap. | [
"Wrap",
"the",
"callback",
"so",
"we",
"can",
"print",
"the",
"output",
"."
] | fafa8967d98ed4d3f2265b17f4b1abe53bf0b5ab | https://github.com/digipolisgent/robo-digipolis-deploy/blob/fafa8967d98ed4d3f2265b17f4b1abe53bf0b5ab/src/Ssh.php#L306-L316 |
205,824 | thelia-modules/SmartyFilter | Handler/ConfigurationFileHandler.php | ConfigurationFileHandler.parseXml | protected function parseXml(SplFileInfo $file)
{
$dom = XmlUtils::loadFile($file, realpath(dirname(__DIR__) . DS . 'Schema' . DS . 'smarty_filter.xsd'));
/** @var \Symfony\Component\DependencyInjection\SimpleXMLElement $xml */
$xml = simplexml_import_dom($dom, '\\Symfony\\Component\\Dependen... | php | protected function parseXml(SplFileInfo $file)
{
$dom = XmlUtils::loadFile($file, realpath(dirname(__DIR__) . DS . 'Schema' . DS . 'smarty_filter.xsd'));
/** @var \Symfony\Component\DependencyInjection\SimpleXMLElement $xml */
$xml = simplexml_import_dom($dom, '\\Symfony\\Component\\Dependen... | [
"protected",
"function",
"parseXml",
"(",
"SplFileInfo",
"$",
"file",
")",
"{",
"$",
"dom",
"=",
"XmlUtils",
"::",
"loadFile",
"(",
"$",
"file",
",",
"realpath",
"(",
"dirname",
"(",
"__DIR__",
")",
".",
"DS",
".",
"'Schema'",
".",
"DS",
".",
"'smarty_... | Get config from xml file
@param SplFileInfo $file XML file
@return array Smarty Filter module configuration | [
"Get",
"config",
"from",
"xml",
"file"
] | e510d281f51ddc4344e563d0f6aaa192fa7171e9 | https://github.com/thelia-modules/SmartyFilter/blob/e510d281f51ddc4344e563d0f6aaa192fa7171e9/Handler/ConfigurationFileHandler.php#L68-L96 |
205,825 | thelia-modules/SmartyFilter | Handler/ConfigurationFileHandler.php | ConfigurationFileHandler.applyConfig | protected function applyConfig(array $moduleConfiguration)
{
foreach ($moduleConfiguration['smarty_filter'] as $smartyFilterData) {
if (SmartyFilterQuery::create()->findOneByCode($smartyFilterData['code']) === null) {
$smartyFilter = (new SmartyFilter())
->set... | php | protected function applyConfig(array $moduleConfiguration)
{
foreach ($moduleConfiguration['smarty_filter'] as $smartyFilterData) {
if (SmartyFilterQuery::create()->findOneByCode($smartyFilterData['code']) === null) {
$smartyFilter = (new SmartyFilter())
->set... | [
"protected",
"function",
"applyConfig",
"(",
"array",
"$",
"moduleConfiguration",
")",
"{",
"foreach",
"(",
"$",
"moduleConfiguration",
"[",
"'smarty_filter'",
"]",
"as",
"$",
"smartyFilterData",
")",
"{",
"if",
"(",
"SmartyFilterQuery",
"::",
"create",
"(",
")"... | Save new smarty filter to database
@param array $moduleConfiguration Smarty Filter module configuration | [
"Save",
"new",
"smarty",
"filter",
"to",
"database"
] | e510d281f51ddc4344e563d0f6aaa192fa7171e9 | https://github.com/thelia-modules/SmartyFilter/blob/e510d281f51ddc4344e563d0f6aaa192fa7171e9/Handler/ConfigurationFileHandler.php#L117-L135 |
205,826 | antaresproject/search | src/Response/QueryResponse.php | QueryResponse.isValid | protected function isValid()
{
if (!$this->request->ajax()) {
return false;
}
$search = $this->request->input('search');
if (!is_string($search) or strlen($this->request->input('search')) <= 0) {
return false;
}
$token = $this->request->header(... | php | protected function isValid()
{
if (!$this->request->ajax()) {
return false;
}
$search = $this->request->input('search');
if (!is_string($search) or strlen($this->request->input('search')) <= 0) {
return false;
}
$token = $this->request->header(... | [
"protected",
"function",
"isValid",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"request",
"->",
"ajax",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"search",
"=",
"$",
"this",
"->",
"request",
"->",
"input",
"(",
"'search'",
")",
... | validates submitted data from search form
@return boolean | [
"validates",
"submitted",
"data",
"from",
"search",
"form"
] | 3bcb994e69c03792d20dfa688a3281f80cd8dde8 | https://github.com/antaresproject/search/blob/3bcb994e69c03792d20dfa688a3281f80cd8dde8/src/Response/QueryResponse.php#L54-L68 |
205,827 | antaresproject/search | src/Response/QueryResponse.php | QueryResponse.validateToken | private function validateToken($token = null)
{
if (is_null($token)) {
return false;
}
$decrypted = Crypt::decrypt($token);
$args = unserialize($decrypted);
if (!isset($args['protection_string']) or $args['protection_string'] !== config('antares/search::prot... | php | private function validateToken($token = null)
{
if (is_null($token)) {
return false;
}
$decrypted = Crypt::decrypt($token);
$args = unserialize($decrypted);
if (!isset($args['protection_string']) or $args['protection_string'] !== config('antares/search::prot... | [
"private",
"function",
"validateToken",
"(",
"$",
"token",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"token",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"decrypted",
"=",
"Crypt",
"::",
"decrypt",
"(",
"$",
"token",
")",
";",
"$"... | validates protection token
@param String $token
@return boolean | [
"validates",
"protection",
"token"
] | 3bcb994e69c03792d20dfa688a3281f80cd8dde8 | https://github.com/antaresproject/search/blob/3bcb994e69c03792d20dfa688a3281f80cd8dde8/src/Response/QueryResponse.php#L76-L91 |
205,828 | antaresproject/search | src/Response/QueryResponse.php | QueryResponse.boot | public function boot()
{
if (!$this->isValid()) {
return false;
}
$serviceProvider = new \Antares\Customfields\CustomFieldsServiceProvider(app());
$serviceProvider->register();
$serviceProvider->boot();
$query = e($this->request->input('search'))... | php | public function boot()
{
if (!$this->isValid()) {
return false;
}
$serviceProvider = new \Antares\Customfields\CustomFieldsServiceProvider(app());
$serviceProvider->register();
$serviceProvider->boot();
$query = e($this->request->input('search'))... | [
"public",
"function",
"boot",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isValid",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"serviceProvider",
"=",
"new",
"\\",
"Antares",
"\\",
"Customfields",
"\\",
"CustomFieldsServiceProvider",
"(... | Boots search query in lucene indexes
@return boolean | [
"Boots",
"search",
"query",
"in",
"lucene",
"indexes"
] | 3bcb994e69c03792d20dfa688a3281f80cd8dde8 | https://github.com/antaresproject/search/blob/3bcb994e69c03792d20dfa688a3281f80cd8dde8/src/Response/QueryResponse.php#L98-L136 |
205,829 | antaresproject/search | src/Response/QueryResponse.php | QueryResponse.getDatatableInstance | protected function getDatatableInstance($classname)
{
if (!class_exists($classname)) {
return false;
}
$datatable = app($classname);
$reflection = new ReflectionClass($datatable);
if (($filename = $reflection->getFileName()) && !str_contains($filename, 'core'))... | php | protected function getDatatableInstance($classname)
{
if (!class_exists($classname)) {
return false;
}
$datatable = app($classname);
$reflection = new ReflectionClass($datatable);
if (($filename = $reflection->getFileName()) && !str_contains($filename, 'core'))... | [
"protected",
"function",
"getDatatableInstance",
"(",
"$",
"classname",
")",
"{",
"if",
"(",
"!",
"class_exists",
"(",
"$",
"classname",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"datatable",
"=",
"app",
"(",
"$",
"classname",
")",
";",
"$",
"re... | Gets instance of datatable
@param String $classname
@return boolean | [
"Gets",
"instance",
"of",
"datatable"
] | 3bcb994e69c03792d20dfa688a3281f80cd8dde8 | https://github.com/antaresproject/search/blob/3bcb994e69c03792d20dfa688a3281f80cd8dde8/src/Response/QueryResponse.php#L144-L157 |
205,830 | RadialCorp/magento-core | src/app/code/community/Radial/Order/Model/Eav/Entity/Increment/Order.php | Radial_Order_Model_Eav_Entity_Increment_Order._getStoreId | protected function _getStoreId()
{
$storeEnv = Mage::app()->getStore();
if ($storeEnv->isAdmin()) {
/** @var Mage_Adminhtml_Model_Session_Quote */
$quoteSession = $this->_orderHelper->getAdminQuoteSessionModel();
// when in the admin, the store id the order is act... | php | protected function _getStoreId()
{
$storeEnv = Mage::app()->getStore();
if ($storeEnv->isAdmin()) {
/** @var Mage_Adminhtml_Model_Session_Quote */
$quoteSession = $this->_orderHelper->getAdminQuoteSessionModel();
// when in the admin, the store id the order is act... | [
"protected",
"function",
"_getStoreId",
"(",
")",
"{",
"$",
"storeEnv",
"=",
"Mage",
"::",
"app",
"(",
")",
"->",
"getStore",
"(",
")",
";",
"if",
"(",
"$",
"storeEnv",
"->",
"isAdmin",
"(",
")",
")",
"{",
"/** @var Mage_Adminhtml_Model_Session_Quote */",
... | Get the store id for the order. In non-admin stores, can use the current
store. In admin stores, must get the order the quote is actually
being created in.
@return int | [
"Get",
"the",
"store",
"id",
"for",
"the",
"order",
".",
"In",
"non",
"-",
"admin",
"stores",
"can",
"use",
"the",
"current",
"store",
".",
"In",
"admin",
"stores",
"must",
"get",
"the",
"order",
"the",
"quote",
"is",
"actually",
"being",
"created",
"i... | 9bb5f218d9caf79eab8598f4f8447037a0cc6355 | https://github.com/RadialCorp/magento-core/blob/9bb5f218d9caf79eab8598f4f8447037a0cc6355/src/app/code/community/Radial/Order/Model/Eav/Entity/Increment/Order.php#L82-L94 |
205,831 | RadialCorp/magento-core | src/app/code/community/Radial/Order/Model/Eav/Entity/Increment/Order.php | Radial_Order_Model_Eav_Entity_Increment_Order.getNextId | public function getNextId()
{
// remove any order prefixes from the last increment id
$last = $this->_orderHelper->removeOrderIncrementPrefix($this->getLastId());
// Using bcmath to avoid float/integer overflow.
return $this->format(bcadd($last, 1));
} | php | public function getNextId()
{
// remove any order prefixes from the last increment id
$last = $this->_orderHelper->removeOrderIncrementPrefix($this->getLastId());
// Using bcmath to avoid float/integer overflow.
return $this->format(bcadd($last, 1));
} | [
"public",
"function",
"getNextId",
"(",
")",
"{",
"// remove any order prefixes from the last increment id",
"$",
"last",
"=",
"$",
"this",
"->",
"_orderHelper",
"->",
"removeOrderIncrementPrefix",
"(",
"$",
"this",
"->",
"getLastId",
"(",
")",
")",
";",
"// Using b... | Get the next increment id by incrementing the last id
@return string | [
"Get",
"the",
"next",
"increment",
"id",
"by",
"incrementing",
"the",
"last",
"id"
] | 9bb5f218d9caf79eab8598f4f8447037a0cc6355 | https://github.com/RadialCorp/magento-core/blob/9bb5f218d9caf79eab8598f4f8447037a0cc6355/src/app/code/community/Radial/Order/Model/Eav/Entity/Increment/Order.php#L99-L105 |
205,832 | sellerlabs/injected | src/SellerLabs/Injected/InjectedTrait.php | InjectedTrait.getDependencyMapping | protected function getDependencyMapping()
{
$constructor = (new ReflectionClass($this->className))
->getConstructor();
$dependencies = [];
if (!is_null($constructor)) {
foreach ($constructor->getParameters() as $param) {
$dependencies[$param->getClas... | php | protected function getDependencyMapping()
{
$constructor = (new ReflectionClass($this->className))
->getConstructor();
$dependencies = [];
if (!is_null($constructor)) {
foreach ($constructor->getParameters() as $param) {
$dependencies[$param->getClas... | [
"protected",
"function",
"getDependencyMapping",
"(",
")",
"{",
"$",
"constructor",
"=",
"(",
"new",
"ReflectionClass",
"(",
"$",
"this",
"->",
"className",
")",
")",
"->",
"getConstructor",
"(",
")",
";",
"$",
"dependencies",
"=",
"[",
"]",
";",
"if",
"... | Get a mapping of class name => member name dependencies.
Important: these must be ordered in the way the class accepts its
dependencies.
@return array
@throws Exception | [
"Get",
"a",
"mapping",
"of",
"class",
"name",
"=",
">",
"member",
"name",
"dependencies",
"."
] | 89f90334ccc392c67c79fb1eba258b34cfa9edd6 | https://github.com/sellerlabs/injected/blob/89f90334ccc392c67c79fb1eba258b34cfa9edd6/src/SellerLabs/Injected/InjectedTrait.php#L32-L46 |
205,833 | sellerlabs/injected | src/SellerLabs/Injected/InjectedTrait.php | InjectedTrait.mockDependencies | protected function mockDependencies()
{
$dependencies = $this->getDependencyMapping();
foreach ($dependencies as $interface => $memberName) {
if (!isset($this->$memberName)) {
$this->$memberName = Mockery::mock($interface);
}
// Update with the a... | php | protected function mockDependencies()
{
$dependencies = $this->getDependencyMapping();
foreach ($dependencies as $interface => $memberName) {
if (!isset($this->$memberName)) {
$this->$memberName = Mockery::mock($interface);
}
// Update with the a... | [
"protected",
"function",
"mockDependencies",
"(",
")",
"{",
"$",
"dependencies",
"=",
"$",
"this",
"->",
"getDependencyMapping",
"(",
")",
";",
"foreach",
"(",
"$",
"dependencies",
"as",
"$",
"interface",
"=>",
"$",
"memberName",
")",
"{",
"if",
"(",
"!",
... | Mock all dependencies that were not set yet
@return array
@throws Exception | [
"Mock",
"all",
"dependencies",
"that",
"were",
"not",
"set",
"yet"
] | 89f90334ccc392c67c79fb1eba258b34cfa9edd6 | https://github.com/sellerlabs/injected/blob/89f90334ccc392c67c79fb1eba258b34cfa9edd6/src/SellerLabs/Injected/InjectedTrait.php#L77-L91 |
205,834 | hal-platform/hal-core | src/VersionControl/GitHub/GitHubDownloader.php | GitHubDownloader.download | public function download(Application $application, string $commit, string $targetFile): bool
{
$username = $application->parameter('gh.owner');
$repository = $application->parameter('gh.repo');
if (!$username || !$repository) {
throw new VCSException(self::ERR_APP_MISCONFIGURED)... | php | public function download(Application $application, string $commit, string $targetFile): bool
{
$username = $application->parameter('gh.owner');
$repository = $application->parameter('gh.repo');
if (!$username || !$repository) {
throw new VCSException(self::ERR_APP_MISCONFIGURED)... | [
"public",
"function",
"download",
"(",
"Application",
"$",
"application",
",",
"string",
"$",
"commit",
",",
"string",
"$",
"targetFile",
")",
":",
"bool",
"{",
"$",
"username",
"=",
"$",
"application",
"->",
"parameter",
"(",
"'gh.owner'",
")",
";",
"$",
... | Get content of archives in a repository
@link http://developer.github.com/v3/repos/contents/
@param Application $application
@param string $commit
@param string $targetFile
@throws VCSException
@return bool | [
"Get",
"content",
"of",
"archives",
"in",
"a",
"repository"
] | 30d456f8392fc873301ad4217d2ae90436c67090 | https://github.com/hal-platform/hal-core/blob/30d456f8392fc873301ad4217d2ae90436c67090/src/VersionControl/GitHub/GitHubDownloader.php#L47-L75 |
205,835 | openclerk/users | src/UserOAuth2.php | UserOAuth2.auth | static function auth(ProviderInterface $provider) {
if (!require_get("code", false)) {
redirect($provider->getAuthorizationUrl());
return false;
} else {
// optionally check for abuse etc
if (!\Openclerk\Events::trigger('oauth2_auth', $provider)) {
throw new UserAuthenticationExc... | php | static function auth(ProviderInterface $provider) {
if (!require_get("code", false)) {
redirect($provider->getAuthorizationUrl());
return false;
} else {
// optionally check for abuse etc
if (!\Openclerk\Events::trigger('oauth2_auth', $provider)) {
throw new UserAuthenticationExc... | [
"static",
"function",
"auth",
"(",
"ProviderInterface",
"$",
"provider",
")",
"{",
"if",
"(",
"!",
"require_get",
"(",
"\"code\"",
",",
"false",
")",
")",
"{",
"redirect",
"(",
"$",
"provider",
"->",
"getAuthorizationUrl",
"(",
")",
")",
";",
"return",
"... | Execute OAuth2 authentication and return the user. | [
"Execute",
"OAuth2",
"authentication",
"and",
"return",
"the",
"user",
"."
] | 550c7610c154a2f6655ce65a2df377ccb207bc6d | https://github.com/openclerk/users/blob/550c7610c154a2f6655ce65a2df377ccb207bc6d/src/UserOAuth2.php#L66-L83 |
205,836 | openclerk/users | src/UserOAuth2.php | UserOAuth2.removeIdentity | static function removeIdentity(\Db\Connection $db, User $user, $provider, $uid) {
if (!$user) {
throw new \InvalidArgumentException("No user provided.");
}
$q = $db->prepare("DELETE FROM user_oauth2_identities WHERE user_id=? AND provider=? AND uid=? LIMIT 1");
return $q->execute(array($user->get... | php | static function removeIdentity(\Db\Connection $db, User $user, $provider, $uid) {
if (!$user) {
throw new \InvalidArgumentException("No user provided.");
}
$q = $db->prepare("DELETE FROM user_oauth2_identities WHERE user_id=? AND provider=? AND uid=? LIMIT 1");
return $q->execute(array($user->get... | [
"static",
"function",
"removeIdentity",
"(",
"\\",
"Db",
"\\",
"Connection",
"$",
"db",
",",
"User",
"$",
"user",
",",
"$",
"provider",
",",
"$",
"uid",
")",
"{",
"if",
"(",
"!",
"$",
"user",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
... | Remove the given OAuth2 identity from the given user. | [
"Remove",
"the",
"given",
"OAuth2",
"identity",
"from",
"the",
"given",
"user",
"."
] | 550c7610c154a2f6655ce65a2df377ccb207bc6d | https://github.com/openclerk/users/blob/550c7610c154a2f6655ce65a2df377ccb207bc6d/src/UserOAuth2.php#L178-L186 |
205,837 | PHPColibri/framework | Database/Query.php | Query.select | public static function select(array $columns = ['*'], ...$joinsColumns)
{
$query = new static(Query\Type::SELECT);
$query->columns['t'] = $columns;
$alias = 'j1';
foreach ($joinsColumns as $joinColumns) {
$query->columns[$alias] = (array)$joinColumns;
... | php | public static function select(array $columns = ['*'], ...$joinsColumns)
{
$query = new static(Query\Type::SELECT);
$query->columns['t'] = $columns;
$alias = 'j1';
foreach ($joinsColumns as $joinColumns) {
$query->columns[$alias] = (array)$joinColumns;
... | [
"public",
"static",
"function",
"select",
"(",
"array",
"$",
"columns",
"=",
"[",
"'*'",
"]",
",",
"...",
"$",
"joinsColumns",
")",
"{",
"$",
"query",
"=",
"new",
"static",
"(",
"Query",
"\\",
"Type",
"::",
"SELECT",
")",
";",
"$",
"query",
"->",
"... | Creates instance of select-type Query.
@param array $columns
@param array $joinsColumns
@return static | [
"Creates",
"instance",
"of",
"select",
"-",
"type",
"Query",
"."
] | 7e5b77141da5e5e7c63afc83592671321ac52f36 | https://github.com/PHPColibri/framework/blob/7e5b77141da5e5e7c63afc83592671321ac52f36/Database/Query.php#L68-L80 |
205,838 | schpill/thin | src/Temp.php | Temp.getTmpPath | protected function getTmpPath()
{
$tmpDir = sys_get_temp_dir();
if (!empty($this->prefix)) {
$tmpDir .= DIRECTORY_SEPARATOR . $this->prefix;
}
$tmpDir .= DIRECTORY_SEPARATOR . uniqid('run-', true);
return $tmpDir;
} | php | protected function getTmpPath()
{
$tmpDir = sys_get_temp_dir();
if (!empty($this->prefix)) {
$tmpDir .= DIRECTORY_SEPARATOR . $this->prefix;
}
$tmpDir .= DIRECTORY_SEPARATOR . uniqid('run-', true);
return $tmpDir;
} | [
"protected",
"function",
"getTmpPath",
"(",
")",
"{",
"$",
"tmpDir",
"=",
"sys_get_temp_dir",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"prefix",
")",
")",
"{",
"$",
"tmpDir",
".=",
"DIRECTORY_SEPARATOR",
".",
"$",
"this",
"->",
... | Get path to temp directory
@return string | [
"Get",
"path",
"to",
"temp",
"directory"
] | a9102d9d6f70e8b0f6be93153f70849f46489ee1 | https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Temp.php#L64-L75 |
205,839 | schpill/thin | src/Temp.php | Temp.createTmpFile | public function createTmpFile($suffix = null, $preserve = false)
{
$this->initRunFolder();
$file = uniqid();
if ($suffix) {
$file .= '-' . $suffix;
}
$fileInfo = new \SplFileInfo($this->tmpRunFolder . DIRECTORY_SEPARATOR . $file);
... | php | public function createTmpFile($suffix = null, $preserve = false)
{
$this->initRunFolder();
$file = uniqid();
if ($suffix) {
$file .= '-' . $suffix;
}
$fileInfo = new \SplFileInfo($this->tmpRunFolder . DIRECTORY_SEPARATOR . $file);
... | [
"public",
"function",
"createTmpFile",
"(",
"$",
"suffix",
"=",
"null",
",",
"$",
"preserve",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"initRunFolder",
"(",
")",
";",
"$",
"file",
"=",
"uniqid",
"(",
")",
";",
"if",
"(",
"$",
"suffix",
")",
"{",
... | Create empty file in TMP directory
@param string $suffix filename suffix
@param bool $preserve
@throws \Exception
@return \SplFileInfo | [
"Create",
"empty",
"file",
"in",
"TMP",
"directory"
] | a9102d9d6f70e8b0f6be93153f70849f46489ee1 | https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Temp.php#L95-L116 |
205,840 | schpill/thin | src/Temp.php | Temp.createFile | public function createFile($fileName, $preserve = false)
{
$this->initRunFolder();
$fileInfo = new \SplFileInfo($this->tmpRunFolder . DIRECTORY_SEPARATOR . $fileName);
$this->filesystem->touch($fileInfo);
$this->files[] = array(
'file' => $file... | php | public function createFile($fileName, $preserve = false)
{
$this->initRunFolder();
$fileInfo = new \SplFileInfo($this->tmpRunFolder . DIRECTORY_SEPARATOR . $fileName);
$this->filesystem->touch($fileInfo);
$this->files[] = array(
'file' => $file... | [
"public",
"function",
"createFile",
"(",
"$",
"fileName",
",",
"$",
"preserve",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"initRunFolder",
"(",
")",
";",
"$",
"fileInfo",
"=",
"new",
"\\",
"SplFileInfo",
"(",
"$",
"this",
"->",
"tmpRunFolder",
".",
"D... | Creates named temporary file
@param $fileName
@param bool $preserve
@return \SplFileInfo
@throws \Exception | [
"Creates",
"named",
"temporary",
"file"
] | a9102d9d6f70e8b0f6be93153f70849f46489ee1 | https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Temp.php#L126-L142 |
205,841 | Vyki/mva-dbm | src/Mva/Dbm/Query/QueryProcessor.php | QueryProcessor.processUpdate | public function processUpdate(array $data)
{
$set = $this->formatCmd('set');
$data[$set] = isset($data[$set]) ? $data[$set] : [];
foreach ($data as $index => $value) {
if (substr($index, 0, 1) !== $this->cmd) {
$data[$set][$index] = $value;
unset($data[$index]);
continue;
}
$ckey = subst... | php | public function processUpdate(array $data)
{
$set = $this->formatCmd('set');
$data[$set] = isset($data[$set]) ? $data[$set] : [];
foreach ($data as $index => $value) {
if (substr($index, 0, 1) !== $this->cmd) {
$data[$set][$index] = $value;
unset($data[$index]);
continue;
}
$ckey = subst... | [
"public",
"function",
"processUpdate",
"(",
"array",
"$",
"data",
")",
"{",
"$",
"set",
"=",
"$",
"this",
"->",
"formatCmd",
"(",
"'set'",
")",
";",
"$",
"data",
"[",
"$",
"set",
"]",
"=",
"isset",
"(",
"$",
"data",
"[",
"$",
"set",
"]",
")",
"... | Process update data
@param array ['a' => 1, 'b%s' => 2, '$set' => ['c%i' => '3'], '$unset' => ['d', 'e'], ...]
@return array ['$set' => ['a' => 1, 'b' => '2', 'c' => 3], '$unset' => ['d' => '', 'e' => ''], ...] | [
"Process",
"update",
"data"
] | 587d840e0620331a9f63a6867f3400a293a9d3c6 | https://github.com/Vyki/mva-dbm/blob/587d840e0620331a9f63a6867f3400a293a9d3c6/src/Mva/Dbm/Query/QueryProcessor.php#L98-L128 |
205,842 | Vyki/mva-dbm | src/Mva/Dbm/Query/QueryProcessor.php | QueryProcessor.processCondition | public function processCondition(array $conditions, $depth = 0)
{
if (empty($conditions)) {
return [];
}
$parsed = [];
foreach ($conditions as $key => $condition) {
if (is_int($key)) {
if ($depth > 0 && is_array($condition)) {
throw new InvalidArgumentException('Too deep sets of condition!');
... | php | public function processCondition(array $conditions, $depth = 0)
{
if (empty($conditions)) {
return [];
}
$parsed = [];
foreach ($conditions as $key => $condition) {
if (is_int($key)) {
if ($depth > 0 && is_array($condition)) {
throw new InvalidArgumentException('Too deep sets of condition!');
... | [
"public",
"function",
"processCondition",
"(",
"array",
"$",
"conditions",
",",
"$",
"depth",
"=",
"0",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"conditions",
")",
")",
"{",
"return",
"[",
"]",
";",
"}",
"$",
"parsed",
"=",
"[",
"]",
";",
"foreach",... | Process sets of conditions and merges them by AND operator
@param array in format [['a' => 1], ['b IN' => [1, 2]], [...]] or ['a' => 1, 'b IN' => [1, 2], ...]
@param array single condition ['a' => 1] or multiple condition ['$and' => ['a' => 1, 'b' => ['$in' => [1, 2]]], ...] | [
"Process",
"sets",
"of",
"conditions",
"and",
"merges",
"them",
"by",
"AND",
"operator"
] | 587d840e0620331a9f63a6867f3400a293a9d3c6 | https://github.com/Vyki/mva-dbm/blob/587d840e0620331a9f63a6867f3400a293a9d3c6/src/Mva/Dbm/Query/QueryProcessor.php#L135-L159 |
205,843 | Vyki/mva-dbm | src/Mva/Dbm/Query/QueryProcessor.php | QueryProcessor.parseCondition | private function parseCondition($condition, $parameters = [])
{
if (strpos($condition, ' ')) {
$match = preg_match('~^
(.+)\s ## identifier
(
(?:\$\w+) | ## $mongoOperator
(?:[A-Z]+(?:_[A-Z]+)*) | ## NAMED_OPERATOR or
(?:[\<\>\!]?\=|\>|\<\>?) ... | php | private function parseCondition($condition, $parameters = [])
{
if (strpos($condition, ' ')) {
$match = preg_match('~^
(.+)\s ## identifier
(
(?:\$\w+) | ## $mongoOperator
(?:[A-Z]+(?:_[A-Z]+)*) | ## NAMED_OPERATOR or
(?:[\<\>\!]?\=|\>|\<\>?) ... | [
"private",
"function",
"parseCondition",
"(",
"$",
"condition",
",",
"$",
"parameters",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"condition",
",",
"' '",
")",
")",
"{",
"$",
"match",
"=",
"preg_match",
"(",
"'~^\n\t\t\t\t(.+)\\s ... | Parses single condition
@param $condition string
@param $parameters mixed
@throws InvalidArgumentException | [
"Parses",
"single",
"condition"
] | 587d840e0620331a9f63a6867f3400a293a9d3c6 | https://github.com/Vyki/mva-dbm/blob/587d840e0620331a9f63a6867f3400a293a9d3c6/src/Mva/Dbm/Query/QueryProcessor.php#L167-L219 |
205,844 | Vyki/mva-dbm | src/Mva/Dbm/Query/QueryProcessor.php | QueryProcessor.parseDeepCondition | private function parseDeepCondition(array $parameters, $toArray = FALSE)
{
$opcond = [];
foreach ($parameters as $key => $param) {
$ccond = is_int($key) ? $this->parseCondition($param) : $this->parseCondition($key, $param);
if ($toArray) {
$opcond[] = $ccond;
} else {
reset($ccond);
$opcond[... | php | private function parseDeepCondition(array $parameters, $toArray = FALSE)
{
$opcond = [];
foreach ($parameters as $key => $param) {
$ccond = is_int($key) ? $this->parseCondition($param) : $this->parseCondition($key, $param);
if ($toArray) {
$opcond[] = $ccond;
} else {
reset($ccond);
$opcond[... | [
"private",
"function",
"parseDeepCondition",
"(",
"array",
"$",
"parameters",
",",
"$",
"toArray",
"=",
"FALSE",
")",
"{",
"$",
"opcond",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"parameters",
"as",
"$",
"key",
"=>",
"$",
"param",
")",
"{",
"$",
"cco... | Parses inner conditions
@param array
@param bool indicates that output should be list | [
"Parses",
"inner",
"conditions"
] | 587d840e0620331a9f63a6867f3400a293a9d3c6 | https://github.com/Vyki/mva-dbm/blob/587d840e0620331a9f63a6867f3400a293a9d3c6/src/Mva/Dbm/Query/QueryProcessor.php#L226-L242 |
205,845 | Vyki/mva-dbm | src/Mva/Dbm/Query/QueryProcessor.php | QueryProcessor.processData | public function processData(array $data, $expand = FALSE)
{
$return = [];
foreach ($data as $key => $item) {
list($modified, $key) = $this->doubledModifier($key, '%');
if ($modified && preg_match('#^(.*)%(\w+(?:\[\])?)$#', $key, $parts)) {
$key = $parts[1];
$item = $this->processModifier($parts[2],... | php | public function processData(array $data, $expand = FALSE)
{
$return = [];
foreach ($data as $key => $item) {
list($modified, $key) = $this->doubledModifier($key, '%');
if ($modified && preg_match('#^(.*)%(\w+(?:\[\])?)$#', $key, $parts)) {
$key = $parts[1];
$item = $this->processModifier($parts[2],... | [
"public",
"function",
"processData",
"(",
"array",
"$",
"data",
",",
"$",
"expand",
"=",
"FALSE",
")",
"{",
"$",
"return",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"data",
"as",
"$",
"key",
"=>",
"$",
"item",
")",
"{",
"list",
"(",
"$",
"modified... | Formats data types by modifiers
@param array ['name' => 'roman', 'age%i' => '27', 'numbers%i[]' => ['1', 2, 2.3]]
@return array | [
"Formats",
"data",
"types",
"by",
"modifiers"
] | 587d840e0620331a9f63a6867f3400a293a9d3c6 | https://github.com/Vyki/mva-dbm/blob/587d840e0620331a9f63a6867f3400a293a9d3c6/src/Mva/Dbm/Query/QueryProcessor.php#L294-L318 |
205,846 | Vyki/mva-dbm | src/Mva/Dbm/Query/QueryProcessor.php | QueryProcessor.processLikeOperator | protected function processLikeOperator($value)
{
$value = preg_quote($value);
$value = substr($value, 0, 1) === '%' ? (substr($value, -1, 1) === '%' ? substr($value, 1, -1) : substr($value, 1) . '$') : (substr($value, -1, 1) === '%' ? '^' . substr($value, 0, -1) : $value);
return '/' . $value . '/i';
} | php | protected function processLikeOperator($value)
{
$value = preg_quote($value);
$value = substr($value, 0, 1) === '%' ? (substr($value, -1, 1) === '%' ? substr($value, 1, -1) : substr($value, 1) . '$') : (substr($value, -1, 1) === '%' ? '^' . substr($value, 0, -1) : $value);
return '/' . $value . '/i';
} | [
"protected",
"function",
"processLikeOperator",
"(",
"$",
"value",
")",
"{",
"$",
"value",
"=",
"preg_quote",
"(",
"$",
"value",
")",
";",
"$",
"value",
"=",
"substr",
"(",
"$",
"value",
",",
"0",
",",
"1",
")",
"===",
"'%'",
"?",
"(",
"substr",
"(... | Converts SQL LIKE to MongoRegex
@param string value with wildcard - %test, test%, %test% | [
"Converts",
"SQL",
"LIKE",
"to",
"MongoRegex"
] | 587d840e0620331a9f63a6867f3400a293a9d3c6 | https://github.com/Vyki/mva-dbm/blob/587d840e0620331a9f63a6867f3400a293a9d3c6/src/Mva/Dbm/Query/QueryProcessor.php#L419-L425 |
205,847 | Vyki/mva-dbm | src/Mva/Dbm/Query/QueryProcessor.php | QueryProcessor.processArray | protected function processArray($modifier, array &$values)
{
foreach ($values as &$item) {
$item = $this->processModifier($modifier, $item);
}
} | php | protected function processArray($modifier, array &$values)
{
foreach ($values as &$item) {
$item = $this->processModifier($modifier, $item);
}
} | [
"protected",
"function",
"processArray",
"(",
"$",
"modifier",
",",
"array",
"&",
"$",
"values",
")",
"{",
"foreach",
"(",
"$",
"values",
"as",
"&",
"$",
"item",
")",
"{",
"$",
"item",
"=",
"$",
"this",
"->",
"processModifier",
"(",
"$",
"modifier",
... | Applies modifier to the inner array via reference
@param string modifier
@param array sets of values | [
"Applies",
"modifier",
"to",
"the",
"inner",
"array",
"via",
"reference"
] | 587d840e0620331a9f63a6867f3400a293a9d3c6 | https://github.com/Vyki/mva-dbm/blob/587d840e0620331a9f63a6867f3400a293a9d3c6/src/Mva/Dbm/Query/QueryProcessor.php#L433-L438 |
205,848 | dotkernel/dot-session | src/ConfigProvider.php | ConfigProvider.getDependencyConfig | public function getDependencyConfig(): array
{
return [
'aliases' => [
SessionManager::class => ManagerInterface::class,
],
'factories' => [
ConfigInterface::class => SessionConfigFactory::class,
ManagerInterface::class => S... | php | public function getDependencyConfig(): array
{
return [
'aliases' => [
SessionManager::class => ManagerInterface::class,
],
'factories' => [
ConfigInterface::class => SessionConfigFactory::class,
ManagerInterface::class => S... | [
"public",
"function",
"getDependencyConfig",
"(",
")",
":",
"array",
"{",
"return",
"[",
"'aliases'",
"=>",
"[",
"SessionManager",
"::",
"class",
"=>",
"ManagerInterface",
"::",
"class",
",",
"]",
",",
"'factories'",
"=>",
"[",
"ConfigInterface",
"::",
"class"... | Merge our config with Zend Session dependencies
@return array | [
"Merge",
"our",
"config",
"with",
"Zend",
"Session",
"dependencies"
] | 9808072c807a9cc708a0cae5475a29f70e3f450e | https://github.com/dotkernel/dot-session/blob/9808072c807a9cc708a0cae5475a29f70e3f450e/src/ConfigProvider.php#L70-L88 |
205,849 | mvccore/ext-view-helper-assets | src/MvcCore/Ext/Views/Helpers/Assets.php | Assets.& | public function & SetView (\MvcCore\IView & $view) {
parent::SetView($view);
if (self::$appRoot === NULL) self::$appRoot = $this->request->GetAppRoot();
if (self::$basePath === NULL) self::$basePath = $this->request->GetBasePath();
if (self::$scriptName === NULL) self::$scriptName = ltrim($this->request->GetSc... | php | public function & SetView (\MvcCore\IView & $view) {
parent::SetView($view);
if (self::$appRoot === NULL) self::$appRoot = $this->request->GetAppRoot();
if (self::$basePath === NULL) self::$basePath = $this->request->GetBasePath();
if (self::$scriptName === NULL) self::$scriptName = ltrim($this->request->GetSc... | [
"public",
"function",
"&",
"SetView",
"(",
"\\",
"MvcCore",
"\\",
"IView",
"&",
"$",
"view",
")",
"{",
"parent",
"::",
"SetView",
"(",
"$",
"view",
")",
";",
"if",
"(",
"self",
"::",
"$",
"appRoot",
"===",
"NULL",
")",
"self",
"::",
"$",
"appRoot",... | Insert a \MvcCore\View in each helper constructing
@param \MvcCore\View|\MvcCore\IView $view
@return \MvcCore\Ext\Views\Helpers\AbstractHelper | [
"Insert",
"a",
"\\",
"MvcCore",
"\\",
"View",
"in",
"each",
"helper",
"constructing"
] | 5672575aca6d63f2340c912f9b9754bbb896d97b | https://github.com/mvccore/ext-view-helper-assets/blob/5672575aca6d63f2340c912f9b9754bbb896d97b/src/MvcCore/Ext/Views/Helpers/Assets.php#L150-L184 |
205,850 | mvccore/ext-view-helper-assets | src/MvcCore/Ext/Views/Helpers/Assets.php | Assets.CssJsFileUrl | public function CssJsFileUrl ($path = '') {
$result = '';
if (self::$assetsUrlCompletion) {
// for \MvcCore\Application::GetInstance()->GetCompiled() equal to: 'PHAR', 'SFU', 'PHP_STRICT_PACKAGE', 'PHP_PRESERVE_PACKAGE', 'PHP_PRESERVE_HDD'
$result = $this->view->AssetUrl($path);
} else {
// for \MvcCore\... | php | public function CssJsFileUrl ($path = '') {
$result = '';
if (self::$assetsUrlCompletion) {
// for \MvcCore\Application::GetInstance()->GetCompiled() equal to: 'PHAR', 'SFU', 'PHP_STRICT_PACKAGE', 'PHP_PRESERVE_PACKAGE', 'PHP_PRESERVE_HDD'
$result = $this->view->AssetUrl($path);
} else {
// for \MvcCore\... | [
"public",
"function",
"CssJsFileUrl",
"(",
"$",
"path",
"=",
"''",
")",
"{",
"$",
"result",
"=",
"''",
";",
"if",
"(",
"self",
"::",
"$",
"assetsUrlCompletion",
")",
"{",
"// for \\MvcCore\\Application::GetInstance()->GetCompiled() equal to: 'PHAR', 'SFU', 'PHP_STRICT_P... | Completes CSS or JS file url.
If application compile mode is in development state or packed in strict HDD mode,
there is generated standard URL with \MvcCore\Request->GetBasePath() (current app location)
plus called $path param. Because those application compile modes presume by default,
that those files are placed be... | [
"Completes",
"CSS",
"or",
"JS",
"file",
"url",
"."
] | 5672575aca6d63f2340c912f9b9754bbb896d97b | https://github.com/mvccore/ext-view-helper-assets/blob/5672575aca6d63f2340c912f9b9754bbb896d97b/src/MvcCore/Ext/Views/Helpers/Assets.php#L301-L311 |
205,851 | mvccore/ext-view-helper-assets | src/MvcCore/Ext/Views/Helpers/Assets.php | Assets.filterItemsForNotPossibleMinifiedAndPossibleMinifiedItems | protected function filterItemsForNotPossibleMinifiedAndPossibleMinifiedItems ($items) {
$itemsToRenderMinimized = [];
$itemsToRenderSeparately = []; // some configurations is not possible to render together and minimized
// go for every item to complete existing combinations in attributes
foreach ($items as & $... | php | protected function filterItemsForNotPossibleMinifiedAndPossibleMinifiedItems ($items) {
$itemsToRenderMinimized = [];
$itemsToRenderSeparately = []; // some configurations is not possible to render together and minimized
// go for every item to complete existing combinations in attributes
foreach ($items as & $... | [
"protected",
"function",
"filterItemsForNotPossibleMinifiedAndPossibleMinifiedItems",
"(",
"$",
"items",
")",
"{",
"$",
"itemsToRenderMinimized",
"=",
"[",
"]",
";",
"$",
"itemsToRenderSeparately",
"=",
"[",
"]",
";",
"// some configurations is not possible to render together... | Look for every item to render if there is any 'doNotMinify' record to render item separately
@param array $items
@return array[] $itemsToRenderMinimized $itemsToRenderSeparately | [
"Look",
"for",
"every",
"item",
"to",
"render",
"if",
"there",
"is",
"any",
"doNotMinify",
"record",
"to",
"render",
"item",
"separately"
] | 5672575aca6d63f2340c912f9b9754bbb896d97b | https://github.com/mvccore/ext-view-helper-assets/blob/5672575aca6d63f2340c912f9b9754bbb896d97b/src/MvcCore/Ext/Views/Helpers/Assets.php#L326-L354 |
205,852 | mvccore/ext-view-helper-assets | src/MvcCore/Ext/Views/Helpers/Assets.php | Assets.addFileModificationImprintToHrefUrl | protected function addFileModificationImprintToHrefUrl ($url, $path) {
$questionMarkPos = strpos($url, '?');
$separator = ($questionMarkPos === FALSE) ? '?' : '&';
$strippedUrl = $questionMarkPos !== FALSE ? substr($url, $questionMarkPos) : $url ;
$srcPath = $this->getAppRoot() . substr($strippedUrl, strlen(sel... | php | protected function addFileModificationImprintToHrefUrl ($url, $path) {
$questionMarkPos = strpos($url, '?');
$separator = ($questionMarkPos === FALSE) ? '?' : '&';
$strippedUrl = $questionMarkPos !== FALSE ? substr($url, $questionMarkPos) : $url ;
$srcPath = $this->getAppRoot() . substr($strippedUrl, strlen(sel... | [
"protected",
"function",
"addFileModificationImprintToHrefUrl",
"(",
"$",
"url",
",",
"$",
"path",
")",
"{",
"$",
"questionMarkPos",
"=",
"strpos",
"(",
"$",
"url",
",",
"'?'",
")",
";",
"$",
"separator",
"=",
"(",
"$",
"questionMarkPos",
"===",
"FALSE",
"... | Add to href URL file modification param by original file
@param string $url
@param string $path
@return string | [
"Add",
"to",
"href",
"URL",
"file",
"modification",
"param",
"by",
"original",
"file"
] | 5672575aca6d63f2340c912f9b9754bbb896d97b | https://github.com/mvccore/ext-view-helper-assets/blob/5672575aca6d63f2340c912f9b9754bbb896d97b/src/MvcCore/Ext/Views/Helpers/Assets.php#L362-L377 |
205,853 | mvccore/ext-view-helper-assets | src/MvcCore/Ext/Views/Helpers/Assets.php | Assets.getIndentString | protected function getIndentString($indent = 0) {
$indentStr = '';
if (is_numeric($indent)) {
$indInt = intval($indent);
if ($indInt > 0) {
$i = 0;
while ($i < $indInt) {
$indentStr .= "\t";
$i += 1;
}
}
} else if (is_string($indent)) {
$indentStr = $indent;
}
return $indentS... | php | protected function getIndentString($indent = 0) {
$indentStr = '';
if (is_numeric($indent)) {
$indInt = intval($indent);
if ($indInt > 0) {
$i = 0;
while ($i < $indInt) {
$indentStr .= "\t";
$i += 1;
}
}
} else if (is_string($indent)) {
$indentStr = $indent;
}
return $indentS... | [
"protected",
"function",
"getIndentString",
"(",
"$",
"indent",
"=",
"0",
")",
"{",
"$",
"indentStr",
"=",
"''",
";",
"if",
"(",
"is_numeric",
"(",
"$",
"indent",
")",
")",
"{",
"$",
"indInt",
"=",
"intval",
"(",
"$",
"indent",
")",
";",
"if",
"(",... | Get indent string
@param string|int $indent
@return string | [
"Get",
"indent",
"string"
] | 5672575aca6d63f2340c912f9b9754bbb896d97b | https://github.com/mvccore/ext-view-helper-assets/blob/5672575aca6d63f2340c912f9b9754bbb896d97b/src/MvcCore/Ext/Views/Helpers/Assets.php#L384-L399 |
205,854 | mvccore/ext-view-helper-assets | src/MvcCore/Ext/Views/Helpers/Assets.php | Assets.getTmpDir | protected function getTmpDir() {
if (!self::$tmpDir) {
$tmpDir = $this->getAppRoot() . self::$globalOptions['tmpDir'];
if (!\MvcCore\Application::GetInstance()->GetCompiled()) {
if (!is_dir($tmpDir)) mkdir($tmpDir, 0777, TRUE);
if (!is_writable($tmpDir)) {
try {
@chmod($tmpDir, 0777);
} ... | php | protected function getTmpDir() {
if (!self::$tmpDir) {
$tmpDir = $this->getAppRoot() . self::$globalOptions['tmpDir'];
if (!\MvcCore\Application::GetInstance()->GetCompiled()) {
if (!is_dir($tmpDir)) mkdir($tmpDir, 0777, TRUE);
if (!is_writable($tmpDir)) {
try {
@chmod($tmpDir, 0777);
} ... | [
"protected",
"function",
"getTmpDir",
"(",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"$",
"tmpDir",
")",
"{",
"$",
"tmpDir",
"=",
"$",
"this",
"->",
"getAppRoot",
"(",
")",
".",
"self",
"::",
"$",
"globalOptions",
"[",
"'tmpDir'",
"]",
";",
"if",
"("... | Return and store application document root from controller view request object
@throws \Exception
@return string | [
"Return",
"and",
"store",
"application",
"document",
"root",
"from",
"controller",
"view",
"request",
"object"
] | 5672575aca6d63f2340c912f9b9754bbb896d97b | https://github.com/mvccore/ext-view-helper-assets/blob/5672575aca6d63f2340c912f9b9754bbb896d97b/src/MvcCore/Ext/Views/Helpers/Assets.php#L414-L431 |
205,855 | mvccore/ext-view-helper-assets | src/MvcCore/Ext/Views/Helpers/Assets.php | Assets.saveFileContent | protected function saveFileContent ($fullPath = '', & $fileContent = '') {
$toolClass = \MvcCore\Application::GetInstance()->GetToolClass();
$toolClass::SingleProcessWrite($fullPath, $fileContent);
@chmod($fullPath, 0766);
} | php | protected function saveFileContent ($fullPath = '', & $fileContent = '') {
$toolClass = \MvcCore\Application::GetInstance()->GetToolClass();
$toolClass::SingleProcessWrite($fullPath, $fileContent);
@chmod($fullPath, 0766);
} | [
"protected",
"function",
"saveFileContent",
"(",
"$",
"fullPath",
"=",
"''",
",",
"&",
"$",
"fileContent",
"=",
"''",
")",
"{",
"$",
"toolClass",
"=",
"\\",
"MvcCore",
"\\",
"Application",
"::",
"GetInstance",
"(",
")",
"->",
"GetToolClass",
"(",
")",
";... | Save atomically file content in full path by 1 MB to not overflow any memory limits
@param string $fullPath
@param string $fileContent
@return void | [
"Save",
"atomically",
"file",
"content",
"in",
"full",
"path",
"by",
"1",
"MB",
"to",
"not",
"overflow",
"any",
"memory",
"limits"
] | 5672575aca6d63f2340c912f9b9754bbb896d97b | https://github.com/mvccore/ext-view-helper-assets/blob/5672575aca6d63f2340c912f9b9754bbb896d97b/src/MvcCore/Ext/Views/Helpers/Assets.php#L439-L443 |
205,856 | mvccore/ext-view-helper-assets | src/MvcCore/Ext/Views/Helpers/Assets.php | Assets.log | protected function log ($msg = '', $logType = 'debug') {
if (self::$loggingAndExceptions) {
\MvcCore\Debug::Log($msg, $logType);
}
} | php | protected function log ($msg = '', $logType = 'debug') {
if (self::$loggingAndExceptions) {
\MvcCore\Debug::Log($msg, $logType);
}
} | [
"protected",
"function",
"log",
"(",
"$",
"msg",
"=",
"''",
",",
"$",
"logType",
"=",
"'debug'",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"loggingAndExceptions",
")",
"{",
"\\",
"MvcCore",
"\\",
"Debug",
"::",
"Log",
"(",
"$",
"msg",
",",
"$",
"logT... | Log any render messages with optional log file name
@param string $msg
@param string $logType
@return void | [
"Log",
"any",
"render",
"messages",
"with",
"optional",
"log",
"file",
"name"
] | 5672575aca6d63f2340c912f9b9754bbb896d97b | https://github.com/mvccore/ext-view-helper-assets/blob/5672575aca6d63f2340c912f9b9754bbb896d97b/src/MvcCore/Ext/Views/Helpers/Assets.php#L451-L455 |
205,857 | mvccore/ext-view-helper-assets | src/MvcCore/Ext/Views/Helpers/Assets.php | Assets.warning | protected function warning ($msg) {
if (self::$loggingAndExceptions) {
\MvcCore\Debug::BarDump('[' . get_class($this) . '] ' . $msg, \MvcCore\IDebug::DEBUG);
}
} | php | protected function warning ($msg) {
if (self::$loggingAndExceptions) {
\MvcCore\Debug::BarDump('[' . get_class($this) . '] ' . $msg, \MvcCore\IDebug::DEBUG);
}
} | [
"protected",
"function",
"warning",
"(",
"$",
"msg",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"loggingAndExceptions",
")",
"{",
"\\",
"MvcCore",
"\\",
"Debug",
"::",
"BarDump",
"(",
"'['",
".",
"get_class",
"(",
"$",
"this",
")",
".",
"'] '",
".",
"$"... | Throw exception with given message with actual helper class name before
@param string $msg
@return void | [
"Throw",
"exception",
"with",
"given",
"message",
"with",
"actual",
"helper",
"class",
"name",
"before"
] | 5672575aca6d63f2340c912f9b9754bbb896d97b | https://github.com/mvccore/ext-view-helper-assets/blob/5672575aca6d63f2340c912f9b9754bbb896d97b/src/MvcCore/Ext/Views/Helpers/Assets.php#L474-L478 |
205,858 | mvccore/ext-view-helper-assets | src/MvcCore/Ext/Views/Helpers/Assets.php | Assets.getTmpFileFullPathByPartFilesInfo | protected function getTmpFileFullPathByPartFilesInfo ($filesGroupInfo = [], $minify = FALSE, $extension = '') {
return implode('', [
$this->getTmpDir(),
'/' . ($minify ? 'minified' : 'rendered') . '_' . $extension . '_',
md5(implode(',', $filesGroupInfo) . '_' . $minify),
'.' . $extension
]);
} | php | protected function getTmpFileFullPathByPartFilesInfo ($filesGroupInfo = [], $minify = FALSE, $extension = '') {
return implode('', [
$this->getTmpDir(),
'/' . ($minify ? 'minified' : 'rendered') . '_' . $extension . '_',
md5(implode(',', $filesGroupInfo) . '_' . $minify),
'.' . $extension
]);
} | [
"protected",
"function",
"getTmpFileFullPathByPartFilesInfo",
"(",
"$",
"filesGroupInfo",
"=",
"[",
"]",
",",
"$",
"minify",
"=",
"FALSE",
",",
"$",
"extension",
"=",
"''",
")",
"{",
"return",
"implode",
"(",
"''",
",",
"[",
"$",
"this",
"->",
"getTmpDir",... | Complete items group tmp directory file name by group source files info
@param array $filesGroupInfo
@param boolean $minify
@return string | [
"Complete",
"items",
"group",
"tmp",
"directory",
"file",
"name",
"by",
"group",
"source",
"files",
"info"
] | 5672575aca6d63f2340c912f9b9754bbb896d97b | https://github.com/mvccore/ext-view-helper-assets/blob/5672575aca6d63f2340c912f9b9754bbb896d97b/src/MvcCore/Ext/Views/Helpers/Assets.php#L497-L504 |
205,859 | schpill/thin | src/Multithread.php | Multithread.run | public function run($jobs)
{
$lenTab = count($jobs);
for ($i = 0 ; $i < $lenTab ; $i++) {
$jobID = rand(0, 100);
while (count($this->currentJobs) >= $this->maxProcesses) {
sleep($this->sleepTime);
}
$lau... | php | public function run($jobs)
{
$lenTab = count($jobs);
for ($i = 0 ; $i < $lenTab ; $i++) {
$jobID = rand(0, 100);
while (count($this->currentJobs) >= $this->maxProcesses) {
sleep($this->sleepTime);
}
$lau... | [
"public",
"function",
"run",
"(",
"$",
"jobs",
")",
"{",
"$",
"lenTab",
"=",
"count",
"(",
"$",
"jobs",
")",
";",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"$",
"lenTab",
";",
"$",
"i",
"++",
")",
"{",
"$",
"jobID",
"=",
"rand",
... | Run the Daemon | [
"Run",
"the",
"Daemon"
] | a9102d9d6f70e8b0f6be93153f70849f46489ee1 | https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Multithread.php#L24-L39 |
205,860 | schpill/thin | src/Multithread.php | Multithread.launchJob | protected function launchJob($jobID)
{
$pid = pcntl_fork();
if ($pid == -1) {
error_log('Could not launch new job, exiting');
echo 'Could not launch new job, exiting';
return false;
} else if ($pid) {
$this->curr... | php | protected function launchJob($jobID)
{
$pid = pcntl_fork();
if ($pid == -1) {
error_log('Could not launch new job, exiting');
echo 'Could not launch new job, exiting';
return false;
} else if ($pid) {
$this->curr... | [
"protected",
"function",
"launchJob",
"(",
"$",
"jobID",
")",
"{",
"$",
"pid",
"=",
"pcntl_fork",
"(",
")",
";",
"if",
"(",
"$",
"pid",
"==",
"-",
"1",
")",
"{",
"error_log",
"(",
"'Could not launch new job, exiting'",
")",
";",
"echo",
"'Could not launch ... | Launch a job from the job queue | [
"Launch",
"a",
"job",
"from",
"the",
"job",
"queue"
] | a9102d9d6f70e8b0f6be93153f70849f46489ee1 | https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Multithread.php#L83-L101 |
205,861 | rzajac/php-test-helper | src/Database/Driver/MySQL.php | MySQL.getTableNames | protected function getTableNames(): array
{
$dbName = $this->config[DbItf::DB_CFG_DATABASE];
$resp = $this->dbRunQuery(sprintf('SHOW FULL TABLES FROM `%s`', $dbName));
$tableAndViewNames = [];
while ($row = $resp->fetch_assoc()) {
$tableAndViewNames[] = array_change_key_... | php | protected function getTableNames(): array
{
$dbName = $this->config[DbItf::DB_CFG_DATABASE];
$resp = $this->dbRunQuery(sprintf('SHOW FULL TABLES FROM `%s`', $dbName));
$tableAndViewNames = [];
while ($row = $resp->fetch_assoc()) {
$tableAndViewNames[] = array_change_key_... | [
"protected",
"function",
"getTableNames",
"(",
")",
":",
"array",
"{",
"$",
"dbName",
"=",
"$",
"this",
"->",
"config",
"[",
"DbItf",
"::",
"DB_CFG_DATABASE",
"]",
";",
"$",
"resp",
"=",
"$",
"this",
"->",
"dbRunQuery",
"(",
"sprintf",
"(",
"'SHOW FULL T... | Return table and view names form the database.
@throws DatabaseEx
@return array | [
"Return",
"table",
"and",
"view",
"names",
"form",
"the",
"database",
"."
] | 37280e9ff639b25cf9413909cc080c5d8deb311c | https://github.com/rzajac/php-test-helper/blob/37280e9ff639b25cf9413909cc080c5d8deb311c/src/Database/Driver/MySQL.php#L164-L175 |
205,862 | wdbo/webdocbook | src/WebDocBook/Filesystem/Helper.php | Helper.slashDirname | public static function slashDirname($dirname = null)
{
if (is_null($dirname) || empty($dirname)) {
return '';
}
return rtrim($dirname, '/ '.DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR;
} | php | public static function slashDirname($dirname = null)
{
if (is_null($dirname) || empty($dirname)) {
return '';
}
return rtrim($dirname, '/ '.DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR;
} | [
"public",
"static",
"function",
"slashDirname",
"(",
"$",
"dirname",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"dirname",
")",
"||",
"empty",
"(",
"$",
"dirname",
")",
")",
"{",
"return",
"''",
";",
"}",
"return",
"rtrim",
"(",
"$",
"d... | Get a dirname with one and only trailing slash
@param string $dirname
@return string | [
"Get",
"a",
"dirname",
"with",
"one",
"and",
"only",
"trailing",
"slash"
] | 7d4e806f674b6222c9a3e85bfed34e72bc9d584e | https://github.com/wdbo/webdocbook/blob/7d4e806f674b6222c9a3e85bfed34e72bc9d584e/src/WebDocBook/Filesystem/Helper.php#L43-L49 |
205,863 | wdbo/webdocbook | src/WebDocBook/Filesystem/Helper.php | Helper.isGitClone | public static function isGitClone($path = null)
{
if (is_null($path) || empty($path)) {
return false;
}
$dir_path = self::slashDirname($path).'.git';
return (bool) (file_exists($dir_path) && is_dir($dir_path));
} | php | public static function isGitClone($path = null)
{
if (is_null($path) || empty($path)) {
return false;
}
$dir_path = self::slashDirname($path).'.git';
return (bool) (file_exists($dir_path) && is_dir($dir_path));
} | [
"public",
"static",
"function",
"isGitClone",
"(",
"$",
"path",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"path",
")",
"||",
"empty",
"(",
"$",
"path",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"dir_path",
"=",
"self",
"::",
"... | Test if a path seems to be a git clone
@param string $path
@return bool | [
"Test",
"if",
"a",
"path",
"seems",
"to",
"be",
"a",
"git",
"clone"
] | 7d4e806f674b6222c9a3e85bfed34e72bc9d584e | https://github.com/wdbo/webdocbook/blob/7d4e806f674b6222c9a3e85bfed34e72bc9d584e/src/WebDocBook/Filesystem/Helper.php#L57-L64 |
205,864 | wdbo/webdocbook | src/WebDocBook/Filesystem/Helper.php | Helper.isDotPath | public static function isDotPath($path = null)
{
if (is_null($path) || empty($path)) {
return false;
}
return (bool) ('.'===substr(basename($path), 0, 1));
} | php | public static function isDotPath($path = null)
{
if (is_null($path) || empty($path)) {
return false;
}
return (bool) ('.'===substr(basename($path), 0, 1));
} | [
"public",
"static",
"function",
"isDotPath",
"(",
"$",
"path",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"path",
")",
"||",
"empty",
"(",
"$",
"path",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"(",
"bool",
")",
"(",
"'.'"... | Test if a filename seems to have a dot as first character
@param string $path
@return bool | [
"Test",
"if",
"a",
"filename",
"seems",
"to",
"have",
"a",
"dot",
"as",
"first",
"character"
] | 7d4e806f674b6222c9a3e85bfed34e72bc9d584e | https://github.com/wdbo/webdocbook/blob/7d4e806f674b6222c9a3e85bfed34e72bc9d584e/src/WebDocBook/Filesystem/Helper.php#L72-L78 |
205,865 | wdbo/webdocbook | src/WebDocBook/Filesystem/Helper.php | Helper.remove | public static function remove($path, $parent = true)
{
$ok = true;
if (true===self::ensureExists($path)) {
if (false===@is_dir($path) || true===is_link($path)) {
return @unlink($path);
}
$iterator = new \RecursiveIteratorIterator(
n... | php | public static function remove($path, $parent = true)
{
$ok = true;
if (true===self::ensureExists($path)) {
if (false===@is_dir($path) || true===is_link($path)) {
return @unlink($path);
}
$iterator = new \RecursiveIteratorIterator(
n... | [
"public",
"static",
"function",
"remove",
"(",
"$",
"path",
",",
"$",
"parent",
"=",
"true",
")",
"{",
"$",
"ok",
"=",
"true",
";",
"if",
"(",
"true",
"===",
"self",
"::",
"ensureExists",
"(",
"$",
"path",
")",
")",
"{",
"if",
"(",
"false",
"==="... | Try to remove a path
@param string $path
@param bool $parent
@return bool | [
"Try",
"to",
"remove",
"a",
"path"
] | 7d4e806f674b6222c9a3e85bfed34e72bc9d584e | https://github.com/wdbo/webdocbook/blob/7d4e806f674b6222c9a3e85bfed34e72bc9d584e/src/WebDocBook/Filesystem/Helper.php#L117-L144 |
205,866 | wdbo/webdocbook | src/WebDocBook/Filesystem/Helper.php | Helper.parseIni | public static function parseIni($path)
{
if (true===@file_exists($path)) {
$data = parse_ini_file($path, true);
if ($data && !empty($data)) {
return $data;
}
}
return false;
} | php | public static function parseIni($path)
{
if (true===@file_exists($path)) {
$data = parse_ini_file($path, true);
if ($data && !empty($data)) {
return $data;
}
}
return false;
} | [
"public",
"static",
"function",
"parseIni",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"true",
"===",
"@",
"file_exists",
"(",
"$",
"path",
")",
")",
"{",
"$",
"data",
"=",
"parse_ini_file",
"(",
"$",
"path",
",",
"true",
")",
";",
"if",
"(",
"$",
"d... | Read and parse a INI content file
@param $path
@return array|bool | [
"Read",
"and",
"parse",
"a",
"INI",
"content",
"file"
] | 7d4e806f674b6222c9a3e85bfed34e72bc9d584e | https://github.com/wdbo/webdocbook/blob/7d4e806f674b6222c9a3e85bfed34e72bc9d584e/src/WebDocBook/Filesystem/Helper.php#L152-L161 |
205,867 | wdbo/webdocbook | src/WebDocBook/Filesystem/Helper.php | Helper.parseJson | public static function parseJson($path)
{
if (true===@file_exists($path)) {
$ctt = file_get_contents($path);
if ($ctt!==false) {
$data = json_decode($ctt, true);
if ($data && !empty($data)) {
return $data;
}
... | php | public static function parseJson($path)
{
if (true===@file_exists($path)) {
$ctt = file_get_contents($path);
if ($ctt!==false) {
$data = json_decode($ctt, true);
if ($data && !empty($data)) {
return $data;
}
... | [
"public",
"static",
"function",
"parseJson",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"true",
"===",
"@",
"file_exists",
"(",
"$",
"path",
")",
")",
"{",
"$",
"ctt",
"=",
"file_get_contents",
"(",
"$",
"path",
")",
";",
"if",
"(",
"$",
"ctt",
"!==",
... | Read and parse a JSON content file
@param $path
@return bool|mixed | [
"Read",
"and",
"parse",
"a",
"JSON",
"content",
"file"
] | 7d4e806f674b6222c9a3e85bfed34e72bc9d584e | https://github.com/wdbo/webdocbook/blob/7d4e806f674b6222c9a3e85bfed34e72bc9d584e/src/WebDocBook/Filesystem/Helper.php#L169-L181 |
205,868 | PhoxPHP/Glider | src/Console/Command/Migration.php | Migration.create | protected function create(Array $arguments=[])
{
$migrationsDirectory = $this->cmd->getConfigOpt('migrations_storage');
$templateTags = [];
$migrationName = $this->cmd->question('Migration filename?');
$filename = trim($migrationName);
$path = $migrationsDirectory . '/' . $filename . '.php';
i... | php | protected function create(Array $arguments=[])
{
$migrationsDirectory = $this->cmd->getConfigOpt('migrations_storage');
$templateTags = [];
$migrationName = $this->cmd->question('Migration filename?');
$filename = trim($migrationName);
$path = $migrationsDirectory . '/' . $filename . '.php';
i... | [
"protected",
"function",
"create",
"(",
"Array",
"$",
"arguments",
"=",
"[",
"]",
")",
"{",
"$",
"migrationsDirectory",
"=",
"$",
"this",
"->",
"cmd",
"->",
"getConfigOpt",
"(",
"'migrations_storage'",
")",
";",
"$",
"templateTags",
"=",
"[",
"]",
";",
"... | Creates a migration.
@param $arguments <Array>
@access protected
@return <void> | [
"Creates",
"a",
"migration",
"."
] | 17aaf3b7bb6e70ea3ae1f04e30a7690e884bf042 | https://github.com/PhoxPHP/Glider/blob/17aaf3b7bb6e70ea3ae1f04e30a7690e884bf042/src/Console/Command/Migration.php#L145-L177 |
205,869 | PhoxPHP/Glider | src/Console/Command/Migration.php | Migration.processMigration | protected function processMigration(Array $arguments)
{
$migrationClass = $arguments[0];
$migration = Model::findByclass_name($migrationClass);
if (!$migration) {
throw new MigrationClassNotFoundException(
sprintf(
'Migration class [%s] does not exist',
$migrationClass
)
);
... | php | protected function processMigration(Array $arguments)
{
$migrationClass = $arguments[0];
$migration = Model::findByclass_name($migrationClass);
if (!$migration) {
throw new MigrationClassNotFoundException(
sprintf(
'Migration class [%s] does not exist',
$migrationClass
)
);
... | [
"protected",
"function",
"processMigration",
"(",
"Array",
"$",
"arguments",
")",
"{",
"$",
"migrationClass",
"=",
"$",
"arguments",
"[",
"0",
"]",
";",
"$",
"migration",
"=",
"Model",
"::",
"findByclass_name",
"(",
"$",
"migrationClass",
")",
";",
"if",
"... | Processes a specific migration.
@param $arguments <Array>
@access protected
@return <void> | [
"Processes",
"a",
"specific",
"migration",
"."
] | 17aaf3b7bb6e70ea3ae1f04e30a7690e884bf042 | https://github.com/PhoxPHP/Glider/blob/17aaf3b7bb6e70ea3ae1f04e30a7690e884bf042/src/Console/Command/Migration.php#L199-L218 |
205,870 | iwyg/xmlconf | src/Thapp/XmlConf/Cache/Cache.php | Cache.getCacheModificationDate | protected function getCacheModificationDate($file)
{
$storageKey = $this->getStorageKey() . '.lasmodified';
$filemtime = filemtime($file);
$lastmodified = $this->storage->has($storageKey) ? $this->storage->get($storageKey) : $filemtime - 1;
return array($filemtime, $lastmodifie... | php | protected function getCacheModificationDate($file)
{
$storageKey = $this->getStorageKey() . '.lasmodified';
$filemtime = filemtime($file);
$lastmodified = $this->storage->has($storageKey) ? $this->storage->get($storageKey) : $filemtime - 1;
return array($filemtime, $lastmodifie... | [
"protected",
"function",
"getCacheModificationDate",
"(",
"$",
"file",
")",
"{",
"$",
"storageKey",
"=",
"$",
"this",
"->",
"getStorageKey",
"(",
")",
".",
"'.lasmodified'",
";",
"$",
"filemtime",
"=",
"filemtime",
"(",
"$",
"file",
")",
";",
"$",
"lastmod... | Returns the modification date of a given file and the the
date of the last cache write.
@access protected
@return array | [
"Returns",
"the",
"modification",
"date",
"of",
"a",
"given",
"file",
"and",
"the",
"the",
"date",
"of",
"the",
"last",
"cache",
"write",
"."
] | 1d8a657073f3fd46dacfb6bf5d173f9d5283661b | https://github.com/iwyg/xmlconf/blob/1d8a657073f3fd46dacfb6bf5d173f9d5283661b/src/Thapp/XmlConf/Cache/Cache.php#L97-L104 |
205,871 | crodas/ConcurrentFileWriter | src/ConcurrentFileWriter/ConcurrentFileWriter.php | ConcurrentFileWriter.create | public function create(array $metadata = array())
{
if (is_file($this->file)) {
return false;
}
$this->createTemporaryFolder();
file_put_contents($this->file, $this->placeholderContent($metadata), LOCK_EX);
return true;
} | php | public function create(array $metadata = array())
{
if (is_file($this->file)) {
return false;
}
$this->createTemporaryFolder();
file_put_contents($this->file, $this->placeholderContent($metadata), LOCK_EX);
return true;
} | [
"public",
"function",
"create",
"(",
"array",
"$",
"metadata",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"is_file",
"(",
"$",
"this",
"->",
"file",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"this",
"->",
"createTemporaryFolder",
"(",
")",
... | Creates the file. It creates a placeholder file with some metadata on it and will
create all the temporary files and folders.
Writing without creating first will throw an exception. Creating twice will not throw an
exception but will return false. That means it is OK to call `create()` before calling
`write()`. Ideall... | [
"Creates",
"the",
"file",
".",
"It",
"creates",
"a",
"placeholder",
"file",
"with",
"some",
"metadata",
"on",
"it",
"and",
"will",
"create",
"all",
"the",
"temporary",
"files",
"and",
"folders",
"."
] | 13f88d8c2daf5fe9c70f8be6aeb3d862cd2a5e5a | https://github.com/crodas/ConcurrentFileWriter/blob/13f88d8c2daf5fe9c70f8be6aeb3d862cd2a5e5a/src/ConcurrentFileWriter/ConcurrentFileWriter.php#L72-L82 |
205,872 | crodas/ConcurrentFileWriter | src/ConcurrentFileWriter/ConcurrentFileWriter.php | ConcurrentFileWriter.createTemporaryFolder | protected function createTemporaryFolder()
{
Util::mkdir($this->blocks);
Util::mkdir(dirname($this->file));
file_put_contents($this->tmp . '.lock', '', LOCK_EX);
} | php | protected function createTemporaryFolder()
{
Util::mkdir($this->blocks);
Util::mkdir(dirname($this->file));
file_put_contents($this->tmp . '.lock', '', LOCK_EX);
} | [
"protected",
"function",
"createTemporaryFolder",
"(",
")",
"{",
"Util",
"::",
"mkdir",
"(",
"$",
"this",
"->",
"blocks",
")",
";",
"Util",
"::",
"mkdir",
"(",
"dirname",
"(",
"$",
"this",
"->",
"file",
")",
")",
";",
"file_put_contents",
"(",
"$",
"th... | Creates the needed temporary files and folders in prepartion for
the file writer. | [
"Creates",
"the",
"needed",
"temporary",
"files",
"and",
"folders",
"in",
"prepartion",
"for",
"the",
"file",
"writer",
"."
] | 13f88d8c2daf5fe9c70f8be6aeb3d862cd2a5e5a | https://github.com/crodas/ConcurrentFileWriter/blob/13f88d8c2daf5fe9c70f8be6aeb3d862cd2a5e5a/src/ConcurrentFileWriter/ConcurrentFileWriter.php#L88-L93 |
205,873 | crodas/ConcurrentFileWriter | src/ConcurrentFileWriter/ConcurrentFileWriter.php | ConcurrentFileWriter.getWroteBlocks | public function getWroteBlocks()
{
if (!is_dir($this->blocks)) {
throw new RuntimeException("cannot obtain the blocks ({$this->blocks})");
}
$files = array_filter(array_map(function($file) {
$basename = basename($file);
if (!is_numeric($basename)) {
... | php | public function getWroteBlocks()
{
if (!is_dir($this->blocks)) {
throw new RuntimeException("cannot obtain the blocks ({$this->blocks})");
}
$files = array_filter(array_map(function($file) {
$basename = basename($file);
if (!is_numeric($basename)) {
... | [
"public",
"function",
"getWroteBlocks",
"(",
")",
"{",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"this",
"->",
"blocks",
")",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"cannot obtain the blocks ({$this->blocks})\"",
")",
";",
"}",
"$",
"files",
"=",
"ar... | Returns all the wrote blocks of files. All the blocks are sorted by their offset.
@return array | [
"Returns",
"all",
"the",
"wrote",
"blocks",
"of",
"files",
".",
"All",
"the",
"blocks",
"are",
"sorted",
"by",
"their",
"offset",
"."
] | 13f88d8c2daf5fe9c70f8be6aeb3d862cd2a5e5a | https://github.com/crodas/ConcurrentFileWriter/blob/13f88d8c2daf5fe9c70f8be6aeb3d862cd2a5e5a/src/ConcurrentFileWriter/ConcurrentFileWriter.php#L139-L161 |
205,874 | domnikl/DesignPatternsPHP | Behavioral/ChainOfResponsibilities/Handler.php | Handler.handle | final public function handle(RequestInterface $request)
{
$processed = $this->processing($request);
if ($processed === null) {
// the request has not been processed by this handler => see the next
if ($this->successor !== null) {
$processed = $this->successor... | php | final public function handle(RequestInterface $request)
{
$processed = $this->processing($request);
if ($processed === null) {
// the request has not been processed by this handler => see the next
if ($this->successor !== null) {
$processed = $this->successor... | [
"final",
"public",
"function",
"handle",
"(",
"RequestInterface",
"$",
"request",
")",
"{",
"$",
"processed",
"=",
"$",
"this",
"->",
"processing",
"(",
"$",
"request",
")",
";",
"if",
"(",
"$",
"processed",
"===",
"null",
")",
"{",
"// the request has not... | This approach by using a template method pattern ensures you that
each subclass will not forget to call the successor
@param RequestInterface $request
@return string|null | [
"This",
"approach",
"by",
"using",
"a",
"template",
"method",
"pattern",
"ensures",
"you",
"that",
"each",
"subclass",
"will",
"not",
"forget",
"to",
"call",
"the",
"successor"
] | 5f5649b57ea94471e20b54eb439c6368dea07886 | https://github.com/domnikl/DesignPatternsPHP/blob/5f5649b57ea94471e20b54eb439c6368dea07886/Behavioral/ChainOfResponsibilities/Handler.php#L28-L40 |
205,875 | domnikl/DesignPatternsPHP | Behavioral/Specification/AndSpecification.php | AndSpecification.isSatisfiedBy | public function isSatisfiedBy(Item $item): bool
{
foreach ($this->specifications as $specification) {
if (!$specification->isSatisfiedBy($item)) {
return false;
}
}
return true;
} | php | public function isSatisfiedBy(Item $item): bool
{
foreach ($this->specifications as $specification) {
if (!$specification->isSatisfiedBy($item)) {
return false;
}
}
return true;
} | [
"public",
"function",
"isSatisfiedBy",
"(",
"Item",
"$",
"item",
")",
":",
"bool",
"{",
"foreach",
"(",
"$",
"this",
"->",
"specifications",
"as",
"$",
"specification",
")",
"{",
"if",
"(",
"!",
"$",
"specification",
"->",
"isSatisfiedBy",
"(",
"$",
"ite... | if at least one specification is false, return false, else return true. | [
"if",
"at",
"least",
"one",
"specification",
"is",
"false",
"return",
"false",
"else",
"return",
"true",
"."
] | 5f5649b57ea94471e20b54eb439c6368dea07886 | https://github.com/domnikl/DesignPatternsPHP/blob/5f5649b57ea94471e20b54eb439c6368dea07886/Behavioral/Specification/AndSpecification.php#L23-L32 |
205,876 | laravel/framework | src/Illuminate/Auth/Passwords/PasswordBroker.php | PasswordBroker.validateNewPassword | public function validateNewPassword(array $credentials)
{
if (isset($this->passwordValidator)) {
[$password, $confirm] = [
$credentials['password'],
$credentials['password_confirmation'],
];
return call_user_func(
$this->pa... | php | public function validateNewPassword(array $credentials)
{
if (isset($this->passwordValidator)) {
[$password, $confirm] = [
$credentials['password'],
$credentials['password_confirmation'],
];
return call_user_func(
$this->pa... | [
"public",
"function",
"validateNewPassword",
"(",
"array",
"$",
"credentials",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"passwordValidator",
")",
")",
"{",
"[",
"$",
"password",
",",
"$",
"confirm",
"]",
"=",
"[",
"$",
"credentials",
"[",
... | Determine if the passwords match for the request.
@param array $credentials
@return bool | [
"Determine",
"if",
"the",
"passwords",
"match",
"for",
"the",
"request",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Auth/Passwords/PasswordBroker.php#L146-L160 |
205,877 | laravel/framework | src/Illuminate/Auth/Passwords/PasswordBroker.php | PasswordBroker.validatePasswordWithDefaults | protected function validatePasswordWithDefaults(array $credentials)
{
[$password, $confirm] = [
$credentials['password'],
$credentials['password_confirmation'],
];
return $password === $confirm && mb_strlen($password) >= 8;
} | php | protected function validatePasswordWithDefaults(array $credentials)
{
[$password, $confirm] = [
$credentials['password'],
$credentials['password_confirmation'],
];
return $password === $confirm && mb_strlen($password) >= 8;
} | [
"protected",
"function",
"validatePasswordWithDefaults",
"(",
"array",
"$",
"credentials",
")",
"{",
"[",
"$",
"password",
",",
"$",
"confirm",
"]",
"=",
"[",
"$",
"credentials",
"[",
"'password'",
"]",
",",
"$",
"credentials",
"[",
"'password_confirmation'",
... | Determine if the passwords are valid for the request.
@param array $credentials
@return bool | [
"Determine",
"if",
"the",
"passwords",
"are",
"valid",
"for",
"the",
"request",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Auth/Passwords/PasswordBroker.php#L168-L176 |
205,878 | laravel/framework | src/Illuminate/Database/Grammar.php | Grammar.wrapAliasedValue | protected function wrapAliasedValue($value, $prefixAlias = false)
{
$segments = preg_split('/\s+as\s+/i', $value);
// If we are wrapping a table we need to prefix the alias with the table prefix
// as well in order to generate proper syntax. If this is a column of course
// no prefi... | php | protected function wrapAliasedValue($value, $prefixAlias = false)
{
$segments = preg_split('/\s+as\s+/i', $value);
// If we are wrapping a table we need to prefix the alias with the table prefix
// as well in order to generate proper syntax. If this is a column of course
// no prefi... | [
"protected",
"function",
"wrapAliasedValue",
"(",
"$",
"value",
",",
"$",
"prefixAlias",
"=",
"false",
")",
"{",
"$",
"segments",
"=",
"preg_split",
"(",
"'/\\s+as\\s+/i'",
",",
"$",
"value",
")",
";",
"// If we are wrapping a table we need to prefix the alias with th... | Wrap a value that has an alias.
@param string $value
@param bool $prefixAlias
@return string | [
"Wrap",
"a",
"value",
"that",
"has",
"an",
"alias",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Grammar.php#L75-L89 |
205,879 | laravel/framework | src/Illuminate/Database/Grammar.php | Grammar.wrapSegments | protected function wrapSegments($segments)
{
return collect($segments)->map(function ($segment, $key) use ($segments) {
return $key == 0 && count($segments) > 1
? $this->wrapTable($segment)
: $this->wrapValue($segment);
})->implode(... | php | protected function wrapSegments($segments)
{
return collect($segments)->map(function ($segment, $key) use ($segments) {
return $key == 0 && count($segments) > 1
? $this->wrapTable($segment)
: $this->wrapValue($segment);
})->implode(... | [
"protected",
"function",
"wrapSegments",
"(",
"$",
"segments",
")",
"{",
"return",
"collect",
"(",
"$",
"segments",
")",
"->",
"map",
"(",
"function",
"(",
"$",
"segment",
",",
"$",
"key",
")",
"use",
"(",
"$",
"segments",
")",
"{",
"return",
"$",
"k... | Wrap the given value segments.
@param array $segments
@return string | [
"Wrap",
"the",
"given",
"value",
"segments",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Grammar.php#L97-L104 |
205,880 | laravel/framework | src/Illuminate/Translation/ArrayLoader.php | ArrayLoader.addMessages | public function addMessages($locale, $group, array $messages, $namespace = null)
{
$namespace = $namespace ?: '*';
$this->messages[$namespace][$locale][$group] = $messages;
return $this;
} | php | public function addMessages($locale, $group, array $messages, $namespace = null)
{
$namespace = $namespace ?: '*';
$this->messages[$namespace][$locale][$group] = $messages;
return $this;
} | [
"public",
"function",
"addMessages",
"(",
"$",
"locale",
",",
"$",
"group",
",",
"array",
"$",
"messages",
",",
"$",
"namespace",
"=",
"null",
")",
"{",
"$",
"namespace",
"=",
"$",
"namespace",
"?",
":",
"'*'",
";",
"$",
"this",
"->",
"messages",
"["... | Add messages to the loader.
@param string $locale
@param string $group
@param array $messages
@param string|null $namespace
@return $this | [
"Add",
"messages",
"to",
"the",
"loader",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Translation/ArrayLoader.php#L63-L70 |
205,881 | laravel/framework | src/Illuminate/Log/LogManager.php | LogManager.stack | public function stack(array $channels, $channel = null)
{
return new Logger(
$this->createStackDriver(compact('channels', 'channel')),
$this->app['events']
);
} | php | public function stack(array $channels, $channel = null)
{
return new Logger(
$this->createStackDriver(compact('channels', 'channel')),
$this->app['events']
);
} | [
"public",
"function",
"stack",
"(",
"array",
"$",
"channels",
",",
"$",
"channel",
"=",
"null",
")",
"{",
"return",
"new",
"Logger",
"(",
"$",
"this",
"->",
"createStackDriver",
"(",
"compact",
"(",
"'channels'",
",",
"'channel'",
")",
")",
",",
"$",
"... | Create a new, on-demand aggregate logger instance.
@param array $channels
@param string|null $channel
@return \Psr\Log\LoggerInterface | [
"Create",
"a",
"new",
"on",
"-",
"demand",
"aggregate",
"logger",
"instance",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Log/LogManager.php#L63-L69 |
205,882 | laravel/framework | src/Illuminate/Log/LogManager.php | LogManager.tap | protected function tap($name, Logger $logger)
{
foreach ($this->configurationFor($name)['tap'] ?? [] as $tap) {
[$class, $arguments] = $this->parseTap($tap);
$this->app->make($class)->__invoke($logger, ...explode(',', $arguments));
}
return $logger;
} | php | protected function tap($name, Logger $logger)
{
foreach ($this->configurationFor($name)['tap'] ?? [] as $tap) {
[$class, $arguments] = $this->parseTap($tap);
$this->app->make($class)->__invoke($logger, ...explode(',', $arguments));
}
return $logger;
} | [
"protected",
"function",
"tap",
"(",
"$",
"name",
",",
"Logger",
"$",
"logger",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"configurationFor",
"(",
"$",
"name",
")",
"[",
"'tap'",
"]",
"??",
"[",
"]",
"as",
"$",
"tap",
")",
"{",
"[",
"$",
"clas... | Apply the configured taps for the logger.
@param string $name
@param \Illuminate\Log\Logger $logger
@return \Illuminate\Log\Logger | [
"Apply",
"the",
"configured",
"taps",
"for",
"the",
"logger",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Log/LogManager.php#L121-L130 |
205,883 | laravel/framework | src/Illuminate/Log/LogManager.php | LogManager.createCustomDriver | protected function createCustomDriver(array $config)
{
$factory = is_callable($via = $config['via']) ? $via : $this->app->make($via);
return $factory($config);
} | php | protected function createCustomDriver(array $config)
{
$factory = is_callable($via = $config['via']) ? $via : $this->app->make($via);
return $factory($config);
} | [
"protected",
"function",
"createCustomDriver",
"(",
"array",
"$",
"config",
")",
"{",
"$",
"factory",
"=",
"is_callable",
"(",
"$",
"via",
"=",
"$",
"config",
"[",
"'via'",
"]",
")",
"?",
"$",
"via",
":",
"$",
"this",
"->",
"app",
"->",
"make",
"(",
... | Create a custom log driver instance.
@param array $config
@return \Psr\Log\LoggerInterface | [
"Create",
"a",
"custom",
"log",
"driver",
"instance",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Log/LogManager.php#L201-L206 |
205,884 | laravel/framework | src/Illuminate/Log/LogManager.php | LogManager.createErrorlogDriver | protected function createErrorlogDriver(array $config)
{
return new Monolog($this->parseChannel($config), [
$this->prepareHandler(new ErrorLogHandler(
$config['type'] ?? ErrorLogHandler::OPERATING_SYSTEM, $this->level($config)
)),
]);
} | php | protected function createErrorlogDriver(array $config)
{
return new Monolog($this->parseChannel($config), [
$this->prepareHandler(new ErrorLogHandler(
$config['type'] ?? ErrorLogHandler::OPERATING_SYSTEM, $this->level($config)
)),
]);
} | [
"protected",
"function",
"createErrorlogDriver",
"(",
"array",
"$",
"config",
")",
"{",
"return",
"new",
"Monolog",
"(",
"$",
"this",
"->",
"parseChannel",
"(",
"$",
"config",
")",
",",
"[",
"$",
"this",
"->",
"prepareHandler",
"(",
"new",
"ErrorLogHandler",... | Create an instance of the "error log" log driver.
@param array $config
@return \Psr\Log\LoggerInterface | [
"Create",
"an",
"instance",
"of",
"the",
"error",
"log",
"log",
"driver",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Log/LogManager.php#L307-L314 |
205,885 | laravel/framework | src/Illuminate/Log/LogManager.php | LogManager.prepareHandlers | protected function prepareHandlers(array $handlers)
{
foreach ($handlers as $key => $handler) {
$handlers[$key] = $this->prepareHandler($handler);
}
return $handlers;
} | php | protected function prepareHandlers(array $handlers)
{
foreach ($handlers as $key => $handler) {
$handlers[$key] = $this->prepareHandler($handler);
}
return $handlers;
} | [
"protected",
"function",
"prepareHandlers",
"(",
"array",
"$",
"handlers",
")",
"{",
"foreach",
"(",
"$",
"handlers",
"as",
"$",
"key",
"=>",
"$",
"handler",
")",
"{",
"$",
"handlers",
"[",
"$",
"key",
"]",
"=",
"$",
"this",
"->",
"prepareHandler",
"("... | Prepare the handlers for usage by Monolog.
@param array $handlers
@return array | [
"Prepare",
"the",
"handlers",
"for",
"usage",
"by",
"Monolog",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Log/LogManager.php#L350-L357 |
205,886 | laravel/framework | src/Illuminate/Log/LogManager.php | LogManager.prepareHandler | protected function prepareHandler(HandlerInterface $handler, array $config = [])
{
if (! isset($config['formatter'])) {
$handler->setFormatter($this->formatter());
} elseif ($config['formatter'] !== 'default') {
$handler->setFormatter($this->app->make($config['formatter'], $c... | php | protected function prepareHandler(HandlerInterface $handler, array $config = [])
{
if (! isset($config['formatter'])) {
$handler->setFormatter($this->formatter());
} elseif ($config['formatter'] !== 'default') {
$handler->setFormatter($this->app->make($config['formatter'], $c... | [
"protected",
"function",
"prepareHandler",
"(",
"HandlerInterface",
"$",
"handler",
",",
"array",
"$",
"config",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"config",
"[",
"'formatter'",
"]",
")",
")",
"{",
"$",
"handler",
"->",
"setFor... | Prepare the handler for usage by Monolog.
@param \Monolog\Handler\HandlerInterface $handler
@param array $config
@return \Monolog\Handler\HandlerInterface | [
"Prepare",
"the",
"handler",
"for",
"usage",
"by",
"Monolog",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Log/LogManager.php#L366-L375 |
205,887 | laravel/framework | src/Illuminate/Cache/TagSet.php | TagSet.resetTag | public function resetTag($name)
{
$this->store->forever($this->tagKey($name), $id = str_replace('.', '', uniqid('', true)));
return $id;
} | php | public function resetTag($name)
{
$this->store->forever($this->tagKey($name), $id = str_replace('.', '', uniqid('', true)));
return $id;
} | [
"public",
"function",
"resetTag",
"(",
"$",
"name",
")",
"{",
"$",
"this",
"->",
"store",
"->",
"forever",
"(",
"$",
"this",
"->",
"tagKey",
"(",
"$",
"name",
")",
",",
"$",
"id",
"=",
"str_replace",
"(",
"'.'",
",",
"''",
",",
"uniqid",
"(",
"''... | Reset the tag and return the new tag identifier.
@param string $name
@return string | [
"Reset",
"the",
"tag",
"and",
"return",
"the",
"new",
"tag",
"identifier",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Cache/TagSet.php#L52-L57 |
205,888 | laravel/framework | src/Illuminate/Cache/TagSet.php | TagSet.tagId | public function tagId($name)
{
return $this->store->get($this->tagKey($name)) ?: $this->resetTag($name);
} | php | public function tagId($name)
{
return $this->store->get($this->tagKey($name)) ?: $this->resetTag($name);
} | [
"public",
"function",
"tagId",
"(",
"$",
"name",
")",
"{",
"return",
"$",
"this",
"->",
"store",
"->",
"get",
"(",
"$",
"this",
"->",
"tagKey",
"(",
"$",
"name",
")",
")",
"?",
":",
"$",
"this",
"->",
"resetTag",
"(",
"$",
"name",
")",
";",
"}"... | Get the unique tag identifier for a given tag.
@param string $name
@return string | [
"Get",
"the",
"unique",
"tag",
"identifier",
"for",
"a",
"given",
"tag",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Cache/TagSet.php#L85-L88 |
205,889 | laravel/framework | src/Illuminate/Config/Repository.php | Repository.getMany | public function getMany($keys)
{
$config = [];
foreach ($keys as $key => $default) {
if (is_numeric($key)) {
[$key, $default] = [$default, null];
}
$config[$key] = Arr::get($this->items, $key, $default);
}
return $config;
} | php | public function getMany($keys)
{
$config = [];
foreach ($keys as $key => $default) {
if (is_numeric($key)) {
[$key, $default] = [$default, null];
}
$config[$key] = Arr::get($this->items, $key, $default);
}
return $config;
} | [
"public",
"function",
"getMany",
"(",
"$",
"keys",
")",
"{",
"$",
"config",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"keys",
"as",
"$",
"key",
"=>",
"$",
"default",
")",
"{",
"if",
"(",
"is_numeric",
"(",
"$",
"key",
")",
")",
"{",
"[",
"$",
... | Get many configuration values.
@param array $keys
@return array | [
"Get",
"many",
"configuration",
"values",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Config/Repository.php#L62-L75 |
205,890 | laravel/framework | src/Illuminate/View/Compilers/Concerns/CompilesJson.php | CompilesJson.compileJson | protected function compileJson($expression)
{
$parts = explode(',', $this->stripParentheses($expression));
$options = isset($parts[1]) ? trim($parts[1]) : $this->encodingOptions;
$depth = isset($parts[2]) ? trim($parts[2]) : 512;
return "<?php echo json_encode($parts[0], $options,... | php | protected function compileJson($expression)
{
$parts = explode(',', $this->stripParentheses($expression));
$options = isset($parts[1]) ? trim($parts[1]) : $this->encodingOptions;
$depth = isset($parts[2]) ? trim($parts[2]) : 512;
return "<?php echo json_encode($parts[0], $options,... | [
"protected",
"function",
"compileJson",
"(",
"$",
"expression",
")",
"{",
"$",
"parts",
"=",
"explode",
"(",
"','",
",",
"$",
"this",
"->",
"stripParentheses",
"(",
"$",
"expression",
")",
")",
";",
"$",
"options",
"=",
"isset",
"(",
"$",
"parts",
"[",... | Compile the JSON statement into valid PHP.
@param string $expression
@return string | [
"Compile",
"the",
"JSON",
"statement",
"into",
"valid",
"PHP",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/View/Compilers/Concerns/CompilesJson.php#L20-L29 |
205,891 | laravel/framework | src/Illuminate/Session/DatabaseSessionHandler.php | DatabaseSessionHandler.addRequestInformation | protected function addRequestInformation(&$payload)
{
if ($this->container->bound('request')) {
$payload = array_merge($payload, [
'ip_address' => $this->ipAddress(),
'user_agent' => $this->userAgent(),
]);
}
return $this;
} | php | protected function addRequestInformation(&$payload)
{
if ($this->container->bound('request')) {
$payload = array_merge($payload, [
'ip_address' => $this->ipAddress(),
'user_agent' => $this->userAgent(),
]);
}
return $this;
} | [
"protected",
"function",
"addRequestInformation",
"(",
"&",
"$",
"payload",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"container",
"->",
"bound",
"(",
"'request'",
")",
")",
"{",
"$",
"payload",
"=",
"array_merge",
"(",
"$",
"payload",
",",
"[",
"'ip_addre... | Add the request information to the session payload.
@param array $payload
@return $this | [
"Add",
"the",
"request",
"information",
"to",
"the",
"session",
"payload",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Session/DatabaseSessionHandler.php#L222-L232 |
205,892 | laravel/framework | src/Illuminate/Database/Eloquent/Relations/Relation.php | Relation.whereInMethod | protected function whereInMethod(Model $model, $key)
{
return $model->getKeyName() === last(explode('.', $key))
&& $model->getIncrementing()
&& in_array($model->getKeyType(), ['int', 'integer'])
? 'whereIntegerInRaw'
: '... | php | protected function whereInMethod(Model $model, $key)
{
return $model->getKeyName() === last(explode('.', $key))
&& $model->getIncrementing()
&& in_array($model->getKeyType(), ['int', 'integer'])
? 'whereIntegerInRaw'
: '... | [
"protected",
"function",
"whereInMethod",
"(",
"Model",
"$",
"model",
",",
"$",
"key",
")",
"{",
"return",
"$",
"model",
"->",
"getKeyName",
"(",
")",
"===",
"last",
"(",
"explode",
"(",
"'.'",
",",
"$",
"key",
")",
")",
"&&",
"$",
"model",
"->",
"... | Get the name of the "where in" method for eager loading.
@param \Illuminate\Database\Eloquent\Model $model
@param string $key
@return string | [
"Get",
"the",
"name",
"of",
"the",
"where",
"in",
"method",
"for",
"eager",
"loading",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Relations/Relation.php#L317-L324 |
205,893 | laravel/framework | src/Illuminate/Database/Eloquent/Relations/Relation.php | Relation.morphMap | public static function morphMap(array $map = null, $merge = true)
{
$map = static::buildMorphMapFromModels($map);
if (is_array($map)) {
static::$morphMap = $merge && static::$morphMap
? $map + static::$morphMap : $map;
}
return static::$morph... | php | public static function morphMap(array $map = null, $merge = true)
{
$map = static::buildMorphMapFromModels($map);
if (is_array($map)) {
static::$morphMap = $merge && static::$morphMap
? $map + static::$morphMap : $map;
}
return static::$morph... | [
"public",
"static",
"function",
"morphMap",
"(",
"array",
"$",
"map",
"=",
"null",
",",
"$",
"merge",
"=",
"true",
")",
"{",
"$",
"map",
"=",
"static",
"::",
"buildMorphMapFromModels",
"(",
"$",
"map",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"map"... | Set or get the morph map for polymorphic relations.
@param array|null $map
@param bool $merge
@return array | [
"Set",
"or",
"get",
"the",
"morph",
"map",
"for",
"polymorphic",
"relations",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Relations/Relation.php#L333-L343 |
205,894 | laravel/framework | src/Illuminate/Database/Schema/Builder.php | Builder.getColumnType | public function getColumnType($table, $column)
{
$table = $this->connection->getTablePrefix().$table;
return $this->connection->getDoctrineColumn($table, $column)->getType()->getName();
} | php | public function getColumnType($table, $column)
{
$table = $this->connection->getTablePrefix().$table;
return $this->connection->getDoctrineColumn($table, $column)->getType()->getName();
} | [
"public",
"function",
"getColumnType",
"(",
"$",
"table",
",",
"$",
"column",
")",
"{",
"$",
"table",
"=",
"$",
"this",
"->",
"connection",
"->",
"getTablePrefix",
"(",
")",
".",
"$",
"table",
";",
"return",
"$",
"this",
"->",
"connection",
"->",
"getD... | Get the data type for the given column name.
@param string $table
@param string $column
@return string | [
"Get",
"the",
"data",
"type",
"for",
"the",
"given",
"column",
"name",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Schema/Builder.php#L120-L125 |
205,895 | laravel/framework | src/Illuminate/Database/Schema/Builder.php | Builder.registerCustomDoctrineType | public function registerCustomDoctrineType($class, $name, $type)
{
if (! $this->connection->isDoctrineAvailable()) {
throw new RuntimeException(
'Registering a custom Doctrine type requires Doctrine DBAL (doctrine/dbal).'
);
}
if (! Type::hasType($nam... | php | public function registerCustomDoctrineType($class, $name, $type)
{
if (! $this->connection->isDoctrineAvailable()) {
throw new RuntimeException(
'Registering a custom Doctrine type requires Doctrine DBAL (doctrine/dbal).'
);
}
if (! Type::hasType($nam... | [
"public",
"function",
"registerCustomDoctrineType",
"(",
"$",
"class",
",",
"$",
"name",
",",
"$",
"type",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"connection",
"->",
"isDoctrineAvailable",
"(",
")",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
... | Register a custom Doctrine mapping type.
@param string $class
@param string $name
@param string $type
@return void
@throws \Doctrine\DBAL\DBALException | [
"Register",
"a",
"custom",
"Doctrine",
"mapping",
"type",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Schema/Builder.php#L299-L315 |
205,896 | laravel/framework | src/Illuminate/Container/RewindableGenerator.php | RewindableGenerator.count | public function count()
{
if (is_callable($count = $this->count)) {
$this->count = $count();
}
return $this->count;
} | php | public function count()
{
if (is_callable($count = $this->count)) {
$this->count = $count();
}
return $this->count;
} | [
"public",
"function",
"count",
"(",
")",
"{",
"if",
"(",
"is_callable",
"(",
"$",
"count",
"=",
"$",
"this",
"->",
"count",
")",
")",
"{",
"$",
"this",
"->",
"count",
"=",
"$",
"count",
"(",
")",
";",
"}",
"return",
"$",
"this",
"->",
"count",
... | Get the total number of tagged services.
@return int | [
"Get",
"the",
"total",
"number",
"of",
"tagged",
"services",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Container/RewindableGenerator.php#L52-L59 |
205,897 | laravel/framework | src/Illuminate/Http/RedirectResponse.php | RedirectResponse.withCookies | public function withCookies(array $cookies)
{
foreach ($cookies as $cookie) {
$this->headers->setCookie($cookie);
}
return $this;
} | php | public function withCookies(array $cookies)
{
foreach ($cookies as $cookie) {
$this->headers->setCookie($cookie);
}
return $this;
} | [
"public",
"function",
"withCookies",
"(",
"array",
"$",
"cookies",
")",
"{",
"foreach",
"(",
"$",
"cookies",
"as",
"$",
"cookie",
")",
"{",
"$",
"this",
"->",
"headers",
"->",
"setCookie",
"(",
"$",
"cookie",
")",
";",
"}",
"return",
"$",
"this",
";"... | Add multiple cookies to the response.
@param array $cookies
@return $this | [
"Add",
"multiple",
"cookies",
"to",
"the",
"response",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Http/RedirectResponse.php#L59-L66 |
205,898 | laravel/framework | src/Illuminate/Console/Command.php | Command.context | protected function context()
{
return collect($this->option())->only([
'ansi',
'no-ansi',
'no-interaction',
'quiet',
'verbose',
])->filter()->mapWithKeys(function ($value, $key) {
return ["--{$key}" => $value];
})->all()... | php | protected function context()
{
return collect($this->option())->only([
'ansi',
'no-ansi',
'no-interaction',
'quiet',
'verbose',
])->filter()->mapWithKeys(function ($value, $key) {
return ["--{$key}" => $value];
})->all()... | [
"protected",
"function",
"context",
"(",
")",
"{",
"return",
"collect",
"(",
"$",
"this",
"->",
"option",
"(",
")",
")",
"->",
"only",
"(",
"[",
"'ansi'",
",",
"'no-ansi'",
",",
"'no-interaction'",
",",
"'quiet'",
",",
"'verbose'",
",",
"]",
")",
"->",... | Get all of the context passed to the command.
@return array | [
"Get",
"all",
"of",
"the",
"context",
"passed",
"to",
"the",
"command",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Console/Command.php#L238-L249 |
205,899 | laravel/framework | src/Illuminate/Console/Command.php | Command.parseVerbosity | protected function parseVerbosity($level = null)
{
if (isset($this->verbosityMap[$level])) {
$level = $this->verbosityMap[$level];
} elseif (! is_int($level)) {
$level = $this->verbosity;
}
return $level;
} | php | protected function parseVerbosity($level = null)
{
if (isset($this->verbosityMap[$level])) {
$level = $this->verbosityMap[$level];
} elseif (! is_int($level)) {
$level = $this->verbosity;
}
return $level;
} | [
"protected",
"function",
"parseVerbosity",
"(",
"$",
"level",
"=",
"null",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"verbosityMap",
"[",
"$",
"level",
"]",
")",
")",
"{",
"$",
"level",
"=",
"$",
"this",
"->",
"verbosityMap",
"[",
"$",
... | Get the verbosity level in terms of Symfony's OutputInterface level.
@param string|int|null $level
@return int | [
"Get",
"the",
"verbosity",
"level",
"in",
"terms",
"of",
"Symfony",
"s",
"OutputInterface",
"level",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Console/Command.php#L553-L562 |
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.