id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
238,800 | bkdotcom/Form | src/Field.php | Field.setValue | private function setValue($value, $store)
{
if (\in_array($this->attribs['type'], array('checkbox','select'))) {
if (\is_null($value)) {
$value = array();
}
$this->props['values'] = (array) $value;
} else {
$this->attribs['value'] = $va... | php | private function setValue($value, $store)
{
if (\in_array($this->attribs['type'], array('checkbox','select'))) {
if (\is_null($value)) {
$value = array();
}
$this->props['values'] = (array) $value;
} else {
$this->attribs['value'] = $va... | [
"private",
"function",
"setValue",
"(",
"$",
"value",
",",
"$",
"store",
")",
"{",
"if",
"(",
"\\",
"in_array",
"(",
"$",
"this",
"->",
"attribs",
"[",
"'type'",
"]",
",",
"array",
"(",
"'checkbox'",
",",
"'select'",
")",
")",
")",
"{",
"if",
"(",
... | Set field's value
@param mixed $value value
@param boolean $store store the value?
@return void | [
"Set",
"field",
"s",
"value"
] | 6aa5704b20300e1c8bd1c187a4fa88db9d442cee | https://github.com/bkdotcom/Form/blob/6aa5704b20300e1c8bd1c187a4fa88db9d442cee/src/Field.php#L300-L317 |
238,801 | bkdotcom/Form | src/Field.php | Field.val | public function val($val = null, $store = true)
{
if (\func_num_args()) {
// setting
$this->setValue($val, $store);
} else {
if ($this->props['getValFormatted'] && !\in_array('getValFormatted', $this->callStack)) {
$this->callStack[] = 'getValForma... | php | public function val($val = null, $store = true)
{
if (\func_num_args()) {
// setting
$this->setValue($val, $store);
} else {
if ($this->props['getValFormatted'] && !\in_array('getValFormatted', $this->callStack)) {
$this->callStack[] = 'getValForma... | [
"public",
"function",
"val",
"(",
"$",
"val",
"=",
"null",
",",
"$",
"store",
"=",
"true",
")",
"{",
"if",
"(",
"\\",
"func_num_args",
"(",
")",
")",
"{",
"// setting",
"$",
"this",
"->",
"setValue",
"(",
"$",
"val",
",",
"$",
"store",
")",
";",
... | Get or set field's value
If getting, will return
+ formatted value if field has getValFormatted callable
+ raw value otherwise
@param mixed $val (optional) new value
@param boolean $store (true) store value?
@return mixed | [
"Get",
"or",
"set",
"field",
"s",
"value",
"If",
"getting",
"will",
"return",
"+",
"formatted",
"value",
"if",
"field",
"has",
"getValFormatted",
"callable",
"+",
"raw",
"value",
"otherwise"
] | 6aa5704b20300e1c8bd1c187a4fa88db9d442cee | https://github.com/bkdotcom/Form/blob/6aa5704b20300e1c8bd1c187a4fa88db9d442cee/src/Field.php#L330-L345 |
238,802 | bkdotcom/Form | src/Field.php | Field.validateCrs | protected function validateCrs()
{
$nonEmpty = array();
$enabled = array();
$required = array();
$optsValid = array();
foreach ($this->props['options'] as $opt) {
if (empty($opt['attribs']['disabled']) && !isset($opt['optgroup'])) {
$enable... | php | protected function validateCrs()
{
$nonEmpty = array();
$enabled = array();
$required = array();
$optsValid = array();
foreach ($this->props['options'] as $opt) {
if (empty($opt['attribs']['disabled']) && !isset($opt['optgroup'])) {
$enable... | [
"protected",
"function",
"validateCrs",
"(",
")",
"{",
"$",
"nonEmpty",
"=",
"array",
"(",
")",
";",
"$",
"enabled",
"=",
"array",
"(",
")",
";",
"$",
"required",
"=",
"array",
"(",
")",
";",
"$",
"optsValid",
"=",
"array",
"(",
")",
";",
"foreach"... | Validate Checkbox, Radio, Select
@return void | [
"Validate",
"Checkbox",
"Radio",
"Select"
] | 6aa5704b20300e1c8bd1c187a4fa88db9d442cee | https://github.com/bkdotcom/Form/blob/6aa5704b20300e1c8bd1c187a4fa88db9d442cee/src/Field.php#L500-L533 |
238,803 | apitude/apitude | src/API/Controller/AbstractCrudController.php | AbstractCrudController.read | public function read($id)
{
$class = $this->getEntityClassFromType($this->apiRecordType);
$entity = $this->getEntityManager()->find($class, $id);
if (!$entity) {
return new Response('', Response::HTTP_NOT_FOUND);
}
return new JsonResponse($this->getApiWriter()->... | php | public function read($id)
{
$class = $this->getEntityClassFromType($this->apiRecordType);
$entity = $this->getEntityManager()->find($class, $id);
if (!$entity) {
return new Response('', Response::HTTP_NOT_FOUND);
}
return new JsonResponse($this->getApiWriter()->... | [
"public",
"function",
"read",
"(",
"$",
"id",
")",
"{",
"$",
"class",
"=",
"$",
"this",
"->",
"getEntityClassFromType",
"(",
"$",
"this",
"->",
"apiRecordType",
")",
";",
"$",
"entity",
"=",
"$",
"this",
"->",
"getEntityManager",
"(",
")",
"->",
"find"... | Note that route must be set up to include an id parameter
@param $id
@return JsonResponse|Response
@internal param Request $request | [
"Note",
"that",
"route",
"must",
"be",
"set",
"up",
"to",
"include",
"an",
"id",
"parameter"
] | ccf503e42214184f96cd73b4e0fc5d06c377bce5 | https://github.com/apitude/apitude/blob/ccf503e42214184f96cd73b4e0fc5d06c377bce5/src/API/Controller/AbstractCrudController.php#L82-L92 |
238,804 | seyon/Teamspeak3Framework | examples/apps/webinterface/lib/module.class.php | TS3WA_Module.getTS3Connection | protected function getTS3Connection()
{
$serverqry = TeamSpeak3_Helper_Uri::getSessParam("_serverqry");
if(!$serverqry)
{
throw new Exception("TeamSpeak3_Node_Abstract object does not exist in your current session");
}
$this->ts3 = unserialize($serverqry);
} | php | protected function getTS3Connection()
{
$serverqry = TeamSpeak3_Helper_Uri::getSessParam("_serverqry");
if(!$serverqry)
{
throw new Exception("TeamSpeak3_Node_Abstract object does not exist in your current session");
}
$this->ts3 = unserialize($serverqry);
} | [
"protected",
"function",
"getTS3Connection",
"(",
")",
"{",
"$",
"serverqry",
"=",
"TeamSpeak3_Helper_Uri",
"::",
"getSessParam",
"(",
"\"_serverqry\"",
")",
";",
"if",
"(",
"!",
"$",
"serverqry",
")",
"{",
"throw",
"new",
"Exception",
"(",
"\"TeamSpeak3_Node_Ab... | Loads the TeamSpeak3_Node_Abstract object stored in the current session.
@return void | [
"Loads",
"the",
"TeamSpeak3_Node_Abstract",
"object",
"stored",
"in",
"the",
"current",
"session",
"."
] | 03f57dbac2197f3fe7cf95ae0124152d19d78832 | https://github.com/seyon/Teamspeak3Framework/blob/03f57dbac2197f3fe7cf95ae0124152d19d78832/examples/apps/webinterface/lib/module.class.php#L135-L145 |
238,805 | seyon/Teamspeak3Framework | examples/apps/webinterface/lib/module.class.php | TS3WA_Module.assignLastEvent | protected function assignLastEvent()
{
$this->tpl->assign("eventMesg", TeamSpeak3_Helper_Uri::getSessParam("_eventmesg"));
$this->tpl->assign("eventType", TeamSpeak3_Helper_Uri::getSessParam("_eventtype", "user"));
unset($_SESSION["_eventmesg"]);
unset($_SESSION["_eventtype"]);
} | php | protected function assignLastEvent()
{
$this->tpl->assign("eventMesg", TeamSpeak3_Helper_Uri::getSessParam("_eventmesg"));
$this->tpl->assign("eventType", TeamSpeak3_Helper_Uri::getSessParam("_eventtype", "user"));
unset($_SESSION["_eventmesg"]);
unset($_SESSION["_eventtype"]);
} | [
"protected",
"function",
"assignLastEvent",
"(",
")",
"{",
"$",
"this",
"->",
"tpl",
"->",
"assign",
"(",
"\"eventMesg\"",
",",
"TeamSpeak3_Helper_Uri",
"::",
"getSessParam",
"(",
"\"_eventmesg\"",
")",
")",
";",
"$",
"this",
"->",
"tpl",
"->",
"assign",
"("... | Assigns available event messages to the template and deletes them from the session.
@return void | [
"Assigns",
"available",
"event",
"messages",
"to",
"the",
"template",
"and",
"deletes",
"them",
"from",
"the",
"session",
"."
] | 03f57dbac2197f3fe7cf95ae0124152d19d78832 | https://github.com/seyon/Teamspeak3Framework/blob/03f57dbac2197f3fe7cf95ae0124152d19d78832/examples/apps/webinterface/lib/module.class.php#L163-L170 |
238,806 | seyon/Teamspeak3Framework | examples/apps/webinterface/lib/module.class.php | TS3WA_Module.redirect | protected function redirect($module, $action = "index", $params = array())
{
$module = $this->app->getModuleKey() . "=" . $module;
$action = $action != "index" ? '&' . $this->app->getActionKey() . "=" . $action : "";
foreach($params as $key => $val)
{
$action .= "&" . $key . "=" . $val;
}
... | php | protected function redirect($module, $action = "index", $params = array())
{
$module = $this->app->getModuleKey() . "=" . $module;
$action = $action != "index" ? '&' . $this->app->getActionKey() . "=" . $action : "";
foreach($params as $key => $val)
{
$action .= "&" . $key . "=" . $val;
}
... | [
"protected",
"function",
"redirect",
"(",
"$",
"module",
",",
"$",
"action",
"=",
"\"index\"",
",",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"$",
"module",
"=",
"$",
"this",
"->",
"app",
"->",
"getModuleKey",
"(",
")",
".",
"\"=\"",
".",
"$... | Redirects the client to a specified module and action.
@param string $module
@param string $action
@return void | [
"Redirects",
"the",
"client",
"to",
"a",
"specified",
"module",
"and",
"action",
"."
] | 03f57dbac2197f3fe7cf95ae0124152d19d78832 | https://github.com/seyon/Teamspeak3Framework/blob/03f57dbac2197f3fe7cf95ae0124152d19d78832/examples/apps/webinterface/lib/module.class.php#L179-L192 |
238,807 | seyon/Teamspeak3Framework | examples/apps/webinterface/lib/module.class.php | TS3WA_Module.dispatch | public function dispatch()
{
$moduleName = $this->app->getModuleName();
$actionName = $this->app->getActionName();
$layoutFile = $moduleName . ($actionName != "index" ? "_" . $actionName : "") . ".tpl.php";
$this->tpl->render($layoutFile);
} | php | public function dispatch()
{
$moduleName = $this->app->getModuleName();
$actionName = $this->app->getActionName();
$layoutFile = $moduleName . ($actionName != "index" ? "_" . $actionName : "") . ".tpl.php";
$this->tpl->render($layoutFile);
} | [
"public",
"function",
"dispatch",
"(",
")",
"{",
"$",
"moduleName",
"=",
"$",
"this",
"->",
"app",
"->",
"getModuleName",
"(",
")",
";",
"$",
"actionName",
"=",
"$",
"this",
"->",
"app",
"->",
"getActionName",
"(",
")",
";",
"$",
"layoutFile",
"=",
"... | Renders a page for the module.
@return void | [
"Renders",
"a",
"page",
"for",
"the",
"module",
"."
] | 03f57dbac2197f3fe7cf95ae0124152d19d78832 | https://github.com/seyon/Teamspeak3Framework/blob/03f57dbac2197f3fe7cf95ae0124152d19d78832/examples/apps/webinterface/lib/module.class.php#L199-L206 |
238,808 | atelierspierrot/library | src/Library/CommandLine/Stream.php | Stream.error | public function error($str, $status = 1, $new_line = true)
{
fwrite($this->error, $str.( true===$new_line ? PHP_EOL : '' ));
fflush($this->error);
if ($status>0) exit($status);
} | php | public function error($str, $status = 1, $new_line = true)
{
fwrite($this->error, $str.( true===$new_line ? PHP_EOL : '' ));
fflush($this->error);
if ($status>0) exit($status);
} | [
"public",
"function",
"error",
"(",
"$",
"str",
",",
"$",
"status",
"=",
"1",
",",
"$",
"new_line",
"=",
"true",
")",
"{",
"fwrite",
"(",
"$",
"this",
"->",
"error",
",",
"$",
"str",
".",
"(",
"true",
"===",
"$",
"new_line",
"?",
"PHP_EOL",
":",
... | Write a message on `STDERR` and exit with an error status
@param string $str The error message string to write
@param int $status The error status for exit (default is `1`) ; you can set it on `0` to not exit
@param bool $new_line Pass a new line befor exit (default is `true`)
@return void | [
"Write",
"a",
"message",
"on",
"STDERR",
"and",
"exit",
"with",
"an",
"error",
"status"
] | a2988a11370d13c7e0dc47f9d2d81c664c30b8dd | https://github.com/atelierspierrot/library/blob/a2988a11370d13c7e0dc47f9d2d81c664c30b8dd/src/Library/CommandLine/Stream.php#L93-L98 |
238,809 | atelierspierrot/library | src/Library/CommandLine/Stream.php | Stream.write | public function write($str, $new_line = true)
{
fwrite($this->stream, $str.( true===$new_line ? PHP_EOL : '' ));
fflush($this->stream);
} | php | public function write($str, $new_line = true)
{
fwrite($this->stream, $str.( true===$new_line ? PHP_EOL : '' ));
fflush($this->stream);
} | [
"public",
"function",
"write",
"(",
"$",
"str",
",",
"$",
"new_line",
"=",
"true",
")",
"{",
"fwrite",
"(",
"$",
"this",
"->",
"stream",
",",
"$",
"str",
".",
"(",
"true",
"===",
"$",
"new_line",
"?",
"PHP_EOL",
":",
"''",
")",
")",
";",
"fflush"... | Write a message on `STDOUT`
@param string $str The error message string to write
@param bool $new_line Pass a new line befor exit (default is `true`)
@return void | [
"Write",
"a",
"message",
"on",
"STDOUT"
] | a2988a11370d13c7e0dc47f9d2d81c664c30b8dd | https://github.com/atelierspierrot/library/blob/a2988a11370d13c7e0dc47f9d2d81c664c30b8dd/src/Library/CommandLine/Stream.php#L107-L111 |
238,810 | atelierspierrot/library | src/Library/CommandLine/Stream.php | Stream.prompt | public function prompt($str)
{
self::write( $str, false );
$this->user_response = trim( fgets( $this->input, 4096 ) );
} | php | public function prompt($str)
{
self::write( $str, false );
$this->user_response = trim( fgets( $this->input, 4096 ) );
} | [
"public",
"function",
"prompt",
"(",
"$",
"str",
")",
"{",
"self",
"::",
"write",
"(",
"$",
"str",
",",
"false",
")",
";",
"$",
"this",
"->",
"user_response",
"=",
"trim",
"(",
"fgets",
"(",
"$",
"this",
"->",
"input",
",",
"4096",
")",
")",
";",... | Write a message on `STDOUT` and wait for a user input on `STDIN`
@param string $str The error message string to write
@return void | [
"Write",
"a",
"message",
"on",
"STDOUT",
"and",
"wait",
"for",
"a",
"user",
"input",
"on",
"STDIN"
] | a2988a11370d13c7e0dc47f9d2d81c664c30b8dd | https://github.com/atelierspierrot/library/blob/a2988a11370d13c7e0dc47f9d2d81c664c30b8dd/src/Library/CommandLine/Stream.php#L119-L123 |
238,811 | WellCommerce/Form | Renderer/JavascriptRenderer.php | JavascriptRenderer.renderElement | protected function renderElement(ElementInterface $element)
{
$collection = $this->getAttributesCollection($element);
$this->addElementChildren($element, $collection);
$this->addElementDependencies($element, $collection);
$this->addElementRules($element, $collection);
retur... | php | protected function renderElement(ElementInterface $element)
{
$collection = $this->getAttributesCollection($element);
$this->addElementChildren($element, $collection);
$this->addElementDependencies($element, $collection);
$this->addElementRules($element, $collection);
retur... | [
"protected",
"function",
"renderElement",
"(",
"ElementInterface",
"$",
"element",
")",
"{",
"$",
"collection",
"=",
"$",
"this",
"->",
"getAttributesCollection",
"(",
"$",
"element",
")",
";",
"$",
"this",
"->",
"addElementChildren",
"(",
"$",
"element",
",",... | Renders single form element with additional attributes
@param ElementInterface $element
@return array | [
"Renders",
"single",
"form",
"element",
"with",
"additional",
"attributes"
] | dad15dbdcf1d13f927fa86f5198bcb6abed1974a | https://github.com/WellCommerce/Form/blob/dad15dbdcf1d13f927fa86f5198bcb6abed1974a/Renderer/JavascriptRenderer.php#L68-L77 |
238,812 | WellCommerce/Form | Renderer/JavascriptRenderer.php | JavascriptRenderer.addElementChildren | protected function addElementChildren(ElementInterface $element, AttributeCollection $collection)
{
$children = $element->getChildren();
if ($children->count()) {
$attribute = new Attribute('aoFields', $this->renderChildren($children), Attribute::TYPE_ARRAY);
$collection->add... | php | protected function addElementChildren(ElementInterface $element, AttributeCollection $collection)
{
$children = $element->getChildren();
if ($children->count()) {
$attribute = new Attribute('aoFields', $this->renderChildren($children), Attribute::TYPE_ARRAY);
$collection->add... | [
"protected",
"function",
"addElementChildren",
"(",
"ElementInterface",
"$",
"element",
",",
"AttributeCollection",
"$",
"collection",
")",
"{",
"$",
"children",
"=",
"$",
"element",
"->",
"getChildren",
"(",
")",
";",
"if",
"(",
"$",
"children",
"->",
"count"... | Adds javascript children to element
@param ElementInterface $element
@param AttributeCollection $collection | [
"Adds",
"javascript",
"children",
"to",
"element"
] | dad15dbdcf1d13f927fa86f5198bcb6abed1974a | https://github.com/WellCommerce/Form/blob/dad15dbdcf1d13f927fa86f5198bcb6abed1974a/Renderer/JavascriptRenderer.php#L85-L92 |
238,813 | WellCommerce/Form | Renderer/JavascriptRenderer.php | JavascriptRenderer.addElementDependencies | protected function addElementDependencies(ElementInterface $element, AttributeCollection $collection)
{
if ($element->hasOption('dependencies') && count($element->getOption('dependencies'))) {
$dependencies = $this->formatter->formatDependencies($element->getOption('dependencies'));
... | php | protected function addElementDependencies(ElementInterface $element, AttributeCollection $collection)
{
if ($element->hasOption('dependencies') && count($element->getOption('dependencies'))) {
$dependencies = $this->formatter->formatDependencies($element->getOption('dependencies'));
... | [
"protected",
"function",
"addElementDependencies",
"(",
"ElementInterface",
"$",
"element",
",",
"AttributeCollection",
"$",
"collection",
")",
"{",
"if",
"(",
"$",
"element",
"->",
"hasOption",
"(",
"'dependencies'",
")",
"&&",
"count",
"(",
"$",
"element",
"->... | Adds javascript dependencies to element
@param ElementInterface $element
@param AttributeCollection $collection | [
"Adds",
"javascript",
"dependencies",
"to",
"element"
] | dad15dbdcf1d13f927fa86f5198bcb6abed1974a | https://github.com/WellCommerce/Form/blob/dad15dbdcf1d13f927fa86f5198bcb6abed1974a/Renderer/JavascriptRenderer.php#L100-L106 |
238,814 | WellCommerce/Form | Renderer/JavascriptRenderer.php | JavascriptRenderer.addElementRules | protected function addElementRules(ElementInterface $element, AttributeCollection $collection)
{
if ($element->hasOption('rules') && count($element->getOption('rules'))) {
$rules = $this->formatter->formatRules($element->getOption('rules'));
$collection->add(new Attribute('aoRules', ... | php | protected function addElementRules(ElementInterface $element, AttributeCollection $collection)
{
if ($element->hasOption('rules') && count($element->getOption('rules'))) {
$rules = $this->formatter->formatRules($element->getOption('rules'));
$collection->add(new Attribute('aoRules', ... | [
"protected",
"function",
"addElementRules",
"(",
"ElementInterface",
"$",
"element",
",",
"AttributeCollection",
"$",
"collection",
")",
"{",
"if",
"(",
"$",
"element",
"->",
"hasOption",
"(",
"'rules'",
")",
"&&",
"count",
"(",
"$",
"element",
"->",
"getOptio... | Adds javascript rules to element
@param ElementInterface $element
@param AttributeCollection $collection | [
"Adds",
"javascript",
"rules",
"to",
"element"
] | dad15dbdcf1d13f927fa86f5198bcb6abed1974a | https://github.com/WellCommerce/Form/blob/dad15dbdcf1d13f927fa86f5198bcb6abed1974a/Renderer/JavascriptRenderer.php#L114-L120 |
238,815 | WellCommerce/Form | Renderer/JavascriptRenderer.php | JavascriptRenderer.getAttributesCollection | protected function getAttributesCollection(ElementInterface $element) : AttributeCollection
{
$collection = new AttributeCollection();
$element->prepareAttributesCollection($collection);
return $collection;
} | php | protected function getAttributesCollection(ElementInterface $element) : AttributeCollection
{
$collection = new AttributeCollection();
$element->prepareAttributesCollection($collection);
return $collection;
} | [
"protected",
"function",
"getAttributesCollection",
"(",
"ElementInterface",
"$",
"element",
")",
":",
"AttributeCollection",
"{",
"$",
"collection",
"=",
"new",
"AttributeCollection",
"(",
")",
";",
"$",
"element",
"->",
"prepareAttributesCollection",
"(",
"$",
"co... | Returns attributes collection for element
@param ElementInterface $element
@return AttributeCollection | [
"Returns",
"attributes",
"collection",
"for",
"element"
] | dad15dbdcf1d13f927fa86f5198bcb6abed1974a | https://github.com/WellCommerce/Form/blob/dad15dbdcf1d13f927fa86f5198bcb6abed1974a/Renderer/JavascriptRenderer.php#L129-L135 |
238,816 | WellCommerce/Form | Renderer/JavascriptRenderer.php | JavascriptRenderer.renderChildren | protected function renderChildren(ElementCollection $children)
{
$attributes = [];
$children->forAll(function (ElementInterface $child) use (&$attributes) {
$attributes[] = $this->renderElement($child);
});
return $attributes;
} | php | protected function renderChildren(ElementCollection $children)
{
$attributes = [];
$children->forAll(function (ElementInterface $child) use (&$attributes) {
$attributes[] = $this->renderElement($child);
});
return $attributes;
} | [
"protected",
"function",
"renderChildren",
"(",
"ElementCollection",
"$",
"children",
")",
"{",
"$",
"attributes",
"=",
"[",
"]",
";",
"$",
"children",
"->",
"forAll",
"(",
"function",
"(",
"ElementInterface",
"$",
"child",
")",
"use",
"(",
"&",
"$",
"attr... | Renders all children elements
@param ElementCollection $children
@return array | [
"Renders",
"all",
"children",
"elements"
] | dad15dbdcf1d13f927fa86f5198bcb6abed1974a | https://github.com/WellCommerce/Form/blob/dad15dbdcf1d13f927fa86f5198bcb6abed1974a/Renderer/JavascriptRenderer.php#L144-L153 |
238,817 | marando/phpSOFA | src/Marando/IAU/iauFw2m.php | iauFw2m.Fw2m | public static function Fw2m($gamb, $phib, $psi, $eps, array &$r) {
/* Construct the matrix. */
IAU::Ir($r);
IAU::Rz($gamb, $r);
IAU::Rx($phib, $r);
IAU::Rz(-$psi, $r);
IAU::Rx(-$eps, $r);
return;
} | php | public static function Fw2m($gamb, $phib, $psi, $eps, array &$r) {
/* Construct the matrix. */
IAU::Ir($r);
IAU::Rz($gamb, $r);
IAU::Rx($phib, $r);
IAU::Rz(-$psi, $r);
IAU::Rx(-$eps, $r);
return;
} | [
"public",
"static",
"function",
"Fw2m",
"(",
"$",
"gamb",
",",
"$",
"phib",
",",
"$",
"psi",
",",
"$",
"eps",
",",
"array",
"&",
"$",
"r",
")",
"{",
"/* Construct the matrix. */",
"IAU",
"::",
"Ir",
"(",
"$",
"r",
")",
";",
"IAU",
"::",
"Rz",
"("... | - - - - - - - -
i a u F w 2 m
- - - - - - - -
Form rotation matrix given the Fukushima-Williams angles.
This function is part of the International Astronomical Union's
SOFA (Standards Of Fundamental Astronomy) software collection.
Status: support function.
Given:
gamb double F-W angle gamma_bar (radian... | [
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"i",
"a",
"u",
"F",
"w",
"2",
"m",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-"
] | 757fa49fe335ae1210eaa7735473fd4388b13f07 | https://github.com/marando/phpSOFA/blob/757fa49fe335ae1210eaa7735473fd4388b13f07/src/Marando/IAU/iauFw2m.php#L81-L90 |
238,818 | lhs168/fasim | src/Fasim/Facades/Facade.php | Facade.getFacadeRoot | public static function getFacadeRoot() {
$accessor = static::getFacadeAccessor();
$instance = Application::getInstance()->make($accessor);
if ($instance == null) {
throw new Exception('Facade get null for: '.$accessor);
}
return $instance;
} | php | public static function getFacadeRoot() {
$accessor = static::getFacadeAccessor();
$instance = Application::getInstance()->make($accessor);
if ($instance == null) {
throw new Exception('Facade get null for: '.$accessor);
}
return $instance;
} | [
"public",
"static",
"function",
"getFacadeRoot",
"(",
")",
"{",
"$",
"accessor",
"=",
"static",
"::",
"getFacadeAccessor",
"(",
")",
";",
"$",
"instance",
"=",
"Application",
"::",
"getInstance",
"(",
")",
"->",
"make",
"(",
"$",
"accessor",
")",
";",
"i... | Get the root object behind the facade.
@return mixed | [
"Get",
"the",
"root",
"object",
"behind",
"the",
"facade",
"."
] | df31e249593380421785f0be342cfb92cbb1d1d7 | https://github.com/lhs168/fasim/blob/df31e249593380421785f0be342cfb92cbb1d1d7/src/Fasim/Facades/Facade.php#L43-L50 |
238,819 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/error.php | PhpErrorException.recover | public function recover()
{
// handle the error based on the config and the environment we're in
if (static::$count <= Config::get('errors.throttle', 10))
{
logger(\Fuel::L_ERROR, $this->code.' - '.$this->message.' in '.$this->file.' on line '.$this->line);
if (\Fuel::$env != \Fuel::PRODUCTION and ($this-... | php | public function recover()
{
// handle the error based on the config and the environment we're in
if (static::$count <= Config::get('errors.throttle', 10))
{
logger(\Fuel::L_ERROR, $this->code.' - '.$this->message.' in '.$this->file.' on line '.$this->line);
if (\Fuel::$env != \Fuel::PRODUCTION and ($this-... | [
"public",
"function",
"recover",
"(",
")",
"{",
"// handle the error based on the config and the environment we're in",
"if",
"(",
"static",
"::",
"$",
"count",
"<=",
"Config",
"::",
"get",
"(",
"'errors.throttle'",
",",
"10",
")",
")",
"{",
"logger",
"(",
"\\",
... | Allow the error handler from recovering from error types defined in the config | [
"Allow",
"the",
"error",
"handler",
"from",
"recovering",
"from",
"error",
"types",
"defined",
"in",
"the",
"config"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/error.php#L25-L45 |
238,820 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/error.php | Error.shutdown_handler | public static function shutdown_handler()
{
$last_error = error_get_last();
// Only show valid fatal errors
if ($last_error AND in_array($last_error['type'], static::$fatal_levels))
{
$severity = static::$levels[$last_error['type']];
logger(\Fuel::L_ERROR, $severity.' - '.$last_error['message'].' in '.$... | php | public static function shutdown_handler()
{
$last_error = error_get_last();
// Only show valid fatal errors
if ($last_error AND in_array($last_error['type'], static::$fatal_levels))
{
$severity = static::$levels[$last_error['type']];
logger(\Fuel::L_ERROR, $severity.' - '.$last_error['message'].' in '.$... | [
"public",
"static",
"function",
"shutdown_handler",
"(",
")",
"{",
"$",
"last_error",
"=",
"error_get_last",
"(",
")",
";",
"// Only show valid fatal errors",
"if",
"(",
"$",
"last_error",
"AND",
"in_array",
"(",
"$",
"last_error",
"[",
"'type'",
"]",
",",
"st... | Native PHP shutdown handler
@return string | [
"Native",
"PHP",
"shutdown",
"handler"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/error.php#L82-L104 |
238,821 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/error.php | Error.exception_handler | public static function exception_handler(\Exception $e)
{
if (method_exists($e, 'handle'))
{
return $e->handle();
}
$severity = ( ! isset(static::$levels[$e->getCode()])) ? $e->getCode() : static::$levels[$e->getCode()];
logger(\Fuel::L_ERROR, $severity.' - '.$e->getMessage().' in '.$e->getFile().' on li... | php | public static function exception_handler(\Exception $e)
{
if (method_exists($e, 'handle'))
{
return $e->handle();
}
$severity = ( ! isset(static::$levels[$e->getCode()])) ? $e->getCode() : static::$levels[$e->getCode()];
logger(\Fuel::L_ERROR, $severity.' - '.$e->getMessage().' in '.$e->getFile().' on li... | [
"public",
"static",
"function",
"exception_handler",
"(",
"\\",
"Exception",
"$",
"e",
")",
"{",
"if",
"(",
"method_exists",
"(",
"$",
"e",
",",
"'handle'",
")",
")",
"{",
"return",
"$",
"e",
"->",
"handle",
"(",
")",
";",
"}",
"$",
"severity",
"=",
... | PHP Exception handler
@param Exception $e the exception
@return bool | [
"PHP",
"Exception",
"handler"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/error.php#L112-L130 |
238,822 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/error.php | Error.error_handler | public static function error_handler($severity, $message, $filepath, $line)
{
// don't do anything if error reporting is disabled
if (error_reporting() !== 0)
{
$fatal = (bool)( ! in_array($severity, \Config::get('errors.continue_on', array())));
if ($fatal)
{
throw new \PhpErrorException($message,... | php | public static function error_handler($severity, $message, $filepath, $line)
{
// don't do anything if error reporting is disabled
if (error_reporting() !== 0)
{
$fatal = (bool)( ! in_array($severity, \Config::get('errors.continue_on', array())));
if ($fatal)
{
throw new \PhpErrorException($message,... | [
"public",
"static",
"function",
"error_handler",
"(",
"$",
"severity",
",",
"$",
"message",
",",
"$",
"filepath",
",",
"$",
"line",
")",
"{",
"// don't do anything if error reporting is disabled",
"if",
"(",
"error_reporting",
"(",
")",
"!==",
"0",
")",
"{",
"... | PHP Error handler
@param int $severity the severity code
@param string $message the error message
@param string $filepath the path to the file throwing the error
@param int $line the line number of the error
@return bool whether to continue with execution | [
"PHP",
"Error",
"handler"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/error.php#L141-L161 |
238,823 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/error.php | Error.show_php_error | public static function show_php_error(\Exception $e)
{
$fatal = (bool)( ! in_array($e->getCode(), \Config::get('errors.continue_on', array())));
$data = static::prepare_exception($e, $fatal);
if ($fatal)
{
$data['contents'] = ob_get_contents();
while (ob_get_level() > 0)
{
ob_end_clean();
}
... | php | public static function show_php_error(\Exception $e)
{
$fatal = (bool)( ! in_array($e->getCode(), \Config::get('errors.continue_on', array())));
$data = static::prepare_exception($e, $fatal);
if ($fatal)
{
$data['contents'] = ob_get_contents();
while (ob_get_level() > 0)
{
ob_end_clean();
}
... | [
"public",
"static",
"function",
"show_php_error",
"(",
"\\",
"Exception",
"$",
"e",
")",
"{",
"$",
"fatal",
"=",
"(",
"bool",
")",
"(",
"!",
"in_array",
"(",
"$",
"e",
"->",
"getCode",
"(",
")",
",",
"\\",
"Config",
"::",
"get",
"(",
"'errors.continu... | Shows an error. It will stop script execution if the error code is not
in the errors.continue_on whitelist.
@param Exception $e the exception to show
@return void | [
"Shows",
"an",
"error",
".",
"It",
"will",
"stop",
"script",
"execution",
"if",
"the",
"error",
"code",
"is",
"not",
"in",
"the",
"errors",
".",
"continue_on",
"whitelist",
"."
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/error.php#L170-L228 |
238,824 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/error.php | Error.notice | public static function notice($msg, $always_show = false)
{
$trace = array_merge(array('file' => '(unknown)', 'line' => '(unknown)'), \Arr::get(debug_backtrace(), 1));
logger(\Fuel::L_DEBUG, 'Notice - '.$msg.' in '.$trace['file'].' on line '.$trace['line']);
if (\Fuel::$is_test or ( ! $always_show and (\Fuel::$... | php | public static function notice($msg, $always_show = false)
{
$trace = array_merge(array('file' => '(unknown)', 'line' => '(unknown)'), \Arr::get(debug_backtrace(), 1));
logger(\Fuel::L_DEBUG, 'Notice - '.$msg.' in '.$trace['file'].' on line '.$trace['line']);
if (\Fuel::$is_test or ( ! $always_show and (\Fuel::$... | [
"public",
"static",
"function",
"notice",
"(",
"$",
"msg",
",",
"$",
"always_show",
"=",
"false",
")",
"{",
"$",
"trace",
"=",
"array_merge",
"(",
"array",
"(",
"'file'",
"=>",
"'(unknown)'",
",",
"'line'",
"=>",
"'(unknown)'",
")",
",",
"\\",
"Arr",
"... | Shows a small notice error, only when not in production or when forced.
This is used by several libraries to notify the developer of certain things.
@param string $msg the message to display
@param bool $always_show whether to force display the notice or not
@return void | [
"Shows",
"a",
"small",
"notice",
"error",
"only",
"when",
"not",
"in",
"production",
"or",
"when",
"forced",
".",
"This",
"is",
"used",
"by",
"several",
"libraries",
"to",
"notify",
"the",
"developer",
"of",
"certain",
"things",
"."
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/error.php#L238-L255 |
238,825 | f1nder/BehatJsonRpcExtension | src/Context/JsonRpcClientContext.php | JsonRpcClientContext.userWithPass | public function userWithPass($username, $password)
{
$header = base64_encode(sprintf('%s:%s', $username, $password));
$this->headers['Authorization'] = 'Basic ' . $header;
} | php | public function userWithPass($username, $password)
{
$header = base64_encode(sprintf('%s:%s', $username, $password));
$this->headers['Authorization'] = 'Basic ' . $header;
} | [
"public",
"function",
"userWithPass",
"(",
"$",
"username",
",",
"$",
"password",
")",
"{",
"$",
"header",
"=",
"base64_encode",
"(",
"sprintf",
"(",
"'%s:%s'",
",",
"$",
"username",
",",
"$",
"password",
")",
")",
";",
"$",
"this",
"->",
"headers",
"[... | Set the username and password for send request
@Given /^user "([^"]+)" with pass "([^"]+)"$/
@param string $username
@param string $password | [
"Set",
"the",
"username",
"and",
"password",
"for",
"send",
"request"
] | 1737faf32e9458d883b77d468f3ffd2d934dae37 | https://github.com/f1nder/BehatJsonRpcExtension/blob/1737faf32e9458d883b77d468f3ffd2d934dae37/src/Context/JsonRpcClientContext.php#L72-L77 |
238,826 | f1nder/BehatJsonRpcExtension | src/Context/JsonRpcClientContext.php | JsonRpcClientContext.responseIsSuccessfully | public function responseIsSuccessfully()
{
Assertions::assertEquals(200, $this->response->getStatusCode(), sprintf(
'Response with error "%s".',
$this->response->getBody()
));
Assertions::assertNull($this->response->getRpcErrorCode(), sprintf(
'Response w... | php | public function responseIsSuccessfully()
{
Assertions::assertEquals(200, $this->response->getStatusCode(), sprintf(
'Response with error "%s".',
$this->response->getBody()
));
Assertions::assertNull($this->response->getRpcErrorCode(), sprintf(
'Response w... | [
"public",
"function",
"responseIsSuccessfully",
"(",
")",
"{",
"Assertions",
"::",
"assertEquals",
"(",
"200",
",",
"$",
"this",
"->",
"response",
"->",
"getStatusCode",
"(",
")",
",",
"sprintf",
"(",
"'Response with error \"%s\".'",
",",
"$",
"this",
"->",
"r... | Check response is successfully
@Then /^response is successfully$/ | [
"Check",
"response",
"is",
"successfully"
] | 1737faf32e9458d883b77d468f3ffd2d934dae37 | https://github.com/f1nder/BehatJsonRpcExtension/blob/1737faf32e9458d883b77d468f3ffd2d934dae37/src/Context/JsonRpcClientContext.php#L135-L146 |
238,827 | f1nder/BehatJsonRpcExtension | src/Context/JsonRpcClientContext.php | JsonRpcClientContext.responseIsSuccessfullyWithContainScalarResult | public function responseIsSuccessfullyWithContainScalarResult($result)
{
Assertions::assertEquals(200, $this->response->getStatusCode(), sprintf(
'Response with error "%s"',
$this->response->getBody()
));
Assertions::assertTrue(is_null($this->response->getRpcErrorCod... | php | public function responseIsSuccessfullyWithContainScalarResult($result)
{
Assertions::assertEquals(200, $this->response->getStatusCode(), sprintf(
'Response with error "%s"',
$this->response->getBody()
));
Assertions::assertTrue(is_null($this->response->getRpcErrorCod... | [
"public",
"function",
"responseIsSuccessfullyWithContainScalarResult",
"(",
"$",
"result",
")",
"{",
"Assertions",
"::",
"assertEquals",
"(",
"200",
",",
"$",
"this",
"->",
"response",
"->",
"getStatusCode",
"(",
")",
",",
"sprintf",
"(",
"'Response with error \"%s\... | Check success response with scalar result
@Then /^response is successfully with contain result "([^"]+)"$/
@param string $result | [
"Check",
"success",
"response",
"with",
"scalar",
"result"
] | 1737faf32e9458d883b77d468f3ffd2d934dae37 | https://github.com/f1nder/BehatJsonRpcExtension/blob/1737faf32e9458d883b77d468f3ffd2d934dae37/src/Context/JsonRpcClientContext.php#L197-L213 |
238,828 | f1nder/BehatJsonRpcExtension | src/Context/JsonRpcClientContext.php | JsonRpcClientContext.responseIsSuccessfullyWithContainListResult | public function responseIsSuccessfullyWithContainListResult(TableNode $table, $count = null)
{
$this->responseIsSuccessfully();
$rpcResult = $this->response->getRpcResult();
Assertions::assertTrue(is_array($rpcResult), sprintf(
'The RPC response must be a array, but "%s" given.... | php | public function responseIsSuccessfullyWithContainListResult(TableNode $table, $count = null)
{
$this->responseIsSuccessfully();
$rpcResult = $this->response->getRpcResult();
Assertions::assertTrue(is_array($rpcResult), sprintf(
'The RPC response must be a array, but "%s" given.... | [
"public",
"function",
"responseIsSuccessfullyWithContainListResult",
"(",
"TableNode",
"$",
"table",
",",
"$",
"count",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"responseIsSuccessfully",
"(",
")",
";",
"$",
"rpcResult",
"=",
"$",
"this",
"->",
"response",
"->... | Check response successfully with list result
@Then /^response is successfully with collection result:$/
@param TableNode $table
@param int $count | [
"Check",
"response",
"successfully",
"with",
"list",
"result"
] | 1737faf32e9458d883b77d468f3ffd2d934dae37 | https://github.com/f1nder/BehatJsonRpcExtension/blob/1737faf32e9458d883b77d468f3ffd2d934dae37/src/Context/JsonRpcClientContext.php#L223-L256 |
238,829 | f1nder/BehatJsonRpcExtension | src/Context/JsonRpcClientContext.php | JsonRpcClientContext.iSendARequest | public function iSendARequest($method, TableNode $params)
{
$id = $this->getRequestId() ? $this->getRequestId() : uniqid();
$params = $params->getRowsHash();
$requestParameters = [];
foreach ($params as $parameterKey => $parameterValue) {
$property = new PropertyPath($p... | php | public function iSendARequest($method, TableNode $params)
{
$id = $this->getRequestId() ? $this->getRequestId() : uniqid();
$params = $params->getRowsHash();
$requestParameters = [];
foreach ($params as $parameterKey => $parameterValue) {
$property = new PropertyPath($p... | [
"public",
"function",
"iSendARequest",
"(",
"$",
"method",
",",
"TableNode",
"$",
"params",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"getRequestId",
"(",
")",
"?",
"$",
"this",
"->",
"getRequestId",
"(",
")",
":",
"uniqid",
"(",
")",
";",
"$",
... | Sends Json rpc request to specific method.
@param string $method request method
@param TableNode $params table of params values
@When /^(?:I )?send a request to "([^"]+)" with params:$/ | [
"Sends",
"Json",
"rpc",
"request",
"to",
"specific",
"method",
"."
] | 1737faf32e9458d883b77d468f3ffd2d934dae37 | https://github.com/f1nder/BehatJsonRpcExtension/blob/1737faf32e9458d883b77d468f3ffd2d934dae37/src/Context/JsonRpcClientContext.php#L278-L328 |
238,830 | f1nder/BehatJsonRpcExtension | src/Context/JsonRpcClientContext.php | JsonRpcClientContext.theServerShouldReturnStatusCode | public function theServerShouldReturnStatusCode($status)
{
Assertions::assertNotNull($this->response, 'Missing response. Can you not send request?');
Assertions::assertEquals($status, $this->response->getStatusCode(), 'Invalid HTTP status code.');
} | php | public function theServerShouldReturnStatusCode($status)
{
Assertions::assertNotNull($this->response, 'Missing response. Can you not send request?');
Assertions::assertEquals($status, $this->response->getStatusCode(), 'Invalid HTTP status code.');
} | [
"public",
"function",
"theServerShouldReturnStatusCode",
"(",
"$",
"status",
")",
"{",
"Assertions",
"::",
"assertNotNull",
"(",
"$",
"this",
"->",
"response",
",",
"'Missing response. Can you not send request?'",
")",
";",
"Assertions",
"::",
"assertEquals",
"(",
"$"... | The server should return status code
@param integer $status
@Then /^(?:the )?server should return "([^"]+)" status code$/ | [
"The",
"server",
"should",
"return",
"status",
"code"
] | 1737faf32e9458d883b77d468f3ffd2d934dae37 | https://github.com/f1nder/BehatJsonRpcExtension/blob/1737faf32e9458d883b77d468f3ffd2d934dae37/src/Context/JsonRpcClientContext.php#L348-L352 |
238,831 | f1nder/BehatJsonRpcExtension | src/Context/JsonRpcClientContext.php | JsonRpcClientContext.theServerShouldReturnHeaders | public function theServerShouldReturnHeaders(TableNode $headers)
{
Assertions::assertNotNull($this->response, 'Missing response. Can you not send request?');
$responseHeaders = [];
foreach ($this->response->getHeaders() as $name => $value) {
$responseHeaders[strtolower($name)] =... | php | public function theServerShouldReturnHeaders(TableNode $headers)
{
Assertions::assertNotNull($this->response, 'Missing response. Can you not send request?');
$responseHeaders = [];
foreach ($this->response->getHeaders() as $name => $value) {
$responseHeaders[strtolower($name)] =... | [
"public",
"function",
"theServerShouldReturnHeaders",
"(",
"TableNode",
"$",
"headers",
")",
"{",
"Assertions",
"::",
"assertNotNull",
"(",
"$",
"this",
"->",
"response",
",",
"'Missing response. Can you not send request?'",
")",
";",
"$",
"responseHeaders",
"=",
"[",... | The server should return headers
@param TableNode $headers
@Then /^(?:the )?server should return headers:$/ | [
"The",
"server",
"should",
"return",
"headers"
] | 1737faf32e9458d883b77d468f3ffd2d934dae37 | https://github.com/f1nder/BehatJsonRpcExtension/blob/1737faf32e9458d883b77d468f3ffd2d934dae37/src/Context/JsonRpcClientContext.php#L361-L380 |
238,832 | f1nder/BehatJsonRpcExtension | src/Context/JsonRpcClientContext.php | JsonRpcClientContext.theResponseShouldContainErrorWithMessage | public function theResponseShouldContainErrorWithMessage($id, $message)
{
Assertions::assertEquals(intval($id), $this->response->getRpcErrorCode());
Assertions::assertEquals($message, $this->response->getRpcErrorMessage());
} | php | public function theResponseShouldContainErrorWithMessage($id, $message)
{
Assertions::assertEquals(intval($id), $this->response->getRpcErrorCode());
Assertions::assertEquals($message, $this->response->getRpcErrorMessage());
} | [
"public",
"function",
"theResponseShouldContainErrorWithMessage",
"(",
"$",
"id",
",",
"$",
"message",
")",
"{",
"Assertions",
"::",
"assertEquals",
"(",
"intval",
"(",
"$",
"id",
")",
",",
"$",
"this",
"->",
"response",
"->",
"getRpcErrorCode",
"(",
")",
")... | Parse json-rpc error response
@param string|integer $id
@param string $message
@Then /^(?:the )?response should be error with id "([^"]+)", message "(.+)"$/ | [
"Parse",
"json",
"-",
"rpc",
"error",
"response"
] | 1737faf32e9458d883b77d468f3ffd2d934dae37 | https://github.com/f1nder/BehatJsonRpcExtension/blob/1737faf32e9458d883b77d468f3ffd2d934dae37/src/Context/JsonRpcClientContext.php#L390-L394 |
238,833 | f1nder/BehatJsonRpcExtension | src/Context/JsonRpcClientContext.php | JsonRpcClientContext.theResponseShouldContainErrorData | public function theResponseShouldContainErrorData($id, $message, TableNode $table)
{
Assertions::assertEquals(200, $this->response->getStatusCode());
$this->theResponseShouldContainErrorWithMessage($id, $message);
$error = $this->getFieldFromBody('error', $this->response->getBody());
... | php | public function theResponseShouldContainErrorData($id, $message, TableNode $table)
{
Assertions::assertEquals(200, $this->response->getStatusCode());
$this->theResponseShouldContainErrorWithMessage($id, $message);
$error = $this->getFieldFromBody('error', $this->response->getBody());
... | [
"public",
"function",
"theResponseShouldContainErrorData",
"(",
"$",
"id",
",",
"$",
"message",
",",
"TableNode",
"$",
"table",
")",
"{",
"Assertions",
"::",
"assertEquals",
"(",
"200",
",",
"$",
"this",
"->",
"response",
"->",
"getStatusCode",
"(",
")",
")"... | Check json-rpc error data
@param string|integer $id
@param string $message
@param TableNode $table
@Then /^(?:the )?response should be error with id "([^"]+)", message "(.+)", data:$/ | [
"Check",
"json",
"-",
"rpc",
"error",
"data"
] | 1737faf32e9458d883b77d468f3ffd2d934dae37 | https://github.com/f1nder/BehatJsonRpcExtension/blob/1737faf32e9458d883b77d468f3ffd2d934dae37/src/Context/JsonRpcClientContext.php#L417-L426 |
238,834 | f1nder/BehatJsonRpcExtension | src/Context/JsonRpcClientContext.php | JsonRpcClientContext.getFieldFromBody | protected function getFieldFromBody($key, $body)
{
$rpc = json_decode($body, true);
return isset($rpc[$key]) ? $rpc[$key] : null;
} | php | protected function getFieldFromBody($key, $body)
{
$rpc = json_decode($body, true);
return isset($rpc[$key]) ? $rpc[$key] : null;
} | [
"protected",
"function",
"getFieldFromBody",
"(",
"$",
"key",
",",
"$",
"body",
")",
"{",
"$",
"rpc",
"=",
"json_decode",
"(",
"$",
"body",
",",
"true",
")",
";",
"return",
"isset",
"(",
"$",
"rpc",
"[",
"$",
"key",
"]",
")",
"?",
"$",
"rpc",
"["... | Get field from body
@param string $key
@param string $body
@return mixed | [
"Get",
"field",
"from",
"body"
] | 1737faf32e9458d883b77d468f3ffd2d934dae37 | https://github.com/f1nder/BehatJsonRpcExtension/blob/1737faf32e9458d883b77d468f3ffd2d934dae37/src/Context/JsonRpcClientContext.php#L550-L555 |
238,835 | perinatologie/hub-client-php | src/Security/UserbaseJwtAuthenticatorClient.php | UserbaseJwtAuthenticatorClient.authenticate | public function authenticate($username, $password)
{
$authRequest = new Request('GET', $this->userbaseUrl);
$client = new GuzzleClient(
[
'verify' => $this->tlsCertVerification,
'headers' => [
'User-Agent' => 'HubUserbaseClient (Guzzle)... | php | public function authenticate($username, $password)
{
$authRequest = new Request('GET', $this->userbaseUrl);
$client = new GuzzleClient(
[
'verify' => $this->tlsCertVerification,
'headers' => [
'User-Agent' => 'HubUserbaseClient (Guzzle)... | [
"public",
"function",
"authenticate",
"(",
"$",
"username",
",",
"$",
"password",
")",
"{",
"$",
"authRequest",
"=",
"new",
"Request",
"(",
"'GET'",
",",
"$",
"this",
"->",
"userbaseUrl",
")",
";",
"$",
"client",
"=",
"new",
"GuzzleClient",
"(",
"[",
"... | Authenticate with UserBase.
The credentials given here will be used to request a Json Web Token,
claiming the username, from UserBase.
@param string $username
@param string $password
@return string
@throws \Hub\Client\Exception\AuthenticationFailureException | [
"Authenticate",
"with",
"UserBase",
"."
] | 3a0cf7ec6e3e5bf465167c283ee3dad9f4daaca3 | https://github.com/perinatologie/hub-client-php/blob/3a0cf7ec6e3e5bf465167c283ee3dad9f4daaca3/src/Security/UserbaseJwtAuthenticatorClient.php#L61-L99 |
238,836 | wasabi-cms/cms | src/Controller/PagesController.php | PagesController.reorderPages | public function reorderPages()
{
if (!$this->request->isAll(['ajax', 'post'])) {
throw new MethodNotAllowedException();
}
if (empty($this->request->data)) {
throw new BadRequestException();
}
$this->request->data = Hash::map($this->request->data, '{n... | php | public function reorderPages()
{
if (!$this->request->isAll(['ajax', 'post'])) {
throw new MethodNotAllowedException();
}
if (empty($this->request->data)) {
throw new BadRequestException();
}
$this->request->data = Hash::map($this->request->data, '{n... | [
"public",
"function",
"reorderPages",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"request",
"->",
"isAll",
"(",
"[",
"'ajax'",
",",
"'post'",
"]",
")",
")",
"{",
"throw",
"new",
"MethodNotAllowedException",
"(",
")",
";",
"}",
"if",
"(",
"empt... | reorderPages action
AJAX POST | [
"reorderPages",
"action",
"AJAX",
"POST"
] | 2787b6422ea1d719cf49951b3253fd0ac31d22ca | https://github.com/wasabi-cms/cms/blob/2787b6422ea1d719cf49951b3253fd0ac31d22ca/src/Controller/PagesController.php#L250-L295 |
238,837 | flowcode/AmulenShopBundle | src/Flowcode/ShopBundle/Controller/AdminStockChangeLogController.php | AdminStockChangeLogController.indexAction | public function indexAction(Request $request)
{
$em = $this->getDoctrine()->getManager();
$qb = $em->getRepository(StockChangeLog::class)->createQueryBuilder('s');
$this->addQueryBuilderSort($qb, 'stockchangelog');
$paginator = $this->get('knp_paginator')->paginate($qb, $request->que... | php | public function indexAction(Request $request)
{
$em = $this->getDoctrine()->getManager();
$qb = $em->getRepository(StockChangeLog::class)->createQueryBuilder('s');
$this->addQueryBuilderSort($qb, 'stockchangelog');
$paginator = $this->get('knp_paginator')->paginate($qb, $request->que... | [
"public",
"function",
"indexAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"em",
"=",
"$",
"this",
"->",
"getDoctrine",
"(",
")",
"->",
"getManager",
"(",
")",
";",
"$",
"qb",
"=",
"$",
"em",
"->",
"getRepository",
"(",
"StockChangeLog",
"::",... | Lists all StockChangeLog entities.
@Route("/", name="admin_shop_changelog")
@Method("GET")
@Template() | [
"Lists",
"all",
"StockChangeLog",
"entities",
"."
] | 500aaf4364be3c42fca69ecd10a449da03993814 | https://github.com/flowcode/AmulenShopBundle/blob/500aaf4364be3c42fca69ecd10a449da03993814/src/Flowcode/ShopBundle/Controller/AdminStockChangeLogController.php#L28-L38 |
238,838 | flowcode/AmulenShopBundle | src/Flowcode/ShopBundle/Controller/AdminStockChangeLogController.php | AdminStockChangeLogController.showAction | public function showAction(StockChangeLog $stockchangelog)
{
$editForm = $this->createForm(new StockChangeLogType(), $stockchangelog, array(
'action' => $this->generateUrl('admin_shop_changelog_update', array('id' => $stockchangelog->getid())),
'method' => 'PUT',
));
... | php | public function showAction(StockChangeLog $stockchangelog)
{
$editForm = $this->createForm(new StockChangeLogType(), $stockchangelog, array(
'action' => $this->generateUrl('admin_shop_changelog_update', array('id' => $stockchangelog->getid())),
'method' => 'PUT',
));
... | [
"public",
"function",
"showAction",
"(",
"StockChangeLog",
"$",
"stockchangelog",
")",
"{",
"$",
"editForm",
"=",
"$",
"this",
"->",
"createForm",
"(",
"new",
"StockChangeLogType",
"(",
")",
",",
"$",
"stockchangelog",
",",
"array",
"(",
"'action'",
"=>",
"$... | Finds and displays a StockChangeLog entity.
@Route("/{id}/show", name="admin_shop_changelog_show", requirements={"id"="\d+"})
@Method("GET")
@Template() | [
"Finds",
"and",
"displays",
"a",
"StockChangeLog",
"entity",
"."
] | 500aaf4364be3c42fca69ecd10a449da03993814 | https://github.com/flowcode/AmulenShopBundle/blob/500aaf4364be3c42fca69ecd10a449da03993814/src/Flowcode/ShopBundle/Controller/AdminStockChangeLogController.php#L47-L62 |
238,839 | flowcode/AmulenShopBundle | src/Flowcode/ShopBundle/Controller/AdminStockChangeLogController.php | AdminStockChangeLogController.newAction | public function newAction()
{
$stockchangelog = new StockChangeLog();
$form = $this->createForm(new StockChangeLogType(), $stockchangelog);
return array(
'stockchangelog' => $stockchangelog,
'form' => $form->createView(),
);
} | php | public function newAction()
{
$stockchangelog = new StockChangeLog();
$form = $this->createForm(new StockChangeLogType(), $stockchangelog);
return array(
'stockchangelog' => $stockchangelog,
'form' => $form->createView(),
);
} | [
"public",
"function",
"newAction",
"(",
")",
"{",
"$",
"stockchangelog",
"=",
"new",
"StockChangeLog",
"(",
")",
";",
"$",
"form",
"=",
"$",
"this",
"->",
"createForm",
"(",
"new",
"StockChangeLogType",
"(",
")",
",",
"$",
"stockchangelog",
")",
";",
"re... | Displays a form to create a new StockChangeLog entity.
@Route("/new", name="admin_shop_changelog_new")
@Method("GET")
@Template() | [
"Displays",
"a",
"form",
"to",
"create",
"a",
"new",
"StockChangeLog",
"entity",
"."
] | 500aaf4364be3c42fca69ecd10a449da03993814 | https://github.com/flowcode/AmulenShopBundle/blob/500aaf4364be3c42fca69ecd10a449da03993814/src/Flowcode/ShopBundle/Controller/AdminStockChangeLogController.php#L71-L80 |
238,840 | flowcode/AmulenShopBundle | src/Flowcode/ShopBundle/Controller/AdminStockChangeLogController.php | AdminStockChangeLogController.createAction | public function createAction(Request $request)
{
$stockchangelog = new StockChangeLog();
$form = $this->createForm(new StockChangeLogType(), $stockchangelog);
if ($form->handleRequest($request)->isValid()) {
$em = $this->getDoctrine()->getManager();
$em->persist($stoc... | php | public function createAction(Request $request)
{
$stockchangelog = new StockChangeLog();
$form = $this->createForm(new StockChangeLogType(), $stockchangelog);
if ($form->handleRequest($request)->isValid()) {
$em = $this->getDoctrine()->getManager();
$em->persist($stoc... | [
"public",
"function",
"createAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"stockchangelog",
"=",
"new",
"StockChangeLog",
"(",
")",
";",
"$",
"form",
"=",
"$",
"this",
"->",
"createForm",
"(",
"new",
"StockChangeLogType",
"(",
")",
",",
"$",
"... | Creates a new StockChangeLog entity.
@Route("/create", name="admin_shop_changelog_create")
@Method("POST")
@Template("FlowerStockBundle:StockChangeLog:new.html.twig") | [
"Creates",
"a",
"new",
"StockChangeLog",
"entity",
"."
] | 500aaf4364be3c42fca69ecd10a449da03993814 | https://github.com/flowcode/AmulenShopBundle/blob/500aaf4364be3c42fca69ecd10a449da03993814/src/Flowcode/ShopBundle/Controller/AdminStockChangeLogController.php#L89-L105 |
238,841 | flowcode/AmulenShopBundle | src/Flowcode/ShopBundle/Controller/AdminStockChangeLogController.php | AdminStockChangeLogController.updateAction | public function updateAction(StockChangeLog $stockchangelog, Request $request)
{
$editForm = $this->createForm(new StockChangeLogType(), $stockchangelog, array(
'action' => $this->generateUrl('admin_shop_changelog_update', array('id' => $stockchangelog->getid())),
'method' => 'PUT',
... | php | public function updateAction(StockChangeLog $stockchangelog, Request $request)
{
$editForm = $this->createForm(new StockChangeLogType(), $stockchangelog, array(
'action' => $this->generateUrl('admin_shop_changelog_update', array('id' => $stockchangelog->getid())),
'method' => 'PUT',
... | [
"public",
"function",
"updateAction",
"(",
"StockChangeLog",
"$",
"stockchangelog",
",",
"Request",
"$",
"request",
")",
"{",
"$",
"editForm",
"=",
"$",
"this",
"->",
"createForm",
"(",
"new",
"StockChangeLogType",
"(",
")",
",",
"$",
"stockchangelog",
",",
... | Edits an existing StockChangeLog entity.
@Route("/{id}/update", name="admin_shop_changelog_update", requirements={"id"="\d+"})
@Method("PUT")
@Template("FlowerStockBundle:StockChangeLog:edit.html.twig") | [
"Edits",
"an",
"existing",
"StockChangeLog",
"entity",
"."
] | 500aaf4364be3c42fca69ecd10a449da03993814 | https://github.com/flowcode/AmulenShopBundle/blob/500aaf4364be3c42fca69ecd10a449da03993814/src/Flowcode/ShopBundle/Controller/AdminStockChangeLogController.php#L136-L154 |
238,842 | marando/phpSOFA | src/Marando/IAU/iauAtciqn.php | iauAtciqn.Atciqn | public static function Atciqn($rc, $dc, $pr, $pd, $px, $rv,
iauASTROM &$astrom, $n, array $b, &$ri, &$di) {
foreach ($b as $i)
if ($i instanceof iauLDBODY == false)
throw new \InvalidArgumentException("All \$b elements must be iauLDBODY type");
$pco = [];
$pnat = [];
$ppr = [... | php | public static function Atciqn($rc, $dc, $pr, $pd, $px, $rv,
iauASTROM &$astrom, $n, array $b, &$ri, &$di) {
foreach ($b as $i)
if ($i instanceof iauLDBODY == false)
throw new \InvalidArgumentException("All \$b elements must be iauLDBODY type");
$pco = [];
$pnat = [];
$ppr = [... | [
"public",
"static",
"function",
"Atciqn",
"(",
"$",
"rc",
",",
"$",
"dc",
",",
"$",
"pr",
",",
"$",
"pd",
",",
"$",
"px",
",",
"$",
"rv",
",",
"iauASTROM",
"&",
"$",
"astrom",
",",
"$",
"n",
",",
"array",
"$",
"b",
",",
"&",
"$",
"ri",
",",... | - - - - - - - - - -
i a u A t c i q n
- - - - - - - - - -
Quick ICRS, epoch J2000.0, to CIRS transformation, given precomputed
star-independent astrometry parameters plus a list of light-
deflecting bodies.
Use of this function is appropriate when efficiency is important and
where many star positions are to be transf... | [
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"i",
"a",
"u",
"A",
"t",
"c",
"i",
"q",
"n",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-"
] | 757fa49fe335ae1210eaa7735473fd4388b13f07 | https://github.com/marando/phpSOFA/blob/757fa49fe335ae1210eaa7735473fd4388b13f07/src/Marando/IAU/iauAtciqn.php#L115-L145 |
238,843 | glynnforrest/reform | src/Reform/Form/Form.php | Form.getTag | public function getTag($tag)
{
return isset($this->tags[$tag]) ? $this->tags[$tag] : null;
} | php | public function getTag($tag)
{
return isset($this->tags[$tag]) ? $this->tags[$tag] : null;
} | [
"public",
"function",
"getTag",
"(",
"$",
"tag",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"tags",
"[",
"$",
"tag",
"]",
")",
"?",
"$",
"this",
"->",
"tags",
"[",
"$",
"tag",
"]",
":",
"null",
";",
"}"
] | Get the value of a tag, or null if it doesn't exist.
@param string $tag The name of the tag
@return mixed The value of the tag or null | [
"Get",
"the",
"value",
"of",
"a",
"tag",
"or",
"null",
"if",
"it",
"doesn",
"t",
"exist",
"."
] | a2a33dfa73933875f9c1dd0691b21e678a541a9e | https://github.com/glynnforrest/reform/blob/a2a33dfa73933875f9c1dd0691b21e678a541a9e/src/Reform/Form/Form.php#L260-L263 |
238,844 | glynnforrest/reform | src/Reform/Form/Form.php | Form.setHeader | public function setHeader($action, $method = 'POST', array $attributes = array())
{
$this->setAction($action);
$this->setMethod($method);
$this->setAttributes($attributes);
return $this;
} | php | public function setHeader($action, $method = 'POST', array $attributes = array())
{
$this->setAction($action);
$this->setMethod($method);
$this->setAttributes($attributes);
return $this;
} | [
"public",
"function",
"setHeader",
"(",
"$",
"action",
",",
"$",
"method",
"=",
"'POST'",
",",
"array",
"$",
"attributes",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"setAction",
"(",
"$",
"action",
")",
";",
"$",
"this",
"->",
"setMethod",... | Set the action, method and any additional attributes of the Form.
@param string $action The action.
@param string $method The method.
@param array $attributes The attributes. | [
"Set",
"the",
"action",
"method",
"and",
"any",
"additional",
"attributes",
"of",
"the",
"Form",
"."
] | a2a33dfa73933875f9c1dd0691b21e678a541a9e | https://github.com/glynnforrest/reform/blob/a2a33dfa73933875f9c1dd0691b21e678a541a9e/src/Reform/Form/Form.php#L282-L289 |
238,845 | glynnforrest/reform | src/Reform/Form/Form.php | Form.header | public function header()
{
$attributes = array('action' => $this->action, 'method' => $this->method);
$attributes = array_merge($attributes, $this->attributes);
return Html::openTag('form', $attributes);
} | php | public function header()
{
$attributes = array('action' => $this->action, 'method' => $this->method);
$attributes = array_merge($attributes, $this->attributes);
return Html::openTag('form', $attributes);
} | [
"public",
"function",
"header",
"(",
")",
"{",
"$",
"attributes",
"=",
"array",
"(",
"'action'",
"=>",
"$",
"this",
"->",
"action",
",",
"'method'",
"=>",
"$",
"this",
"->",
"method",
")",
";",
"$",
"attributes",
"=",
"array_merge",
"(",
"$",
"attribut... | Render the header of this Form as Html. | [
"Render",
"the",
"header",
"of",
"this",
"Form",
"as",
"Html",
"."
] | a2a33dfa73933875f9c1dd0691b21e678a541a9e | https://github.com/glynnforrest/reform/blob/a2a33dfa73933875f9c1dd0691b21e678a541a9e/src/Reform/Form/Form.php#L294-L300 |
238,846 | glynnforrest/reform | src/Reform/Form/Form.php | Form.render | public function render(RendererInterface $renderer = null)
{
$renderer = $renderer ?: $this->getDefaultRenderer();
$form = $this->header();
foreach ($this->rows as $row) {
$form .= $row->render($renderer);
}
$form .= '</form>';
return $form;
} | php | public function render(RendererInterface $renderer = null)
{
$renderer = $renderer ?: $this->getDefaultRenderer();
$form = $this->header();
foreach ($this->rows as $row) {
$form .= $row->render($renderer);
}
$form .= '</form>';
return $form;
} | [
"public",
"function",
"render",
"(",
"RendererInterface",
"$",
"renderer",
"=",
"null",
")",
"{",
"$",
"renderer",
"=",
"$",
"renderer",
"?",
":",
"$",
"this",
"->",
"getDefaultRenderer",
"(",
")",
";",
"$",
"form",
"=",
"$",
"this",
"->",
"header",
"(... | Render the entire Form. | [
"Render",
"the",
"entire",
"Form",
"."
] | a2a33dfa73933875f9c1dd0691b21e678a541a9e | https://github.com/glynnforrest/reform/blob/a2a33dfa73933875f9c1dd0691b21e678a541a9e/src/Reform/Form/Form.php#L305-L315 |
238,847 | glynnforrest/reform | src/Reform/Form/Form.php | Form.row | public function row($name, RendererInterface $renderer = null)
{
$renderer = $renderer ?: $this->getDefaultRenderer();
return $this->getRow($name)->render($renderer);
} | php | public function row($name, RendererInterface $renderer = null)
{
$renderer = $renderer ?: $this->getDefaultRenderer();
return $this->getRow($name)->render($renderer);
} | [
"public",
"function",
"row",
"(",
"$",
"name",
",",
"RendererInterface",
"$",
"renderer",
"=",
"null",
")",
"{",
"$",
"renderer",
"=",
"$",
"renderer",
"?",
":",
"$",
"this",
"->",
"getDefaultRenderer",
"(",
")",
";",
"return",
"$",
"this",
"->",
"getR... | Render a row. If no renderer is supplied, the default renderer on this
form will be used.
@param string $name The name of the row
@param RendererInterface $renderer The renderer to use | [
"Render",
"a",
"row",
".",
"If",
"no",
"renderer",
"is",
"supplied",
"the",
"default",
"renderer",
"on",
"this",
"form",
"will",
"be",
"used",
"."
] | a2a33dfa73933875f9c1dd0691b21e678a541a9e | https://github.com/glynnforrest/reform/blob/a2a33dfa73933875f9c1dd0691b21e678a541a9e/src/Reform/Form/Form.php#L324-L329 |
238,848 | glynnforrest/reform | src/Reform/Form/Form.php | Form.input | public function input($name, RendererInterface $renderer = null)
{
$renderer = $renderer ?: $this->getDefaultRenderer();
return $this->getRow($name)->input($renderer);
} | php | public function input($name, RendererInterface $renderer = null)
{
$renderer = $renderer ?: $this->getDefaultRenderer();
return $this->getRow($name)->input($renderer);
} | [
"public",
"function",
"input",
"(",
"$",
"name",
",",
"RendererInterface",
"$",
"renderer",
"=",
"null",
")",
"{",
"$",
"renderer",
"=",
"$",
"renderer",
"?",
":",
"$",
"this",
"->",
"getDefaultRenderer",
"(",
")",
";",
"return",
"$",
"this",
"->",
"ge... | Render the input of a row. If no renderer is supplied, the default
renderer on this form will be used.
@param string $name The name of the row
@param RendererInterface $renderer The renderer to use | [
"Render",
"the",
"input",
"of",
"a",
"row",
".",
"If",
"no",
"renderer",
"is",
"supplied",
"the",
"default",
"renderer",
"on",
"this",
"form",
"will",
"be",
"used",
"."
] | a2a33dfa73933875f9c1dd0691b21e678a541a9e | https://github.com/glynnforrest/reform/blob/a2a33dfa73933875f9c1dd0691b21e678a541a9e/src/Reform/Form/Form.php#L338-L343 |
238,849 | glynnforrest/reform | src/Reform/Form/Form.php | Form.setValues | public function setValues(array $values = array(), $ignore_unknown = false)
{
foreach ($values as $name => $value) {
try {
$this->getRow($name)->setValue($value);
} catch (\InvalidArgumentException $e) {
if (!$ignore_unknown) {
thro... | php | public function setValues(array $values = array(), $ignore_unknown = false)
{
foreach ($values as $name => $value) {
try {
$this->getRow($name)->setValue($value);
} catch (\InvalidArgumentException $e) {
if (!$ignore_unknown) {
thro... | [
"public",
"function",
"setValues",
"(",
"array",
"$",
"values",
"=",
"array",
"(",
")",
",",
"$",
"ignore_unknown",
"=",
"false",
")",
"{",
"foreach",
"(",
"$",
"values",
"as",
"$",
"name",
"=>",
"$",
"value",
")",
"{",
"try",
"{",
"$",
"this",
"->... | Set the value of multiple rows.
@param array $values The array of values
@param bool $ignore_unknown Whether to ignore any unknown form rows | [
"Set",
"the",
"value",
"of",
"multiple",
"rows",
"."
] | a2a33dfa73933875f9c1dd0691b21e678a541a9e | https://github.com/glynnforrest/reform/blob/a2a33dfa73933875f9c1dd0691b21e678a541a9e/src/Reform/Form/Form.php#L425-L438 |
238,850 | glynnforrest/reform | src/Reform/Form/Form.php | Form.getValues | public function getValues()
{
$values = array();
foreach ($this->rows as $name => $row) {
$values[$name] = $row->getValue();
}
return $values;
} | php | public function getValues()
{
$values = array();
foreach ($this->rows as $name => $row) {
$values[$name] = $row->getValue();
}
return $values;
} | [
"public",
"function",
"getValues",
"(",
")",
"{",
"$",
"values",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"rows",
"as",
"$",
"name",
"=>",
"$",
"row",
")",
"{",
"$",
"values",
"[",
"$",
"name",
"]",
"=",
"$",
"row",
"->",... | Get the values of all rows. | [
"Get",
"the",
"values",
"of",
"all",
"rows",
"."
] | a2a33dfa73933875f9c1dd0691b21e678a541a9e | https://github.com/glynnforrest/reform/blob/a2a33dfa73933875f9c1dd0691b21e678a541a9e/src/Reform/Form/Form.php#L455-L463 |
238,851 | glynnforrest/reform | src/Reform/Form/Form.php | Form.buildValidator | public function buildValidator()
{
if ($this->validator_built) {
return $this->validator;
}
foreach ($this->rows as $name => $row) {
foreach ($row->getRules() as $rule) {
$this->validator->addRule($name, $rule);
}
$row->disable... | php | public function buildValidator()
{
if ($this->validator_built) {
return $this->validator;
}
foreach ($this->rows as $name => $row) {
foreach ($row->getRules() as $rule) {
$this->validator->addRule($name, $rule);
}
$row->disable... | [
"public",
"function",
"buildValidator",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"validator_built",
")",
"{",
"return",
"$",
"this",
"->",
"validator",
";",
"}",
"foreach",
"(",
"$",
"this",
"->",
"rows",
"as",
"$",
"name",
"=>",
"$",
"row",
")",... | Add the rules from all rows to form a complete Validator for
this form. The Validator can only be built once - no additional
rules may be added after building. | [
"Add",
"the",
"rules",
"from",
"all",
"rows",
"to",
"form",
"a",
"complete",
"Validator",
"for",
"this",
"form",
".",
"The",
"Validator",
"can",
"only",
"be",
"built",
"once",
"-",
"no",
"additional",
"rules",
"may",
"be",
"added",
"after",
"building",
"... | a2a33dfa73933875f9c1dd0691b21e678a541a9e | https://github.com/glynnforrest/reform/blob/a2a33dfa73933875f9c1dd0691b21e678a541a9e/src/Reform/Form/Form.php#L514-L529 |
238,852 | glynnforrest/reform | src/Reform/Form/Form.php | Form.flattenArray | protected function flattenArray(array $values, $previous = '')
{
$result = array();
foreach ($values as $key => $value) {
if ($previous) {
$key = $previous.'['.$key.']';
}
if (is_array($value)) {
$result = $result + $this->flattenAr... | php | protected function flattenArray(array $values, $previous = '')
{
$result = array();
foreach ($values as $key => $value) {
if ($previous) {
$key = $previous.'['.$key.']';
}
if (is_array($value)) {
$result = $result + $this->flattenAr... | [
"protected",
"function",
"flattenArray",
"(",
"array",
"$",
"values",
",",
"$",
"previous",
"=",
"''",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"values",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
... | Flatten a multidimensional array into a one-dimensional array, using
square brackets to show the structure of the original array. | [
"Flatten",
"a",
"multidimensional",
"array",
"into",
"a",
"one",
"-",
"dimensional",
"array",
"using",
"square",
"brackets",
"to",
"show",
"the",
"structure",
"of",
"the",
"original",
"array",
"."
] | a2a33dfa73933875f9c1dd0691b21e678a541a9e | https://github.com/glynnforrest/reform/blob/a2a33dfa73933875f9c1dd0691b21e678a541a9e/src/Reform/Form/Form.php#L535-L550 |
238,853 | cityware/city-monitoring | src/Jobs/Services/Snmp/PhpFpm.php | PhpFpm.getServiceData | public function getServiceData($snmpConnection) {
$phpFpmData = $snmpConnection->realWalkToArray('NET-SNMP-EXTEND-MIB::nsExtendOutLine."Php-Fpm"', true);
$return = Array();
$return['num_listen_queue'] = $phpFpmData[1];
$return['num_accepted_connections'] = $phpFpmData[... | php | public function getServiceData($snmpConnection) {
$phpFpmData = $snmpConnection->realWalkToArray('NET-SNMP-EXTEND-MIB::nsExtendOutLine."Php-Fpm"', true);
$return = Array();
$return['num_listen_queue'] = $phpFpmData[1];
$return['num_accepted_connections'] = $phpFpmData[... | [
"public",
"function",
"getServiceData",
"(",
"$",
"snmpConnection",
")",
"{",
"$",
"phpFpmData",
"=",
"$",
"snmpConnection",
"->",
"realWalkToArray",
"(",
"'NET-SNMP-EXTEND-MIB::nsExtendOutLine.\"Php-Fpm\"'",
",",
"true",
")",
";",
"$",
"return",
"=",
"Array",
"(",
... | Return PHP-FPM service Data
@param object $snmpConnection
@return array | [
"Return",
"PHP",
"-",
"FPM",
"service",
"Data"
] | 0eb4e7ade7e2028093109856e67a317743b2e048 | https://github.com/cityware/city-monitoring/blob/0eb4e7ade7e2028093109856e67a317743b2e048/src/Jobs/Services/Snmp/PhpFpm.php#L23-L45 |
238,854 | Silvestra/Silvestra | src/Silvestra/Component/Banner/Form/Factory/BannerFormFactory.php | BannerFormFactory.create | public function create(BannerInterface $banner)
{
return $this->formFactory->create(
'silvestra_banner',
$banner,
array('action' => $this->router->getContext()->getPathInfo())
);
} | php | public function create(BannerInterface $banner)
{
return $this->formFactory->create(
'silvestra_banner',
$banner,
array('action' => $this->router->getContext()->getPathInfo())
);
} | [
"public",
"function",
"create",
"(",
"BannerInterface",
"$",
"banner",
")",
"{",
"return",
"$",
"this",
"->",
"formFactory",
"->",
"create",
"(",
"'silvestra_banner'",
",",
"$",
"banner",
",",
"array",
"(",
"'action'",
"=>",
"$",
"this",
"->",
"router",
"-... | Create banner form.
@param BannerInterface $banner
@return FormInterface | [
"Create",
"banner",
"form",
"."
] | b7367601b01495ae3c492b42042f804dee13ab06 | https://github.com/Silvestra/Silvestra/blob/b7367601b01495ae3c492b42042f804dee13ab06/src/Silvestra/Component/Banner/Form/Factory/BannerFormFactory.php#L55-L62 |
238,855 | jelix/BuildTools | lib/Cli/Environment.php | Environment.init | public static function init($build_options)
{
self::$variables_def = $build_options;
foreach ($build_options as $name => $def) {
// if there isn't a defined default value,
// let's defining an empty string as default value
if (!isset($def[1])) {
s... | php | public static function init($build_options)
{
self::$variables_def = $build_options;
foreach ($build_options as $name => $def) {
// if there isn't a defined default value,
// let's defining an empty string as default value
if (!isset($def[1])) {
s... | [
"public",
"static",
"function",
"init",
"(",
"$",
"build_options",
")",
"{",
"self",
"::",
"$",
"variables_def",
"=",
"$",
"build_options",
";",
"foreach",
"(",
"$",
"build_options",
"as",
"$",
"name",
"=>",
"$",
"def",
")",
"{",
"// if there isn't a defined... | init the globals variables, by reading the given
array which describes all this variables.
each build options item should be an array
0: help (or false for hidden options)
1: the default value (string)
2: a preg expression to verify the given value
or
1: a boolean, which indicates that the option is a boolean value
th... | [
"init",
"the",
"globals",
"variables",
"by",
"reading",
"the",
"given",
"array",
"which",
"describes",
"all",
"this",
"variables",
"."
] | 432050708c72107f959614f53696384aa92b9e1b | https://github.com/jelix/BuildTools/blob/432050708c72107f959614f53696384aa92b9e1b/lib/Cli/Environment.php#L39-L56 |
238,856 | stubbles/stubbles-values | src/main/php/Value.php | Value.isEmpty | public function isEmpty(): bool
{
return $this->isNull()
|| (is_array($this->value) && count($this->value) === 0)
|| (is_string($this->value) && strlen($this->value) === 0);
} | php | public function isEmpty(): bool
{
return $this->isNull()
|| (is_array($this->value) && count($this->value) === 0)
|| (is_string($this->value) && strlen($this->value) === 0);
} | [
"public",
"function",
"isEmpty",
"(",
")",
":",
"bool",
"{",
"return",
"$",
"this",
"->",
"isNull",
"(",
")",
"||",
"(",
"is_array",
"(",
"$",
"this",
"->",
"value",
")",
"&&",
"count",
"(",
"$",
"this",
"->",
"value",
")",
"===",
"0",
")",
"||",... | checks if value is empty
Value is empty if its value is null, an empty string or an empty array.
@return bool
@since 8.1.0 | [
"checks",
"if",
"value",
"is",
"empty"
] | 505e016715f7d7f96e180f2e8a1d711a12a3c4c2 | https://github.com/stubbles/stubbles-values/blob/505e016715f7d7f96e180f2e8a1d711a12a3c4c2/src/main/php/Value.php#L87-L92 |
238,857 | stubbles/stubbles-values | src/main/php/Value.php | Value.containsAnyOf | public function containsAnyOf(array $elements): bool
{
if (!is_scalar($this->value) || null === $this->value) {
return false;
}
foreach ($elements as $needle) {
if (is_bool($needle) && $this->value === $needle) {
return true;
} elseif (!is... | php | public function containsAnyOf(array $elements): bool
{
if (!is_scalar($this->value) || null === $this->value) {
return false;
}
foreach ($elements as $needle) {
if (is_bool($needle) && $this->value === $needle) {
return true;
} elseif (!is... | [
"public",
"function",
"containsAnyOf",
"(",
"array",
"$",
"elements",
")",
":",
"bool",
"{",
"if",
"(",
"!",
"is_scalar",
"(",
"$",
"this",
"->",
"value",
")",
"||",
"null",
"===",
"$",
"this",
"->",
"value",
")",
"{",
"return",
"false",
";",
"}",
... | checks that value contains any of the given elements
@param array $elements
@return bool | [
"checks",
"that",
"value",
"contains",
"any",
"of",
"the",
"given",
"elements"
] | 505e016715f7d7f96e180f2e8a1d711a12a3c4c2 | https://github.com/stubbles/stubbles-values/blob/505e016715f7d7f96e180f2e8a1d711a12a3c4c2/src/main/php/Value.php#L139-L154 |
238,858 | stubbles/stubbles-values | src/main/php/Value.php | Value.isOneOf | public function isOneOf(array $allowedValues, bool $strict = false): bool
{
if (!is_array($this->value)) {
return in_array($this->value, $allowedValues, $strict);
}
foreach ($this->value as $value) {
if (!in_array($value, $allowedValues, $strict)) {
r... | php | public function isOneOf(array $allowedValues, bool $strict = false): bool
{
if (!is_array($this->value)) {
return in_array($this->value, $allowedValues, $strict);
}
foreach ($this->value as $value) {
if (!in_array($value, $allowedValues, $strict)) {
r... | [
"public",
"function",
"isOneOf",
"(",
"array",
"$",
"allowedValues",
",",
"bool",
"$",
"strict",
"=",
"false",
")",
":",
"bool",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"this",
"->",
"value",
")",
")",
"{",
"return",
"in_array",
"(",
"$",
"this",
... | checks that value is one of the allowed values
@param array $allowedValues
@param bool $strict optional whether type must match as well
@return bool | [
"checks",
"that",
"value",
"is",
"one",
"of",
"the",
"allowed",
"values"
] | 505e016715f7d7f96e180f2e8a1d711a12a3c4c2 | https://github.com/stubbles/stubbles-values/blob/505e016715f7d7f96e180f2e8a1d711a12a3c4c2/src/main/php/Value.php#L181-L194 |
238,859 | stubbles/stubbles-values | src/main/php/Value.php | Value.defineCheck | public static function defineCheck(string $method, callable $function)
{
if (function_exists($method)) {
throw new \InvalidArgumentException('Can not overwrite internal PHP function ' . $method . '().');
}
self::$checks[$method] = $function;
} | php | public static function defineCheck(string $method, callable $function)
{
if (function_exists($method)) {
throw new \InvalidArgumentException('Can not overwrite internal PHP function ' . $method . '().');
}
self::$checks[$method] = $function;
} | [
"public",
"static",
"function",
"defineCheck",
"(",
"string",
"$",
"method",
",",
"callable",
"$",
"function",
")",
"{",
"if",
"(",
"function_exists",
"(",
"$",
"method",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Can not overwrite... | adds a check method
The $method must be an allowed method name which can be called on an
instance of stubbles\values\Value. The given callable function must
accept the value to check as first parameter and any additional
parameters after that. It must either return true or false.
<code>
Value::addCheck('isHttpUri', [... | [
"adds",
"a",
"check",
"method"
] | 505e016715f7d7f96e180f2e8a1d711a12a3c4c2 | https://github.com/stubbles/stubbles-values/blob/505e016715f7d7f96e180f2e8a1d711a12a3c4c2/src/main/php/Value.php#L247-L254 |
238,860 | marando/phpSOFA | src/Marando/IAU/iauObl06.php | iauObl06.Obl06 | public static function Obl06($date1, $date2) {
$t;
$eps0;
/* Interval between fundamental date J2000.0 and given date (JC). */
$t = (($date1 - DJ00) + $date2) / DJC;
/* Mean obliquity. */
$eps0 = (84381.406 +
(-46.836769 +
( -0.0001831 +
( 0.00200340 +
... | php | public static function Obl06($date1, $date2) {
$t;
$eps0;
/* Interval between fundamental date J2000.0 and given date (JC). */
$t = (($date1 - DJ00) + $date2) / DJC;
/* Mean obliquity. */
$eps0 = (84381.406 +
(-46.836769 +
( -0.0001831 +
( 0.00200340 +
... | [
"public",
"static",
"function",
"Obl06",
"(",
"$",
"date1",
",",
"$",
"date2",
")",
"{",
"$",
"t",
";",
"$",
"eps0",
";",
"/* Interval between fundamental date J2000.0 and given date (JC). */",
"$",
"t",
"=",
"(",
"(",
"$",
"date1",
"-",
"DJ00",
")",
"+",
... | - - - - - - - - -
i a u O b l 0 6
- - - - - - - - -
Mean obliquity of the ecliptic, IAU 2006 precession model.
This function is part of the International Astronomical Union's
SOFA (Standards Of Fundamental Astronomy) software collection.
Status: canonical model.
Given:
date1,date2 double TT as a 2-part Julian D... | [
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"i",
"a",
"u",
"O",
"b",
"l",
"0",
"6",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-"
] | 757fa49fe335ae1210eaa7735473fd4388b13f07 | https://github.com/marando/phpSOFA/blob/757fa49fe335ae1210eaa7735473fd4388b13f07/src/Marando/IAU/iauObl06.php#L59-L75 |
238,861 | nwjeffm/nw-service-generator | src/Commands/MakeRepositoryCommand.php | MakeRepositoryCommand.createService | protected function createService($name)
{
$name = $this->configureName('service', $name);
if($this->serviceNameExists($name) === true) {
return $this->error('Service already exists');
}
$this->createServiceDirectory();
$this->createBaseServiceAbstract();
... | php | protected function createService($name)
{
$name = $this->configureName('service', $name);
if($this->serviceNameExists($name) === true) {
return $this->error('Service already exists');
}
$this->createServiceDirectory();
$this->createBaseServiceAbstract();
... | [
"protected",
"function",
"createService",
"(",
"$",
"name",
")",
"{",
"$",
"name",
"=",
"$",
"this",
"->",
"configureName",
"(",
"'service'",
",",
"$",
"name",
")",
";",
"if",
"(",
"$",
"this",
"->",
"serviceNameExists",
"(",
"$",
"name",
")",
"===",
... | Create the service
@param string $name
@return void | [
"Create",
"the",
"service"
] | 39125f0bdf5275edb429e032c1c1ae581765fedd | https://github.com/nwjeffm/nw-service-generator/blob/39125f0bdf5275edb429e032c1c1ae581765fedd/src/Commands/MakeRepositoryCommand.php#L90-L103 |
238,862 | nwjeffm/nw-service-generator | src/Commands/MakeRepositoryCommand.php | MakeRepositoryCommand.createBaseServiceAbstract | protected function createBaseServiceAbstract()
{
if( ! $this->files->exists($this->getServiceDirectory() . 'BaseServiceAbstract.php')) {
$stub = str_replace(
['{{ServiceDirectory}}'],
$this->getServiceDirectoryFromConfig(),
$this->files->get(__DIR_... | php | protected function createBaseServiceAbstract()
{
if( ! $this->files->exists($this->getServiceDirectory() . 'BaseServiceAbstract.php')) {
$stub = str_replace(
['{{ServiceDirectory}}'],
$this->getServiceDirectoryFromConfig(),
$this->files->get(__DIR_... | [
"protected",
"function",
"createBaseServiceAbstract",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"files",
"->",
"exists",
"(",
"$",
"this",
"->",
"getServiceDirectory",
"(",
")",
".",
"'BaseServiceAbstract.php'",
")",
")",
"{",
"$",
"stub",
"=",
"st... | Create base service abstract class file
@return void | [
"Create",
"base",
"service",
"abstract",
"class",
"file"
] | 39125f0bdf5275edb429e032c1c1ae581765fedd | https://github.com/nwjeffm/nw-service-generator/blob/39125f0bdf5275edb429e032c1c1ae581765fedd/src/Commands/MakeRepositoryCommand.php#L146-L157 |
238,863 | nwjeffm/nw-service-generator | src/Commands/MakeRepositoryCommand.php | MakeRepositoryCommand.createBaseInterfaceFile | protected function createBaseInterfaceFile()
{
if( ! $this->files->exists($this->getRepositoryDirectory() . 'BaseRepositoryInterface.php')) {
$stub = str_replace(
['{{Namespace}}'],
$this->getRepositoryDirectoryFromConfig(),
$this->files->get(__DIR... | php | protected function createBaseInterfaceFile()
{
if( ! $this->files->exists($this->getRepositoryDirectory() . 'BaseRepositoryInterface.php')) {
$stub = str_replace(
['{{Namespace}}'],
$this->getRepositoryDirectoryFromConfig(),
$this->files->get(__DIR... | [
"protected",
"function",
"createBaseInterfaceFile",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"files",
"->",
"exists",
"(",
"$",
"this",
"->",
"getRepositoryDirectory",
"(",
")",
".",
"'BaseRepositoryInterface.php'",
")",
")",
"{",
"$",
"stub",
"=",
... | Create base interface file
@return void | [
"Create",
"base",
"interface",
"file"
] | 39125f0bdf5275edb429e032c1c1ae581765fedd | https://github.com/nwjeffm/nw-service-generator/blob/39125f0bdf5275edb429e032c1c1ae581765fedd/src/Commands/MakeRepositoryCommand.php#L164-L175 |
238,864 | nwjeffm/nw-service-generator | src/Commands/MakeRepositoryCommand.php | MakeRepositoryCommand.createServiceFile | protected function createServiceFile($name, $with_interface)
{
$dir_option = rtrim(str_replace('/', '\\', $this->getDirOption()), '/\\');
$dir_option = $dir_option ? '\\' . $dir_option : '';
$classname = $this->configureName('service', $name);
if($with_interface === true) {
... | php | protected function createServiceFile($name, $with_interface)
{
$dir_option = rtrim(str_replace('/', '\\', $this->getDirOption()), '/\\');
$dir_option = $dir_option ? '\\' . $dir_option : '';
$classname = $this->configureName('service', $name);
if($with_interface === true) {
... | [
"protected",
"function",
"createServiceFile",
"(",
"$",
"name",
",",
"$",
"with_interface",
")",
"{",
"$",
"dir_option",
"=",
"rtrim",
"(",
"str_replace",
"(",
"'/'",
",",
"'\\\\'",
",",
"$",
"this",
"->",
"getDirOption",
"(",
")",
")",
",",
"'/\\\\'",
"... | Create the service class file
@return void | [
"Create",
"the",
"service",
"class",
"file"
] | 39125f0bdf5275edb429e032c1c1ae581765fedd | https://github.com/nwjeffm/nw-service-generator/blob/39125f0bdf5275edb429e032c1c1ae581765fedd/src/Commands/MakeRepositoryCommand.php#L182-L207 |
238,865 | nwjeffm/nw-service-generator | src/Commands/MakeRepositoryCommand.php | MakeRepositoryCommand.createInterfaceFile | protected function createInterfaceFile($interface)
{
$dir_option = rtrim(str_replace('/', '\\', $this->getDirOption()), '/\\');
$dir_option = $dir_option ? '\\' . $dir_option : '';
$interface = $this->configureName('repository', $interface);
dd($interface);
$stub = str_repla... | php | protected function createInterfaceFile($interface)
{
$dir_option = rtrim(str_replace('/', '\\', $this->getDirOption()), '/\\');
$dir_option = $dir_option ? '\\' . $dir_option : '';
$interface = $this->configureName('repository', $interface);
dd($interface);
$stub = str_repla... | [
"protected",
"function",
"createInterfaceFile",
"(",
"$",
"interface",
")",
"{",
"$",
"dir_option",
"=",
"rtrim",
"(",
"str_replace",
"(",
"'/'",
",",
"'\\\\'",
",",
"$",
"this",
"->",
"getDirOption",
"(",
")",
")",
",",
"'/\\\\'",
")",
";",
"$",
"dir_op... | Create the interface file
@param string $interface
@return void | [
"Create",
"the",
"interface",
"file"
] | 39125f0bdf5275edb429e032c1c1ae581765fedd | https://github.com/nwjeffm/nw-service-generator/blob/39125f0bdf5275edb429e032c1c1ae581765fedd/src/Commands/MakeRepositoryCommand.php#L215-L229 |
238,866 | nwjeffm/nw-service-generator | src/Commands/MakeRepositoryCommand.php | MakeRepositoryCommand.createTraitFile | protected function createTraitFile($trait)
{
$dir_option = rtrim(str_replace('/', '\\', $this->getDirOption()), '/\\');
$dir_option = $dir_option ? '\\' . $dir_option : '';
$trait = $this->configureName('trait', $trait);
$stub = str_replace(
['{{Namespace}}', '{{TraitNam... | php | protected function createTraitFile($trait)
{
$dir_option = rtrim(str_replace('/', '\\', $this->getDirOption()), '/\\');
$dir_option = $dir_option ? '\\' . $dir_option : '';
$trait = $this->configureName('trait', $trait);
$stub = str_replace(
['{{Namespace}}', '{{TraitNam... | [
"protected",
"function",
"createTraitFile",
"(",
"$",
"trait",
")",
"{",
"$",
"dir_option",
"=",
"rtrim",
"(",
"str_replace",
"(",
"'/'",
",",
"'\\\\'",
",",
"$",
"this",
"->",
"getDirOption",
"(",
")",
")",
",",
"'/\\\\'",
")",
";",
"$",
"dir_option",
... | Create the trait file
@param string $trait
@return void | [
"Create",
"the",
"trait",
"file"
] | 39125f0bdf5275edb429e032c1c1ae581765fedd | https://github.com/nwjeffm/nw-service-generator/blob/39125f0bdf5275edb429e032c1c1ae581765fedd/src/Commands/MakeRepositoryCommand.php#L237-L250 |
238,867 | nwjeffm/nw-service-generator | src/Commands/MakeRepositoryCommand.php | MakeRepositoryCommand.serviceNameExists | protected function serviceNameExists($name)
{
if($this->files->exists($this->getServiceDirectory() . $this->getDirOption() . $name . '.php')) {
return true;
}
return false;
} | php | protected function serviceNameExists($name)
{
if($this->files->exists($this->getServiceDirectory() . $this->getDirOption() . $name . '.php')) {
return true;
}
return false;
} | [
"protected",
"function",
"serviceNameExists",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"files",
"->",
"exists",
"(",
"$",
"this",
"->",
"getServiceDirectory",
"(",
")",
".",
"$",
"this",
"->",
"getDirOption",
"(",
")",
".",
"$",
"name"... | Validate if service already exists
@param string $name
@return bool | [
"Validate",
"if",
"service",
"already",
"exists"
] | 39125f0bdf5275edb429e032c1c1ae581765fedd | https://github.com/nwjeffm/nw-service-generator/blob/39125f0bdf5275edb429e032c1c1ae581765fedd/src/Commands/MakeRepositoryCommand.php#L258-L265 |
238,868 | nwjeffm/nw-service-generator | src/Commands/MakeRepositoryCommand.php | MakeRepositoryCommand.repositoryNameExists | protected function repositoryNameExists($interface)
{
if($this->files->exists($this->getRepositoryDirectory() . $this->getDirOption() . $interface . 'php')) {
return true;
}
return false;
} | php | protected function repositoryNameExists($interface)
{
if($this->files->exists($this->getRepositoryDirectory() . $this->getDirOption() . $interface . 'php')) {
return true;
}
return false;
} | [
"protected",
"function",
"repositoryNameExists",
"(",
"$",
"interface",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"files",
"->",
"exists",
"(",
"$",
"this",
"->",
"getRepositoryDirectory",
"(",
")",
".",
"$",
"this",
"->",
"getDirOption",
"(",
")",
".",
"$... | Validate if repository interface already exists
@param string $interface
@return bool | [
"Validate",
"if",
"repository",
"interface",
"already",
"exists"
] | 39125f0bdf5275edb429e032c1c1ae581765fedd | https://github.com/nwjeffm/nw-service-generator/blob/39125f0bdf5275edb429e032c1c1ae581765fedd/src/Commands/MakeRepositoryCommand.php#L273-L280 |
238,869 | nwjeffm/nw-service-generator | src/Commands/MakeRepositoryCommand.php | MakeRepositoryCommand.traitNameExists | protected function traitNameExists($trait)
{
if($this->files->exists($this->getTraitDirectory() . $this->getDirOption() . $trait . '.php')) {
return true;
}
return false;
} | php | protected function traitNameExists($trait)
{
if($this->files->exists($this->getTraitDirectory() . $this->getDirOption() . $trait . '.php')) {
return true;
}
return false;
} | [
"protected",
"function",
"traitNameExists",
"(",
"$",
"trait",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"files",
"->",
"exists",
"(",
"$",
"this",
"->",
"getTraitDirectory",
"(",
")",
".",
"$",
"this",
"->",
"getDirOption",
"(",
")",
".",
"$",
"trait",
... | Validate if trait already exists
@param string $trait
@return bool | [
"Validate",
"if",
"trait",
"already",
"exists"
] | 39125f0bdf5275edb429e032c1c1ae581765fedd | https://github.com/nwjeffm/nw-service-generator/blob/39125f0bdf5275edb429e032c1c1ae581765fedd/src/Commands/MakeRepositoryCommand.php#L288-L295 |
238,870 | nwjeffm/nw-service-generator | src/Commands/MakeRepositoryCommand.php | MakeRepositoryCommand.getServiceDirectory | protected function getServiceDirectory()
{
if($config = $this->configFileMissing()) {
return $this->error($config);
}
return 'app/' . rtrim($this->getConfigServiceDirectory(), '/\\') . '/';
} | php | protected function getServiceDirectory()
{
if($config = $this->configFileMissing()) {
return $this->error($config);
}
return 'app/' . rtrim($this->getConfigServiceDirectory(), '/\\') . '/';
} | [
"protected",
"function",
"getServiceDirectory",
"(",
")",
"{",
"if",
"(",
"$",
"config",
"=",
"$",
"this",
"->",
"configFileMissing",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"error",
"(",
"$",
"config",
")",
";",
"}",
"return",
"'app/'",
".",
... | Return the full service directory
@return string | [
"Return",
"the",
"full",
"service",
"directory"
] | 39125f0bdf5275edb429e032c1c1ae581765fedd | https://github.com/nwjeffm/nw-service-generator/blob/39125f0bdf5275edb429e032c1c1ae581765fedd/src/Commands/MakeRepositoryCommand.php#L302-L309 |
238,871 | nwjeffm/nw-service-generator | src/Commands/MakeRepositoryCommand.php | MakeRepositoryCommand.getRepositoryDirectory | protected function getRepositoryDirectory()
{
if($config = $this->configFileMissing()) {
return $this->error($config);
}
return 'app/' . rtrim($this->getConfigRepositoryDirectory(), '/\\') . '/';
} | php | protected function getRepositoryDirectory()
{
if($config = $this->configFileMissing()) {
return $this->error($config);
}
return 'app/' . rtrim($this->getConfigRepositoryDirectory(), '/\\') . '/';
} | [
"protected",
"function",
"getRepositoryDirectory",
"(",
")",
"{",
"if",
"(",
"$",
"config",
"=",
"$",
"this",
"->",
"configFileMissing",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"error",
"(",
"$",
"config",
")",
";",
"}",
"return",
"'app/'",
".... | Return the full repository directory
@return string | [
"Return",
"the",
"full",
"repository",
"directory"
] | 39125f0bdf5275edb429e032c1c1ae581765fedd | https://github.com/nwjeffm/nw-service-generator/blob/39125f0bdf5275edb429e032c1c1ae581765fedd/src/Commands/MakeRepositoryCommand.php#L316-L323 |
238,872 | nwjeffm/nw-service-generator | src/Commands/MakeRepositoryCommand.php | MakeRepositoryCommand.getTraitDirectory | protected function getTraitDirectory()
{
if($config = $this->configFileMissing()) {
return $this->error($config);
}
return 'app/' . rtrim($this->getConfigTraitDirectory(), '/\\') . '/';
} | php | protected function getTraitDirectory()
{
if($config = $this->configFileMissing()) {
return $this->error($config);
}
return 'app/' . rtrim($this->getConfigTraitDirectory(), '/\\') . '/';
} | [
"protected",
"function",
"getTraitDirectory",
"(",
")",
"{",
"if",
"(",
"$",
"config",
"=",
"$",
"this",
"->",
"configFileMissing",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"error",
"(",
"$",
"config",
")",
";",
"}",
"return",
"'app/'",
".",
... | Return the full trait directory
@return string | [
"Return",
"the",
"full",
"trait",
"directory"
] | 39125f0bdf5275edb429e032c1c1ae581765fedd | https://github.com/nwjeffm/nw-service-generator/blob/39125f0bdf5275edb429e032c1c1ae581765fedd/src/Commands/MakeRepositoryCommand.php#L330-L337 |
238,873 | nwjeffm/nw-service-generator | src/Commands/MakeRepositoryCommand.php | MakeRepositoryCommand.getDirOption | protected function getDirOption($return_array = false)
{
if($dir = $this->option('dir')) {
$directories = explode('/', $dir);
if(is_array($directories) && $directories) {
$directories = array_map(function($directory) {
return ucfirst(str::plural(st... | php | protected function getDirOption($return_array = false)
{
if($dir = $this->option('dir')) {
$directories = explode('/', $dir);
if(is_array($directories) && $directories) {
$directories = array_map(function($directory) {
return ucfirst(str::plural(st... | [
"protected",
"function",
"getDirOption",
"(",
"$",
"return_array",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"dir",
"=",
"$",
"this",
"->",
"option",
"(",
"'dir'",
")",
")",
"{",
"$",
"directories",
"=",
"explode",
"(",
"'/'",
",",
"$",
"dir",
")",
"... | Return the directory option
@return string|null | [
"Return",
"the",
"directory",
"option"
] | 39125f0bdf5275edb429e032c1c1ae581765fedd | https://github.com/nwjeffm/nw-service-generator/blob/39125f0bdf5275edb429e032c1c1ae581765fedd/src/Commands/MakeRepositoryCommand.php#L374-L386 |
238,874 | nwjeffm/nw-service-generator | src/Commands/MakeRepositoryCommand.php | MakeRepositoryCommand.configureName | protected function configureName($type, $name)
{
$config = $this->laravel['config']['repository'];
if($config["{$type}_to_plural"] === true) {
$name = Str::plural($name);
}
if($config["case_sensitive"] === false) {
$name = Str::studly(strtolower($name));
... | php | protected function configureName($type, $name)
{
$config = $this->laravel['config']['repository'];
if($config["{$type}_to_plural"] === true) {
$name = Str::plural($name);
}
if($config["case_sensitive"] === false) {
$name = Str::studly(strtolower($name));
... | [
"protected",
"function",
"configureName",
"(",
"$",
"type",
",",
"$",
"name",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"laravel",
"[",
"'config'",
"]",
"[",
"'repository'",
"]",
";",
"if",
"(",
"$",
"config",
"[",
"\"{$type}_to_plural\"",
"]",
... | Configure the name according to user preferred settings
@param string $type
@param string $name
@return string | [
"Configure",
"the",
"name",
"according",
"to",
"user",
"preferred",
"settings"
] | 39125f0bdf5275edb429e032c1c1ae581765fedd | https://github.com/nwjeffm/nw-service-generator/blob/39125f0bdf5275edb429e032c1c1ae581765fedd/src/Commands/MakeRepositoryCommand.php#L407-L420 |
238,875 | nwjeffm/nw-service-generator | src/Commands/MakeRepositoryCommand.php | MakeRepositoryCommand.createTraitDirectory | protected function createTraitDirectory()
{
if( ! $this->files->isDirectory($this->getTraitDirectory())) {
$this->files->makeDirectory($this->getTraitDirectory());
}
$this->createDirectory('trait');
} | php | protected function createTraitDirectory()
{
if( ! $this->files->isDirectory($this->getTraitDirectory())) {
$this->files->makeDirectory($this->getTraitDirectory());
}
$this->createDirectory('trait');
} | [
"protected",
"function",
"createTraitDirectory",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"files",
"->",
"isDirectory",
"(",
"$",
"this",
"->",
"getTraitDirectory",
"(",
")",
")",
")",
"{",
"$",
"this",
"->",
"files",
"->",
"makeDirectory",
"(",... | Create trait directory
@return void | [
"Create",
"trait",
"directory"
] | 39125f0bdf5275edb429e032c1c1ae581765fedd | https://github.com/nwjeffm/nw-service-generator/blob/39125f0bdf5275edb429e032c1c1ae581765fedd/src/Commands/MakeRepositoryCommand.php#L427-L434 |
238,876 | nwjeffm/nw-service-generator | src/Commands/MakeRepositoryCommand.php | MakeRepositoryCommand.createInterfaceDirectory | protected function createInterfaceDirectory()
{
if( ! $this->files->isDirectory($this->getRepositoryDirectory())) {
$this->files->makeDirectory($this->getRepositoryDirectory());
}
$this->createDirectory('repository');
} | php | protected function createInterfaceDirectory()
{
if( ! $this->files->isDirectory($this->getRepositoryDirectory())) {
$this->files->makeDirectory($this->getRepositoryDirectory());
}
$this->createDirectory('repository');
} | [
"protected",
"function",
"createInterfaceDirectory",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"files",
"->",
"isDirectory",
"(",
"$",
"this",
"->",
"getRepositoryDirectory",
"(",
")",
")",
")",
"{",
"$",
"this",
"->",
"files",
"->",
"makeDirectory... | Create interface directory
@return void | [
"Create",
"interface",
"directory"
] | 39125f0bdf5275edb429e032c1c1ae581765fedd | https://github.com/nwjeffm/nw-service-generator/blob/39125f0bdf5275edb429e032c1c1ae581765fedd/src/Commands/MakeRepositoryCommand.php#L441-L448 |
238,877 | nwjeffm/nw-service-generator | src/Commands/MakeRepositoryCommand.php | MakeRepositoryCommand.createServiceDirectory | protected function createServiceDirectory()
{
if( ! $this->files->isDirectory($this->getServiceDirectory())) {
$this->files->makeDirectory($this->getServiceDirectory());
}
$this->createDirectory('service');
} | php | protected function createServiceDirectory()
{
if( ! $this->files->isDirectory($this->getServiceDirectory())) {
$this->files->makeDirectory($this->getServiceDirectory());
}
$this->createDirectory('service');
} | [
"protected",
"function",
"createServiceDirectory",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"files",
"->",
"isDirectory",
"(",
"$",
"this",
"->",
"getServiceDirectory",
"(",
")",
")",
")",
"{",
"$",
"this",
"->",
"files",
"->",
"makeDirectory",
... | Create service directory
@return void | [
"Create",
"service",
"directory"
] | 39125f0bdf5275edb429e032c1c1ae581765fedd | https://github.com/nwjeffm/nw-service-generator/blob/39125f0bdf5275edb429e032c1c1ae581765fedd/src/Commands/MakeRepositoryCommand.php#L455-L462 |
238,878 | Xannn94/support | src/Bases/RouteRegister.php | RouteRegister.getAttributes | protected function getAttributes(array $merge = [])
{
return array_merge([
'prefix' => $this->prefix,
'as' => $this->routeName,
'middleware' => $this->middlewares,
'namespace' => $this->namespace,
], $merge);
} | php | protected function getAttributes(array $merge = [])
{
return array_merge([
'prefix' => $this->prefix,
'as' => $this->routeName,
'middleware' => $this->middlewares,
'namespace' => $this->namespace,
], $merge);
} | [
"protected",
"function",
"getAttributes",
"(",
"array",
"$",
"merge",
"=",
"[",
"]",
")",
"{",
"return",
"array_merge",
"(",
"[",
"'prefix'",
"=>",
"$",
"this",
"->",
"prefix",
",",
"'as'",
"=>",
"$",
"this",
"->",
"routeName",
",",
"'middleware'",
"=>",... | Get route attributes.
@param array $merge
@return array | [
"Get",
"route",
"attributes",
"."
] | 92f4da1b0d47b769af3c65cd1d672b68809262c8 | https://github.com/Xannn94/support/blob/92f4da1b0d47b769af3c65cd1d672b68809262c8/src/Bases/RouteRegister.php#L182-L190 |
238,879 | Xannn94/support | src/Bases/RouteRegister.php | RouteRegister.loadAttributes | protected function loadAttributes($key, array $default = [])
{
$attributes = config($key, $default);
if (isset($attributes['prefix']))
$this->addPrefix($attributes['prefix']);
if (isset($attributes['namespace']))
$this->setNamespace($attributes['namespace']);
... | php | protected function loadAttributes($key, array $default = [])
{
$attributes = config($key, $default);
if (isset($attributes['prefix']))
$this->addPrefix($attributes['prefix']);
if (isset($attributes['namespace']))
$this->setNamespace($attributes['namespace']);
... | [
"protected",
"function",
"loadAttributes",
"(",
"$",
"key",
",",
"array",
"$",
"default",
"=",
"[",
"]",
")",
"{",
"$",
"attributes",
"=",
"config",
"(",
"$",
"key",
",",
"$",
"default",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"attributes",
"[",
"'... | Load attributes from config file.
@param string $key
@param array $default | [
"Load",
"attributes",
"from",
"config",
"file",
"."
] | 92f4da1b0d47b769af3c65cd1d672b68809262c8 | https://github.com/Xannn94/support/blob/92f4da1b0d47b769af3c65cd1d672b68809262c8/src/Bases/RouteRegister.php#L223-L238 |
238,880 | docit/core | src/Http/Controllers/DocitController.php | DocitController.document | public function document($projectSlug, $ref = null, $path = '')
{
$project = $this->factory->getProject($projectSlug);
if (is_null($ref)) {
$ref = $project->getDefaultRef();
}
$project->setRef($ref);
$document = $project->getDocument($path);
$content ... | php | public function document($projectSlug, $ref = null, $path = '')
{
$project = $this->factory->getProject($projectSlug);
if (is_null($ref)) {
$ref = $project->getDefaultRef();
}
$project->setRef($ref);
$document = $project->getDocument($path);
$content ... | [
"public",
"function",
"document",
"(",
"$",
"projectSlug",
",",
"$",
"ref",
"=",
"null",
",",
"$",
"path",
"=",
"''",
")",
"{",
"$",
"project",
"=",
"$",
"this",
"->",
"factory",
"->",
"getProject",
"(",
"$",
"projectSlug",
")",
";",
"if",
"(",
"is... | Render the documentation page for the given project and version.
@param string $projectSlug
@param string|null $ref
@param string $path
@return $this | [
"Render",
"the",
"documentation",
"page",
"for",
"the",
"given",
"project",
"and",
"version",
"."
] | 448e1cdca18a8ffb6c08430cad8d22162171ac35 | https://github.com/docit/core/blob/448e1cdca18a8ffb6c08430cad8d22162171ac35/src/Http/Controllers/DocitController.php#L34-L51 |
238,881 | easy-system/es-http | src/Factory/InputFactory.php | InputFactory.setSource | public static function setSource($source = null)
{
if (! is_resource($source) && ! is_null($source)) {
throw new InvalidArgumentException(sprintf(
'Invalid source provided; must be a null or an resource, "%s" given.',
is_object($source) ? get_class($source) : gett... | php | public static function setSource($source = null)
{
if (! is_resource($source) && ! is_null($source)) {
throw new InvalidArgumentException(sprintf(
'Invalid source provided; must be a null or an resource, "%s" given.',
is_object($source) ? get_class($source) : gett... | [
"public",
"static",
"function",
"setSource",
"(",
"$",
"source",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_resource",
"(",
"$",
"source",
")",
"&&",
"!",
"is_null",
"(",
"$",
"source",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"s... | Sets data source.
@param null|resource $source
@throws \InvalidArgumentException If invalid source provided | [
"Sets",
"data",
"source",
"."
] | dd5852e94901e147a7546a8715133408ece767a1 | https://github.com/easy-system/es-http/blob/dd5852e94901e147a7546a8715133408ece767a1/src/Factory/InputFactory.php#L34-L43 |
238,882 | easy-system/es-http | src/Factory/InputFactory.php | InputFactory.make | public static function make()
{
$stream = new Stream();
$source = static::getSource();
$stream->copy($source);
if (! static::$source) {
fclose($source);
}
return $stream;
} | php | public static function make()
{
$stream = new Stream();
$source = static::getSource();
$stream->copy($source);
if (! static::$source) {
fclose($source);
}
return $stream;
} | [
"public",
"static",
"function",
"make",
"(",
")",
"{",
"$",
"stream",
"=",
"new",
"Stream",
"(",
")",
";",
"$",
"source",
"=",
"static",
"::",
"getSource",
"(",
")",
";",
"$",
"stream",
"->",
"copy",
"(",
"$",
"source",
")",
";",
"if",
"(",
"!",
... | Makes a stream and and fills it with input data.
@return \Es\Http\Stream The stream | [
"Makes",
"a",
"stream",
"and",
"and",
"fills",
"it",
"with",
"input",
"data",
"."
] | dd5852e94901e147a7546a8715133408ece767a1 | https://github.com/easy-system/es-http/blob/dd5852e94901e147a7546a8715133408ece767a1/src/Factory/InputFactory.php#L65-L76 |
238,883 | magdev/php-assimp | src/Command/Result.php | Result.getOutput | public function getOutput(string $glue = null)
{
if (!is_null($glue)) {
return implode($glue, $this->output);
}
return $this->output;
} | php | public function getOutput(string $glue = null)
{
if (!is_null($glue)) {
return implode($glue, $this->output);
}
return $this->output;
} | [
"public",
"function",
"getOutput",
"(",
"string",
"$",
"glue",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"glue",
")",
")",
"{",
"return",
"implode",
"(",
"$",
"glue",
",",
"$",
"this",
"->",
"output",
")",
";",
"}",
"return",
"$... | Get the full output array
@param string|null $glue
@return string|array | [
"Get",
"the",
"full",
"output",
"array"
] | 206e9c341f8be271a80fbeea7c32ec33b0f2fc90 | https://github.com/magdev/php-assimp/blob/206e9c341f8be271a80fbeea7c32ec33b0f2fc90/src/Command/Result.php#L171-L177 |
238,884 | magdev/php-assimp | src/Command/Result.php | Result.getOutputLine | public function getOutputLine(int $line): string
{
return array_key_exists($line, $this->output) ? $this->output[$line] : null;
} | php | public function getOutputLine(int $line): string
{
return array_key_exists($line, $this->output) ? $this->output[$line] : null;
} | [
"public",
"function",
"getOutputLine",
"(",
"int",
"$",
"line",
")",
":",
"string",
"{",
"return",
"array_key_exists",
"(",
"$",
"line",
",",
"$",
"this",
"->",
"output",
")",
"?",
"$",
"this",
"->",
"output",
"[",
"$",
"line",
"]",
":",
"null",
";",... | Get a specific line from the output array
@param int $line
@return string|null | [
"Get",
"a",
"specific",
"line",
"from",
"the",
"output",
"array"
] | 206e9c341f8be271a80fbeea7c32ec33b0f2fc90 | https://github.com/magdev/php-assimp/blob/206e9c341f8be271a80fbeea7c32ec33b0f2fc90/src/Command/Result.php#L186-L189 |
238,885 | magdev/php-assimp | src/Command/Result.php | Result.setParsed | public function setParsed(bool $parsed = true): Result
{
$this->parsed = (boolean) $parsed;
return $this;
} | php | public function setParsed(bool $parsed = true): Result
{
$this->parsed = (boolean) $parsed;
return $this;
} | [
"public",
"function",
"setParsed",
"(",
"bool",
"$",
"parsed",
"=",
"true",
")",
":",
"Result",
"{",
"$",
"this",
"->",
"parsed",
"=",
"(",
"boolean",
")",
"$",
"parsed",
";",
"return",
"$",
"this",
";",
"}"
] | Mark the output as parsed
@param boolean $parsed
@return \Assimp\Command\Result | [
"Mark",
"the",
"output",
"as",
"parsed"
] | 206e9c341f8be271a80fbeea7c32ec33b0f2fc90 | https://github.com/magdev/php-assimp/blob/206e9c341f8be271a80fbeea7c32ec33b0f2fc90/src/Command/Result.php#L271-L275 |
238,886 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/request.php | Request.forge | public static function forge($uri = null, $options = true, $method = null)
{
is_bool($options) and $options = array('route' => $options);
is_string($options) and $options = array('driver' => $options);
if ( ! empty($options['driver']))
{
$class = \Inflector::words_to_upper('Request_'.$options['driver']);
... | php | public static function forge($uri = null, $options = true, $method = null)
{
is_bool($options) and $options = array('route' => $options);
is_string($options) and $options = array('driver' => $options);
if ( ! empty($options['driver']))
{
$class = \Inflector::words_to_upper('Request_'.$options['driver']);
... | [
"public",
"static",
"function",
"forge",
"(",
"$",
"uri",
"=",
"null",
",",
"$",
"options",
"=",
"true",
",",
"$",
"method",
"=",
"null",
")",
"{",
"is_bool",
"(",
"$",
"options",
")",
"and",
"$",
"options",
"=",
"array",
"(",
"'route'",
"=>",
"$",... | Generates a new request. The request is then set to be the active
request. If this is the first request, then save that as the main
request for the app.
Usage:
Request::forge('hello/world');
@param string The URI of the request
@param mixed Internal: whether to use the routes; external: driver type or arr... | [
"Generates",
"a",
"new",
"request",
".",
"The",
"request",
"is",
"then",
"set",
"to",
"be",
"the",
"active",
"request",
".",
"If",
"this",
"is",
"the",
"first",
"request",
"then",
"save",
"that",
"as",
"the",
"main",
"request",
"for",
"the",
"app",
"."... | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/request.php#L59-L81 |
238,887 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/request.php | Request.reset_request | public static function reset_request($full = false)
{
// Let's make the previous Request active since we are done executing this one.
static::$active and static::$active = static::$active->parent();
if ($full)
{
static::$main = null;
}
} | php | public static function reset_request($full = false)
{
// Let's make the previous Request active since we are done executing this one.
static::$active and static::$active = static::$active->parent();
if ($full)
{
static::$main = null;
}
} | [
"public",
"static",
"function",
"reset_request",
"(",
"$",
"full",
"=",
"false",
")",
"{",
"// Let's make the previous Request active since we are done executing this one.",
"static",
"::",
"$",
"active",
"and",
"static",
"::",
"$",
"active",
"=",
"static",
"::",
"$",... | Reset's the active request with the previous one. This is needed after
the active request is finished.
Usage:
Request::reset_request();
@return void | [
"Reset",
"s",
"the",
"active",
"request",
"with",
"the",
"previous",
"one",
".",
"This",
"is",
"needed",
"after",
"the",
"active",
"request",
"is",
"finished",
"."
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/request.php#L146-L155 |
238,888 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/request.php | Request.param | public function param($param, $default = null)
{
if ( ! isset($this->named_params[$param]))
{
return \Fuel::value($default);
}
return $this->named_params[$param];
} | php | public function param($param, $default = null)
{
if ( ! isset($this->named_params[$param]))
{
return \Fuel::value($default);
}
return $this->named_params[$param];
} | [
"public",
"function",
"param",
"(",
"$",
"param",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"named_params",
"[",
"$",
"param",
"]",
")",
")",
"{",
"return",
"\\",
"Fuel",
"::",
"value",
"(",
"$",... | Gets a specific named parameter
@param string $param Name of the parameter
@param mixed $default Default value
@return mixed | [
"Gets",
"a",
"specific",
"named",
"parameter"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/request.php#L587-L595 |
238,889 | canis-io/yii2-canis-lib | lib/web/grid/Cell.php | Cell.getClasses | public function getClasses()
{
$classes = [];
$sizes = $this->sizes;
if (isset($sizes['phone'])) {
$classes[] = 'col-xs-' . $sizes['phone'];
}
if (isset($sizes['tablet'])) {
$classes[] = 'col-sm-' . $sizes['tablet'];
}
if (isset($sizes[... | php | public function getClasses()
{
$classes = [];
$sizes = $this->sizes;
if (isset($sizes['phone'])) {
$classes[] = 'col-xs-' . $sizes['phone'];
}
if (isset($sizes['tablet'])) {
$classes[] = 'col-sm-' . $sizes['tablet'];
}
if (isset($sizes[... | [
"public",
"function",
"getClasses",
"(",
")",
"{",
"$",
"classes",
"=",
"[",
"]",
";",
"$",
"sizes",
"=",
"$",
"this",
"->",
"sizes",
";",
"if",
"(",
"isset",
"(",
"$",
"sizes",
"[",
"'phone'",
"]",
")",
")",
"{",
"$",
"classes",
"[",
"]",
"=",... | Get classes.
@return [[@doctodo return_type:getClasses]] [[@doctodo return_description:getClasses]] | [
"Get",
"classes",
"."
] | 97d533521f65b084dc805c5f312c364b469142d2 | https://github.com/canis-io/yii2-canis-lib/blob/97d533521f65b084dc805c5f312c364b469142d2/lib/web/grid/Cell.php#L203-L221 |
238,890 | canis-io/yii2-canis-lib | lib/web/grid/Cell.php | Cell.getSizes | public function getSizes()
{
$sizes = [];
if ($this->phoneSize === 'auto') {
$sizes['phone'] = $this->generatePhoneSize();
} elseif ($this->phoneSize === true && $this->hasPhoneColumns) {
$sizes['phone'] = $this->phoneColumns;
}
if ($this->tabletSize =... | php | public function getSizes()
{
$sizes = [];
if ($this->phoneSize === 'auto') {
$sizes['phone'] = $this->generatePhoneSize();
} elseif ($this->phoneSize === true && $this->hasPhoneColumns) {
$sizes['phone'] = $this->phoneColumns;
}
if ($this->tabletSize =... | [
"public",
"function",
"getSizes",
"(",
")",
"{",
"$",
"sizes",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"this",
"->",
"phoneSize",
"===",
"'auto'",
")",
"{",
"$",
"sizes",
"[",
"'phone'",
"]",
"=",
"$",
"this",
"->",
"generatePhoneSize",
"(",
")",
";",
... | Get sizes.
@return [[@doctodo return_type:getSizes]] [[@doctodo return_description:getSizes]] | [
"Get",
"sizes",
"."
] | 97d533521f65b084dc805c5f312c364b469142d2 | https://github.com/canis-io/yii2-canis-lib/blob/97d533521f65b084dc805c5f312c364b469142d2/lib/web/grid/Cell.php#L228-L253 |
238,891 | canis-io/yii2-canis-lib | lib/web/grid/Cell.php | Cell.getMaxColumns | public function getMaxColumns($size = null)
{
if (is_object($this->content) && property_exists($this->content, 'maxColumns') && !is_null($this->content->maxColumns)) {
return $this->content->maxColumns;
}
if (is_null($size)) {
$size = $this->baseSize;
}
... | php | public function getMaxColumns($size = null)
{
if (is_object($this->content) && property_exists($this->content, 'maxColumns') && !is_null($this->content->maxColumns)) {
return $this->content->maxColumns;
}
if (is_null($size)) {
$size = $this->baseSize;
}
... | [
"public",
"function",
"getMaxColumns",
"(",
"$",
"size",
"=",
"null",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"this",
"->",
"content",
")",
"&&",
"property_exists",
"(",
"$",
"this",
"->",
"content",
",",
"'maxColumns'",
")",
"&&",
"!",
"is_null",
... | Get max columns.
@param [[@doctodo param_type:size]] $size [[@doctodo param_description:size]] [optional]
@return [[@doctodo return_type:getMaxColumns]] [[@doctodo return_description:getMaxColumns]] | [
"Get",
"max",
"columns",
"."
] | 97d533521f65b084dc805c5f312c364b469142d2 | https://github.com/canis-io/yii2-canis-lib/blob/97d533521f65b084dc805c5f312c364b469142d2/lib/web/grid/Cell.php#L318-L329 |
238,892 | canis-io/yii2-canis-lib | lib/web/grid/Cell.php | Cell.setMaxColumns | public function setMaxColumns($columns, $size = null)
{
if (is_null($size)) {
$size = $this->baseSize;
}
$columnAttribute = 'max' . ucfirst($size) . 'Columns';
$this->{$columnAttribute} = $columns;
} | php | public function setMaxColumns($columns, $size = null)
{
if (is_null($size)) {
$size = $this->baseSize;
}
$columnAttribute = 'max' . ucfirst($size) . 'Columns';
$this->{$columnAttribute} = $columns;
} | [
"public",
"function",
"setMaxColumns",
"(",
"$",
"columns",
",",
"$",
"size",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"size",
")",
")",
"{",
"$",
"size",
"=",
"$",
"this",
"->",
"baseSize",
";",
"}",
"$",
"columnAttribute",
"=",
"'ma... | Set max columns.
@param [[@doctodo param_type:columns]] $columns [[@doctodo param_description:columns]]
@param [[@doctodo param_type:size]] $size [[@doctodo param_description:size]] [optional] | [
"Set",
"max",
"columns",
"."
] | 97d533521f65b084dc805c5f312c364b469142d2 | https://github.com/canis-io/yii2-canis-lib/blob/97d533521f65b084dc805c5f312c364b469142d2/lib/web/grid/Cell.php#L337-L344 |
238,893 | canis-io/yii2-canis-lib | lib/web/grid/Cell.php | Cell.getFlex | public function getFlex($size = null)
{
if (is_null($size)) {
$size = $this->baseSize;
}
$getter = $size . 'Columns';
$flex = $this->getMaxColumns($size) - $this->{$getter};
if ($flex < 0) {
return 0;
}
return $flex;
} | php | public function getFlex($size = null)
{
if (is_null($size)) {
$size = $this->baseSize;
}
$getter = $size . 'Columns';
$flex = $this->getMaxColumns($size) - $this->{$getter};
if ($flex < 0) {
return 0;
}
return $flex;
} | [
"public",
"function",
"getFlex",
"(",
"$",
"size",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"size",
")",
")",
"{",
"$",
"size",
"=",
"$",
"this",
"->",
"baseSize",
";",
"}",
"$",
"getter",
"=",
"$",
"size",
".",
"'Columns'",
";",
... | Get flex.
@param [[@doctodo param_type:size]] $size [[@doctodo param_description:size]] [optional]
@return [[@doctodo return_type:getFlex]] [[@doctodo return_description:getFlex]] | [
"Get",
"flex",
"."
] | 97d533521f65b084dc805c5f312c364b469142d2 | https://github.com/canis-io/yii2-canis-lib/blob/97d533521f65b084dc805c5f312c364b469142d2/lib/web/grid/Cell.php#L625-L637 |
238,894 | vinala/kernel | src/Html/Html.php | Html.open | public static function open($tag, array $options = [], $self = false)
{
$attributes = self::attributes($options);
//add the opened tag to $opened array
if (!$self || is_null($self)) {
self::$opened[] = $tag;
//
return '<'.$tag.$attributes.'>';
} e... | php | public static function open($tag, array $options = [], $self = false)
{
$attributes = self::attributes($options);
//add the opened tag to $opened array
if (!$self || is_null($self)) {
self::$opened[] = $tag;
//
return '<'.$tag.$attributes.'>';
} e... | [
"public",
"static",
"function",
"open",
"(",
"$",
"tag",
",",
"array",
"$",
"options",
"=",
"[",
"]",
",",
"$",
"self",
"=",
"false",
")",
"{",
"$",
"attributes",
"=",
"self",
"::",
"attributes",
"(",
"$",
"options",
")",
";",
"//add the opened tag to ... | open html tag.
@param string $tag
@param array $options
@return string | [
"open",
"html",
"tag",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Html/Html.php#L25-L37 |
238,895 | vinala/kernel | src/Html/Html.php | Html.close | public static function close()
{
//get the last opened tag
$tag = self::$opened[count(self::$opened) - 1];
//remove the last opened tag
array_pop(self::$opened);
return '</'.$tag.'>';
} | php | public static function close()
{
//get the last opened tag
$tag = self::$opened[count(self::$opened) - 1];
//remove the last opened tag
array_pop(self::$opened);
return '</'.$tag.'>';
} | [
"public",
"static",
"function",
"close",
"(",
")",
"{",
"//get the last opened tag",
"$",
"tag",
"=",
"self",
"::",
"$",
"opened",
"[",
"count",
"(",
"self",
"::",
"$",
"opened",
")",
"-",
"1",
"]",
";",
"//remove the last opened tag",
"array_pop",
"(",
"s... | close the last open html tag.
@return string | [
"close",
"the",
"last",
"open",
"html",
"tag",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Html/Html.php#L44-L53 |
238,896 | vinala/kernel | src/Html/Html.php | Html.title | public static function title($title = null)
{
if (is_null($title)) {
$title = config('app.title');
}
$tag = static::open('title');
$tag .= $title;
$tag .= static::close();
return $tag;
} | php | public static function title($title = null)
{
if (is_null($title)) {
$title = config('app.title');
}
$tag = static::open('title');
$tag .= $title;
$tag .= static::close();
return $tag;
} | [
"public",
"static",
"function",
"title",
"(",
"$",
"title",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"title",
")",
")",
"{",
"$",
"title",
"=",
"config",
"(",
"'app.title'",
")",
";",
"}",
"$",
"tag",
"=",
"static",
"::",
"open",
"(... | The HTML title tag.
@param string $title
@return string | [
"The",
"HTML",
"title",
"tag",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Html/Html.php#L132-L143 |
238,897 | AlcyZ/Alcys-ORM | src/Core/Db/QueryBuilder/MySql/InsertBuilder.php | InsertBuilder._prepareColumns | private function _prepareColumns(array $columnArray)
{
if(count($columnArray) === 0)
{
throw new \Exception('The column method of the statement must called before!');
}
foreach($columnArray as $column)
{
$this->columns .= $column->getColumnName() . ', ';
}
$this->columns = rtrim($this->columns);
... | php | private function _prepareColumns(array $columnArray)
{
if(count($columnArray) === 0)
{
throw new \Exception('The column method of the statement must called before!');
}
foreach($columnArray as $column)
{
$this->columns .= $column->getColumnName() . ', ';
}
$this->columns = rtrim($this->columns);
... | [
"private",
"function",
"_prepareColumns",
"(",
"array",
"$",
"columnArray",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"columnArray",
")",
"===",
"0",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'The column method of the statement must called before!'",
")",
... | Validate and prepare the columns property to set it to the query.
@param ColumnInterface[] $columnArray An array with ColumnInterface objects as elements.
@return $this The same instance to concatenate methods.
@throws \Exception When column method of statement was not invoked. | [
"Validate",
"and",
"prepare",
"the",
"columns",
"property",
"to",
"set",
"it",
"to",
"the",
"query",
"."
] | dd30946ad35ab06cba2167cf6dfa02b733614720 | https://github.com/AlcyZ/Alcys-ORM/blob/dd30946ad35ab06cba2167cf6dfa02b733614720/src/Core/Db/QueryBuilder/MySql/InsertBuilder.php#L96-L110 |
238,898 | AlcyZ/Alcys-ORM | src/Core/Db/QueryBuilder/MySql/InsertBuilder.php | InsertBuilder._prepareValues | private function _prepareValues(array $valueArrays)
{
if(count($valueArrays) === 0)
{
throw new \Exception('The value method of the statement must called before!');
}
foreach($valueArrays as $valueArray)
{
$valueString = '(';
foreach($valueArray as $value)
{
$valueString .= $value->getValue()... | php | private function _prepareValues(array $valueArrays)
{
if(count($valueArrays) === 0)
{
throw new \Exception('The value method of the statement must called before!');
}
foreach($valueArrays as $valueArray)
{
$valueString = '(';
foreach($valueArray as $value)
{
$valueString .= $value->getValue()... | [
"private",
"function",
"_prepareValues",
"(",
"array",
"$",
"valueArrays",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"valueArrays",
")",
"===",
"0",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'The value method of the statement must called before!'",
")",
"... | Validate and prepare the values property to set it to the query.
@param ReferencesInterface[][] $valueArrays An array with arrays that contain ReferenceInterface objects.
@return $this The same instance to concatenate methods.
@throws \Exception When statements values method was not called. | [
"Validate",
"and",
"prepare",
"the",
"values",
"property",
"to",
"set",
"it",
"to",
"the",
"query",
"."
] | dd30946ad35ab06cba2167cf6dfa02b733614720 | https://github.com/AlcyZ/Alcys-ORM/blob/dd30946ad35ab06cba2167cf6dfa02b733614720/src/Core/Db/QueryBuilder/MySql/InsertBuilder.php#L121-L142 |
238,899 | wucdbm/menu-builder-bundle | Composer/ScriptHandler.php | ScriptHandler.importRoutes | public static function importRoutes(Event $event) {
$options = self::getOptions($event);
$appDir = $options['symfony-app-dir'];
$webDir = $options['symfony-web-dir'];
if (!is_dir($webDir)) {
echo 'The symfony-web-dir (' . $webDir . ') specified in composer.json was not found... | php | public static function importRoutes(Event $event) {
$options = self::getOptions($event);
$appDir = $options['symfony-app-dir'];
$webDir = $options['symfony-web-dir'];
if (!is_dir($webDir)) {
echo 'The symfony-web-dir (' . $webDir . ') specified in composer.json was not found... | [
"public",
"static",
"function",
"importRoutes",
"(",
"Event",
"$",
"event",
")",
"{",
"$",
"options",
"=",
"self",
"::",
"getOptions",
"(",
"$",
"event",
")",
";",
"$",
"appDir",
"=",
"$",
"options",
"[",
"'symfony-app-dir'",
"]",
";",
"$",
"webDir",
"... | Imports routes into the database.
@param $event Event A instance | [
"Imports",
"routes",
"into",
"the",
"database",
"."
] | 85bbb0760701eda4eb7c624f743abcc63a320168 | https://github.com/wucdbm/menu-builder-bundle/blob/85bbb0760701eda4eb7c624f743abcc63a320168/Composer/ScriptHandler.php#L30-L42 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.