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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
5,800 | sellerlabs/nucleus | src/SellerLabs/Nucleus/Support/Str.php | Str.contains | public static function contains($subject, $inner, $encoding = null)
{
return Rope::of($subject, $encoding)->contains($inner);
} | php | public static function contains($subject, $inner, $encoding = null)
{
return Rope::of($subject, $encoding)->contains($inner);
} | [
"public",
"static",
"function",
"contains",
"(",
"$",
"subject",
",",
"$",
"inner",
",",
"$",
"encoding",
"=",
"null",
")",
"{",
"return",
"Rope",
"::",
"of",
"(",
"$",
"subject",
",",
"$",
"encoding",
")",
"->",
"contains",
"(",
"$",
"inner",
")",
... | Return whether or not the subject contains the inner string.
@param string $subject
@param string $inner
@param null|string $encoding
@return bool | [
"Return",
"whether",
"or",
"not",
"the",
"subject",
"contains",
"the",
"inner",
"string",
"."
] | c05d9c23d424a6bd5ab2e29140805cc6e37e4623 | https://github.com/sellerlabs/nucleus/blob/c05d9c23d424a6bd5ab2e29140805cc6e37e4623/src/SellerLabs/Nucleus/Support/Str.php#L152-L155 |
5,801 | phlexible/phlexible | src/Phlexible/Bundle/MessageBundle/Controller/SubscriptionsController.php | SubscriptionsController.listAction | public function listAction()
{
$subscriptionManager = $this->get('phlexible_message.subscription_manager');
$subscriptions = [];
foreach ($subscriptionManager->findAll() as $subscription) {
$subscriptions[] = [
'id' => $subscription->getId(),
'fi... | php | public function listAction()
{
$subscriptionManager = $this->get('phlexible_message.subscription_manager');
$subscriptions = [];
foreach ($subscriptionManager->findAll() as $subscription) {
$subscriptions[] = [
'id' => $subscription->getId(),
'fi... | [
"public",
"function",
"listAction",
"(",
")",
"{",
"$",
"subscriptionManager",
"=",
"$",
"this",
"->",
"get",
"(",
"'phlexible_message.subscription_manager'",
")",
";",
"$",
"subscriptions",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"subscriptionManager",
"->",
... | List subscriptions.
@return JsonResponse
@Route("", name="messages_subscriptions") | [
"List",
"subscriptions",
"."
] | 132f24924c9bb0dbb6c1ea84db0a463f97fa3893 | https://github.com/phlexible/phlexible/blob/132f24924c9bb0dbb6c1ea84db0a463f97fa3893/src/Phlexible/Bundle/MessageBundle/Controller/SubscriptionsController.php#L34-L50 |
5,802 | phlexible/phlexible | src/Phlexible/Bundle/MessageBundle/Controller/SubscriptionsController.php | SubscriptionsController.createAction | public function createAction(Request $request)
{
$filterId = $request->get('filter');
$handler = $request->get('handler');
$subscriptionManager = $this->get('phlexible_message.subscription_manager');
$filterManager = $this->get('phlexible_message.filter_manager');
$filter =... | php | public function createAction(Request $request)
{
$filterId = $request->get('filter');
$handler = $request->get('handler');
$subscriptionManager = $this->get('phlexible_message.subscription_manager');
$filterManager = $this->get('phlexible_message.filter_manager');
$filter =... | [
"public",
"function",
"createAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"filterId",
"=",
"$",
"request",
"->",
"get",
"(",
"'filter'",
")",
";",
"$",
"handler",
"=",
"$",
"request",
"->",
"get",
"(",
"'handler'",
")",
";",
"$",
"subscripti... | Create subscription.
@param Request $request
@return ResultResponse
@Route("/create", name="messages_subscription_create") | [
"Create",
"subscription",
"."
] | 132f24924c9bb0dbb6c1ea84db0a463f97fa3893 | https://github.com/phlexible/phlexible/blob/132f24924c9bb0dbb6c1ea84db0a463f97fa3893/src/Phlexible/Bundle/MessageBundle/Controller/SubscriptionsController.php#L60-L78 |
5,803 | phlexible/phlexible | src/Phlexible/Bundle/MessageBundle/Controller/SubscriptionsController.php | SubscriptionsController.deleteAction | public function deleteAction($id)
{
$subscriptionManager = $this->get('phlexible_message.subscription_manager');
$subscription = $subscriptionManager->find($id);
$subscriptionManager->deleteSubscription($subscription);
return new ResultResponse(true, 'Subscription deleted.');
} | php | public function deleteAction($id)
{
$subscriptionManager = $this->get('phlexible_message.subscription_manager');
$subscription = $subscriptionManager->find($id);
$subscriptionManager->deleteSubscription($subscription);
return new ResultResponse(true, 'Subscription deleted.');
} | [
"public",
"function",
"deleteAction",
"(",
"$",
"id",
")",
"{",
"$",
"subscriptionManager",
"=",
"$",
"this",
"->",
"get",
"(",
"'phlexible_message.subscription_manager'",
")",
";",
"$",
"subscription",
"=",
"$",
"subscriptionManager",
"->",
"find",
"(",
"$",
... | Delete subscription.
@param string $id
@return ResultResponse
@Route("/delete/{id}", name="messages_subscription_delete") | [
"Delete",
"subscription",
"."
] | 132f24924c9bb0dbb6c1ea84db0a463f97fa3893 | https://github.com/phlexible/phlexible/blob/132f24924c9bb0dbb6c1ea84db0a463f97fa3893/src/Phlexible/Bundle/MessageBundle/Controller/SubscriptionsController.php#L88-L96 |
5,804 | gossi/trixionary | src/model/Base/StructureNodeParentQuery.php | StructureNodeParentQuery.filterByStructureNodeId | public function filterByStructureNodeId($structureNodeId = null, $comparison = null)
{
if (is_array($structureNodeId)) {
$useMinMax = false;
if (isset($structureNodeId['min'])) {
$this->addUsingAlias(StructureNodeParentTableMap::COL_STRUCTURE_NODE_ID, $structureNodeId... | php | public function filterByStructureNodeId($structureNodeId = null, $comparison = null)
{
if (is_array($structureNodeId)) {
$useMinMax = false;
if (isset($structureNodeId['min'])) {
$this->addUsingAlias(StructureNodeParentTableMap::COL_STRUCTURE_NODE_ID, $structureNodeId... | [
"public",
"function",
"filterByStructureNodeId",
"(",
"$",
"structureNodeId",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"structureNodeId",
")",
")",
"{",
"$",
"useMinMax",
"=",
"false",
";",
"if",
"(",
"... | Filter the query on the structure_node_id column
Example usage:
<code>
$query->filterByStructureNodeId(1234); // WHERE structure_node_id = 1234
$query->filterByStructureNodeId(array(12, 34)); // WHERE structure_node_id IN (12, 34)
$query->filterByStructureNodeId(array('min' => 12)); // WHERE structure_node_id > 12
</c... | [
"Filter",
"the",
"query",
"on",
"the",
"structure_node_id",
"column"
] | 221a6c5322473d7d7f8e322958a3ee46d87da150 | https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/model/Base/StructureNodeParentQuery.php#L272-L293 |
5,805 | gossi/trixionary | src/model/Base/StructureNodeParentQuery.php | StructureNodeParentQuery.filterByParentId | public function filterByParentId($parentId = null, $comparison = null)
{
if (is_array($parentId)) {
$useMinMax = false;
if (isset($parentId['min'])) {
$this->addUsingAlias(StructureNodeParentTableMap::COL_PARENT_ID, $parentId['min'], Criteria::GREATER_EQUAL);
... | php | public function filterByParentId($parentId = null, $comparison = null)
{
if (is_array($parentId)) {
$useMinMax = false;
if (isset($parentId['min'])) {
$this->addUsingAlias(StructureNodeParentTableMap::COL_PARENT_ID, $parentId['min'], Criteria::GREATER_EQUAL);
... | [
"public",
"function",
"filterByParentId",
"(",
"$",
"parentId",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"parentId",
")",
")",
"{",
"$",
"useMinMax",
"=",
"false",
";",
"if",
"(",
"isset",
"(",
"$",... | Filter the query on the parent_id column
Example usage:
<code>
$query->filterByParentId(1234); // WHERE parent_id = 1234
$query->filterByParentId(array(12, 34)); // WHERE parent_id IN (12, 34)
$query->filterByParentId(array('min' => 12)); // WHERE parent_id > 12
</code>
@see filterByStructureNodeRelatedByParent... | [
"Filter",
"the",
"query",
"on",
"the",
"parent_id",
"column"
] | 221a6c5322473d7d7f8e322958a3ee46d87da150 | https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/model/Base/StructureNodeParentQuery.php#L315-L336 |
5,806 | gossi/trixionary | src/model/Base/StructureNodeParentQuery.php | StructureNodeParentQuery.useStructureNodeRelatedByStructureNodeIdQuery | public function useStructureNodeRelatedByStructureNodeIdQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinStructureNodeRelatedByStructureNodeId($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'StructureNodeRelatedByStructureNo... | php | public function useStructureNodeRelatedByStructureNodeIdQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinStructureNodeRelatedByStructureNodeId($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'StructureNodeRelatedByStructureNo... | [
"public",
"function",
"useStructureNodeRelatedByStructureNodeIdQuery",
"(",
"$",
"relationAlias",
"=",
"null",
",",
"$",
"joinType",
"=",
"Criteria",
"::",
"INNER_JOIN",
")",
"{",
"return",
"$",
"this",
"->",
"joinStructureNodeRelatedByStructureNodeId",
"(",
"$",
"rel... | Use the StructureNodeRelatedByStructureNodeId relation StructureNode object
@see useQuery()
@param string $relationAlias optional alias for the relation,
to be used as main alias in the secondary query
@param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
@return \gossi\tr... | [
"Use",
"the",
"StructureNodeRelatedByStructureNodeId",
"relation",
"StructureNode",
"object"
] | 221a6c5322473d7d7f8e322958a3ee46d87da150 | https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/model/Base/StructureNodeParentQuery.php#L408-L413 |
5,807 | gossi/trixionary | src/model/Base/StructureNodeParentQuery.php | StructureNodeParentQuery.useStructureNodeRelatedByParentIdQuery | public function useStructureNodeRelatedByParentIdQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinStructureNodeRelatedByParentId($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'StructureNodeRelatedByParentId', '\gossi\trixio... | php | public function useStructureNodeRelatedByParentIdQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinStructureNodeRelatedByParentId($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'StructureNodeRelatedByParentId', '\gossi\trixio... | [
"public",
"function",
"useStructureNodeRelatedByParentIdQuery",
"(",
"$",
"relationAlias",
"=",
"null",
",",
"$",
"joinType",
"=",
"Criteria",
"::",
"INNER_JOIN",
")",
"{",
"return",
"$",
"this",
"->",
"joinStructureNodeRelatedByParentId",
"(",
"$",
"relationAlias",
... | Use the StructureNodeRelatedByParentId relation StructureNode object
@see useQuery()
@param string $relationAlias optional alias for the relation,
to be used as main alias in the secondary query
@param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
@return \gossi\trixionar... | [
"Use",
"the",
"StructureNodeRelatedByParentId",
"relation",
"StructureNode",
"object"
] | 221a6c5322473d7d7f8e322958a3ee46d87da150 | https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/model/Base/StructureNodeParentQuery.php#L485-L490 |
5,808 | franckysolo/octopush-sdk | src/Octopush/Message.php | Message.setParams | public function setParams(array $params = [])
{
if (empty($params) || count($params) < 4) {
throw new \InvalidArgumentException(
'Missing required params for Octopush message'
);
}
foreach ($params as $key => $param) {
if (!in_array($key, array_... | php | public function setParams(array $params = [])
{
if (empty($params) || count($params) < 4) {
throw new \InvalidArgumentException(
'Missing required params for Octopush message'
);
}
foreach ($params as $key => $param) {
if (!in_array($key, array_... | [
"public",
"function",
"setParams",
"(",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"params",
")",
"||",
"count",
"(",
"$",
"params",
")",
"<",
"4",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
... | Set the parameters message
@param array $params The parameters message required and optionnals
@return \Octopush\Message
@throws \InvalidArgumentException | [
"Set",
"the",
"parameters",
"message"
] | 3797e53d51474a64b65fbf437e5dd46e288f2ef8 | https://github.com/franckysolo/octopush-sdk/blob/3797e53d51474a64b65fbf437e5dd46e288f2ef8/src/Octopush/Message.php#L154-L191 |
5,809 | franckysolo/octopush-sdk | src/Octopush/Message.php | Message.encrypt | public function encrypt(array $params = [])
{
$requestString = '';
$requestKey = $this->params['request_keys'];
for ($i = 0, $n = strlen($requestKey); $i < $n; ++$i) {
$char = $requestKey[$i];
if (!isset($this->encryptData[$char])
|| !isset($params[$this... | php | public function encrypt(array $params = [])
{
$requestString = '';
$requestKey = $this->params['request_keys'];
for ($i = 0, $n = strlen($requestKey); $i < $n; ++$i) {
$char = $requestKey[$i];
if (!isset($this->encryptData[$char])
|| !isset($params[$this... | [
"public",
"function",
"encrypt",
"(",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"requestString",
"=",
"''",
";",
"$",
"requestKey",
"=",
"$",
"this",
"->",
"params",
"[",
"'request_keys'",
"]",
";",
"for",
"(",
"$",
"i",
"=",
"0",
",",
... | Encoding request_sha1 Optionnel
Cette valeur contient le sha1 de la concaténation des valeurs des champs
choisis dans la variable request_keys et concaténés dans le même
ordre que les clés.
@param array $params the params
@return string the encrypt string code | [
"Encoding",
"request_sha1",
"Optionnel"
] | 3797e53d51474a64b65fbf437e5dd46e288f2ef8 | https://github.com/franckysolo/octopush-sdk/blob/3797e53d51474a64b65fbf437e5dd46e288f2ef8/src/Octopush/Message.php#L214-L228 |
5,810 | franckysolo/octopush-sdk | src/Octopush/Message.php | Message.setRequestMode | public function setRequestMode($mode)
{
if (!in_array($mode, ['real', 'simu'])) {
$message = sprintf(
'The request mode %s is not supported, real or simu expected!',
$mode
);
throw new \InvalidArgumentException($message, 500);
}
... | php | public function setRequestMode($mode)
{
if (!in_array($mode, ['real', 'simu'])) {
$message = sprintf(
'The request mode %s is not supported, real or simu expected!',
$mode
);
throw new \InvalidArgumentException($message, 500);
}
... | [
"public",
"function",
"setRequestMode",
"(",
"$",
"mode",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"mode",
",",
"[",
"'real'",
",",
"'simu'",
"]",
")",
")",
"{",
"$",
"message",
"=",
"sprintf",
"(",
"'The request mode %s is not supported, real or simu... | The request_mode param Optionnel
Allows you to choose simulation mode with the value 'simu'. * Default: real
Permet de choisir le mode simulation avec la valeur 'simu'. * défaut : real
@param string $mode
@return \Octopush\Message | [
"The",
"request_mode",
"param",
"Optionnel"
] | 3797e53d51474a64b65fbf437e5dd46e288f2ef8 | https://github.com/franckysolo/octopush-sdk/blob/3797e53d51474a64b65fbf437e5dd46e288f2ef8/src/Octopush/Message.php#L334-L345 |
5,811 | fortrabbit/datafilter | src/DataFilter/Rule.php | Rule.parseDefinition | protected function parseDefinition($definition = null)
{
if (is_null($definition)) {
if (!is_null($this->definition)) {
throw new \InvalidArgumentException(
'Cannot parse rule definitions for rule "'. $this->name. '", attrib "'
. $this->att... | php | protected function parseDefinition($definition = null)
{
if (is_null($definition)) {
if (!is_null($this->definition)) {
throw new \InvalidArgumentException(
'Cannot parse rule definitions for rule "'. $this->name. '", attrib "'
. $this->att... | [
"protected",
"function",
"parseDefinition",
"(",
"$",
"definition",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"definition",
")",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
"->",
"definition",
")",
")",
"{",
"throw",
"new",
"\... | The long description
@param mixed $definition The rule definition
@throws \InvalidArgumentException | [
"The",
"long",
"description"
] | fca1c2cbd299f3762b251134d8a62038fb7defe3 | https://github.com/fortrabbit/datafilter/blob/fca1c2cbd299f3762b251134d8a62038fb7defe3/src/DataFilter/Rule.php#L118-L187 |
5,812 | fortrabbit/datafilter | src/DataFilter/Rule.php | Rule.getError | public function getError(\DataFilter\Attribute $attrib = null)
{
if ($this->error === false) {
return null;
}
if (!$attrib) {
$attrib = $this->attrib;
}
$formatData = array('rule' => $this->name);
if ($attrib) {
$formatData['attrib'... | php | public function getError(\DataFilter\Attribute $attrib = null)
{
if ($this->error === false) {
return null;
}
if (!$attrib) {
$attrib = $this->attrib;
}
$formatData = array('rule' => $this->name);
if ($attrib) {
$formatData['attrib'... | [
"public",
"function",
"getError",
"(",
"\\",
"DataFilter",
"\\",
"Attribute",
"$",
"attrib",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"error",
"===",
"false",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"!",
"$",
"attrib",
")",
"{"... | Returns error string or null
@return string | [
"Returns",
"error",
"string",
"or",
"null"
] | fca1c2cbd299f3762b251134d8a62038fb7defe3 | https://github.com/fortrabbit/datafilter/blob/fca1c2cbd299f3762b251134d8a62038fb7defe3/src/DataFilter/Rule.php#L235-L255 |
5,813 | hediet/php-type-reflection | src/Hediet/Types/ArrayType.php | ArrayType.isAssignableFrom | public function isAssignableFrom(Type $type)
{
if (!$type instanceof ArrayType)
return false;
if (!$type->itemType->equals($this->itemType))
return false;
if (!$type->keyType->equals($this->keyType))
return false;
return true;
} | php | public function isAssignableFrom(Type $type)
{
if (!$type instanceof ArrayType)
return false;
if (!$type->itemType->equals($this->itemType))
return false;
if (!$type->keyType->equals($this->keyType))
return false;
return true;
} | [
"public",
"function",
"isAssignableFrom",
"(",
"Type",
"$",
"type",
")",
"{",
"if",
"(",
"!",
"$",
"type",
"instanceof",
"ArrayType",
")",
"return",
"false",
";",
"if",
"(",
"!",
"$",
"type",
"->",
"itemType",
"->",
"equals",
"(",
"$",
"this",
"->",
... | Checks whether the provided type represents
an array whose key and value type are equal to the key and value type of this instance.
@param Type $type The provided type.
@return boolean | [
"Checks",
"whether",
"the",
"provided",
"type",
"represents",
"an",
"array",
"whose",
"key",
"and",
"value",
"type",
"are",
"equal",
"to",
"the",
"key",
"and",
"value",
"type",
"of",
"this",
"instance",
"."
] | 4a049c0e35f35cf95769f3823c915a3c41d6a292 | https://github.com/hediet/php-type-reflection/blob/4a049c0e35f35cf95769f3823c915a3c41d6a292/src/Hediet/Types/ArrayType.php#L61-L71 |
5,814 | hediet/php-type-reflection | src/Hediet/Types/ArrayType.php | ArrayType.isAssignableFromValue | public function isAssignableFromValue($value)
{
if (!is_array($value))
return false;
foreach ($value as $key => $item)
{
if (!$this->itemType->isAssignableFromValue($item))
return false;
if (!$this->keyType->isAssignableFromValue($key))
... | php | public function isAssignableFromValue($value)
{
if (!is_array($value))
return false;
foreach ($value as $key => $item)
{
if (!$this->itemType->isAssignableFromValue($item))
return false;
if (!$this->keyType->isAssignableFromValue($key))
... | [
"public",
"function",
"isAssignableFromValue",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"value",
")",
")",
"return",
"false",
";",
"foreach",
"(",
"$",
"value",
"as",
"$",
"key",
"=>",
"$",
"item",
")",
"{",
"if",
"(",
"!"... | Checks whether the provided value is an array and all keys and values
are assignable to the key and value type of this instance.
@param mixed $value The provided value.
@return boolean | [
"Checks",
"whether",
"the",
"provided",
"value",
"is",
"an",
"array",
"and",
"all",
"keys",
"and",
"values",
"are",
"assignable",
"to",
"the",
"key",
"and",
"value",
"type",
"of",
"this",
"instance",
"."
] | 4a049c0e35f35cf95769f3823c915a3c41d6a292 | https://github.com/hediet/php-type-reflection/blob/4a049c0e35f35cf95769f3823c915a3c41d6a292/src/Hediet/Types/ArrayType.php#L80-L92 |
5,815 | phlexible/phlexible | src/Phlexible/Bundle/GuiBundle/Controller/StatusController.php | StatusController.indexAction | public function indexAction()
{
$output = '';
$output .= '<a href="'.$this->generateUrl('gui_status_listeners').'">listeners</a><br/>';
$output .= '<a href="'.$this->generateUrl('gui_status_php').'">php</a><br/>';
$output .= '<a href="'.$this->generateUrl('gui_status_load').'">load</... | php | public function indexAction()
{
$output = '';
$output .= '<a href="'.$this->generateUrl('gui_status_listeners').'">listeners</a><br/>';
$output .= '<a href="'.$this->generateUrl('gui_status_php').'">php</a><br/>';
$output .= '<a href="'.$this->generateUrl('gui_status_load').'">load</... | [
"public",
"function",
"indexAction",
"(",
")",
"{",
"$",
"output",
"=",
"''",
";",
"$",
"output",
".=",
"'<a href=\"'",
".",
"$",
"this",
"->",
"generateUrl",
"(",
"'gui_status_listeners'",
")",
".",
"'\">listeners</a><br/>'",
";",
"$",
"output",
".=",
"'<a ... | List status actions.
@return Response
@Route("", name="gui_status") | [
"List",
"status",
"actions",
"."
] | 132f24924c9bb0dbb6c1ea84db0a463f97fa3893 | https://github.com/phlexible/phlexible/blob/132f24924c9bb0dbb6c1ea84db0a463f97fa3893/src/Phlexible/Bundle/GuiBundle/Controller/StatusController.php#L35-L43 |
5,816 | phlexible/phlexible | src/Phlexible/Bundle/GuiBundle/Controller/StatusController.php | StatusController.listenersAction | public function listenersAction()
{
$dispatcher = $this->get('event_dispatcher');
$listenerNames = array_keys($dispatcher->getListeners());
sort($listenerNames);
$output = '<pre>';
$output .= str_repeat('=', 3).str_pad(' Events / Listeners ', 80, '=').PHP_EOL.PHP_EOL;
... | php | public function listenersAction()
{
$dispatcher = $this->get('event_dispatcher');
$listenerNames = array_keys($dispatcher->getListeners());
sort($listenerNames);
$output = '<pre>';
$output .= str_repeat('=', 3).str_pad(' Events / Listeners ', 80, '=').PHP_EOL.PHP_EOL;
... | [
"public",
"function",
"listenersAction",
"(",
")",
"{",
"$",
"dispatcher",
"=",
"$",
"this",
"->",
"get",
"(",
"'event_dispatcher'",
")",
";",
"$",
"listenerNames",
"=",
"array_keys",
"(",
"$",
"dispatcher",
"->",
"getListeners",
"(",
")",
")",
";",
"sort"... | Show events.
@return Response
@Route("/listeners", name="gui_status_listeners") | [
"Show",
"events",
"."
] | 132f24924c9bb0dbb6c1ea84db0a463f97fa3893 | https://github.com/phlexible/phlexible/blob/132f24924c9bb0dbb6c1ea84db0a463f97fa3893/src/Phlexible/Bundle/GuiBundle/Controller/StatusController.php#L51-L89 |
5,817 | harvestcloud/CoreBundle | Entity/Profile.php | Profile.addBuyerHubRefAsBuyer | public function addBuyerHubRefAsBuyer(BuyerHubRef $buyerHubRef)
{
if (!count($this->buyerHubRefsAsBuyer))
{
$buyerHubRef->setIsDefault(true);
}
$this->buyerHubRefsAsBuyer[] = $buyerHubRef;
$buyerHubRef->setBuyer($this);
} | php | public function addBuyerHubRefAsBuyer(BuyerHubRef $buyerHubRef)
{
if (!count($this->buyerHubRefsAsBuyer))
{
$buyerHubRef->setIsDefault(true);
}
$this->buyerHubRefsAsBuyer[] = $buyerHubRef;
$buyerHubRef->setBuyer($this);
} | [
"public",
"function",
"addBuyerHubRefAsBuyer",
"(",
"BuyerHubRef",
"$",
"buyerHubRef",
")",
"{",
"if",
"(",
"!",
"count",
"(",
"$",
"this",
"->",
"buyerHubRefsAsBuyer",
")",
")",
"{",
"$",
"buyerHubRef",
"->",
"setIsDefault",
"(",
"true",
")",
";",
"}",
"$... | Add BuyerHubRef as Buyer
@author Tom Haskins-Vaughan <tom@harvestcloud.com>
@since 2012-04-26
@param BuyerHubRef $buyerHubRef | [
"Add",
"BuyerHubRef",
"as",
"Buyer"
] | f33e079c4a6191cf674aa2678f2fb2e6f0dd89cc | https://github.com/harvestcloud/CoreBundle/blob/f33e079c4a6191cf674aa2678f2fb2e6f0dd89cc/Entity/Profile.php#L812-L821 |
5,818 | harvestcloud/CoreBundle | Entity/Profile.php | Profile.addSellerHubRefAsSeller | public function addSellerHubRefAsSeller(SellerHubRef $sellerHubRef)
{
if (!count($this->sellerHubRefsAsSeller))
{
$sellerHubRef->setIsDefault(true);
}
$this->sellerHubRefsAsSeller[] = $sellerHubRef;
$sellerHubRef->setSeller($this);
} | php | public function addSellerHubRefAsSeller(SellerHubRef $sellerHubRef)
{
if (!count($this->sellerHubRefsAsSeller))
{
$sellerHubRef->setIsDefault(true);
}
$this->sellerHubRefsAsSeller[] = $sellerHubRef;
$sellerHubRef->setSeller($this);
} | [
"public",
"function",
"addSellerHubRefAsSeller",
"(",
"SellerHubRef",
"$",
"sellerHubRef",
")",
"{",
"if",
"(",
"!",
"count",
"(",
"$",
"this",
"->",
"sellerHubRefsAsSeller",
")",
")",
"{",
"$",
"sellerHubRef",
"->",
"setIsDefault",
"(",
"true",
")",
";",
"}... | Add SellerHubRef as Seller
@author Tom Haskins-Vaughan <tom@harvestcloud.com>
@since 2012-04-26
@param SellerHubRef $sellerHubRef | [
"Add",
"SellerHubRef",
"as",
"Seller"
] | f33e079c4a6191cf674aa2678f2fb2e6f0dd89cc | https://github.com/harvestcloud/CoreBundle/blob/f33e079c4a6191cf674aa2678f2fb2e6f0dd89cc/Entity/Profile.php#L879-L888 |
5,819 | harvestcloud/CoreBundle | Entity/Profile.php | Profile.getAccountByCode | public function getAccountByCode($type_code)
{
switch ($type_code)
{
case Account::TYPE_ACCOUNTS_RECEIVABLE:
case Account::TYPE_ACCOUNTS_PAYABLE:
case Account::TYPE_SALES:
case Account::TYPE_BANK:
foreach ($this->getAccounts() as $acco... | php | public function getAccountByCode($type_code)
{
switch ($type_code)
{
case Account::TYPE_ACCOUNTS_RECEIVABLE:
case Account::TYPE_ACCOUNTS_PAYABLE:
case Account::TYPE_SALES:
case Account::TYPE_BANK:
foreach ($this->getAccounts() as $acco... | [
"public",
"function",
"getAccountByCode",
"(",
"$",
"type_code",
")",
"{",
"switch",
"(",
"$",
"type_code",
")",
"{",
"case",
"Account",
"::",
"TYPE_ACCOUNTS_RECEIVABLE",
":",
"case",
"Account",
"::",
"TYPE_ACCOUNTS_PAYABLE",
":",
"case",
"Account",
"::",
"TYPE_... | Get Profile's account by code
e.g. AP => Accounts Payable
@author Tom Haskins-Vaughan <tom@harvestcloud.com>
@since 2012-05-21
@param string $type_code
@return \HarvestCloud\CoreBundle\Entity\Account | [
"Get",
"Profile",
"s",
"account",
"by",
"code"
] | f33e079c4a6191cf674aa2678f2fb2e6f0dd89cc | https://github.com/harvestcloud/CoreBundle/blob/f33e079c4a6191cf674aa2678f2fb2e6f0dd89cc/Entity/Profile.php#L1232-L1263 |
5,820 | SocietyCMS/User | Entities/Entrust/EloquentUser.php | EloquentUser.can | public function can($permission, $requireAll = false)
{
if ($this->cachedRoles()->where('name', 'admin')->count()) {
return true;
}
return $this->entrustCan($permission, $requireAll = false);
} | php | public function can($permission, $requireAll = false)
{
if ($this->cachedRoles()->where('name', 'admin')->count()) {
return true;
}
return $this->entrustCan($permission, $requireAll = false);
} | [
"public",
"function",
"can",
"(",
"$",
"permission",
",",
"$",
"requireAll",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"cachedRoles",
"(",
")",
"->",
"where",
"(",
"'name'",
",",
"'admin'",
")",
"->",
"count",
"(",
")",
")",
"{",
"retur... | Check if user has a permission by its name.
return rearly if the user is in the admin group.
@param string|array $permission Permission string or array of permissions.
@param bool $requireAll All permissions in the array are required.
@return bool | [
"Check",
"if",
"user",
"has",
"a",
"permission",
"by",
"its",
"name",
".",
"return",
"rearly",
"if",
"the",
"user",
"is",
"in",
"the",
"admin",
"group",
"."
] | 76f7b52b27e8a9740f8d5a9c3b86181e1c231634 | https://github.com/SocietyCMS/User/blob/76f7b52b27e8a9740f8d5a9c3b86181e1c231634/Entities/Entrust/EloquentUser.php#L135-L142 |
5,821 | park-manager/security | Token/SplitToken.php | SplitToken.fromString | final public static function fromString(string $token): self
{
if (Binary::safeStrlen($token) < self::TOKEN_CHAR_LENGTH) {
// Don't zero memory as the value is invalid.
throw new \RuntimeException('Invalid token provided.');
}
$instance = new static();
$insta... | php | final public static function fromString(string $token): self
{
if (Binary::safeStrlen($token) < self::TOKEN_CHAR_LENGTH) {
// Don't zero memory as the value is invalid.
throw new \RuntimeException('Invalid token provided.');
}
$instance = new static();
$insta... | [
"final",
"public",
"static",
"function",
"fromString",
"(",
"string",
"$",
"token",
")",
":",
"self",
"{",
"if",
"(",
"Binary",
"::",
"safeStrlen",
"(",
"$",
"token",
")",
"<",
"self",
"::",
"TOKEN_CHAR_LENGTH",
")",
"{",
"// Don't zero memory as the value is ... | Recreates a SplitToken object from a string.
Note: The $token is zeroed from memory when valid.
@param string $token
@return static | [
"Recreates",
"a",
"SplitToken",
"object",
"from",
"a",
"string",
"."
] | 14faa70daa7559a2ccbd256f7168ab782463feab | https://github.com/park-manager/security/blob/14faa70daa7559a2ccbd256f7168ab782463feab/Token/SplitToken.php#L157-L175 |
5,822 | park-manager/security | Token/SplitToken.php | SplitToken.toValueHolder | public function toValueHolder(array $metadata = []): SplitTokenValueHolder
{
if (null === $this->verifierHash) {
throw new \RuntimeException('toValueHolder() does not work SplitToken object created with fromString().');
}
return new SplitTokenValueHolder($this->selector, $this->... | php | public function toValueHolder(array $metadata = []): SplitTokenValueHolder
{
if (null === $this->verifierHash) {
throw new \RuntimeException('toValueHolder() does not work SplitToken object created with fromString().');
}
return new SplitTokenValueHolder($this->selector, $this->... | [
"public",
"function",
"toValueHolder",
"(",
"array",
"$",
"metadata",
"=",
"[",
"]",
")",
":",
"SplitTokenValueHolder",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"verifierHash",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'toValueHolder... | Produce a new SplitTokenValue instance.
Note: This method doesn't work when reconstructed from a string.
@param array $metadata
@return SplitTokenValueHolder | [
"Produce",
"a",
"new",
"SplitTokenValue",
"instance",
"."
] | 14faa70daa7559a2ccbd256f7168ab782463feab | https://github.com/park-manager/security/blob/14faa70daa7559a2ccbd256f7168ab782463feab/Token/SplitToken.php#L226-L233 |
5,823 | fkooman/php-lib-rest | src/fkooman/Rest/Route.php | Route.findAvailableParameterValue | private function findAvailableParameterValue(ReflectionParameter $p, array $availableParameters)
{
// determine the name, in case of a class this is the type hint, in
// case of a non-class parameter it is the actual name
$isClass = null !== $p->getClass();
if ($isClass) {
... | php | private function findAvailableParameterValue(ReflectionParameter $p, array $availableParameters)
{
// determine the name, in case of a class this is the type hint, in
// case of a non-class parameter it is the actual name
$isClass = null !== $p->getClass();
if ($isClass) {
... | [
"private",
"function",
"findAvailableParameterValue",
"(",
"ReflectionParameter",
"$",
"p",
",",
"array",
"$",
"availableParameters",
")",
"{",
"// determine the name, in case of a class this is the type hint, in",
"// case of a non-class parameter it is the actual name",
"$",
"isCla... | Find the parameter required by the callback.
@param ReflectionParameter $p a parameter belonging to the callback
@param array $availableParameters contains a list of parameters available to the callback, where the
key contains either the type hinted name of the class, or the
name of the... | [
"Find",
"the",
"parameter",
"required",
"by",
"the",
"callback",
"."
] | 27bfd12e267b2ce866c2855c8a094db9682906af | https://github.com/fkooman/php-lib-rest/blob/27bfd12e267b2ce866c2855c8a094db9682906af/src/fkooman/Rest/Route.php#L108-L133 |
5,824 | ddehart/dilmun | src/Anshar/Http/UriParts/Port.php | Port.isValid | public static function isValid($port)
{
$port_valid = false;
if (is_int($port)) {
$port_valid = self::portIsInValidRange($port);
} elseif (is_null($port)) {
$port_valid = true;
}
return $port_valid;
} | php | public static function isValid($port)
{
$port_valid = false;
if (is_int($port)) {
$port_valid = self::portIsInValidRange($port);
} elseif (is_null($port)) {
$port_valid = true;
}
return $port_valid;
} | [
"public",
"static",
"function",
"isValid",
"(",
"$",
"port",
")",
"{",
"$",
"port_valid",
"=",
"false",
";",
"if",
"(",
"is_int",
"(",
"$",
"port",
")",
")",
"{",
"$",
"port_valid",
"=",
"self",
"::",
"portIsInValidRange",
"(",
"$",
"port",
")",
";",... | Validates a given port. A port is valid if it is either null or an integer between 1 and 65535 inclusive.
@param mixed $port The port to be validated
@return bool Returns true if the given port is valid
Returns false otherwise | [
"Validates",
"a",
"given",
"port",
".",
"A",
"port",
"is",
"valid",
"if",
"it",
"is",
"either",
"null",
"or",
"an",
"integer",
"between",
"1",
"and",
"65535",
"inclusive",
"."
] | e2a294dbcd4c6754063c247be64930c5ee91378f | https://github.com/ddehart/dilmun/blob/e2a294dbcd4c6754063c247be64930c5ee91378f/src/Anshar/Http/UriParts/Port.php#L82-L93 |
5,825 | ddehart/dilmun | src/Anshar/Http/UriParts/Port.php | Port.toUriString | public function toUriString(Scheme $scheme = null)
{
$normalized_port = $this->normalizePortAgainstScheme($scheme);
$uri_string = (string) $normalized_port;
if (!is_null($normalized_port)) {
$uri_string = ":" . $uri_string;
}
return $uri_string;
} | php | public function toUriString(Scheme $scheme = null)
{
$normalized_port = $this->normalizePortAgainstScheme($scheme);
$uri_string = (string) $normalized_port;
if (!is_null($normalized_port)) {
$uri_string = ":" . $uri_string;
}
return $uri_string;
} | [
"public",
"function",
"toUriString",
"(",
"Scheme",
"$",
"scheme",
"=",
"null",
")",
"{",
"$",
"normalized_port",
"=",
"$",
"this",
"->",
"normalizePortAgainstScheme",
"(",
"$",
"scheme",
")",
";",
"$",
"uri_string",
"=",
"(",
"string",
")",
"$",
"normaliz... | Returns a string representation of the port formatted so that it can be compiled into a complete URI string
per the Uri object's string specification.
If the port is empty, toUriString returns an empty string; if the port is not empty, toUriString returns the
port prefixed with a colon.
toUriString will also check th... | [
"Returns",
"a",
"string",
"representation",
"of",
"the",
"port",
"formatted",
"so",
"that",
"it",
"can",
"be",
"compiled",
"into",
"a",
"complete",
"URI",
"string",
"per",
"the",
"Uri",
"object",
"s",
"string",
"specification",
"."
] | e2a294dbcd4c6754063c247be64930c5ee91378f | https://github.com/ddehart/dilmun/blob/e2a294dbcd4c6754063c247be64930c5ee91378f/src/Anshar/Http/UriParts/Port.php#L111-L122 |
5,826 | ddehart/dilmun | src/Anshar/Http/UriParts/Port.php | Port.normalizePortAgainstScheme | public function normalizePortAgainstScheme(Scheme $scheme = null)
{
$scheme_port_array = new ArrayHelper($this->scheme_ports);
$scheme_string = (string) $scheme;
$standard_port = $scheme_port_array->valueLookup($scheme_string);
if ($this->port == $standard_port) {
$... | php | public function normalizePortAgainstScheme(Scheme $scheme = null)
{
$scheme_port_array = new ArrayHelper($this->scheme_ports);
$scheme_string = (string) $scheme;
$standard_port = $scheme_port_array->valueLookup($scheme_string);
if ($this->port == $standard_port) {
$... | [
"public",
"function",
"normalizePortAgainstScheme",
"(",
"Scheme",
"$",
"scheme",
"=",
"null",
")",
"{",
"$",
"scheme_port_array",
"=",
"new",
"ArrayHelper",
"(",
"$",
"this",
"->",
"scheme_ports",
")",
";",
"$",
"scheme_string",
"=",
"(",
"string",
")",
"$"... | Normalizes the port against a given scheme so that the scheme is reported as null if the port is standard for the
scheme.
For example, given a http scheme and a port of 80, the normalized port will be reported as null; given a https
scheme and a port of 80, the normalized port will be reported as 80.
@see Port::toUri... | [
"Normalizes",
"the",
"port",
"against",
"a",
"given",
"scheme",
"so",
"that",
"the",
"scheme",
"is",
"reported",
"as",
"null",
"if",
"the",
"port",
"is",
"standard",
"for",
"the",
"scheme",
"."
] | e2a294dbcd4c6754063c247be64930c5ee91378f | https://github.com/ddehart/dilmun/blob/e2a294dbcd4c6754063c247be64930c5ee91378f/src/Anshar/Http/UriParts/Port.php#L137-L151 |
5,827 | SocietyCMS/Menu | Repositories/Menu/MenuRepository.php | MenuRepository.menu | public function menu($name)
{
if (array_key_exists($name, $this->menus)) {
return $this->menus[$name];
}
return $this->menus[$name] = new MenuBuilder($name, $this->config);
} | php | public function menu($name)
{
if (array_key_exists($name, $this->menus)) {
return $this->menus[$name];
}
return $this->menus[$name] = new MenuBuilder($name, $this->config);
} | [
"public",
"function",
"menu",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"menus",
")",
")",
"{",
"return",
"$",
"this",
"->",
"menus",
"[",
"$",
"name",
"]",
";",
"}",
"return",
"$",
"this... | Create MenuItem for specified menu.
@param $name
@return MenuItem | [
"Create",
"MenuItem",
"for",
"specified",
"menu",
"."
] | 417468edaa2be0051ae041ee614ab609f0ac8b49 | https://github.com/SocietyCMS/Menu/blob/417468edaa2be0051ae041ee614ab609f0ac8b49/Repositories/Menu/MenuRepository.php#L40-L47 |
5,828 | SocietyCMS/Menu | Repositories/Menu/MenuRepository.php | MenuRepository.getItemUuiD | public function getItemUuiD($menuItem)
{
$itemID = '';
if (is_a($menuItem, MenuItem::class)) {
$itemID = 'MenuItem'.$menuItem->getURL();
}
if (is_a($menuItem, MenuBuilder::class)) {
$itemID = 'MenuBuilder'.$menuItem->getName();
}
return Str::... | php | public function getItemUuiD($menuItem)
{
$itemID = '';
if (is_a($menuItem, MenuItem::class)) {
$itemID = 'MenuItem'.$menuItem->getURL();
}
if (is_a($menuItem, MenuBuilder::class)) {
$itemID = 'MenuBuilder'.$menuItem->getName();
}
return Str::... | [
"public",
"function",
"getItemUuiD",
"(",
"$",
"menuItem",
")",
"{",
"$",
"itemID",
"=",
"''",
";",
"if",
"(",
"is_a",
"(",
"$",
"menuItem",
",",
"MenuItem",
"::",
"class",
")",
")",
"{",
"$",
"itemID",
"=",
"'MenuItem'",
".",
"$",
"menuItem",
"->",
... | Generate Item uuid.
@param $menuName
@param $itemURL
@return string | [
"Generate",
"Item",
"uuid",
"."
] | 417468edaa2be0051ae041ee614ab609f0ac8b49 | https://github.com/SocietyCMS/Menu/blob/417468edaa2be0051ae041ee614ab609f0ac8b49/Repositories/Menu/MenuRepository.php#L77-L89 |
5,829 | DripsPHP/DataStructures | src/DataCollection.php | DataCollection.delete | public function delete($key)
{
if ($this->has($key)) {
unset($this->collection[$key]);
return true;
}
return false;
} | php | public function delete($key)
{
if ($this->has($key)) {
unset($this->collection[$key]);
return true;
}
return false;
} | [
"public",
"function",
"delete",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"has",
"(",
"$",
"key",
")",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"collection",
"[",
"$",
"key",
"]",
")",
";",
"return",
"true",
";",
"}",
"return",... | Entfernt ein Element aus der Collection.
@param $key
@return bool | [
"Entfernt",
"ein",
"Element",
"aus",
"der",
"Collection",
"."
] | 1daa5a654afe63f7bafa7c5104288d293e2e5aa0 | https://github.com/DripsPHP/DataStructures/blob/1daa5a654afe63f7bafa7c5104288d293e2e5aa0/src/DataCollection.php#L88-L95 |
5,830 | jumilla/laravel-source-generator | sources/OneFileGeneratorCommand.php | OneFileGeneratorCommand.generate | protected function generate(FileGenerator $generator)
{
$fqcn = $this->convertToFullQualifyClassName($this->getNameInput());
$path = $this->getRelativePath($fqcn).'.php';
if ($generator->exists($path)) {
$this->error($this->type.' already exists!');
return false;
... | php | protected function generate(FileGenerator $generator)
{
$fqcn = $this->convertToFullQualifyClassName($this->getNameInput());
$path = $this->getRelativePath($fqcn).'.php';
if ($generator->exists($path)) {
$this->error($this->type.' already exists!');
return false;
... | [
"protected",
"function",
"generate",
"(",
"FileGenerator",
"$",
"generator",
")",
"{",
"$",
"fqcn",
"=",
"$",
"this",
"->",
"convertToFullQualifyClassName",
"(",
"$",
"this",
"->",
"getNameInput",
"(",
")",
")",
";",
"$",
"path",
"=",
"$",
"this",
"->",
... | Generate files.
@return bool | [
"Generate",
"files",
"."
] | cb4757f636d68643a8ba2644527ffb9f6390750e | https://github.com/jumilla/laravel-source-generator/blob/cb4757f636d68643a8ba2644527ffb9f6390750e/sources/OneFileGeneratorCommand.php#L14-L27 |
5,831 | onesimus-systems/oslogger | src/ErrorHandler.php | ErrorHandler.PHPErrorHandler | public function PHPErrorHandler($error_level, $error_message, $error_file, $error_line, $error_context)
{
$message = $error_message . ' | File: {file} | Ln: {line}';
$context = array(
'file' => $error_file,
'line' => $error_line
);
switch ($error_level) {
... | php | public function PHPErrorHandler($error_level, $error_message, $error_file, $error_line, $error_context)
{
$message = $error_message . ' | File: {file} | Ln: {line}';
$context = array(
'file' => $error_file,
'line' => $error_line
);
switch ($error_level) {
... | [
"public",
"function",
"PHPErrorHandler",
"(",
"$",
"error_level",
",",
"$",
"error_message",
",",
"$",
"error_file",
",",
"$",
"error_line",
",",
"$",
"error_context",
")",
"{",
"$",
"message",
"=",
"$",
"error_message",
".",
"' | File: {file} | Ln: {line}'",
";... | Logger provided error handler | [
"Logger",
"provided",
"error",
"handler"
] | 98138d4fbcae83b9cedac13ab173a3f8273de3e0 | https://github.com/onesimus-systems/oslogger/blob/98138d4fbcae83b9cedac13ab173a3f8273de3e0/src/ErrorHandler.php#L56-L87 |
5,832 | onesimus-systems/oslogger | src/ErrorHandler.php | ErrorHandler.PHPShutdownHandler | public function PHPShutdownHandler()
{
session_write_close();
if ($lasterror = error_get_last()) {
$message = $lasterror['message'] . ' | File: {file} | Ln: {line}';
$context = array(
'file' => $lasterror['file'],
'line' => $lasterror['line']
... | php | public function PHPShutdownHandler()
{
session_write_close();
if ($lasterror = error_get_last()) {
$message = $lasterror['message'] . ' | File: {file} | Ln: {line}';
$context = array(
'file' => $lasterror['file'],
'line' => $lasterror['line']
... | [
"public",
"function",
"PHPShutdownHandler",
"(",
")",
"{",
"session_write_close",
"(",
")",
";",
"if",
"(",
"$",
"lasterror",
"=",
"error_get_last",
"(",
")",
")",
"{",
"$",
"message",
"=",
"$",
"lasterror",
"[",
"'message'",
"]",
".",
"' | File: {file} | Ln... | Logger provided shutdown handler | [
"Logger",
"provided",
"shutdown",
"handler"
] | 98138d4fbcae83b9cedac13ab173a3f8273de3e0 | https://github.com/onesimus-systems/oslogger/blob/98138d4fbcae83b9cedac13ab173a3f8273de3e0/src/ErrorHandler.php#L92-L103 |
5,833 | onesimus-systems/oslogger | src/ErrorHandler.php | ErrorHandler.PHPExceptionHandler | public function PHPExceptionHandler($exception)
{
session_write_close();
$message = $exception->getMessage() . ' | File: {file} | Ln: {line} | ST: {stacktrace}';
$context = array(
'file' => $exception->getFile(),
'line' => $exception->getLine(),
'stacktrac... | php | public function PHPExceptionHandler($exception)
{
session_write_close();
$message = $exception->getMessage() . ' | File: {file} | Ln: {line} | ST: {stacktrace}';
$context = array(
'file' => $exception->getFile(),
'line' => $exception->getLine(),
'stacktrac... | [
"public",
"function",
"PHPExceptionHandler",
"(",
"$",
"exception",
")",
"{",
"session_write_close",
"(",
")",
";",
"$",
"message",
"=",
"$",
"exception",
"->",
"getMessage",
"(",
")",
".",
"' | File: {file} | Ln: {line} | ST: {stacktrace}'",
";",
"$",
"context",
... | Logger provided uncaught Exception handler | [
"Logger",
"provided",
"uncaught",
"Exception",
"handler"
] | 98138d4fbcae83b9cedac13ab173a3f8273de3e0 | https://github.com/onesimus-systems/oslogger/blob/98138d4fbcae83b9cedac13ab173a3f8273de3e0/src/ErrorHandler.php#L108-L118 |
5,834 | strident/Trident | src/Trident/Module/FrameworkModule/Console/Command/AssetsInstallCommand.php | AssetsInstallCommand.installAssets | private function installAssets(\TridentKernel $kernel, $name, $from, OutputInterface $output)
{
$output->write(sprintf('Installing assets for "%s"', $name));
$filesystem = new FileSystem();
if ( ! $filesystem->exists($from)) {
// If there were no assets to install
$... | php | private function installAssets(\TridentKernel $kernel, $name, $from, OutputInterface $output)
{
$output->write(sprintf('Installing assets for "%s"', $name));
$filesystem = new FileSystem();
if ( ! $filesystem->exists($from)) {
// If there were no assets to install
$... | [
"private",
"function",
"installAssets",
"(",
"\\",
"TridentKernel",
"$",
"kernel",
",",
"$",
"name",
",",
"$",
"from",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"output",
"->",
"write",
"(",
"sprintf",
"(",
"'Installing assets for \"%s\"'",
",",
... | Install assets from on directory to another.
@param \TridentKernel $kernel
@param string $name
@param string $from
@param OutputInterface $output | [
"Install",
"assets",
"from",
"on",
"directory",
"to",
"another",
"."
] | a112f0b75601b897c470a49d85791dc386c29952 | https://github.com/strident/Trident/blob/a112f0b75601b897c470a49d85791dc386c29952/src/Trident/Module/FrameworkModule/Console/Command/AssetsInstallCommand.php#L83-L104 |
5,835 | strident/Trident | src/Trident/Module/FrameworkModule/Console/Command/AssetsInstallCommand.php | AssetsInstallCommand.flushAssets | private function flushAssets(\TridentKernel $kernel, OutputInterface $output)
{
$filesystem = new FileSystem();
$output->write('Clearing existing assets');
try {
if ($filesystem->exists($kernel->getAssetDir())) {
$filesystem->remove($kernel->getAssetDir());
... | php | private function flushAssets(\TridentKernel $kernel, OutputInterface $output)
{
$filesystem = new FileSystem();
$output->write('Clearing existing assets');
try {
if ($filesystem->exists($kernel->getAssetDir())) {
$filesystem->remove($kernel->getAssetDir());
... | [
"private",
"function",
"flushAssets",
"(",
"\\",
"TridentKernel",
"$",
"kernel",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"filesystem",
"=",
"new",
"FileSystem",
"(",
")",
";",
"$",
"output",
"->",
"write",
"(",
"'Clearing existing assets'",
")",
... | Flush all existing assets
@param TridentKernel $kernel
@param OutputInterface $output
@return boolean | [
"Flush",
"all",
"existing",
"assets"
] | a112f0b75601b897c470a49d85791dc386c29952 | https://github.com/strident/Trident/blob/a112f0b75601b897c470a49d85791dc386c29952/src/Trident/Module/FrameworkModule/Console/Command/AssetsInstallCommand.php#L114-L135 |
5,836 | joomla-framework/mediawiki-api | src/Users.php | Users.login | public function login($lgname, $lgpassword, $lgdomain = null)
{
// Build the request path.
$path = '?action=login&lgname=' . $lgname . '&lgpassword=' . $lgpassword;
if (isset($lgdomain))
{
$path .= '&lgdomain=' . $lgdomain;
}
// Send the request.
$response = $this->client->post($this->fetchUrl($path... | php | public function login($lgname, $lgpassword, $lgdomain = null)
{
// Build the request path.
$path = '?action=login&lgname=' . $lgname . '&lgpassword=' . $lgpassword;
if (isset($lgdomain))
{
$path .= '&lgdomain=' . $lgdomain;
}
// Send the request.
$response = $this->client->post($this->fetchUrl($path... | [
"public",
"function",
"login",
"(",
"$",
"lgname",
",",
"$",
"lgpassword",
",",
"$",
"lgdomain",
"=",
"null",
")",
"{",
"// Build the request path.",
"$",
"path",
"=",
"'?action=login&lgname='",
".",
"$",
"lgname",
".",
"'&lgpassword='",
".",
"$",
"lgpassword"... | Method to login and get authentication tokens.
@param string $lgname User Name.
@param string $lgpassword Password.
@param string $lgdomain Domain (optional).
@return object
@since 1.0 | [
"Method",
"to",
"login",
"and",
"get",
"authentication",
"tokens",
"."
] | 8855d51b61d5518bd92a0806fbd3098f4e063619 | https://github.com/joomla-framework/mediawiki-api/blob/8855d51b61d5518bd92a0806fbd3098f4e063619/src/Users.php#L29-L68 |
5,837 | joomla-framework/mediawiki-api | src/Users.php | Users.logout | public function logout()
{
// Build the request path.
$path = '?action=login';
// @todo clear internal data as well
// Send the request.
$response = $this->client->get($this->fetchUrl($path));
return $this->validateResponse($response);
} | php | public function logout()
{
// Build the request path.
$path = '?action=login';
// @todo clear internal data as well
// Send the request.
$response = $this->client->get($this->fetchUrl($path));
return $this->validateResponse($response);
} | [
"public",
"function",
"logout",
"(",
")",
"{",
"// Build the request path.",
"$",
"path",
"=",
"'?action=login'",
";",
"// @todo clear internal data as well",
"// Send the request.",
"$",
"response",
"=",
"$",
"this",
"->",
"client",
"->",
"get",
"(",
"$",
"this",
... | Method to logout and clear session data.
@return object
@since 1.0 | [
"Method",
"to",
"logout",
"and",
"clear",
"session",
"data",
"."
] | 8855d51b61d5518bd92a0806fbd3098f4e063619 | https://github.com/joomla-framework/mediawiki-api/blob/8855d51b61d5518bd92a0806fbd3098f4e063619/src/Users.php#L77-L88 |
5,838 | joomla-framework/mediawiki-api | src/Users.php | Users.getUserInfo | public function getUserInfo(array $ususers, array $usprop = null)
{
// Build the request path.
$path = '?action=query&list=users';
// Append users to the request.
$path .= '&ususers=' . $this->buildParameter($ususers);
if (isset($usprop))
{
$path .= '&usprop' . $this->buildParameter($usprop);
}
/... | php | public function getUserInfo(array $ususers, array $usprop = null)
{
// Build the request path.
$path = '?action=query&list=users';
// Append users to the request.
$path .= '&ususers=' . $this->buildParameter($ususers);
if (isset($usprop))
{
$path .= '&usprop' . $this->buildParameter($usprop);
}
/... | [
"public",
"function",
"getUserInfo",
"(",
"array",
"$",
"ususers",
",",
"array",
"$",
"usprop",
"=",
"null",
")",
"{",
"// Build the request path.",
"$",
"path",
"=",
"'?action=query&list=users'",
";",
"// Append users to the request.",
"$",
"path",
".=",
"'&ususers... | Method to get user information.
@param array $ususers A list of users to obtain the same information for.
@param array $usprop What pieces of information to include.
@return object
@since 1.0 | [
"Method",
"to",
"get",
"user",
"information",
"."
] | 8855d51b61d5518bd92a0806fbd3098f4e063619 | https://github.com/joomla-framework/mediawiki-api/blob/8855d51b61d5518bd92a0806fbd3098f4e063619/src/Users.php#L100-L117 |
5,839 | joomla-framework/mediawiki-api | src/Users.php | Users.getCurrentUserInfo | public function getCurrentUserInfo(array $uiprop = null)
{
// Build the request path.
$path = '?action=query&meta=userinfo';
if (isset($uiprop))
{
$path .= '&uiprop' . $this->buildParameter($uiprop);
}
// Send the request.
$response = $this->client->get($this->fetchUrl($path));
return $this->vali... | php | public function getCurrentUserInfo(array $uiprop = null)
{
// Build the request path.
$path = '?action=query&meta=userinfo';
if (isset($uiprop))
{
$path .= '&uiprop' . $this->buildParameter($uiprop);
}
// Send the request.
$response = $this->client->get($this->fetchUrl($path));
return $this->vali... | [
"public",
"function",
"getCurrentUserInfo",
"(",
"array",
"$",
"uiprop",
"=",
"null",
")",
"{",
"// Build the request path.",
"$",
"path",
"=",
"'?action=query&meta=userinfo'",
";",
"if",
"(",
"isset",
"(",
"$",
"uiprop",
")",
")",
"{",
"$",
"path",
".=",
"'... | Method to get current user information.
@param array $uiprop What pieces of information to include.
@return object
@since 1.0 | [
"Method",
"to",
"get",
"current",
"user",
"information",
"."
] | 8855d51b61d5518bd92a0806fbd3098f4e063619 | https://github.com/joomla-framework/mediawiki-api/blob/8855d51b61d5518bd92a0806fbd3098f4e063619/src/Users.php#L128-L142 |
5,840 | joomla-framework/mediawiki-api | src/Users.php | Users.getUserContribs | public function getUserContribs($ucuser = null, $ucuserprefix = null, $uclimit = null, $ucstart = null, $ucend = null, $uccontinue = null,
$ucdir = null, array $ucnamespace = null, array $ucprop = null, array $ucshow = null, $uctag = null, $uctoponly = null
)
{
// Build the request path.
$path = '?action=query&... | php | public function getUserContribs($ucuser = null, $ucuserprefix = null, $uclimit = null, $ucstart = null, $ucend = null, $uccontinue = null,
$ucdir = null, array $ucnamespace = null, array $ucprop = null, array $ucshow = null, $uctag = null, $uctoponly = null
)
{
// Build the request path.
$path = '?action=query&... | [
"public",
"function",
"getUserContribs",
"(",
"$",
"ucuser",
"=",
"null",
",",
"$",
"ucuserprefix",
"=",
"null",
",",
"$",
"uclimit",
"=",
"null",
",",
"$",
"ucstart",
"=",
"null",
",",
"$",
"ucend",
"=",
"null",
",",
"$",
"uccontinue",
"=",
"null",
... | Method to get user contributions.
@param string $ucuser The users to retrieve contributions for.
@param string $ucuserprefix Retrieve contibutions for all users whose names begin with this value.
@param integer $uclimit The users to retrieve contributions for.
@param string $ucstart ... | [
"Method",
"to",
"get",
"user",
"contributions",
"."
] | 8855d51b61d5518bd92a0806fbd3098f4e063619 | https://github.com/joomla-framework/mediawiki-api/blob/8855d51b61d5518bd92a0806fbd3098f4e063619/src/Users.php#L164-L235 |
5,841 | joomla-framework/mediawiki-api | src/Users.php | Users.blockUser | public function blockUser($user, $expiry = null, $reason = null, $anononly = null, $nocreate = null, $autoblock = null, $noemail = null,
$hidename = null, $allowusertalk = null, $reblock = null, $watchuser = null
)
{
// Get the token.
$token = $this->getToken($user, 'block');
// Build the request path.
$pa... | php | public function blockUser($user, $expiry = null, $reason = null, $anononly = null, $nocreate = null, $autoblock = null, $noemail = null,
$hidename = null, $allowusertalk = null, $reblock = null, $watchuser = null
)
{
// Get the token.
$token = $this->getToken($user, 'block');
// Build the request path.
$pa... | [
"public",
"function",
"blockUser",
"(",
"$",
"user",
",",
"$",
"expiry",
"=",
"null",
",",
"$",
"reason",
"=",
"null",
",",
"$",
"anononly",
"=",
"null",
",",
"$",
"nocreate",
"=",
"null",
",",
"$",
"autoblock",
"=",
"null",
",",
"$",
"noemail",
"=... | Method to block a user.
@param string $user Username, IP address or IP range you want to block.
@param string $expiry Relative expiry time, Default: never.
@param string $reason Reason for block (optional).
@param boolean $anononly Block anonymous users only.
@param boo... | [
"Method",
"to",
"block",
"a",
"user",
"."
] | 8855d51b61d5518bd92a0806fbd3098f4e063619 | https://github.com/joomla-framework/mediawiki-api/blob/8855d51b61d5518bd92a0806fbd3098f4e063619/src/Users.php#L256-L286 |
5,842 | joomla-framework/mediawiki-api | src/Users.php | Users.assignGroup | public function assignGroup($username, $add = null, $remove = null, $reason = null)
{
// Get the token.
$token = $this->getToken($username, 'unblock');
// Build the request path.
$path = '?action=userrights';
// Build the request data.
$data = array(
'username' => $username,
'token' => $token,
... | php | public function assignGroup($username, $add = null, $remove = null, $reason = null)
{
// Get the token.
$token = $this->getToken($username, 'unblock');
// Build the request path.
$path = '?action=userrights';
// Build the request data.
$data = array(
'username' => $username,
'token' => $token,
... | [
"public",
"function",
"assignGroup",
"(",
"$",
"username",
",",
"$",
"add",
"=",
"null",
",",
"$",
"remove",
"=",
"null",
",",
"$",
"reason",
"=",
"null",
")",
"{",
"// Get the token.",
"$",
"token",
"=",
"$",
"this",
"->",
"getToken",
"(",
"$",
"use... | Method to assign a user to a group.
@param string $username User name.
@param array $add Add the user to these groups.
@param array $remove Remove the user from these groups.
@param string $reason Reason for the change.
@return object
@since 1.0 | [
"Method",
"to",
"assign",
"a",
"user",
"to",
"a",
"group",
"."
] | 8855d51b61d5518bd92a0806fbd3098f4e063619 | https://github.com/joomla-framework/mediawiki-api/blob/8855d51b61d5518bd92a0806fbd3098f4e063619/src/Users.php#L363-L384 |
5,843 | joomla-framework/mediawiki-api | src/Users.php | Users.emailUser | public function emailUser($target, $subject = null, $text = null, $ccme = null)
{
// Get the token.
$token = $this->getToken($target, 'emailuser');
// Build the request path.
$path = '?action=emailuser';
// Build the request data.
$data = array(
'target' => $target,
'token' => $token,
'subjec... | php | public function emailUser($target, $subject = null, $text = null, $ccme = null)
{
// Get the token.
$token = $this->getToken($target, 'emailuser');
// Build the request path.
$path = '?action=emailuser';
// Build the request data.
$data = array(
'target' => $target,
'token' => $token,
'subjec... | [
"public",
"function",
"emailUser",
"(",
"$",
"target",
",",
"$",
"subject",
"=",
"null",
",",
"$",
"text",
"=",
"null",
",",
"$",
"ccme",
"=",
"null",
")",
"{",
"// Get the token.",
"$",
"token",
"=",
"$",
"this",
"->",
"getToken",
"(",
"$",
"target"... | Method to email a user.
@param string $target User to send email to.
@param string $subject Subject header.
@param string $text Mail body.
@param boolean $ccme Send a copy of this mail to me.
@return object
@since 1.0 | [
"Method",
"to",
"email",
"a",
"user",
"."
] | 8855d51b61d5518bd92a0806fbd3098f4e063619 | https://github.com/joomla-framework/mediawiki-api/blob/8855d51b61d5518bd92a0806fbd3098f4e063619/src/Users.php#L398-L419 |
5,844 | nourdine/regular | src/regular/Match.php | Match.getCaptured | public function getCaptured($i) {
if ($this->success) {
if ($i >= 0) {
$i++; // Captured groups starts from index 1. Index 0 is the whole match!
if (array_key_exists($i, $this->matches)) {
return new Group($this->matches[$i]);
} else {
t... | php | public function getCaptured($i) {
if ($this->success) {
if ($i >= 0) {
$i++; // Captured groups starts from index 1. Index 0 is the whole match!
if (array_key_exists($i, $this->matches)) {
return new Group($this->matches[$i]);
} else {
t... | [
"public",
"function",
"getCaptured",
"(",
"$",
"i",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"success",
")",
"{",
"if",
"(",
"$",
"i",
">=",
"0",
")",
"{",
"$",
"i",
"++",
";",
"// Captured groups starts from index 1. Index 0 is the whole match! ",
"if",
"... | Return a captured group.
@param integer $i Index of the wanted captured subgroup
@return Group
@throws RuntimeException | [
"Return",
"a",
"captured",
"group",
"."
] | 4bf599fb8dceb7ce259f1f5b0003f5f550e2e3f3 | https://github.com/nourdine/regular/blob/4bf599fb8dceb7ce259f1f5b0003f5f550e2e3f3/src/regular/Match.php#L61-L76 |
5,845 | bishopb/vanilla | applications/dashboard/models/class.exportmodel.php | ExportModel.BeginExport | public function BeginExport($Path, $Source = '') {
$this->BeginTime = microtime(TRUE);
$TimeStart = list($sm, $ss) = explode(' ', microtime());
if($this->UseCompression && function_exists('gzopen'))
$fp = gzopen($Path, 'wb');
else
$fp = fopen($Path, 'wb');
$this->_File = $fp;
fwrite($f... | php | public function BeginExport($Path, $Source = '') {
$this->BeginTime = microtime(TRUE);
$TimeStart = list($sm, $ss) = explode(' ', microtime());
if($this->UseCompression && function_exists('gzopen'))
$fp = gzopen($Path, 'wb');
else
$fp = fopen($Path, 'wb');
$this->_File = $fp;
fwrite($f... | [
"public",
"function",
"BeginExport",
"(",
"$",
"Path",
",",
"$",
"Source",
"=",
"''",
")",
"{",
"$",
"this",
"->",
"BeginTime",
"=",
"microtime",
"(",
"TRUE",
")",
";",
"$",
"TimeStart",
"=",
"list",
"(",
"$",
"sm",
",",
"$",
"ss",
")",
"=",
"exp... | Create the export file and begin the export.
@param string $Path The path to the export file.
@param string $Source The source program that created the export. This may be used by the import routine to do additional processing. | [
"Create",
"the",
"export",
"file",
"and",
"begin",
"the",
"export",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/dashboard/models/class.exportmodel.php#L28-L43 |
5,846 | bishopb/vanilla | applications/dashboard/models/class.exportmodel.php | ExportModel.Comment | public function Comment($Message, $Echo = TRUE) {
fwrite($this->_File, self::COMMENT.' '.str_replace(self::NEWLINE, self::NEWLINE.self::COMMENT.' ', $Message).self::NEWLINE);
if($Echo)
echo $Message, "\n";
} | php | public function Comment($Message, $Echo = TRUE) {
fwrite($this->_File, self::COMMENT.' '.str_replace(self::NEWLINE, self::NEWLINE.self::COMMENT.' ', $Message).self::NEWLINE);
if($Echo)
echo $Message, "\n";
} | [
"public",
"function",
"Comment",
"(",
"$",
"Message",
",",
"$",
"Echo",
"=",
"TRUE",
")",
"{",
"fwrite",
"(",
"$",
"this",
"->",
"_File",
",",
"self",
"::",
"COMMENT",
".",
"' '",
".",
"str_replace",
"(",
"self",
"::",
"NEWLINE",
",",
"self",
"::",
... | Write a comment to the export file.
@param string $Message The message to write.
@param bool $Echo Whether or not to echo the message in addition to writing it to the file. | [
"Write",
"a",
"comment",
"to",
"the",
"export",
"file",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/dashboard/models/class.exportmodel.php#L50-L54 |
5,847 | bishopb/vanilla | applications/dashboard/models/class.exportmodel.php | ExportModel.PDO | public function PDO($DsnOrPDO = NULL, $Username = NULL, $Password = NULL) {
if(!is_null($DsnOrPDO)) {
if($DsnOrPDO instanceof PDO)
$this->_PDO = $DsnOrPDO;
else {
$this->_PDO = new PDO($DsnOrPDO, $Username, $Password);
if(strncasecmp($DsnOrPDO, 'mysql', 5) == 0)
$this->_PDO->exec('set na... | php | public function PDO($DsnOrPDO = NULL, $Username = NULL, $Password = NULL) {
if(!is_null($DsnOrPDO)) {
if($DsnOrPDO instanceof PDO)
$this->_PDO = $DsnOrPDO;
else {
$this->_PDO = new PDO($DsnOrPDO, $Username, $Password);
if(strncasecmp($DsnOrPDO, 'mysql', 5) == 0)
$this->_PDO->exec('set na... | [
"public",
"function",
"PDO",
"(",
"$",
"DsnOrPDO",
"=",
"NULL",
",",
"$",
"Username",
"=",
"NULL",
",",
"$",
"Password",
"=",
"NULL",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"DsnOrPDO",
")",
")",
"{",
"if",
"(",
"$",
"DsnOrPDO",
"instanceof"... | Gets or sets the PDO connection to the database.
@param mixed $DsnOrPDO One of the following:
- <b>String</b>: The dsn to the database.
- <b>PDO</b>: An existing connection to the database.
- <b>Null</b>: The PDO connection will not be set.
@param string $Username The username for the database if a dsn is specified.
@p... | [
"Gets",
"or",
"sets",
"the",
"PDO",
"connection",
"to",
"the",
"database",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/dashboard/models/class.exportmodel.php#L86-L97 |
5,848 | matryoshka-model/mongo-wrapper | library/Criteria/Isolated/DocumentStore.php | DocumentStore.has | public function has(MongoCollection $dataGateway, $id)
{
$id = (string) $id;
if (!$this->splObjectStorage->contains($dataGateway)) {
return false;
}
if (isset($this->splObjectStorage[$dataGateway][$id])) {
return true;
}
return false;
} | php | public function has(MongoCollection $dataGateway, $id)
{
$id = (string) $id;
if (!$this->splObjectStorage->contains($dataGateway)) {
return false;
}
if (isset($this->splObjectStorage[$dataGateway][$id])) {
return true;
}
return false;
} | [
"public",
"function",
"has",
"(",
"MongoCollection",
"$",
"dataGateway",
",",
"$",
"id",
")",
"{",
"$",
"id",
"=",
"(",
"string",
")",
"$",
"id",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"splObjectStorage",
"->",
"contains",
"(",
"$",
"dataGateway",
"... | Check whether the given data gateway exists in the current store
@param MongoCollection $dataGateway
@param $id
@return bool | [
"Check",
"whether",
"the",
"given",
"data",
"gateway",
"exists",
"in",
"the",
"current",
"store"
] | d69511d7f7fc58e708c771ea0cd3c8ba7e8a155a | https://github.com/matryoshka-model/mongo-wrapper/blob/d69511d7f7fc58e708c771ea0cd3c8ba7e8a155a/library/Criteria/Isolated/DocumentStore.php#L109-L122 |
5,849 | matryoshka-model/mongo-wrapper | library/Criteria/Isolated/DocumentStore.php | DocumentStore.get | public function get(MongoCollection $dataGateway, $id)
{
$id = (string) $id;
if ($this->has($dataGateway, $id)) {
return $this->splObjectStorage[$dataGateway][$id];
}
} | php | public function get(MongoCollection $dataGateway, $id)
{
$id = (string) $id;
if ($this->has($dataGateway, $id)) {
return $this->splObjectStorage[$dataGateway][$id];
}
} | [
"public",
"function",
"get",
"(",
"MongoCollection",
"$",
"dataGateway",
",",
"$",
"id",
")",
"{",
"$",
"id",
"=",
"(",
"string",
")",
"$",
"id",
";",
"if",
"(",
"$",
"this",
"->",
"has",
"(",
"$",
"dataGateway",
",",
"$",
"id",
")",
")",
"{",
... | Retrieve the given data gateway from the store
@param MongoCollection $dataGateway
@param $id
@return mixed|null | [
"Retrieve",
"the",
"given",
"data",
"gateway",
"from",
"the",
"store"
] | d69511d7f7fc58e708c771ea0cd3c8ba7e8a155a | https://github.com/matryoshka-model/mongo-wrapper/blob/d69511d7f7fc58e708c771ea0cd3c8ba7e8a155a/library/Criteria/Isolated/DocumentStore.php#L131-L138 |
5,850 | awjudd/l4-revisable | src/Awjudd/Revisable/Revisable.php | Revisable.getRevisionNumber | public function getRevisionNumber($revisionNumber, $columnList = array('*'))
{
$query = $this->deriveRevisions();
if($revisionNumber > 1)
{
// Skip ahead to where we need to be
$query->skip($revisionNumber - 1)->take(1);
}
return $query->get($columnL... | php | public function getRevisionNumber($revisionNumber, $columnList = array('*'))
{
$query = $this->deriveRevisions();
if($revisionNumber > 1)
{
// Skip ahead to where we need to be
$query->skip($revisionNumber - 1)->take(1);
}
return $query->get($columnL... | [
"public",
"function",
"getRevisionNumber",
"(",
"$",
"revisionNumber",
",",
"$",
"columnList",
"=",
"array",
"(",
"'*'",
")",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"deriveRevisions",
"(",
")",
";",
"if",
"(",
"$",
"revisionNumber",
">",
"1",
... | Gets a single revision from the list.
@param int $revisionNumber The revision number to retrieve
@param array $columnList The list of columns to retrieve
@return array | [
"Gets",
"a",
"single",
"revision",
"from",
"the",
"list",
"."
] | 15954fa1d4bf97453514f4be1f56382ba40279fc | https://github.com/awjudd/l4-revisable/blob/15954fa1d4bf97453514f4be1f56382ba40279fc/src/Awjudd/Revisable/Revisable.php#L121-L132 |
5,851 | awjudd/l4-revisable | src/Awjudd/Revisable/Revisable.php | Revisable.removeExpired | public static function removeExpired(array $where = array())
{
// Check if we either have no revisions enabled, or it is set to infinite
if(static::$revisionCount <= 0)
{
// Remove nothing
return TRUE;
}
// Otherwise look for the expired revisions
... | php | public static function removeExpired(array $where = array())
{
// Check if we either have no revisions enabled, or it is set to infinite
if(static::$revisionCount <= 0)
{
// Remove nothing
return TRUE;
}
// Otherwise look for the expired revisions
... | [
"public",
"static",
"function",
"removeExpired",
"(",
"array",
"$",
"where",
"=",
"array",
"(",
")",
")",
"{",
"// Check if we either have no revisions enabled, or it is set to infinite",
"if",
"(",
"static",
"::",
"$",
"revisionCount",
"<=",
"0",
")",
"{",
"// Remo... | Used in order to get rid of any expired revisions.
@param array $where Any filters to apply to the filters
@return boolean | [
"Used",
"in",
"order",
"to",
"get",
"rid",
"of",
"any",
"expired",
"revisions",
"."
] | 15954fa1d4bf97453514f4be1f56382ba40279fc | https://github.com/awjudd/l4-revisable/blob/15954fa1d4bf97453514f4be1f56382ba40279fc/src/Awjudd/Revisable/Revisable.php#L248-L365 |
5,852 | awjudd/l4-revisable | src/Awjudd/Revisable/Revisable.php | Revisable.deriveRevisions | private function deriveRevisions()
{
$query = NULL;
// There are, so look for any revisions
if($this->hasAlternateRevisionTable())
{
$query = \DB::table(static::$revisionTable);
}
else
{
// Only grab the instances that were trashed
... | php | private function deriveRevisions()
{
$query = NULL;
// There are, so look for any revisions
if($this->hasAlternateRevisionTable())
{
$query = \DB::table(static::$revisionTable);
}
else
{
// Only grab the instances that were trashed
... | [
"private",
"function",
"deriveRevisions",
"(",
")",
"{",
"$",
"query",
"=",
"NULL",
";",
"// There are, so look for any revisions",
"if",
"(",
"$",
"this",
"->",
"hasAlternateRevisionTable",
"(",
")",
")",
"{",
"$",
"query",
"=",
"\\",
"DB",
"::",
"table",
"... | Used in order to derive the actual query that is used to grab the revisions.
@return Illuminate\Database\Query\Builder | [
"Used",
"in",
"order",
"to",
"derive",
"the",
"actual",
"query",
"that",
"is",
"used",
"to",
"grab",
"the",
"revisions",
"."
] | 15954fa1d4bf97453514f4be1f56382ba40279fc | https://github.com/awjudd/l4-revisable/blob/15954fa1d4bf97453514f4be1f56382ba40279fc/src/Awjudd/Revisable/Revisable.php#L372-L403 |
5,853 | coolms/common | src/Stdlib/ArrayUtils.php | ArrayUtils.filterRecursive | public static function filterRecursive(array $array, $callback = null, $removeEmptyArrays = false)
{
if (null !== $callback && !is_callable($callback)) {
throw new Exception\InvalidArgumentException(sprintf(
'Second parameter of %s must be callable',
__METHOD__
... | php | public static function filterRecursive(array $array, $callback = null, $removeEmptyArrays = false)
{
if (null !== $callback && !is_callable($callback)) {
throw new Exception\InvalidArgumentException(sprintf(
'Second parameter of %s must be callable',
__METHOD__
... | [
"public",
"static",
"function",
"filterRecursive",
"(",
"array",
"$",
"array",
",",
"$",
"callback",
"=",
"null",
",",
"$",
"removeEmptyArrays",
"=",
"false",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"callback",
"&&",
"!",
"is_callable",
"(",
"$",
"callb... | Exactly the same as array_filter except this function
filters within multi-dimensional arrays
@param array $array
@param callable $callback optional callback function name
@param bool $removeEmptyArrays optional flag removal of empty arrays after filtering
@return array | [
"Exactly",
"the",
"same",
"as",
"array_filter",
"except",
"this",
"function",
"filters",
"within",
"multi",
"-",
"dimensional",
"arrays"
] | 3572993cdcdb2898cdde396a2f1de9864b193660 | https://github.com/coolms/common/blob/3572993cdcdb2898cdde396a2f1de9864b193660/src/Stdlib/ArrayUtils.php#L32-L60 |
5,854 | ItinerisLtd/preflight-command | src/Validators/AbstractValidator.php | AbstractValidator.report | public function report(string ...$messages): ResultInterface
{
if (! empty($messages)) {
return ResultFactory::makeFailure(
$this->checker,
array_merge([$this->failureMessage], $messages)
);
}
return ResultFactory::makeSuccess($this->c... | php | public function report(string ...$messages): ResultInterface
{
if (! empty($messages)) {
return ResultFactory::makeFailure(
$this->checker,
array_merge([$this->failureMessage], $messages)
);
}
return ResultFactory::makeSuccess($this->c... | [
"public",
"function",
"report",
"(",
"string",
"...",
"$",
"messages",
")",
":",
"ResultInterface",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"messages",
")",
")",
"{",
"return",
"ResultFactory",
"::",
"makeFailure",
"(",
"$",
"this",
"->",
"checker",
",",... | Returns result instance.
TODO: Should I be protected?
@param string|string[] ...$messages Failure message. If empty, assume success.
@return Failure|Success | [
"Returns",
"result",
"instance",
"."
] | d1c1360ea8d7de0312b5c0c09c9c486949594049 | https://github.com/ItinerisLtd/preflight-command/blob/d1c1360ea8d7de0312b5c0c09c9c486949594049/src/Validators/AbstractValidator.php#L52-L62 |
5,855 | Webiny/Hrc | src/Webiny/Hrc/CacheStorage/FileSystem.php | FileSystem.save | public function save($key, $content, $ttl)
{
$cacheFile = $this->getCachePath($key);
$cache = json_encode(['ttl' => (time() + $ttl), 'content' => $content]);
file_put_contents($cacheFile, $cache);
return true;
} | php | public function save($key, $content, $ttl)
{
$cacheFile = $this->getCachePath($key);
$cache = json_encode(['ttl' => (time() + $ttl), 'content' => $content]);
file_put_contents($cacheFile, $cache);
return true;
} | [
"public",
"function",
"save",
"(",
"$",
"key",
",",
"$",
"content",
",",
"$",
"ttl",
")",
"{",
"$",
"cacheFile",
"=",
"$",
"this",
"->",
"getCachePath",
"(",
"$",
"key",
")",
";",
"$",
"cache",
"=",
"json_encode",
"(",
"[",
"'ttl'",
"=>",
"(",
"t... | Save the given content into cache.
@param string $key Cache key.
@param string $content Content that should be saved.
@param string $ttl Cache time-to-live
@return bool | [
"Save",
"the",
"given",
"content",
"into",
"cache",
"."
] | 2594d645dd79a579916d90ec93ce815bd413558f | https://github.com/Webiny/Hrc/blob/2594d645dd79a579916d90ec93ce815bd413558f/src/Webiny/Hrc/CacheStorage/FileSystem.php#L74-L82 |
5,856 | Webiny/Hrc | src/Webiny/Hrc/CacheStorage/FileSystem.php | FileSystem.getCachePath | private function getCachePath($cacheKey)
{
$folder = $this->cacheDir . substr($cacheKey, 0, 2) . DIRECTORY_SEPARATOR . substr($cacheKey, 2,
2) . DIRECTORY_SEPARATOR . substr($cacheKey, 4, 2) . DIRECTORY_SEPARATOR;
if (!is_dir($folder)) {
mkdir($folder, 0755, true);
... | php | private function getCachePath($cacheKey)
{
$folder = $this->cacheDir . substr($cacheKey, 0, 2) . DIRECTORY_SEPARATOR . substr($cacheKey, 2,
2) . DIRECTORY_SEPARATOR . substr($cacheKey, 4, 2) . DIRECTORY_SEPARATOR;
if (!is_dir($folder)) {
mkdir($folder, 0755, true);
... | [
"private",
"function",
"getCachePath",
"(",
"$",
"cacheKey",
")",
"{",
"$",
"folder",
"=",
"$",
"this",
"->",
"cacheDir",
".",
"substr",
"(",
"$",
"cacheKey",
",",
"0",
",",
"2",
")",
".",
"DIRECTORY_SEPARATOR",
".",
"substr",
"(",
"$",
"cacheKey",
","... | Creates the cache folder hierarchy and returns the full path to the given cache file.
@param string $cacheKey
@return string | [
"Creates",
"the",
"cache",
"folder",
"hierarchy",
"and",
"returns",
"the",
"full",
"path",
"to",
"the",
"given",
"cache",
"file",
"."
] | 2594d645dd79a579916d90ec93ce815bd413558f | https://github.com/Webiny/Hrc/blob/2594d645dd79a579916d90ec93ce815bd413558f/src/Webiny/Hrc/CacheStorage/FileSystem.php#L112-L121 |
5,857 | nirix/radium | src/Database/Model/Relatable.php | Relatable.getRelationInfo | public static function getRelationInfo($name, $info = array())
{
// Get current models namespace
$class = new \ReflectionClass(get_called_class());
$namespace = $class->getNamespaceName();
// Name
$info['name'] = $name;
// Model and class
if (!isset($info['m... | php | public static function getRelationInfo($name, $info = array())
{
// Get current models namespace
$class = new \ReflectionClass(get_called_class());
$namespace = $class->getNamespaceName();
// Name
$info['name'] = $name;
// Model and class
if (!isset($info['m... | [
"public",
"static",
"function",
"getRelationInfo",
"(",
"$",
"name",
",",
"$",
"info",
"=",
"array",
"(",
")",
")",
"{",
"// Get current models namespace",
"$",
"class",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"get_called_class",
"(",
")",
")",
";",
"$",
... | Returns an array containing information about the
relation.
@param string $name Relation name
@param array $info Relation info
@return array | [
"Returns",
"an",
"array",
"containing",
"information",
"about",
"the",
"relation",
"."
] | cc6907bfee296b64a7630b0b188e233d7cdb86fd | https://github.com/nirix/radium/blob/cc6907bfee296b64a7630b0b188e233d7cdb86fd/src/Database/Model/Relatable.php#L41-L66 |
5,858 | nirix/radium | src/Database/Model/Relatable.php | Relatable.belongsTo | public function belongsTo($model, $options = array())
{
if (isset($this->_relationsCache[$model])) {
return $this->_relationsCache[$model];
}
$options = static::getRelationInfo($model, $options);
if (!isset($options['localKey'])) {
$options['localKey'] = Inf... | php | public function belongsTo($model, $options = array())
{
if (isset($this->_relationsCache[$model])) {
return $this->_relationsCache[$model];
}
$options = static::getRelationInfo($model, $options);
if (!isset($options['localKey'])) {
$options['localKey'] = Inf... | [
"public",
"function",
"belongsTo",
"(",
"$",
"model",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_relationsCache",
"[",
"$",
"model",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"_relati... | Returns the owning object.
@param string $model Name of the model.
@param aray $options Optional relation options.
@return object | [
"Returns",
"the",
"owning",
"object",
"."
] | cc6907bfee296b64a7630b0b188e233d7cdb86fd | https://github.com/nirix/radium/blob/cc6907bfee296b64a7630b0b188e233d7cdb86fd/src/Database/Model/Relatable.php#L110-L129 |
5,859 | nirix/radium | src/Database/Model/Relatable.php | Relatable.hasMany | public function hasMany($model, $options = array())
{
$options = static::getRelationInfo($model, $options);
if (!isset($options['localKey'])) {
$options['localKey'] = static::primaryKey();
}
if (!isset($options['foreignKey'])) {
$options['foreignKey'] = Infl... | php | public function hasMany($model, $options = array())
{
$options = static::getRelationInfo($model, $options);
if (!isset($options['localKey'])) {
$options['localKey'] = static::primaryKey();
}
if (!isset($options['foreignKey'])) {
$options['foreignKey'] = Infl... | [
"public",
"function",
"hasMany",
"(",
"$",
"model",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"options",
"=",
"static",
"::",
"getRelationInfo",
"(",
"$",
"model",
",",
"$",
"options",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
... | Returns an array of owned objects.
@param string $model Name of the model.
@param aray $options Optional relation options.
@return array | [
"Returns",
"an",
"array",
"of",
"owned",
"objects",
"."
] | cc6907bfee296b64a7630b0b188e233d7cdb86fd | https://github.com/nirix/radium/blob/cc6907bfee296b64a7630b0b188e233d7cdb86fd/src/Database/Model/Relatable.php#L139-L154 |
5,860 | mszewcz/php-json-schema-validator | src/Validators/ObjectValidators/AdditionalPropertiesValidator.php | AdditionalPropertiesValidator.validate | public function validate($subject): bool
{
// Validation with "additionalProperties" applies only to the child values of instance names that do
// not match any names in "properties", and do not match any regular expression in "patternProperties".
$subject = $this->removePropertiesFromSubjec... | php | public function validate($subject): bool
{
// Validation with "additionalProperties" applies only to the child values of instance names that do
// not match any names in "properties", and do not match any regular expression in "patternProperties".
$subject = $this->removePropertiesFromSubjec... | [
"public",
"function",
"validate",
"(",
"$",
"subject",
")",
":",
"bool",
"{",
"// Validation with \"additionalProperties\" applies only to the child values of instance names that do",
"// not match any names in \"properties\", and do not match any regular expression in \"patternProperties\".",... | Validates subject against additionalProperties
@param array $subject
@return bool | [
"Validates",
"subject",
"against",
"additionalProperties"
] | f7768bfe07ce6508bb1ff36163560a5e5791de7d | https://github.com/mszewcz/php-json-schema-validator/blob/f7768bfe07ce6508bb1ff36163560a5e5791de7d/src/Validators/ObjectValidators/AdditionalPropertiesValidator.php#L48-L68 |
5,861 | mszewcz/php-json-schema-validator | src/Validators/ObjectValidators/AdditionalPropertiesValidator.php | AdditionalPropertiesValidator.removePropertiesFromSubject | private function removePropertiesFromSubject(array $subject, array $schema): array
{
if (isset($schema['properties']) && \is_array($schema['properties'])) {
$propertyNames = \array_keys($schema['properties']);
foreach ($propertyNames as $propertyName) {
if (isset($sub... | php | private function removePropertiesFromSubject(array $subject, array $schema): array
{
if (isset($schema['properties']) && \is_array($schema['properties'])) {
$propertyNames = \array_keys($schema['properties']);
foreach ($propertyNames as $propertyName) {
if (isset($sub... | [
"private",
"function",
"removePropertiesFromSubject",
"(",
"array",
"$",
"subject",
",",
"array",
"$",
"schema",
")",
":",
"array",
"{",
"if",
"(",
"isset",
"(",
"$",
"schema",
"[",
"'properties'",
"]",
")",
"&&",
"\\",
"is_array",
"(",
"$",
"schema",
"[... | Removes properties defined in 'properties' from subject
@param array $subject
@param array $schema
@return array | [
"Removes",
"properties",
"defined",
"in",
"properties",
"from",
"subject"
] | f7768bfe07ce6508bb1ff36163560a5e5791de7d | https://github.com/mszewcz/php-json-schema-validator/blob/f7768bfe07ce6508bb1ff36163560a5e5791de7d/src/Validators/ObjectValidators/AdditionalPropertiesValidator.php#L77-L88 |
5,862 | mszewcz/php-json-schema-validator | src/Validators/ObjectValidators/AdditionalPropertiesValidator.php | AdditionalPropertiesValidator.removePatternPropertiesFromSubject | private function removePatternPropertiesFromSubject(array $subject, array $schema): array
{
if (isset($schema['patternProperties']) && \is_array($schema['patternProperties'])) {
$patterns = \array_keys($schema['patternProperties']);
$propertyNames = \array_keys($subject);
... | php | private function removePatternPropertiesFromSubject(array $subject, array $schema): array
{
if (isset($schema['patternProperties']) && \is_array($schema['patternProperties'])) {
$patterns = \array_keys($schema['patternProperties']);
$propertyNames = \array_keys($subject);
... | [
"private",
"function",
"removePatternPropertiesFromSubject",
"(",
"array",
"$",
"subject",
",",
"array",
"$",
"schema",
")",
":",
"array",
"{",
"if",
"(",
"isset",
"(",
"$",
"schema",
"[",
"'patternProperties'",
"]",
")",
"&&",
"\\",
"is_array",
"(",
"$",
... | Removes properties defined in 'patternProperties' from subject
@param array $subject
@param array $schema
@return array | [
"Removes",
"properties",
"defined",
"in",
"patternProperties",
"from",
"subject"
] | f7768bfe07ce6508bb1ff36163560a5e5791de7d | https://github.com/mszewcz/php-json-schema-validator/blob/f7768bfe07ce6508bb1ff36163560a5e5791de7d/src/Validators/ObjectValidators/AdditionalPropertiesValidator.php#L97-L112 |
5,863 | iwyg/template | View.php | View.setListeners | public function setListeners(array $listeners)
{
$this->listeners = [];
foreach ($listeners as $name => $listener) {
$this->addListener($name, $listener);
}
} | php | public function setListeners(array $listeners)
{
$this->listeners = [];
foreach ($listeners as $name => $listener) {
$this->addListener($name, $listener);
}
} | [
"public",
"function",
"setListeners",
"(",
"array",
"$",
"listeners",
")",
"{",
"$",
"this",
"->",
"listeners",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"listeners",
"as",
"$",
"name",
"=>",
"$",
"listener",
")",
"{",
"$",
"this",
"->",
"addListener",
... | Set render listeners.
@param array $listeners
@return void | [
"Set",
"render",
"listeners",
"."
] | ad7c8e79ce3b8fc7fcf82bc3e53737a4d7ecc16e | https://github.com/iwyg/template/blob/ad7c8e79ce3b8fc7fcf82bc3e53737a4d7ecc16e/View.php#L77-L84 |
5,864 | bugotech/phar | src/Commands/CompilerCommand.php | CompilerCommand.runScripts | protected function runScripts($keyList)
{
$this->info('Run scripts');
$this->laravel->configure('phar');
$scripts = $this->laravel['config']->get($keyList, []);
foreach ($scripts as $item) {
try {
$this->info('..' . $item);
$out = [];
... | php | protected function runScripts($keyList)
{
$this->info('Run scripts');
$this->laravel->configure('phar');
$scripts = $this->laravel['config']->get($keyList, []);
foreach ($scripts as $item) {
try {
$this->info('..' . $item);
$out = [];
... | [
"protected",
"function",
"runScripts",
"(",
"$",
"keyList",
")",
"{",
"$",
"this",
"->",
"info",
"(",
"'Run scripts'",
")",
";",
"$",
"this",
"->",
"laravel",
"->",
"configure",
"(",
"'phar'",
")",
";",
"$",
"scripts",
"=",
"$",
"this",
"->",
"laravel"... | Executar scripts.
@param $keyList | [
"Executar",
"scripts",
"."
] | 96f226d2c4bb1787fd41a3c67fe64b10de22b7af | https://github.com/bugotech/phar/blob/96f226d2c4bb1787fd41a3c67fe64b10de22b7af/src/Commands/CompilerCommand.php#L78-L93 |
5,865 | PublisherHub/Publisher | src/Publisher/Mode/ContentTransformer.php | ContentTransformer.transform | public function transform(string $mode, array $modeData)
{
$return = array();
foreach($modeData as $data) {
$modeClass = $this->entryHelper->getModeClass($mode, $data['entry']);
$entity = new $modeClass($data['content']);
$entryD... | php | public function transform(string $mode, array $modeData)
{
$return = array();
foreach($modeData as $data) {
$modeClass = $this->entryHelper->getModeClass($mode, $data['entry']);
$entity = new $modeClass($data['content']);
$entryD... | [
"public",
"function",
"transform",
"(",
"string",
"$",
"mode",
",",
"array",
"$",
"modeData",
")",
"{",
"$",
"return",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"modeData",
"as",
"$",
"data",
")",
"{",
"$",
"modeClass",
"=",
"$",
"this",
"-... | Transforms the mode specific data for each entry
to the mapped entry data.
@param string $mode
@param array $modeData
@return array | [
"Transforms",
"the",
"mode",
"specific",
"data",
"for",
"each",
"entry",
"to",
"the",
"mapped",
"entry",
"data",
"."
] | 954e05118be9956e0c8631e44958af4ba42606b3 | https://github.com/PublisherHub/Publisher/blob/954e05118be9956e0c8631e44958af4ba42606b3/src/Publisher/Mode/ContentTransformer.php#L35-L57 |
5,866 | indigophp-archive/http-adapter | src/Stream.php | Stream.create | public static function create($resource)
{
$type = gettype($resource);
if ($type == 'string') {
$stream = fopen('php://temp', 'r+');
if ($resource !== '') {
fwrite($stream, $resource);
fseek($stream, 0);
}
return new ... | php | public static function create($resource)
{
$type = gettype($resource);
if ($type == 'string') {
$stream = fopen('php://temp', 'r+');
if ($resource !== '') {
fwrite($stream, $resource);
fseek($stream, 0);
}
return new ... | [
"public",
"static",
"function",
"create",
"(",
"$",
"resource",
")",
"{",
"$",
"type",
"=",
"gettype",
"(",
"$",
"resource",
")",
";",
"if",
"(",
"$",
"type",
"==",
"'string'",
")",
"{",
"$",
"stream",
"=",
"fopen",
"(",
"'php://temp'",
",",
"'r+'",
... | Creates a new stream
From Guzzle
@param mixed $resource
@return self | [
"Creates",
"a",
"new",
"stream"
] | 2233e8329a0704e020857228c2b538438e127475 | https://github.com/indigophp-archive/http-adapter/blob/2233e8329a0704e020857228c2b538438e127475/src/Stream.php#L90-L114 |
5,867 | dlevacher/php-git-hg-repo | lib/PHPHg/Repository.php | Repository.checkVers | public function checkVers($options = "-i") {
$output = $this->cmd(sprintf('identify %s', $options));
$output = substr($output['output'], 0, 11);
return $output;
} | php | public function checkVers($options = "-i") {
$output = $this->cmd(sprintf('identify %s', $options));
$output = substr($output['output'], 0, 11);
return $output;
} | [
"public",
"function",
"checkVers",
"(",
"$",
"options",
"=",
"\"-i\"",
")",
"{",
"$",
"output",
"=",
"$",
"this",
"->",
"cmd",
"(",
"sprintf",
"(",
"'identify %s'",
",",
"$",
"options",
")",
")",
";",
"$",
"output",
"=",
"substr",
"(",
"$",
"output",... | Check current version | [
"Check",
"current",
"version"
] | 415cb600cc8a8cba8817c92c9d6bc4e02f2d7535 | https://github.com/dlevacher/php-git-hg-repo/blob/415cb600cc8a8cba8817c92c9d6bc4e02f2d7535/lib/PHPHg/Repository.php#L135-L139 |
5,868 | dlevacher/php-git-hg-repo | lib/PHPHg/Repository.php | Repository.checkFiles | public function checkFiles($options = "-m") {
try {
$output = $this->cmd(sprintf('status %s', $options));
if (strlen($output['output']) == 0) {
$output['output'] = "No files modified.";
$output['modified'] = false;
} else {
$ou... | php | public function checkFiles($options = "-m") {
try {
$output = $this->cmd(sprintf('status %s', $options));
if (strlen($output['output']) == 0) {
$output['output'] = "No files modified.";
$output['modified'] = false;
} else {
$ou... | [
"public",
"function",
"checkFiles",
"(",
"$",
"options",
"=",
"\"-m\"",
")",
"{",
"try",
"{",
"$",
"output",
"=",
"$",
"this",
"->",
"cmd",
"(",
"sprintf",
"(",
"'status %s'",
",",
"$",
"options",
")",
")",
";",
"if",
"(",
"strlen",
"(",
"$",
"outp... | Check if they are local files modified | [
"Check",
"if",
"they",
"are",
"local",
"files",
"modified"
] | 415cb600cc8a8cba8817c92c9d6bc4e02f2d7535 | https://github.com/dlevacher/php-git-hg-repo/blob/415cb600cc8a8cba8817c92c9d6bc4e02f2d7535/lib/PHPHg/Repository.php#L144-L158 |
5,869 | dlevacher/php-git-hg-repo | lib/PHPHg/Repository.php | Repository.updateClean | public function updateClean($options = "-C") {
try {
$output = $this->cmd(sprintf('update %s', $options));
return $output;
} catch (Exception $ex) {
return $ex;
}
} | php | public function updateClean($options = "-C") {
try {
$output = $this->cmd(sprintf('update %s', $options));
return $output;
} catch (Exception $ex) {
return $ex;
}
} | [
"public",
"function",
"updateClean",
"(",
"$",
"options",
"=",
"\"-C\"",
")",
"{",
"try",
"{",
"$",
"output",
"=",
"$",
"this",
"->",
"cmd",
"(",
"sprintf",
"(",
"'update %s'",
",",
"$",
"options",
")",
")",
";",
"return",
"$",
"output",
";",
"}",
... | Clean local modified files | [
"Clean",
"local",
"modified",
"files"
] | 415cb600cc8a8cba8817c92c9d6bc4e02f2d7535 | https://github.com/dlevacher/php-git-hg-repo/blob/415cb600cc8a8cba8817c92c9d6bc4e02f2d7535/lib/PHPHg/Repository.php#L163-L171 |
5,870 | faustbrian/binary | src/Buffer/Reader/Buffer.php | Buffer.position | public function position(int $value): self
{
$this->offset = $value;
$this->bytes = substr(hex2bin($this->hex), $value);
return $this;
} | php | public function position(int $value): self
{
$this->offset = $value;
$this->bytes = substr(hex2bin($this->hex), $value);
return $this;
} | [
"public",
"function",
"position",
"(",
"int",
"$",
"value",
")",
":",
"self",
"{",
"$",
"this",
"->",
"offset",
"=",
"$",
"value",
";",
"$",
"this",
"->",
"bytes",
"=",
"substr",
"(",
"hex2bin",
"(",
"$",
"this",
"->",
"hex",
")",
",",
"$",
"valu... | Set the cursor to N.
@param int $value
@return \BrianFaust\Binary\Buffer\Reader\Buffer | [
"Set",
"the",
"cursor",
"to",
"N",
"."
] | 7d845497460c2dabf7e369ec8e55baf989ef74cb | https://github.com/faustbrian/binary/blob/7d845497460c2dabf7e369ec8e55baf989ef74cb/src/Buffer/Reader/Buffer.php#L69-L75 |
5,871 | faustbrian/binary | src/Buffer/Reader/Buffer.php | Buffer.skip | public function skip(int $value): self
{
$this->offset += $value;
$this->bytes = substr($this->bytes, $value);
return $this;
} | php | public function skip(int $value): self
{
$this->offset += $value;
$this->bytes = substr($this->bytes, $value);
return $this;
} | [
"public",
"function",
"skip",
"(",
"int",
"$",
"value",
")",
":",
"self",
"{",
"$",
"this",
"->",
"offset",
"+=",
"$",
"value",
";",
"$",
"this",
"->",
"bytes",
"=",
"substr",
"(",
"$",
"this",
"->",
"bytes",
",",
"$",
"value",
")",
";",
"return"... | Move the cursor by N amount of bytes.
@param int $value
@return \BrianFaust\Binary\Buffer\Reader\Buffer | [
"Move",
"the",
"cursor",
"by",
"N",
"amount",
"of",
"bytes",
"."
] | 7d845497460c2dabf7e369ec8e55baf989ef74cb | https://github.com/faustbrian/binary/blob/7d845497460c2dabf7e369ec8e55baf989ef74cb/src/Buffer/Reader/Buffer.php#L84-L90 |
5,872 | common-libs/user | src/users.php | users.isUser | public static function isUser(string $username): bool {
$userdbname = setup::getValidation("username");
if (R::findOne('user', ' ' . $userdbname . ' = ? ', [$username])) {
return true;
}
return false;
} | php | public static function isUser(string $username): bool {
$userdbname = setup::getValidation("username");
if (R::findOne('user', ' ' . $userdbname . ' = ? ', [$username])) {
return true;
}
return false;
} | [
"public",
"static",
"function",
"isUser",
"(",
"string",
"$",
"username",
")",
":",
"bool",
"{",
"$",
"userdbname",
"=",
"setup",
"::",
"getValidation",
"(",
"\"username\"",
")",
";",
"if",
"(",
"R",
"::",
"findOne",
"(",
"'user'",
",",
"' '",
".",
"$"... | checks if a user exists
@param string $username Username
@return bool | [
"checks",
"if",
"a",
"user",
"exists"
] | 820fce6748a59e8d692bf613b4694f903d9db6c1 | https://github.com/common-libs/user/blob/820fce6748a59e8d692bf613b4694f903d9db6c1/src/users.php#L43-L50 |
5,873 | common-libs/user | src/users.php | users.removeByUsername | public static function removeByUsername(string $username) {
$userdbname = setup::getValidation("username");
if ($user = R::findOne('user', ' ' . $userdbname . ' = ? ', [$username])) {
R::trash($user);
}
} | php | public static function removeByUsername(string $username) {
$userdbname = setup::getValidation("username");
if ($user = R::findOne('user', ' ' . $userdbname . ' = ? ', [$username])) {
R::trash($user);
}
} | [
"public",
"static",
"function",
"removeByUsername",
"(",
"string",
"$",
"username",
")",
"{",
"$",
"userdbname",
"=",
"setup",
"::",
"getValidation",
"(",
"\"username\"",
")",
";",
"if",
"(",
"$",
"user",
"=",
"R",
"::",
"findOne",
"(",
"'user'",
",",
"'... | Removes an user by his name
@param string $username Username | [
"Removes",
"an",
"user",
"by",
"his",
"name"
] | 820fce6748a59e8d692bf613b4694f903d9db6c1 | https://github.com/common-libs/user/blob/820fce6748a59e8d692bf613b4694f903d9db6c1/src/users.php#L57-L62 |
5,874 | common-libs/user | src/users.php | users.removeById | public static function removeById(int $id) {
if ($user = R::findOne('user', ' id = ? ', [$id])) {
R::trash($user);
}
} | php | public static function removeById(int $id) {
if ($user = R::findOne('user', ' id = ? ', [$id])) {
R::trash($user);
}
} | [
"public",
"static",
"function",
"removeById",
"(",
"int",
"$",
"id",
")",
"{",
"if",
"(",
"$",
"user",
"=",
"R",
"::",
"findOne",
"(",
"'user'",
",",
"' id = ? '",
",",
"[",
"$",
"id",
"]",
")",
")",
"{",
"R",
"::",
"trash",
"(",
"$",
"user",
"... | Removes an user by his id
@param integer $id id of user | [
"Removes",
"an",
"user",
"by",
"his",
"id"
] | 820fce6748a59e8d692bf613b4694f903d9db6c1 | https://github.com/common-libs/user/blob/820fce6748a59e8d692bf613b4694f903d9db6c1/src/users.php#L69-L73 |
5,875 | dlin-me/geocoder | src/Dlin/Geocoder/Geocoding/GoogleGeocoding.php | GoogleGeocoding._parseComponent | private function _parseComponent($components)
{
$address = new GeoAddress();
$address->geoCoding = $this->name;
$streetNumber = '';
$routeName = '';
foreach ($components as $component) {
if (isset($component['types'])) {
if (in_array('street_numb... | php | private function _parseComponent($components)
{
$address = new GeoAddress();
$address->geoCoding = $this->name;
$streetNumber = '';
$routeName = '';
foreach ($components as $component) {
if (isset($component['types'])) {
if (in_array('street_numb... | [
"private",
"function",
"_parseComponent",
"(",
"$",
"components",
")",
"{",
"$",
"address",
"=",
"new",
"GeoAddress",
"(",
")",
";",
"$",
"address",
"->",
"geoCoding",
"=",
"$",
"this",
"->",
"name",
";",
"$",
"streetNumber",
"=",
"''",
";",
"$",
"rout... | This function use to parse the return components from google geocoding api
@param $components
@return GeoAddress | [
"This",
"function",
"use",
"to",
"parse",
"the",
"return",
"components",
"from",
"google",
"geocoding",
"api"
] | 50596ff3dcaccd95034e5799ae02fd1c753b5cd2 | https://github.com/dlin-me/geocoder/blob/50596ff3dcaccd95034e5799ae02fd1c753b5cd2/src/Dlin/Geocoder/Geocoding/GoogleGeocoding.php#L53-L99 |
5,876 | budkit/budkit-framework | src/Budkit/Application/Support/Mockery.php | Mockery.createAliasMock | public function createAliasMock($alias, $original = null, $autoload = true)
{
//If we are passing a large array;
if (is_array($alias)) {
foreach ($alias as $mock => $original) {
$this->createAliasMock($mock, $original);
}
return;
}
... | php | public function createAliasMock($alias, $original = null, $autoload = true)
{
//If we are passing a large array;
if (is_array($alias)) {
foreach ($alias as $mock => $original) {
$this->createAliasMock($mock, $original);
}
return;
}
... | [
"public",
"function",
"createAliasMock",
"(",
"$",
"alias",
",",
"$",
"original",
"=",
"null",
",",
"$",
"autoload",
"=",
"true",
")",
"{",
"//If we are passing a large array;",
"if",
"(",
"is_array",
"(",
"$",
"alias",
")",
")",
"{",
"foreach",
"(",
"$",
... | Create a mock of the container object
@$alias can also take an array or mocks e.g `[ ["MockName"=>MockableClass::class], ...]`
@$original If a single ** *$alias* ** parameter is passed provide the original class name here e.g. `MockableClass::class`
@$autoload bool|true $autoload If you will like these mocked classes... | [
"Create",
"a",
"mock",
"of",
"the",
"container",
"object"
] | 0635061815fe07a8c63f9514b845d199b3c0d485 | https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Application/Support/Mockery.php#L63-L104 |
5,877 | osflab/view | Helper/Bootstrap/Box.php | Box.addNav | public function addNav(Nav $nav)
{
$nav->setStacked();
$this->setContent((string) $nav);
$this->setStackContainer();
return $this;
} | php | public function addNav(Nav $nav)
{
$nav->setStacked();
$this->setContent((string) $nav);
$this->setStackContainer();
return $this;
} | [
"public",
"function",
"addNav",
"(",
"Nav",
"$",
"nav",
")",
"{",
"$",
"nav",
"->",
"setStacked",
"(",
")",
";",
"$",
"this",
"->",
"setContent",
"(",
"(",
"string",
")",
"$",
"nav",
")",
";",
"$",
"this",
"->",
"setStackContainer",
"(",
")",
";",
... | Add nav in content
@param \Osf\View\Helper\Bootstrap\Nav $nav
@return $this | [
"Add",
"nav",
"in",
"content"
] | e06601013e8ec86dc2055e000e58dffd963c78e2 | https://github.com/osflab/view/blob/e06601013e8ec86dc2055e000e58dffd963c78e2/Helper/Bootstrap/Box.php#L141-L147 |
5,878 | osflab/view | Helper/Bootstrap/Box.php | Box.setContentHtmlTable | public function setContentHtmlTable(bool $responsive = true)
{
$this->setStackContainer();
$this->addCssClass($responsive ? 'table-responsive' : 'table');
return $this;
} | php | public function setContentHtmlTable(bool $responsive = true)
{
$this->setStackContainer();
$this->addCssClass($responsive ? 'table-responsive' : 'table');
return $this;
} | [
"public",
"function",
"setContentHtmlTable",
"(",
"bool",
"$",
"responsive",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"setStackContainer",
"(",
")",
";",
"$",
"this",
"->",
"addCssClass",
"(",
"$",
"responsive",
"?",
"'table-responsive'",
":",
"'table'",
")... | Content is html table
@param bool $responsive
@return $this | [
"Content",
"is",
"html",
"table"
] | e06601013e8ec86dc2055e000e58dffd963c78e2 | https://github.com/osflab/view/blob/e06601013e8ec86dc2055e000e58dffd963c78e2/Helper/Bootstrap/Box.php#L173-L178 |
5,879 | osflab/view | Helper/Bootstrap/Box.php | Box.render | public function render()
{
$this->addCssClass('box');
$this->addCssClass('box-' . $this->getStatus(), $this->getStatus());
$this->addCssClass('collapsed-box', $this->expandable);
$this->addCssClass('box-solid', $this->coloredTitleBox);
$boxTools = isset($this->badges[0]) || $... | php | public function render()
{
$this->addCssClass('box');
$this->addCssClass('box-' . $this->getStatus(), $this->getStatus());
$this->addCssClass('collapsed-box', $this->expandable);
$this->addCssClass('box-solid', $this->coloredTitleBox);
$boxTools = isset($this->badges[0]) || $... | [
"public",
"function",
"render",
"(",
")",
"{",
"$",
"this",
"->",
"addCssClass",
"(",
"'box'",
")",
";",
"$",
"this",
"->",
"addCssClass",
"(",
"'box-'",
".",
"$",
"this",
"->",
"getStatus",
"(",
")",
",",
"$",
"this",
"->",
"getStatus",
"(",
")",
... | Render the box at the end of configuration
@return string | [
"Render",
"the",
"box",
"at",
"the",
"end",
"of",
"configuration"
] | e06601013e8ec86dc2055e000e58dffd963c78e2 | https://github.com/osflab/view/blob/e06601013e8ec86dc2055e000e58dffd963c78e2/Helper/Bootstrap/Box.php#L220-L255 |
5,880 | xloit/xloit-bridge-zend-validator | src/File/IsImage.php | IsImage.isValid | public function isValid($value, $file = null)
{
if ($this->allowEmpty && $this->isFileEmpty($value, $file)) {
return true;
}
return parent::isValid($value, $file);
} | php | public function isValid($value, $file = null)
{
if ($this->allowEmpty && $this->isFileEmpty($value, $file)) {
return true;
}
return parent::isValid($value, $file);
} | [
"public",
"function",
"isValid",
"(",
"$",
"value",
",",
"$",
"file",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"allowEmpty",
"&&",
"$",
"this",
"->",
"isFileEmpty",
"(",
"$",
"value",
",",
"$",
"file",
")",
")",
"{",
"return",
"true",
... | Returns true if and only if the file input is an image.
@param string|array $value Real file to check.
@param array $file File data from {@link \Zend\File\Transfer\Transfer} (optional).
@return bool | [
"Returns",
"true",
"if",
"and",
"only",
"if",
"the",
"file",
"input",
"is",
"an",
"image",
"."
] | 2e789986e6551f157d4e07cf4c27d027dd070324 | https://github.com/xloit/xloit-bridge-zend-validator/blob/2e789986e6551f157d4e07cf4c27d027dd070324/src/File/IsImage.php#L39-L46 |
5,881 | routegroup/native-media | src/Helpers/Thumbnail.php | Thumbnail.name | public function name($width, $height = null)
{
$parts = explode('.', $this->file->filename);
$extension = array_pop($parts);
$prefix = '-' . $width . 'x' . ($height ?: $width);
$name = implode('.', $parts) . $prefix;
return "{$name}.{$extension}";
} | php | public function name($width, $height = null)
{
$parts = explode('.', $this->file->filename);
$extension = array_pop($parts);
$prefix = '-' . $width . 'x' . ($height ?: $width);
$name = implode('.', $parts) . $prefix;
return "{$name}.{$extension}";
} | [
"public",
"function",
"name",
"(",
"$",
"width",
",",
"$",
"height",
"=",
"null",
")",
"{",
"$",
"parts",
"=",
"explode",
"(",
"'.'",
",",
"$",
"this",
"->",
"file",
"->",
"filename",
")",
";",
"$",
"extension",
"=",
"array_pop",
"(",
"$",
"parts",... | Resolves thumbnail name.
@param integer $width
@param integer $height
@return string | [
"Resolves",
"thumbnail",
"name",
"."
] | 5ea35c46c2ac1019e277ec4fe698f17581524631 | https://github.com/routegroup/native-media/blob/5ea35c46c2ac1019e277ec4fe698f17581524631/src/Helpers/Thumbnail.php#L34-L45 |
5,882 | routegroup/native-media | src/Helpers/Thumbnail.php | Thumbnail.exists | public function exists($filename)
{
return $this->file->storage->exists($this->file->path($filename));
} | php | public function exists($filename)
{
return $this->file->storage->exists($this->file->path($filename));
} | [
"public",
"function",
"exists",
"(",
"$",
"filename",
")",
"{",
"return",
"$",
"this",
"->",
"file",
"->",
"storage",
"->",
"exists",
"(",
"$",
"this",
"->",
"file",
"->",
"path",
"(",
"$",
"filename",
")",
")",
";",
"}"
] | Check if thumbnail with given name exists.
@param string $filename
@return boolean | [
"Check",
"if",
"thumbnail",
"with",
"given",
"name",
"exists",
"."
] | 5ea35c46c2ac1019e277ec4fe698f17581524631 | https://github.com/routegroup/native-media/blob/5ea35c46c2ac1019e277ec4fe698f17581524631/src/Helpers/Thumbnail.php#L53-L56 |
5,883 | routegroup/native-media | src/Helpers/Thumbnail.php | Thumbnail.create | public function create($filename, $width, $height = null)
{
try {
$image = app('image')->make($this->file->realPath)
->fit($width, ($height ?: $width))
->encode();
$this->file->storage->put($this->file->path($filename), $image);
} catch (NotRe... | php | public function create($filename, $width, $height = null)
{
try {
$image = app('image')->make($this->file->realPath)
->fit($width, ($height ?: $width))
->encode();
$this->file->storage->put($this->file->path($filename), $image);
} catch (NotRe... | [
"public",
"function",
"create",
"(",
"$",
"filename",
",",
"$",
"width",
",",
"$",
"height",
"=",
"null",
")",
"{",
"try",
"{",
"$",
"image",
"=",
"app",
"(",
"'image'",
")",
"->",
"make",
"(",
"$",
"this",
"->",
"file",
"->",
"realPath",
")",
"-... | Create thumbnail.
@param string $filename
@param integer $width
@param integer|null $height
@return string | [
"Create",
"thumbnail",
"."
] | 5ea35c46c2ac1019e277ec4fe698f17581524631 | https://github.com/routegroup/native-media/blob/5ea35c46c2ac1019e277ec4fe698f17581524631/src/Helpers/Thumbnail.php#L66-L79 |
5,884 | routegroup/native-media | src/Helpers/Thumbnail.php | Thumbnail.lists | public function lists()
{
$parts = explode('.', $this->file->filename);
$extension = array_pop($parts);
$name = $this->file->path(implode('.', $parts));
$files = glob($this->file->realPath("{$name}-*"));
array_walk($files, function (&$file) {
$file = substr($f... | php | public function lists()
{
$parts = explode('.', $this->file->filename);
$extension = array_pop($parts);
$name = $this->file->path(implode('.', $parts));
$files = glob($this->file->realPath("{$name}-*"));
array_walk($files, function (&$file) {
$file = substr($f... | [
"public",
"function",
"lists",
"(",
")",
"{",
"$",
"parts",
"=",
"explode",
"(",
"'.'",
",",
"$",
"this",
"->",
"file",
"->",
"filename",
")",
";",
"$",
"extension",
"=",
"array_pop",
"(",
"$",
"parts",
")",
";",
"$",
"name",
"=",
"$",
"this",
"-... | Return all thumbnails.
@return \Illuminate\Support\Collection | [
"Return",
"all",
"thumbnails",
"."
] | 5ea35c46c2ac1019e277ec4fe698f17581524631 | https://github.com/routegroup/native-media/blob/5ea35c46c2ac1019e277ec4fe698f17581524631/src/Helpers/Thumbnail.php#L86-L102 |
5,885 | neemzy/patchwork-core | src/Controller/EntityController.php | EntityController.connect | public function connect(Application $app)
{
$this->modelProvider = function ($id) use ($app) {
return $app['redbean']->load($this->table, $id);
};
return $app['controllers_factory'];
} | php | public function connect(Application $app)
{
$this->modelProvider = function ($id) use ($app) {
return $app['redbean']->load($this->table, $id);
};
return $app['controllers_factory'];
} | [
"public",
"function",
"connect",
"(",
"Application",
"$",
"app",
")",
"{",
"$",
"this",
"->",
"modelProvider",
"=",
"function",
"(",
"$",
"id",
")",
"use",
"(",
"$",
"app",
")",
"{",
"return",
"$",
"app",
"[",
"'redbean'",
"]",
"->",
"load",
"(",
"... | Silex method that exposes routes to the app
Attaches a model provider to the controller
@param Silex\Application $app Application instance
@return Silex\ControllerCollection Object encapsulating crafted routes | [
"Silex",
"method",
"that",
"exposes",
"routes",
"to",
"the",
"app",
"Attaches",
"a",
"model",
"provider",
"to",
"the",
"controller"
] | 81c31b5c0b3a82a04ed90eb17cefaf2faddee4ee | https://github.com/neemzy/patchwork-core/blob/81c31b5c0b3a82a04ed90eb17cefaf2faddee4ee/src/Controller/EntityController.php#L44-L51 |
5,886 | Apatis/Prima | src/Service.php | Service.getNormalizeResponseChunkSize | public function getNormalizeResponseChunkSize() : int
{
$chunkSize = $this->getConfiguration('responseChunkSize', static::DEFAULT_CHUNK_SIZE);
$chunkSize = ! is_numeric($chunkSize) ? static::DEFAULT_CHUNK_SIZE : intval(abs($chunkSize));
$chunkSize = $chunkSize < 512 ? 512 : $c... | php | public function getNormalizeResponseChunkSize() : int
{
$chunkSize = $this->getConfiguration('responseChunkSize', static::DEFAULT_CHUNK_SIZE);
$chunkSize = ! is_numeric($chunkSize) ? static::DEFAULT_CHUNK_SIZE : intval(abs($chunkSize));
$chunkSize = $chunkSize < 512 ? 512 : $c... | [
"public",
"function",
"getNormalizeResponseChunkSize",
"(",
")",
":",
"int",
"{",
"$",
"chunkSize",
"=",
"$",
"this",
"->",
"getConfiguration",
"(",
"'responseChunkSize'",
",",
"static",
"::",
"DEFAULT_CHUNK_SIZE",
")",
";",
"$",
"chunkSize",
"=",
"!",
"is_numer... | Get normalized chunk size from configuration
@return int chunk size | [
"Get",
"normalized",
"chunk",
"size",
"from",
"configuration"
] | 342cb8e51f185413a2ee1a769674da0bdc7368e6 | https://github.com/Apatis/Prima/blob/342cb8e51f185413a2ee1a769674da0bdc7368e6/src/Service.php#L281-L287 |
5,887 | Apatis/Prima | src/Service.php | Service.setConfig | public function setConfig(ConfigInterface $config)
{
// get keys & flip
$configKeys = array_flip($config->keys());
// put default config
foreach ($this->defaultConfiguration as $key => $value) {
if (!isset($configKeys[$key])) {
$config->set($key, $value);
... | php | public function setConfig(ConfigInterface $config)
{
// get keys & flip
$configKeys = array_flip($config->keys());
// put default config
foreach ($this->defaultConfiguration as $key => $value) {
if (!isset($configKeys[$key])) {
$config->set($key, $value);
... | [
"public",
"function",
"setConfig",
"(",
"ConfigInterface",
"$",
"config",
")",
"{",
"// get keys & flip",
"$",
"configKeys",
"=",
"array_flip",
"(",
"$",
"config",
"->",
"keys",
"(",
")",
")",
";",
"// put default config",
"foreach",
"(",
"$",
"this",
"->",
... | Set config object
Behavior this will be override your current configuration
@param ConfigInterface $config | [
"Set",
"config",
"object",
"Behavior",
"this",
"will",
"be",
"override",
"your",
"current",
"configuration"
] | 342cb8e51f185413a2ee1a769674da0bdc7368e6 | https://github.com/Apatis/Prima/blob/342cb8e51f185413a2ee1a769674da0bdc7368e6/src/Service.php#L326-L338 |
5,888 | Apatis/Prima | src/Service.php | Service.getRouter | public function getRouter() : RouterInterface
{
if (! $this->router instanceof RouterInterface) {
$router = new Router();
$resolver = $this->getCallbackResolver();
if ($resolver instanceof CallbackResolverInterface) {
$router->setCallbackResolver($resolver... | php | public function getRouter() : RouterInterface
{
if (! $this->router instanceof RouterInterface) {
$router = new Router();
$resolver = $this->getCallbackResolver();
if ($resolver instanceof CallbackResolverInterface) {
$router->setCallbackResolver($resolver... | [
"public",
"function",
"getRouter",
"(",
")",
":",
"RouterInterface",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"router",
"instanceof",
"RouterInterface",
")",
"{",
"$",
"router",
"=",
"new",
"Router",
"(",
")",
";",
"$",
"resolver",
"=",
"$",
"this",
"->... | Get router handler
@return RouterInterface | [
"Get",
"router",
"handler"
] | 342cb8e51f185413a2ee1a769674da0bdc7368e6 | https://github.com/Apatis/Prima/blob/342cb8e51f185413a2ee1a769674da0bdc7368e6/src/Service.php#L406-L424 |
5,889 | Apatis/Prima | src/Service.php | Service.getCallbackResolver | public function getCallbackResolver()
{
if (! $this->callbackResolver instanceof CallbackResolverInterface) {
$this->callbackResolver = new CallbackResolver($this);
}
return $this->callbackResolver;
} | php | public function getCallbackResolver()
{
if (! $this->callbackResolver instanceof CallbackResolverInterface) {
$this->callbackResolver = new CallbackResolver($this);
}
return $this->callbackResolver;
} | [
"public",
"function",
"getCallbackResolver",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"callbackResolver",
"instanceof",
"CallbackResolverInterface",
")",
"{",
"$",
"this",
"->",
"callbackResolver",
"=",
"new",
"CallbackResolver",
"(",
"$",
"this",
")",
... | Get callable resolver
@return CallbackResolverInterface|null | [
"Get",
"callable",
"resolver"
] | 342cb8e51f185413a2ee1a769674da0bdc7368e6 | https://github.com/Apatis/Prima/blob/342cb8e51f185413a2ee1a769674da0bdc7368e6/src/Service.php#L443-L450 |
5,890 | Apatis/Prima | src/Service.php | Service.shutdownHandlerCallback | protected function shutdownHandlerCallback(
ServerRequestInterface $request,
ResponseInterface $response
) : callable {
/**
* Shutdown Handler
*/
return function () use($request, $response) {
if ($this->haltShutDown === true) {
return;
... | php | protected function shutdownHandlerCallback(
ServerRequestInterface $request,
ResponseInterface $response
) : callable {
/**
* Shutdown Handler
*/
return function () use($request, $response) {
if ($this->haltShutDown === true) {
return;
... | [
"protected",
"function",
"shutdownHandlerCallback",
"(",
"ServerRequestInterface",
"$",
"request",
",",
"ResponseInterface",
"$",
"response",
")",
":",
"callable",
"{",
"/**\n * Shutdown Handler\n */",
"return",
"function",
"(",
")",
"use",
"(",
"$",
"re... | Shutdown Handler callback to print Output Response
@param ServerRequestInterface $request
@param ResponseInterface $response
@return callable | [
"Shutdown",
"Handler",
"callback",
"to",
"print",
"Output",
"Response"
] | 342cb8e51f185413a2ee1a769674da0bdc7368e6 | https://github.com/Apatis/Prima/blob/342cb8e51f185413a2ee1a769674da0bdc7368e6/src/Service.php#L579-L607 |
5,891 | Apatis/Prima | src/Service.php | Service.handleForResponseException | protected function handleForResponseException(
ServerRequestInterface $request,
ResponseInterface $response,
\Throwable $e
) : ResponseInterface {
if ($e instanceof MethodNotAllowedException) {
$handler = $this->getNotAllowedHandler();
} elseif ($e instanceof NotF... | php | protected function handleForResponseException(
ServerRequestInterface $request,
ResponseInterface $response,
\Throwable $e
) : ResponseInterface {
if ($e instanceof MethodNotAllowedException) {
$handler = $this->getNotAllowedHandler();
} elseif ($e instanceof NotF... | [
"protected",
"function",
"handleForResponseException",
"(",
"ServerRequestInterface",
"$",
"request",
",",
"ResponseInterface",
"$",
"response",
",",
"\\",
"Throwable",
"$",
"e",
")",
":",
"ResponseInterface",
"{",
"if",
"(",
"$",
"e",
"instanceof",
"MethodNotAllowe... | Handle Response Exception
@param ServerRequestInterface $request
@param ResponseInterface $response
@param \Throwable $e
@return ResponseInterface | [
"Handle",
"Response",
"Exception"
] | 342cb8e51f185413a2ee1a769674da0bdc7368e6 | https://github.com/Apatis/Prima/blob/342cb8e51f185413a2ee1a769674da0bdc7368e6/src/Service.php#L817-L840 |
5,892 | Apatis/Prima | src/Service.php | Service.dispatchRouterRoute | protected function dispatchRouterRoute(
ServerRequestInterface $request,
RouterInterface $router
) : ServerRequestInterface {
$routeInfo = $router->dispatch($request);
if ($routeInfo[0] === Dispatcher::FOUND) {
$routeArguments = [];
foreach ($routeInfo[2] as $... | php | protected function dispatchRouterRoute(
ServerRequestInterface $request,
RouterInterface $router
) : ServerRequestInterface {
$routeInfo = $router->dispatch($request);
if ($routeInfo[0] === Dispatcher::FOUND) {
$routeArguments = [];
foreach ($routeInfo[2] as $... | [
"protected",
"function",
"dispatchRouterRoute",
"(",
"ServerRequestInterface",
"$",
"request",
",",
"RouterInterface",
"$",
"router",
")",
":",
"ServerRequestInterface",
"{",
"$",
"routeInfo",
"=",
"$",
"router",
"->",
"dispatch",
"(",
"$",
"request",
")",
";",
... | Dispatch the router to find the route. Prepare the route for use.
@param ServerRequestInterface $request
@param RouterInterface $router
@return ServerRequestInterface | [
"Dispatch",
"the",
"router",
"to",
"find",
"the",
"route",
".",
"Prepare",
"the",
"route",
"for",
"use",
"."
] | 342cb8e51f185413a2ee1a769674da0bdc7368e6 | https://github.com/Apatis/Prima/blob/342cb8e51f185413a2ee1a769674da0bdc7368e6/src/Service.php#L960-L981 |
5,893 | derokorian/gen-synth | src/GenSynth.php | GenSynth.highlight_string | public static function highlight_string($source, $language, $return = false, $opts = 0)
{
if (is_int($return)) {
$opts = $return;
$return = false;
}
$gs = new static($source, $language, $opts);
$s = $gs->parseCode();
if ($gs->error()) {
... | php | public static function highlight_string($source, $language, $return = false, $opts = 0)
{
if (is_int($return)) {
$opts = $return;
$return = false;
}
$gs = new static($source, $language, $opts);
$s = $gs->parseCode();
if ($gs->error()) {
... | [
"public",
"static",
"function",
"highlight_string",
"(",
"$",
"source",
",",
"$",
"language",
",",
"$",
"return",
"=",
"false",
",",
"$",
"opts",
"=",
"0",
")",
"{",
"if",
"(",
"is_int",
"(",
"$",
"return",
")",
")",
"{",
"$",
"opts",
"=",
"$",
"... | Easy way to highlight stuff. Behaves just like highlight_string
@param string $source
@param string $language
@param bool $return [Default: false] *Can be skipped*
@param int $opts [Default: 0]
@return bool|string | [
"Easy",
"way",
"to",
"highlight",
"stuff",
".",
"Behaves",
"just",
"like",
"highlight_string"
] | 7114d25246da3f34adfb0ffd68464f2fca12df47 | https://github.com/derokorian/gen-synth/blob/7114d25246da3f34adfb0ffd68464f2fca12df47/src/GenSynth.php#L389-L409 |
5,894 | derokorian/gen-synth | src/GenSynth.php | GenSynth.highlight_file | public static function highlight_file($filename, $language = '', $return = false, $opts = 0)
{
if (is_bool($language)) {
!is_int($return) ?: $opts = $return;
$return = $language;
$language = '';
}
elseif (is_int($language)) {
$opts = $l... | php | public static function highlight_file($filename, $language = '', $return = false, $opts = 0)
{
if (is_bool($language)) {
!is_int($return) ?: $opts = $return;
$return = $language;
$language = '';
}
elseif (is_int($language)) {
$opts = $l... | [
"public",
"static",
"function",
"highlight_file",
"(",
"$",
"filename",
",",
"$",
"language",
"=",
"''",
",",
"$",
"return",
"=",
"false",
",",
"$",
"opts",
"=",
"0",
")",
"{",
"if",
"(",
"is_bool",
"(",
"$",
"language",
")",
")",
"{",
"!",
"is_int... | Easy way to highlight stuff. Behaves just like highlight_file
@param string $filename the full filepath of the file to highlight
@param string $language language to use
(will try to determine from extension if not provided)
[Default: ''] *Can be skipped*
@param bool $return [Default: false] *Can be skipped*
@pa... | [
"Easy",
"way",
"to",
"highlight",
"stuff",
".",
"Behaves",
"just",
"like",
"highlight_file"
] | 7114d25246da3f34adfb0ffd68464f2fca12df47 | https://github.com/derokorian/gen-synth/blob/7114d25246da3f34adfb0ffd68464f2fca12df47/src/GenSynth.php#L423-L459 |
5,895 | derokorian/gen-synth | src/GenSynth.php | GenSynth.enable_highlighting | function enable_highlighting($flag = true)
{
$flag = $flag ? true : false;
foreach ($this->lexic_permissions as $key => $value) {
if (is_array($value)) {
foreach ($value as $k => $v) {
$this->lexic_permissions[$key][$k] = $flag;
... | php | function enable_highlighting($flag = true)
{
$flag = $flag ? true : false;
foreach ($this->lexic_permissions as $key => $value) {
if (is_array($value)) {
foreach ($value as $k => $v) {
$this->lexic_permissions[$key][$k] = $flag;
... | [
"function",
"enable_highlighting",
"(",
"$",
"flag",
"=",
"true",
")",
"{",
"$",
"flag",
"=",
"$",
"flag",
"?",
"true",
":",
"false",
";",
"foreach",
"(",
"$",
"this",
"->",
"lexic_permissions",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
... | Enables all highlighting
The optional flag parameter was added in version 1.0.7.21 and can be used
to enable (true) or disable (false) all highlighting.
@param boolean A flag specifying whether to enable or disable all highlighting
@todo Rewrite with array traversal | [
"Enables",
"all",
"highlighting"
] | 7114d25246da3f34adfb0ffd68464f2fca12df47 | https://github.com/derokorian/gen-synth/blob/7114d25246da3f34adfb0ffd68464f2fca12df47/src/GenSynth.php#L608-L621 |
5,896 | derokorian/gen-synth | src/GenSynth.php | GenSynth.error | public function error()
{
if ($this->error) {
$debug_tpl_vars = [
'{LANGUAGE}' => $this->language,
'{PATH}' => self::LANG_ROOT,
];
$msg = strtr($this->error_messages[$this->error], $debug_tpl_vars);
return "<br /><... | php | public function error()
{
if ($this->error) {
$debug_tpl_vars = [
'{LANGUAGE}' => $this->language,
'{PATH}' => self::LANG_ROOT,
];
$msg = strtr($this->error_messages[$this->error], $debug_tpl_vars);
return "<br /><... | [
"public",
"function",
"error",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"error",
")",
"{",
"$",
"debug_tpl_vars",
"=",
"[",
"'{LANGUAGE}'",
"=>",
"$",
"this",
"->",
"language",
",",
"'{PATH}'",
"=>",
"self",
"::",
"LANG_ROOT",
",",
"]",
";",
"$",... | Returns an error message associated with the last GenSynth operation
@return string|false An error message if there has been an error, else false | [
"Returns",
"an",
"error",
"message",
"associated",
"with",
"the",
"last",
"GenSynth",
"operation"
] | 7114d25246da3f34adfb0ffd68464f2fca12df47 | https://github.com/derokorian/gen-synth/blob/7114d25246da3f34adfb0ffd68464f2fca12df47/src/GenSynth.php#L706-L719 |
5,897 | derokorian/gen-synth | src/GenSynth.php | GenSynth.get_language_name_from_extension | function get_language_name_from_extension($ext, $lookup = [])
{
$ext = strtolower($ext);
if (!is_array($lookup) || empty($lookup)) {
$lookup = [
'as' => 'actionscript',
'as3' => 'actionscript3',
'conf' => 'apache',
... | php | function get_language_name_from_extension($ext, $lookup = [])
{
$ext = strtolower($ext);
if (!is_array($lookup) || empty($lookup)) {
$lookup = [
'as' => 'actionscript',
'as3' => 'actionscript3',
'conf' => 'apache',
... | [
"function",
"get_language_name_from_extension",
"(",
"$",
"ext",
",",
"$",
"lookup",
"=",
"[",
"]",
")",
"{",
"$",
"ext",
"=",
"strtolower",
"(",
"$",
"ext",
")",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"lookup",
")",
"||",
"empty",
"(",
"$",
"l... | Given a file extension, this method returns either a valid GenSynth language
name, or the empty string if it couldn't be found
@param string The extension to get a language name for
@param array A lookup array to use instead of the default one
@return string | [
"Given",
"a",
"file",
"extension",
"this",
"method",
"returns",
"either",
"a",
"valid",
"GenSynth",
"language",
"name",
"or",
"the",
"empty",
"string",
"if",
"it",
"couldn",
"t",
"be",
"found"
] | 7114d25246da3f34adfb0ffd68464f2fca12df47 | https://github.com/derokorian/gen-synth/blob/7114d25246da3f34adfb0ffd68464f2fca12df47/src/GenSynth.php#L1310-L1360 |
5,898 | derokorian/gen-synth | src/GenSynth.php | GenSynth.remove_keyword | function remove_keyword($key, $word, $recompile = true)
{
$key_to_remove = array_search($word, $this->language_data['KEYWORDS'][$key]);
if ($key_to_remove !== false) {
unset($this->language_data['KEYWORDS'][$key][$key_to_remove]);
//NEW in 1.0.8, optionally recompile k... | php | function remove_keyword($key, $word, $recompile = true)
{
$key_to_remove = array_search($word, $this->language_data['KEYWORDS'][$key]);
if ($key_to_remove !== false) {
unset($this->language_data['KEYWORDS'][$key][$key_to_remove]);
//NEW in 1.0.8, optionally recompile k... | [
"function",
"remove_keyword",
"(",
"$",
"key",
",",
"$",
"word",
",",
"$",
"recompile",
"=",
"true",
")",
"{",
"$",
"key_to_remove",
"=",
"array_search",
"(",
"$",
"word",
",",
"$",
"this",
"->",
"language_data",
"[",
"'KEYWORDS'",
"]",
"[",
"$",
"key"... | Removes a keyword from a keyword group
@param int The key of the keyword group to remove the keyword from
@param string The word to remove from the keyword group
@param bool Wether to automatically recompile the optimized regexp list or not.
Note: if you set this to false and @see GenSynth->parse_code() was alrea... | [
"Removes",
"a",
"keyword",
"from",
"a",
"keyword",
"group"
] | 7114d25246da3f34adfb0ffd68464f2fca12df47 | https://github.com/derokorian/gen-synth/blob/7114d25246da3f34adfb0ffd68464f2fca12df47/src/GenSynth.php#L1396-L1407 |
5,899 | derokorian/gen-synth | src/GenSynth.php | GenSynth.highlight_lines_extra | function highlight_lines_extra($lines, $style = null)
{
if (is_array($lines)) {
//Split up the job using single lines at a time
foreach ($lines as $line) {
$this->highlight_lines_extra($line, $style);
}
}
else {
//Mark ... | php | function highlight_lines_extra($lines, $style = null)
{
if (is_array($lines)) {
//Split up the job using single lines at a time
foreach ($lines as $line) {
$this->highlight_lines_extra($line, $style);
}
}
else {
//Mark ... | [
"function",
"highlight_lines_extra",
"(",
"$",
"lines",
",",
"$",
"style",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"lines",
")",
")",
"{",
"//Split up the job using single lines at a time\r",
"foreach",
"(",
"$",
"lines",
"as",
"$",
"line",
"... | Specifies which lines to highlight extra
The extra style parameter was added in 1.0.7.21.
@param mixed An array of line numbers to highlight, or just a line
number on its own.
@param string A string specifying the style to use for this line.
If null is specified, the default style is used.
If false is specified, the... | [
"Specifies",
"which",
"lines",
"to",
"highlight",
"extra"
] | 7114d25246da3f34adfb0ffd68464f2fca12df47 | https://github.com/derokorian/gen-synth/blob/7114d25246da3f34adfb0ffd68464f2fca12df47/src/GenSynth.php#L1791-L1816 |
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.