repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
koolphp/koolreport | src/core/ResourceManager.php | ResourceManager.addStyle | public function addStyle($style,$options=array())
{
$options["type"] = Utility::get($options, "type", "text/css");
$this->tags[md5($style)] = array(
"at"=>'begin',
"tag"=>"style",
"options"=>$options,
"content"=>$style,
);
return $this... | php | public function addStyle($style,$options=array())
{
$options["type"] = Utility::get($options, "type", "text/css");
$this->tags[md5($style)] = array(
"at"=>'begin',
"tag"=>"style",
"options"=>$options,
"content"=>$style,
);
return $this... | [
"public",
"function",
"addStyle",
"(",
"$",
"style",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"options",
"[",
"\"type\"",
"]",
"=",
"Utility",
"::",
"get",
"(",
"$",
"options",
",",
"\"type\"",
",",
"\"text/css\"",
")",
";",
"$",
... | Adding a css style to report
@param string $style The css style you want to add
@param array $options Additional options for style tag
@return ResourceManager This resource manager object | [
"Adding",
"a",
"css",
"style",
"to",
"report"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/core/ResourceManager.php#L283-L294 |
koolphp/koolreport | src/core/ResourceManager.php | ResourceManager.addCssFile | public function addCssFile($href,$options=array())
{
$options["type"] = Utility::get($options, "type", "text/css");
$options["rel"] = Utility::get($options, "rel", "stylesheet");
$options["href"] = $href;
$this->tags[md5($href)] = array(
"at"=>'begin',
"tag"=... | php | public function addCssFile($href,$options=array())
{
$options["type"] = Utility::get($options, "type", "text/css");
$options["rel"] = Utility::get($options, "rel", "stylesheet");
$options["href"] = $href;
$this->tags[md5($href)] = array(
"at"=>'begin',
"tag"=... | [
"public",
"function",
"addCssFile",
"(",
"$",
"href",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"options",
"[",
"\"type\"",
"]",
"=",
"Utility",
"::",
"get",
"(",
"$",
"options",
",",
"\"type\"",
",",
"\"text/css\"",
")",
";",
"$",
... | Adding a css file to the report
@param string $href The url link to css file
@param array $options Additional settings you want to add to link tag
@return ResourceManager This resource manager object | [
"Adding",
"a",
"css",
"file",
"to",
"the",
"report"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/core/ResourceManager.php#L304-L317 |
koolphp/koolreport | src/core/ResourceManager.php | ResourceManager.addLinkTag | public function addLinkTag($options)
{
$unique = "u";
foreach ($options as $key=>$value) {
$unique.="[$key=$value]";
}
$this->tags[md5($unique)] = array(
"at"=>'begin',
"tag"=>"link",
"options"=>$options,
"content"=>"",
... | php | public function addLinkTag($options)
{
$unique = "u";
foreach ($options as $key=>$value) {
$unique.="[$key=$value]";
}
$this->tags[md5($unique)] = array(
"at"=>'begin',
"tag"=>"link",
"options"=>$options,
"content"=>"",
... | [
"public",
"function",
"addLinkTag",
"(",
"$",
"options",
")",
"{",
"$",
"unique",
"=",
"\"u\"",
";",
"foreach",
"(",
"$",
"options",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"unique",
".=",
"\"[$key=$value]\"",
";",
"}",
"$",
"this",
"->"... | Add a link tag to the page
Beside css, there could be another type of resources
you want to add via link tag
@param array $options The options you want to add to link tag
@return ResourceManager This resource manager object | [
"Add",
"a",
"link",
"tag",
"to",
"the",
"page"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/core/ResourceManager.php#L329-L342 |
koolphp/koolreport | src/core/ResourceManager.php | ResourceManager.renderTag | public function renderTag($tag)
{
$str = "<".$tag["tag"];
foreach ($tag["options"] as $key=>$value) {
$str.=" $key='$value'";
}
$str.=">".$tag["content"]."</".$tag["tag"].">";
return $str;
} | php | public function renderTag($tag)
{
$str = "<".$tag["tag"];
foreach ($tag["options"] as $key=>$value) {
$str.=" $key='$value'";
}
$str.=">".$tag["content"]."</".$tag["tag"].">";
return $str;
} | [
"public",
"function",
"renderTag",
"(",
"$",
"tag",
")",
"{",
"$",
"str",
"=",
"\"<\"",
".",
"$",
"tag",
"[",
"\"tag\"",
"]",
";",
"foreach",
"(",
"$",
"tag",
"[",
"\"options\"",
"]",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"str",
... | Render a tag
@param array $tag Tag settings
@return string The hmtl string representing the tag | [
"Render",
"a",
"tag"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/core/ResourceManager.php#L351-L359 |
koolphp/koolreport | src/core/ResourceManager.php | ResourceManager.process | public function process(&$content)
{
//Add resources to the content
$begin = "";
$end = "";
foreach ($this->tags as $tag) {
if ($tag["at"]=="begin") {
$begin.=$this->renderTag($tag);
} else {
$end.=$this->renderTag($tag);
... | php | public function process(&$content)
{
//Add resources to the content
$begin = "";
$end = "";
foreach ($this->tags as $tag) {
if ($tag["at"]=="begin") {
$begin.=$this->renderTag($tag);
} else {
$end.=$this->renderTag($tag);
... | [
"public",
"function",
"process",
"(",
"&",
"$",
"content",
")",
"{",
"//Add resources to the content",
"$",
"begin",
"=",
"\"\"",
";",
"$",
"end",
"=",
"\"\"",
";",
"foreach",
"(",
"$",
"this",
"->",
"tags",
"as",
"$",
"tag",
")",
"{",
"if",
"(",
"$"... | Take content of report and adds resource to content
@param string $content Content of report
@return null | [
"Take",
"content",
"of",
"report",
"and",
"adds",
"resource",
"to",
"content"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/core/ResourceManager.php#L368-L413 |
koolphp/koolreport | src/processes/StringTrim.php | StringTrim.onInit | protected function onInit()
{
if (isset($this->params["character_mask"])) {
$this->character_mask = $this->params["character_mask"];
unset($this->params["character_mask"]);
}
} | php | protected function onInit()
{
if (isset($this->params["character_mask"])) {
$this->character_mask = $this->params["character_mask"];
unset($this->params["character_mask"]);
}
} | [
"protected",
"function",
"onInit",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"params",
"[",
"\"character_mask\"",
"]",
")",
")",
"{",
"$",
"this",
"->",
"character_mask",
"=",
"$",
"this",
"->",
"params",
"[",
"\"character_mask\"",
"]",
... | Handle on initiation
@return null | [
"Handle",
"on",
"initiation"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/processes/StringTrim.php#L50-L56 |
koolphp/koolreport | src/processes/StringTrim.php | StringTrim.onInput | protected function onInput($data)
{
//Process data here
foreach ($this->params as $column) {
if ($this->character_mask) {
$data[$column] = trim($data[$column], $this->character_mask);
} else {
$data[$column] = trim($data[$column]);
... | php | protected function onInput($data)
{
//Process data here
foreach ($this->params as $column) {
if ($this->character_mask) {
$data[$column] = trim($data[$column], $this->character_mask);
} else {
$data[$column] = trim($data[$column]);
... | [
"protected",
"function",
"onInput",
"(",
"$",
"data",
")",
"{",
"//Process data here",
"foreach",
"(",
"$",
"this",
"->",
"params",
"as",
"$",
"column",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"character_mask",
")",
"{",
"$",
"data",
"[",
"$",
"column"... | Handle on data input
@param array $data The input data row
@return null | [
"Handle",
"on",
"data",
"input"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/processes/StringTrim.php#L65-L76 |
koolphp/koolreport | src/core/Node.php | Node.pipe | public function pipe($node)
{
array_push($this->destinations, $node);
$node->source($this);
return $node;
} | php | public function pipe($node)
{
array_push($this->destinations, $node);
$node->source($this);
return $node;
} | [
"public",
"function",
"pipe",
"(",
"$",
"node",
")",
"{",
"array_push",
"(",
"$",
"this",
"->",
"destinations",
",",
"$",
"node",
")",
";",
"$",
"node",
"->",
"source",
"(",
"$",
"this",
")",
";",
"return",
"$",
"node",
";",
"}"
] | Add a new node that this node will send data to
@param Node $node The node that data will be sent to
@return Node The new node | [
"Add",
"a",
"new",
"node",
"that",
"this",
"node",
"will",
"send",
"data",
"to"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/core/Node.php#L84-L89 |
koolphp/koolreport | src/core/Node.php | Node.previous | public function previous($index=0)
{
if (count($this->sources)>0) {
return Utility::get($this->sources, $index);
}
return null;
} | php | public function previous($index=0)
{
if (count($this->sources)>0) {
return Utility::get($this->sources, $index);
}
return null;
} | [
"public",
"function",
"previous",
"(",
"$",
"index",
"=",
"0",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"sources",
")",
">",
"0",
")",
"{",
"return",
"Utility",
"::",
"get",
"(",
"$",
"this",
"->",
"sources",
",",
"$",
"index",
")",
... | Get the previous source that send data to this node
This method is very helpful if we want to go trace back to the root
source that is sending data. Since a node can receive data from
multiple sources, the $index params help to return the node you need.
By default $index is 0 meaning the first node that streams data t... | [
"Get",
"the",
"previous",
"source",
"that",
"send",
"data",
"to",
"this",
"node"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/core/Node.php#L104-L110 |
koolphp/koolreport | src/core/Node.php | Node.next | public function next($data)
{
if ($this->destinations!=null) {
foreach ($this->destinations as $node) {
$node->input($data, $this);
}
}
} | php | public function next($data)
{
if ($this->destinations!=null) {
foreach ($this->destinations as $node) {
$node->input($data, $this);
}
}
} | [
"public",
"function",
"next",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"destinations",
"!=",
"null",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"destinations",
"as",
"$",
"node",
")",
"{",
"$",
"node",
"->",
"input",
"(",
"$",
... | Send data row to the next destinations
@param array $data An associate array epresenting a row of data
@return null | [
"Send",
"data",
"row",
"to",
"the",
"next",
"destinations"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/core/Node.php#L155-L162 |
koolphp/koolreport | src/core/Node.php | Node.startInput | public function startInput($source)
{
$this->streamingSource = $source;
$this->is_ended = false;
$this->onInputStart();
foreach ($this->destinations as $node) {
$node->startInput($this);
}
} | php | public function startInput($source)
{
$this->streamingSource = $source;
$this->is_ended = false;
$this->onInputStart();
foreach ($this->destinations as $node) {
$node->startInput($this);
}
} | [
"public",
"function",
"startInput",
"(",
"$",
"source",
")",
"{",
"$",
"this",
"->",
"streamingSource",
"=",
"$",
"source",
";",
"$",
"this",
"->",
"is_ended",
"=",
"false",
";",
"$",
"this",
"->",
"onInputStart",
"(",
")",
";",
"foreach",
"(",
"$",
... | Receive signal from source node that this node will be about to receive data
@param Node $source The source that is about to send data
@return null | [
"Receive",
"signal",
"from",
"source",
"node",
"that",
"this",
"node",
"will",
"be",
"about",
"to",
"receive",
"data"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/core/Node.php#L171-L179 |
koolphp/koolreport | src/core/Node.php | Node.endInput | public function endInput($source)
{
$this->streamingSource = $source;
$sourceAllEnded = true;
foreach ($this->sources as $src) {
$sourceAllEnded &= $src->isEnded();
}
if ($sourceAllEnded) {
$this->is_ended = true;
$this->onInputEnd();
... | php | public function endInput($source)
{
$this->streamingSource = $source;
$sourceAllEnded = true;
foreach ($this->sources as $src) {
$sourceAllEnded &= $src->isEnded();
}
if ($sourceAllEnded) {
$this->is_ended = true;
$this->onInputEnd();
... | [
"public",
"function",
"endInput",
"(",
"$",
"source",
")",
"{",
"$",
"this",
"->",
"streamingSource",
"=",
"$",
"source",
";",
"$",
"sourceAllEnded",
"=",
"true",
";",
"foreach",
"(",
"$",
"this",
"->",
"sources",
"as",
"$",
"src",
")",
"{",
"$",
"so... | The source will call this method to tell that it finishes sending data
@param Node $source The source that sends data to
@return null | [
"The",
"source",
"will",
"call",
"this",
"method",
"to",
"tell",
"that",
"it",
"finishes",
"sending",
"data"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/core/Node.php#L224-L238 |
koolphp/koolreport | src/core/Node.php | Node.sendMeta | protected function sendMeta($metaData)
{
foreach ($this->destinations as $node) {
$node->receiveMeta($metaData, $this);
}
} | php | protected function sendMeta($metaData)
{
foreach ($this->destinations as $node) {
$node->receiveMeta($metaData, $this);
}
} | [
"protected",
"function",
"sendMeta",
"(",
"$",
"metaData",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"destinations",
"as",
"$",
"node",
")",
"{",
"$",
"node",
"->",
"receiveMeta",
"(",
"$",
"metaData",
",",
"$",
"this",
")",
";",
"}",
"}"
] | Sending meta data to next nodes
@param array $metaData the meta data that will be sent to next nodes
@return null | [
"Sending",
"meta",
"data",
"to",
"next",
"nodes"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/core/Node.php#L279-L284 |
koolphp/koolreport | src/core/Node.php | Node.receiveMeta | public function receiveMeta($metaData,$source)
{
$this->streamingSource = $source;
$this->metaData = $metaData;
$metaData = $this->onMetaReceived($metaData);
$this->sendMeta($metaData);
} | php | public function receiveMeta($metaData,$source)
{
$this->streamingSource = $source;
$this->metaData = $metaData;
$metaData = $this->onMetaReceived($metaData);
$this->sendMeta($metaData);
} | [
"public",
"function",
"receiveMeta",
"(",
"$",
"metaData",
",",
"$",
"source",
")",
"{",
"$",
"this",
"->",
"streamingSource",
"=",
"$",
"source",
";",
"$",
"this",
"->",
"metaData",
"=",
"$",
"metaData",
";",
"$",
"metaData",
"=",
"$",
"this",
"->",
... | Recieving meta data from the source
@param array $metaData The meta data receiving from sources
@param array $source The source that sends meta data
@return null | [
"Recieving",
"meta",
"data",
"from",
"the",
"source"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/core/Node.php#L294-L300 |
koolphp/koolreport | src/core/Node.php | Node.requestDataSending | public function requestDataSending()
{
if (!$this->isEnded()) {
foreach ($this->sources as $source) {
$source->requestDataSending();
}
}
return $this;
} | php | public function requestDataSending()
{
if (!$this->isEnded()) {
foreach ($this->sources as $source) {
$source->requestDataSending();
}
}
return $this;
} | [
"public",
"function",
"requestDataSending",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isEnded",
"(",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"sources",
"as",
"$",
"source",
")",
"{",
"$",
"source",
"->",
"requestDataSending",
"(",
... | Request source nodes to send data.
@return Node This node object | [
"Request",
"source",
"nodes",
"to",
"send",
"data",
"."
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/core/Node.php#L319-L327 |
koolphp/koolreport | src/processes/AppendRow.php | AppendRow.onInputEnd | protected function onInputEnd()
{
$data = array();
if (Utility::isAssoc($this->params)) {
$data = array($this->params);
} else {
$data = $this->params;
}
foreach ($data as $row) {
$this->next($row);
}
} | php | protected function onInputEnd()
{
$data = array();
if (Utility::isAssoc($this->params)) {
$data = array($this->params);
} else {
$data = $this->params;
}
foreach ($data as $row) {
$this->next($row);
}
} | [
"protected",
"function",
"onInputEnd",
"(",
")",
"{",
"$",
"data",
"=",
"array",
"(",
")",
";",
"if",
"(",
"Utility",
"::",
"isAssoc",
"(",
"$",
"this",
"->",
"params",
")",
")",
"{",
"$",
"data",
"=",
"array",
"(",
"$",
"this",
"->",
"params",
"... | Handle on input end
@return null | [
"Handle",
"on",
"input",
"end"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/processes/AppendRow.php#L46-L57 |
koolphp/koolreport | src/processes/ColumnRename.php | ColumnRename.onMetaReceived | protected function onMetaReceived($metaData)
{
$keys = array_keys($metaData["columns"]);
$values = array_values($metaData["columns"]);
for ($i = 0; $i < count($keys); $i++) {
if (isset($this->params[$keys[$i]])) {
$keys[$i] = $this->params[$keys[$i]];
... | php | protected function onMetaReceived($metaData)
{
$keys = array_keys($metaData["columns"]);
$values = array_values($metaData["columns"]);
for ($i = 0; $i < count($keys); $i++) {
if (isset($this->params[$keys[$i]])) {
$keys[$i] = $this->params[$keys[$i]];
... | [
"protected",
"function",
"onMetaReceived",
"(",
"$",
"metaData",
")",
"{",
"$",
"keys",
"=",
"array_keys",
"(",
"$",
"metaData",
"[",
"\"columns\"",
"]",
")",
";",
"$",
"values",
"=",
"array_values",
"(",
"$",
"metaData",
"[",
"\"columns\"",
"]",
")",
";... | Handle on meta received
@param array $metaData The meta data
@return array New meta data | [
"Handle",
"on",
"meta",
"received"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/processes/ColumnRename.php#L44-L56 |
koolphp/koolreport | src/processes/ColumnRename.php | ColumnRename.onInput | public function onInput($row)
{
$keys = array_keys($row);
$values = array_values($row);
for ($i = 0; $i < count($keys); $i++) {
if (isset($this->params[$keys[$i]])) {
$keys[$i] = $this->params[$keys[$i]];
}
}
$this->next(array_combine($... | php | public function onInput($row)
{
$keys = array_keys($row);
$values = array_values($row);
for ($i = 0; $i < count($keys); $i++) {
if (isset($this->params[$keys[$i]])) {
$keys[$i] = $this->params[$keys[$i]];
}
}
$this->next(array_combine($... | [
"public",
"function",
"onInput",
"(",
"$",
"row",
")",
"{",
"$",
"keys",
"=",
"array_keys",
"(",
"$",
"row",
")",
";",
"$",
"values",
"=",
"array_values",
"(",
"$",
"row",
")",
";",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"count",
... | Handle on data input
@param array $row The input data row
@return null | [
"Handle",
"on",
"data",
"input"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/processes/ColumnRename.php#L65-L75 |
koolphp/koolreport | src/processes/AggregatedColumn.php | AggregatedColumn.onInputEnd | protected function onInputEnd()
{
$countRows = count($this->data);
$storage = array();
foreach ($this->params as $cKey=>$cValue) {
$storage[$cKey] = array(
"count"=>$countRows,
"sum"=>0,
"min"=>INF,
"max"=>-INF,
... | php | protected function onInputEnd()
{
$countRows = count($this->data);
$storage = array();
foreach ($this->params as $cKey=>$cValue) {
$storage[$cKey] = array(
"count"=>$countRows,
"sum"=>0,
"min"=>INF,
"max"=>-INF,
... | [
"protected",
"function",
"onInputEnd",
"(",
")",
"{",
"$",
"countRows",
"=",
"count",
"(",
"$",
"this",
"->",
"data",
")",
";",
"$",
"storage",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"params",
"as",
"$",
"cKey",
"=>",
"$",
... | Handle on input end
@return null | [
"Handle",
"on",
"input",
"end"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/processes/AggregatedColumn.php#L89-L159 |
koolphp/koolreport | src/KoolReport.php | KoolReport.js | public static function js()
{
$jsPath = dirname(__FILE__) . "/clients/core/KoolReport.js";
if (is_file($jsPath)) {
return "<script type='text/javascript'>"
.preg_replace('/\s+/S', " ", file_get_contents($jsPath))
."</script>";
} else {
... | php | public static function js()
{
$jsPath = dirname(__FILE__) . "/clients/core/KoolReport.js";
if (is_file($jsPath)) {
return "<script type='text/javascript'>"
.preg_replace('/\s+/S', " ", file_get_contents($jsPath))
."</script>";
} else {
... | [
"public",
"static",
"function",
"js",
"(",
")",
"{",
"$",
"jsPath",
"=",
"dirname",
"(",
"__FILE__",
")",
".",
"\"/clients/core/KoolReport.js\"",
";",
"if",
"(",
"is_file",
"(",
"$",
"jsPath",
")",
")",
"{",
"return",
"\"<script type='text/javascript'>\"",
"."... | Return the javascript of KoolReport
@return string Javascript of KoolReport | [
"Return",
"the",
"javascript",
"of",
"KoolReport"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/KoolReport.php#L54-L64 |
koolphp/koolreport | src/KoolReport.php | KoolReport.registerEvent | public function registerEvent($name, $methodName, $prepend = false)
{
if (!isset($this->events[$name])) {
$this->events[$name] = array();
}
if (!in_array($methodName, $this->events[$name])) {
if ($prepend) {
array_unshift($this->events[$name], $methodN... | php | public function registerEvent($name, $methodName, $prepend = false)
{
if (!isset($this->events[$name])) {
$this->events[$name] = array();
}
if (!in_array($methodName, $this->events[$name])) {
if ($prepend) {
array_unshift($this->events[$name], $methodN... | [
"public",
"function",
"registerEvent",
"(",
"$",
"name",
",",
"$",
"methodName",
",",
"$",
"prepend",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"events",
"[",
"$",
"name",
"]",
")",
")",
"{",
"$",
"this",
"->",
"eve... | Register callback function to be called on certain events
@param string $name Name of event
@param function $methodName A anonymous function to be called
@param bool $prepend Whether the event should be prepended.
@return KoolReport the report object | [
"Register",
"callback",
"function",
"to",
"be",
"called",
"on",
"certain",
"events"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/KoolReport.php#L114-L127 |
koolphp/koolreport | src/KoolReport.php | KoolReport.fireEvent | public function fireEvent($name, $params = null)
{
$handleList = Utility::get($this->events, $name, null);
$result = true;
if ($handleList) {
foreach ($handleList as $methodName) {
if (gettype($methodName) == "string") {
$return = $this->$metho... | php | public function fireEvent($name, $params = null)
{
$handleList = Utility::get($this->events, $name, null);
$result = true;
if ($handleList) {
foreach ($handleList as $methodName) {
if (gettype($methodName) == "string") {
$return = $this->$metho... | [
"public",
"function",
"fireEvent",
"(",
"$",
"name",
",",
"$",
"params",
"=",
"null",
")",
"{",
"$",
"handleList",
"=",
"Utility",
"::",
"get",
"(",
"$",
"this",
"->",
"events",
",",
"$",
"name",
",",
"null",
")",
";",
"$",
"result",
"=",
"true",
... | Fire an event with parameters in array form
@param string $name Name of event
@param array $params Parameters going with the event
@return bool Approve or disapprove action | [
"Fire",
"an",
"event",
"with",
"parameters",
"in",
"array",
"form"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/KoolReport.php#L137-L157 |
koolphp/koolreport | src/KoolReport.php | KoolReport.getServiceConstructs | protected function getServiceConstructs()
{
$serviceConstructs = array();
$public_methods = get_class_methods($this);
foreach ($public_methods as $method) {
if (strpos($method, "__construct") === 0 && strlen($method) > 11) {
array_push($serviceConstructs, $method)... | php | protected function getServiceConstructs()
{
$serviceConstructs = array();
$public_methods = get_class_methods($this);
foreach ($public_methods as $method) {
if (strpos($method, "__construct") === 0 && strlen($method) > 11) {
array_push($serviceConstructs, $method)... | [
"protected",
"function",
"getServiceConstructs",
"(",
")",
"{",
"$",
"serviceConstructs",
"=",
"array",
"(",
")",
";",
"$",
"public_methods",
"=",
"get_class_methods",
"(",
"$",
"this",
")",
";",
"foreach",
"(",
"$",
"public_methods",
"as",
"$",
"method",
")... | Return list of contruction methods of services
@return array List of construction methods | [
"Return",
"list",
"of",
"contruction",
"methods",
"of",
"services"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/KoolReport.php#L164-L174 |
koolphp/koolreport | src/KoolReport.php | KoolReport.src | protected function src($name = null)
{
$dataSources = Utility::get($this->reportSettings, "dataSources", array());
if (count($dataSources) == 0) {
throw new \Exception("There is no source available, please add at least one in the settings()");
return false;
}
... | php | protected function src($name = null)
{
$dataSources = Utility::get($this->reportSettings, "dataSources", array());
if (count($dataSources) == 0) {
throw new \Exception("There is no source available, please add at least one in the settings()");
return false;
}
... | [
"protected",
"function",
"src",
"(",
"$",
"name",
"=",
"null",
")",
"{",
"$",
"dataSources",
"=",
"Utility",
"::",
"get",
"(",
"$",
"this",
"->",
"reportSettings",
",",
"\"dataSources\"",
",",
"array",
"(",
")",
")",
";",
"if",
"(",
"count",
"(",
"$"... | Get a new source
@param string $name Name of the source, if no name specified
then get the first one
@return DataSource The data source object | [
"Get",
"a",
"new",
"source"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/KoolReport.php#L238-L266 |
koolphp/koolreport | src/KoolReport.php | KoolReport.dataStore | public function dataStore($name)
{
if (gettype($name) == "string") {
if (!isset($this->dataStores[$name])) {
$this->dataStores[$name] = new DataStore;
}
return $this->dataStores[$name];
} else {
//$name's type is different from string
... | php | public function dataStore($name)
{
if (gettype($name) == "string") {
if (!isset($this->dataStores[$name])) {
$this->dataStores[$name] = new DataStore;
}
return $this->dataStores[$name];
} else {
//$name's type is different from string
... | [
"public",
"function",
"dataStore",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"gettype",
"(",
"$",
"name",
")",
"==",
"\"string\"",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"dataStores",
"[",
"$",
"name",
"]",
")",
")",
"{",
"$",
... | Get the data store with a name, if not found, create a new one
@param string $name The name of data store
@return DataStore The datastore object | [
"Get",
"the",
"data",
"store",
"with",
"a",
"name",
"if",
"not",
"found",
"create",
"a",
"new",
"one"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/KoolReport.php#L275-L287 |
koolphp/koolreport | src/KoolReport.php | KoolReport.run | public function run()
{
if ($this->fireEvent("OnBeforeRun")) {
if ($this->dataSources != null) {
foreach ($this->dataSources as $dataSource) {
if (!$dataSource->isEnded()) {
$dataSource->start();
}
}
... | php | public function run()
{
if ($this->fireEvent("OnBeforeRun")) {
if ($this->dataSources != null) {
foreach ($this->dataSources as $dataSource) {
if (!$dataSource->isEnded()) {
$dataSource->start();
}
}
... | [
"public",
"function",
"run",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"fireEvent",
"(",
"\"OnBeforeRun\"",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"dataSources",
"!=",
"null",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"dataSources",
"as",... | Run the report
@return KoolReport Return this report object | [
"Run",
"the",
"report"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/KoolReport.php#L294-L307 |
koolphp/koolreport | src/KoolReport.php | KoolReport.debug | public function debug()
{
$oldActiveReport = (isset($GLOBALS["__ACTIVE_KOOLREPORT__"]))
? $GLOBALS["__ACTIVE_KOOLREPORT__"] : null;
$GLOBALS["__ACTIVE_KOOLREPORT__"] = $this;
include dirname(__FILE__) . "/debug.view.php";
if ($oldActiveReport === null) {
unse... | php | public function debug()
{
$oldActiveReport = (isset($GLOBALS["__ACTIVE_KOOLREPORT__"]))
? $GLOBALS["__ACTIVE_KOOLREPORT__"] : null;
$GLOBALS["__ACTIVE_KOOLREPORT__"] = $this;
include dirname(__FILE__) . "/debug.view.php";
if ($oldActiveReport === null) {
unse... | [
"public",
"function",
"debug",
"(",
")",
"{",
"$",
"oldActiveReport",
"=",
"(",
"isset",
"(",
"$",
"GLOBALS",
"[",
"\"__ACTIVE_KOOLREPORT__\"",
"]",
")",
")",
"?",
"$",
"GLOBALS",
"[",
"\"__ACTIVE_KOOLREPORT__\"",
"]",
":",
"null",
";",
"$",
"GLOBALS",
"["... | Return debug view
@return null | [
"Return",
"debug",
"view"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/KoolReport.php#L314-L325 |
koolphp/koolreport | src/KoolReport.php | KoolReport.innerView | public function innerView($view, $params = null, $return = false)
{
$currentDir = dirname(Utility::getClassPath($this));
ob_start();
if ($params) {
foreach ($params as $key => $value) {
$$key = $value;
}
}
include $currentDir . "/" . $v... | php | public function innerView($view, $params = null, $return = false)
{
$currentDir = dirname(Utility::getClassPath($this));
ob_start();
if ($params) {
foreach ($params as $key => $value) {
$$key = $value;
}
}
include $currentDir . "/" . $v... | [
"public",
"function",
"innerView",
"(",
"$",
"view",
",",
"$",
"params",
"=",
"null",
",",
"$",
"return",
"=",
"false",
")",
"{",
"$",
"currentDir",
"=",
"dirname",
"(",
"Utility",
"::",
"getClassPath",
"(",
"$",
"this",
")",
")",
";",
"ob_start",
"(... | Render inner view
@param string $view The view name
@param array $params Parameters for the view
@param bool $return Wher the string should be return of be rendered
@return string If the $return is set to true then string representing
the view will be return. | [
"Render",
"inner",
"view"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/KoolReport.php#L337-L353 |
koolphp/koolreport | src/KoolReport.php | KoolReport.render | public function render($view = null, $return = false)
{
if ($view === null) {
$view = Utility::getClassName($this);
} else {
if (gettype($view) == "boolean") {
$return = $view;
$view = Utility::getClassName($this);
}
}
... | php | public function render($view = null, $return = false)
{
if ($view === null) {
$view = Utility::getClassName($this);
} else {
if (gettype($view) == "boolean") {
$return = $view;
$view = Utility::getClassName($this);
}
}
... | [
"public",
"function",
"render",
"(",
"$",
"view",
"=",
"null",
",",
"$",
"return",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"view",
"===",
"null",
")",
"{",
"$",
"view",
"=",
"Utility",
"::",
"getClassName",
"(",
"$",
"this",
")",
";",
"}",
"else"... | Reder the view, if no view specified then try to look for the
view with name {report_class}.view.php
If not found, render debug view
@param string $view The view name
@param bool $return Whether return the view intead of rendering
@return bool If true the view will be returned
instead of being rendered | [
"Reder",
"the",
"view",
"if",
"no",
"view",
"specified",
"then",
"try",
"to",
"look",
"for",
"the",
"view",
"with",
"name",
"{",
"report_class",
"}",
".",
"view",
".",
"php",
"If",
"not",
"found",
"render",
"debug",
"view"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/KoolReport.php#L366-L426 |
koolphp/koolreport | src/processes/Limit.php | Limit.onInit | protected function onInit()
{
$this->limit = Utility::get($this->params, 0, 10);
$this->offset = Utility::get($this->params, 1, 0);
} | php | protected function onInit()
{
$this->limit = Utility::get($this->params, 0, 10);
$this->offset = Utility::get($this->params, 1, 0);
} | [
"protected",
"function",
"onInit",
"(",
")",
"{",
"$",
"this",
"->",
"limit",
"=",
"Utility",
"::",
"get",
"(",
"$",
"this",
"->",
"params",
",",
"0",
",",
"10",
")",
";",
"$",
"this",
"->",
"offset",
"=",
"Utility",
"::",
"get",
"(",
"$",
"this"... | Handle on initiation
@return null | [
"Handle",
"on",
"initiation"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/processes/Limit.php#L45-L49 |
koolphp/koolreport | src/processes/Limit.php | Limit.onInput | protected function onInput($data)
{
$this->index++;
if ($this->index >= $this->offset && $this->index < $this->offset + $this->limit) {
$this->next($data);
}
} | php | protected function onInput($data)
{
$this->index++;
if ($this->index >= $this->offset && $this->index < $this->offset + $this->limit) {
$this->next($data);
}
} | [
"protected",
"function",
"onInput",
"(",
"$",
"data",
")",
"{",
"$",
"this",
"->",
"index",
"++",
";",
"if",
"(",
"$",
"this",
"->",
"index",
">=",
"$",
"this",
"->",
"offset",
"&&",
"$",
"this",
"->",
"index",
"<",
"$",
"this",
"->",
"offset",
"... | Handle on data input
@param array $data The input data row
@return null | [
"Handle",
"on",
"data",
"input"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/processes/Limit.php#L68-L74 |
koolphp/koolreport | src/datasources/CSVDataSource.php | CSVDataSource.onInit | protected function onInit()
{
$this->filePath = Utility::get($this->params, "filePath");
$this->fieldSeparator = Utility::get($this->params, "fieldSeparator", ",");
$this->charset = Utility::get($this->params, "charset");
$this->precision = Utility::get($this->params, "precision", 10... | php | protected function onInit()
{
$this->filePath = Utility::get($this->params, "filePath");
$this->fieldSeparator = Utility::get($this->params, "fieldSeparator", ",");
$this->charset = Utility::get($this->params, "charset");
$this->precision = Utility::get($this->params, "precision", 10... | [
"protected",
"function",
"onInit",
"(",
")",
"{",
"$",
"this",
"->",
"filePath",
"=",
"Utility",
"::",
"get",
"(",
"$",
"this",
"->",
"params",
",",
"\"filePath\"",
")",
";",
"$",
"this",
"->",
"fieldSeparator",
"=",
"Utility",
"::",
"get",
"(",
"$",
... | Init the datasource
@return null | [
"Init",
"the",
"datasource"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/datasources/CSVDataSource.php#L79-L86 |
koolphp/koolreport | src/datasources/CSVDataSource.php | CSVDataSource.start | public function start()
{
// $offset = 0;
// //Go to where we were when we ended the last batch
// fseek($fileHandle, $offset);
// fgetcsv($fileHandle)
// $offset = ftell($fileHandle);
$data = array();
if (($handle = fopen($this->filePath, "r")) !... | php | public function start()
{
// $offset = 0;
// //Go to where we were when we ended the last batch
// fseek($fileHandle, $offset);
// fgetcsv($fileHandle)
// $offset = ftell($fileHandle);
$data = array();
if (($handle = fopen($this->filePath, "r")) !... | [
"public",
"function",
"start",
"(",
")",
"{",
"// $offset = 0;",
"// //Go to where we were when we ended the last batch",
"// fseek($fileHandle, $offset);",
"// fgetcsv($fileHandle)",
"// $offset = ftell($fileHandle);",
"$",
"data",
"=",
"array",
"(",
")",
";",
"if",
"(",
"("... | Start piping data
@return null | [
"Start",
"piping",
"data"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/datasources/CSVDataSource.php#L121-L180 |
koolphp/koolreport | src/clients/jQuery.php | jQuery.__constructjQuery | public function __constructjQuery()
{
$this->registerEvent(
'OnResourceInit',
function () {
$publicAssetUrl = $this->getResourceManager()
->publishAssetFolder(realpath(dirname(__FILE__))."/jquery");
$this->getResourceManager()
... | php | public function __constructjQuery()
{
$this->registerEvent(
'OnResourceInit',
function () {
$publicAssetUrl = $this->getResourceManager()
->publishAssetFolder(realpath(dirname(__FILE__))."/jquery");
$this->getResourceManager()
... | [
"public",
"function",
"__constructjQuery",
"(",
")",
"{",
"$",
"this",
"->",
"registerEvent",
"(",
"'OnResourceInit'",
",",
"function",
"(",
")",
"{",
"$",
"publicAssetUrl",
"=",
"$",
"this",
"->",
"getResourceManager",
"(",
")",
"->",
"publishAssetFolder",
"(... | Service construction | [
"Service",
"construction"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/clients/jQuery.php#L31-L42 |
koolphp/koolreport | src/datasources/MySQLDataSource.php | MySQLDataSource.onInit | protected function onInit()
{
$host = Util::get($this->params, "host", "");
$username = Util::get($this->params, "username", "");
$password = Util::get($this->params, "password", "");
$dbname = Util::get($this->params, "dbname", "");
$charset = Util::get($this->params, "chars... | php | protected function onInit()
{
$host = Util::get($this->params, "host", "");
$username = Util::get($this->params, "username", "");
$password = Util::get($this->params, "password", "");
$dbname = Util::get($this->params, "dbname", "");
$charset = Util::get($this->params, "chars... | [
"protected",
"function",
"onInit",
"(",
")",
"{",
"$",
"host",
"=",
"Util",
"::",
"get",
"(",
"$",
"this",
"->",
"params",
",",
"\"host\"",
",",
"\"\"",
")",
";",
"$",
"username",
"=",
"Util",
"::",
"get",
"(",
"$",
"this",
"->",
"params",
",",
"... | Init MySQLdataSource
@return null | [
"Init",
"MySQLdataSource"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/datasources/MySQLDataSource.php#L87-L119 |
koolphp/koolreport | src/datasources/MySQLDataSource.php | MySQLDataSource.mapFieldTypeToBindType | function mapFieldTypeToBindType($field_type)
{
switch ($field_type) {
case MYSQLI_TYPE_DECIMAL:
case MYSQLI_TYPE_NEWDECIMAL:
case MYSQLI_TYPE_FLOAT:
case MYSQLI_TYPE_DOUBLE:
case MYSQLI_TYPE_BIT:
case MYSQLI_TYPE_TINY:
case MYSQLI_TYPE_SHORT:
c... | php | function mapFieldTypeToBindType($field_type)
{
switch ($field_type) {
case MYSQLI_TYPE_DECIMAL:
case MYSQLI_TYPE_NEWDECIMAL:
case MYSQLI_TYPE_FLOAT:
case MYSQLI_TYPE_DOUBLE:
case MYSQLI_TYPE_BIT:
case MYSQLI_TYPE_TINY:
case MYSQLI_TYPE_SHORT:
c... | [
"function",
"mapFieldTypeToBindType",
"(",
"$",
"field_type",
")",
"{",
"switch",
"(",
"$",
"field_type",
")",
"{",
"case",
"MYSQLI_TYPE_DECIMAL",
":",
"case",
"MYSQLI_TYPE_NEWDECIMAL",
":",
"case",
"MYSQLI_TYPE_FLOAT",
":",
"case",
"MYSQLI_TYPE_DOUBLE",
":",
"case"... | Map field type to bind type
@param strng $field_type The type of field
@return string KoolReport type of field | [
"Map",
"field",
"type",
"to",
"bind",
"type"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/datasources/MySQLDataSource.php#L271-L311 |
koolphp/koolreport | src/datasources/MySQLDataSource.php | MySQLDataSource.start | public function start()
{
$metaData = array("columns"=>array());
if ($this->countTotal) {
$totalQuery = $this->bindParams($this->totalQuery, $this->sqlParams);
$totalResult = $this->connection->query($totalQuery);
if ($totalResult===false) {
throw... | php | public function start()
{
$metaData = array("columns"=>array());
if ($this->countTotal) {
$totalQuery = $this->bindParams($this->totalQuery, $this->sqlParams);
$totalResult = $this->connection->query($totalQuery);
if ($totalResult===false) {
throw... | [
"public",
"function",
"start",
"(",
")",
"{",
"$",
"metaData",
"=",
"array",
"(",
"\"columns\"",
"=>",
"array",
"(",
")",
")",
";",
"if",
"(",
"$",
"this",
"->",
"countTotal",
")",
"{",
"$",
"totalQuery",
"=",
"$",
"this",
"->",
"bindParams",
"(",
... | Start piping data
@return null | [
"Start",
"piping",
"data"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/datasources/MySQLDataSource.php#L318-L383 |
koolphp/koolreport | src/processes/TimeBucket.php | TimeBucket.onInit | protected function onInit()
{
foreach ($this->params as $cName => $cParams) {
if (gettype($cParams) == "array") {
$bucket = Utility::get($cParams, "bucket");
$formatString = Utility::get($cParams, "formatString");
$this->params[$cName] = array(
... | php | protected function onInit()
{
foreach ($this->params as $cName => $cParams) {
if (gettype($cParams) == "array") {
$bucket = Utility::get($cParams, "bucket");
$formatString = Utility::get($cParams, "formatString");
$this->params[$cName] = array(
... | [
"protected",
"function",
"onInit",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"params",
"as",
"$",
"cName",
"=>",
"$",
"cParams",
")",
"{",
"if",
"(",
"gettype",
"(",
"$",
"cParams",
")",
"==",
"\"array\"",
")",
"{",
"$",
"bucket",
"=",
"Uti... | Handle on initiation
@return null | [
"Handle",
"on",
"initiation"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/processes/TimeBucket.php#L59-L78 |
koolphp/koolreport | src/processes/TimeBucket.php | TimeBucket.onInput | protected function onInput($data)
{
//Process data here
foreach ($this->params as $cName => $cParams) {
if ($data[$cName]) {
//Only if the value of column is not empty
$format = Utility::get($this->metaData["columns"][$cName], "format");
$... | php | protected function onInput($data)
{
//Process data here
foreach ($this->params as $cName => $cParams) {
if ($data[$cName]) {
//Only if the value of column is not empty
$format = Utility::get($this->metaData["columns"][$cName], "format");
$... | [
"protected",
"function",
"onInput",
"(",
"$",
"data",
")",
"{",
"//Process data here",
"foreach",
"(",
"$",
"this",
"->",
"params",
"as",
"$",
"cName",
"=>",
"$",
"cParams",
")",
"{",
"if",
"(",
"$",
"data",
"[",
"$",
"cName",
"]",
")",
"{",
"//Only ... | Handle on data input
@param array $data The input data row
@return null | [
"Handle",
"on",
"data",
"input"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/processes/TimeBucket.php#L127-L149 |
koolphp/koolreport | src/datasources/ReportDataSource.php | ReportDataSource.onInit | protected function onInit()
{
$key = Utility::get($this->params, "key", "");
$reportSource = Utility::get($this->params, "report");
$reportParams = Utility::get($this->params, "params", array());
if ($reportSource==null) {
throw new \Exception("ReportDataSource require '... | php | protected function onInit()
{
$key = Utility::get($this->params, "key", "");
$reportSource = Utility::get($this->params, "report");
$reportParams = Utility::get($this->params, "params", array());
if ($reportSource==null) {
throw new \Exception("ReportDataSource require '... | [
"protected",
"function",
"onInit",
"(",
")",
"{",
"$",
"key",
"=",
"Utility",
"::",
"get",
"(",
"$",
"this",
"->",
"params",
",",
"\"key\"",
",",
"\"\"",
")",
";",
"$",
"reportSource",
"=",
"Utility",
"::",
"get",
"(",
"$",
"this",
"->",
"params",
... | Datasource initiation
@return null | [
"Datasource",
"initiation"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/datasources/ReportDataSource.php#L55-L84 |
koolphp/koolreport | src/datasources/ReportDataSource.php | ReportDataSource.start | public function start()
{
$this->sendMeta($this->report->dataStore($this->storeName)->meta());
$this->startInput(null);
$this->report->dataStore($this->storeName)->popStart();
while ($row = $this->report->dataStore($this->storeName)->pop()) {
$this->next($row, $this);
... | php | public function start()
{
$this->sendMeta($this->report->dataStore($this->storeName)->meta());
$this->startInput(null);
$this->report->dataStore($this->storeName)->popStart();
while ($row = $this->report->dataStore($this->storeName)->pop()) {
$this->next($row, $this);
... | [
"public",
"function",
"start",
"(",
")",
"{",
"$",
"this",
"->",
"sendMeta",
"(",
"$",
"this",
"->",
"report",
"->",
"dataStore",
"(",
"$",
"this",
"->",
"storeName",
")",
"->",
"meta",
"(",
")",
")",
";",
"$",
"this",
"->",
"startInput",
"(",
"nul... | Start piping data
@return null | [
"Start",
"piping",
"data"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/datasources/ReportDataSource.php#L104-L113 |
deployphp/phar-update | src/Exception/Exception.php | Exception.create | public static function create($format, $value = null)
{
if (0 < func_num_args()) {
$format = vsprintf($format, array_slice(func_get_args(), 1));
}
return new static($format);
} | php | public static function create($format, $value = null)
{
if (0 < func_num_args()) {
$format = vsprintf($format, array_slice(func_get_args(), 1));
}
return new static($format);
} | [
"public",
"static",
"function",
"create",
"(",
"$",
"format",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"0",
"<",
"func_num_args",
"(",
")",
")",
"{",
"$",
"format",
"=",
"vsprintf",
"(",
"$",
"format",
",",
"array_slice",
"(",
"func_get_a... | Creates a new exception using a format and values.
@param string $format The format.
@param mixed $value,... The value(s).
@return Exception The exception. | [
"Creates",
"a",
"new",
"exception",
"using",
"a",
"format",
"and",
"values",
"."
] | train | https://github.com/deployphp/phar-update/blob/a6c7c3a1b2eb6983ebeb59cd1dc1c2e9df115c4a/src/Exception/Exception.php#L20-L27 |
deployphp/phar-update | src/Version/Dumper.php | Dumper.toComponents | public static function toComponents(Version $version)
{
return array(
Parser::MAJOR => $version->getMajor(),
Parser::MINOR => $version->getMinor(),
Parser::PATCH => $version->getPatch(),
Parser::PRE_RELEASE => $version->getPreRelease(),
Parser::BUI... | php | public static function toComponents(Version $version)
{
return array(
Parser::MAJOR => $version->getMajor(),
Parser::MINOR => $version->getMinor(),
Parser::PATCH => $version->getPatch(),
Parser::PRE_RELEASE => $version->getPreRelease(),
Parser::BUI... | [
"public",
"static",
"function",
"toComponents",
"(",
"Version",
"$",
"version",
")",
"{",
"return",
"array",
"(",
"Parser",
"::",
"MAJOR",
"=>",
"$",
"version",
"->",
"getMajor",
"(",
")",
",",
"Parser",
"::",
"MINOR",
"=>",
"$",
"version",
"->",
"getMin... | Returns the components of a Version instance.
@param Version $version A version.
@return array The components. | [
"Returns",
"the",
"components",
"of",
"a",
"Version",
"instance",
"."
] | train | https://github.com/deployphp/phar-update/blob/a6c7c3a1b2eb6983ebeb59cd1dc1c2e9df115c4a/src/Version/Dumper.php#L19-L28 |
deployphp/phar-update | src/Version/Dumper.php | Dumper.toString | public static function toString(Version $version)
{
return sprintf(
'%d.%d.%d%s%s',
$version->getMajor(),
$version->getMinor(),
$version->getPatch(),
$version->getPreRelease()
? '-' . join('.', $version->getPreRelease())
... | php | public static function toString(Version $version)
{
return sprintf(
'%d.%d.%d%s%s',
$version->getMajor(),
$version->getMinor(),
$version->getPatch(),
$version->getPreRelease()
? '-' . join('.', $version->getPreRelease())
... | [
"public",
"static",
"function",
"toString",
"(",
"Version",
"$",
"version",
")",
"{",
"return",
"sprintf",
"(",
"'%d.%d.%d%s%s'",
",",
"$",
"version",
"->",
"getMajor",
"(",
")",
",",
"$",
"version",
"->",
"getMinor",
"(",
")",
",",
"$",
"version",
"->",... | Returns the string representation of a Version instance.
@param Version $version A version.
@return string The string representation. | [
"Returns",
"the",
"string",
"representation",
"of",
"a",
"Version",
"instance",
"."
] | train | https://github.com/deployphp/phar-update/blob/a6c7c3a1b2eb6983ebeb59cd1dc1c2e9df115c4a/src/Version/Dumper.php#L37-L51 |
deployphp/phar-update | src/Version/Comparator.php | Comparator.compareTo | public static function compareTo(Version $left, Version $right)
{
switch (true) {
case ($left->getMajor() < $right->getMajor()):
return self::LESS_THAN;
case ($left->getMajor() > $right->getMajor()):
return self::GREATER_THAN;
case ($left->... | php | public static function compareTo(Version $left, Version $right)
{
switch (true) {
case ($left->getMajor() < $right->getMajor()):
return self::LESS_THAN;
case ($left->getMajor() > $right->getMajor()):
return self::GREATER_THAN;
case ($left->... | [
"public",
"static",
"function",
"compareTo",
"(",
"Version",
"$",
"left",
",",
"Version",
"$",
"right",
")",
"{",
"switch",
"(",
"true",
")",
"{",
"case",
"(",
"$",
"left",
"->",
"getMajor",
"(",
")",
"<",
"$",
"right",
"->",
"getMajor",
"(",
")",
... | Compares one version with another.
@param Version $left The left version to compare.
@param Version $right The right version to compare.
@return integer Returns Comparator::EQUAL_TO if the two versions are
equal. If the left version is less than the right
version, Comparator::LESS_THAN is returned. If the left
versi... | [
"Compares",
"one",
"version",
"with",
"another",
"."
] | train | https://github.com/deployphp/phar-update/blob/a6c7c3a1b2eb6983ebeb59cd1dc1c2e9df115c4a/src/Version/Comparator.php#L39-L62 |
deployphp/phar-update | src/Version/Comparator.php | Comparator.isEqualTo | public static function isEqualTo(Version $left, Version $right)
{
return (self::EQUAL_TO === self::compareTo($left, $right));
} | php | public static function isEqualTo(Version $left, Version $right)
{
return (self::EQUAL_TO === self::compareTo($left, $right));
} | [
"public",
"static",
"function",
"isEqualTo",
"(",
"Version",
"$",
"left",
",",
"Version",
"$",
"right",
")",
"{",
"return",
"(",
"self",
"::",
"EQUAL_TO",
"===",
"self",
"::",
"compareTo",
"(",
"$",
"left",
",",
"$",
"right",
")",
")",
";",
"}"
] | Checks if the left version is equal to the right.
@param Version $left The left version to compare.
@param Version $right The right version to compare.
@return boolean TRUE if the left version is equal to the right, FALSE
if not. | [
"Checks",
"if",
"the",
"left",
"version",
"is",
"equal",
"to",
"the",
"right",
"."
] | train | https://github.com/deployphp/phar-update/blob/a6c7c3a1b2eb6983ebeb59cd1dc1c2e9df115c4a/src/Version/Comparator.php#L73-L76 |
deployphp/phar-update | src/Version/Comparator.php | Comparator.isGreaterThan | public static function isGreaterThan(Version $left, Version $right)
{
return (self::GREATER_THAN === self::compareTo($left, $right));
} | php | public static function isGreaterThan(Version $left, Version $right)
{
return (self::GREATER_THAN === self::compareTo($left, $right));
} | [
"public",
"static",
"function",
"isGreaterThan",
"(",
"Version",
"$",
"left",
",",
"Version",
"$",
"right",
")",
"{",
"return",
"(",
"self",
"::",
"GREATER_THAN",
"===",
"self",
"::",
"compareTo",
"(",
"$",
"left",
",",
"$",
"right",
")",
")",
";",
"}"... | Checks if the left version is greater than the right.
@param Version $left The left version to compare.
@param Version $right The right version to compare.
@return boolean TRUE if the left version is greater than the right,
FALSE if not. | [
"Checks",
"if",
"the",
"left",
"version",
"is",
"greater",
"than",
"the",
"right",
"."
] | train | https://github.com/deployphp/phar-update/blob/a6c7c3a1b2eb6983ebeb59cd1dc1c2e9df115c4a/src/Version/Comparator.php#L87-L90 |
deployphp/phar-update | src/Version/Comparator.php | Comparator.isLessThan | public static function isLessThan(Version $left, Version $right)
{
return (self::LESS_THAN === self::compareTo($left, $right));
} | php | public static function isLessThan(Version $left, Version $right)
{
return (self::LESS_THAN === self::compareTo($left, $right));
} | [
"public",
"static",
"function",
"isLessThan",
"(",
"Version",
"$",
"left",
",",
"Version",
"$",
"right",
")",
"{",
"return",
"(",
"self",
"::",
"LESS_THAN",
"===",
"self",
"::",
"compareTo",
"(",
"$",
"left",
",",
"$",
"right",
")",
")",
";",
"}"
] | Checks if the left version is less than the right.
@param Version $left The left version to compare.
@param Version $right The right version to compare.
@return boolean TRUE if the left version is less than the right,
FALSE if not. | [
"Checks",
"if",
"the",
"left",
"version",
"is",
"less",
"than",
"the",
"right",
"."
] | train | https://github.com/deployphp/phar-update/blob/a6c7c3a1b2eb6983ebeb59cd1dc1c2e9df115c4a/src/Version/Comparator.php#L101-L104 |
deployphp/phar-update | src/Version/Comparator.php | Comparator.compareIdentifiers | public static function compareIdentifiers(array $left, array $right)
{
if ($left && empty($right)) {
return self::LESS_THAN;
} elseif (empty($left) && $right) {
return self::GREATER_THAN;
}
$l = $left;
$r = $right;
$x = self::GREATER_THAN;
... | php | public static function compareIdentifiers(array $left, array $right)
{
if ($left && empty($right)) {
return self::LESS_THAN;
} elseif (empty($left) && $right) {
return self::GREATER_THAN;
}
$l = $left;
$r = $right;
$x = self::GREATER_THAN;
... | [
"public",
"static",
"function",
"compareIdentifiers",
"(",
"array",
"$",
"left",
",",
"array",
"$",
"right",
")",
"{",
"if",
"(",
"$",
"left",
"&&",
"empty",
"(",
"$",
"right",
")",
")",
"{",
"return",
"self",
"::",
"LESS_THAN",
";",
"}",
"elseif",
"... | Compares the identifier components of the left and right versions.
@param array $left The left identifiers.
@param array $right The right identifiers.
@return integer Returns Comparator::EQUAL_TO if the two identifiers are
equal. If the left identifiers is less than the right
identifiers, Comparator::LESS_THAN is re... | [
"Compares",
"the",
"identifier",
"components",
"of",
"the",
"left",
"and",
"right",
"versions",
"."
] | train | https://github.com/deployphp/phar-update/blob/a6c7c3a1b2eb6983ebeb59cd1dc1c2e9df115c4a/src/Version/Comparator.php#L118-L173 |
deployphp/phar-update | src/Manifest.php | Manifest.findRecent | public function findRecent(Version $version, $major = false, $pre = false)
{
/** @var $current Update */
$current = null;
$major = $major ? $version->getMajor() : null;
foreach ($this->updates as $update) {
if ($major && ($major !== $update->getVersion()->getMajor())) {
... | php | public function findRecent(Version $version, $major = false, $pre = false)
{
/** @var $current Update */
$current = null;
$major = $major ? $version->getMajor() : null;
foreach ($this->updates as $update) {
if ($major && ($major !== $update->getVersion()->getMajor())) {
... | [
"public",
"function",
"findRecent",
"(",
"Version",
"$",
"version",
",",
"$",
"major",
"=",
"false",
",",
"$",
"pre",
"=",
"false",
")",
"{",
"/** @var $current Update */",
"$",
"current",
"=",
"null",
";",
"$",
"major",
"=",
"$",
"major",
"?",
"$",
"v... | Finds the most recent update and returns it.
@param Version $version The current version.
@param boolean $major Lock to major version?
@param boolean $pre Allow pre-releases?
@return Update The update. | [
"Finds",
"the",
"most",
"recent",
"update",
"and",
"returns",
"it",
"."
] | train | https://github.com/deployphp/phar-update/blob/a6c7c3a1b2eb6983ebeb59cd1dc1c2e9df115c4a/src/Manifest.php#L42-L68 |
deployphp/phar-update | src/Console/Command.php | Command.configure | protected function configure()
{
$this->setDescription('Updates the application.');
$this->addOption(
'pre',
'p',
InputOption::VALUE_NONE,
'Allow pre-release updates.'
);
$this->addOption(
'redo',
'r',
... | php | protected function configure()
{
$this->setDescription('Updates the application.');
$this->addOption(
'pre',
'p',
InputOption::VALUE_NONE,
'Allow pre-release updates.'
);
$this->addOption(
'redo',
'r',
... | [
"protected",
"function",
"configure",
"(",
")",
"{",
"$",
"this",
"->",
"setDescription",
"(",
"'Updates the application.'",
")",
";",
"$",
"this",
"->",
"addOption",
"(",
"'pre'",
",",
"'p'",
",",
"InputOption",
"::",
"VALUE_NONE",
",",
"'Allow pre-release upda... | {@inheritdoc} | [
"{"
] | train | https://github.com/deployphp/phar-update/blob/a6c7c3a1b2eb6983ebeb59cd1dc1c2e9df115c4a/src/Console/Command.php#L55-L79 |
deployphp/phar-update | src/Console/Command.php | Command.execute | protected function execute(InputInterface $input, OutputInterface $output)
{
if (null === $this->manifestUri) {
throw new LogicException(
'No manifest URI has been configured.'
);
}
$output->writeln('Looking for updates...');
/** @var $pharUp... | php | protected function execute(InputInterface $input, OutputInterface $output)
{
if (null === $this->manifestUri) {
throw new LogicException(
'No manifest URI has been configured.'
);
}
$output->writeln('Looking for updates...');
/** @var $pharUp... | [
"protected",
"function",
"execute",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"manifestUri",
")",
"{",
"throw",
"new",
"LogicException",
"(",
"'No manifest URI has been conf... | {@inheritdoc} | [
"{"
] | train | https://github.com/deployphp/phar-update/blob/a6c7c3a1b2eb6983ebeb59cd1dc1c2e9df115c4a/src/Console/Command.php#L84-L110 |
deployphp/phar-update | src/Update.php | Update.copyTo | public function copyTo($file)
{
if (null === $this->file) {
throw LogicException::create(
'The update file has not been downloaded.'
);
}
$mode = 0755;
if (file_exists($file)) {
$mode = fileperms($file) & 511;
}
i... | php | public function copyTo($file)
{
if (null === $this->file) {
throw LogicException::create(
'The update file has not been downloaded.'
);
}
$mode = 0755;
if (file_exists($file)) {
$mode = fileperms($file) & 511;
}
i... | [
"public",
"function",
"copyTo",
"(",
"$",
"file",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"file",
")",
"{",
"throw",
"LogicException",
"::",
"create",
"(",
"'The update file has not been downloaded.'",
")",
";",
"}",
"$",
"mode",
"=",
"0755"... | Copies the update file to the destination.
@param string $file The target file.
@throws Exception\Exception
@throws FileException If the file could not be replaced. | [
"Copies",
"the",
"update",
"file",
"to",
"the",
"destination",
"."
] | train | https://github.com/deployphp/phar-update/blob/a6c7c3a1b2eb6983ebeb59cd1dc1c2e9df115c4a/src/Update.php#L94-L127 |
deployphp/phar-update | src/Update.php | Update.deleteFile | public function deleteFile()
{
if ($this->file) {
if (file_exists($this->file)) {
if (false === @unlink($this->file)) {
throw FileException::lastError();
}
}
if (file_exists($this->file . '.pubkey')) {
i... | php | public function deleteFile()
{
if ($this->file) {
if (file_exists($this->file)) {
if (false === @unlink($this->file)) {
throw FileException::lastError();
}
}
if (file_exists($this->file . '.pubkey')) {
i... | [
"public",
"function",
"deleteFile",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"file",
")",
"{",
"if",
"(",
"file_exists",
"(",
"$",
"this",
"->",
"file",
")",
")",
"{",
"if",
"(",
"false",
"===",
"@",
"unlink",
"(",
"$",
"this",
"->",
"file",
... | Cleans up by deleting the temporary update file.
@throws FileException If the file could not be deleted. | [
"Cleans",
"up",
"by",
"deleting",
"the",
"temporary",
"update",
"file",
"."
] | train | https://github.com/deployphp/phar-update/blob/a6c7c3a1b2eb6983ebeb59cd1dc1c2e9df115c4a/src/Update.php#L134-L159 |
deployphp/phar-update | src/Update.php | Update.getFile | public function getFile()
{
if (null === $this->file) {
unlink($this->file = tempnam(sys_get_temp_dir(), 'upd'));
mkdir($this->file);
$this->file .= DIRECTORY_SEPARATOR . $this->name;
$in = new SplFileObject($this->url, 'rb', false);
$out = new S... | php | public function getFile()
{
if (null === $this->file) {
unlink($this->file = tempnam(sys_get_temp_dir(), 'upd'));
mkdir($this->file);
$this->file .= DIRECTORY_SEPARATOR . $this->name;
$in = new SplFileObject($this->url, 'rb', false);
$out = new S... | [
"public",
"function",
"getFile",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"file",
")",
"{",
"unlink",
"(",
"$",
"this",
"->",
"file",
"=",
"tempnam",
"(",
"sys_get_temp_dir",
"(",
")",
",",
"'upd'",
")",
")",
";",
"mkdir",
"(",
... | Downloads the update file to a temporary location.
@return string The temporary file path.
@throws Exception\Exception
@throws FileException If the SHA1 checksum differs.
@throws UnexpectedValueException If the Phar is corrupt. | [
"Downloads",
"the",
"update",
"file",
"to",
"a",
"temporary",
"location",
"."
] | train | https://github.com/deployphp/phar-update/blob/a6c7c3a1b2eb6983ebeb59cd1dc1c2e9df115c4a/src/Update.php#L170-L219 |
deployphp/phar-update | src/Manager.php | Manager.getRunningFile | public function getRunningFile()
{
if (null === $this->runningFile) {
$this->runningFile = realpath($_SERVER['argv'][0]);
}
return $this->runningFile;
} | php | public function getRunningFile()
{
if (null === $this->runningFile) {
$this->runningFile = realpath($_SERVER['argv'][0]);
}
return $this->runningFile;
} | [
"public",
"function",
"getRunningFile",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"runningFile",
")",
"{",
"$",
"this",
"->",
"runningFile",
"=",
"realpath",
"(",
"$",
"_SERVER",
"[",
"'argv'",
"]",
"[",
"0",
"]",
")",
";",
"}",
"... | Returns the running file (the Phar that will be updated).
@return string The file. | [
"Returns",
"the",
"running",
"file",
"(",
"the",
"Phar",
"that",
"will",
"be",
"updated",
")",
"."
] | train | https://github.com/deployphp/phar-update/blob/a6c7c3a1b2eb6983ebeb59cd1dc1c2e9df115c4a/src/Manager.php#L55-L62 |
deployphp/phar-update | src/Manager.php | Manager.setRunningFile | public function setRunningFile($file)
{
if (false === is_file($file)) {
throw InvalidArgumentException::create(
'The file "%s" is not a file or it does not exist.',
$file
);
}
$this->runningFile = $file;
} | php | public function setRunningFile($file)
{
if (false === is_file($file)) {
throw InvalidArgumentException::create(
'The file "%s" is not a file or it does not exist.',
$file
);
}
$this->runningFile = $file;
} | [
"public",
"function",
"setRunningFile",
"(",
"$",
"file",
")",
"{",
"if",
"(",
"false",
"===",
"is_file",
"(",
"$",
"file",
")",
")",
"{",
"throw",
"InvalidArgumentException",
"::",
"create",
"(",
"'The file \"%s\" is not a file or it does not exist.'",
",",
"$",
... | Sets the running file (the Phar that will be updated).
@param string $file The file name or path.
@throws Exception\Exception
@throws InvalidArgumentException If the file path is invalid. | [
"Sets",
"the",
"running",
"file",
"(",
"the",
"Phar",
"that",
"will",
"be",
"updated",
")",
"."
] | train | https://github.com/deployphp/phar-update/blob/a6c7c3a1b2eb6983ebeb59cd1dc1c2e9df115c4a/src/Manager.php#L72-L82 |
deployphp/phar-update | src/Manager.php | Manager.update | public function update($version, $major = false, $pre = false)
{
if (false === ($version instanceof Version)) {
$version = Parser::toVersion($version);
}
if (null !== ($update = $this->manifest->findRecent(
$version,
$major,
$pre
))) {... | php | public function update($version, $major = false, $pre = false)
{
if (false === ($version instanceof Version)) {
$version = Parser::toVersion($version);
}
if (null !== ($update = $this->manifest->findRecent(
$version,
$major,
$pre
))) {... | [
"public",
"function",
"update",
"(",
"$",
"version",
",",
"$",
"major",
"=",
"false",
",",
"$",
"pre",
"=",
"false",
")",
"{",
"if",
"(",
"false",
"===",
"(",
"$",
"version",
"instanceof",
"Version",
")",
")",
"{",
"$",
"version",
"=",
"Parser",
":... | Updates the running Phar if any is available.
@param string|Version $version The current version.
@param boolean $major Lock to current major version?
@param boolean $pre Allow pre-releases?
@return boolean TRUE if an update was performed, FALSE if none available. | [
"Updates",
"the",
"running",
"Phar",
"if",
"any",
"is",
"available",
"."
] | train | https://github.com/deployphp/phar-update/blob/a6c7c3a1b2eb6983ebeb59cd1dc1c2e9df115c4a/src/Manager.php#L93-L111 |
deployphp/phar-update | src/PHPUnit/Extras.php | Extras.callMethod | public function callMethod($class, $method, array $args = array())
{
$method = $this->findMethod($class, $method);
$method->setAccessible(true);
return $method->invokeArgs(
is_object($class) ? $class : null,
$args
);
} | php | public function callMethod($class, $method, array $args = array())
{
$method = $this->findMethod($class, $method);
$method->setAccessible(true);
return $method->invokeArgs(
is_object($class) ? $class : null,
$args
);
} | [
"public",
"function",
"callMethod",
"(",
"$",
"class",
",",
"$",
"method",
",",
"array",
"$",
"args",
"=",
"array",
"(",
")",
")",
"{",
"$",
"method",
"=",
"$",
"this",
"->",
"findMethod",
"(",
"$",
"class",
",",
"$",
"method",
")",
";",
"$",
"me... | Calls a class or object method.
@param object|string $class The class name or object.
@param string $method The method name.
@param array $args The method arguments.
@return mixed The method result. | [
"Calls",
"a",
"class",
"or",
"object",
"method",
"."
] | train | https://github.com/deployphp/phar-update/blob/a6c7c3a1b2eb6983ebeb59cd1dc1c2e9df115c4a/src/PHPUnit/Extras.php#L36-L45 |
deployphp/phar-update | src/PHPUnit/Extras.php | Extras.copyPath | public function copyPath($from, $to, $replace = true, $purge = true)
{
if (false === file_exists($from)) {
throw FileSystemException::invalidPath($from);
}
if (is_dir($from)) {
if (false === file_exists($to)) {
if (false === @ mkdir($to)) {
... | php | public function copyPath($from, $to, $replace = true, $purge = true)
{
if (false === file_exists($from)) {
throw FileSystemException::invalidPath($from);
}
if (is_dir($from)) {
if (false === file_exists($to)) {
if (false === @ mkdir($to)) {
... | [
"public",
"function",
"copyPath",
"(",
"$",
"from",
",",
"$",
"to",
",",
"$",
"replace",
"=",
"true",
",",
"$",
"purge",
"=",
"true",
")",
"{",
"if",
"(",
"false",
"===",
"file_exists",
"(",
"$",
"from",
")",
")",
"{",
"throw",
"FileSystemException",... | Recursively copies a file or directory tree to another location.
@param string $from The source file system path.
@param string $to The target file system path.
@param boolean $replace Replacing existing files?
@param boolean $purge Automatically purge?
@throws FileSystemException If the path could not be... | [
"Recursively",
"copies",
"a",
"file",
"or",
"directory",
"tree",
"to",
"another",
"location",
"."
] | train | https://github.com/deployphp/phar-update/blob/a6c7c3a1b2eb6983ebeb59cd1dc1c2e9df115c4a/src/PHPUnit/Extras.php#L57-L103 |
deployphp/phar-update | src/PHPUnit/Extras.php | Extras.createDir | public function createDir($name = null)
{
unlink($dir = $this->createFile());
if (false === mkdir($dir)) {
throw FileSystemException::lastError($dir);
}
if (null !== $name) {
$dir .= DIRECTORY_SEPARATOR . $name;
if (false === mkdir($dir)) {
... | php | public function createDir($name = null)
{
unlink($dir = $this->createFile());
if (false === mkdir($dir)) {
throw FileSystemException::lastError($dir);
}
if (null !== $name) {
$dir .= DIRECTORY_SEPARATOR . $name;
if (false === mkdir($dir)) {
... | [
"public",
"function",
"createDir",
"(",
"$",
"name",
"=",
"null",
")",
"{",
"unlink",
"(",
"$",
"dir",
"=",
"$",
"this",
"->",
"createFile",
"(",
")",
")",
";",
"if",
"(",
"false",
"===",
"mkdir",
"(",
"$",
"dir",
")",
")",
"{",
"throw",
"FileSys... | Creates a temporary directory path that will be automatically purged
at the end of the test.
@param string $name The directory name.
@return string The directory path.
@throws FileSystemException If the directory could not be created. | [
"Creates",
"a",
"temporary",
"directory",
"path",
"that",
"will",
"be",
"automatically",
"purged",
"at",
"the",
"end",
"of",
"the",
"test",
"."
] | train | https://github.com/deployphp/phar-update/blob/a6c7c3a1b2eb6983ebeb59cd1dc1c2e9df115c4a/src/PHPUnit/Extras.php#L115-L132 |
deployphp/phar-update | src/PHPUnit/Extras.php | Extras.createFile | public function createFile($name = null)
{
if (null === $name) {
if (false === ($file = tempnam(sys_get_temp_dir(), 'tst'))) {
throw FileSystemException::lastError($name);
}
$this->purgePaths[] = $file;
} else {
if (false === touch(
... | php | public function createFile($name = null)
{
if (null === $name) {
if (false === ($file = tempnam(sys_get_temp_dir(), 'tst'))) {
throw FileSystemException::lastError($name);
}
$this->purgePaths[] = $file;
} else {
if (false === touch(
... | [
"public",
"function",
"createFile",
"(",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"name",
")",
"{",
"if",
"(",
"false",
"===",
"(",
"$",
"file",
"=",
"tempnam",
"(",
"sys_get_temp_dir",
"(",
")",
",",
"'tst'",
")",
")",
... | Creates a temporary file path that will be automatically purged at the
end of the test.
@param string $name The file name.
@return string The file path.
@throws FileSystemException If the file could not be created. | [
"Creates",
"a",
"temporary",
"file",
"path",
"that",
"will",
"be",
"automatically",
"purged",
"at",
"the",
"end",
"of",
"the",
"test",
"."
] | train | https://github.com/deployphp/phar-update/blob/a6c7c3a1b2eb6983ebeb59cd1dc1c2e9df115c4a/src/PHPUnit/Extras.php#L144-L161 |
deployphp/phar-update | src/PHPUnit/Extras.php | Extras.findMethod | public function findMethod($class, $name)
{
$reflection = new ReflectionClass($class);
while (false === $reflection->hasMethod($name)) {
if (false === ($reflection = $reflection->getParentClass())) {
throw new ReflectionException(sprintf(
'The method ... | php | public function findMethod($class, $name)
{
$reflection = new ReflectionClass($class);
while (false === $reflection->hasMethod($name)) {
if (false === ($reflection = $reflection->getParentClass())) {
throw new ReflectionException(sprintf(
'The method ... | [
"public",
"function",
"findMethod",
"(",
"$",
"class",
",",
"$",
"name",
")",
"{",
"$",
"reflection",
"=",
"new",
"ReflectionClass",
"(",
"$",
"class",
")",
";",
"while",
"(",
"false",
"===",
"$",
"reflection",
"->",
"hasMethod",
"(",
"$",
"name",
")",... | Finds a class method and returns the ReflectionMethod instance.
@param object|string $class The class name or object.
@param string $name The method name.
@return ReflectionMethod The method name.
@throws ReflectionException If the method does not exist. | [
"Finds",
"a",
"class",
"method",
"and",
"returns",
"the",
"ReflectionMethod",
"instance",
"."
] | train | https://github.com/deployphp/phar-update/blob/a6c7c3a1b2eb6983ebeb59cd1dc1c2e9df115c4a/src/PHPUnit/Extras.php#L173-L188 |
deployphp/phar-update | src/PHPUnit/Extras.php | Extras.findProperty | public function findProperty($class, $name)
{
$reflection = new ReflectionClass($class);
while (false === $reflection->hasProperty($name)) {
if (false === ($reflection = $reflection->getParentClass())) {
throw new ReflectionException(sprintf(
'The pro... | php | public function findProperty($class, $name)
{
$reflection = new ReflectionClass($class);
while (false === $reflection->hasProperty($name)) {
if (false === ($reflection = $reflection->getParentClass())) {
throw new ReflectionException(sprintf(
'The pro... | [
"public",
"function",
"findProperty",
"(",
"$",
"class",
",",
"$",
"name",
")",
"{",
"$",
"reflection",
"=",
"new",
"ReflectionClass",
"(",
"$",
"class",
")",
";",
"while",
"(",
"false",
"===",
"$",
"reflection",
"->",
"hasProperty",
"(",
"$",
"name",
... | Finds a class property and returns the ReflectionProperty instance.
@param object|string $class The class name or object.
@param string $name The property name.
@return ReflectionProperty The property instance.
@throws ReflectionException If the property is not found. | [
"Finds",
"a",
"class",
"property",
"and",
"returns",
"the",
"ReflectionProperty",
"instance",
"."
] | train | https://github.com/deployphp/phar-update/blob/a6c7c3a1b2eb6983ebeb59cd1dc1c2e9df115c4a/src/PHPUnit/Extras.php#L200-L215 |
deployphp/phar-update | src/PHPUnit/Extras.php | Extras.getPropertyValue | public function getPropertyValue($class, $name)
{
$property = $this->findProperty($class, $name);
$property->setAccessible(true);
return $property->getValue(is_object($class) ? $class : null);
} | php | public function getPropertyValue($class, $name)
{
$property = $this->findProperty($class, $name);
$property->setAccessible(true);
return $property->getValue(is_object($class) ? $class : null);
} | [
"public",
"function",
"getPropertyValue",
"(",
"$",
"class",
",",
"$",
"name",
")",
"{",
"$",
"property",
"=",
"$",
"this",
"->",
"findProperty",
"(",
"$",
"class",
",",
"$",
"name",
")",
";",
"$",
"property",
"->",
"setAccessible",
"(",
"true",
")",
... | Returns the value of the property.
@param object|string $class The class name or object.
@param string $name The property name.
@return mixed The value of the property. | [
"Returns",
"the",
"value",
"of",
"the",
"property",
"."
] | train | https://github.com/deployphp/phar-update/blob/a6c7c3a1b2eb6983ebeb59cd1dc1c2e9df115c4a/src/PHPUnit/Extras.php#L225-L231 |
deployphp/phar-update | src/PHPUnit/Extras.php | Extras.purgePath | public function purgePath($path)
{
if (false === file_exists($path)) {
throw FileSystemException::invalidPath($path);
}
if (is_dir($path)) {
if (false === ($dh = @ opendir($path))) {
throw FileSystemException::lastError($path);
}
... | php | public function purgePath($path)
{
if (false === file_exists($path)) {
throw FileSystemException::invalidPath($path);
}
if (is_dir($path)) {
if (false === ($dh = @ opendir($path))) {
throw FileSystemException::lastError($path);
}
... | [
"public",
"function",
"purgePath",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"false",
"===",
"file_exists",
"(",
"$",
"path",
")",
")",
"{",
"throw",
"FileSystemException",
"::",
"invalidPath",
"(",
"$",
"path",
")",
";",
"}",
"if",
"(",
"is_dir",
"(",
... | Recursively deletes a file or directory tree.
@param string $path The file or directory path.
@throws FileSystemException If the path could not be purged.
s | [
"Recursively",
"deletes",
"a",
"file",
"or",
"directory",
"tree",
"."
] | train | https://github.com/deployphp/phar-update/blob/a6c7c3a1b2eb6983ebeb59cd1dc1c2e9df115c4a/src/PHPUnit/Extras.php#L240-L269 |
deployphp/phar-update | src/PHPUnit/Extras.php | Extras.setPropertyValue | public function setPropertyValue($class, $name, $value)
{
$property = $this->findProperty($class, $name);
$property->setAccessible(true);
$property->setValue(
is_object($class) ? $class : null,
$value
);
} | php | public function setPropertyValue($class, $name, $value)
{
$property = $this->findProperty($class, $name);
$property->setAccessible(true);
$property->setValue(
is_object($class) ? $class : null,
$value
);
} | [
"public",
"function",
"setPropertyValue",
"(",
"$",
"class",
",",
"$",
"name",
",",
"$",
"value",
")",
"{",
"$",
"property",
"=",
"$",
"this",
"->",
"findProperty",
"(",
"$",
"class",
",",
"$",
"name",
")",
";",
"$",
"property",
"->",
"setAccessible",
... | Sets the value of the property.
@param object|string $class The class name or object.
@param string $name The property name.
@param mixed $value The property value. | [
"Sets",
"the",
"value",
"of",
"the",
"property",
"."
] | train | https://github.com/deployphp/phar-update/blob/a6c7c3a1b2eb6983ebeb59cd1dc1c2e9df115c4a/src/PHPUnit/Extras.php#L294-L302 |
deployphp/phar-update | src/PHPUnit/Extras.php | Extras.tearDown | protected function tearDown()
{
foreach ($this->purgePaths as $path) {
if (file_exists($path)) {
$this->purgePath($path);
}
}
} | php | protected function tearDown()
{
foreach ($this->purgePaths as $path) {
if (file_exists($path)) {
$this->purgePath($path);
}
}
} | [
"protected",
"function",
"tearDown",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"purgePaths",
"as",
"$",
"path",
")",
"{",
"if",
"(",
"file_exists",
"(",
"$",
"path",
")",
")",
"{",
"$",
"this",
"->",
"purgePath",
"(",
"$",
"path",
")",
";",... | Purges the created paths and reverts changes made by Runkit. | [
"Purges",
"the",
"created",
"paths",
"and",
"reverts",
"changes",
"made",
"by",
"Runkit",
"."
] | train | https://github.com/deployphp/phar-update/blob/a6c7c3a1b2eb6983ebeb59cd1dc1c2e9df115c4a/src/PHPUnit/Extras.php#L307-L314 |
deployphp/phar-update | src/Version/Builder.php | Builder.getVersion | public function getVersion()
{
return new Version(
$this->major,
$this->minor,
$this->patch,
$this->preRelease,
$this->build
);
} | php | public function getVersion()
{
return new Version(
$this->major,
$this->minor,
$this->patch,
$this->preRelease,
$this->build
);
} | [
"public",
"function",
"getVersion",
"(",
")",
"{",
"return",
"new",
"Version",
"(",
"$",
"this",
"->",
"major",
",",
"$",
"this",
"->",
"minor",
",",
"$",
"this",
"->",
"patch",
",",
"$",
"this",
"->",
"preRelease",
",",
"$",
"this",
"->",
"build",
... | Returns a readonly Version instance.
@return Version The readonly Version instance. | [
"Returns",
"a",
"readonly",
"Version",
"instance",
"."
] | train | https://github.com/deployphp/phar-update/blob/a6c7c3a1b2eb6983ebeb59cd1dc1c2e9df115c4a/src/Version/Builder.php#L50-L59 |
deployphp/phar-update | src/Version/Builder.php | Builder.importComponents | public function importComponents(array $components)
{
if (isset($components[Parser::BUILD])) {
$this->build = $components[Parser::BUILD];
} else {
$this->build = array();
}
if (isset($components[Parser::MAJOR])) {
$this->major = $components[Parser... | php | public function importComponents(array $components)
{
if (isset($components[Parser::BUILD])) {
$this->build = $components[Parser::BUILD];
} else {
$this->build = array();
}
if (isset($components[Parser::MAJOR])) {
$this->major = $components[Parser... | [
"public",
"function",
"importComponents",
"(",
"array",
"$",
"components",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"components",
"[",
"Parser",
"::",
"BUILD",
"]",
")",
")",
"{",
"$",
"this",
"->",
"build",
"=",
"$",
"components",
"[",
"Parser",
"::",
... | Imports the version components.
@param array $components The components.
@return Builder The Version builder. | [
"Imports",
"the",
"version",
"components",
"."
] | train | https://github.com/deployphp/phar-update/blob/a6c7c3a1b2eb6983ebeb59cd1dc1c2e9df115c4a/src/Version/Builder.php#L68-L101 |
deployphp/phar-update | src/Version/Builder.php | Builder.importVersion | public function importVersion($version)
{
return $this
->setMajor($version->getMajor())
->setMinor($version->getMinor())
->setPatch($version->getPatch())
->setPreRelease($version->getPreRelease())
->setBuild($version->getBuild());
} | php | public function importVersion($version)
{
return $this
->setMajor($version->getMajor())
->setMinor($version->getMinor())
->setPatch($version->getPatch())
->setPreRelease($version->getPreRelease())
->setBuild($version->getBuild());
} | [
"public",
"function",
"importVersion",
"(",
"$",
"version",
")",
"{",
"return",
"$",
"this",
"->",
"setMajor",
"(",
"$",
"version",
"->",
"getMajor",
"(",
")",
")",
"->",
"setMinor",
"(",
"$",
"version",
"->",
"getMinor",
"(",
")",
")",
"->",
"setPatch... | Imports an existing Version instance.
@param Version $version A Version instance.
@return Builder The Version builder. | [
"Imports",
"an",
"existing",
"Version",
"instance",
"."
] | train | https://github.com/deployphp/phar-update/blob/a6c7c3a1b2eb6983ebeb59cd1dc1c2e9df115c4a/src/Version/Builder.php#L122-L130 |
deployphp/phar-update | src/Version/Builder.php | Builder.incrementMajor | public function incrementMajor($amount = 1)
{
$this->major += $amount;
$this->minor = 0;
$this->patch = 0;
return $this;
} | php | public function incrementMajor($amount = 1)
{
$this->major += $amount;
$this->minor = 0;
$this->patch = 0;
return $this;
} | [
"public",
"function",
"incrementMajor",
"(",
"$",
"amount",
"=",
"1",
")",
"{",
"$",
"this",
"->",
"major",
"+=",
"$",
"amount",
";",
"$",
"this",
"->",
"minor",
"=",
"0",
";",
"$",
"this",
"->",
"patch",
"=",
"0",
";",
"return",
"$",
"this",
";"... | Increments the major version number and resets the minor and patch
version numbers to zero.
@param integer $amount Increment by what amount?
@return Builder The Version builder. | [
"Increments",
"the",
"major",
"version",
"number",
"and",
"resets",
"the",
"minor",
"and",
"patch",
"version",
"numbers",
"to",
"zero",
"."
] | train | https://github.com/deployphp/phar-update/blob/a6c7c3a1b2eb6983ebeb59cd1dc1c2e9df115c4a/src/Version/Builder.php#L140-L147 |
deployphp/phar-update | src/Version/Builder.php | Builder.setBuild | public function setBuild(array $identifiers)
{
foreach ($identifiers as $identifier) {
if (!Validator::isIdentifier($identifier)) {
throw new InvalidIdentifierException($identifier);
}
}
$this->build = $identifiers;
return $this;
} | php | public function setBuild(array $identifiers)
{
foreach ($identifiers as $identifier) {
if (!Validator::isIdentifier($identifier)) {
throw new InvalidIdentifierException($identifier);
}
}
$this->build = $identifiers;
return $this;
} | [
"public",
"function",
"setBuild",
"(",
"array",
"$",
"identifiers",
")",
"{",
"foreach",
"(",
"$",
"identifiers",
"as",
"$",
"identifier",
")",
"{",
"if",
"(",
"!",
"Validator",
"::",
"isIdentifier",
"(",
"$",
"identifier",
")",
")",
"{",
"throw",
"new",... | Sets the build metadata identifiers.
@param array $identifiers The build metadata identifiers.
@return Builder The Version builder.
@throws InvalidIdentifierException If an identifier is invalid. | [
"Sets",
"the",
"build",
"metadata",
"identifiers",
"."
] | train | https://github.com/deployphp/phar-update/blob/a6c7c3a1b2eb6983ebeb59cd1dc1c2e9df115c4a/src/Version/Builder.php#L188-L199 |
deployphp/phar-update | src/Version/Builder.php | Builder.setMajor | public function setMajor($number)
{
if (!Validator::isNumber($number)) {
throw new InvalidNumberException($number);
}
$this->major = intval($number);
return $this;
} | php | public function setMajor($number)
{
if (!Validator::isNumber($number)) {
throw new InvalidNumberException($number);
}
$this->major = intval($number);
return $this;
} | [
"public",
"function",
"setMajor",
"(",
"$",
"number",
")",
"{",
"if",
"(",
"!",
"Validator",
"::",
"isNumber",
"(",
"$",
"number",
")",
")",
"{",
"throw",
"new",
"InvalidNumberException",
"(",
"$",
"number",
")",
";",
"}",
"$",
"this",
"->",
"major",
... | Sets the major version number.
@param integer $number The major version number.
@return Builder The Version builder.
@throws InvalidNumberException If the number is invalid. | [
"Sets",
"the",
"major",
"version",
"number",
"."
] | train | https://github.com/deployphp/phar-update/blob/a6c7c3a1b2eb6983ebeb59cd1dc1c2e9df115c4a/src/Version/Builder.php#L210-L219 |
deployphp/phar-update | src/Version/Builder.php | Builder.setMinor | public function setMinor($number)
{
if (!Validator::isNumber($number)) {
throw new InvalidNumberException($number);
}
$this->minor = intval($number);
return $this;
} | php | public function setMinor($number)
{
if (!Validator::isNumber($number)) {
throw new InvalidNumberException($number);
}
$this->minor = intval($number);
return $this;
} | [
"public",
"function",
"setMinor",
"(",
"$",
"number",
")",
"{",
"if",
"(",
"!",
"Validator",
"::",
"isNumber",
"(",
"$",
"number",
")",
")",
"{",
"throw",
"new",
"InvalidNumberException",
"(",
"$",
"number",
")",
";",
"}",
"$",
"this",
"->",
"minor",
... | Sets the minor version number.
@param integer $number The minor version number.
@return Builder The Version builder.
@throws InvalidNumberException If the number is invalid. | [
"Sets",
"the",
"minor",
"version",
"number",
"."
] | train | https://github.com/deployphp/phar-update/blob/a6c7c3a1b2eb6983ebeb59cd1dc1c2e9df115c4a/src/Version/Builder.php#L230-L239 |
deployphp/phar-update | src/Version/Builder.php | Builder.setPatch | public function setPatch($number)
{
if (!Validator::isNumber($number)) {
throw new InvalidNumberException($number);
}
$this->patch = intval($number);
return $this;
} | php | public function setPatch($number)
{
if (!Validator::isNumber($number)) {
throw new InvalidNumberException($number);
}
$this->patch = intval($number);
return $this;
} | [
"public",
"function",
"setPatch",
"(",
"$",
"number",
")",
"{",
"if",
"(",
"!",
"Validator",
"::",
"isNumber",
"(",
"$",
"number",
")",
")",
"{",
"throw",
"new",
"InvalidNumberException",
"(",
"$",
"number",
")",
";",
"}",
"$",
"this",
"->",
"patch",
... | Sets the patch version number.
@param integer $number The patch version number.
@return Builder The Version builder.
@throws InvalidNumberException If the number is invalid. | [
"Sets",
"the",
"patch",
"version",
"number",
"."
] | train | https://github.com/deployphp/phar-update/blob/a6c7c3a1b2eb6983ebeb59cd1dc1c2e9df115c4a/src/Version/Builder.php#L250-L259 |
deployphp/phar-update | src/Version/Builder.php | Builder.setPreRelease | public function setPreRelease(array $identifiers)
{
foreach ($identifiers as $identifier) {
if (!Validator::isIdentifier($identifier)) {
throw new InvalidIdentifierException($identifier);
}
}
$this->preRelease = $identifiers;
return $this;
... | php | public function setPreRelease(array $identifiers)
{
foreach ($identifiers as $identifier) {
if (!Validator::isIdentifier($identifier)) {
throw new InvalidIdentifierException($identifier);
}
}
$this->preRelease = $identifiers;
return $this;
... | [
"public",
"function",
"setPreRelease",
"(",
"array",
"$",
"identifiers",
")",
"{",
"foreach",
"(",
"$",
"identifiers",
"as",
"$",
"identifier",
")",
"{",
"if",
"(",
"!",
"Validator",
"::",
"isIdentifier",
"(",
"$",
"identifier",
")",
")",
"{",
"throw",
"... | Sets the pre-release version identifiers.
@param array $identifiers The pre-release version identifiers.
@return Builder The Version builder.
@throws InvalidIdentifierException If an identifier is invalid. | [
"Sets",
"the",
"pre",
"-",
"release",
"version",
"identifiers",
"."
] | train | https://github.com/deployphp/phar-update/blob/a6c7c3a1b2eb6983ebeb59cd1dc1c2e9df115c4a/src/Version/Builder.php#L270-L281 |
deployphp/phar-update | src/Version/Parser.php | Parser.toComponents | public static function toComponents($version)
{
if (!Validator::isVersion($version)) {
throw new InvalidStringRepresentationException($version);
}
if (false !== strpos($version, '+')) {
list($version, $build) = explode('+', $version);
$build = explode('.... | php | public static function toComponents($version)
{
if (!Validator::isVersion($version)) {
throw new InvalidStringRepresentationException($version);
}
if (false !== strpos($version, '+')) {
list($version, $build) = explode('+', $version);
$build = explode('.... | [
"public",
"static",
"function",
"toComponents",
"(",
"$",
"version",
")",
"{",
"if",
"(",
"!",
"Validator",
"::",
"isVersion",
"(",
"$",
"version",
")",
")",
"{",
"throw",
"new",
"InvalidStringRepresentationException",
"(",
"$",
"version",
")",
";",
"}",
"... | Returns the components of the string representation.
@param string $version The string representation.
@return array The components of the version.
@throws InvalidStringRepresentationException If the string representation
is invalid. | [
"Returns",
"the",
"components",
"of",
"the",
"string",
"representation",
"."
] | train | https://github.com/deployphp/phar-update/blob/a6c7c3a1b2eb6983ebeb59cd1dc1c2e9df115c4a/src/Version/Parser.php#L63-L94 |
deployphp/phar-update | src/Version/Parser.php | Parser.toVersion | public static function toVersion($version)
{
$components = self::toComponents($version);
return new Version(
$components['major'],
$components['minor'],
$components['patch'],
$components['pre'],
$components['build']
);
} | php | public static function toVersion($version)
{
$components = self::toComponents($version);
return new Version(
$components['major'],
$components['minor'],
$components['patch'],
$components['pre'],
$components['build']
);
} | [
"public",
"static",
"function",
"toVersion",
"(",
"$",
"version",
")",
"{",
"$",
"components",
"=",
"self",
"::",
"toComponents",
"(",
"$",
"version",
")",
";",
"return",
"new",
"Version",
"(",
"$",
"components",
"[",
"'major'",
"]",
",",
"$",
"component... | Returns a Version instance for the string representation.
@param string $version The string representation.
@return Version A Version instance. | [
"Returns",
"a",
"Version",
"instance",
"for",
"the",
"string",
"representation",
"."
] | train | https://github.com/deployphp/phar-update/blob/a6c7c3a1b2eb6983ebeb59cd1dc1c2e9df115c4a/src/Version/Parser.php#L103-L114 |
tightenco/nova-google-analytics | src/PageViewsMetric.php | PageViewsMetric.calculate | public function calculate(Request $request)
{
$lookups = [
1 => $this->pageViewsOneDay(),
'MTD' => $this->pageViewsOneMonth(),
'YTD' => $this->pageViewsOneYear(),
];
$data = array_get($lookups, $request->get('range'), ['result' => 0, 'previous' => 0]);
... | php | public function calculate(Request $request)
{
$lookups = [
1 => $this->pageViewsOneDay(),
'MTD' => $this->pageViewsOneMonth(),
'YTD' => $this->pageViewsOneYear(),
];
$data = array_get($lookups, $request->get('range'), ['result' => 0, 'previous' => 0]);
... | [
"public",
"function",
"calculate",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"lookups",
"=",
"[",
"1",
"=>",
"$",
"this",
"->",
"pageViewsOneDay",
"(",
")",
",",
"'MTD'",
"=>",
"$",
"this",
"->",
"pageViewsOneMonth",
"(",
")",
",",
"'YTD'",
"=>",
... | Calculate the value of the metric.
@param \Illuminate\Http\Request $request
@return mixed | [
"Calculate",
"the",
"value",
"of",
"the",
"metric",
"."
] | train | https://github.com/tightenco/nova-google-analytics/blob/f1c31d0aab3493f01f2bb06e1a35de44deeffd12/src/PageViewsMetric.php#L21-L34 |
tightenco/nova-google-analytics | src/VisitorsMetric.php | VisitorsMetric.calculate | public function calculate(Request $request)
{
$lookups = [
1 => $this->visitorsOneDay(),
'MTD' => $this->visitorsOneMonth(),
'YTD' => $this->visitorsOneYear(),
];
$data = array_get($lookups, $request->get('range'), ['result' => 0, 'previous' => 0]);
... | php | public function calculate(Request $request)
{
$lookups = [
1 => $this->visitorsOneDay(),
'MTD' => $this->visitorsOneMonth(),
'YTD' => $this->visitorsOneYear(),
];
$data = array_get($lookups, $request->get('range'), ['result' => 0, 'previous' => 0]);
... | [
"public",
"function",
"calculate",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"lookups",
"=",
"[",
"1",
"=>",
"$",
"this",
"->",
"visitorsOneDay",
"(",
")",
",",
"'MTD'",
"=>",
"$",
"this",
"->",
"visitorsOneMonth",
"(",
")",
",",
"'YTD'",
"=>",
... | Calculate the value of the metric.
@param \Illuminate\Http\Request $request
@return mixed | [
"Calculate",
"the",
"value",
"of",
"the",
"metric",
"."
] | train | https://github.com/tightenco/nova-google-analytics/blob/f1c31d0aab3493f01f2bb06e1a35de44deeffd12/src/VisitorsMetric.php#L21-L34 |
dvaknheo/DNMVCS | src/Basic/SuperGlobal.php | SuperGlobal.& | public function &_GLOBALS($k, $v=null)
{
if (!isset($this->GLOBALS[$k])) {
$this->GLOBALS[$k]=$v;
}
return $this->GLOBALS[$k];
} | php | public function &_GLOBALS($k, $v=null)
{
if (!isset($this->GLOBALS[$k])) {
$this->GLOBALS[$k]=$v;
}
return $this->GLOBALS[$k];
} | [
"public",
"function",
"&",
"_GLOBALS",
"(",
"$",
"k",
",",
"$",
"v",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"GLOBALS",
"[",
"$",
"k",
"]",
")",
")",
"{",
"$",
"this",
"->",
"GLOBALS",
"[",
"$",
"k",
"]",
"="... | ///////////////////////////// | [
"/////////////////////////////"
] | train | https://github.com/dvaknheo/DNMVCS/blob/b0f81796bff33677c8c4797300de2726eeba4b2f/src/Basic/SuperGlobal.php#L67-L73 |
dvaknheo/DNMVCS | src/Ext/RouteHookDirectoryMode.php | RouteHookDirectoryMode.hook | public function hook($route)
{
$route->setURLHandler([$this,'onURL']); //todo once ?
$route->path_info=$this->adjustPathinfo($route->path_info, $route->document_root);
$route->calling_path=$route->path_info;
} | php | public function hook($route)
{
$route->setURLHandler([$this,'onURL']); //todo once ?
$route->path_info=$this->adjustPathinfo($route->path_info, $route->document_root);
$route->calling_path=$route->path_info;
} | [
"public",
"function",
"hook",
"(",
"$",
"route",
")",
"{",
"$",
"route",
"->",
"setURLHandler",
"(",
"[",
"$",
"this",
",",
"'onURL'",
"]",
")",
";",
"//todo once ?",
"$",
"route",
"->",
"path_info",
"=",
"$",
"this",
"->",
"adjustPathinfo",
"(",
"$",
... | abc/d/e.php/g/h?act=z abc/d/e/g | [
"abc",
"/",
"d",
"/",
"e",
".",
"php",
"/",
"g",
"/",
"h?act",
"=",
"z",
"abc",
"/",
"d",
"/",
"e",
"/",
"g"
] | train | https://github.com/dvaknheo/DNMVCS/blob/b0f81796bff33677c8c4797300de2726eeba4b2f/src/Ext/RouteHookDirectoryMode.php#L94-L100 |
dvaknheo/DNMVCS | src/Base/Pager.php | Pager.init | public function init($options=[], $context=null)
{
$this->url=$options['url']??static::SG()->_SERVER['REQUEST_URI'];
$this->key=$options['key']??$this->key;
$this->page_size=$options['page_size']??$this->page_size;
$this->handel_get_url=$options['rewrite']??$this->handel_get... | php | public function init($options=[], $context=null)
{
$this->url=$options['url']??static::SG()->_SERVER['REQUEST_URI'];
$this->key=$options['key']??$this->key;
$this->page_size=$options['page_size']??$this->page_size;
$this->handel_get_url=$options['rewrite']??$this->handel_get... | [
"public",
"function",
"init",
"(",
"$",
"options",
"=",
"[",
"]",
",",
"$",
"context",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"url",
"=",
"$",
"options",
"[",
"'url'",
"]",
"??",
"static",
"::",
"SG",
"(",
")",
"->",
"_SERVER",
"[",
"'REQUEST_... | options: url, key,rewrite,current | [
"options",
":",
"url",
"key",
"rewrite",
"current"
] | train | https://github.com/dvaknheo/DNMVCS/blob/b0f81796bff33677c8c4797300de2726eeba4b2f/src/Base/Pager.php#L48-L58 |
dvaknheo/DNMVCS | src/SwooleHttpd/SwooleHttpd.php | SwooleHttpd.checkOverride | protected function checkOverride($options)
{
if ($this->skip_override) {
return null;
}
$base_class=isset($options['base_class'])?$options['base_class']:self::DEFAULT_OPTIONS['base_class'];
$base_class=ltrim($base_class, '\\');
if (!$base_class || !class_... | php | protected function checkOverride($options)
{
if ($this->skip_override) {
return null;
}
$base_class=isset($options['base_class'])?$options['base_class']:self::DEFAULT_OPTIONS['base_class'];
$base_class=ltrim($base_class, '\\');
if (!$base_class || !class_... | [
"protected",
"function",
"checkOverride",
"(",
"$",
"options",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"skip_override",
")",
"{",
"return",
"null",
";",
"}",
"$",
"base_class",
"=",
"isset",
"(",
"$",
"options",
"[",
"'base_class'",
"]",
")",
"?",
"$",... | /////////////////////// | [
"///////////////////////"
] | train | https://github.com/dvaknheo/DNMVCS/blob/b0f81796bff33677c8c4797300de2726eeba4b2f/src/SwooleHttpd/SwooleHttpd.php#L296-L311 |
dvaknheo/DNMVCS | src/InnerExt/DIExt.php | DIExt.init | public function init($options=[], $context=null)
{
if ($context) {
$this->initContext($options, $context);
}
return $this;
} | php | public function init($options=[], $context=null)
{
if ($context) {
$this->initContext($options, $context);
}
return $this;
} | [
"public",
"function",
"init",
"(",
"$",
"options",
"=",
"[",
"]",
",",
"$",
"context",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"context",
")",
"{",
"$",
"this",
"->",
"initContext",
"(",
"$",
"options",
",",
"$",
"context",
")",
";",
"}",
"return"... | ////////// | [
"//////////"
] | train | https://github.com/dvaknheo/DNMVCS/blob/b0f81796bff33677c8c4797300de2726eeba4b2f/src/InnerExt/DIExt.php#L24-L30 |
dvaknheo/DNMVCS | src/DNMVCS.php | DNMVCS_Misc._Import | public function _Import($file)
{
if ($this->path_lib===null) {
$this->path_lib=$this->path.rtrim($this->options['path_lib'], '/').'/';
}
$file=rtrim($file, '.php').'.php';
require_once($this->path_lib.$file);
} | php | public function _Import($file)
{
if ($this->path_lib===null) {
$this->path_lib=$this->path.rtrim($this->options['path_lib'], '/').'/';
}
$file=rtrim($file, '.php').'.php';
require_once($this->path_lib.$file);
} | [
"public",
"function",
"_Import",
"(",
"$",
"file",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"path_lib",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"path_lib",
"=",
"$",
"this",
"->",
"path",
".",
"rtrim",
"(",
"$",
"this",
"->",
"options",
"[",
"... | /////////////////// | [
"///////////////////"
] | train | https://github.com/dvaknheo/DNMVCS/blob/b0f81796bff33677c8c4797300de2726eeba4b2f/src/DNMVCS.php#L286-L293 |
dvaknheo/DNMVCS | src/DNMVCS.php | DNMVCS.RunWithoutPathInfo | public static function RunWithoutPathInfo($options=[])
{
$default_options=[
'ext'=>[
'Ext\RouteHookOneFileMode'=>[
'mode_onefile'=>true,
'mode_onefile_key_for_action'=>'_',
],
],
];
$options=array... | php | public static function RunWithoutPathInfo($options=[])
{
$default_options=[
'ext'=>[
'Ext\RouteHookOneFileMode'=>[
'mode_onefile'=>true,
'mode_onefile_key_for_action'=>'_',
],
],
];
$options=array... | [
"public",
"static",
"function",
"RunWithoutPathInfo",
"(",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"default_options",
"=",
"[",
"'ext'",
"=>",
"[",
"'Ext\\RouteHookOneFileMode'",
"=>",
"[",
"'mode_onefile'",
"=>",
"true",
",",
"'mode_onefile_key_for_action'"... | // RunMode | [
"//",
"RunMode"
] | train | https://github.com/dvaknheo/DNMVCS/blob/b0f81796bff33677c8c4797300de2726eeba4b2f/src/DNMVCS.php#L62-L74 |
dvaknheo/DNMVCS | src/SwooleHttpd/SwooleCoroutineSingleton.php | SwooleCoroutineSingleton._DumpString | public function _DumpString()
{
$cid = \Swoole\Coroutine::getuid();
$ret="==== SwooleCoroutineSingleton List Current cid [{$cid}] ==== ;\n";
foreach (self::$_instances as $cid=>$v) {
foreach ($v as $cid_class=>$object) {
$hash=$object?md5(spl_object_hash($object))... | php | public function _DumpString()
{
$cid = \Swoole\Coroutine::getuid();
$ret="==== SwooleCoroutineSingleton List Current cid [{$cid}] ==== ;\n";
foreach (self::$_instances as $cid=>$v) {
foreach ($v as $cid_class=>$object) {
$hash=$object?md5(spl_object_hash($object))... | [
"public",
"function",
"_DumpString",
"(",
")",
"{",
"$",
"cid",
"=",
"\\",
"Swoole",
"\\",
"Coroutine",
"::",
"getuid",
"(",
")",
";",
"$",
"ret",
"=",
"\"==== SwooleCoroutineSingleton List Current cid [{$cid}] ==== ;\\n\"",
";",
"foreach",
"(",
"self",
"::",
"$... | ///////////////////// | [
"/////////////////////"
] | train | https://github.com/dvaknheo/DNMVCS/blob/b0f81796bff33677c8c4797300de2726eeba4b2f/src/SwooleHttpd/SwooleCoroutineSingleton.php#L134-L147 |
dvaknheo/DNMVCS | src/InnerExt/StrictCheck.php | StrictCheck.getCallerByLevel | protected function getCallerByLevel($level)
{
$level+=1;
$backtrace=debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, static::MAX_TRACE_LEVEL);
$caller_class=$backtrace[$level]['class']??'';
if ($this->dn_class && (is_subclass_of($this->dn_class, $caller_class) || $this->dn_class===$calle... | php | protected function getCallerByLevel($level)
{
$level+=1;
$backtrace=debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, static::MAX_TRACE_LEVEL);
$caller_class=$backtrace[$level]['class']??'';
if ($this->dn_class && (is_subclass_of($this->dn_class, $caller_class) || $this->dn_class===$calle... | [
"protected",
"function",
"getCallerByLevel",
"(",
"$",
"level",
")",
"{",
"$",
"level",
"+=",
"1",
";",
"$",
"backtrace",
"=",
"debug_backtrace",
"(",
"DEBUG_BACKTRACE_IGNORE_ARGS",
",",
"static",
"::",
"MAX_TRACE_LEVEL",
")",
";",
"$",
"caller_class",
"=",
"$... | ///////////////////////////////////////////////////////// | [
"/////////////////////////////////////////////////////////"
] | train | https://github.com/dvaknheo/DNMVCS/blob/b0f81796bff33677c8c4797300de2726eeba4b2f/src/InnerExt/StrictCheck.php#L29-L40 |
dvaknheo/DNMVCS | src/Core/App.php | Core_Redirect._ExitJson | public function _ExitJson($ret)
{
static::header('Content-Type:text/json');
$flag= JSON_UNESCAPED_UNICODE | JSON_NUMERIC_CHECK;
if ($this->is_debug) {
$flag=$flag | JSON_PRETTY_PRINT;
}
echo json_encode($ret, $flag);
static::exit_system();
} | php | public function _ExitJson($ret)
{
static::header('Content-Type:text/json');
$flag= JSON_UNESCAPED_UNICODE | JSON_NUMERIC_CHECK;
if ($this->is_debug) {
$flag=$flag | JSON_PRETTY_PRINT;
}
echo json_encode($ret, $flag);
static::exit_system();
} | [
"public",
"function",
"_ExitJson",
"(",
"$",
"ret",
")",
"{",
"static",
"::",
"header",
"(",
"'Content-Type:text/json'",
")",
";",
"$",
"flag",
"=",
"JSON_UNESCAPED_UNICODE",
"|",
"JSON_NUMERIC_CHECK",
";",
"if",
"(",
"$",
"this",
"->",
"is_debug",
")",
"{",... | // | [
"//"
] | train | https://github.com/dvaknheo/DNMVCS/blob/b0f81796bff33677c8c4797300de2726eeba4b2f/src/Core/App.php#L460-L470 |
dvaknheo/DNMVCS | src/Core/App.php | Core_Helper._Show | public function _Show($data=[], $view=null)
{
$view=$view??Route::G()->getRouteCallingPath();
foreach ($this->beforeShowHandlers as $v) {
($v)();
}
$this->is_before_show_done=true;
if ($this->options['skip_view_notice_error']) {
RuntimeState::G()->skip... | php | public function _Show($data=[], $view=null)
{
$view=$view??Route::G()->getRouteCallingPath();
foreach ($this->beforeShowHandlers as $v) {
($v)();
}
$this->is_before_show_done=true;
if ($this->options['skip_view_notice_error']) {
RuntimeState::G()->skip... | [
"public",
"function",
"_Show",
"(",
"$",
"data",
"=",
"[",
"]",
",",
"$",
"view",
"=",
"null",
")",
"{",
"$",
"view",
"=",
"$",
"view",
"??",
"Route",
"::",
"G",
"(",
")",
"->",
"getRouteCallingPath",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
... | // | [
"//"
] | train | https://github.com/dvaknheo/DNMVCS/blob/b0f81796bff33677c8c4797300de2726eeba4b2f/src/Core/App.php#L511-L522 |
dvaknheo/DNMVCS | src/Core/App.php | Core_Glue.addRouteHook | public function addRouteHook($hook, $prepend=false, $once=true)
{
return Route::G()->addRouteHook($hook, $prepend, $once);
} | php | public function addRouteHook($hook, $prepend=false, $once=true)
{
return Route::G()->addRouteHook($hook, $prepend, $once);
} | [
"public",
"function",
"addRouteHook",
"(",
"$",
"hook",
",",
"$",
"prepend",
"=",
"false",
",",
"$",
"once",
"=",
"true",
")",
"{",
"return",
"Route",
"::",
"G",
"(",
")",
"->",
"addRouteHook",
"(",
"$",
"hook",
",",
"$",
"prepend",
",",
"$",
"once... | route | [
"route"
] | train | https://github.com/dvaknheo/DNMVCS/blob/b0f81796bff33677c8c4797300de2726eeba4b2f/src/Core/App.php#L619-L622 |
dvaknheo/DNMVCS | src/Core/App.php | Core_Glue.setViewWrapper | public function setViewWrapper($head_file=null, $foot_file=null)
{
return View::G()->setViewWrapper($head_file, $foot_file);
} | php | public function setViewWrapper($head_file=null, $foot_file=null)
{
return View::G()->setViewWrapper($head_file, $foot_file);
} | [
"public",
"function",
"setViewWrapper",
"(",
"$",
"head_file",
"=",
"null",
",",
"$",
"foot_file",
"=",
"null",
")",
"{",
"return",
"View",
"::",
"G",
"(",
")",
"->",
"setViewWrapper",
"(",
"$",
"head_file",
",",
"$",
"foot_file",
")",
";",
"}"
] | view | [
"view"
] | train | https://github.com/dvaknheo/DNMVCS/blob/b0f81796bff33677c8c4797300de2726eeba4b2f/src/Core/App.php#L637-L640 |
dvaknheo/DNMVCS | src/Ext/Lazybones.php | Lazybones.runRoute | public function runRoute()
{
$path_info=Route::G()->path_info;
$enable_paramters=Route::G()->controller_enable_paramters;
$class_blocks=explode('/', $path_info);
$method=array_pop($class_blocks);
$class_path=implode('/', $class_blocks);
$full_class=$... | php | public function runRoute()
{
$path_info=Route::G()->path_info;
$enable_paramters=Route::G()->controller_enable_paramters;
$class_blocks=explode('/', $path_info);
$method=array_pop($class_blocks);
$class_path=implode('/', $class_blocks);
$full_class=$... | [
"public",
"function",
"runRoute",
"(",
")",
"{",
"$",
"path_info",
"=",
"Route",
"::",
"G",
"(",
")",
"->",
"path_info",
";",
"$",
"enable_paramters",
"=",
"Route",
"::",
"G",
"(",
")",
"->",
"controller_enable_paramters",
";",
"$",
"class_blocks",
"=",
... | // | [
"//"
] | train | https://github.com/dvaknheo/DNMVCS/blob/b0f81796bff33677c8c4797300de2726eeba4b2f/src/Ext/Lazybones.php#L84-L109 |
dvaknheo/DNMVCS | src/Ext/Lazybones.php | Lazybones.checkLoadClass | protected function checkLoadClass($path_class)
{
$namespace_controller=Route::G()->namespace_controller;
$path_class_simple=str_replace('/', '__', $path_class);
$class=($this->lazy_controller_class)?$this->lazy_controller_class:'';
if (class_exists($class)) {
re... | php | protected function checkLoadClass($path_class)
{
$namespace_controller=Route::G()->namespace_controller;
$path_class_simple=str_replace('/', '__', $path_class);
$class=($this->lazy_controller_class)?$this->lazy_controller_class:'';
if (class_exists($class)) {
re... | [
"protected",
"function",
"checkLoadClass",
"(",
"$",
"path_class",
")",
"{",
"$",
"namespace_controller",
"=",
"Route",
"::",
"G",
"(",
")",
"->",
"namespace_controller",
";",
"$",
"path_class_simple",
"=",
"str_replace",
"(",
"'/'",
",",
"'__'",
",",
"$",
"... | MyProject\Controller\AA__BB__CC | [
"MyProject",
"\\",
"Controller",
"\\",
"AA__BB__CC"
] | train | https://github.com/dvaknheo/DNMVCS/blob/b0f81796bff33677c8c4797300de2726eeba4b2f/src/Ext/Lazybones.php#L159-L182 |
tuupola/cors-middleware | src/CorsMiddleware.php | CorsMiddleware.process | public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
$response = (new ResponseFactory)->createResponse();
$analyzer = CorsAnalyzer::instance($this->buildSettings($request, $response));
if ($this->logger) {
$analyzer->set... | php | public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
$response = (new ResponseFactory)->createResponse();
$analyzer = CorsAnalyzer::instance($this->buildSettings($request, $response));
if ($this->logger) {
$analyzer->set... | [
"public",
"function",
"process",
"(",
"ServerRequestInterface",
"$",
"request",
",",
"RequestHandlerInterface",
"$",
"handler",
")",
":",
"ResponseInterface",
"{",
"$",
"response",
"=",
"(",
"new",
"ResponseFactory",
")",
"->",
"createResponse",
"(",
")",
";",
"... | Execute as PSR-15 middleware. | [
"Execute",
"as",
"PSR",
"-",
"15",
"middleware",
"."
] | train | https://github.com/tuupola/cors-middleware/blob/10c77e5ff19270380c4174cc8c95849d23521d9c/src/CorsMiddleware.php#L75-L126 |
tuupola/cors-middleware | src/CorsMiddleware.php | CorsMiddleware.buildSettings | private function buildSettings(ServerRequestInterface $request, ResponseInterface $response): CorsSettings
{
$settings = new CorsSettings;
$origin = array_fill_keys((array) $this->options["origin"], true);
$settings->setRequestAllowedOrigins($origin);
if (is_callable($this->options... | php | private function buildSettings(ServerRequestInterface $request, ResponseInterface $response): CorsSettings
{
$settings = new CorsSettings;
$origin = array_fill_keys((array) $this->options["origin"], true);
$settings->setRequestAllowedOrigins($origin);
if (is_callable($this->options... | [
"private",
"function",
"buildSettings",
"(",
"ServerRequestInterface",
"$",
"request",
",",
"ResponseInterface",
"$",
"response",
")",
":",
"CorsSettings",
"{",
"$",
"settings",
"=",
"new",
"CorsSettings",
";",
"$",
"origin",
"=",
"array_fill_keys",
"(",
"(",
"a... | Build a CORS settings object. | [
"Build",
"a",
"CORS",
"settings",
"object",
"."
] | train | https://github.com/tuupola/cors-middleware/blob/10c77e5ff19270380c4174cc8c95849d23521d9c/src/CorsMiddleware.php#L153-L184 |
tuupola/cors-middleware | src/CorsMiddleware.php | CorsMiddleware.methods | private function methods($methods): void
{
if (is_callable($methods)) {
if ($methods instanceof Closure) {
$this->options["methods"] = $methods->bindTo($this);
} else {
$this->options["methods"] = $methods;
}
} else {
$t... | php | private function methods($methods): void
{
if (is_callable($methods)) {
if ($methods instanceof Closure) {
$this->options["methods"] = $methods->bindTo($this);
} else {
$this->options["methods"] = $methods;
}
} else {
$t... | [
"private",
"function",
"methods",
"(",
"$",
"methods",
")",
":",
"void",
"{",
"if",
"(",
"is_callable",
"(",
"$",
"methods",
")",
")",
"{",
"if",
"(",
"$",
"methods",
"instanceof",
"Closure",
")",
"{",
"$",
"this",
"->",
"options",
"[",
"\"methods\"",
... | Set request methods to be allowed. | [
"Set",
"request",
"methods",
"to",
"be",
"allowed",
"."
] | train | https://github.com/tuupola/cors-middleware/blob/10c77e5ff19270380c4174cc8c95849d23521d9c/src/CorsMiddleware.php#L197-L208 |
tuupola/cors-middleware | src/CorsMiddleware.php | CorsMiddleware.processError | private function processError(ServerRequestInterface $request, ResponseInterface $response, array $arguments = null)
{
if (is_callable($this->options["error"])) {
$handler_response = $this->options["error"]($request, $response, $arguments);
if (is_a($handler_response, "\Psr\Http\Mess... | php | private function processError(ServerRequestInterface $request, ResponseInterface $response, array $arguments = null)
{
if (is_callable($this->options["error"])) {
$handler_response = $this->options["error"]($request, $response, $arguments);
if (is_a($handler_response, "\Psr\Http\Mess... | [
"private",
"function",
"processError",
"(",
"ServerRequestInterface",
"$",
"request",
",",
"ResponseInterface",
"$",
"response",
",",
"array",
"$",
"arguments",
"=",
"null",
")",
"{",
"if",
"(",
"is_callable",
"(",
"$",
"this",
"->",
"options",
"[",
"\"error\"... | Call the error handler if it exists. | [
"Call",
"the",
"error",
"handler",
"if",
"it",
"exists",
"."
] | train | https://github.com/tuupola/cors-middleware/blob/10c77e5ff19270380c4174cc8c95849d23521d9c/src/CorsMiddleware.php#L273-L282 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.