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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
14,200 | dphn/ScContent | src/ScContent/Service/Dir.php | Dir.appUploads | public function appUploads($path = '', $checkIfExists = false)
{
$appUploadsDir = getcwd() . $this->getRelativeAppUploadsDir();
if ($checkIfExists) {
return realpath($appUploadsDir . DS . $path);
}
if (empty($path)) {
return $appUploadsDir;
}
r... | php | public function appUploads($path = '', $checkIfExists = false)
{
$appUploadsDir = getcwd() . $this->getRelativeAppUploadsDir();
if ($checkIfExists) {
return realpath($appUploadsDir . DS . $path);
}
if (empty($path)) {
return $appUploadsDir;
}
r... | [
"public",
"function",
"appUploads",
"(",
"$",
"path",
"=",
"''",
",",
"$",
"checkIfExists",
"=",
"false",
")",
"{",
"$",
"appUploadsDir",
"=",
"getcwd",
"(",
")",
".",
"$",
"this",
"->",
"getRelativeAppUploadsDir",
"(",
")",
";",
"if",
"(",
"$",
"check... | Returns the path to the upload directory, or any child path.
If the flag "checkIfExists" is set to TRUE, checks for the specified
path and if the path was not found, returns FALSE.
Usage:
<code>
$dir = $serviceLocator->get('ScService.Dir');
$uploadedFile = $dir->appUploads('test.jpg');
</code>
@api
@param string ... | [
"Returns",
"the",
"path",
"to",
"the",
"upload",
"directory",
"or",
"any",
"child",
"path",
"."
] | 9dd5732490c45fd788b96cedf7b3c7adfacb30d2 | https://github.com/dphn/ScContent/blob/9dd5732490c45fd788b96cedf7b3c7adfacb30d2/src/ScContent/Service/Dir.php#L236-L246 |
14,201 | andylolz/everypolitician-popolo-php | src/Popolo.php | Popolo.fromFilename | public static function fromFilename($filename)
{
$contents = file_get_contents($filename);
$jsonData = json_decode($contents, true);
$instance = new self($jsonData);
return $instance;
} | php | public static function fromFilename($filename)
{
$contents = file_get_contents($filename);
$jsonData = json_decode($contents, true);
$instance = new self($jsonData);
return $instance;
} | [
"public",
"static",
"function",
"fromFilename",
"(",
"$",
"filename",
")",
"{",
"$",
"contents",
"=",
"file_get_contents",
"(",
"$",
"filename",
")",
";",
"$",
"jsonData",
"=",
"json_decode",
"(",
"$",
"contents",
",",
"true",
")",
";",
"$",
"instance",
... | Construct from filename
@param string $filename name of Popolo json file
@return $this | [
"Construct",
"from",
"filename"
] | 701fca91b782871d463cfb56f3c1c7afb121eb9f | https://github.com/andylolz/everypolitician-popolo-php/blob/701fca91b782871d463cfb56f3c1c7afb121eb9f/src/Popolo.php#L48-L54 |
14,202 | andylolz/everypolitician-popolo-php | src/Popolo.php | Popolo.fromUrl | public static function fromUrl($url)
{
$client = new GuzzleHttp\Client();
$response = $client->get($url);
$jsonData = json_decode($response->getBody(), true);
$instance = new self($jsonData);
return $instance;
} | php | public static function fromUrl($url)
{
$client = new GuzzleHttp\Client();
$response = $client->get($url);
$jsonData = json_decode($response->getBody(), true);
$instance = new self($jsonData);
return $instance;
} | [
"public",
"static",
"function",
"fromUrl",
"(",
"$",
"url",
")",
"{",
"$",
"client",
"=",
"new",
"GuzzleHttp",
"\\",
"Client",
"(",
")",
";",
"$",
"response",
"=",
"$",
"client",
"->",
"get",
"(",
"$",
"url",
")",
";",
"$",
"jsonData",
"=",
"json_d... | Construct from URL
@param string $url location of Popolo json file
@return $this | [
"Construct",
"from",
"URL"
] | 701fca91b782871d463cfb56f3c1c7afb121eb9f | https://github.com/andylolz/everypolitician-popolo-php/blob/701fca91b782871d463cfb56f3c1c7afb121eb9f/src/Popolo.php#L63-L70 |
14,203 | hfcorriez/php-childprocess | lib/Pagon/Process.php | Process.register | public function register(\Closure $runner, $options = array())
{
$this->runner = $runner;
$this->options = $options;
return $this;
} | php | public function register(\Closure $runner, $options = array())
{
$this->runner = $runner;
$this->options = $options;
return $this;
} | [
"public",
"function",
"register",
"(",
"\\",
"Closure",
"$",
"runner",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"runner",
"=",
"$",
"runner",
";",
"$",
"this",
"->",
"options",
"=",
"$",
"options",
";",
"return",
"$... | Register the runner and options for delay run
@param \Closure $runner
@param array $options
@return $this | [
"Register",
"the",
"runner",
"and",
"options",
"for",
"delay",
"run"
] | 92481a85783cf2a24fef1760930f1252bb83fa5d | https://github.com/hfcorriez/php-childprocess/blob/92481a85783cf2a24fef1760930f1252bb83fa5d/lib/Pagon/Process.php#L154-L159 |
14,204 | hfcorriez/php-childprocess | lib/Pagon/Process.php | Process.send | public function send($msg)
{
// Check queue and send messages
if ($this->queue && is_resource($this->queue) && msg_stat_queue($this->queue)) {
return msg_send($this->queue, 1, array(
'from' => $this->isMaster() ? $this->ppid : $this->pid,
'to' => $this->... | php | public function send($msg)
{
// Check queue and send messages
if ($this->queue && is_resource($this->queue) && msg_stat_queue($this->queue)) {
return msg_send($this->queue, 1, array(
'from' => $this->isMaster() ? $this->ppid : $this->pid,
'to' => $this->... | [
"public",
"function",
"send",
"(",
"$",
"msg",
")",
"{",
"// Check queue and send messages",
"if",
"(",
"$",
"this",
"->",
"queue",
"&&",
"is_resource",
"(",
"$",
"this",
"->",
"queue",
")",
"&&",
"msg_stat_queue",
"(",
"$",
"this",
"->",
"queue",
")",
"... | Send msg to child process
@param mixed $msg
@return bool | [
"Send",
"msg",
"to",
"child",
"process"
] | 92481a85783cf2a24fef1760930f1252bb83fa5d | https://github.com/hfcorriez/php-childprocess/blob/92481a85783cf2a24fef1760930f1252bb83fa5d/lib/Pagon/Process.php#L187-L198 |
14,205 | astronati/php-fantasy-football-quotations-parser | src/Map/MapAbstract.php | MapAbstract.getStartingRow | private function getStartingRow($sheet): int
{
$row = null;
for ($i = 1; $i <= 4 && !$row; $i++) {
if ($sheet->getCellByColumnAndRow(1, $i) == "Cod.") {
$row = $i + 1;
}
}
return $row;
} | php | private function getStartingRow($sheet): int
{
$row = null;
for ($i = 1; $i <= 4 && !$row; $i++) {
if ($sheet->getCellByColumnAndRow(1, $i) == "Cod.") {
$row = $i + 1;
}
}
return $row;
} | [
"private",
"function",
"getStartingRow",
"(",
"$",
"sheet",
")",
":",
"int",
"{",
"$",
"row",
"=",
"null",
";",
"for",
"(",
"$",
"i",
"=",
"1",
";",
"$",
"i",
"<=",
"4",
"&&",
"!",
"$",
"row",
";",
"$",
"i",
"++",
")",
"{",
"if",
"(",
"$",
... | Returns the spreadsheet row number for which the extractor should start extracting row data.
@param Worksheet $sheet
@return int | [
"Returns",
"the",
"spreadsheet",
"row",
"number",
"for",
"which",
"the",
"extractor",
"should",
"start",
"extracting",
"row",
"data",
"."
] | 1214f313c325ac7e9fc4d5218b85b3d7234f7bf3 | https://github.com/astronati/php-fantasy-football-quotations-parser/blob/1214f313c325ac7e9fc4d5218b85b3d7234f7bf3/src/Map/MapAbstract.php#L53-L63 |
14,206 | ronan-gloo/jade-php | src/Jade/Filter/AbstractFilter.php | AbstractFilter.getNodeString | protected function getNodeString(Filter $node, Compiler $compiler = null)
{
return array_reduce($node->block->nodes, function(&$result, $line) use($compiler) {
$val = $compiler ? $compiler->interpolate($line->value) : $line->value;
return $result .= $val."\n";
});
} | php | protected function getNodeString(Filter $node, Compiler $compiler = null)
{
return array_reduce($node->block->nodes, function(&$result, $line) use($compiler) {
$val = $compiler ? $compiler->interpolate($line->value) : $line->value;
return $result .= $val."\n";
});
} | [
"protected",
"function",
"getNodeString",
"(",
"Filter",
"$",
"node",
",",
"Compiler",
"$",
"compiler",
"=",
"null",
")",
"{",
"return",
"array_reduce",
"(",
"$",
"node",
"->",
"block",
"->",
"nodes",
",",
"function",
"(",
"&",
"$",
"result",
",",
"$",
... | Returns the node string value, line by line.
If the compiler is present, that means we need
to interpolate line contents
@param Filter $node
@param Compiler $compiler
@return mixed | [
"Returns",
"the",
"node",
"string",
"value",
"line",
"by",
"line",
".",
"If",
"the",
"compiler",
"is",
"present",
"that",
"means",
"we",
"need",
"to",
"interpolate",
"line",
"contents"
] | 77230d2eef2f0d4f045292a5906162f0c0499421 | https://github.com/ronan-gloo/jade-php/blob/77230d2eef2f0d4f045292a5906162f0c0499421/src/Jade/Filter/AbstractFilter.php#L21-L27 |
14,207 | ssheduardo/didimo | src/Sms.php | Sms.createSend | public function createSend($sender='', $messages=array(), $scheduledate='')
{
$message_sender = array();
$index = 0;
$url = $this->_setEnvironment.'wcf/Service.svc/rest/CreateSend';
if(is_array($messages)) {
foreach($messages as $mobile => $message){
$me... | php | public function createSend($sender='', $messages=array(), $scheduledate='')
{
$message_sender = array();
$index = 0;
$url = $this->_setEnvironment.'wcf/Service.svc/rest/CreateSend';
if(is_array($messages)) {
foreach($messages as $mobile => $message){
$me... | [
"public",
"function",
"createSend",
"(",
"$",
"sender",
"=",
"''",
",",
"$",
"messages",
"=",
"array",
"(",
")",
",",
"$",
"scheduledate",
"=",
"''",
")",
"{",
"$",
"message_sender",
"=",
"array",
"(",
")",
";",
"$",
"index",
"=",
"0",
";",
"$",
... | This operation allows you to send 1 or more messages in a single call.
@param string $sender Message sender. If informed, it must be a maximum of 11 characters. If not reported, the API will use the user-defined sender.
@param array $messages With the messages to send.
@param string $scheduledate Optional. Date and tim... | [
"This",
"operation",
"allows",
"you",
"to",
"send",
"1",
"or",
"more",
"messages",
"in",
"a",
"single",
"call",
"."
] | 6c5bd8b03000f40b13661c3fd6ffa1e44f4da945 | https://github.com/ssheduardo/didimo/blob/6c5bd8b03000f40b13661c3fd6ffa1e44f4da945/src/Sms.php#L70-L108 |
14,208 | ssheduardo/didimo | src/Sms.php | Sms.createMessage | public function createMessage($sender='',$mobile='', $message='', $scheduledate='')
{
$url = $this->_setEnvironment.'wcf/Service.svc/rest/CreateMessage';
$json = array(
'UserName' => $this->user,
'Password' => $this->password,
'Sender' => $sender... | php | public function createMessage($sender='',$mobile='', $message='', $scheduledate='')
{
$url = $this->_setEnvironment.'wcf/Service.svc/rest/CreateMessage';
$json = array(
'UserName' => $this->user,
'Password' => $this->password,
'Sender' => $sender... | [
"public",
"function",
"createMessage",
"(",
"$",
"sender",
"=",
"''",
",",
"$",
"mobile",
"=",
"''",
",",
"$",
"message",
"=",
"''",
",",
"$",
"scheduledate",
"=",
"''",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"_setEnvironment",
".",
"'wcf/Serv... | This operation allows you to send 1 message on a single call.
@param string $sender Message sender. If informed, it must be a maximum of 11 characters. If not reported, the API will use the user-defined sender.
@param string $mobile Recipient of the message. Information is available in international (+34699999999,0034... | [
"This",
"operation",
"allows",
"you",
"to",
"send",
"1",
"message",
"on",
"a",
"single",
"call",
"."
] | 6c5bd8b03000f40b13661c3fd6ffa1e44f4da945 | https://github.com/ssheduardo/didimo/blob/6c5bd8b03000f40b13661c3fd6ffa1e44f4da945/src/Sms.php#L119-L148 |
14,209 | ssheduardo/didimo | src/Sms.php | Sms.statusCodeHandling | protected function statusCodeHandling($e)
{
$response =(object)array(
"Status" => $e->getResponse()->getStatusCode(),
"Error" => json_decode($e->getResponse()->getBody(true)->getContents())
);
return $response;
} | php | protected function statusCodeHandling($e)
{
$response =(object)array(
"Status" => $e->getResponse()->getStatusCode(),
"Error" => json_decode($e->getResponse()->getBody(true)->getContents())
);
return $response;
} | [
"protected",
"function",
"statusCodeHandling",
"(",
"$",
"e",
")",
"{",
"$",
"response",
"=",
"(",
"object",
")",
"array",
"(",
"\"Status\"",
"=>",
"$",
"e",
"->",
"getResponse",
"(",
")",
"->",
"getStatusCode",
"(",
")",
",",
"\"Error\"",
"=>",
"json_de... | Return message error
@param $e
@return array | [
"Return",
"message",
"error"
] | 6c5bd8b03000f40b13661c3fd6ffa1e44f4da945 | https://github.com/ssheduardo/didimo/blob/6c5bd8b03000f40b13661c3fd6ffa1e44f4da945/src/Sms.php#L257-L264 |
14,210 | cpliakas/search-framework | src/Search/Framework/Collector.php | Collector.queue | public function queue()
{
$log = $this->getLogger();
$log->info('Queueing operation started', array('collections' => count($this)));
$event = new CollectorEvent($this);
$this->dispatchEvent(SearchEvents::COLLECTOR_PRE_QUEUE, $event);
$num_queued = 0;
foreach ($this-... | php | public function queue()
{
$log = $this->getLogger();
$log->info('Queueing operation started', array('collections' => count($this)));
$event = new CollectorEvent($this);
$this->dispatchEvent(SearchEvents::COLLECTOR_PRE_QUEUE, $event);
$num_queued = 0;
foreach ($this-... | [
"public",
"function",
"queue",
"(",
")",
"{",
"$",
"log",
"=",
"$",
"this",
"->",
"getLogger",
"(",
")",
";",
"$",
"log",
"->",
"info",
"(",
"'Queueing operation started'",
",",
"array",
"(",
"'collections'",
"=>",
"count",
"(",
"$",
"this",
")",
")",
... | Queues the items scheduled for indexing for all collections attached to
the collector.
@return int
The number of items sent to the queue. | [
"Queues",
"the",
"items",
"scheduled",
"for",
"indexing",
"for",
"all",
"collections",
"attached",
"to",
"the",
"collector",
"."
] | 7c5832d38ed998e04837c26e0daef59115563b98 | https://github.com/cpliakas/search-framework/blob/7c5832d38ed998e04837c26e0daef59115563b98/src/Search/Framework/Collector.php#L50-L67 |
14,211 | cpliakas/search-framework | src/Search/Framework/Collector.php | Collector.queueCollection | public function queueCollection(CollectionAbstract $collection)
{
$log = $this->getLogger();
$context = array('collection' => $collection->getId());
$log->info('Begin fetching items that are scheduled for indexing', $context);
$event = new CollectionEvent($this, $collection);
... | php | public function queueCollection(CollectionAbstract $collection)
{
$log = $this->getLogger();
$context = array('collection' => $collection->getId());
$log->info('Begin fetching items that are scheduled for indexing', $context);
$event = new CollectionEvent($this, $collection);
... | [
"public",
"function",
"queueCollection",
"(",
"CollectionAbstract",
"$",
"collection",
")",
"{",
"$",
"log",
"=",
"$",
"this",
"->",
"getLogger",
"(",
")",
";",
"$",
"context",
"=",
"array",
"(",
"'collection'",
"=>",
"$",
"collection",
"->",
"getId",
"(",... | Queues the items scheduled for indexing for the collection.
@param CollectionAbstract $collection
The collection that fetches the items scheduled for indexing.
@return int
The number of items sent to the queue. | [
"Queues",
"the",
"items",
"scheduled",
"for",
"indexing",
"for",
"the",
"collection",
"."
] | 7c5832d38ed998e04837c26e0daef59115563b98 | https://github.com/cpliakas/search-framework/blob/7c5832d38ed998e04837c26e0daef59115563b98/src/Search/Framework/Collector.php#L78-L108 |
14,212 | antarestupin/Accessible | lib/Accessible/Reader/AutoConstructReader.php | AutoConstructReader.getConstructArguments | public static function getConstructArguments($objectClasses, $annotationReader)
{
$constructArguments = null;
array_reverse($objectClasses);
foreach ($objectClasses as $class) {
$annotation = $annotationReader->getClassAnnotation($class, self::$constructAnnotationClass);
... | php | public static function getConstructArguments($objectClasses, $annotationReader)
{
$constructArguments = null;
array_reverse($objectClasses);
foreach ($objectClasses as $class) {
$annotation = $annotationReader->getClassAnnotation($class, self::$constructAnnotationClass);
... | [
"public",
"static",
"function",
"getConstructArguments",
"(",
"$",
"objectClasses",
",",
"$",
"annotationReader",
")",
"{",
"$",
"constructArguments",
"=",
"null",
";",
"array_reverse",
"(",
"$",
"objectClasses",
")",
";",
"foreach",
"(",
"$",
"objectClasses",
"... | Get the list of needed arguments for given object's constructor.
@param array $objectClasses The classes of the object to read.
@param \Doctrine\Common\Annotations\Reader $annotationReader The annotation reader to use.
@return array The list of arguments. | [
"Get",
"the",
"list",
"of",
"needed",
"arguments",
"for",
"given",
"object",
"s",
"constructor",
"."
] | d12ce93d72f74c099dfd2109371fcd6ddfffdca4 | https://github.com/antarestupin/Accessible/blob/d12ce93d72f74c099dfd2109371fcd6ddfffdca4/lib/Accessible/Reader/AutoConstructReader.php#L36-L50 |
14,213 | antarestupin/Accessible | lib/Accessible/Reader/AutoConstructReader.php | AutoConstructReader.getPropertiesToInitialize | public static function getPropertiesToInitialize($properties, $annotationReader)
{
$propertiesValues = array();
foreach ($properties as $propertyName => $property) {
$initializeAnnotation = $annotationReader->getPropertyAnnotation($property, self::$initializeAnnotationClass);
... | php | public static function getPropertiesToInitialize($properties, $annotationReader)
{
$propertiesValues = array();
foreach ($properties as $propertyName => $property) {
$initializeAnnotation = $annotationReader->getPropertyAnnotation($property, self::$initializeAnnotationClass);
... | [
"public",
"static",
"function",
"getPropertiesToInitialize",
"(",
"$",
"properties",
",",
"$",
"annotationReader",
")",
"{",
"$",
"propertiesValues",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"properties",
"as",
"$",
"propertyName",
"=>",
"$",
"propert... | Get the list of properties that have to be initialized automatically
during the object construction, plus their value.
@param array $properties The properties of the object to read.
@param \Doctrine\Common\Annotations\Reader $annotationReader The annotation reader to use.
@return array The list of properties and val... | [
"Get",
"the",
"list",
"of",
"properties",
"that",
"have",
"to",
"be",
"initialized",
"automatically",
"during",
"the",
"object",
"construction",
"plus",
"their",
"value",
"."
] | d12ce93d72f74c099dfd2109371fcd6ddfffdca4 | https://github.com/antarestupin/Accessible/blob/d12ce93d72f74c099dfd2109371fcd6ddfffdca4/lib/Accessible/Reader/AutoConstructReader.php#L62-L88 |
14,214 | vi-kon/laravel-parser | src/ViKon/Parser/lexer/Lexer.php | Lexer.addSinglePattern | public function addSinglePattern($pattern, $ruleName, $childRuleName) {
return $this->addPattern($pattern, $ruleName, self::SINGLE_RULE_PREFIX . $childRuleName);
} | php | public function addSinglePattern($pattern, $ruleName, $childRuleName) {
return $this->addPattern($pattern, $ruleName, self::SINGLE_RULE_PREFIX . $childRuleName);
} | [
"public",
"function",
"addSinglePattern",
"(",
"$",
"pattern",
",",
"$",
"ruleName",
",",
"$",
"childRuleName",
")",
"{",
"return",
"$",
"this",
"->",
"addPattern",
"(",
"$",
"pattern",
",",
"$",
"ruleName",
",",
"self",
"::",
"SINGLE_RULE_PREFIX",
".",
"$... | Add single pattern. If pattern match change to provided rule and immediately back
@param string $pattern regexp pattern
@param string $ruleName rule name
@param string $childRuleName child rule name (next rule)
@return \ViKon\Parser\Lexer\Lexer | [
"Add",
"single",
"pattern",
".",
"If",
"pattern",
"match",
"change",
"to",
"provided",
"rule",
"and",
"immediately",
"back"
] | 070f0bb9120cb9ca6ff836d4f418e78ee33ee182 | https://github.com/vi-kon/laravel-parser/blob/070f0bb9120cb9ca6ff836d4f418e78ee33ee182/src/ViKon/Parser/lexer/Lexer.php#L83-L85 |
14,215 | vi-kon/laravel-parser | src/ViKon/Parser/lexer/Lexer.php | Lexer.addPattern | protected function addPattern($pattern, $ruleName, $childRuleName = null) {
if (!isset($this->patterns[$ruleName])) {
$this->patterns[$ruleName] = new LexerPattern($ruleName);
}
$this->patterns[$ruleName]->addPattern($pattern, $childRuleName);
return $this;
} | php | protected function addPattern($pattern, $ruleName, $childRuleName = null) {
if (!isset($this->patterns[$ruleName])) {
$this->patterns[$ruleName] = new LexerPattern($ruleName);
}
$this->patterns[$ruleName]->addPattern($pattern, $childRuleName);
return $this;
} | [
"protected",
"function",
"addPattern",
"(",
"$",
"pattern",
",",
"$",
"ruleName",
",",
"$",
"childRuleName",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"patterns",
"[",
"$",
"ruleName",
"]",
")",
")",
"{",
"$",
"this",
... | Add pattern to rule patterns
@param string $pattern regex pattern
@param string $ruleName rule name
@param string|null $childRuleName child rule name
@return $this | [
"Add",
"pattern",
"to",
"rule",
"patterns"
] | 070f0bb9120cb9ca6ff836d4f418e78ee33ee182 | https://github.com/vi-kon/laravel-parser/blob/070f0bb9120cb9ca6ff836d4f418e78ee33ee182/src/ViKon/Parser/lexer/Lexer.php#L161-L168 |
14,216 | vi-kon/laravel-parser | src/ViKon/Parser/lexer/Lexer.php | Lexer.reduce | protected function reduce(&$text) {
if (!array_key_exists($this->stack->top(), $this->patterns)) {
return false;
}
if ($text !== '' && ($data = $this->patterns[$this->stack->top()]->split($text)) !== false) {
list($unmatched, $matched, $text, $childRuleName) = $data;
... | php | protected function reduce(&$text) {
if (!array_key_exists($this->stack->top(), $this->patterns)) {
return false;
}
if ($text !== '' && ($data = $this->patterns[$this->stack->top()]->split($text)) !== false) {
list($unmatched, $matched, $text, $childRuleName) = $data;
... | [
"protected",
"function",
"reduce",
"(",
"&",
"$",
"text",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"this",
"->",
"stack",
"->",
"top",
"(",
")",
",",
"$",
"this",
"->",
"patterns",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
... | Reduce input text length by patterns match
@param string $text
@return array|bool FALSE if no valid pattern found, TRUE if input text is empty or split is not succeed,
otherwise array with unmatched, matched part of text and used patterns rule name | [
"Reduce",
"input",
"text",
"length",
"by",
"patterns",
"match"
] | 070f0bb9120cb9ca6ff836d4f418e78ee33ee182 | https://github.com/vi-kon/laravel-parser/blob/070f0bb9120cb9ca6ff836d4f418e78ee33ee182/src/ViKon/Parser/lexer/Lexer.php#L178-L189 |
14,217 | antarestupin/Accessible | lib/Accessible/Reader/AccessReader.php | AccessReader.getAccessProperties | public static function getAccessProperties($properties, $annotationReader)
{
$objectAccessProperties = array();
foreach ($properties as $propertyName => $property) {
if (empty($objectAccessProperties[$propertyName])) {
$objectAccessProperties[$propertyName] = array();
... | php | public static function getAccessProperties($properties, $annotationReader)
{
$objectAccessProperties = array();
foreach ($properties as $propertyName => $property) {
if (empty($objectAccessProperties[$propertyName])) {
$objectAccessProperties[$propertyName] = array();
... | [
"public",
"static",
"function",
"getAccessProperties",
"(",
"$",
"properties",
",",
"$",
"annotationReader",
")",
"{",
"$",
"objectAccessProperties",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"properties",
"as",
"$",
"propertyName",
"=>",
"$",
"propert... | Get a list of properties and the access that are given to them for given object.
@param array $properties The properties of the object to read.
@param Reader $annotationReader The annotation reader to use.
@return array The list of properties and their access. | [
"Get",
"a",
"list",
"of",
"properties",
"and",
"the",
"access",
"that",
"are",
"given",
"to",
"them",
"for",
"given",
"object",
"."
] | d12ce93d72f74c099dfd2109371fcd6ddfffdca4 | https://github.com/antarestupin/Accessible/blob/d12ce93d72f74c099dfd2109371fcd6ddfffdca4/lib/Accessible/Reader/AccessReader.php#L22-L58 |
14,218 | Laralum/Dashboard | src/Widgets.php | Widgets.get | public static function get()
{
$widgets = [];
foreach (Packages::all() as $package) {
$dir = __DIR__.'/../../'.$package.'/src';
$files = is_dir($dir) ? scandir($dir) : [];
foreach ($files as $file) {
if ($file == 'Widgets.json') {
... | php | public static function get()
{
$widgets = [];
foreach (Packages::all() as $package) {
$dir = __DIR__.'/../../'.$package.'/src';
$files = is_dir($dir) ? scandir($dir) : [];
foreach ($files as $file) {
if ($file == 'Widgets.json') {
... | [
"public",
"static",
"function",
"get",
"(",
")",
"{",
"$",
"widgets",
"=",
"[",
"]",
";",
"foreach",
"(",
"Packages",
"::",
"all",
"(",
")",
"as",
"$",
"package",
")",
"{",
"$",
"dir",
"=",
"__DIR__",
".",
"'/../../'",
".",
"$",
"package",
".",
"... | Returns all the widgets. | [
"Returns",
"all",
"the",
"widgets",
"."
] | 2acbef188bdd2d19ed1ac48e28fd74ec2df6ee4b | https://github.com/Laralum/Dashboard/blob/2acbef188bdd2d19ed1ac48e28fd74ec2df6ee4b/src/Widgets.php#L27-L49 |
14,219 | Laralum/Dashboard | src/Widgets.php | Widgets.orderByPreference | public static function orderByPreference($widgets)
{
$preference = collect(['laralum', 'dashboard', 'users', 'roles', 'permissions']);
$ordered_widgets = [];
$final_ordered_widgets = [];
$widgets = collect($widgets)->groupBy('package')->toArray();
foreach (Packages::all() ... | php | public static function orderByPreference($widgets)
{
$preference = collect(['laralum', 'dashboard', 'users', 'roles', 'permissions']);
$ordered_widgets = [];
$final_ordered_widgets = [];
$widgets = collect($widgets)->groupBy('package')->toArray();
foreach (Packages::all() ... | [
"public",
"static",
"function",
"orderByPreference",
"(",
"$",
"widgets",
")",
"{",
"$",
"preference",
"=",
"collect",
"(",
"[",
"'laralum'",
",",
"'dashboard'",
",",
"'users'",
",",
"'roles'",
",",
"'permissions'",
"]",
")",
";",
"$",
"ordered_widgets",
"="... | Order the widgets by preference. | [
"Order",
"the",
"widgets",
"by",
"preference",
"."
] | 2acbef188bdd2d19ed1ac48e28fd74ec2df6ee4b | https://github.com/Laralum/Dashboard/blob/2acbef188bdd2d19ed1ac48e28fd74ec2df6ee4b/src/Widgets.php#L54-L80 |
14,220 | ptlis/conneg | src/Preference/Builder/MimePreferenceBuilder.php | MimePreferenceBuilder.getQualityFactor | private function getQualityFactor()
{
$qFactor = 0.0;
if (2 === count(explode('/', $this->variant))) {
$qFactor = $this->qFactor;
}
return $qFactor;
} | php | private function getQualityFactor()
{
$qFactor = 0.0;
if (2 === count(explode('/', $this->variant))) {
$qFactor = $this->qFactor;
}
return $qFactor;
} | [
"private",
"function",
"getQualityFactor",
"(",
")",
"{",
"$",
"qFactor",
"=",
"0.0",
";",
"if",
"(",
"2",
"===",
"count",
"(",
"explode",
"(",
"'/'",
",",
"$",
"this",
"->",
"variant",
")",
")",
")",
"{",
"$",
"qFactor",
"=",
"$",
"this",
"->",
... | Get the variants's quality factor, defaulting to 0 on absent variant.
@return float | [
"Get",
"the",
"variants",
"s",
"quality",
"factor",
"defaulting",
"to",
"0",
"on",
"absent",
"variant",
"."
] | 04afb568f368ecdd81c13277006c4be041ccb58b | https://github.com/ptlis/conneg/blob/04afb568f368ecdd81c13277006c4be041ccb58b/src/Preference/Builder/MimePreferenceBuilder.php#L86-L95 |
14,221 | christophe-brachet/aspi-framework | src/Framework/Form/Element/AbstractElement.php | AbstractElement.setLabelAttributes | public function setLabelAttributes(array $attribs)
{
foreach ($attribs as $a => $v) {
$this->setLabelAttribute($a, $v);
}
return $this;
} | php | public function setLabelAttributes(array $attribs)
{
foreach ($attribs as $a => $v) {
$this->setLabelAttribute($a, $v);
}
return $this;
} | [
"public",
"function",
"setLabelAttributes",
"(",
"array",
"$",
"attribs",
")",
"{",
"foreach",
"(",
"$",
"attribs",
"as",
"$",
"a",
"=>",
"$",
"v",
")",
"{",
"$",
"this",
"->",
"setLabelAttribute",
"(",
"$",
"a",
",",
"$",
"v",
")",
";",
"}",
"retu... | Set the attributes of the label of the form element object
@param array $attribs
@return AbstractElement | [
"Set",
"the",
"attributes",
"of",
"the",
"label",
"of",
"the",
"form",
"element",
"object"
] | 17a36c8a8582e0b8d8bff7087590c09a9bd4af1e | https://github.com/christophe-brachet/aspi-framework/blob/17a36c8a8582e0b8d8bff7087590c09a9bd4af1e/src/Framework/Form/Element/AbstractElement.php#L152-L158 |
14,222 | christophe-brachet/aspi-framework | src/Framework/Form/Element/AbstractElement.php | AbstractElement.setHintAttributes | public function setHintAttributes(array $attribs)
{
foreach ($attribs as $a => $v) {
$this->setHintAttribute($a, $v);
}
return $this;
} | php | public function setHintAttributes(array $attribs)
{
foreach ($attribs as $a => $v) {
$this->setHintAttribute($a, $v);
}
return $this;
} | [
"public",
"function",
"setHintAttributes",
"(",
"array",
"$",
"attribs",
")",
"{",
"foreach",
"(",
"$",
"attribs",
"as",
"$",
"a",
"=>",
"$",
"v",
")",
"{",
"$",
"this",
"->",
"setHintAttribute",
"(",
"$",
"a",
",",
"$",
"v",
")",
";",
"}",
"return... | Set the attributes of the hint of the form element object
@param array $attribs
@return AbstractElement | [
"Set",
"the",
"attributes",
"of",
"the",
"hint",
"of",
"the",
"form",
"element",
"object"
] | 17a36c8a8582e0b8d8bff7087590c09a9bd4af1e | https://github.com/christophe-brachet/aspi-framework/blob/17a36c8a8582e0b8d8bff7087590c09a9bd4af1e/src/Framework/Form/Element/AbstractElement.php#L177-L183 |
14,223 | christophe-brachet/aspi-framework | src/Framework/Form/Element/AbstractElement.php | AbstractElement.addValidator | public function addValidator($validator)
{
if (!($validator instanceof \Pop\Validator\AbstractValidator) && !is_callable($validator)) {
throw new Exception('Error: The validator must be an instance of Pop\Validator\AbstractValidator or a callable object.');
}
$this->validators[] ... | php | public function addValidator($validator)
{
if (!($validator instanceof \Pop\Validator\AbstractValidator) && !is_callable($validator)) {
throw new Exception('Error: The validator must be an instance of Pop\Validator\AbstractValidator or a callable object.');
}
$this->validators[] ... | [
"public",
"function",
"addValidator",
"(",
"$",
"validator",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"validator",
"instanceof",
"\\",
"Pop",
"\\",
"Validator",
"\\",
"AbstractValidator",
")",
"&&",
"!",
"is_callable",
"(",
"$",
"validator",
")",
")",
"{",
"t... | Add a validator the form element
@param mixed $validator
@throws Exception
@return AbstractElement | [
"Add",
"a",
"validator",
"the",
"form",
"element"
] | 17a36c8a8582e0b8d8bff7087590c09a9bd4af1e | https://github.com/christophe-brachet/aspi-framework/blob/17a36c8a8582e0b8d8bff7087590c09a9bd4af1e/src/Framework/Form/Element/AbstractElement.php#L376-L383 |
14,224 | DASPRiD/Pikkuleipa | src/Cookie.php | Cookie.fromJson | public static function fromJson(
string $name,
bool $endsWithSession,
DateTimeImmutable $issuedAt,
string $json
) : self {
$cookie = new self($name, $endsWithSession, $issuedAt);
$cookie->data = json_decode($json, true);
if (! is_array($cookie->data)) {
... | php | public static function fromJson(
string $name,
bool $endsWithSession,
DateTimeImmutable $issuedAt,
string $json
) : self {
$cookie = new self($name, $endsWithSession, $issuedAt);
$cookie->data = json_decode($json, true);
if (! is_array($cookie->data)) {
... | [
"public",
"static",
"function",
"fromJson",
"(",
"string",
"$",
"name",
",",
"bool",
"$",
"endsWithSession",
",",
"DateTimeImmutable",
"$",
"issuedAt",
",",
"string",
"$",
"json",
")",
":",
"self",
"{",
"$",
"cookie",
"=",
"new",
"self",
"(",
"$",
"name"... | Creates a new cookie instance from JSON encoded data.
This is primarily used by the `TokenManager` to unserialize a cookie from a JWT token.
@throws JsonException When an error occurs during decoding | [
"Creates",
"a",
"new",
"cookie",
"instance",
"from",
"JSON",
"encoded",
"data",
"."
] | e80c6ad7354069d49c18ca3bae0d1ae7f3912bfb | https://github.com/DASPRiD/Pikkuleipa/blob/e80c6ad7354069d49c18ca3bae0d1ae7f3912bfb/src/Cookie.php#L45-L59 |
14,225 | DASPRiD/Pikkuleipa | src/Cookie.php | Cookie.toJson | public function toJson() : string
{
$json = json_encode($this->data);
if (false === $json) {
throw JsonException::fromJsonEncodeError(json_last_error_msg());
}
return $json;
} | php | public function toJson() : string
{
$json = json_encode($this->data);
if (false === $json) {
throw JsonException::fromJsonEncodeError(json_last_error_msg());
}
return $json;
} | [
"public",
"function",
"toJson",
"(",
")",
":",
"string",
"{",
"$",
"json",
"=",
"json_encode",
"(",
"$",
"this",
"->",
"data",
")",
";",
"if",
"(",
"false",
"===",
"$",
"json",
")",
"{",
"throw",
"JsonException",
"::",
"fromJsonEncodeError",
"(",
"json... | Serializes the cookie data as JSON.
@throws JsonException When an error occurs during encoding | [
"Serializes",
"the",
"cookie",
"data",
"as",
"JSON",
"."
] | e80c6ad7354069d49c18ca3bae0d1ae7f3912bfb | https://github.com/DASPRiD/Pikkuleipa/blob/e80c6ad7354069d49c18ca3bae0d1ae7f3912bfb/src/Cookie.php#L66-L75 |
14,226 | ssnepenthe/soter | src/class-plugin-provider.php | Plugin_Provider.boot | public function boot( Container $container ) {
add_action( 'admin_init', [ $this->proxy( $container, 'options_page' ), 'admin_init' ] );
add_action( 'admin_menu', [ $this->proxy( $container, 'options_page' ), 'admin_menu' ] );
add_action(
'admin_notices',
[ $this->proxy( $container, 'options_page' ), 'print... | php | public function boot( Container $container ) {
add_action( 'admin_init', [ $this->proxy( $container, 'options_page' ), 'admin_init' ] );
add_action( 'admin_menu', [ $this->proxy( $container, 'options_page' ), 'admin_menu' ] );
add_action(
'admin_notices',
[ $this->proxy( $container, 'options_page' ), 'print... | [
"public",
"function",
"boot",
"(",
"Container",
"$",
"container",
")",
"{",
"add_action",
"(",
"'admin_init'",
",",
"[",
"$",
"this",
"->",
"proxy",
"(",
"$",
"container",
",",
"'options_page'",
")",
",",
"'admin_init'",
"]",
")",
";",
"add_action",
"(",
... | Provider-specific boot logic.
@param Container $container Plugin container instance.
@return void | [
"Provider",
"-",
"specific",
"boot",
"logic",
"."
] | f6d7032f8562e23c2ee8dbf9d60ef1114c8cdce7 | https://github.com/ssnepenthe/soter/blob/f6d7032f8562e23c2ee8dbf9d60ef1114c8cdce7/src/class-plugin-provider.php#L48-L66 |
14,227 | ssnepenthe/soter | src/class-plugin-provider.php | Plugin_Provider.register | public function register( Container $container ) {
$container['check_site_job'] = function( Container $c ) {
return new Check_Site_Job( $c['checker'], $c['options_manager'] );
};
$container['checker'] = function( Container $c ) {
$checker = new Checker( new Api_Client( $c['http'] ), new WP_Package_Manager(... | php | public function register( Container $container ) {
$container['check_site_job'] = function( Container $c ) {
return new Check_Site_Job( $c['checker'], $c['options_manager'] );
};
$container['checker'] = function( Container $c ) {
$checker = new Checker( new Api_Client( $c['http'] ), new WP_Package_Manager(... | [
"public",
"function",
"register",
"(",
"Container",
"$",
"container",
")",
"{",
"$",
"container",
"[",
"'check_site_job'",
"]",
"=",
"function",
"(",
"Container",
"$",
"c",
")",
"{",
"return",
"new",
"Check_Site_Job",
"(",
"$",
"c",
"[",
"'checker'",
"]",
... | Provider-specific registration logic.
@param Container $container Plugin container instance.
@return void | [
"Provider",
"-",
"specific",
"registration",
"logic",
"."
] | f6d7032f8562e23c2ee8dbf9d60ef1114c8cdce7 | https://github.com/ssnepenthe/soter/blob/f6d7032f8562e23c2ee8dbf9d60ef1114c8cdce7/src/class-plugin-provider.php#L86-L160 |
14,228 | ssnepenthe/soter | src/class-plugin-provider.php | Plugin_Provider.boot_upgrader | protected function boot_upgrader( Container $container ) {
if ( ! $this->doing_cron() && ! is_admin() ) {
return;
}
$upgrader = new Upgrader( $container['options_manager'] );
add_action( 'init', [ $upgrader, 'perform_upgrade' ] );
} | php | protected function boot_upgrader( Container $container ) {
if ( ! $this->doing_cron() && ! is_admin() ) {
return;
}
$upgrader = new Upgrader( $container['options_manager'] );
add_action( 'init', [ $upgrader, 'perform_upgrade' ] );
} | [
"protected",
"function",
"boot_upgrader",
"(",
"Container",
"$",
"container",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"doing_cron",
"(",
")",
"&&",
"!",
"is_admin",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"upgrader",
"=",
"new",
"Upgrader",
... | Boots the upgrader object on cron or admin requests.
@param Container $container Plugin container instance.
@return void | [
"Boots",
"the",
"upgrader",
"object",
"on",
"cron",
"or",
"admin",
"requests",
"."
] | f6d7032f8562e23c2ee8dbf9d60ef1114c8cdce7 | https://github.com/ssnepenthe/soter/blob/f6d7032f8562e23c2ee8dbf9d60ef1114c8cdce7/src/class-plugin-provider.php#L169-L177 |
14,229 | crysalead/net | src/Headers.php | Headers.push | public function push($headers, $value = '')
{
if (is_string($headers) && func_num_args() === 2) {
$headers = [$headers => $value];
}
return $this->_set($headers);
} | php | public function push($headers, $value = '')
{
if (is_string($headers) && func_num_args() === 2) {
$headers = [$headers => $value];
}
return $this->_set($headers);
} | [
"public",
"function",
"push",
"(",
"$",
"headers",
",",
"$",
"value",
"=",
"''",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"headers",
")",
"&&",
"func_num_args",
"(",
")",
"===",
"2",
")",
"{",
"$",
"headers",
"=",
"[",
"$",
"headers",
"=>",
"$... | Sets some headers.
@param string|array $headers A header name, string content or an array of headers.
@param string|array $value The header value. I set, `$headers` must be an header string name.
@return self | [
"Sets",
"some",
"headers",
"."
] | 4d75abead39e954529b56cbffa3841a9cd3044bb | https://github.com/crysalead/net/blob/4d75abead39e954529b56cbffa3841a9cd3044bb/src/Headers.php#L87-L93 |
14,230 | crysalead/net | src/Headers.php | Headers.prepend | public function prepend($headers, $value = '')
{
if (is_string($headers) && func_num_args() === 2) {
$headers = [$headers => $value];
}
return $this->_set($headers, true);
} | php | public function prepend($headers, $value = '')
{
if (is_string($headers) && func_num_args() === 2) {
$headers = [$headers => $value];
}
return $this->_set($headers, true);
} | [
"public",
"function",
"prepend",
"(",
"$",
"headers",
",",
"$",
"value",
"=",
"''",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"headers",
")",
"&&",
"func_num_args",
"(",
")",
"===",
"2",
")",
"{",
"$",
"headers",
"=",
"[",
"$",
"headers",
"=>",
... | Prepends some headers.
@param string|array $headers A header name, string content or an array of headers.
@param string|array $value The header value. I set, `$headers` must be an header string name.
@return self | [
"Prepends",
"some",
"headers",
"."
] | 4d75abead39e954529b56cbffa3841a9cd3044bb | https://github.com/crysalead/net/blob/4d75abead39e954529b56cbffa3841a9cd3044bb/src/Headers.php#L102-L108 |
14,231 | crysalead/net | src/Headers.php | Headers.offsetExists | public function offsetExists($name)
{
$name = strtolower($name);
if (!array_key_exists($name, $this->_data)) {
return false;
}
return !empty($this->_data[$name]->value());
} | php | public function offsetExists($name)
{
$name = strtolower($name);
if (!array_key_exists($name, $this->_data)) {
return false;
}
return !empty($this->_data[$name]->value());
} | [
"public",
"function",
"offsetExists",
"(",
"$",
"name",
")",
"{",
"$",
"name",
"=",
"strtolower",
"(",
"$",
"name",
")",
";",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"_data",
")",
")",
"{",
"return",
"false",
"... | Checks whether or not an header exists.
@param string $name The header name.
@return boolean Returns `true` if the header exists, `false` otherwise. | [
"Checks",
"whether",
"or",
"not",
"an",
"header",
"exists",
"."
] | 4d75abead39e954529b56cbffa3841a9cd3044bb | https://github.com/crysalead/net/blob/4d75abead39e954529b56cbffa3841a9cd3044bb/src/Headers.php#L128-L135 |
14,232 | crysalead/net | src/Headers.php | Headers.offsetGet | public function offsetGet($name)
{
if (!isset($this->_data[strtolower($name)])) {
$header = $this->_classes['header'];
return $this->_data[strtolower($name)] = new $header($name, '');
}
return $this->_data[strtolower($name)];
} | php | public function offsetGet($name)
{
if (!isset($this->_data[strtolower($name)])) {
$header = $this->_classes['header'];
return $this->_data[strtolower($name)] = new $header($name, '');
}
return $this->_data[strtolower($name)];
} | [
"public",
"function",
"offsetGet",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_data",
"[",
"strtolower",
"(",
"$",
"name",
")",
"]",
")",
")",
"{",
"$",
"header",
"=",
"$",
"this",
"->",
"_classes",
"[",
"'heade... | Returns the value of a specific header.
@param string $name The header name.
@return string The header value. | [
"Returns",
"the",
"value",
"of",
"a",
"specific",
"header",
"."
] | 4d75abead39e954529b56cbffa3841a9cd3044bb | https://github.com/crysalead/net/blob/4d75abead39e954529b56cbffa3841a9cd3044bb/src/Headers.php#L143-L150 |
14,233 | crysalead/net | src/Headers.php | Headers._set | protected function _set($values, $prepend = false)
{
$header = $this->_classes['header'];
$headers = is_string($values) ? explode("\n", $values) : $values;
$headers = $headers ? $headers : [];
foreach ($headers as $key => $value) {
if (!is_numeric($key)) {
... | php | protected function _set($values, $prepend = false)
{
$header = $this->_classes['header'];
$headers = is_string($values) ? explode("\n", $values) : $values;
$headers = $headers ? $headers : [];
foreach ($headers as $key => $value) {
if (!is_numeric($key)) {
... | [
"protected",
"function",
"_set",
"(",
"$",
"values",
",",
"$",
"prepend",
"=",
"false",
")",
"{",
"$",
"header",
"=",
"$",
"this",
"->",
"_classes",
"[",
"'header'",
"]",
";",
"$",
"headers",
"=",
"is_string",
"(",
"$",
"values",
")",
"?",
"explode",... | Sets one or some plain string headers.
@param string|array $headers A header string or an array of headers.
@param boolean $prepend If true, prepend headers to the beginning.
@return self | [
"Sets",
"one",
"or",
"some",
"plain",
"string",
"headers",
"."
] | 4d75abead39e954529b56cbffa3841a9cd3044bb | https://github.com/crysalead/net/blob/4d75abead39e954529b56cbffa3841a9cd3044bb/src/Headers.php#L181-L229 |
14,234 | crysalead/net | src/Headers.php | Headers.valid | public function valid()
{
if (key($this->_data) === null) {
return false;
}
$current = current($this->_data);
while (!$current->value()) {
$current = $this->next();
if (key($this->_data) === null) {
return false;
}
... | php | public function valid()
{
if (key($this->_data) === null) {
return false;
}
$current = current($this->_data);
while (!$current->value()) {
$current = $this->next();
if (key($this->_data) === null) {
return false;
}
... | [
"public",
"function",
"valid",
"(",
")",
"{",
"if",
"(",
"key",
"(",
"$",
"this",
"->",
"_data",
")",
"===",
"null",
")",
"{",
"return",
"false",
";",
"}",
"$",
"current",
"=",
"current",
"(",
"$",
"this",
"->",
"_data",
")",
";",
"while",
"(",
... | Returns the current item.
@return mixed The current item or `false` on failure. | [
"Returns",
"the",
"current",
"item",
"."
] | 4d75abead39e954529b56cbffa3841a9cd3044bb | https://github.com/crysalead/net/blob/4d75abead39e954529b56cbffa3841a9cd3044bb/src/Headers.php#L236-L250 |
14,235 | crysalead/net | src/Headers.php | Headers.toArray | public static function toArray($headers, $options = [])
{
$data = [];
foreach ($headers as $name => $header) {
if (strtolower($name) === 'set-cookie') {
foreach ($header->data() as $value) {
$data[] = $name . ': ' . $value;
}
... | php | public static function toArray($headers, $options = [])
{
$data = [];
foreach ($headers as $name => $header) {
if (strtolower($name) === 'set-cookie') {
foreach ($header->data() as $value) {
$data[] = $name . ': ' . $value;
}
... | [
"public",
"static",
"function",
"toArray",
"(",
"$",
"headers",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"data",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"headers",
"as",
"$",
"name",
"=>",
"$",
"header",
")",
"{",
"if",
"(",
"strtolowe... | Gets the headers as an array.
@return array Returns the headers. | [
"Gets",
"the",
"headers",
"as",
"an",
"array",
"."
] | 4d75abead39e954529b56cbffa3841a9cd3044bb | https://github.com/crysalead/net/blob/4d75abead39e954529b56cbffa3841a9cd3044bb/src/Headers.php#L257-L270 |
14,236 | eddiriarte/console-select | src/Handlers/SelectHandler.php | SelectHandler.handle | public function handle(): array
{
$this->firstRun = true;
$this->output->writeln(
'<info>' . $this->question->getMessage() . '</info> [<comment>SPACE=select</>, <comment>ENTER=submit</>]'
);
$this->repaint();
$sttyMode = shell_exec('stty -g');
// Disable... | php | public function handle(): array
{
$this->firstRun = true;
$this->output->writeln(
'<info>' . $this->question->getMessage() . '</info> [<comment>SPACE=select</>, <comment>ENTER=submit</>]'
);
$this->repaint();
$sttyMode = shell_exec('stty -g');
// Disable... | [
"public",
"function",
"handle",
"(",
")",
":",
"array",
"{",
"$",
"this",
"->",
"firstRun",
"=",
"true",
";",
"$",
"this",
"->",
"output",
"->",
"writeln",
"(",
"'<info>'",
".",
"$",
"this",
"->",
"question",
"->",
"getMessage",
"(",
")",
".",
"'</in... | Navigates through option items.
@return array | [
"Navigates",
"through",
"option",
"items",
"."
] | 76a6818c128571dfed8f0546a6ac5dd15e64f1ad | https://github.com/eddiriarte/console-select/blob/76a6818c128571dfed8f0546a6ac5dd15e64f1ad/src/Handlers/SelectHandler.php#L70-L106 |
14,237 | guillaumemonet/Rad | src/Rad/Utils/Time.php | Time.get_microtime | public static function get_microtime() {
list($tps_usec, $tps_sec) = explode(' ', microtime());
return (float) $tps_usec + (float) $tps_sec;
} | php | public static function get_microtime() {
list($tps_usec, $tps_sec) = explode(' ', microtime());
return (float) $tps_usec + (float) $tps_sec;
} | [
"public",
"static",
"function",
"get_microtime",
"(",
")",
"{",
"list",
"(",
"$",
"tps_usec",
",",
"$",
"tps_sec",
")",
"=",
"explode",
"(",
"' '",
",",
"microtime",
"(",
")",
")",
";",
"return",
"(",
"float",
")",
"$",
"tps_usec",
"+",
"(",
"float",... | Return current microtime.
@return int | [
"Return",
"current",
"microtime",
"."
] | cb9932f570cf3c2a7197f81e1d959c2729989e59 | https://github.com/guillaumemonet/Rad/blob/cb9932f570cf3c2a7197f81e1d959c2729989e59/src/Rad/Utils/Time.php#L53-L56 |
14,238 | guillaumemonet/Rad | src/Rad/Utils/Time.php | Time.isFrenchHoliday | public static function isFrenchHoliday($unixTimeStamp = null) {
$date = strtotime(date('m/d/Y', $unixTimeStamp == null ? time() : $unixTimeStamp));
$year = date('Y', $date);
$holidays = Cache::getHandler('quick')->get('holiday' . $year);
if ($holidays == null) {
$easterDate =... | php | public static function isFrenchHoliday($unixTimeStamp = null) {
$date = strtotime(date('m/d/Y', $unixTimeStamp == null ? time() : $unixTimeStamp));
$year = date('Y', $date);
$holidays = Cache::getHandler('quick')->get('holiday' . $year);
if ($holidays == null) {
$easterDate =... | [
"public",
"static",
"function",
"isFrenchHoliday",
"(",
"$",
"unixTimeStamp",
"=",
"null",
")",
"{",
"$",
"date",
"=",
"strtotime",
"(",
"date",
"(",
"'m/d/Y'",
",",
"$",
"unixTimeStamp",
"==",
"null",
"?",
"time",
"(",
")",
":",
"$",
"unixTimeStamp",
")... | Return french holiday
@param int $unixTimeStamp
@return bool | [
"Return",
"french",
"holiday"
] | cb9932f570cf3c2a7197f81e1d959c2729989e59 | https://github.com/guillaumemonet/Rad/blob/cb9932f570cf3c2a7197f81e1d959c2729989e59/src/Rad/Utils/Time.php#L79-L109 |
14,239 | nyeholt/silverstripe-simplewiki | thirdparty/htmlpurifier-4.0.0-lite/library/HTMLPurifier/ErrorCollector.php | HTMLPurifier_ErrorCollector.getHTMLFormatted | public function getHTMLFormatted($config, $errors = null) {
$ret = array();
$this->generator = new HTMLPurifier_Generator($config, $this->context);
if ($errors === null) $errors = $this->errors;
// 'At line' message needs to be removed
// generation code for new structure goes... | php | public function getHTMLFormatted($config, $errors = null) {
$ret = array();
$this->generator = new HTMLPurifier_Generator($config, $this->context);
if ($errors === null) $errors = $this->errors;
// 'At line' message needs to be removed
// generation code for new structure goes... | [
"public",
"function",
"getHTMLFormatted",
"(",
"$",
"config",
",",
"$",
"errors",
"=",
"null",
")",
"{",
"$",
"ret",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"generator",
"=",
"new",
"HTMLPurifier_Generator",
"(",
"$",
"config",
",",
"$",
"this"... | Default HTML formatting implementation for error messages
@param $config Configuration array, vital for HTML output nature
@param $errors Errors array to display; used for recursion. | [
"Default",
"HTML",
"formatting",
"implementation",
"for",
"error",
"messages"
] | ecffed0d75be1454901e1cb24633472b8f67c967 | https://github.com/nyeholt/silverstripe-simplewiki/blob/ecffed0d75be1454901e1cb24633472b8f67c967/thirdparty/htmlpurifier-4.0.0-lite/library/HTMLPurifier/ErrorCollector.php#L144-L169 |
14,240 | reinvanoyen/aegis | lib/Aegis/Cache/Filesystem.php | Filesystem.load | public static function load($id, $subId = null) : CacheEntryInterface
{
$storageId = $id;
if ($subId) {
$storageId .= '[' . $subId . ']';
}
if (!isset(self::$files[$storageId])) {
$filename = static::CACHE_DIR . ($subId ? $subId . '/' : null) . urlencode($id... | php | public static function load($id, $subId = null) : CacheEntryInterface
{
$storageId = $id;
if ($subId) {
$storageId .= '[' . $subId . ']';
}
if (!isset(self::$files[$storageId])) {
$filename = static::CACHE_DIR . ($subId ? $subId . '/' : null) . urlencode($id... | [
"public",
"static",
"function",
"load",
"(",
"$",
"id",
",",
"$",
"subId",
"=",
"null",
")",
":",
"CacheEntryInterface",
"{",
"$",
"storageId",
"=",
"$",
"id",
";",
"if",
"(",
"$",
"subId",
")",
"{",
"$",
"storageId",
".=",
"'['",
".",
"$",
"subId"... | Gets the cache file from the filesystem
@param $id
@param null $subId
@return CacheEntryInterface | [
"Gets",
"the",
"cache",
"file",
"from",
"the",
"filesystem"
] | ecd831fd6f3ceb4fb20fb5af83483d73cad8e323 | https://github.com/reinvanoyen/aegis/blob/ecd831fd6f3ceb4fb20fb5af83483d73cad8e323/lib/Aegis/Cache/Filesystem.php#L27-L41 |
14,241 | cpliakas/search-framework | src/Search/Framework/Schema.php | Schema.build | public function build(array $options)
{
if (isset($options['fields'])) {
if (!is_array($options['fields'])) {
$message = 'Argument 1 passed to ' . __METHOD__ . ' must be an array.';
throw new \InvalidArgumentException($message);
}
foreach (... | php | public function build(array $options)
{
if (isset($options['fields'])) {
if (!is_array($options['fields'])) {
$message = 'Argument 1 passed to ' . __METHOD__ . ' must be an array.';
throw new \InvalidArgumentException($message);
}
foreach (... | [
"public",
"function",
"build",
"(",
"array",
"$",
"options",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"options",
"[",
"'fields'",
"]",
")",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"options",
"[",
"'fields'",
"]",
")",
")",
"{",
"$",
"messa... | Builds the schema from an array of options.
@param array $options
The raw options parsed form the configuration file related to the
schema.
@throws \InvalidArgumentException | [
"Builds",
"the",
"schema",
"from",
"an",
"array",
"of",
"options",
"."
] | 7c5832d38ed998e04837c26e0daef59115563b98 | https://github.com/cpliakas/search-framework/blob/7c5832d38ed998e04837c26e0daef59115563b98/src/Search/Framework/Schema.php#L65-L80 |
14,242 | cpliakas/search-framework | src/Search/Framework/Schema.php | Schema.attachField | public function attachField(SchemaField $field)
{
$id = $field->getId();
$name = $field->getName();
$this->_fields[$id] = $field;
$this->_fieldNameMap[$name] = $id;
return $this;
} | php | public function attachField(SchemaField $field)
{
$id = $field->getId();
$name = $field->getName();
$this->_fields[$id] = $field;
$this->_fieldNameMap[$name] = $id;
return $this;
} | [
"public",
"function",
"attachField",
"(",
"SchemaField",
"$",
"field",
")",
"{",
"$",
"id",
"=",
"$",
"field",
"->",
"getId",
"(",
")",
";",
"$",
"name",
"=",
"$",
"field",
"->",
"getName",
"(",
")",
";",
"$",
"this",
"->",
"_fields",
"[",
"$",
"... | Associates a field with this schema.
@param SchemaField $field
The field being associated with the schema.
@return Schema | [
"Associates",
"a",
"field",
"with",
"this",
"schema",
"."
] | 7c5832d38ed998e04837c26e0daef59115563b98 | https://github.com/cpliakas/search-framework/blob/7c5832d38ed998e04837c26e0daef59115563b98/src/Search/Framework/Schema.php#L90-L97 |
14,243 | cpliakas/search-framework | src/Search/Framework/Schema.php | Schema.getField | public function getField($id)
{
if (!isset($this->_fields[$id])) {
$message = 'Field "' . $id . '" not associated with this schema.';
throw new \InvalidArgumentException($message);
}
return $this->_fields[$id];
} | php | public function getField($id)
{
if (!isset($this->_fields[$id])) {
$message = 'Field "' . $id . '" not associated with this schema.';
throw new \InvalidArgumentException($message);
}
return $this->_fields[$id];
} | [
"public",
"function",
"getField",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_fields",
"[",
"$",
"id",
"]",
")",
")",
"{",
"$",
"message",
"=",
"'Field \"'",
".",
"$",
"id",
".",
"'\" not associated with this schema.'",... | Returns a field by its unique identifier.
@param string $id
The unique identifier of the field.
@return SchemaField
@throw \InvalidArgumentException() | [
"Returns",
"a",
"field",
"by",
"its",
"unique",
"identifier",
"."
] | 7c5832d38ed998e04837c26e0daef59115563b98 | https://github.com/cpliakas/search-framework/blob/7c5832d38ed998e04837c26e0daef59115563b98/src/Search/Framework/Schema.php#L109-L116 |
14,244 | cpliakas/search-framework | src/Search/Framework/Schema.php | Schema.getFieldByName | public function getFieldByName($name)
{
if (!isset($this->_fieldNameMap[$name])) {
$message = 'Field name "' . $name . '" not associated to this schema.';
throw new \InvalidArgumentException($message);
}
return $this->getField($this->_fieldNameMap[$name]);
} | php | public function getFieldByName($name)
{
if (!isset($this->_fieldNameMap[$name])) {
$message = 'Field name "' . $name . '" not associated to this schema.';
throw new \InvalidArgumentException($message);
}
return $this->getField($this->_fieldNameMap[$name]);
} | [
"public",
"function",
"getFieldByName",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_fieldNameMap",
"[",
"$",
"name",
"]",
")",
")",
"{",
"$",
"message",
"=",
"'Field name \"'",
".",
"$",
"name",
".",
"'\" not associat... | Returns a field by its name as stored in the index.
@param string $name
The name of the field as stored in the index.
@return SchemaField
@throws \InvalidArgumentException() | [
"Returns",
"a",
"field",
"by",
"its",
"name",
"as",
"stored",
"in",
"the",
"index",
"."
] | 7c5832d38ed998e04837c26e0daef59115563b98 | https://github.com/cpliakas/search-framework/blob/7c5832d38ed998e04837c26e0daef59115563b98/src/Search/Framework/Schema.php#L138-L145 |
14,245 | cpliakas/search-framework | src/Search/Framework/Schema.php | Schema.removeField | public function removeField($id)
{
if (isset($this->_fields[$id])) {
$name = $this->_fields[$id]->getName();
unset($this->_fields[$id], $this->_fieldNameMap[$name]);
}
return $this;
} | php | public function removeField($id)
{
if (isset($this->_fields[$id])) {
$name = $this->_fields[$id]->getName();
unset($this->_fields[$id], $this->_fieldNameMap[$name]);
}
return $this;
} | [
"public",
"function",
"removeField",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_fields",
"[",
"$",
"id",
"]",
")",
")",
"{",
"$",
"name",
"=",
"$",
"this",
"->",
"_fields",
"[",
"$",
"id",
"]",
"->",
"getName",
"(",... | De-references a field from the schema.
@param string $id
The unique identifier of the field.
@return Schema | [
"De",
"-",
"references",
"a",
"field",
"from",
"the",
"schema",
"."
] | 7c5832d38ed998e04837c26e0daef59115563b98 | https://github.com/cpliakas/search-framework/blob/7c5832d38ed998e04837c26e0daef59115563b98/src/Search/Framework/Schema.php#L168-L175 |
14,246 | cpliakas/search-framework | src/Search/Framework/Schema.php | Schema.toArray | public function toArray()
{
$schema_options = array(
'unique_field' => $this->_uniqueField,
'fields' => array(),
);
foreach ($this->_fields as $id => $field) {
$schema_options['fields'][$id] = $field->toArray();
}
return $schema_options;
... | php | public function toArray()
{
$schema_options = array(
'unique_field' => $this->_uniqueField,
'fields' => array(),
);
foreach ($this->_fields as $id => $field) {
$schema_options['fields'][$id] = $field->toArray();
}
return $schema_options;
... | [
"public",
"function",
"toArray",
"(",
")",
"{",
"$",
"schema_options",
"=",
"array",
"(",
"'unique_field'",
"=>",
"$",
"this",
"->",
"_uniqueField",
",",
"'fields'",
"=>",
"array",
"(",
")",
",",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"_fields",
... | Returns the array of schema options.
@return | [
"Returns",
"the",
"array",
"of",
"schema",
"options",
"."
] | 7c5832d38ed998e04837c26e0daef59115563b98 | https://github.com/cpliakas/search-framework/blob/7c5832d38ed998e04837c26e0daef59115563b98/src/Search/Framework/Schema.php#L259-L269 |
14,247 | antarestupin/Accessible | lib/Accessible/AutoMethodsTrait.php | AutoMethodsTrait.getMethodCallInfo | private function getMethodCallInfo($name)
{
$extractedMethod = preg_match("/^(set|get|is|add|remove)([A-Z].*)/", $name, $pregMatches);
if ($extractedMethod) {
$method = $pregMatches[1];
$property = lcfirst($pregMatches[2]);
} else {
$method = 'call';
... | php | private function getMethodCallInfo($name)
{
$extractedMethod = preg_match("/^(set|get|is|add|remove)([A-Z].*)/", $name, $pregMatches);
if ($extractedMethod) {
$method = $pregMatches[1];
$property = lcfirst($pregMatches[2]);
} else {
$method = 'call';
... | [
"private",
"function",
"getMethodCallInfo",
"(",
"$",
"name",
")",
"{",
"$",
"extractedMethod",
"=",
"preg_match",
"(",
"\"/^(set|get|is|add|remove)([A-Z].*)/\"",
",",
"$",
"name",
",",
"$",
"pregMatches",
")",
";",
"if",
"(",
"$",
"extractedMethod",
")",
"{",
... | Extract the info about the method called.
@param string $name
@return array | [
"Extract",
"the",
"info",
"about",
"the",
"method",
"called",
"."
] | d12ce93d72f74c099dfd2109371fcd6ddfffdca4 | https://github.com/antarestupin/Accessible/blob/d12ce93d72f74c099dfd2109371fcd6ddfffdca4/lib/Accessible/AutoMethodsTrait.php#L117-L147 |
14,248 | oscarotero/fol | src/App.php | App.getPath | public function getPath(string ...$dirs): string
{
if (empty($dirs)) {
return $this->path;
}
return self::canonicalize($this->path, ...$dirs);
} | php | public function getPath(string ...$dirs): string
{
if (empty($dirs)) {
return $this->path;
}
return self::canonicalize($this->path, ...$dirs);
} | [
"public",
"function",
"getPath",
"(",
"string",
"...",
"$",
"dirs",
")",
":",
"string",
"{",
"if",
"(",
"empty",
"(",
"$",
"dirs",
")",
")",
"{",
"return",
"$",
"this",
"->",
"path",
";",
"}",
"return",
"self",
"::",
"canonicalize",
"(",
"$",
"this... | Returns the absolute path of the app. | [
"Returns",
"the",
"absolute",
"path",
"of",
"the",
"app",
"."
] | 898c9f657adc12fb1b46acc2adbf0199caaebe3b | https://github.com/oscarotero/fol/blob/898c9f657adc12fb1b46acc2adbf0199caaebe3b/src/App.php#L111-L118 |
14,249 | sifophp/sifo-common-instance | models/OAuth/twitter.php | OAuthTwitterModel.getAuth | public function getAuth( $oauth_token )
{
try
{
$this->setToken( $oauth_token );
$token = $this->getAccessToken();
$this->setToken( $token->oauth_token, $token->oauth_token_secret );
return array(
'oauth_token' => $token->oauth_token,
'oauth_token_secret' => $token->oauth_token_secret,
'us... | php | public function getAuth( $oauth_token )
{
try
{
$this->setToken( $oauth_token );
$token = $this->getAccessToken();
$this->setToken( $token->oauth_token, $token->oauth_token_secret );
return array(
'oauth_token' => $token->oauth_token,
'oauth_token_secret' => $token->oauth_token_secret,
'us... | [
"public",
"function",
"getAuth",
"(",
"$",
"oauth_token",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"setToken",
"(",
"$",
"oauth_token",
")",
";",
"$",
"token",
"=",
"$",
"this",
"->",
"getAccessToken",
"(",
")",
";",
"$",
"this",
"->",
"setToken",
"(... | Returns the authentication token and secret.
@param string $oauth_token Authorization request given by Twitter via GET when calling the callback Url.
@return array | [
"Returns",
"the",
"authentication",
"token",
"and",
"secret",
"."
] | 52d54ea3e565bd2bccd77e0b0a6a99b5cae3aff5 | https://github.com/sifophp/sifo-common-instance/blob/52d54ea3e565bd2bccd77e0b0a6a99b5cae3aff5/models/OAuth/twitter.php#L70-L91 |
14,250 | todstoychev/icr | src/Processor.php | Processor.upload | public function upload($context, $file, $extension, FilesystemAdapter $filesystemAdapter, $fileName)
{
// Upload original image
$fileName = $this->fileManager->setFileSystemAdapter($filesystemAdapter)
->uploadFile($file, $extension, $context, null, $fileName);
$this->processSizes... | php | public function upload($context, $file, $extension, FilesystemAdapter $filesystemAdapter, $fileName)
{
// Upload original image
$fileName = $this->fileManager->setFileSystemAdapter($filesystemAdapter)
->uploadFile($file, $extension, $context, null, $fileName);
$this->processSizes... | [
"public",
"function",
"upload",
"(",
"$",
"context",
",",
"$",
"file",
",",
"$",
"extension",
",",
"FilesystemAdapter",
"$",
"filesystemAdapter",
",",
"$",
"fileName",
")",
"{",
"// Upload original image",
"$",
"fileName",
"=",
"$",
"this",
"->",
"fileManager"... | Handles image upload
@param string $context
@param string $file
@param string $extension
@param FilesystemAdapter $filesystemAdapter
@param string $fileName
@return string
@throws \Exception | [
"Handles",
"image",
"upload"
] | 0214c7bc76e44488e98758d55deb707b72e24000 | https://github.com/todstoychev/icr/blob/0214c7bc76e44488e98758d55deb707b72e24000/src/Processor.php#L71-L79 |
14,251 | todstoychev/icr | src/Processor.php | Processor.rebuild | public function rebuild($fileName, $context, FilesystemAdapter $filesystemAdapter)
{
// Open original file
$originalImage = $filesystemAdapter->get('/' . $context . '/' . $fileName);
$originalImage = $this->openImageHandler->loadImage($originalImage);
$extension = $this->findExtensio... | php | public function rebuild($fileName, $context, FilesystemAdapter $filesystemAdapter)
{
// Open original file
$originalImage = $filesystemAdapter->get('/' . $context . '/' . $fileName);
$originalImage = $this->openImageHandler->loadImage($originalImage);
$extension = $this->findExtensio... | [
"public",
"function",
"rebuild",
"(",
"$",
"fileName",
",",
"$",
"context",
",",
"FilesystemAdapter",
"$",
"filesystemAdapter",
")",
"{",
"// Open original file",
"$",
"originalImage",
"=",
"$",
"filesystemAdapter",
"->",
"get",
"(",
"'/'",
".",
"$",
"context",
... | Rebuilds image sizes
@param string $fileName
@param string $context
@param FilesystemAdapter $filesystemAdapter
@return bool
@throws \Illuminate\Contracts\Filesystem\FileNotFoundException | [
"Rebuilds",
"image",
"sizes"
] | 0214c7bc76e44488e98758d55deb707b72e24000 | https://github.com/todstoychev/icr/blob/0214c7bc76e44488e98758d55deb707b72e24000/src/Processor.php#L111-L124 |
14,252 | todstoychev/icr | src/Processor.php | Processor.rename | public function rename($oldFileName, $newFileName, $context, FilesystemAdapter $filesystemAdapter)
{
if ($filesystemAdapter->exists($context . '/' . $newFileName)) {
throw new IcrRuntimeException("File with name {$newFileName} already exists!");
}
$image = $filesystemAdapter->ge... | php | public function rename($oldFileName, $newFileName, $context, FilesystemAdapter $filesystemAdapter)
{
if ($filesystemAdapter->exists($context . '/' . $newFileName)) {
throw new IcrRuntimeException("File with name {$newFileName} already exists!");
}
$image = $filesystemAdapter->ge... | [
"public",
"function",
"rename",
"(",
"$",
"oldFileName",
",",
"$",
"newFileName",
",",
"$",
"context",
",",
"FilesystemAdapter",
"$",
"filesystemAdapter",
")",
"{",
"if",
"(",
"$",
"filesystemAdapter",
"->",
"exists",
"(",
"$",
"context",
".",
"'/'",
".",
... | Renames existing file
@param string $oldFileName
@param string $newFileName
@param string $context
@param FilesystemAdapter $filesystemAdapter
@return boolean | [
"Renames",
"existing",
"file"
] | 0214c7bc76e44488e98758d55deb707b72e24000 | https://github.com/todstoychev/icr/blob/0214c7bc76e44488e98758d55deb707b72e24000/src/Processor.php#L198-L214 |
14,253 | liip/LiipDrupalConnectorModule | src/Liip/Drupal/Modules/DrupalConnector/Node.php | Node.node_load | public function node_load($nid = null, $vid = null, $reset = false)
{
return node_load($nid, $vid, $reset);
} | php | public function node_load($nid = null, $vid = null, $reset = false)
{
return node_load($nid, $vid, $reset);
} | [
"public",
"function",
"node_load",
"(",
"$",
"nid",
"=",
"null",
",",
"$",
"vid",
"=",
"null",
",",
"$",
"reset",
"=",
"false",
")",
"{",
"return",
"node_load",
"(",
"$",
"nid",
",",
"$",
"vid",
",",
"$",
"reset",
")",
";",
"}"
] | Load a node object from the database.
@param integer $nid The node ID.
@param integer $vid The revision ID.
@param boolean $reset Whether to reset the node_load_multiple cache.
@return \stdClass|false A fully-populated node object, or FALSE if the node is not found.
@link http://api.drupal.org/api/drupal/modules... | [
"Load",
"a",
"node",
"object",
"from",
"the",
"database",
"."
] | 6ba161ef0d3a27c108e533f1adbea22ed73b78ce | https://github.com/liip/LiipDrupalConnectorModule/blob/6ba161ef0d3a27c108e533f1adbea22ed73b78ce/src/Liip/Drupal/Modules/DrupalConnector/Node.php#L84-L87 |
14,254 | liip/LiipDrupalConnectorModule | src/Liip/Drupal/Modules/DrupalConnector/Node.php | Node.node_save | public function node_save(&$node)
{
try {
node_save($node);
} catch (\Exception $e) {
throw new NodeException(
sprintf(NodeException::FailedToSaveNodeText, $node->nid),
NodeException::FailedToSaveNode,
$e->getCode(),
... | php | public function node_save(&$node)
{
try {
node_save($node);
} catch (\Exception $e) {
throw new NodeException(
sprintf(NodeException::FailedToSaveNodeText, $node->nid),
NodeException::FailedToSaveNode,
$e->getCode(),
... | [
"public",
"function",
"node_save",
"(",
"&",
"$",
"node",
")",
"{",
"try",
"{",
"node_save",
"(",
"$",
"node",
")",
";",
"}",
"catch",
"(",
"\\",
"Exception",
"$",
"e",
")",
"{",
"throw",
"new",
"NodeException",
"(",
"sprintf",
"(",
"NodeException",
... | Save changes to a node or add a new node.
@param \stdClass &$node The $node object to be saved. If $node->nid is omitted (or $node->is_new is TRUE), a new node will be added.
@throws \Liip\Drupal\Modules\DrupalConnector\NodeException in case the node could not be persisted.
@link http://api.drupal.org/api/drupal/mod... | [
"Save",
"changes",
"to",
"a",
"node",
"or",
"add",
"a",
"new",
"node",
"."
] | 6ba161ef0d3a27c108e533f1adbea22ed73b78ce | https://github.com/liip/LiipDrupalConnectorModule/blob/6ba161ef0d3a27c108e533f1adbea22ed73b78ce/src/Liip/Drupal/Modules/DrupalConnector/Node.php#L113-L125 |
14,255 | incraigulous/contentful-sdk | src/PayloadBuilders/ContentTypeValidation.php | ContentTypeValidation.size | function size($min = null, $max = null) {
$size = [];
if ($min) $size['min'] = $min;
if ($max) $size['max'] = $max;
if (count($size)) $this->data['size'] = $size;
return $this;
} | php | function size($min = null, $max = null) {
$size = [];
if ($min) $size['min'] = $min;
if ($max) $size['max'] = $max;
if (count($size)) $this->data['size'] = $size;
return $this;
} | [
"function",
"size",
"(",
"$",
"min",
"=",
"null",
",",
"$",
"max",
"=",
"null",
")",
"{",
"$",
"size",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"min",
")",
"$",
"size",
"[",
"'min'",
"]",
"=",
"$",
"min",
";",
"if",
"(",
"$",
"max",
")",
"$",
... | Validates that the size of a text, object or array is within a range.
@param null $min
@param null $max
@return $this | [
"Validates",
"that",
"the",
"size",
"of",
"a",
"text",
"object",
"or",
"array",
"is",
"within",
"a",
"range",
"."
] | 29399b11b0e085a06ea5976661378c379fe5a731 | https://github.com/incraigulous/contentful-sdk/blob/29399b11b0e085a06ea5976661378c379fe5a731/src/PayloadBuilders/ContentTypeValidation.php#L13-L19 |
14,256 | incraigulous/contentful-sdk | src/PayloadBuilders/ContentTypeValidation.php | ContentTypeValidation.regexp | function regexp($pattern, $flags = null) {
$regexp['pattern'] = $pattern;
if ($flags) $regexp['flags'] = $flags;
$this->data['regexp'] = $regexp;
return $this;
} | php | function regexp($pattern, $flags = null) {
$regexp['pattern'] = $pattern;
if ($flags) $regexp['flags'] = $flags;
$this->data['regexp'] = $regexp;
return $this;
} | [
"function",
"regexp",
"(",
"$",
"pattern",
",",
"$",
"flags",
"=",
"null",
")",
"{",
"$",
"regexp",
"[",
"'pattern'",
"]",
"=",
"$",
"pattern",
";",
"if",
"(",
"$",
"flags",
")",
"$",
"regexp",
"[",
"'flags'",
"]",
"=",
"$",
"flags",
";",
"$",
... | Validates that the value of a field matches a Regular Expression.
@param $pattern
@param null $flags
@return $this | [
"Validates",
"that",
"the",
"value",
"of",
"a",
"field",
"matches",
"a",
"Regular",
"Expression",
"."
] | 29399b11b0e085a06ea5976661378c379fe5a731 | https://github.com/incraigulous/contentful-sdk/blob/29399b11b0e085a06ea5976661378c379fe5a731/src/PayloadBuilders/ContentTypeValidation.php#L37-L42 |
14,257 | incraigulous/contentful-sdk | src/PayloadBuilders/ContentTypeValidation.php | ContentTypeValidation.dateRange | function dateRange($min = null, $max = null) {
$range = [];
if ($min) $range['min'] = $min;
if ($max) $range['max'] = $max;
if (count($range)) $this->data['dateRange'] = $range;
return $this;
} | php | function dateRange($min = null, $max = null) {
$range = [];
if ($min) $range['min'] = $min;
if ($max) $range['max'] = $max;
if (count($range)) $this->data['dateRange'] = $range;
return $this;
} | [
"function",
"dateRange",
"(",
"$",
"min",
"=",
"null",
",",
"$",
"max",
"=",
"null",
")",
"{",
"$",
"range",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"min",
")",
"$",
"range",
"[",
"'min'",
"]",
"=",
"$",
"min",
";",
"if",
"(",
"$",
"max",
")",
... | Validates that the value of a field is within a date range. It's defined specifying the min and max values of that range.
@param null $min
@param null $max
@return $this | [
"Validates",
"that",
"the",
"value",
"of",
"a",
"field",
"is",
"within",
"a",
"date",
"range",
".",
"It",
"s",
"defined",
"specifying",
"the",
"min",
"and",
"max",
"values",
"of",
"that",
"range",
"."
] | 29399b11b0e085a06ea5976661378c379fe5a731 | https://github.com/incraigulous/contentful-sdk/blob/29399b11b0e085a06ea5976661378c379fe5a731/src/PayloadBuilders/ContentTypeValidation.php#L50-L56 |
14,258 | incraigulous/contentful-sdk | src/PayloadBuilders/ContentTypeValidation.php | ContentTypeValidation.assetFileSize | function assetFileSize($min = null, $max = null) {
$range = [];
if ($min) $range['min'] = $min;
if ($max) $range['max'] = $max;
if (count($range)) $this->data['assetFileSize'] = $range;
return $this;
} | php | function assetFileSize($min = null, $max = null) {
$range = [];
if ($min) $range['min'] = $min;
if ($max) $range['max'] = $max;
if (count($range)) $this->data['assetFileSize'] = $range;
return $this;
} | [
"function",
"assetFileSize",
"(",
"$",
"min",
"=",
"null",
",",
"$",
"max",
"=",
"null",
")",
"{",
"$",
"range",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"min",
")",
"$",
"range",
"[",
"'min'",
"]",
"=",
"$",
"min",
";",
"if",
"(",
"$",
"max",
"... | Validates that the size of an asset is within a range. It's defined specifying the min and max values of that range. min and max are inclusive.
@param null $min
@param null $max
@return $this | [
"Validates",
"that",
"the",
"size",
"of",
"an",
"asset",
"is",
"within",
"a",
"range",
".",
"It",
"s",
"defined",
"specifying",
"the",
"min",
"and",
"max",
"values",
"of",
"that",
"range",
".",
"min",
"and",
"max",
"are",
"inclusive",
"."
] | 29399b11b0e085a06ea5976661378c379fe5a731 | https://github.com/incraigulous/contentful-sdk/blob/29399b11b0e085a06ea5976661378c379fe5a731/src/PayloadBuilders/ContentTypeValidation.php#L64-L70 |
14,259 | incraigulous/contentful-sdk | src/PayloadBuilders/ContentTypeValidation.php | ContentTypeValidation.assetImageDimensions | function assetImageDimensions($height = null, $width = null) {
$imageDimensions = [];
if ($height) $imageDimensions['height'] = $height;
if ($width) $imageDimensions['width'] = $width;
if (count($imageDimensions)) $this->data['assetImageDimensions'] = $imageDimensions;
return $th... | php | function assetImageDimensions($height = null, $width = null) {
$imageDimensions = [];
if ($height) $imageDimensions['height'] = $height;
if ($width) $imageDimensions['width'] = $width;
if (count($imageDimensions)) $this->data['assetImageDimensions'] = $imageDimensions;
return $th... | [
"function",
"assetImageDimensions",
"(",
"$",
"height",
"=",
"null",
",",
"$",
"width",
"=",
"null",
")",
"{",
"$",
"imageDimensions",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"height",
")",
"$",
"imageDimensions",
"[",
"'height'",
"]",
"=",
"$",
"height",
... | Validates that the dimensions of an image are within a range.
@param null $height
@param null $width
@return $this | [
"Validates",
"that",
"the",
"dimensions",
"of",
"an",
"image",
"are",
"within",
"a",
"range",
"."
] | 29399b11b0e085a06ea5976661378c379fe5a731 | https://github.com/incraigulous/contentful-sdk/blob/29399b11b0e085a06ea5976661378c379fe5a731/src/PayloadBuilders/ContentTypeValidation.php#L78-L84 |
14,260 | iP1SMS/ip1-php-sdk | src/Recipient/Membership.php | Membership.getGroup | public function getGroup(Communicator $communicator): ProcessedGroup
{
$groupJSON = $communicator->get('api/groups/'.$this->groupID);
$group = RecipientFactory::createProcessedGroupFromJSON($groupJSON);
return $group;
} | php | public function getGroup(Communicator $communicator): ProcessedGroup
{
$groupJSON = $communicator->get('api/groups/'.$this->groupID);
$group = RecipientFactory::createProcessedGroupFromJSON($groupJSON);
return $group;
} | [
"public",
"function",
"getGroup",
"(",
"Communicator",
"$",
"communicator",
")",
":",
"ProcessedGroup",
"{",
"$",
"groupJSON",
"=",
"$",
"communicator",
"->",
"get",
"(",
"'api/groups/'",
".",
"$",
"this",
"->",
"groupID",
")",
";",
"$",
"group",
"=",
"Rec... | Returns the Group this membership is referenced to.
@param Communicator $communicator Used to fetch the Group from the API.
@return ProcessedGroup | [
"Returns",
"the",
"Group",
"this",
"membership",
"is",
"referenced",
"to",
"."
] | 348e6572a279363ba689c9e0f5689b83a25930f5 | https://github.com/iP1SMS/ip1-php-sdk/blob/348e6572a279363ba689c9e0f5689b83a25930f5/src/Recipient/Membership.php#L66-L71 |
14,261 | iP1SMS/ip1-php-sdk | src/Recipient/Membership.php | Membership.getContact | public function getContact(Communicator $communicator): ProcessedContact
{
$contactJSON = $communicator->get('api/groups/'.$this->contactID);
$contact = RecipientFactory::createProcessedGroupFromJSON($contactJSON);
return $contact;
} | php | public function getContact(Communicator $communicator): ProcessedContact
{
$contactJSON = $communicator->get('api/groups/'.$this->contactID);
$contact = RecipientFactory::createProcessedGroupFromJSON($contactJSON);
return $contact;
} | [
"public",
"function",
"getContact",
"(",
"Communicator",
"$",
"communicator",
")",
":",
"ProcessedContact",
"{",
"$",
"contactJSON",
"=",
"$",
"communicator",
"->",
"get",
"(",
"'api/groups/'",
".",
"$",
"this",
"->",
"contactID",
")",
";",
"$",
"contact",
"... | Returns the Contact this membership is referenced to.
@param Communicator $communicator Used to fetch the Contact from the API.
@return ProcessedContact | [
"Returns",
"the",
"Contact",
"this",
"membership",
"is",
"referenced",
"to",
"."
] | 348e6572a279363ba689c9e0f5689b83a25930f5 | https://github.com/iP1SMS/ip1-php-sdk/blob/348e6572a279363ba689c9e0f5689b83a25930f5/src/Recipient/Membership.php#L77-L82 |
14,262 | iP1SMS/ip1-php-sdk | src/Recipient/ProcessedContact.php | ProcessedContact.getGroups | public function getGroups(Communicator $communicator = null): ClassValidationArray
{
if ($communicator !== null) {
$groupsJSON = $communicator->get('api/contacts/'.$this->contactID. '/groups');
$groupStd = json_decode($groupsJSON);
$groups = RecipientFactory::createProces... | php | public function getGroups(Communicator $communicator = null): ClassValidationArray
{
if ($communicator !== null) {
$groupsJSON = $communicator->get('api/contacts/'.$this->contactID. '/groups');
$groupStd = json_decode($groupsJSON);
$groups = RecipientFactory::createProces... | [
"public",
"function",
"getGroups",
"(",
"Communicator",
"$",
"communicator",
"=",
"null",
")",
":",
"ClassValidationArray",
"{",
"if",
"(",
"$",
"communicator",
"!==",
"null",
")",
"{",
"$",
"groupsJSON",
"=",
"$",
"communicator",
"->",
"get",
"(",
"'api/con... | Returns an array of all the Groups the group is referenced in.
If a communicator is not provided it will not fetch memberships from the API
but return those that has been fetched, if any.
@param Communicator $communicator Used to fetch Groups from the API.
@return ClassValidationArray An array of Group objects. | [
"Returns",
"an",
"array",
"of",
"all",
"the",
"Groups",
"the",
"group",
"is",
"referenced",
"in",
".",
"If",
"a",
"communicator",
"is",
"not",
"provided",
"it",
"will",
"not",
"fetch",
"memberships",
"from",
"the",
"API",
"but",
"return",
"those",
"that",
... | 348e6572a279363ba689c9e0f5689b83a25930f5 | https://github.com/iP1SMS/ip1-php-sdk/blob/348e6572a279363ba689c9e0f5689b83a25930f5/src/Recipient/ProcessedContact.php#L144-L154 |
14,263 | iP1SMS/ip1-php-sdk | src/Recipient/ProcessedContact.php | ProcessedContact.addGroup | public function addGroup(Communicator $communicator, ProcessedGroup $group): ProcessedMembership
{
$response = $communicator->post('api/memberships', new Membership($group->getID(), $this->contactID));
$returnValue = RecipientFactory::createProcessedMembershipFromJSON($response);
if ($this-... | php | public function addGroup(Communicator $communicator, ProcessedGroup $group): ProcessedMembership
{
$response = $communicator->post('api/memberships', new Membership($group->getID(), $this->contactID));
$returnValue = RecipientFactory::createProcessedMembershipFromJSON($response);
if ($this-... | [
"public",
"function",
"addGroup",
"(",
"Communicator",
"$",
"communicator",
",",
"ProcessedGroup",
"$",
"group",
")",
":",
"ProcessedMembership",
"{",
"$",
"response",
"=",
"$",
"communicator",
"->",
"post",
"(",
"'api/memberships'",
",",
"new",
"Membership",
"(... | Adds the contact to the given group and returns the membership.
@param Communicator $communicator Used to fetch Groups from the API.
@param ProcessedGroup $group The group the contact should be added to.
@return ProcessedMembership | [
"Adds",
"the",
"contact",
"to",
"the",
"given",
"group",
"and",
"returns",
"the",
"membership",
"."
] | 348e6572a279363ba689c9e0f5689b83a25930f5 | https://github.com/iP1SMS/ip1-php-sdk/blob/348e6572a279363ba689c9e0f5689b83a25930f5/src/Recipient/ProcessedContact.php#L161-L169 |
14,264 | unimapper/unimapper | src/Convention.php | Convention.classToName | public static function classToName($class, $type)
{
if (!class_exists($class)) {
throw new InvalidArgumentException(
"Class '" . $class . "' not found!"
);
}
$class = self::_trimNamespace($class);
if (!isset(self::$masks[$type])) {
... | php | public static function classToName($class, $type)
{
if (!class_exists($class)) {
throw new InvalidArgumentException(
"Class '" . $class . "' not found!"
);
}
$class = self::_trimNamespace($class);
if (!isset(self::$masks[$type])) {
... | [
"public",
"static",
"function",
"classToName",
"(",
"$",
"class",
",",
"$",
"type",
")",
"{",
"if",
"(",
"!",
"class_exists",
"(",
"$",
"class",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"\"Class '\"",
".",
"$",
"class",
".",
"\"' n... | Converts class to name
@param string $class
@param integer $type Mask type
@return string
@throws InvalidArgumentException | [
"Converts",
"class",
"to",
"name"
] | a63b39f38a790fec7e852c8ef1e4c31653e689f7 | https://github.com/unimapper/unimapper/blob/a63b39f38a790fec7e852c8ef1e4c31653e689f7/src/Convention.php#L67-L90 |
14,265 | unimapper/unimapper | src/Convention.php | Convention.nameToClass | public static function nameToClass($name, $type)
{
if (!isset(self::$masks[$type])) {
throw new InvalidArgumentException(
"Invalid mask type " . $type . "!"
);
}
return str_replace("*", $name, self::$masks[$type]);
} | php | public static function nameToClass($name, $type)
{
if (!isset(self::$masks[$type])) {
throw new InvalidArgumentException(
"Invalid mask type " . $type . "!"
);
}
return str_replace("*", $name, self::$masks[$type]);
} | [
"public",
"static",
"function",
"nameToClass",
"(",
"$",
"name",
",",
"$",
"type",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"masks",
"[",
"$",
"type",
"]",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"\"Invalid mas... | Converts name to class
@param string $name
@param integer $type
@return string
@throws InvalidArgumentException | [
"Converts",
"name",
"to",
"class"
] | a63b39f38a790fec7e852c8ef1e4c31653e689f7 | https://github.com/unimapper/unimapper/blob/a63b39f38a790fec7e852c8ef1e4c31653e689f7/src/Convention.php#L102-L110 |
14,266 | LIN3S/WPFoundation | src/LIN3S/WPFoundation/Configuration/Assets/Assets.php | Assets.addScript | protected function addScript(
$name,
$from = AssetsInterface::ASSETS_JS,
array $dependencies = ['jquery'],
$version = '1.0.0',
$inFooter = true,
$ajaxUrl = null
) {
wp_enqueue_script($name, $this->path($from, $name), $dependencies, $version, $inFooter);
... | php | protected function addScript(
$name,
$from = AssetsInterface::ASSETS_JS,
array $dependencies = ['jquery'],
$version = '1.0.0',
$inFooter = true,
$ajaxUrl = null
) {
wp_enqueue_script($name, $this->path($from, $name), $dependencies, $version, $inFooter);
... | [
"protected",
"function",
"addScript",
"(",
"$",
"name",
",",
"$",
"from",
"=",
"AssetsInterface",
"::",
"ASSETS_JS",
",",
"array",
"$",
"dependencies",
"=",
"[",
"'jquery'",
"]",
",",
"$",
"version",
"=",
"'1.0.0'",
",",
"$",
"inFooter",
"=",
"true",
","... | Method that wraps the WordPress internal "wp_enqueue_script"
simplifying the process adding some common default values.
@param string $name The name of asset
@param string $from The from location, by default is the JS files default location
@param array $dependencies A... | [
"Method",
"that",
"wraps",
"the",
"WordPress",
"internal",
"wp_enqueue_script",
"simplifying",
"the",
"process",
"adding",
"some",
"common",
"default",
"values",
"."
] | 4f5674b0544b770809f1ffa7bd7d8fdfe013e4bf | https://github.com/LIN3S/WPFoundation/blob/4f5674b0544b770809f1ffa7bd7d8fdfe013e4bf/src/LIN3S/WPFoundation/Configuration/Assets/Assets.php#L73-L88 |
14,267 | LIN3S/WPFoundation | src/LIN3S/WPFoundation/Configuration/Assets/Assets.php | Assets.addStylesheet | protected function addStylesheet(
$name,
$from = AssetsInterface::CSS,
array $dependencies = [],
$version = '1.0.0',
$media = 'all'
) {
wp_enqueue_style($name, $this->path($from, $name, 'css'), $dependencies, $version, $media);
return $this;
} | php | protected function addStylesheet(
$name,
$from = AssetsInterface::CSS,
array $dependencies = [],
$version = '1.0.0',
$media = 'all'
) {
wp_enqueue_style($name, $this->path($from, $name, 'css'), $dependencies, $version, $media);
return $this;
} | [
"protected",
"function",
"addStylesheet",
"(",
"$",
"name",
",",
"$",
"from",
"=",
"AssetsInterface",
"::",
"CSS",
",",
"array",
"$",
"dependencies",
"=",
"[",
"]",
",",
"$",
"version",
"=",
"'1.0.0'",
",",
"$",
"media",
"=",
"'all'",
")",
"{",
"wp_enq... | Method that wraps the WordPress internal "wp_enqueue_style"
simplifying the process adding some common default values.
@param string $name The name of asset
@param string $from The from location, by default is the CSS files default location
@param array $dependencies Array which contains the dependenc... | [
"Method",
"that",
"wraps",
"the",
"WordPress",
"internal",
"wp_enqueue_style",
"simplifying",
"the",
"process",
"adding",
"some",
"common",
"default",
"values",
"."
] | 4f5674b0544b770809f1ffa7bd7d8fdfe013e4bf | https://github.com/LIN3S/WPFoundation/blob/4f5674b0544b770809f1ffa7bd7d8fdfe013e4bf/src/LIN3S/WPFoundation/Configuration/Assets/Assets.php#L102-L112 |
14,268 | LIN3S/WPFoundation | src/LIN3S/WPFoundation/Configuration/Assets/Assets.php | Assets.registerAjaxUrls | protected function registerAjaxUrls($name, $ajaxUrl)
{
if (false === is_array($ajaxUrl)) {
$ajaxUrl = [$ajaxUrl];
}
foreach ($ajaxUrl as $url) {
wp_localize_script($name, $url, [
'ajaxUrl' => admin_url('admin-ajax.php'),
]);
}
} | php | protected function registerAjaxUrls($name, $ajaxUrl)
{
if (false === is_array($ajaxUrl)) {
$ajaxUrl = [$ajaxUrl];
}
foreach ($ajaxUrl as $url) {
wp_localize_script($name, $url, [
'ajaxUrl' => admin_url('admin-ajax.php'),
]);
}
} | [
"protected",
"function",
"registerAjaxUrls",
"(",
"$",
"name",
",",
"$",
"ajaxUrl",
")",
"{",
"if",
"(",
"false",
"===",
"is_array",
"(",
"$",
"ajaxUrl",
")",
")",
"{",
"$",
"ajaxUrl",
"=",
"[",
"$",
"ajaxUrl",
"]",
";",
"}",
"foreach",
"(",
"$",
"... | Registers the ajax urls inside given JS filename.
@param string $name The script file name
@param string $ajaxUrl The name that is going to expose in JS file as ajaxUrl
Usage example with name="subscribe" and ajaxUrl="subscribeAjax":
// subscribe.js
$.ajax({
url: subscribeAjax.ajaxUrl,
method: 'GET',
data: {
act... | [
"Registers",
"the",
"ajax",
"urls",
"inside",
"given",
"JS",
"filename",
"."
] | 4f5674b0544b770809f1ffa7bd7d8fdfe013e4bf | https://github.com/LIN3S/WPFoundation/blob/4f5674b0544b770809f1ffa7bd7d8fdfe013e4bf/src/LIN3S/WPFoundation/Configuration/Assets/Assets.php#L134-L144 |
14,269 | cauditor/php-analyzer | src/Analyzers/PDepend/Analyzer.php | Analyzer.pdepend | protected function pdepend($path)
{
$jsonGenerator = new JsonGenerator();
$jsonGenerator->setLogFile($path.DIRECTORY_SEPARATOR.$this->json);
$application = new Application();
// overwrite default config to ensure that cache files are stored in
// different folders per build... | php | protected function pdepend($path)
{
$jsonGenerator = new JsonGenerator();
$jsonGenerator->setLogFile($path.DIRECTORY_SEPARATOR.$this->json);
$application = new Application();
// overwrite default config to ensure that cache files are stored in
// different folders per build... | [
"protected",
"function",
"pdepend",
"(",
"$",
"path",
")",
"{",
"$",
"jsonGenerator",
"=",
"new",
"JsonGenerator",
"(",
")",
";",
"$",
"jsonGenerator",
"->",
"setLogFile",
"(",
"$",
"path",
".",
"DIRECTORY_SEPARATOR",
".",
"$",
"this",
"->",
"json",
")",
... | Runs pdepend to generate the metrics.
@param string $path
@throws Exception | [
"Runs",
"pdepend",
"to",
"generate",
"the",
"metrics",
"."
] | 0d86686d64d01e6aaed433898841894fa3ce1101 | https://github.com/cauditor/php-analyzer/blob/0d86686d64d01e6aaed433898841894fa3ce1101/src/Analyzers/PDepend/Analyzer.php#L81-L111 |
14,270 | joomla-projects/jorobo | src/Tasks/Deploy/Package.php | Package.createComponentZip | public function createComponentZip()
{
$comZip = new \ZipArchive(JPATH_BASE . "/dist", \ZipArchive::CREATE);
$tmp_path = '/dist/tmp/cbuild';
if (file_exists(JPATH_BASE . $tmp_path))
{
$this->_deleteDir(JPATH_BASE . $tmp_path);
}
// Improve, should been a whitelist instead of a hardcoded copy
$this-... | php | public function createComponentZip()
{
$comZip = new \ZipArchive(JPATH_BASE . "/dist", \ZipArchive::CREATE);
$tmp_path = '/dist/tmp/cbuild';
if (file_exists(JPATH_BASE . $tmp_path))
{
$this->_deleteDir(JPATH_BASE . $tmp_path);
}
// Improve, should been a whitelist instead of a hardcoded copy
$this-... | [
"public",
"function",
"createComponentZip",
"(",
")",
"{",
"$",
"comZip",
"=",
"new",
"\\",
"ZipArchive",
"(",
"JPATH_BASE",
".",
"\"/dist\"",
",",
"\\",
"ZipArchive",
"::",
"CREATE",
")",
";",
"$",
"tmp_path",
"=",
"'/dist/tmp/cbuild'",
";",
"if",
"(",
"f... | Create a installable zip file for a component
@TODO implement possibility for multiple components (without duplicate content)
@return void
@since 1.0 | [
"Create",
"a",
"installable",
"zip",
"file",
"for",
"a",
"component"
] | e72dd0ed15f387739f67cacdbc2c0bd1b427f317 | https://github.com/joomla-projects/jorobo/blob/e72dd0ed15f387739f67cacdbc2c0bd1b427f317/src/Tasks/Deploy/Package.php#L261-L295 |
14,271 | joomla-projects/jorobo | src/Tasks/Deploy/Package.php | Package.createLibraryZips | public function createLibraryZips()
{
$path = $this->current . "/libraries";
// Get every module
$hdl = opendir($path);
while ($lib = readdir($hdl))
{
// Only folders
$p = $path . "/" . $lib;
if (substr($lib, 0, 1) == '.')
{
continue;
}
// Workaround for libraries without lib_
if... | php | public function createLibraryZips()
{
$path = $this->current . "/libraries";
// Get every module
$hdl = opendir($path);
while ($lib = readdir($hdl))
{
// Only folders
$p = $path . "/" . $lib;
if (substr($lib, 0, 1) == '.')
{
continue;
}
// Workaround for libraries without lib_
if... | [
"public",
"function",
"createLibraryZips",
"(",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"current",
".",
"\"/libraries\"",
";",
"// Get every module",
"$",
"hdl",
"=",
"opendir",
"(",
"$",
"path",
")",
";",
"while",
"(",
"$",
"lib",
"=",
"readdir",... | Create zips for libraries
@return void
@since 1.0 | [
"Create",
"zips",
"for",
"libraries"
] | e72dd0ed15f387739f67cacdbc2c0bd1b427f317 | https://github.com/joomla-projects/jorobo/blob/e72dd0ed15f387739f67cacdbc2c0bd1b427f317/src/Tasks/Deploy/Package.php#L304-L347 |
14,272 | joomla-projects/jorobo | src/Tasks/Deploy/Package.php | Package.createModuleZips | public function createModuleZips()
{
$path = $this->current . "/modules";
// Get every module
$hdl = opendir($path);
while ($entry = readdir($hdl))
{
// Only folders
$p = $path . "/" . $entry;
if (substr($entry, 0, 1) == '.')
{
continue;
}
if (!is_file($p))
{
$this->say("Pack... | php | public function createModuleZips()
{
$path = $this->current . "/modules";
// Get every module
$hdl = opendir($path);
while ($entry = readdir($hdl))
{
// Only folders
$p = $path . "/" . $entry;
if (substr($entry, 0, 1) == '.')
{
continue;
}
if (!is_file($p))
{
$this->say("Pack... | [
"public",
"function",
"createModuleZips",
"(",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"current",
".",
"\"/modules\"",
";",
"// Get every module",
"$",
"hdl",
"=",
"opendir",
"(",
"$",
"path",
")",
";",
"while",
"(",
"$",
"entry",
"=",
"readdir",
... | Create zips for modules
@return void
@since 1.0 | [
"Create",
"zips",
"for",
"modules"
] | e72dd0ed15f387739f67cacdbc2c0bd1b427f317 | https://github.com/joomla-projects/jorobo/blob/e72dd0ed15f387739f67cacdbc2c0bd1b427f317/src/Tasks/Deploy/Package.php#L356-L393 |
14,273 | joomla-projects/jorobo | src/Tasks/Deploy/Package.php | Package.createPluginZips | public function createPluginZips()
{
$path = $this->current . "/plugins";
// Get every plugin
$hdl = opendir($path);
while ($entry = readdir($hdl))
{
// Only folders
$p = $path . "/" . $entry;
if (substr($entry, 0, 1) == '.')
{
continue;
}
if (!is_file($p))
{
// Plugin type f... | php | public function createPluginZips()
{
$path = $this->current . "/plugins";
// Get every plugin
$hdl = opendir($path);
while ($entry = readdir($hdl))
{
// Only folders
$p = $path . "/" . $entry;
if (substr($entry, 0, 1) == '.')
{
continue;
}
if (!is_file($p))
{
// Plugin type f... | [
"public",
"function",
"createPluginZips",
"(",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"current",
".",
"\"/plugins\"",
";",
"// Get every plugin",
"$",
"hdl",
"=",
"opendir",
"(",
"$",
"path",
")",
";",
"while",
"(",
"$",
"entry",
"=",
"readdir",
... | Create zips for plugins
@return void
@since 1.0 | [
"Create",
"zips",
"for",
"plugins"
] | e72dd0ed15f387739f67cacdbc2c0bd1b427f317 | https://github.com/joomla-projects/jorobo/blob/e72dd0ed15f387739f67cacdbc2c0bd1b427f317/src/Tasks/Deploy/Package.php#L402-L460 |
14,274 | PandaPlatform/framework | src/Panda/Localization/Translator.php | Translator.translate | public function translate($key, $package = 'default', $locale = '', $default = null)
{
// Normalize locale to current if the given is empty
$defaultLocale = Locale::getDefault();
$locale = $locale ?: Locale::get();
$locale = $locale ?: $defaultLocale;
// Get locale fallback
... | php | public function translate($key, $package = 'default', $locale = '', $default = null)
{
// Normalize locale to current if the given is empty
$defaultLocale = Locale::getDefault();
$locale = $locale ?: Locale::get();
$locale = $locale ?: $defaultLocale;
// Get locale fallback
... | [
"public",
"function",
"translate",
"(",
"$",
"key",
",",
"$",
"package",
"=",
"'default'",
",",
"$",
"locale",
"=",
"''",
",",
"$",
"default",
"=",
"null",
")",
"{",
"// Normalize locale to current if the given is empty",
"$",
"defaultLocale",
"=",
"Locale",
"... | Get a translation value.
If there is no value for the given locale, it tries to fallback to default locale.
If the default value is null and no translation is found, it throws Exception.
@param string $key
@param string $package
@param string $locale
@param mixed $default
@return string
@throws Exception | [
"Get",
"a",
"translation",
"value",
".",
"If",
"there",
"is",
"no",
"value",
"for",
"the",
"given",
"locale",
"it",
"tries",
"to",
"fallback",
"to",
"default",
"locale",
".",
"If",
"the",
"default",
"value",
"is",
"null",
"and",
"no",
"translation",
"is"... | a78cf051b379896b5a4d5df620988e37a0e632f5 | https://github.com/PandaPlatform/framework/blob/a78cf051b379896b5a4d5df620988e37a0e632f5/src/Panda/Localization/Translator.php#L53-L76 |
14,275 | ipunkt/social-auth | src/Ipunkt/SocialAuth/Profile/CompositeProfile.php | CompositeProfile.getValue | protected function getValue($field) {
$value = null;
$readField = 'get'.$field;
foreach($this->readProfiles as $profile) {
$value = $profile->$readField();
if($value !== null) {
$this->setValue($field, $value);
break;
}
}
return $value;
} | php | protected function getValue($field) {
$value = null;
$readField = 'get'.$field;
foreach($this->readProfiles as $profile) {
$value = $profile->$readField();
if($value !== null) {
$this->setValue($field, $value);
break;
}
}
return $value;
} | [
"protected",
"function",
"getValue",
"(",
"$",
"field",
")",
"{",
"$",
"value",
"=",
"null",
";",
"$",
"readField",
"=",
"'get'",
".",
"$",
"field",
";",
"foreach",
"(",
"$",
"this",
"->",
"readProfiles",
"as",
"$",
"profile",
")",
"{",
"$",
"value",... | Searches all profiles for the given value
@param $field
@return mixed | [
"Searches",
"all",
"profiles",
"for",
"the",
"given",
"value"
] | 28723a8e449612789a2cd7d21137996c48b62229 | https://github.com/ipunkt/social-auth/blob/28723a8e449612789a2cd7d21137996c48b62229/src/Ipunkt/SocialAuth/Profile/CompositeProfile.php#L42-L57 |
14,276 | markwatkinson/luminous | src/Luminous/Caches/FileSystemCache.php | FileSystemCache.purgeRecurse | private function purgeRecurse($dir)
{
$base = $dir . '/';
$time = time();
if (substr($dir, 0, strlen($this->dir)) !== $this->dir) {
// uh oh, we somehow tried to escape from the cache directory
assert(0);
return;
}
foreach (scandir($dir) as... | php | private function purgeRecurse($dir)
{
$base = $dir . '/';
$time = time();
if (substr($dir, 0, strlen($this->dir)) !== $this->dir) {
// uh oh, we somehow tried to escape from the cache directory
assert(0);
return;
}
foreach (scandir($dir) as... | [
"private",
"function",
"purgeRecurse",
"(",
"$",
"dir",
")",
"{",
"$",
"base",
"=",
"$",
"dir",
".",
"'/'",
";",
"$",
"time",
"=",
"time",
"(",
")",
";",
"if",
"(",
"substr",
"(",
"$",
"dir",
",",
"0",
",",
"strlen",
"(",
"$",
"this",
"->",
"... | Purges the contents of a directory recursively | [
"Purges",
"the",
"contents",
"of",
"a",
"directory",
"recursively"
] | 4adc18f414534abe986133d6d38e8e9787d32e69 | https://github.com/markwatkinson/luminous/blob/4adc18f414534abe986133d6d38e8e9787d32e69/src/Luminous/Caches/FileSystemCache.php#L119-L144 |
14,277 | opus-online/yii2-giimodel | Generator.php | Generator.generateClassName | protected function generateClassName($tableName, $short = false)
{
$ns = null;
if (list($prefix, $ns) = $this->tablePrefixMatches($tableName)) {
$tableName = substr($tableName, strlen($prefix));
}
$className = parent::generateClassName($tableName);
if (nu... | php | protected function generateClassName($tableName, $short = false)
{
$ns = null;
if (list($prefix, $ns) = $this->tablePrefixMatches($tableName)) {
$tableName = substr($tableName, strlen($prefix));
}
$className = parent::generateClassName($tableName);
if (nu... | [
"protected",
"function",
"generateClassName",
"(",
"$",
"tableName",
",",
"$",
"short",
"=",
"false",
")",
"{",
"$",
"ns",
"=",
"null",
";",
"if",
"(",
"list",
"(",
"$",
"prefix",
",",
"$",
"ns",
")",
"=",
"$",
"this",
"->",
"tablePrefixMatches",
"("... | Generates a class name with namespace prefix from the specified table name.
@param string $tableName the table name (which may contain schema prefix)
@param bool $short
@return string the generated class name | [
"Generates",
"a",
"class",
"name",
"with",
"namespace",
"prefix",
"from",
"the",
"specified",
"table",
"name",
"."
] | 85303396a5e5b540cb38138f4b6af2e6f19d0487 | https://github.com/opus-online/yii2-giimodel/blob/85303396a5e5b540cb38138f4b6af2e6f19d0487/Generator.php#L258-L270 |
14,278 | dpolac/dictionary | Dictionary.php | Dictionary.fromPairs | public static function fromPairs($array)
{
if (!is_array($array) && !($array instanceof \Traversable)) {
throw new \InvalidArgumentException(sprintf(
'Dictionary::fromPairs() argument must be array or Traversable, '
. 'but is "%s".', gettype($array)
))... | php | public static function fromPairs($array)
{
if (!is_array($array) && !($array instanceof \Traversable)) {
throw new \InvalidArgumentException(sprintf(
'Dictionary::fromPairs() argument must be array or Traversable, '
. 'but is "%s".', gettype($array)
))... | [
"public",
"static",
"function",
"fromPairs",
"(",
"$",
"array",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"array",
")",
"&&",
"!",
"(",
"$",
"array",
"instanceof",
"\\",
"Traversable",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException"... | Create new Dictionary from array of key-value pairs.
@param $array array Array of pairs. Each pair must be 2-element array.
@return Dictionary | [
"Create",
"new",
"Dictionary",
"from",
"array",
"of",
"key",
"-",
"value",
"pairs",
"."
] | 7078d8bfe47cfcb11882140f5dbd7c106c1906e6 | https://github.com/dpolac/dictionary/blob/7078d8bfe47cfcb11882140f5dbd7c106c1906e6/Dictionary.php#L137-L158 |
14,279 | dpolac/dictionary | Dictionary.php | Dictionary.fromArray | public static function fromArray($array)
{
if (!is_array($array) && !($array instanceof \Traversable)) {
throw new \InvalidArgumentException(sprintf(
'Dictionary::fromArray() argument must be array or Traversable, '
. 'but is "%s".', gettype($array)
))... | php | public static function fromArray($array)
{
if (!is_array($array) && !($array instanceof \Traversable)) {
throw new \InvalidArgumentException(sprintf(
'Dictionary::fromArray() argument must be array or Traversable, '
. 'but is "%s".', gettype($array)
))... | [
"public",
"static",
"function",
"fromArray",
"(",
"$",
"array",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"array",
")",
"&&",
"!",
"(",
"$",
"array",
"instanceof",
"\\",
"Traversable",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException"... | Create new Dictionary from standard PHP array.
@param $array array Array to create Dictionary from.
@return Dictionary | [
"Create",
"new",
"Dictionary",
"from",
"standard",
"PHP",
"array",
"."
] | 7078d8bfe47cfcb11882140f5dbd7c106c1906e6 | https://github.com/dpolac/dictionary/blob/7078d8bfe47cfcb11882140f5dbd7c106c1906e6/Dictionary.php#L166-L180 |
14,280 | dpolac/dictionary | Dictionary.php | Dictionary.toPairs | public function toPairs()
{
$result = [];
foreach ($this as $key => $value) {
$result[] = [$key, $value];
}
return $result;
} | php | public function toPairs()
{
$result = [];
foreach ($this as $key => $value) {
$result[] = [$key, $value];
}
return $result;
} | [
"public",
"function",
"toPairs",
"(",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"result",
"[",
"]",
"=",
"[",
"$",
"key",
",",
"$",
"value",
"]",
";",
"}",
... | Get array of all key-value pairs in dictionary.
@return array Array of pairs. Each pair is 2-element array. | [
"Get",
"array",
"of",
"all",
"key",
"-",
"value",
"pairs",
"in",
"dictionary",
"."
] | 7078d8bfe47cfcb11882140f5dbd7c106c1906e6 | https://github.com/dpolac/dictionary/blob/7078d8bfe47cfcb11882140f5dbd7c106c1906e6/Dictionary.php#L187-L194 |
14,281 | dpolac/dictionary | Dictionary.php | Dictionary.sortBy | public function sortBy($callback = null, $direction = 'ASC')
{
if (!is_callable($callback)) {
if (is_null($callback) or is_string($callback) && 'values' === strtolower($callback)) {
$callback = function ($value, $key) { return $value; };
} else if (is_string($callback... | php | public function sortBy($callback = null, $direction = 'ASC')
{
if (!is_callable($callback)) {
if (is_null($callback) or is_string($callback) && 'values' === strtolower($callback)) {
$callback = function ($value, $key) { return $value; };
} else if (is_string($callback... | [
"public",
"function",
"sortBy",
"(",
"$",
"callback",
"=",
"null",
",",
"$",
"direction",
"=",
"'ASC'",
")",
"{",
"if",
"(",
"!",
"is_callable",
"(",
"$",
"callback",
")",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"callback",
")",
"or",
"is_string",
... | Sort Dictionary by values returned by callback.
@param string|callable $callback Callback returning value for each Dictionary's element.
If argument is a string "values" or "keys", it will be sorted
by Dictionary's values or keys.
@param string $direction Sorting direction. "ASC" or "DESC".
@return $t... | [
"Sort",
"Dictionary",
"by",
"values",
"returned",
"by",
"callback",
"."
] | 7078d8bfe47cfcb11882140f5dbd7c106c1906e6 | https://github.com/dpolac/dictionary/blob/7078d8bfe47cfcb11882140f5dbd7c106c1906e6/Dictionary.php#L225-L267 |
14,282 | terdia/legato-framework | src/Routing/RouteDispatcher.php | RouteDispatcher.handle | private function handle($handler, $parameters)
{
if ($handler instanceof \Closure) {
$this->app->execute($handler, $parameters);
} else {
list($controller, $action) = explode('@', $handler);
$class = $this->app->construct($controller);
$this->app->exe... | php | private function handle($handler, $parameters)
{
if ($handler instanceof \Closure) {
$this->app->execute($handler, $parameters);
} else {
list($controller, $action) = explode('@', $handler);
$class = $this->app->construct($controller);
$this->app->exe... | [
"private",
"function",
"handle",
"(",
"$",
"handler",
",",
"$",
"parameters",
")",
"{",
"if",
"(",
"$",
"handler",
"instanceof",
"\\",
"Closure",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"execute",
"(",
"$",
"handler",
",",
"$",
"parameters",
")",
"... | Handler for route found, support Closure and Controller methods.
@param $handler
@param $parameters | [
"Handler",
"for",
"route",
"found",
"support",
"Closure",
"and",
"Controller",
"methods",
"."
] | 44057c1c3c6f3e9643e9fade51bd417860fafda8 | https://github.com/terdia/legato-framework/blob/44057c1c3c6f3e9643e9fade51bd417860fafda8/src/Routing/RouteDispatcher.php#L52-L62 |
14,283 | christophe-brachet/aspi-framework | src/Framework/Form/Fieldset.php | Fieldset.createFromConfig | public static function createFromConfig(array $config)
{
$fields = [];
foreach ($config as $name => $field) {
$fields[$name] = Fields::create($name, $field);
}
return new static($fields);
} | php | public static function createFromConfig(array $config)
{
$fields = [];
foreach ($config as $name => $field) {
$fields[$name] = Fields::create($name, $field);
}
return new static($fields);
} | [
"public",
"static",
"function",
"createFromConfig",
"(",
"array",
"$",
"config",
")",
"{",
"$",
"fields",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"config",
"as",
"$",
"name",
"=>",
"$",
"field",
")",
"{",
"$",
"fields",
"[",
"$",
"name",
"]",
"=",... | Method to create form fieldset object and fields from config
@param array $config
@return Fieldset | [
"Method",
"to",
"create",
"form",
"fieldset",
"object",
"and",
"fields",
"from",
"config"
] | 17a36c8a8582e0b8d8bff7087590c09a9bd4af1e | https://github.com/christophe-brachet/aspi-framework/blob/17a36c8a8582e0b8d8bff7087590c09a9bd4af1e/src/Framework/Form/Fieldset.php#L61-L68 |
14,284 | christophe-brachet/aspi-framework | src/Framework/Form/Fieldset.php | Fieldset.setCurrent | public function setCurrent($i)
{
$this->current = (int)$i;
if (!isset($this->fields[$this->current])) {
$this->fields[$this->current] = [];
}
return $this;
} | php | public function setCurrent($i)
{
$this->current = (int)$i;
if (!isset($this->fields[$this->current])) {
$this->fields[$this->current] = [];
}
return $this;
} | [
"public",
"function",
"setCurrent",
"(",
"$",
"i",
")",
"{",
"$",
"this",
"->",
"current",
"=",
"(",
"int",
")",
"$",
"i",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"fields",
"[",
"$",
"this",
"->",
"current",
"]",
")",
")",
"{",
... | Method to get current group index
@param int $i
@return Fieldset | [
"Method",
"to",
"get",
"current",
"group",
"index"
] | 17a36c8a8582e0b8d8bff7087590c09a9bd4af1e | https://github.com/christophe-brachet/aspi-framework/blob/17a36c8a8582e0b8d8bff7087590c09a9bd4af1e/src/Framework/Form/Fieldset.php#L86-L93 |
14,285 | christophe-brachet/aspi-framework | src/Framework/Form/Fieldset.php | Fieldset.insertFieldAfter | public function insertFieldAfter($name, Element\AbstractElement $field)
{
foreach ($this->fields as $i => $group) {
$fields = [];
foreach ($group as $key => $value) {
if ($key == $name) {
$fields[$key] = $value;
$fields[$field->... | php | public function insertFieldAfter($name, Element\AbstractElement $field)
{
foreach ($this->fields as $i => $group) {
$fields = [];
foreach ($group as $key => $value) {
if ($key == $name) {
$fields[$key] = $value;
$fields[$field->... | [
"public",
"function",
"insertFieldAfter",
"(",
"$",
"name",
",",
"Element",
"\\",
"AbstractElement",
"$",
"field",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"fields",
"as",
"$",
"i",
"=>",
"$",
"group",
")",
"{",
"$",
"fields",
"=",
"[",
"]",
";",... | Method to insert a field after another one
@param string $name
@param Element\AbstractElement $field
@return Fieldset | [
"Method",
"to",
"insert",
"a",
"field",
"after",
"another",
"one"
] | 17a36c8a8582e0b8d8bff7087590c09a9bd4af1e | https://github.com/christophe-brachet/aspi-framework/blob/17a36c8a8582e0b8d8bff7087590c09a9bd4af1e/src/Framework/Form/Fieldset.php#L162-L177 |
14,286 | christophe-brachet/aspi-framework | src/Framework/Form/Fieldset.php | Fieldset.count | public function count()
{
$count = 0;
foreach ($this->fields as $group) {
$count += count($group);
}
return $count;
} | php | public function count()
{
$count = 0;
foreach ($this->fields as $group) {
$count += count($group);
}
return $count;
} | [
"public",
"function",
"count",
"(",
")",
"{",
"$",
"count",
"=",
"0",
";",
"foreach",
"(",
"$",
"this",
"->",
"fields",
"as",
"$",
"group",
")",
"{",
"$",
"count",
"+=",
"count",
"(",
"$",
"group",
")",
";",
"}",
"return",
"$",
"count",
";",
"}... | Method to get the count of elements in the form fieldset
@return int | [
"Method",
"to",
"get",
"the",
"count",
"of",
"elements",
"in",
"the",
"form",
"fieldset"
] | 17a36c8a8582e0b8d8bff7087590c09a9bd4af1e | https://github.com/christophe-brachet/aspi-framework/blob/17a36c8a8582e0b8d8bff7087590c09a9bd4af1e/src/Framework/Form/Fieldset.php#L183-L190 |
14,287 | christophe-brachet/aspi-framework | src/Framework/Form/Fieldset.php | Fieldset.hasField | public function hasField($name)
{
$result = false;
foreach ($this->fields as $key => $fields) {
if (isset($fields[$name])) {
$result = true;
break;
}
}
return $result;
} | php | public function hasField($name)
{
$result = false;
foreach ($this->fields as $key => $fields) {
if (isset($fields[$name])) {
$result = true;
break;
}
}
return $result;
} | [
"public",
"function",
"hasField",
"(",
"$",
"name",
")",
"{",
"$",
"result",
"=",
"false",
";",
"foreach",
"(",
"$",
"this",
"->",
"fields",
"as",
"$",
"key",
"=>",
"$",
"fields",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"fields",
"[",
"$",
"name"... | Method to determine if the fieldset has a field
@param string $name
@return boolean | [
"Method",
"to",
"determine",
"if",
"the",
"fieldset",
"has",
"a",
"field"
] | 17a36c8a8582e0b8d8bff7087590c09a9bd4af1e | https://github.com/christophe-brachet/aspi-framework/blob/17a36c8a8582e0b8d8bff7087590c09a9bd4af1e/src/Framework/Form/Fieldset.php#L239-L249 |
14,288 | christophe-brachet/aspi-framework | src/Framework/Form/Fieldset.php | Fieldset.getFields | public function getFields($i)
{
return (isset($this->fields[$i])) ? $this->fields[$i] : null;
} | php | public function getFields($i)
{
return (isset($this->fields[$i])) ? $this->fields[$i] : null;
} | [
"public",
"function",
"getFields",
"(",
"$",
"i",
")",
"{",
"return",
"(",
"isset",
"(",
"$",
"this",
"->",
"fields",
"[",
"$",
"i",
"]",
")",
")",
"?",
"$",
"this",
"->",
"fields",
"[",
"$",
"i",
"]",
":",
"null",
";",
"}"
] | Method to get field element objects in a group
@param int $i
@return array | [
"Method",
"to",
"get",
"field",
"element",
"objects",
"in",
"a",
"group"
] | 17a36c8a8582e0b8d8bff7087590c09a9bd4af1e | https://github.com/christophe-brachet/aspi-framework/blob/17a36c8a8582e0b8d8bff7087590c09a9bd4af1e/src/Framework/Form/Fieldset.php#L272-L275 |
14,289 | christophe-brachet/aspi-framework | src/Framework/Form/Fieldset.php | Fieldset.getAllFields | public function getAllFields()
{
$fields = [];
foreach ($this->fields as $group) {
foreach ($group as $field) {
$fields[$field->getName()] = $field;
}
}
return $fields;
} | php | public function getAllFields()
{
$fields = [];
foreach ($this->fields as $group) {
foreach ($group as $field) {
$fields[$field->getName()] = $field;
}
}
return $fields;
} | [
"public",
"function",
"getAllFields",
"(",
")",
"{",
"$",
"fields",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"fields",
"as",
"$",
"group",
")",
"{",
"foreach",
"(",
"$",
"group",
"as",
"$",
"field",
")",
"{",
"$",
"fields",
"[",
"$"... | Method to get all field elements
@return array | [
"Method",
"to",
"get",
"all",
"field",
"elements"
] | 17a36c8a8582e0b8d8bff7087590c09a9bd4af1e | https://github.com/christophe-brachet/aspi-framework/blob/17a36c8a8582e0b8d8bff7087590c09a9bd4af1e/src/Framework/Form/Fieldset.php#L290-L299 |
14,290 | christophe-brachet/aspi-framework | src/Framework/Form/Fieldset.php | Fieldset.prepareForView | public function prepareForView()
{
$fields = [];
foreach ($this->fields as $groups) {
foreach ($groups as $field) {
if (null !== $field->getLabel()) {
$labelFor = $field->getName() . (($field->getNodeName() == 'fieldset') ? '1' : '');
... | php | public function prepareForView()
{
$fields = [];
foreach ($this->fields as $groups) {
foreach ($groups as $field) {
if (null !== $field->getLabel()) {
$labelFor = $field->getName() . (($field->getNodeName() == 'fieldset') ? '1' : '');
... | [
"public",
"function",
"prepareForView",
"(",
")",
"{",
"$",
"fields",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"fields",
"as",
"$",
"groups",
")",
"{",
"foreach",
"(",
"$",
"groups",
"as",
"$",
"field",
")",
"{",
"if",
"(",
"null",
... | Prepare fieldset elements for rendering with a view
@return array | [
"Prepare",
"fieldset",
"elements",
"for",
"rendering",
"with",
"a",
"view"
] | 17a36c8a8582e0b8d8bff7087590c09a9bd4af1e | https://github.com/christophe-brachet/aspi-framework/blob/17a36c8a8582e0b8d8bff7087590c09a9bd4af1e/src/Framework/Form/Fieldset.php#L529-L564 |
14,291 | taskforcedev/laravel-support | src/Helpers/User.php | User.getUserModel | public function getUserModel()
{
/* Check the app's auth config, first */
$model = Config::get('auth.model');
if (class_exists($model)) {
return $model;
}
/* That didn't work, so let's try our fallback. First get the namespace */
$ns = $this->getAppNamesp... | php | public function getUserModel()
{
/* Check the app's auth config, first */
$model = Config::get('auth.model');
if (class_exists($model)) {
return $model;
}
/* That didn't work, so let's try our fallback. First get the namespace */
$ns = $this->getAppNamesp... | [
"public",
"function",
"getUserModel",
"(",
")",
"{",
"/* Check the app's auth config, first */",
"$",
"model",
"=",
"Config",
"::",
"get",
"(",
"'auth.model'",
")",
";",
"if",
"(",
"class_exists",
"(",
"$",
"model",
")",
")",
"{",
"return",
"$",
"model",
";"... | Gets the user model if found.
@return bool|string | [
"Gets",
"the",
"user",
"model",
"if",
"found",
"."
] | fdfa90ca10ffd57bc6f7aca20d2f3db7dc259221 | https://github.com/taskforcedev/laravel-support/blob/fdfa90ca10ffd57bc6f7aca20d2f3db7dc259221/src/Helpers/User.php#L15-L37 |
14,292 | taskforcedev/laravel-support | src/Helpers/User.php | User.createGuest | public function createGuest()
{
/* Get the namespace */
$model = $this->getUserModel();
if ($model) {
$guest = new $model();
$guest->name = 'Guest';
$guest->email = '[email protected]';
} else {
$guest = (object)['name' => 'Guest', 'ema... | php | public function createGuest()
{
/* Get the namespace */
$model = $this->getUserModel();
if ($model) {
$guest = new $model();
$guest->name = 'Guest';
$guest->email = '[email protected]';
} else {
$guest = (object)['name' => 'Guest', 'ema... | [
"public",
"function",
"createGuest",
"(",
")",
"{",
"/* Get the namespace */",
"$",
"model",
"=",
"$",
"this",
"->",
"getUserModel",
"(",
")",
";",
"if",
"(",
"$",
"model",
")",
"{",
"$",
"guest",
"=",
"new",
"$",
"model",
"(",
")",
";",
"$",
"guest"... | Return an instance of a guest user, uses user model if exists.
@return object | [
"Return",
"an",
"instance",
"of",
"a",
"guest",
"user",
"uses",
"user",
"model",
"if",
"exists",
"."
] | fdfa90ca10ffd57bc6f7aca20d2f3db7dc259221 | https://github.com/taskforcedev/laravel-support/blob/fdfa90ca10ffd57bc6f7aca20d2f3db7dc259221/src/Helpers/User.php#L52-L64 |
14,293 | cbednarski/pharcc | src/cbednarski/Pharcc/Git.php | Git.getVersion | public static function getVersion($path, $strict = false)
{
$version = 'unknown';
$temp_path = getcwd();
// Git needs the cwd to be inside the repo
// proc_open will pick this up automatically
chdir($path);
// multi-level exit loop
do {
$descrip... | php | public static function getVersion($path, $strict = false)
{
$version = 'unknown';
$temp_path = getcwd();
// Git needs the cwd to be inside the repo
// proc_open will pick this up automatically
chdir($path);
// multi-level exit loop
do {
$descrip... | [
"public",
"static",
"function",
"getVersion",
"(",
"$",
"path",
",",
"$",
"strict",
"=",
"false",
")",
"{",
"$",
"version",
"=",
"'unknown'",
";",
"$",
"temp_path",
"=",
"getcwd",
"(",
")",
";",
"// Git needs the cwd to be inside the repo",
"// proc_open will pi... | Determine the git version based on `git describe` and semver conventions.
@see http://semver.org/
@see https://www.kernel.org/pub/software/scm/git/docs/git-describe.html
Normally we'll pull a version number like:
1.0.4 Tagged commit
1.0.4+306 Untagged commit on top of a tag
If the strict param is true, we will... | [
"Determine",
"the",
"git",
"version",
"based",
"on",
"git",
"describe",
"and",
"semver",
"conventions",
"."
] | 562f9d3d13d2856de6a7ca846a83fe70897baaea | https://github.com/cbednarski/pharcc/blob/562f9d3d13d2856de6a7ca846a83fe70897baaea/src/cbednarski/Pharcc/Git.php#L23-L73 |
14,294 | DevGroup-ru/yii2-data-structure-tools | src/behaviors/HasProperties.php | HasProperties.afterFind | public function afterFind()
{
if ($this->autoFetchProperties === true) {
/** @var \yii\db\ActiveRecord|\DevGroup\DataStructure\traits\PropertiesTrait $owner */
$owner = $this->owner;
$owner->ensurePropertyGroupIds();
$models = [&$owner];
Properti... | php | public function afterFind()
{
if ($this->autoFetchProperties === true) {
/** @var \yii\db\ActiveRecord|\DevGroup\DataStructure\traits\PropertiesTrait $owner */
$owner = $this->owner;
$owner->ensurePropertyGroupIds();
$models = [&$owner];
Properti... | [
"public",
"function",
"afterFind",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"autoFetchProperties",
"===",
"true",
")",
"{",
"/** @var \\yii\\db\\ActiveRecord|\\DevGroup\\DataStructure\\traits\\PropertiesTrait $owner */",
"$",
"owner",
"=",
"$",
"this",
"->",
"owner"... | Performs auto fetching properties if it is turned on
@return bool | [
"Performs",
"auto",
"fetching",
"properties",
"if",
"it",
"is",
"turned",
"on"
] | a5b24d7c0b24d4b0d58cacd91ec7fd876e979097 | https://github.com/DevGroup-ru/yii2-data-structure-tools/blob/a5b24d7c0b24d4b0d58cacd91ec7fd876e979097/src/behaviors/HasProperties.php#L59-L71 |
14,295 | DevGroup-ru/yii2-data-structure-tools | src/behaviors/HasProperties.php | HasProperties.beforeDelete | public function beforeDelete()
{
// properties assigned to this record
/** @var \yii\db\ActiveRecord|\DevGroup\DataStructure\traits\PropertiesTrait $owner */
$owner = $this->owner;
$event = new HasPropertiesEvent();
$event->model = $owner;
HasPropertiesEvent::trigger(... | php | public function beforeDelete()
{
// properties assigned to this record
/** @var \yii\db\ActiveRecord|\DevGroup\DataStructure\traits\PropertiesTrait $owner */
$owner = $this->owner;
$event = new HasPropertiesEvent();
$event->model = $owner;
HasPropertiesEvent::trigger(... | [
"public",
"function",
"beforeDelete",
"(",
")",
"{",
"// properties assigned to this record",
"/** @var \\yii\\db\\ActiveRecord|\\DevGroup\\DataStructure\\traits\\PropertiesTrait $owner */",
"$",
"owner",
"=",
"$",
"this",
"->",
"owner",
";",
"$",
"event",
"=",
"new",
"HasPro... | Deletes related properties from database
@return bool | [
"Deletes",
"related",
"properties",
"from",
"database"
] | a5b24d7c0b24d4b0d58cacd91ec7fd876e979097 | https://github.com/DevGroup-ru/yii2-data-structure-tools/blob/a5b24d7c0b24d4b0d58cacd91ec7fd876e979097/src/behaviors/HasProperties.php#L77-L91 |
14,296 | DevGroup-ru/yii2-data-structure-tools | src/behaviors/HasProperties.php | HasProperties.hasPropertyKey | public function hasPropertyKey($key)
{
/** @var \yii\db\ActiveRecord|\DevGroup\DataStructure\traits\PropertiesTrait $owner */
$owner = $this->owner;
$owner->ensurePropertiesAttributes();
return in_array($key, $owner->propertiesAttributes);
} | php | public function hasPropertyKey($key)
{
/** @var \yii\db\ActiveRecord|\DevGroup\DataStructure\traits\PropertiesTrait $owner */
$owner = $this->owner;
$owner->ensurePropertiesAttributes();
return in_array($key, $owner->propertiesAttributes);
} | [
"public",
"function",
"hasPropertyKey",
"(",
"$",
"key",
")",
"{",
"/** @var \\yii\\db\\ActiveRecord|\\DevGroup\\DataStructure\\traits\\PropertiesTrait $owner */",
"$",
"owner",
"=",
"$",
"this",
"->",
"owner",
";",
"$",
"owner",
"->",
"ensurePropertiesAttributes",
"(",
"... | Returns if property is binded to model
@param string $key
@return bool | [
"Returns",
"if",
"property",
"is",
"binded",
"to",
"model"
] | a5b24d7c0b24d4b0d58cacd91ec7fd876e979097 | https://github.com/DevGroup-ru/yii2-data-structure-tools/blob/a5b24d7c0b24d4b0d58cacd91ec7fd876e979097/src/behaviors/HasProperties.php#L98-L104 |
14,297 | DevGroup-ru/yii2-data-structure-tools | src/behaviors/HasProperties.php | HasProperties.afterInsert | public function afterInsert()
{
/** @var \yii\db\ActiveRecord|\DevGroup\DataStructure\traits\PropertiesTrait $owner */
$owner = $this->owner;
$groups = $owner->propertyGroupIds;
$owner->propertyGroupIds = null;
$event = new HasPropertiesEvent();
$event->model = $owner... | php | public function afterInsert()
{
/** @var \yii\db\ActiveRecord|\DevGroup\DataStructure\traits\PropertiesTrait $owner */
$owner = $this->owner;
$groups = $owner->propertyGroupIds;
$owner->propertyGroupIds = null;
$event = new HasPropertiesEvent();
$event->model = $owner... | [
"public",
"function",
"afterInsert",
"(",
")",
"{",
"/** @var \\yii\\db\\ActiveRecord|\\DevGroup\\DataStructure\\traits\\PropertiesTrait $owner */",
"$",
"owner",
"=",
"$",
"this",
"->",
"owner",
";",
"$",
"groups",
"=",
"$",
"owner",
"->",
"propertyGroupIds",
";",
"$",... | Performs after insert stuff | [
"Performs",
"after",
"insert",
"stuff"
] | a5b24d7c0b24d4b0d58cacd91ec7fd876e979097 | https://github.com/DevGroup-ru/yii2-data-structure-tools/blob/a5b24d7c0b24d4b0d58cacd91ec7fd876e979097/src/behaviors/HasProperties.php#L194-L219 |
14,298 | dphn/ScContent | src/ScContent/Controller/Back/ContentManagerController.php | ContentManagerController.indexAction | public function indexAction()
{
$optionsProvider = $this->getOptionsProvider();
if ($this->getRequest()->isPost()) {
$event = $this->request->getPost('suboperation');
if (! empty($event)) {
$events = $this->getEventManager();
$params = $this->r... | php | public function indexAction()
{
$optionsProvider = $this->getOptionsProvider();
if ($this->getRequest()->isPost()) {
$event = $this->request->getPost('suboperation');
if (! empty($event)) {
$events = $this->getEventManager();
$params = $this->r... | [
"public",
"function",
"indexAction",
"(",
")",
"{",
"$",
"optionsProvider",
"=",
"$",
"this",
"->",
"getOptionsProvider",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"isPost",
"(",
")",
")",
"{",
"$",
"event",
"=",
"$",... | Show content list.
@return \Zend\Stdlib\ResponseInterface|\Zend\View\Model\ViewModel | [
"Show",
"content",
"list",
"."
] | 9dd5732490c45fd788b96cedf7b3c7adfacb30d2 | https://github.com/dphn/ScContent/blob/9dd5732490c45fd788b96cedf7b3c7adfacb30d2/src/ScContent/Controller/Back/ContentManagerController.php#L45-L72 |
14,299 | dphn/ScContent | src/ScContent/Controller/Back/ContentManagerController.php | ContentManagerController.searchAction | public function searchAction()
{
$optionsProvider = $this->getOptionsProvider();
$pane = $this->params()->fromRoute('pane');
if (! $pane || ! $optionsProvider->hasIdentifier($pane)) {
$pane = 'first';
}
$options = $optionsProvider->getOptions($pane, 'search');
... | php | public function searchAction()
{
$optionsProvider = $this->getOptionsProvider();
$pane = $this->params()->fromRoute('pane');
if (! $pane || ! $optionsProvider->hasIdentifier($pane)) {
$pane = 'first';
}
$options = $optionsProvider->getOptions($pane, 'search');
... | [
"public",
"function",
"searchAction",
"(",
")",
"{",
"$",
"optionsProvider",
"=",
"$",
"this",
"->",
"getOptionsProvider",
"(",
")",
";",
"$",
"pane",
"=",
"$",
"this",
"->",
"params",
"(",
")",
"->",
"fromRoute",
"(",
"'pane'",
")",
";",
"if",
"(",
... | Show search options.
@return \Zend\View\Model\ViewModel | [
"Show",
"search",
"options",
"."
] | 9dd5732490c45fd788b96cedf7b3c7adfacb30d2 | https://github.com/dphn/ScContent/blob/9dd5732490c45fd788b96cedf7b3c7adfacb30d2/src/ScContent/Controller/Back/ContentManagerController.php#L79-L121 |
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.