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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
19,100 | tableau-mkt/eggs-n-cereal | src/Serializer.php | Serializer.errorStop | protected function errorStop($use) {
foreach (libxml_get_errors() as $error) {
switch ($error->level) {
case LIBXML_ERR_WARNING:
case LIBXML_ERR_ERROR:
$level = LogLevel::WARNING;
break;
case LIBXML_ERR_FATAL:
$level = LogLevel::ERROR;
break;
... | php | protected function errorStop($use) {
foreach (libxml_get_errors() as $error) {
switch ($error->level) {
case LIBXML_ERR_WARNING:
case LIBXML_ERR_ERROR:
$level = LogLevel::WARNING;
break;
case LIBXML_ERR_FATAL:
$level = LogLevel::ERROR;
break;
... | [
"protected",
"function",
"errorStop",
"(",
"$",
"use",
")",
"{",
"foreach",
"(",
"libxml_get_errors",
"(",
")",
"as",
"$",
"error",
")",
"{",
"switch",
"(",
"$",
"error",
"->",
"level",
")",
"{",
"case",
"LIBXML_ERR_WARNING",
":",
"case",
"LIBXML_ERR_ERROR... | Ends custom error handling.
@param bool $use
The return value of Serializer::errorStart(). | [
"Ends",
"custom",
"error",
"handling",
"."
] | 778b83ddae1dd687724a84545ce8afa1a31e4bcf | https://github.com/tableau-mkt/eggs-n-cereal/blob/778b83ddae1dd687724a84545ce8afa1a31e4bcf/src/Serializer.php#L455-L479 |
19,101 | prowebcraft/dot | src/Dot.php | Dot.getValue | public static function getValue($array, $key, $default = null)
{
if (is_string($key)) {
// Iterate path
$keys = explode('.', $key);
foreach ($keys as $key) {
if (!isset($array[$key])) {
return $default;
}
... | php | public static function getValue($array, $key, $default = null)
{
if (is_string($key)) {
// Iterate path
$keys = explode('.', $key);
foreach ($keys as $key) {
if (!isset($array[$key])) {
return $default;
}
... | [
"public",
"static",
"function",
"getValue",
"(",
"$",
"array",
",",
"$",
"key",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"key",
")",
")",
"{",
"// Iterate path",
"$",
"keys",
"=",
"explode",
"(",
"'.'",
",",
"$"... | Get value of path, default value if path doesn't exist or all data
@param array $array Source Array
@param mixed|null $key Path
@param mixed|null $default Default value
@return mixed Value of path | [
"Get",
"value",
"of",
"path",
"default",
"value",
"if",
"path",
"doesn",
"t",
"exist",
"or",
"all",
"data"
] | de47137ec650f39c6835f30474a42cd9548063c4 | https://github.com/prowebcraft/dot/blob/de47137ec650f39c6835f30474a42cd9548063c4/src/Dot.php#L39-L57 |
19,102 | lmammino/e-foundation | src/Variation/Model/OptionSubjectTrait.php | OptionSubjectTrait.addOption | public function addOption(OptionInterface $option)
{
if (!$this->hasOption($option)) {
$this->options->add($option);
}
return $this;
} | php | public function addOption(OptionInterface $option)
{
if (!$this->hasOption($option)) {
$this->options->add($option);
}
return $this;
} | [
"public",
"function",
"addOption",
"(",
"OptionInterface",
"$",
"option",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasOption",
"(",
"$",
"option",
")",
")",
"{",
"$",
"this",
"->",
"options",
"->",
"add",
"(",
"$",
"option",
")",
";",
"}",
"re... | Add a given option
@param OptionInterface $option
@return $this | [
"Add",
"a",
"given",
"option"
] | 198b7047d93eb11c9bc0c7ddf0bfa8229d42807a | https://github.com/lmammino/e-foundation/blob/198b7047d93eb11c9bc0c7ddf0bfa8229d42807a/src/Variation/Model/OptionSubjectTrait.php#L71-L78 |
19,103 | lmammino/e-foundation | src/Variation/Model/OptionSubjectTrait.php | OptionSubjectTrait.removeOption | public function removeOption(OptionInterface $option)
{
if ($this->hasOption($option)) {
$this->options->removeElement($option);
}
return $this;
} | php | public function removeOption(OptionInterface $option)
{
if ($this->hasOption($option)) {
$this->options->removeElement($option);
}
return $this;
} | [
"public",
"function",
"removeOption",
"(",
"OptionInterface",
"$",
"option",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasOption",
"(",
"$",
"option",
")",
")",
"{",
"$",
"this",
"->",
"options",
"->",
"removeElement",
"(",
"$",
"option",
")",
";",
"}",... | Remove a given option
@param OptionInterface $option
@return $this | [
"Remove",
"a",
"given",
"option"
] | 198b7047d93eb11c9bc0c7ddf0bfa8229d42807a | https://github.com/lmammino/e-foundation/blob/198b7047d93eb11c9bc0c7ddf0bfa8229d42807a/src/Variation/Model/OptionSubjectTrait.php#L86-L93 |
19,104 | atkrad/data-tables | src/Column/Action.php | Action.getContent | public function getContent($rowResult)
{
if ($this->callManager($rowResult) === false) {
return '';
}
return $this->builder->render($this->template);
} | php | public function getContent($rowResult)
{
if ($this->callManager($rowResult) === false) {
return '';
}
return $this->builder->render($this->template);
} | [
"public",
"function",
"getContent",
"(",
"$",
"rowResult",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"callManager",
"(",
"$",
"rowResult",
")",
"===",
"false",
")",
"{",
"return",
"''",
";",
"}",
"return",
"$",
"this",
"->",
"builder",
"->",
"render",
... | Get column content
@param mixed $rowResult Per row result
@return string | [
"Get",
"column",
"content"
] | 5afcc337ab624ca626e29d9674459c5105982b16 | https://github.com/atkrad/data-tables/blob/5afcc337ab624ca626e29d9674459c5105982b16/src/Column/Action.php#L75-L82 |
19,105 | atkrad/data-tables | src/Column/Action.php | Action.setManager | public function setManager(Closure $manager)
{
if (!is_callable($manager)) {
throw new Exception('Manager must be callable.');
}
$this->manager = $manager;
return $this;
} | php | public function setManager(Closure $manager)
{
if (!is_callable($manager)) {
throw new Exception('Manager must be callable.');
}
$this->manager = $manager;
return $this;
} | [
"public",
"function",
"setManager",
"(",
"Closure",
"$",
"manager",
")",
"{",
"if",
"(",
"!",
"is_callable",
"(",
"$",
"manager",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'Manager must be callable.'",
")",
";",
"}",
"$",
"this",
"->",
"manager",
... | Set action manager
@param callable $manager
@throws \DataTable\Exception
@return Action | [
"Set",
"action",
"manager"
] | 5afcc337ab624ca626e29d9674459c5105982b16 | https://github.com/atkrad/data-tables/blob/5afcc337ab624ca626e29d9674459c5105982b16/src/Column/Action.php#L92-L101 |
19,106 | barebone-php/barebone-core | lib/Controller.php | Controller.render | protected function render($template, $data = [], $status = 200)
{
$rendered = View::render($template, $data);
$this->response->getBody()->write($rendered);
return $this->getResponse()
->withStatus($status)
->withHeader('Content-Type', 'text/html; charset=utf-8');
... | php | protected function render($template, $data = [], $status = 200)
{
$rendered = View::render($template, $data);
$this->response->getBody()->write($rendered);
return $this->getResponse()
->withStatus($status)
->withHeader('Content-Type', 'text/html; charset=utf-8');
... | [
"protected",
"function",
"render",
"(",
"$",
"template",
",",
"$",
"data",
"=",
"[",
"]",
",",
"$",
"status",
"=",
"200",
")",
"{",
"$",
"rendered",
"=",
"View",
"::",
"render",
"(",
"$",
"template",
",",
"$",
"data",
")",
";",
"$",
"this",
"->",... | Render a view template with optional data
@param string $template Relative Path to Template File
@param array|object $data Associate Array or Object (key => value)
@param int $status HTTP status code (100-599, default 200)
@return Response | [
"Render",
"a",
"view",
"template",
"with",
"optional",
"data"
] | 7fda3a62d5fa103cdc4d2d34e1adf8f3ccbfe2bc | https://github.com/barebone-php/barebone-core/blob/7fda3a62d5fa103cdc4d2d34e1adf8f3ccbfe2bc/lib/Controller.php#L109-L118 |
19,107 | barebone-php/barebone-core | lib/Controller.php | Controller.redirect | protected function redirect($url, $status = 302)
{
return $this->getResponse()
->withStatus($status)
->withHeader('Location', (string)$url);
} | php | protected function redirect($url, $status = 302)
{
return $this->getResponse()
->withStatus($status)
->withHeader('Location', (string)$url);
} | [
"protected",
"function",
"redirect",
"(",
"$",
"url",
",",
"$",
"status",
"=",
"302",
")",
"{",
"return",
"$",
"this",
"->",
"getResponse",
"(",
")",
"->",
"withStatus",
"(",
"$",
"status",
")",
"->",
"withHeader",
"(",
"'Location'",
",",
"(",
"string"... | Redirect to URL with optional status
@param string $url The redirect destination.
@param int $status The redirect HTTP status code (between 100 and 599).
@return Response | [
"Redirect",
"to",
"URL",
"with",
"optional",
"status"
] | 7fda3a62d5fa103cdc4d2d34e1adf8f3ccbfe2bc | https://github.com/barebone-php/barebone-core/blob/7fda3a62d5fa103cdc4d2d34e1adf8f3ccbfe2bc/lib/Controller.php#L150-L155 |
19,108 | barebone-php/barebone-core | lib/Controller.php | Controller.routerError | public function routerError($error = null, $subject = null)
{
switch ($error) {
case Router::ERR_NOT_FOUND:
$status = 404;
$template = 'router/error404';
break;
case Router::ERR_BAD_METHOD:
$status = 405;
$template = 'router/error40... | php | public function routerError($error = null, $subject = null)
{
switch ($error) {
case Router::ERR_NOT_FOUND:
$status = 404;
$template = 'router/error404';
break;
case Router::ERR_BAD_METHOD:
$status = 405;
$template = 'router/error40... | [
"public",
"function",
"routerError",
"(",
"$",
"error",
"=",
"null",
",",
"$",
"subject",
"=",
"null",
")",
"{",
"switch",
"(",
"$",
"error",
")",
"{",
"case",
"Router",
"::",
"ERR_NOT_FOUND",
":",
"$",
"status",
"=",
"404",
";",
"$",
"template",
"="... | Router Error Action
@param string $error Router::ERR_*
@param mixed $subject Optional value for the error template
@return Response | [
"Router",
"Error",
"Action"
] | 7fda3a62d5fa103cdc4d2d34e1adf8f3ccbfe2bc | https://github.com/barebone-php/barebone-core/blob/7fda3a62d5fa103cdc4d2d34e1adf8f3ccbfe2bc/lib/Controller.php#L165-L185 |
19,109 | barebone-php/barebone-core | lib/Controller.php | Controller.setRequest | public function setRequest(Request $request)
{
$this->request = $request;
$parsedBody = $this->request->getParsedBody();
if (!empty($parsedBody)) {
if (is_array($parsedBody)) {
$this->data = array_map('trim', (array)$parsedBody);
} else {
... | php | public function setRequest(Request $request)
{
$this->request = $request;
$parsedBody = $this->request->getParsedBody();
if (!empty($parsedBody)) {
if (is_array($parsedBody)) {
$this->data = array_map('trim', (array)$parsedBody);
} else {
... | [
"public",
"function",
"setRequest",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"this",
"->",
"request",
"=",
"$",
"request",
";",
"$",
"parsedBody",
"=",
"$",
"this",
"->",
"request",
"->",
"getParsedBody",
"(",
")",
";",
"if",
"(",
"!",
"empty",
... | Assign a request object
@param Request $request FIG-7 Request Interface
@return self | [
"Assign",
"a",
"request",
"object"
] | 7fda3a62d5fa103cdc4d2d34e1adf8f3ccbfe2bc | https://github.com/barebone-php/barebone-core/blob/7fda3a62d5fa103cdc4d2d34e1adf8f3ccbfe2bc/lib/Controller.php#L278-L293 |
19,110 | steeffeen/FancyManiaLinks | FML/Controls/Frame3d.php | Frame3d.setStyle3dId | public function setStyle3dId($style3dId)
{
$this->style3dId = (string)$style3dId;
$this->style3d = null;
return $this;
} | php | public function setStyle3dId($style3dId)
{
$this->style3dId = (string)$style3dId;
$this->style3d = null;
return $this;
} | [
"public",
"function",
"setStyle3dId",
"(",
"$",
"style3dId",
")",
"{",
"$",
"this",
"->",
"style3dId",
"=",
"(",
"string",
")",
"$",
"style3dId",
";",
"$",
"this",
"->",
"style3d",
"=",
"null",
";",
"return",
"$",
"this",
";",
"}"
] | Set the Style3d id
@api
@param string $style3dId Style3d id
@return static | [
"Set",
"the",
"Style3d",
"id"
] | 227b0759306f0a3c75873ba50276e4163a93bfa6 | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Controls/Frame3d.php#L81-L86 |
19,111 | steeffeen/FancyManiaLinks | FML/Controls/Frame3d.php | Frame3d.setStyle3d | public function setStyle3d(Style3d $style3d)
{
$this->style3dId = null;
$this->style3d = $style3d;
return $this;
} | php | public function setStyle3d(Style3d $style3d)
{
$this->style3dId = null;
$this->style3d = $style3d;
return $this;
} | [
"public",
"function",
"setStyle3d",
"(",
"Style3d",
"$",
"style3d",
")",
"{",
"$",
"this",
"->",
"style3dId",
"=",
"null",
";",
"$",
"this",
"->",
"style3d",
"=",
"$",
"style3d",
";",
"return",
"$",
"this",
";",
"}"
] | Set the Style3d
@api
@param Style3d $style3d Style3d
@return static | [
"Set",
"the",
"Style3d"
] | 227b0759306f0a3c75873ba50276e4163a93bfa6 | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Controls/Frame3d.php#L106-L111 |
19,112 | SignpostMarv/daft-object | src/AbstractArrayBackedDaftObject.php | AbstractArrayBackedDaftObject.RetrievePropertyValueFromData | protected function RetrievePropertyValueFromData(string $property)
{
$isNullable = in_array(
$property,
static::DaftObjectNullableProperties(),
DefinitionAssistant::IN_ARRAY_STRICT_MODE
);
if ( ! array_key_exists($property, $this->data) && ! $isNullable) ... | php | protected function RetrievePropertyValueFromData(string $property)
{
$isNullable = in_array(
$property,
static::DaftObjectNullableProperties(),
DefinitionAssistant::IN_ARRAY_STRICT_MODE
);
if ( ! array_key_exists($property, $this->data) && ! $isNullable) ... | [
"protected",
"function",
"RetrievePropertyValueFromData",
"(",
"string",
"$",
"property",
")",
"{",
"$",
"isNullable",
"=",
"in_array",
"(",
"$",
"property",
",",
"static",
"::",
"DaftObjectNullableProperties",
"(",
")",
",",
"DefinitionAssistant",
"::",
"IN_ARRAY_S... | Retrieve a property from data.
@param string $property the property being retrieved
@throws Exceptions\PropertyNotNullableException if value is not set and $property is not listed as nullabe
@return scalar|array|object|null the property value | [
"Retrieve",
"a",
"property",
"from",
"data",
"."
] | 514886592b64986cc637040045f098335e27c037 | https://github.com/SignpostMarv/daft-object/blob/514886592b64986cc637040045f098335e27c037/src/AbstractArrayBackedDaftObject.php#L180-L195 |
19,113 | haldayne/boost | src/MapOfCollections.php | MapOfCollections.pluck | public function pluck($key_for_value, $key_for_key = null)
{
$map = new Map;
$this->walk(function ($v) use ($key_for_value, $key_for_key, $map) {
// get the key to use
if (null === $key_for_key) {
$key = null;
} else if ($v->has($key_for_key)) {
... | php | public function pluck($key_for_value, $key_for_key = null)
{
$map = new Map;
$this->walk(function ($v) use ($key_for_value, $key_for_key, $map) {
// get the key to use
if (null === $key_for_key) {
$key = null;
} else if ($v->has($key_for_key)) {
... | [
"public",
"function",
"pluck",
"(",
"$",
"key_for_value",
",",
"$",
"key_for_key",
"=",
"null",
")",
"{",
"$",
"map",
"=",
"new",
"Map",
";",
"$",
"this",
"->",
"walk",
"(",
"function",
"(",
"$",
"v",
")",
"use",
"(",
"$",
"key_for_value",
",",
"$"... | Create a new map by pulling the given key out of all contained maps.
Thinking of a Map of Collections as a two-dimensional array, this
method slices a column out:
```
use Haldayne\Boost\MapOfCollections;
$map = new MapOfCollections;
$map->push([ 'id' => 5, 'name' => 'Ada', 'age' => 16 ]);
$map->push([ 'id' => 6, 'nam... | [
"Create",
"a",
"new",
"map",
"by",
"pulling",
"the",
"given",
"key",
"out",
"of",
"all",
"contained",
"maps",
"."
] | d18cc398557e23f9c316ea7fb40b90f84cc53650 | https://github.com/haldayne/boost/blob/d18cc398557e23f9c316ea7fb40b90f84cc53650/src/MapOfCollections.php#L40-L61 |
19,114 | Ocramius/OcraDiCompiler | src/OcraDiCompiler/Mvc/Service/DiFactory.php | DiFactory.createService | public function createService(ServiceLocatorInterface $serviceLocator)
{
$config = $serviceLocator->get('Config');
ErrorHandler::start();
$compiledInstantiators = include $config['ocra_di_compiler']['compiled_di_instantiator_filename'];
ErrorHandler::stop();
if (!is_array($... | php | public function createService(ServiceLocatorInterface $serviceLocator)
{
$config = $serviceLocator->get('Config');
ErrorHandler::start();
$compiledInstantiators = include $config['ocra_di_compiler']['compiled_di_instantiator_filename'];
ErrorHandler::stop();
if (!is_array($... | [
"public",
"function",
"createService",
"(",
"ServiceLocatorInterface",
"$",
"serviceLocator",
")",
"{",
"$",
"config",
"=",
"$",
"serviceLocator",
"->",
"get",
"(",
"'Config'",
")",
";",
"ErrorHandler",
"::",
"start",
"(",
")",
";",
"$",
"compiledInstantiators",... | Generates a compiled Di proxy to be used as a replacement for \Zend\Di\Di
@param ServiceLocatorInterface $serviceLocator
@return Di | [
"Generates",
"a",
"compiled",
"Di",
"proxy",
"to",
"be",
"used",
"as",
"a",
"replacement",
"for",
"\\",
"Zend",
"\\",
"Di",
"\\",
"Di"
] | 667f4b24771f27fb9c8d6c38ffaf72d9cd55ca4a | https://github.com/Ocramius/OcraDiCompiler/blob/667f4b24771f27fb9c8d6c38ffaf72d9cd55ca4a/src/OcraDiCompiler/Mvc/Service/DiFactory.php#L55-L77 |
19,115 | kherge-abandoned/php-wise | src/lib/Herrera/Wise/Util/ArrayUtil.php | ArrayUtil.flatten | public static function flatten(array $array, $prefix = '', $join = '.')
{
$flat = array();
foreach ($array as $key => $value) {
$key = $prefix ? $prefix . $join . $key : $key;
if (is_array($value)) {
$flat = array_merge(
$flat,
... | php | public static function flatten(array $array, $prefix = '', $join = '.')
{
$flat = array();
foreach ($array as $key => $value) {
$key = $prefix ? $prefix . $join . $key : $key;
if (is_array($value)) {
$flat = array_merge(
$flat,
... | [
"public",
"static",
"function",
"flatten",
"(",
"array",
"$",
"array",
",",
"$",
"prefix",
"=",
"''",
",",
"$",
"join",
"=",
"'.'",
")",
"{",
"$",
"flat",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"$",
"... | Flattens an associative array.
@param array $array An array.
@param string $prefix A key prefix.
@param string $join The key join character.
@return array The flattened array. | [
"Flattens",
"an",
"associative",
"array",
"."
] | 7621e0be7dbb2a015d68197d290fe8469f539a4d | https://github.com/kherge-abandoned/php-wise/blob/7621e0be7dbb2a015d68197d290fe8469f539a4d/src/lib/Herrera/Wise/Util/ArrayUtil.php#L21-L39 |
19,116 | webforge-labs/psc-cms | lib/Psc/HTML/WidgetBase.php | WidgetBase.doInit | protected function doInit() {
if ($this->loadWith === self::JAVASCRIPT) {
jQuery::widget($this->html, $this->widgetName, (array) $this->widgetOptions);
} else {
$this->html
->setAttribute('data-widget', $this->widgetName)
->setAttribute('data-widget-options', $this->getJSONConverter(... | php | protected function doInit() {
if ($this->loadWith === self::JAVASCRIPT) {
jQuery::widget($this->html, $this->widgetName, (array) $this->widgetOptions);
} else {
$this->html
->setAttribute('data-widget', $this->widgetName)
->setAttribute('data-widget-options', $this->getJSONConverter(... | [
"protected",
"function",
"doInit",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"loadWith",
"===",
"self",
"::",
"JAVASCRIPT",
")",
"{",
"jQuery",
"::",
"widget",
"(",
"$",
"this",
"->",
"html",
",",
"$",
"this",
"->",
"widgetName",
",",
"(",
"array"... | Initialisiert das Widget des objektes
wenn loadWith === self::JAVASCRIPT ist
an das Element wird inline Javascript angehängt welcher jQuery( elementSelector ).$widgetName.({ $options}) aufruft
ansonsten wird im Element die attribute
data-widget und data-widget-options (ein JSON string) gesetzt | [
"Initialisiert",
"das",
"Widget",
"des",
"objektes"
] | 467bfa2547e6b4fa487d2d7f35fa6cc618dbc763 | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/HTML/WidgetBase.php#L40-L50 |
19,117 | anime-db/app-bundle | src/Event/Listener/Project.php | Project.onUpdatedProposeUpdateTask | public function onUpdatedProposeUpdateTask()
{
/* @var $task Task */
$task = $this->em
->getRepository('AnimeDbAppBundle:Task')
->findOneBy(['command' => 'animedb:propose-update']);
$next_run = new \DateTime();
$next_run->modify(sprintf('+%s seconds 01:00:00... | php | public function onUpdatedProposeUpdateTask()
{
/* @var $task Task */
$task = $this->em
->getRepository('AnimeDbAppBundle:Task')
->findOneBy(['command' => 'animedb:propose-update']);
$next_run = new \DateTime();
$next_run->modify(sprintf('+%s seconds 01:00:00... | [
"public",
"function",
"onUpdatedProposeUpdateTask",
"(",
")",
"{",
"/* @var $task Task */",
"$",
"task",
"=",
"$",
"this",
"->",
"em",
"->",
"getRepository",
"(",
"'AnimeDbAppBundle:Task'",
")",
"->",
"findOneBy",
"(",
"[",
"'command'",
"=>",
"'animedb:propose-updat... | Update next run date for the propose update task. | [
"Update",
"next",
"run",
"date",
"for",
"the",
"propose",
"update",
"task",
"."
] | ca3b342081719d41ba018792a75970cbb1f1fe22 | https://github.com/anime-db/app-bundle/blob/ca3b342081719d41ba018792a75970cbb1f1fe22/src/Event/Listener/Project.php#L52-L64 |
19,118 | stanislav-web/phalcon-ulogin | src/ULogin/Init.php | Init.setProviders | public function setProviders($providers)
{
$array = Parser::map($providers);
// collection data
if (empty($array['required']) === false) {
$this->requiredProviders = implode(',', $array['required']);
}
if (empty($array['hidden']) === false) {
$this->... | php | public function setProviders($providers)
{
$array = Parser::map($providers);
// collection data
if (empty($array['required']) === false) {
$this->requiredProviders = implode(',', $array['required']);
}
if (empty($array['hidden']) === false) {
$this->... | [
"public",
"function",
"setProviders",
"(",
"$",
"providers",
")",
"{",
"$",
"array",
"=",
"Parser",
"::",
"map",
"(",
"$",
"providers",
")",
";",
"// collection data",
"if",
"(",
"empty",
"(",
"$",
"array",
"[",
"'required'",
"]",
")",
"===",
"false",
... | Allows you to add authentication providers in the list of available.
@param mixed $providers as ('provider' => true, 'provider' => false) or string separated by comma
@example <code>
$this->setProviders([
'vkontakte' => true,
'odnoklassniki' => true,
'mailru' => true,
'facebook' => true,
'twitter' ... | [
"Allows",
"you",
"to",
"add",
"authentication",
"providers",
"in",
"the",
"list",
"of",
"available",
"."
] | 0cea8510a244ebb9b1333085b325a283e4fb9f2f | https://github.com/stanislav-web/phalcon-ulogin/blob/0cea8510a244ebb9b1333085b325a283e4fb9f2f/src/ULogin/Init.php#L129-L143 |
19,119 | stanislav-web/phalcon-ulogin | src/ULogin/Init.php | Init.setFields | public function setFields($fields)
{
if (empty($fields) === false) {
if (is_array($fields) === true) {
$this->requiredFields = implode(',', $fields);
} else {
$this->requiredFields = $fields;
}
}
return $this;
} | php | public function setFields($fields)
{
if (empty($fields) === false) {
if (is_array($fields) === true) {
$this->requiredFields = implode(',', $fields);
} else {
$this->requiredFields = $fields;
}
}
return $this;
} | [
"public",
"function",
"setFields",
"(",
"$",
"fields",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"fields",
")",
"===",
"false",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"fields",
")",
"===",
"true",
")",
"{",
"$",
"this",
"->",
"requiredFields",
"=... | Allows you to add to the list of fields requested for the provider's authorization.
@param mixed $fields as ('field1', 'field2', ...) or string separated by comma
@example <code>
$this->setFields([
'first_name',
'last_name',
'photo'
]);
$this->setFields('first_name,last_name,photo');
</code>
@return Init | [
"Allows",
"you",
"to",
"add",
"to",
"the",
"list",
"of",
"fields",
"requested",
"for",
"the",
"provider",
"s",
"authorization",
"."
] | 0cea8510a244ebb9b1333085b325a283e4fb9f2f | https://github.com/stanislav-web/phalcon-ulogin/blob/0cea8510a244ebb9b1333085b325a283e4fb9f2f/src/ULogin/Init.php#L160-L174 |
19,120 | stanislav-web/phalcon-ulogin | src/ULogin/Init.php | Init.setOptional | public function setOptional($fields)
{
if (empty($fields) === false) {
if (is_array($fields) === true) {
$this->optionalFields = implode(',', $fields);
} else {
$this->optionalFields = $fields;
}
}
return $this;
} | php | public function setOptional($fields)
{
if (empty($fields) === false) {
if (is_array($fields) === true) {
$this->optionalFields = implode(',', $fields);
} else {
$this->optionalFields = $fields;
}
}
return $this;
} | [
"public",
"function",
"setOptional",
"(",
"$",
"fields",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"fields",
")",
"===",
"false",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"fields",
")",
"===",
"true",
")",
"{",
"$",
"this",
"->",
"optionalFields",
... | Allows you to add to the list of optionals fields.
@param mixed $fields as ('field1', 'field2', ...) or string separated by comma
@example <code>
$this->setOptional([
'bday',
'city',
'sex'
]);
$this->setOptional('bday,city,sex');
</code>
@return Init | [
"Allows",
"you",
"to",
"add",
"to",
"the",
"list",
"of",
"optionals",
"fields",
"."
] | 0cea8510a244ebb9b1333085b325a283e4fb9f2f | https://github.com/stanislav-web/phalcon-ulogin/blob/0cea8510a244ebb9b1333085b325a283e4fb9f2f/src/ULogin/Init.php#L191-L206 |
19,121 | stanislav-web/phalcon-ulogin | src/ULogin/Init.php | Init.setType | public function setType($type)
{
if(is_array($type) === true) {
$type = $type[key($type)];
}
$this->types = array_flip($this->types);
if (isset($this->types[$type]) === true) {
$this->widget = $type;
}
return $this;
} | php | public function setType($type)
{
if(is_array($type) === true) {
$type = $type[key($type)];
}
$this->types = array_flip($this->types);
if (isset($this->types[$type]) === true) {
$this->widget = $type;
}
return $this;
} | [
"public",
"function",
"setType",
"(",
"$",
"type",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"type",
")",
"===",
"true",
")",
"{",
"$",
"type",
"=",
"$",
"type",
"[",
"key",
"(",
"$",
"type",
")",
"]",
";",
"}",
"$",
"this",
"->",
"types",
"... | Lets you specify the widget type. Must match the variable `types`
@param $type
@example <code>
$this->setType('small');
</code>
@return Init | [
"Lets",
"you",
"specify",
"the",
"widget",
"type",
".",
"Must",
"match",
"the",
"variable",
"types"
] | 0cea8510a244ebb9b1333085b325a283e4fb9f2f | https://github.com/stanislav-web/phalcon-ulogin/blob/0cea8510a244ebb9b1333085b325a283e4fb9f2f/src/ULogin/Init.php#L217-L231 |
19,122 | stanislav-web/phalcon-ulogin | src/ULogin/Init.php | Init.setUrl | public function setUrl($url = '')
{
if(is_array($url) === true) {
$url = $url[key($url)];
}
$request = new Request();
if (empty($url) === true) {
$this->url = $request->getScheme() . '://' . $request->getHttpHost() . (new Router())->getRewriteUri();
... | php | public function setUrl($url = '')
{
if(is_array($url) === true) {
$url = $url[key($url)];
}
$request = new Request();
if (empty($url) === true) {
$this->url = $request->getScheme() . '://' . $request->getHttpHost() . (new Router())->getRewriteUri();
... | [
"public",
"function",
"setUrl",
"(",
"$",
"url",
"=",
"''",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"url",
")",
"===",
"true",
")",
"{",
"$",
"url",
"=",
"$",
"url",
"[",
"key",
"(",
"$",
"url",
")",
"]",
";",
"}",
"$",
"request",
"=",
"... | Lets you specify the callback url to redirect to when authorizing the page is reloaded.
If the url is not specified and is used to redirect the authorization,
the authorization after the current page just updated
@param string $url page that will be implemented to redirect after login (accept QUERY_STRING)
@return $th... | [
"Lets",
"you",
"specify",
"the",
"callback",
"url",
"to",
"redirect",
"to",
"when",
"authorizing",
"the",
"page",
"is",
"reloaded",
".",
"If",
"the",
"url",
"is",
"not",
"specified",
"and",
"is",
"used",
"to",
"redirect",
"the",
"authorization",
"the",
"au... | 0cea8510a244ebb9b1333085b325a283e4fb9f2f | https://github.com/stanislav-web/phalcon-ulogin/blob/0cea8510a244ebb9b1333085b325a283e4fb9f2f/src/ULogin/Init.php#L241-L257 |
19,123 | stanislav-web/phalcon-ulogin | src/ULogin/Init.php | Init.destroyUserData | private function destroyUserData()
{
if (is_array($this->user) === true
&& isset($this->user["error"]) === true
) {
$this->user = false;
return true;
}
return false;
} | php | private function destroyUserData()
{
if (is_array($this->user) === true
&& isset($this->user["error"]) === true
) {
$this->user = false;
return true;
}
return false;
} | [
"private",
"function",
"destroyUserData",
"(",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"user",
")",
"===",
"true",
"&&",
"isset",
"(",
"$",
"this",
"->",
"user",
"[",
"\"error\"",
"]",
")",
"===",
"true",
")",
"{",
"$",
"this",
"->... | Destroy user data
@return bool | [
"Destroy",
"user",
"data"
] | 0cea8510a244ebb9b1333085b325a283e4fb9f2f | https://github.com/stanislav-web/phalcon-ulogin/blob/0cea8510a244ebb9b1333085b325a283e4fb9f2f/src/ULogin/Init.php#L264-L274 |
19,124 | stanislav-web/phalcon-ulogin | src/ULogin/Init.php | Init.getToken | public function getToken()
{
$request = new Request();
if ($request->isPost() === true) {
$this->token = $request->getPost('token', null, false);
} else {
$this->token = $request->getQuery('token', null, false);
}
return $this->token;
} | php | public function getToken()
{
$request = new Request();
if ($request->isPost() === true) {
$this->token = $request->getPost('token', null, false);
} else {
$this->token = $request->getQuery('token', null, false);
}
return $this->token;
} | [
"public",
"function",
"getToken",
"(",
")",
"{",
"$",
"request",
"=",
"new",
"Request",
"(",
")",
";",
"if",
"(",
"$",
"request",
"->",
"isPost",
"(",
")",
"===",
"true",
")",
"{",
"$",
"this",
"->",
"token",
"=",
"$",
"request",
"->",
"getPost",
... | Reads the parameters passed to the script, and selects the authorization key ULogin
@return bool|mixed | [
"Reads",
"the",
"parameters",
"passed",
"to",
"the",
"script",
"and",
"selects",
"the",
"authorization",
"key",
"ULogin"
] | 0cea8510a244ebb9b1333085b325a283e4fb9f2f | https://github.com/stanislav-web/phalcon-ulogin/blob/0cea8510a244ebb9b1333085b325a283e4fb9f2f/src/ULogin/Init.php#L281-L293 |
19,125 | stanislav-web/phalcon-ulogin | src/ULogin/Init.php | Init.getUser | public function getUser()
{
// destroy previous content
$this->destroyUserData();
if ($this->user === false) {
// get user
$url = 'http://ulogin.ru/token.php?token=' . $this->getToken() . '&host=' . (new Request())->getHttpHost();
$content = file_get_c... | php | public function getUser()
{
// destroy previous content
$this->destroyUserData();
if ($this->user === false) {
// get user
$url = 'http://ulogin.ru/token.php?token=' . $this->getToken() . '&host=' . (new Request())->getHttpHost();
$content = file_get_c... | [
"public",
"function",
"getUser",
"(",
")",
"{",
"// destroy previous content",
"$",
"this",
"->",
"destroyUserData",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"user",
"===",
"false",
")",
"{",
"// get user",
"$",
"url",
"=",
"'http://ulogin.ru/token.php?tok... | Returns an associative array with the data about the user.
Fields array described in the method setFields
@example <code>
$this->getUser();
</code>
@return array|bool|mixed data provided by the ISP login | [
"Returns",
"an",
"associative",
"array",
"with",
"the",
"data",
"about",
"the",
"user",
".",
"Fields",
"array",
"described",
"in",
"the",
"method",
"setFields"
] | 0cea8510a244ebb9b1333085b325a283e4fb9f2f | https://github.com/stanislav-web/phalcon-ulogin/blob/0cea8510a244ebb9b1333085b325a283e4fb9f2f/src/ULogin/Init.php#L305-L326 |
19,126 | stanislav-web/phalcon-ulogin | src/ULogin/Init.php | Init.isAuthorised | public function isAuthorised()
{
if (is_array($this->user) === true
&& isset($this->user['error']) === false
) {
return true;
}
return $this->getUser();
} | php | public function isAuthorised()
{
if (is_array($this->user) === true
&& isset($this->user['error']) === false
) {
return true;
}
return $this->getUser();
} | [
"public",
"function",
"isAuthorised",
"(",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"user",
")",
"===",
"true",
"&&",
"isset",
"(",
"$",
"this",
"->",
"user",
"[",
"'error'",
"]",
")",
"===",
"false",
")",
"{",
"return",
"true",
";"... | Checks whether logon
@return array|bool|mixed | [
"Checks",
"whether",
"logon"
] | 0cea8510a244ebb9b1333085b325a283e4fb9f2f | https://github.com/stanislav-web/phalcon-ulogin/blob/0cea8510a244ebb9b1333085b325a283e4fb9f2f/src/ULogin/Init.php#L333-L344 |
19,127 | stanislav-web/phalcon-ulogin | src/ULogin/Init.php | Init.getForm | public function getForm()
{
$view = new View();
return $view->render(__DIR__ . '/../views/ulogin', [
'widget' => $this->widget,
'fields' => $this->requiredFields,
'optional' => $this->optionalFields,
'providers' => $this->requiredProviders,
... | php | public function getForm()
{
$view = new View();
return $view->render(__DIR__ . '/../views/ulogin', [
'widget' => $this->widget,
'fields' => $this->requiredFields,
'optional' => $this->optionalFields,
'providers' => $this->requiredProviders,
... | [
"public",
"function",
"getForm",
"(",
")",
"{",
"$",
"view",
"=",
"new",
"View",
"(",
")",
";",
"return",
"$",
"view",
"->",
"render",
"(",
"__DIR__",
".",
"'/../views/ulogin'",
",",
"[",
"'widget'",
"=>",
"$",
"this",
"->",
"widget",
",",
"'fields'",
... | Returns the html-form widget
@return View | [
"Returns",
"the",
"html",
"-",
"form",
"widget"
] | 0cea8510a244ebb9b1333085b325a283e4fb9f2f | https://github.com/stanislav-web/phalcon-ulogin/blob/0cea8510a244ebb9b1333085b325a283e4fb9f2f/src/ULogin/Init.php#L366-L380 |
19,128 | jfusion/org.jfusion.framework | src/Installer/Installer.php | Installer.setOverwrite | public function setOverwrite($state = false)
{
$tmp = $this->overwrite;
if ($state)
{
$this->overwrite = true;
}
else
{
$this->overwrite = false;
}
return $tmp;
} | php | public function setOverwrite($state = false)
{
$tmp = $this->overwrite;
if ($state)
{
$this->overwrite = true;
}
else
{
$this->overwrite = false;
}
return $tmp;
} | [
"public",
"function",
"setOverwrite",
"(",
"$",
"state",
"=",
"false",
")",
"{",
"$",
"tmp",
"=",
"$",
"this",
"->",
"overwrite",
";",
"if",
"(",
"$",
"state",
")",
"{",
"$",
"this",
"->",
"overwrite",
"=",
"true",
";",
"}",
"else",
"{",
"$",
"th... | Set the allow overwrite switch
@param boolean $state Overwrite switch state
@return boolean True it state is set, false if it is not
@since 3.1 | [
"Set",
"the",
"allow",
"overwrite",
"switch"
] | 65771963f23ccabcf1f867eb17c9452299cfe683 | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Installer/Installer.php#L125-L139 |
19,129 | jfusion/org.jfusion.framework | src/Installer/Installer.php | Installer.setUpgrade | public function setUpgrade($state = false)
{
$tmp = $this->upgrade;
if ($state)
{
$this->upgrade = true;
}
else
{
$this->upgrade = false;
}
return $tmp;
} | php | public function setUpgrade($state = false)
{
$tmp = $this->upgrade;
if ($state)
{
$this->upgrade = true;
}
else
{
$this->upgrade = false;
}
return $tmp;
} | [
"public",
"function",
"setUpgrade",
"(",
"$",
"state",
"=",
"false",
")",
"{",
"$",
"tmp",
"=",
"$",
"this",
"->",
"upgrade",
";",
"if",
"(",
"$",
"state",
")",
"{",
"$",
"this",
"->",
"upgrade",
"=",
"true",
";",
"}",
"else",
"{",
"$",
"this",
... | Set the upgrade switch
@param boolean $state Upgrade switch state
@return boolean True if upgrade, false otherwise
@since 3.1 | [
"Set",
"the",
"upgrade",
"switch"
] | 65771963f23ccabcf1f867eb17c9452299cfe683 | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Installer/Installer.php#L162-L176 |
19,130 | jfusion/org.jfusion.framework | src/Installer/Installer.php | Installer.getPath | public function getPath($name, $default = null)
{
return (!empty($this->paths[$name])) ? $this->paths[$name] : $default;
} | php | public function getPath($name, $default = null)
{
return (!empty($this->paths[$name])) ? $this->paths[$name] : $default;
} | [
"public",
"function",
"getPath",
"(",
"$",
"name",
",",
"$",
"default",
"=",
"null",
")",
"{",
"return",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"paths",
"[",
"$",
"name",
"]",
")",
")",
"?",
"$",
"this",
"->",
"paths",
"[",
"$",
"name",
"]"... | Get an installer path by name
@param string $name Path name
@param string $default Default value
@return string Path
@since 3.1 | [
"Get",
"an",
"installer",
"path",
"by",
"name"
] | 65771963f23ccabcf1f867eb17c9452299cfe683 | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Installer/Installer.php#L188-L191 |
19,131 | jfusion/org.jfusion.framework | src/Installer/Installer.php | Installer.abort | public function abort($msg = null, $type = null)
{
$retval = true;
$step = array_pop($this->stepStack);
// Raise abort warning
if ($msg)
{
$this->log(LogLevel::WARNING, $msg);
}
while ($step != null)
{
switch ($step['type'])
{
case 'file':
// Remove the file
$stepval = File::de... | php | public function abort($msg = null, $type = null)
{
$retval = true;
$step = array_pop($this->stepStack);
// Raise abort warning
if ($msg)
{
$this->log(LogLevel::WARNING, $msg);
}
while ($step != null)
{
switch ($step['type'])
{
case 'file':
// Remove the file
$stepval = File::de... | [
"public",
"function",
"abort",
"(",
"$",
"msg",
"=",
"null",
",",
"$",
"type",
"=",
"null",
")",
"{",
"$",
"retval",
"=",
"true",
";",
"$",
"step",
"=",
"array_pop",
"(",
"$",
"this",
"->",
"stepStack",
")",
";",
"// Raise abort warning",
"if",
"(",
... | Installation abort method
@param string $msg Abort message from the installer
@param string $type Package type if defined
@return boolean True if successful
@since 3.1
@throws RuntimeException | [
"Installation",
"abort",
"method"
] | 65771963f23ccabcf1f867eb17c9452299cfe683 | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Installer/Installer.php#L233-L279 |
19,132 | jfusion/org.jfusion.framework | src/Installer/Installer.php | Installer.parseFiles | public function parseFiles(SimpleXMLElement $element, $cid = 0, $oldFiles = null, $oldMD5 = null)
{
// Get the array of file nodes to process; we checked whether this had children above.
if (!$element || !$element->children()->count())
{
// Either the tag does not exist or has no children (hence no files to p... | php | public function parseFiles(SimpleXMLElement $element, $cid = 0, $oldFiles = null, $oldMD5 = null)
{
// Get the array of file nodes to process; we checked whether this had children above.
if (!$element || !$element->children()->count())
{
// Either the tag does not exist or has no children (hence no files to p... | [
"public",
"function",
"parseFiles",
"(",
"SimpleXMLElement",
"$",
"element",
",",
"$",
"cid",
"=",
"0",
",",
"$",
"oldFiles",
"=",
"null",
",",
"$",
"oldMD5",
"=",
"null",
")",
"{",
"// Get the array of file nodes to process; we checked whether this had children above... | Method to parse through a files element of the installation manifest and take appropriate
action.
@param SimpleXMLElement $element The XML node to process
@param integer $cid Application ID of application to install to
@param array $oldFiles List of old files (SimpleXMLElement's)
... | [
"Method",
"to",
"parse",
"through",
"a",
"files",
"element",
"of",
"the",
"installation",
"manifest",
"and",
"take",
"appropriate",
"action",
"."
] | 65771963f23ccabcf1f867eb17c9452299cfe683 | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Installer/Installer.php#L295-L400 |
19,133 | Lansoweb/LosReCaptcha | src/Service/Request/ZendHttpClient.php | ZendHttpClient.send | public function send(Parameters $params)
{
$this->client->setUri(ReCaptcha::VERIFY_SERVER);
$this->client->setRawBody($params->toQueryString());
$this->client->setEncType('application/x-www-form-urlencoded');
$result = $this->client->setMethod('POST')->send();
return $result ... | php | public function send(Parameters $params)
{
$this->client->setUri(ReCaptcha::VERIFY_SERVER);
$this->client->setRawBody($params->toQueryString());
$this->client->setEncType('application/x-www-form-urlencoded');
$result = $this->client->setMethod('POST')->send();
return $result ... | [
"public",
"function",
"send",
"(",
"Parameters",
"$",
"params",
")",
"{",
"$",
"this",
"->",
"client",
"->",
"setUri",
"(",
"ReCaptcha",
"::",
"VERIFY_SERVER",
")",
";",
"$",
"this",
"->",
"client",
"->",
"setRawBody",
"(",
"$",
"params",
"->",
"toQueryS... | Submit ReCaptcha API request, return response body.
@param Parameters $params ReCaptcha parameters
@return string | [
"Submit",
"ReCaptcha",
"API",
"request",
"return",
"response",
"body",
"."
] | 8df866995501db087c3850f97fd2b6547632e6ed | https://github.com/Lansoweb/LosReCaptcha/blob/8df866995501db087c3850f97fd2b6547632e6ed/src/Service/Request/ZendHttpClient.php#L33-L40 |
19,134 | wikimedia/CLDRPluralRuleParser | src/Converter/Operator.php | Operator.operate | public function operate( Expression $left, Expression $right ) {
$typeSpec = self::$opTypes[$this->name];
$leftType = self::$typeSpecMap[$typeSpec[0]];
$rightType = self::$typeSpecMap[$typeSpec[1]];
$resultType = self::$typeSpecMap[$typeSpec[2]];
$start = min( $this->pos, $left->pos, $right->pos );
$end =... | php | public function operate( Expression $left, Expression $right ) {
$typeSpec = self::$opTypes[$this->name];
$leftType = self::$typeSpecMap[$typeSpec[0]];
$rightType = self::$typeSpecMap[$typeSpec[1]];
$resultType = self::$typeSpecMap[$typeSpec[2]];
$start = min( $this->pos, $left->pos, $right->pos );
$end =... | [
"public",
"function",
"operate",
"(",
"Expression",
"$",
"left",
",",
"Expression",
"$",
"right",
")",
"{",
"$",
"typeSpec",
"=",
"self",
"::",
"$",
"opTypes",
"[",
"$",
"this",
"->",
"name",
"]",
";",
"$",
"leftType",
"=",
"self",
"::",
"$",
"typeSp... | Compute the operation
@param Expression $left The left part of the expression
@param Expression $right The right part of the expression
@return Expression The result of the operation | [
"Compute",
"the",
"operation"
] | 4c5d71a3fd62a75871da8562310ca2258647ee6d | https://github.com/wikimedia/CLDRPluralRuleParser/blob/4c5d71a3fd62a75871da8562310ca2258647ee6d/src/Converter/Operator.php#L89-L113 |
19,135 | steeffeen/FancyManiaLinks | FML/Script/Features/Paging.php | Paging.addPageControl | public function addPageControl(Control $pageControl, $pageNumber = null)
{
if ($pageNumber === null) {
$pageNumber = count($this->pages) + 1;
}
$page = new PagingPage($pageControl, $pageNumber);
return $this->addPage($page);
} | php | public function addPageControl(Control $pageControl, $pageNumber = null)
{
if ($pageNumber === null) {
$pageNumber = count($this->pages) + 1;
}
$page = new PagingPage($pageControl, $pageNumber);
return $this->addPage($page);
} | [
"public",
"function",
"addPageControl",
"(",
"Control",
"$",
"pageControl",
",",
"$",
"pageNumber",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"pageNumber",
"===",
"null",
")",
"{",
"$",
"pageNumber",
"=",
"count",
"(",
"$",
"this",
"->",
"pages",
")",
"+"... | Add a new Page Control
@api
@param Control $pageControl Page Control
@param string $pageNumber (optional) Page number
@return static | [
"Add",
"a",
"new",
"Page",
"Control"
] | 227b0759306f0a3c75873ba50276e4163a93bfa6 | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/Features/Paging.php#L133-L140 |
19,136 | steeffeen/FancyManiaLinks | FML/Script/Features/Paging.php | Paging.addPage | public function addPage(PagingPage $page)
{
if (!in_array($page, $this->pages, true)) {
array_push($this->pages, $page);
}
return $this;
} | php | public function addPage(PagingPage $page)
{
if (!in_array($page, $this->pages, true)) {
array_push($this->pages, $page);
}
return $this;
} | [
"public",
"function",
"addPage",
"(",
"PagingPage",
"$",
"page",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"page",
",",
"$",
"this",
"->",
"pages",
",",
"true",
")",
")",
"{",
"array_push",
"(",
"$",
"this",
"->",
"pages",
",",
"$",
"page",
... | Add a new Page
@api
@param PagingPage $page Page
@return static | [
"Add",
"a",
"new",
"Page"
] | 227b0759306f0a3c75873ba50276e4163a93bfa6 | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/Features/Paging.php#L149-L155 |
19,137 | steeffeen/FancyManiaLinks | FML/Script/Features/Paging.php | Paging.setPages | public function setPages(array $pages)
{
$this->pages = array();
foreach ($pages as $page) {
$this->addPage($page);
}
return $this;
} | php | public function setPages(array $pages)
{
$this->pages = array();
foreach ($pages as $page) {
$this->addPage($page);
}
return $this;
} | [
"public",
"function",
"setPages",
"(",
"array",
"$",
"pages",
")",
"{",
"$",
"this",
"->",
"pages",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"pages",
"as",
"$",
"page",
")",
"{",
"$",
"this",
"->",
"addPage",
"(",
"$",
"page",
")",
";",
... | Add new Pages
@api
@param PagingPage[] $pages Pages
@return static | [
"Add",
"new",
"Pages"
] | 227b0759306f0a3c75873ba50276e4163a93bfa6 | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/Features/Paging.php#L164-L171 |
19,138 | steeffeen/FancyManiaLinks | FML/Script/Features/Paging.php | Paging.addButtonControl | public function addButtonControl(Control $buttonControl, $browseAction = null)
{
if ($browseAction === null) {
$buttonCount = count($this->buttons);
if ($buttonCount % 2 === 0) {
$browseAction = $buttonCount / 2 + 1;
} else {
$browseAction ... | php | public function addButtonControl(Control $buttonControl, $browseAction = null)
{
if ($browseAction === null) {
$buttonCount = count($this->buttons);
if ($buttonCount % 2 === 0) {
$browseAction = $buttonCount / 2 + 1;
} else {
$browseAction ... | [
"public",
"function",
"addButtonControl",
"(",
"Control",
"$",
"buttonControl",
",",
"$",
"browseAction",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"browseAction",
"===",
"null",
")",
"{",
"$",
"buttonCount",
"=",
"count",
"(",
"$",
"this",
"->",
"buttons",
... | Add a new Button Control to browse through the Pages
@api
@param Control $buttonControl Button used for browsing
@param int $browseAction (optional) Number of browsed Pages per click
@return static | [
"Add",
"a",
"new",
"Button",
"Control",
"to",
"browse",
"through",
"the",
"Pages"
] | 227b0759306f0a3c75873ba50276e4163a93bfa6 | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/Features/Paging.php#L192-L204 |
19,139 | steeffeen/FancyManiaLinks | FML/Script/Features/Paging.php | Paging.addButton | public function addButton(PagingButton $button)
{
if (!in_array($button, $this->buttons, true)) {
array_push($this->buttons, $button);
}
return $this;
} | php | public function addButton(PagingButton $button)
{
if (!in_array($button, $this->buttons, true)) {
array_push($this->buttons, $button);
}
return $this;
} | [
"public",
"function",
"addButton",
"(",
"PagingButton",
"$",
"button",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"button",
",",
"$",
"this",
"->",
"buttons",
",",
"true",
")",
")",
"{",
"array_push",
"(",
"$",
"this",
"->",
"buttons",
",",
"$",... | Add a new Button to browse through Pages
@api
@param PagingButton $button Paging Button
@return static | [
"Add",
"a",
"new",
"Button",
"to",
"browse",
"through",
"Pages"
] | 227b0759306f0a3c75873ba50276e4163a93bfa6 | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/Features/Paging.php#L213-L219 |
19,140 | steeffeen/FancyManiaLinks | FML/Script/Features/Paging.php | Paging.setButtons | public function setButtons(array $buttons)
{
$this->buttons = array();
foreach ($buttons as $button) {
$this->addButton($button);
}
return $this;
} | php | public function setButtons(array $buttons)
{
$this->buttons = array();
foreach ($buttons as $button) {
$this->addButton($button);
}
return $this;
} | [
"public",
"function",
"setButtons",
"(",
"array",
"$",
"buttons",
")",
"{",
"$",
"this",
"->",
"buttons",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"buttons",
"as",
"$",
"button",
")",
"{",
"$",
"this",
"->",
"addButton",
"(",
"$",
"button",
... | Set the Paging Buttons
@api
@param PagingButton[] $buttons Paging Buttons
@return static | [
"Set",
"the",
"Paging",
"Buttons"
] | 227b0759306f0a3c75873ba50276e4163a93bfa6 | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/Features/Paging.php#L228-L235 |
19,141 | steeffeen/FancyManiaLinks | FML/Script/Features/Paging.php | Paging.getMinPage | protected function getMinPage()
{
$minPageNumber = null;
$minPage = null;
foreach ($this->pages as $page) {
$pageNumber = $page->getPageNumber();
if ($minPageNumber === null || $pageNumber < $minPageNumber) {
$minPageNumber = $pageNumber;
... | php | protected function getMinPage()
{
$minPageNumber = null;
$minPage = null;
foreach ($this->pages as $page) {
$pageNumber = $page->getPageNumber();
if ($minPageNumber === null || $pageNumber < $minPageNumber) {
$minPageNumber = $pageNumber;
... | [
"protected",
"function",
"getMinPage",
"(",
")",
"{",
"$",
"minPageNumber",
"=",
"null",
";",
"$",
"minPage",
"=",
"null",
";",
"foreach",
"(",
"$",
"this",
"->",
"pages",
"as",
"$",
"page",
")",
"{",
"$",
"pageNumber",
"=",
"$",
"page",
"->",
"getPa... | Get the minimum Page
@return PagingPage | [
"Get",
"the",
"minimum",
"Page"
] | 227b0759306f0a3c75873ba50276e4163a93bfa6 | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/Features/Paging.php#L466-L478 |
19,142 | steeffeen/FancyManiaLinks | FML/Script/Features/Paging.php | Paging.getMaxPage | protected function getMaxPage()
{
$maxPageNumber = null;
$maxPage = null;
foreach ($this->pages as $page) {
$pageNumber = $page->getPageNumber();
if ($maxPageNumber === null || $pageNumber > $maxPageNumber) {
$maxPageNumber = $pageNumber;
... | php | protected function getMaxPage()
{
$maxPageNumber = null;
$maxPage = null;
foreach ($this->pages as $page) {
$pageNumber = $page->getPageNumber();
if ($maxPageNumber === null || $pageNumber > $maxPageNumber) {
$maxPageNumber = $pageNumber;
... | [
"protected",
"function",
"getMaxPage",
"(",
")",
"{",
"$",
"maxPageNumber",
"=",
"null",
";",
"$",
"maxPage",
"=",
"null",
";",
"foreach",
"(",
"$",
"this",
"->",
"pages",
"as",
"$",
"page",
")",
"{",
"$",
"pageNumber",
"=",
"$",
"page",
"->",
"getPa... | Get the maximum Page
@return PagingPage | [
"Get",
"the",
"maximum",
"Page"
] | 227b0759306f0a3c75873ba50276e4163a93bfa6 | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/Features/Paging.php#L485-L497 |
19,143 | steeffeen/FancyManiaLinks | FML/Script/Features/Paging.php | Paging.getPagesArrayText | protected function getPagesArrayText()
{
if (empty($this->pages)) {
return Builder::getArray(array(0 => ''), true);
}
$pages = array();
foreach ($this->pages as $page) {
$pages[$page->getPageNumber()] = $page->getControl()
... | php | protected function getPagesArrayText()
{
if (empty($this->pages)) {
return Builder::getArray(array(0 => ''), true);
}
$pages = array();
foreach ($this->pages as $page) {
$pages[$page->getPageNumber()] = $page->getControl()
... | [
"protected",
"function",
"getPagesArrayText",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"pages",
")",
")",
"{",
"return",
"Builder",
"::",
"getArray",
"(",
"array",
"(",
"0",
"=>",
"''",
")",
",",
"true",
")",
";",
"}",
"$",
"pages... | Build the array text for the Pages
@return string | [
"Build",
"the",
"array",
"text",
"for",
"the",
"Pages"
] | 227b0759306f0a3c75873ba50276e4163a93bfa6 | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/Features/Paging.php#L504-L515 |
19,144 | steeffeen/FancyManiaLinks | FML/Script/Features/Paging.php | Paging.getPageButtonsArrayText | protected function getPageButtonsArrayText()
{
if (empty($this->buttons)) {
return Builder::getArray(array('' => 0), true);
}
$pageButtons = array();
foreach ($this->buttons as $pageButton) {
$pageButtons[$pageButton->getControl()
... | php | protected function getPageButtonsArrayText()
{
if (empty($this->buttons)) {
return Builder::getArray(array('' => 0), true);
}
$pageButtons = array();
foreach ($this->buttons as $pageButton) {
$pageButtons[$pageButton->getControl()
... | [
"protected",
"function",
"getPageButtonsArrayText",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"buttons",
")",
")",
"{",
"return",
"Builder",
"::",
"getArray",
"(",
"array",
"(",
"''",
"=>",
"0",
")",
",",
"true",
")",
";",
"}",
"$",
... | Build the array text for the Page Buttons
@return string | [
"Build",
"the",
"array",
"text",
"for",
"the",
"Page",
"Buttons"
] | 227b0759306f0a3c75873ba50276e4163a93bfa6 | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/Features/Paging.php#L522-L533 |
19,145 | guillermoandrae/php-repository | src/Repositories/RepositoryFactory.php | RepositoryFactory.factory | public static function factory(string $name, $options = null): RepositoryInterface
{
try {
$className = sprintf(
'%s\%sRepository',
self::getNamespace(),
ucfirst(strtolower($name))
);
$reflectionClass = new \ReflectionClass(... | php | public static function factory(string $name, $options = null): RepositoryInterface
{
try {
$className = sprintf(
'%s\%sRepository',
self::getNamespace(),
ucfirst(strtolower($name))
);
$reflectionClass = new \ReflectionClass(... | [
"public",
"static",
"function",
"factory",
"(",
"string",
"$",
"name",
",",
"$",
"options",
"=",
"null",
")",
":",
"RepositoryInterface",
"{",
"try",
"{",
"$",
"className",
"=",
"sprintf",
"(",
"'%s\\%sRepository'",
",",
"self",
"::",
"getNamespace",
"(",
... | Returns the desired repository using the provided data.
@param string $name The name of the desired repository.
@param mixed|null $options The data needed to build the repository.
@return RepositoryInterface
@throws InvalidRepositoryException Thrown when an invalid repository is
requested. | [
"Returns",
"the",
"desired",
"repository",
"using",
"the",
"provided",
"data",
"."
] | 8cf9c50c7c7f4c08190b3232df77e21e706e7a2a | https://github.com/guillermoandrae/php-repository/blob/8cf9c50c7c7f4c08190b3232df77e21e706e7a2a/src/Repositories/RepositoryFactory.php#L53-L71 |
19,146 | xinix-technology/norm | src/Norm/Type/Object.php | Object.toObject | public function toObject()
{
$obj = new stdClass();
if (! empty($this->attributes)) {
foreach ($this->attributes as $key => $value) {
$obj->$key = $value;
}
}
return $obj;
} | php | public function toObject()
{
$obj = new stdClass();
if (! empty($this->attributes)) {
foreach ($this->attributes as $key => $value) {
$obj->$key = $value;
}
}
return $obj;
} | [
"public",
"function",
"toObject",
"(",
")",
"{",
"$",
"obj",
"=",
"new",
"stdClass",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"attributes",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"attributes",
"as",
"$",
"key",
"... | Convert this class to a standard object.
@return \stdClass | [
"Convert",
"this",
"class",
"to",
"a",
"standard",
"object",
"."
] | c357f7d3a75d05324dd84b8f6a968a094c53d603 | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Type/Object.php#L20-L31 |
19,147 | davidgorges/color-contrast-php | src/ContrastAlgorithm/LuminosityContrast.php | LuminosityContrast.calculate | public function calculate(ColorJizz $foreground, ColorJizz $background)
{
$fgLuma = $this->relativeLuminosity($foreground->toRGB());
$bgLuma = $this->relativeLuminosity($background->toRGB());
if ($fgLuma > $bgLuma) {
return ($fgLuma + 0.05) / ($bgLuma + 0.05);
} else {... | php | public function calculate(ColorJizz $foreground, ColorJizz $background)
{
$fgLuma = $this->relativeLuminosity($foreground->toRGB());
$bgLuma = $this->relativeLuminosity($background->toRGB());
if ($fgLuma > $bgLuma) {
return ($fgLuma + 0.05) / ($bgLuma + 0.05);
} else {... | [
"public",
"function",
"calculate",
"(",
"ColorJizz",
"$",
"foreground",
",",
"ColorJizz",
"$",
"background",
")",
"{",
"$",
"fgLuma",
"=",
"$",
"this",
"->",
"relativeLuminosity",
"(",
"$",
"foreground",
"->",
"toRGB",
"(",
")",
")",
";",
"$",
"bgLuma",
... | returns the contrast ratio between foreground and background color.
@param ColorJizz $foreground
@param ColorJizz $background
@return float | [
"returns",
"the",
"contrast",
"ratio",
"between",
"foreground",
"and",
"background",
"color",
"."
] | 11edc6e04ce73d8d9b0bffeda1586f2c2fa22e71 | https://github.com/davidgorges/color-contrast-php/blob/11edc6e04ce73d8d9b0bffeda1586f2c2fa22e71/src/ContrastAlgorithm/LuminosityContrast.php#L24-L34 |
19,148 | stanislav-web/phalcon-ulogin | src/ULogin/Parser.php | Parser.arrayResolve | public static function arrayResolve(array $data)
{
$array = [];
foreach ($data as $provider => $bool) {
if ($bool === true) {
$array['required'][] = $provider;
}
else {
$array['hidden'][] = $provider;
}
}
... | php | public static function arrayResolve(array $data)
{
$array = [];
foreach ($data as $provider => $bool) {
if ($bool === true) {
$array['required'][] = $provider;
}
else {
$array['hidden'][] = $provider;
}
}
... | [
"public",
"static",
"function",
"arrayResolve",
"(",
"array",
"$",
"data",
")",
"{",
"$",
"array",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"data",
"as",
"$",
"provider",
"=>",
"$",
"bool",
")",
"{",
"if",
"(",
"$",
"bool",
"===",
"true",
")",
"{... | Resolve array data as providers
@param array $data
@access static
@return array | [
"Resolve",
"array",
"data",
"as",
"providers"
] | 0cea8510a244ebb9b1333085b325a283e4fb9f2f | https://github.com/stanislav-web/phalcon-ulogin/blob/0cea8510a244ebb9b1333085b325a283e4fb9f2f/src/ULogin/Parser.php#L44-L64 |
19,149 | stanislav-web/phalcon-ulogin | src/ULogin/Parser.php | Parser.isDelim | private static function isDelim($provider, $delimiter = '=')
{
if (mb_strpos($provider, $delimiter) !== false) {
$res = explode('=', $provider);
return $res;
}
return false;
} | php | private static function isDelim($provider, $delimiter = '=')
{
if (mb_strpos($provider, $delimiter) !== false) {
$res = explode('=', $provider);
return $res;
}
return false;
} | [
"private",
"static",
"function",
"isDelim",
"(",
"$",
"provider",
",",
"$",
"delimiter",
"=",
"'='",
")",
"{",
"if",
"(",
"mb_strpos",
"(",
"$",
"provider",
",",
"$",
"delimiter",
")",
"!==",
"false",
")",
"{",
"$",
"res",
"=",
"explode",
"(",
"'='",... | Check if data has delimiter
@param string $provider
@param string $delimiter
@access static
@return array|false | [
"Check",
"if",
"data",
"has",
"delimiter"
] | 0cea8510a244ebb9b1333085b325a283e4fb9f2f | https://github.com/stanislav-web/phalcon-ulogin/blob/0cea8510a244ebb9b1333085b325a283e4fb9f2f/src/ULogin/Parser.php#L120-L131 |
19,150 | yuncms/framework | src/helpers/Html.php | Html.encodeParams | public static function encodeParams(string $html, array $variables = []): string
{
// Normalize the param keys
$normalizedVariables = [];
if (is_array($variables)) {
foreach ($variables as $key => $value) {
$key = '{' . trim($key, '{}') . '}';
$nor... | php | public static function encodeParams(string $html, array $variables = []): string
{
// Normalize the param keys
$normalizedVariables = [];
if (is_array($variables)) {
foreach ($variables as $key => $value) {
$key = '{' . trim($key, '{}') . '}';
$nor... | [
"public",
"static",
"function",
"encodeParams",
"(",
"string",
"$",
"html",
",",
"array",
"$",
"variables",
"=",
"[",
"]",
")",
":",
"string",
"{",
"// Normalize the param keys",
"$",
"normalizedVariables",
"=",
"[",
"]",
";",
"if",
"(",
"is_array",
"(",
"... | Will take an HTML string and an associative array of key=>value pairs, HTML encode the values and swap them back
into the original string using the keys as tokens.
@param string $html The HTML string.
@param array $variables An associative array of key => value pairs to be applied to the HTML string using `strtr`.
@re... | [
"Will",
"take",
"an",
"HTML",
"string",
"and",
"an",
"associative",
"array",
"of",
"key",
"=",
">",
"value",
"pairs",
"HTML",
"encode",
"the",
"values",
"and",
"swap",
"them",
"back",
"into",
"the",
"original",
"string",
"using",
"the",
"keys",
"as",
"to... | af42e28ea4ae15ab8eead3f6d119f93863b94154 | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/helpers/Html.php#L82-L94 |
19,151 | factorio-item-browser/export-data | src/Entity/Icon/Color.php | Color.setRed | public function setRed(float $red, float $scale = 1.)
{
$this->red = $this->setComponent($red, $scale);
return $this;
} | php | public function setRed(float $red, float $scale = 1.)
{
$this->red = $this->setComponent($red, $scale);
return $this;
} | [
"public",
"function",
"setRed",
"(",
"float",
"$",
"red",
",",
"float",
"$",
"scale",
"=",
"1.",
")",
"{",
"$",
"this",
"->",
"red",
"=",
"$",
"this",
"->",
"setComponent",
"(",
"$",
"red",
",",
"$",
"scale",
")",
";",
"return",
"$",
"this",
";",... | Sets the red component of the color.
@param float $red
@param float $scale
@return $this | [
"Sets",
"the",
"red",
"component",
"of",
"the",
"color",
"."
] | 1413b2eed0fbfed0521457ac7ef0d668ac30c212 | https://github.com/factorio-item-browser/export-data/blob/1413b2eed0fbfed0521457ac7ef0d668ac30c212/src/Entity/Icon/Color.php#L50-L54 |
19,152 | factorio-item-browser/export-data | src/Entity/Icon/Color.php | Color.setGreen | public function setGreen(float $green, float $scale = 1.)
{
$this->green = $this->setComponent($green, $scale);
return $this;
} | php | public function setGreen(float $green, float $scale = 1.)
{
$this->green = $this->setComponent($green, $scale);
return $this;
} | [
"public",
"function",
"setGreen",
"(",
"float",
"$",
"green",
",",
"float",
"$",
"scale",
"=",
"1.",
")",
"{",
"$",
"this",
"->",
"green",
"=",
"$",
"this",
"->",
"setComponent",
"(",
"$",
"green",
",",
"$",
"scale",
")",
";",
"return",
"$",
"this"... | Sets the green component of the color.
@param float $green
@param float $scale
@return $this | [
"Sets",
"the",
"green",
"component",
"of",
"the",
"color",
"."
] | 1413b2eed0fbfed0521457ac7ef0d668ac30c212 | https://github.com/factorio-item-browser/export-data/blob/1413b2eed0fbfed0521457ac7ef0d668ac30c212/src/Entity/Icon/Color.php#L72-L76 |
19,153 | factorio-item-browser/export-data | src/Entity/Icon/Color.php | Color.setBlue | public function setBlue(float $blue, float $scale = 1.)
{
$this->blue = $this->setComponent($blue, $scale);
return $this;
} | php | public function setBlue(float $blue, float $scale = 1.)
{
$this->blue = $this->setComponent($blue, $scale);
return $this;
} | [
"public",
"function",
"setBlue",
"(",
"float",
"$",
"blue",
",",
"float",
"$",
"scale",
"=",
"1.",
")",
"{",
"$",
"this",
"->",
"blue",
"=",
"$",
"this",
"->",
"setComponent",
"(",
"$",
"blue",
",",
"$",
"scale",
")",
";",
"return",
"$",
"this",
... | Sets the blue component of the color.
@param float $blue
@param float $scale
@return $this | [
"Sets",
"the",
"blue",
"component",
"of",
"the",
"color",
"."
] | 1413b2eed0fbfed0521457ac7ef0d668ac30c212 | https://github.com/factorio-item-browser/export-data/blob/1413b2eed0fbfed0521457ac7ef0d668ac30c212/src/Entity/Icon/Color.php#L94-L98 |
19,154 | factorio-item-browser/export-data | src/Entity/Icon/Color.php | Color.setAlpha | public function setAlpha(float $alpha, float $scale = 1.)
{
$this->alpha = $this->setComponent($alpha, $scale);
return $this;
} | php | public function setAlpha(float $alpha, float $scale = 1.)
{
$this->alpha = $this->setComponent($alpha, $scale);
return $this;
} | [
"public",
"function",
"setAlpha",
"(",
"float",
"$",
"alpha",
",",
"float",
"$",
"scale",
"=",
"1.",
")",
"{",
"$",
"this",
"->",
"alpha",
"=",
"$",
"this",
"->",
"setComponent",
"(",
"$",
"alpha",
",",
"$",
"scale",
")",
";",
"return",
"$",
"this"... | Sets the alpha component of the color.
@param float $alpha
@param float $scale
@return $this | [
"Sets",
"the",
"alpha",
"component",
"of",
"the",
"color",
"."
] | 1413b2eed0fbfed0521457ac7ef0d668ac30c212 | https://github.com/factorio-item-browser/export-data/blob/1413b2eed0fbfed0521457ac7ef0d668ac30c212/src/Entity/Icon/Color.php#L116-L120 |
19,155 | factorio-item-browser/export-data | src/Entity/Icon/Color.php | Color.setComponent | protected function setComponent(float $value, float $scale): float
{
return ($scale < 0) ? (1 - $value / -$scale) : ($value / $scale);
} | php | protected function setComponent(float $value, float $scale): float
{
return ($scale < 0) ? (1 - $value / -$scale) : ($value / $scale);
} | [
"protected",
"function",
"setComponent",
"(",
"float",
"$",
"value",
",",
"float",
"$",
"scale",
")",
":",
"float",
"{",
"return",
"(",
"$",
"scale",
"<",
"0",
")",
"?",
"(",
"1",
"-",
"$",
"value",
"/",
"-",
"$",
"scale",
")",
":",
"(",
"$",
"... | Calculates the value to set a component.
@param float $value
@param float $scale
@return float | [
"Calculates",
"the",
"value",
"to",
"set",
"a",
"component",
"."
] | 1413b2eed0fbfed0521457ac7ef0d668ac30c212 | https://github.com/factorio-item-browser/export-data/blob/1413b2eed0fbfed0521457ac7ef0d668ac30c212/src/Entity/Icon/Color.php#L138-L141 |
19,156 | factorio-item-browser/export-data | src/Entity/Icon/Color.php | Color.getComponent | protected function getComponent(float $value, float $scale): float
{
return ($scale < 0) ? ((1 - $value) * -$scale) : ($value * $scale);
} | php | protected function getComponent(float $value, float $scale): float
{
return ($scale < 0) ? ((1 - $value) * -$scale) : ($value * $scale);
} | [
"protected",
"function",
"getComponent",
"(",
"float",
"$",
"value",
",",
"float",
"$",
"scale",
")",
":",
"float",
"{",
"return",
"(",
"$",
"scale",
"<",
"0",
")",
"?",
"(",
"(",
"1",
"-",
"$",
"value",
")",
"*",
"-",
"$",
"scale",
")",
":",
"... | Calculates the value to get a component.
@param float $value
@param float $scale
@return float | [
"Calculates",
"the",
"value",
"to",
"get",
"a",
"component",
"."
] | 1413b2eed0fbfed0521457ac7ef0d668ac30c212 | https://github.com/factorio-item-browser/export-data/blob/1413b2eed0fbfed0521457ac7ef0d668ac30c212/src/Entity/Icon/Color.php#L149-L152 |
19,157 | aedart/laravel-helpers | src/Traits/Notifications/NotificationDispatcherTrait.php | NotificationDispatcherTrait.getNotificationDispatcher | public function getNotificationDispatcher(): ?Dispatcher
{
if (!$this->hasNotificationDispatcher()) {
$this->setNotificationDispatcher($this->getDefaultNotificationDispatcher());
}
return $this->notificationDispatcher;
} | php | public function getNotificationDispatcher(): ?Dispatcher
{
if (!$this->hasNotificationDispatcher()) {
$this->setNotificationDispatcher($this->getDefaultNotificationDispatcher());
}
return $this->notificationDispatcher;
} | [
"public",
"function",
"getNotificationDispatcher",
"(",
")",
":",
"?",
"Dispatcher",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasNotificationDispatcher",
"(",
")",
")",
"{",
"$",
"this",
"->",
"setNotificationDispatcher",
"(",
"$",
"this",
"->",
"getDefaultNot... | Get notification dispatcher
If no notification dispatcher has been set, this method will
set and return a default notification dispatcher, if any such
value is available
@see getDefaultNotificationDispatcher()
@return Dispatcher|null notification dispatcher or null if none notification dispatcher has been set | [
"Get",
"notification",
"dispatcher"
] | 8b81a2d6658f3f8cb62b6be2c34773aaa2df219a | https://github.com/aedart/laravel-helpers/blob/8b81a2d6658f3f8cb62b6be2c34773aaa2df219a/src/Traits/Notifications/NotificationDispatcherTrait.php#L53-L59 |
19,158 | ClanCats/Core | src/classes/CCUrl.php | CCUrl._init | public static function _init()
{
static::$path_offset = ClanCats::$config->get( 'url.path', '/' );
if ( empty( static::$path_offset ) )
{
static::$path_offset = '/';
}
if ( substr( static::$path_offset, -1 ) != '/' )
{
static::$path_offset .= '/';
}
// register the default parameter providers... | php | public static function _init()
{
static::$path_offset = ClanCats::$config->get( 'url.path', '/' );
if ( empty( static::$path_offset ) )
{
static::$path_offset = '/';
}
if ( substr( static::$path_offset, -1 ) != '/' )
{
static::$path_offset .= '/';
}
// register the default parameter providers... | [
"public",
"static",
"function",
"_init",
"(",
")",
"{",
"static",
"::",
"$",
"path_offset",
"=",
"ClanCats",
"::",
"$",
"config",
"->",
"get",
"(",
"'url.path'",
",",
"'/'",
")",
";",
"if",
"(",
"empty",
"(",
"static",
"::",
"$",
"path_offset",
")",
... | static CCUrl initialisation | [
"static",
"CCUrl",
"initialisation"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCUrl.php#L32-L62 |
19,159 | ClanCats/Core | src/classes/CCUrl.php | CCUrl.to | public static function to( $uri = '', $params = array(), $retain = false )
{
// To avoid // urls we check for a single slash.
if ( $uri === '/' )
{
$uri = '';
}
// When the uri starts with an @ sign we handle the uri as route alias.
if ( substr( $uri, 0, 1 ) == '@' )
{
return static::alias( sub... | php | public static function to( $uri = '', $params = array(), $retain = false )
{
// To avoid // urls we check for a single slash.
if ( $uri === '/' )
{
$uri = '';
}
// When the uri starts with an @ sign we handle the uri as route alias.
if ( substr( $uri, 0, 1 ) == '@' )
{
return static::alias( sub... | [
"public",
"static",
"function",
"to",
"(",
"$",
"uri",
"=",
"''",
",",
"$",
"params",
"=",
"array",
"(",
")",
",",
"$",
"retain",
"=",
"false",
")",
"{",
"// To avoid // urls we check for a single slash.",
"if",
"(",
"$",
"uri",
"===",
"'/'",
")",
"{",
... | Generate an url
@param string $uri
@param array $params
@param bool $retain Should we keep the get parameters?
@return string | [
"Generate",
"an",
"url"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCUrl.php#L84-L167 |
19,160 | ClanCats/Core | src/classes/CCUrl.php | CCUrl.alias | public static function alias( $alias, $params = array(), $retain = false )
{
$route_params = array();
// to handle the suffix after a slash in an alias define
$suffix = '';
if ( strpos( $alias, '/' ) !== false && $alias !== '/' )
{
// slashes in aliases get appended as suffix
list( $alias, $suffi... | php | public static function alias( $alias, $params = array(), $retain = false )
{
$route_params = array();
// to handle the suffix after a slash in an alias define
$suffix = '';
if ( strpos( $alias, '/' ) !== false && $alias !== '/' )
{
// slashes in aliases get appended as suffix
list( $alias, $suffi... | [
"public",
"static",
"function",
"alias",
"(",
"$",
"alias",
",",
"$",
"params",
"=",
"array",
"(",
")",
",",
"$",
"retain",
"=",
"false",
")",
"{",
"$",
"route_params",
"=",
"array",
"(",
")",
";",
"// to handle the suffix after a slash in an alias define",
... | Create an URL based on an router alias
@param string $alias
@param array $params
@param bool $retain Should we keep the get parameters?
@return string | [
"Create",
"an",
"URL",
"based",
"on",
"an",
"router",
"alias"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCUrl.php#L177-L204 |
19,161 | ClanCats/Core | src/classes/CCUrl.php | CCUrl.full | public static function full( $uri = '', $params = array(), $retain = false )
{
return CCIn::protocol().'://'.CCIn::host().static::to( $uri, $params, $retain );
} | php | public static function full( $uri = '', $params = array(), $retain = false )
{
return CCIn::protocol().'://'.CCIn::host().static::to( $uri, $params, $retain );
} | [
"public",
"static",
"function",
"full",
"(",
"$",
"uri",
"=",
"''",
",",
"$",
"params",
"=",
"array",
"(",
")",
",",
"$",
"retain",
"=",
"false",
")",
"{",
"return",
"CCIn",
"::",
"protocol",
"(",
")",
".",
"'://'",
".",
"CCIn",
"::",
"host",
"("... | Create the full url including protocol and hostname
@param string $uri
@param array $params
@param bool $retain Should we keep the get parameters?
@return string | [
"Create",
"the",
"full",
"url",
"including",
"protocol",
"and",
"hostname"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCUrl.php#L214-L217 |
19,162 | ClanCats/Core | src/classes/CCUrl.php | CCUrl.secure | public static function secure( $uri = '', $params = array(), $retain = false )
{
return 'https://'.CCIn::host().static::to( $uri, $params, $retain );
} | php | public static function secure( $uri = '', $params = array(), $retain = false )
{
return 'https://'.CCIn::host().static::to( $uri, $params, $retain );
} | [
"public",
"static",
"function",
"secure",
"(",
"$",
"uri",
"=",
"''",
",",
"$",
"params",
"=",
"array",
"(",
")",
",",
"$",
"retain",
"=",
"false",
")",
"{",
"return",
"'https://'",
".",
"CCIn",
"::",
"host",
"(",
")",
".",
"static",
"::",
"to",
... | Create the url and force the https protocol
@param string $uri
@param array $params
@param bool $retain Should we keep the get parameters?
@return string | [
"Create",
"the",
"url",
"and",
"force",
"the",
"https",
"protocol"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCUrl.php#L227-L230 |
19,163 | ClanCats/Core | src/classes/CCUrl.php | CCUrl.action | public static function action( $action = '', $params = array(), $retain = false )
{
if ( $action == 'index' )
{
$action = '';
}
if ( CCRequest::current() && ( $route = CCRequest::current()->route ) )
{
$uri = $route->uri;
if ( !is_null( $route->action ) )
{
$uri = substr( $uri, 0, strl... | php | public static function action( $action = '', $params = array(), $retain = false )
{
if ( $action == 'index' )
{
$action = '';
}
if ( CCRequest::current() && ( $route = CCRequest::current()->route ) )
{
$uri = $route->uri;
if ( !is_null( $route->action ) )
{
$uri = substr( $uri, 0, strl... | [
"public",
"static",
"function",
"action",
"(",
"$",
"action",
"=",
"''",
",",
"$",
"params",
"=",
"array",
"(",
")",
",",
"$",
"retain",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"action",
"==",
"'index'",
")",
"{",
"$",
"action",
"=",
"''",
";",
... | Get the url to a action of the current route
!Important it's not possible to link between action on multiple routes
This method always assumes that all actions are in the same route.
If you want to link to another route using an alias you could do something like:
CCUrl::to( '@myalias/myaction' );
@param string $act... | [
"Get",
"the",
"url",
"to",
"a",
"action",
"of",
"the",
"current",
"route"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCUrl.php#L258-L283 |
19,164 | ClanCats/Core | src/classes/CCUrl.php | CCUrl.active | public static function active( $url )
{
$url = parse_url( $url, PHP_URL_PATH );
if ( empty( $url ) )
{
return false;
}
if ( $url[0] !== '/' )
{
$url = static::to( $url );
}
// when we are on "/" only "/" counts as active.
if ( $url === '/' )
{
return static::current() == $url;
}
/... | php | public static function active( $url )
{
$url = parse_url( $url, PHP_URL_PATH );
if ( empty( $url ) )
{
return false;
}
if ( $url[0] !== '/' )
{
$url = static::to( $url );
}
// when we are on "/" only "/" counts as active.
if ( $url === '/' )
{
return static::current() == $url;
}
/... | [
"public",
"static",
"function",
"active",
"(",
"$",
"url",
")",
"{",
"$",
"url",
"=",
"parse_url",
"(",
"$",
"url",
",",
"PHP_URL_PATH",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"url",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"$",
... | Is the given url active?
This function ignores the domain and the parameters if the
uri matches the current uri true will be returned.
@param string $url
@return bool | [
"Is",
"the",
"given",
"url",
"active?",
"This",
"function",
"ignores",
"the",
"domain",
"and",
"the",
"parameters",
"if",
"the",
"uri",
"matches",
"the",
"current",
"uri",
"true",
"will",
"be",
"returned",
"."
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCUrl.php#L293-L317 |
19,165 | CakeCMS/Core | src/Plugin.php | Plugin.getData | public static function getData($plugin, $key = null)
{
$data = self::_checkData($plugin);
if (empty($data) && $path = self::getManifestPath($plugin)) {
if (FS::isFile($path)) {
/** @noinspection PhpIncludeInspection */
$plgData = include $path;
... | php | public static function getData($plugin, $key = null)
{
$data = self::_checkData($plugin);
if (empty($data) && $path = self::getManifestPath($plugin)) {
if (FS::isFile($path)) {
/** @noinspection PhpIncludeInspection */
$plgData = include $path;
... | [
"public",
"static",
"function",
"getData",
"(",
"$",
"plugin",
",",
"$",
"key",
"=",
"null",
")",
"{",
"$",
"data",
"=",
"self",
"::",
"_checkData",
"(",
"$",
"plugin",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"data",
")",
"&&",
"$",
"path",
"=",
... | Get plugin manifest data.
@param string $plugin
@param null|string $key
@return Data | [
"Get",
"plugin",
"manifest",
"data",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Plugin.php#L88-L104 |
19,166 | CakeCMS/Core | src/Plugin.php | Plugin.getManifestPath | public static function getManifestPath($plugin)
{
if (self::loaded($plugin)) {
return FS::clean(self::path($plugin) . DS . self::PLUGIN_MANIFEST);
}
return null;
} | php | public static function getManifestPath($plugin)
{
if (self::loaded($plugin)) {
return FS::clean(self::path($plugin) . DS . self::PLUGIN_MANIFEST);
}
return null;
} | [
"public",
"static",
"function",
"getManifestPath",
"(",
"$",
"plugin",
")",
"{",
"if",
"(",
"self",
"::",
"loaded",
"(",
"$",
"plugin",
")",
")",
"{",
"return",
"FS",
"::",
"clean",
"(",
"self",
"::",
"path",
"(",
"$",
"plugin",
")",
".",
"DS",
"."... | Get absolute plugin manifest file path.
@param string $plugin
@return null|string | [
"Get",
"absolute",
"plugin",
"manifest",
"file",
"path",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Plugin.php#L123-L130 |
19,167 | CakeCMS/Core | src/Plugin.php | Plugin.loadList | public static function loadList(array $plugins)
{
foreach ($plugins as $name) {
if (self::loaded($name)) {
continue;
}
if ($path = self::_findPlugin($name)) {
self::load($name, self::_getConfigForLoad($path));
}
}
} | php | public static function loadList(array $plugins)
{
foreach ($plugins as $name) {
if (self::loaded($name)) {
continue;
}
if ($path = self::_findPlugin($name)) {
self::load($name, self::_getConfigForLoad($path));
}
}
} | [
"public",
"static",
"function",
"loadList",
"(",
"array",
"$",
"plugins",
")",
"{",
"foreach",
"(",
"$",
"plugins",
"as",
"$",
"name",
")",
"{",
"if",
"(",
"self",
"::",
"loaded",
"(",
"$",
"name",
")",
")",
"{",
"continue",
";",
"}",
"if",
"(",
... | Load list plugin.
@param array $plugins
@return void | [
"Load",
"list",
"plugin",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Plugin.php#L168-L179 |
19,168 | CakeCMS/Core | src/Plugin.php | Plugin.manifestEvent | public static function manifestEvent()
{
$args = func_get_args();
$callback = array_shift($args);
if (Arr::key($callback, self::$_eventList)) {
$callbacks = self::$_eventList[$callback];
foreach ($callbacks as $method) {
call_user_func_array($meth... | php | public static function manifestEvent()
{
$args = func_get_args();
$callback = array_shift($args);
if (Arr::key($callback, self::$_eventList)) {
$callbacks = self::$_eventList[$callback];
foreach ($callbacks as $method) {
call_user_func_array($meth... | [
"public",
"static",
"function",
"manifestEvent",
"(",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"$",
"callback",
"=",
"array_shift",
"(",
"$",
"args",
")",
";",
"if",
"(",
"Arr",
"::",
"key",
"(",
"$",
"callback",
",",
"self",
"::",... | Call plugin manifest callbacks.
@return void | [
"Call",
"plugin",
"manifest",
"callbacks",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Plugin.php#L186-L197 |
19,169 | CakeCMS/Core | src/Plugin.php | Plugin.unload | public static function unload($plugin = null)
{
if (self::loaded($plugin)) {
$locales = Configure::read('App.paths.locales');
foreach ($locales as $key => $path) {
if ($path == self::getLocalePath($plugin)) {
unset($locales[$key]);
... | php | public static function unload($plugin = null)
{
if (self::loaded($plugin)) {
$locales = Configure::read('App.paths.locales');
foreach ($locales as $key => $path) {
if ($path == self::getLocalePath($plugin)) {
unset($locales[$key]);
... | [
"public",
"static",
"function",
"unload",
"(",
"$",
"plugin",
"=",
"null",
")",
"{",
"if",
"(",
"self",
"::",
"loaded",
"(",
"$",
"plugin",
")",
")",
"{",
"$",
"locales",
"=",
"Configure",
"::",
"read",
"(",
"'App.paths.locales'",
")",
";",
"foreach",
... | Unload the plugin.
@param null|string $plugin
@return void | [
"Unload",
"the",
"plugin",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Plugin.php#L205-L219 |
19,170 | CakeCMS/Core | src/Plugin.php | Plugin._addManifestCallback | protected static function _addManifestCallback($plugin)
{
$data = Plugin::getData($plugin);
foreach ($data as $name => $callback) {
if (self::_isCallablePluginData($name, $plugin, $callback) && $plugin !== 'Core') {
self::$_eventList[$name][$plugin] = $callback;
... | php | protected static function _addManifestCallback($plugin)
{
$data = Plugin::getData($plugin);
foreach ($data as $name => $callback) {
if (self::_isCallablePluginData($name, $plugin, $callback) && $plugin !== 'Core') {
self::$_eventList[$name][$plugin] = $callback;
... | [
"protected",
"static",
"function",
"_addManifestCallback",
"(",
"$",
"plugin",
")",
"{",
"$",
"data",
"=",
"Plugin",
"::",
"getData",
"(",
"$",
"plugin",
")",
";",
"foreach",
"(",
"$",
"data",
"as",
"$",
"name",
"=>",
"$",
"callback",
")",
"{",
"if",
... | Registration plugin manifest callbacks.
@param string $plugin
@return void | [
"Registration",
"plugin",
"manifest",
"callbacks",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Plugin.php#L227-L235 |
19,171 | CakeCMS/Core | src/Plugin.php | Plugin._checkData | protected static function _checkData($plugin)
{
return (Arr::in($plugin, self::$_data)) ? self::$_data[$plugin] : [];
} | php | protected static function _checkData($plugin)
{
return (Arr::in($plugin, self::$_data)) ? self::$_data[$plugin] : [];
} | [
"protected",
"static",
"function",
"_checkData",
"(",
"$",
"plugin",
")",
"{",
"return",
"(",
"Arr",
"::",
"in",
"(",
"$",
"plugin",
",",
"self",
"::",
"$",
"_data",
")",
")",
"?",
"self",
"::",
"$",
"_data",
"[",
"$",
"plugin",
"]",
":",
"[",
"]... | Check plugin data.
@param string $plugin
@return array | [
"Check",
"plugin",
"data",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Plugin.php#L243-L246 |
19,172 | CakeCMS/Core | src/Plugin.php | Plugin._findPlugin | protected static function _findPlugin($name)
{
$output = null;
$paths = App::path('Plugin');
$plugin = Configure::read('plugins.' . $name);
if ($plugin !== null) {
return $plugin;
}
foreach ($paths as $path) {
$plgPath = $path . $name . DS;
... | php | protected static function _findPlugin($name)
{
$output = null;
$paths = App::path('Plugin');
$plugin = Configure::read('plugins.' . $name);
if ($plugin !== null) {
return $plugin;
}
foreach ($paths as $path) {
$plgPath = $path . $name . DS;
... | [
"protected",
"static",
"function",
"_findPlugin",
"(",
"$",
"name",
")",
"{",
"$",
"output",
"=",
"null",
";",
"$",
"paths",
"=",
"App",
"::",
"path",
"(",
"'Plugin'",
")",
";",
"$",
"plugin",
"=",
"Configure",
"::",
"read",
"(",
"'plugins.'",
".",
"... | Find plugin dir in registered paths.
@param string $name
@return null|string | [
"Find",
"plugin",
"dir",
"in",
"registered",
"paths",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Plugin.php#L254-L273 |
19,173 | CakeCMS/Core | src/Plugin.php | Plugin._getConfigForLoad | protected static function _getConfigForLoad($path)
{
$config = ['autoload' => true];
$routes = $path . 'config' . DS . Plugin::FILE_ROUTES;
$bootstrap = $path . 'config' . DS . Plugin::FILE_BOOTSTRAP;
if (FS::isFile($bootstrap)) {
$config['bootstrap'] = true;
... | php | protected static function _getConfigForLoad($path)
{
$config = ['autoload' => true];
$routes = $path . 'config' . DS . Plugin::FILE_ROUTES;
$bootstrap = $path . 'config' . DS . Plugin::FILE_BOOTSTRAP;
if (FS::isFile($bootstrap)) {
$config['bootstrap'] = true;
... | [
"protected",
"static",
"function",
"_getConfigForLoad",
"(",
"$",
"path",
")",
"{",
"$",
"config",
"=",
"[",
"'autoload'",
"=>",
"true",
"]",
";",
"$",
"routes",
"=",
"$",
"path",
".",
"'config'",
".",
"DS",
".",
"Plugin",
"::",
"FILE_ROUTES",
";",
"$"... | Get plugin configuration for load plugin.
@param string $path
@return array | [
"Get",
"plugin",
"configuration",
"for",
"load",
"plugin",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Plugin.php#L281-L298 |
19,174 | CakeCMS/Core | src/Plugin.php | Plugin._getPluginData | protected static function _getPluginData(array $data, $key = null)
{
if (isset($data[$key])) {
$data = $data[$key];
}
return new Data($data);
} | php | protected static function _getPluginData(array $data, $key = null)
{
if (isset($data[$key])) {
$data = $data[$key];
}
return new Data($data);
} | [
"protected",
"static",
"function",
"_getPluginData",
"(",
"array",
"$",
"data",
",",
"$",
"key",
"=",
"null",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"data",
"[",
"$",
"key",
"]",
")",
")",
"{",
"$",
"data",
"=",
"$",
"data",
"[",
"$",
"key",
"... | Get current plugin data.
@param array $data
@param null|string $key
@return Data | [
"Get",
"current",
"plugin",
"data",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Plugin.php#L307-L314 |
19,175 | CakeCMS/Core | src/Plugin.php | Plugin._isCallablePluginData | protected static function _isCallablePluginData($name, $plugin, $callback)
{
if (Arr::in($name, self::$_manifestEvents) &&
!isset(self::$_eventList[$name][$plugin]) &&
is_callable($callback)
) {
return true;
}
return false;
} | php | protected static function _isCallablePluginData($name, $plugin, $callback)
{
if (Arr::in($name, self::$_manifestEvents) &&
!isset(self::$_eventList[$name][$plugin]) &&
is_callable($callback)
) {
return true;
}
return false;
} | [
"protected",
"static",
"function",
"_isCallablePluginData",
"(",
"$",
"name",
",",
"$",
"plugin",
",",
"$",
"callback",
")",
"{",
"if",
"(",
"Arr",
"::",
"in",
"(",
"$",
"name",
",",
"self",
"::",
"$",
"_manifestEvents",
")",
"&&",
"!",
"isset",
"(",
... | Check manifest param on callable.
@param string $name
@param string $plugin
@param mixed $callback
@return bool | [
"Check",
"manifest",
"param",
"on",
"callable",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Plugin.php#L324-L334 |
19,176 | yuncms/framework | src/helpers/PasswordHelper.php | PasswordHelper.generate | public static function generate($length): string
{
$sets = ['abcdefghjkmnpqrstuvwxyz', 'ABCDEFGHJKMNPQRSTUVWXYZ', '23456789'];
$all = '';
$password = '';
foreach ($sets as $set) {
$password .= $set[array_rand(str_split($set))];
$all .= $set;
}
... | php | public static function generate($length): string
{
$sets = ['abcdefghjkmnpqrstuvwxyz', 'ABCDEFGHJKMNPQRSTUVWXYZ', '23456789'];
$all = '';
$password = '';
foreach ($sets as $set) {
$password .= $set[array_rand(str_split($set))];
$all .= $set;
}
... | [
"public",
"static",
"function",
"generate",
"(",
"$",
"length",
")",
":",
"string",
"{",
"$",
"sets",
"=",
"[",
"'abcdefghjkmnpqrstuvwxyz'",
",",
"'ABCDEFGHJKMNPQRSTUVWXYZ'",
",",
"'23456789'",
"]",
";",
"$",
"all",
"=",
"''",
";",
"$",
"password",
"=",
"'... | Generates user-friendly random password containing at least one lower case letter, one uppercase letter and one
digit. The remaining characters in the password are chosen at random from those three sets.
@see https://gist.github.com/tylerhall/521810
@param $length
@return string | [
"Generates",
"user",
"-",
"friendly",
"random",
"password",
"containing",
"at",
"least",
"one",
"lower",
"case",
"letter",
"one",
"uppercase",
"letter",
"and",
"one",
"digit",
".",
"The",
"remaining",
"characters",
"in",
"the",
"password",
"are",
"chosen",
"at... | af42e28ea4ae15ab8eead3f6d119f93863b94154 | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/helpers/PasswordHelper.php#L56-L74 |
19,177 | devemio/php-readable-timer | src/TimerPool.php | TimerPool.stop | public function stop($marker)
{
if (array_key_exists($marker, $this->timers)) {
$this->timers[$marker]->stop();
}
} | php | public function stop($marker)
{
if (array_key_exists($marker, $this->timers)) {
$this->timers[$marker]->stop();
}
} | [
"public",
"function",
"stop",
"(",
"$",
"marker",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"marker",
",",
"$",
"this",
"->",
"timers",
")",
")",
"{",
"$",
"this",
"->",
"timers",
"[",
"$",
"marker",
"]",
"->",
"stop",
"(",
")",
";",
"}"... | Stop timer with a specific marker.
@param string $marker | [
"Stop",
"timer",
"with",
"a",
"specific",
"marker",
"."
] | 50916b630eda07999dc6676528afe59fb2105615 | https://github.com/devemio/php-readable-timer/blob/50916b630eda07999dc6676528afe59fb2105615/src/TimerPool.php#L48-L53 |
19,178 | devemio/php-readable-timer | src/TimerPool.php | TimerPool.build | public function build()
{
foreach ($this->timers as $marker => $timer) {
$this->markers[$marker] = $timer->time();
}
arsort($this->markers);
return $this->markers;
} | php | public function build()
{
foreach ($this->timers as $marker => $timer) {
$this->markers[$marker] = $timer->time();
}
arsort($this->markers);
return $this->markers;
} | [
"public",
"function",
"build",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"timers",
"as",
"$",
"marker",
"=>",
"$",
"timer",
")",
"{",
"$",
"this",
"->",
"markers",
"[",
"$",
"marker",
"]",
"=",
"$",
"timer",
"->",
"time",
"(",
")",
";",
... | Return sorted times.
@return string[] | [
"Return",
"sorted",
"times",
"."
] | 50916b630eda07999dc6676528afe59fb2105615 | https://github.com/devemio/php-readable-timer/blob/50916b630eda07999dc6676528afe59fb2105615/src/TimerPool.php#L60-L67 |
19,179 | lmammino/e-foundation | src/Price/Model/PricedItemTrait.php | PricedItemTrait.calculateTotal | public function calculateTotal()
{
$this->calculateAdjustmentsTotal();
$this->total = ($this->quantity * $this->unitPrice) + $this->adjustmentsTotal;
if ($this->total < 0) {
$this->total = 0;
}
return $this;
} | php | public function calculateTotal()
{
$this->calculateAdjustmentsTotal();
$this->total = ($this->quantity * $this->unitPrice) + $this->adjustmentsTotal;
if ($this->total < 0) {
$this->total = 0;
}
return $this;
} | [
"public",
"function",
"calculateTotal",
"(",
")",
"{",
"$",
"this",
"->",
"calculateAdjustmentsTotal",
"(",
")",
";",
"$",
"this",
"->",
"total",
"=",
"(",
"$",
"this",
"->",
"quantity",
"*",
"$",
"this",
"->",
"unitPrice",
")",
"+",
"$",
"this",
"->",... | Calculates the total for the item
@return $this | [
"Calculates",
"the",
"total",
"for",
"the",
"item"
] | 198b7047d93eb11c9bc0c7ddf0bfa8229d42807a | https://github.com/lmammino/e-foundation/blob/198b7047d93eb11c9bc0c7ddf0bfa8229d42807a/src/Price/Model/PricedItemTrait.php#L153-L164 |
19,180 | lmammino/e-foundation | src/Price/Model/PricedItemsContainerTrait.php | PricedItemsContainerTrait.addItem | public function addItem(PricedItemInterface $item)
{
if ($this->hasItem($item)) {
return $this;
}
foreach ($this->items as $existingItem) {
if ($item->equals($existingItem)) {
$existingItem->merge($item, false);
$this->itemsTotal = nu... | php | public function addItem(PricedItemInterface $item)
{
if ($this->hasItem($item)) {
return $this;
}
foreach ($this->items as $existingItem) {
if ($item->equals($existingItem)) {
$existingItem->merge($item, false);
$this->itemsTotal = nu... | [
"public",
"function",
"addItem",
"(",
"PricedItemInterface",
"$",
"item",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasItem",
"(",
"$",
"item",
")",
")",
"{",
"return",
"$",
"this",
";",
"}",
"foreach",
"(",
"$",
"this",
"->",
"items",
"as",
"$",
"e... | Add an item
@param PricedItemInterface $item
@return $this | [
"Add",
"an",
"item"
] | 198b7047d93eb11c9bc0c7ddf0bfa8229d42807a | https://github.com/lmammino/e-foundation/blob/198b7047d93eb11c9bc0c7ddf0bfa8229d42807a/src/Price/Model/PricedItemsContainerTrait.php#L121-L145 |
19,181 | lmammino/e-foundation | src/Price/Model/PricedItemsContainerTrait.php | PricedItemsContainerTrait.removeItem | public function removeItem(PricedItemInterface $item)
{
if ($this->hasItem($item)) {
$item->setContainer(null);
$this->items->removeElement($item);
$this->itemsTotal = null;
$this->total = null;
}
return $this;
} | php | public function removeItem(PricedItemInterface $item)
{
if ($this->hasItem($item)) {
$item->setContainer(null);
$this->items->removeElement($item);
$this->itemsTotal = null;
$this->total = null;
}
return $this;
} | [
"public",
"function",
"removeItem",
"(",
"PricedItemInterface",
"$",
"item",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasItem",
"(",
"$",
"item",
")",
")",
"{",
"$",
"item",
"->",
"setContainer",
"(",
"null",
")",
";",
"$",
"this",
"->",
"items",
"->... | Remove a given item
@param PricedItemInterface $item
@return $this | [
"Remove",
"a",
"given",
"item"
] | 198b7047d93eb11c9bc0c7ddf0bfa8229d42807a | https://github.com/lmammino/e-foundation/blob/198b7047d93eb11c9bc0c7ddf0bfa8229d42807a/src/Price/Model/PricedItemsContainerTrait.php#L154-L165 |
19,182 | lmammino/e-foundation | src/Price/Model/PricedItemsContainerTrait.php | PricedItemsContainerTrait.calculateItemsTotal | public function calculateItemsTotal()
{
$itemsTotal = 0;
foreach ($this->items as $item) {
$itemsTotal += $item->getTotal();
}
$this->itemsTotal = $itemsTotal;
return $this;
} | php | public function calculateItemsTotal()
{
$itemsTotal = 0;
foreach ($this->items as $item) {
$itemsTotal += $item->getTotal();
}
$this->itemsTotal = $itemsTotal;
return $this;
} | [
"public",
"function",
"calculateItemsTotal",
"(",
")",
"{",
"$",
"itemsTotal",
"=",
"0",
";",
"foreach",
"(",
"$",
"this",
"->",
"items",
"as",
"$",
"item",
")",
"{",
"$",
"itemsTotal",
"+=",
"$",
"item",
"->",
"getTotal",
"(",
")",
";",
"}",
"$",
... | Calculate the total price for all the items
@return $this | [
"Calculate",
"the",
"total",
"price",
"for",
"all",
"the",
"items"
] | 198b7047d93eb11c9bc0c7ddf0bfa8229d42807a | https://github.com/lmammino/e-foundation/blob/198b7047d93eb11c9bc0c7ddf0bfa8229d42807a/src/Price/Model/PricedItemsContainerTrait.php#L196-L207 |
19,183 | lmammino/e-foundation | src/Price/Model/PricedItemsContainerTrait.php | PricedItemsContainerTrait.calculateTotal | public function calculateTotal()
{
$this->total = $this->getItemsTotal() + $this->getAdjustmentTotal();
if ($this->total < 0) {
$this->total = 0;
}
return $this;
} | php | public function calculateTotal()
{
$this->total = $this->getItemsTotal() + $this->getAdjustmentTotal();
if ($this->total < 0) {
$this->total = 0;
}
return $this;
} | [
"public",
"function",
"calculateTotal",
"(",
")",
"{",
"$",
"this",
"->",
"total",
"=",
"$",
"this",
"->",
"getItemsTotal",
"(",
")",
"+",
"$",
"this",
"->",
"getAdjustmentTotal",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"total",
"<",
"0",
")",
... | Calculate the total amount for the whole container
@return $this | [
"Calculate",
"the",
"total",
"amount",
"for",
"the",
"whole",
"container"
] | 198b7047d93eb11c9bc0c7ddf0bfa8229d42807a | https://github.com/lmammino/e-foundation/blob/198b7047d93eb11c9bc0c7ddf0bfa8229d42807a/src/Price/Model/PricedItemsContainerTrait.php#L241-L250 |
19,184 | forxer/tao | src/Tao/Controller/Controller.php | Controller.serve401 | public function serve401()
{
$response = new Response();
$response->setStatusCode(Response::HTTP_UNAUTHORIZED);
return $this->render('Errors/401', [], $response);
} | php | public function serve401()
{
$response = new Response();
$response->setStatusCode(Response::HTTP_UNAUTHORIZED);
return $this->render('Errors/401', [], $response);
} | [
"public",
"function",
"serve401",
"(",
")",
"{",
"$",
"response",
"=",
"new",
"Response",
"(",
")",
";",
"$",
"response",
"->",
"setStatusCode",
"(",
"Response",
"::",
"HTTP_UNAUTHORIZED",
")",
";",
"return",
"$",
"this",
"->",
"render",
"(",
"'Errors/401'... | Affichage page 401 | [
"Affichage",
"page",
"401"
] | b5e9109c244a29a72403ae6a58633ab96a67c660 | https://github.com/forxer/tao/blob/b5e9109c244a29a72403ae6a58633ab96a67c660/src/Tao/Controller/Controller.php#L147-L153 |
19,185 | forxer/tao | src/Tao/Controller/Controller.php | Controller.serve404 | public function serve404()
{
$response = new Response();
$response->setStatusCode(Response::HTTP_NOT_FOUND);
return $this->render('Errors/404', [], $response);
} | php | public function serve404()
{
$response = new Response();
$response->setStatusCode(Response::HTTP_NOT_FOUND);
return $this->render('Errors/404', [], $response);
} | [
"public",
"function",
"serve404",
"(",
")",
"{",
"$",
"response",
"=",
"new",
"Response",
"(",
")",
";",
"$",
"response",
"->",
"setStatusCode",
"(",
"Response",
"::",
"HTTP_NOT_FOUND",
")",
";",
"return",
"$",
"this",
"->",
"render",
"(",
"'Errors/404'",
... | Affichage page 404 | [
"Affichage",
"page",
"404"
] | b5e9109c244a29a72403ae6a58633ab96a67c660 | https://github.com/forxer/tao/blob/b5e9109c244a29a72403ae6a58633ab96a67c660/src/Tao/Controller/Controller.php#L158-L164 |
19,186 | forxer/tao | src/Tao/Controller/Controller.php | Controller.serve503 | public function serve503()
{
$response = new Response();
$response->setStatusCode(Response::HTTP_SERVICE_UNAVAILABLE);
$response->headers->set('Retry-After', 3600);
return $this->render('Errors/503', [], $response);
} | php | public function serve503()
{
$response = new Response();
$response->setStatusCode(Response::HTTP_SERVICE_UNAVAILABLE);
$response->headers->set('Retry-After', 3600);
return $this->render('Errors/503', [], $response);
} | [
"public",
"function",
"serve503",
"(",
")",
"{",
"$",
"response",
"=",
"new",
"Response",
"(",
")",
";",
"$",
"response",
"->",
"setStatusCode",
"(",
"Response",
"::",
"HTTP_SERVICE_UNAVAILABLE",
")",
";",
"$",
"response",
"->",
"headers",
"->",
"set",
"("... | Affichage page 503 | [
"Affichage",
"page",
"503"
] | b5e9109c244a29a72403ae6a58633ab96a67c660 | https://github.com/forxer/tao/blob/b5e9109c244a29a72403ae6a58633ab96a67c660/src/Tao/Controller/Controller.php#L169-L176 |
19,187 | forxer/tao | src/Tao/Controller/Controller.php | Controller.removeTrailingSlash | public function removeTrailingSlash()
{
$pathInfo = $this->app['request']->getPathInfo();
$requestUri = $this->app['request']->getRequestUri();
$url = str_replace($pathInfo, rtrim($pathInfo, ' /'), $requestUri);
return $this->redirect($url, Response::HTTP_MOVED_PERMANENTLY);
} | php | public function removeTrailingSlash()
{
$pathInfo = $this->app['request']->getPathInfo();
$requestUri = $this->app['request']->getRequestUri();
$url = str_replace($pathInfo, rtrim($pathInfo, ' /'), $requestUri);
return $this->redirect($url, Response::HTTP_MOVED_PERMANENTLY);
} | [
"public",
"function",
"removeTrailingSlash",
"(",
")",
"{",
"$",
"pathInfo",
"=",
"$",
"this",
"->",
"app",
"[",
"'request'",
"]",
"->",
"getPathInfo",
"(",
")",
";",
"$",
"requestUri",
"=",
"$",
"this",
"->",
"app",
"[",
"'request'",
"]",
"->",
"getRe... | Remove trailing slash and redirect permanent
@return \Symfony\Component\HttpFoundation\RedirectResponse | [
"Remove",
"trailing",
"slash",
"and",
"redirect",
"permanent"
] | b5e9109c244a29a72403ae6a58633ab96a67c660 | https://github.com/forxer/tao/blob/b5e9109c244a29a72403ae6a58633ab96a67c660/src/Tao/Controller/Controller.php#L183-L191 |
19,188 | ClanCats/Core | src/classes/CCView/Builder/CCFTemplate.php | CCView_Builder_CCFTemplate.repair_expression | public function repair_expression( $exp )
{
$commands = explode( ' ', $exp );
// filter empty ones
$commands = array_filter( $commands, function( $value )
{
return !is_null( $value );
});
// bracket starting command
if ( in_array( $commands[0], $this->bracket_starting_commands ) )
{
// each ... | php | public function repair_expression( $exp )
{
$commands = explode( ' ', $exp );
// filter empty ones
$commands = array_filter( $commands, function( $value )
{
return !is_null( $value );
});
// bracket starting command
if ( in_array( $commands[0], $this->bracket_starting_commands ) )
{
// each ... | [
"public",
"function",
"repair_expression",
"(",
"$",
"exp",
")",
"{",
"$",
"commands",
"=",
"explode",
"(",
"' '",
",",
"$",
"exp",
")",
";",
"// filter empty ones",
"$",
"commands",
"=",
"array_filter",
"(",
"$",
"commands",
",",
"function",
"(",
"$",
"... | Repair an expression | [
"Repair",
"an",
"expression"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCView/Builder/CCFTemplate.php#L102-L194 |
19,189 | ClanCats/Core | src/classes/CCView/Builder/CCFTemplate.php | CCView_Builder_CCFTemplate.compile_phptag | private function compile_phptag( $view )
{
// I hate this workaround
$that = $this;
return preg_replace_callback('/\{\%(.*?)\%\}/s', function( $match ) use( $that )
{
$expression = trim( $match[1] );
// repair it
$expression = $that->repair_expression( $expression );
return '<?php '.$expressio... | php | private function compile_phptag( $view )
{
// I hate this workaround
$that = $this;
return preg_replace_callback('/\{\%(.*?)\%\}/s', function( $match ) use( $that )
{
$expression = trim( $match[1] );
// repair it
$expression = $that->repair_expression( $expression );
return '<?php '.$expressio... | [
"private",
"function",
"compile_phptag",
"(",
"$",
"view",
")",
"{",
"// I hate this workaround",
"$",
"that",
"=",
"$",
"this",
";",
"return",
"preg_replace_callback",
"(",
"'/\\{\\%(.*?)\\%\\}/s'",
",",
"function",
"(",
"$",
"match",
")",
"use",
"(",
"$",
"t... | Search and replace for shortcuts of the php tag
@param string $view
@return void | [
"Search",
"and",
"replace",
"for",
"shortcuts",
"of",
"the",
"php",
"tag"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCView/Builder/CCFTemplate.php#L223-L237 |
19,190 | ClanCats/Core | src/classes/CCView/Builder/CCFTemplate.php | CCView_Builder_CCFTemplate.compile_arrays | private function compile_arrays( $view )
{
$tokens = token_get_all( $view );
$tags = array( 0 => '' );
$tag_index = 0;
$in_tag = false;
// parse all php tags out of the view
foreach ( $tokens as $token )
{
if ( is_array( $token ) )
{
if ( $token[0] === T_OPEN_TAG )
{
$in_tag = tru... | php | private function compile_arrays( $view )
{
$tokens = token_get_all( $view );
$tags = array( 0 => '' );
$tag_index = 0;
$in_tag = false;
// parse all php tags out of the view
foreach ( $tokens as $token )
{
if ( is_array( $token ) )
{
if ( $token[0] === T_OPEN_TAG )
{
$in_tag = tru... | [
"private",
"function",
"compile_arrays",
"(",
"$",
"view",
")",
"{",
"$",
"tokens",
"=",
"token_get_all",
"(",
"$",
"view",
")",
";",
"$",
"tags",
"=",
"array",
"(",
"0",
"=>",
"''",
")",
";",
"$",
"tag_index",
"=",
"0",
";",
"$",
"in_tag",
"=",
... | Search and replace vars with . array access
@param string $view
@return void | [
"Search",
"and",
"replace",
"vars",
"with",
".",
"array",
"access"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCView/Builder/CCFTemplate.php#L245-L342 |
19,191 | anexia-it/anexia-laravel-encryption | src/DatabaseEncryption.php | DatabaseEncryption.performInsert | protected function performInsert(Builder $query)
{
$encryptedFields = static::getEncryptedFields();
if (count($encryptedFields) && !$this->getEncryptKey()) {
throw new \RuntimeException("No encryption key specified");
}
$originalAttributes = $this->attributes;
for... | php | protected function performInsert(Builder $query)
{
$encryptedFields = static::getEncryptedFields();
if (count($encryptedFields) && !$this->getEncryptKey()) {
throw new \RuntimeException("No encryption key specified");
}
$originalAttributes = $this->attributes;
for... | [
"protected",
"function",
"performInsert",
"(",
"Builder",
"$",
"query",
")",
"{",
"$",
"encryptedFields",
"=",
"static",
"::",
"getEncryptedFields",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"encryptedFields",
")",
"&&",
"!",
"$",
"this",
"->",
"getEncr... | Perform insert with encryption
@param Builder $query
@return bool | [
"Perform",
"insert",
"with",
"encryption"
] | b7c72d99916ebca2d2cf2dbab1d4c0f84e383081 | https://github.com/anexia-it/anexia-laravel-encryption/blob/b7c72d99916ebca2d2cf2dbab1d4c0f84e383081/src/DatabaseEncryption.php#L59-L80 |
19,192 | anexia-it/anexia-laravel-encryption | src/DatabaseEncryption.php | DatabaseEncryption.newBaseQueryBuilder | protected function newBaseQueryBuilder()
{
$connection = $this->getConnection();
return new DatabaseEncryptionQueryBuilder(
$connection, $connection->getQueryGrammar(), $connection->getPostProcessor()
);
} | php | protected function newBaseQueryBuilder()
{
$connection = $this->getConnection();
return new DatabaseEncryptionQueryBuilder(
$connection, $connection->getQueryGrammar(), $connection->getPostProcessor()
);
} | [
"protected",
"function",
"newBaseQueryBuilder",
"(",
")",
"{",
"$",
"connection",
"=",
"$",
"this",
"->",
"getConnection",
"(",
")",
";",
"return",
"new",
"DatabaseEncryptionQueryBuilder",
"(",
"$",
"connection",
",",
"$",
"connection",
"->",
"getQueryGrammar",
... | Get a new query builder instance for the connection.
Use the package's DatabaseEncryptionQueryBuilder.
@return \Illuminate\Database\Query\Builder | [
"Get",
"a",
"new",
"query",
"builder",
"instance",
"for",
"the",
"connection",
".",
"Use",
"the",
"package",
"s",
"DatabaseEncryptionQueryBuilder",
"."
] | b7c72d99916ebca2d2cf2dbab1d4c0f84e383081 | https://github.com/anexia-it/anexia-laravel-encryption/blob/b7c72d99916ebca2d2cf2dbab1d4c0f84e383081/src/DatabaseEncryption.php#L116-L123 |
19,193 | ClanCats/Core | src/classes/CCOrbit.php | CCOrbit.installed_ships | public static function installed_ships()
{
$ships = static::$data->get( 'installed', array() );
foreach ( $ships as $key => $ship )
{
$ships[$key] = CCROOT.$ship;
}
return $ships;
} | php | public static function installed_ships()
{
$ships = static::$data->get( 'installed', array() );
foreach ( $ships as $key => $ship )
{
$ships[$key] = CCROOT.$ship;
}
return $ships;
} | [
"public",
"static",
"function",
"installed_ships",
"(",
")",
"{",
"$",
"ships",
"=",
"static",
"::",
"$",
"data",
"->",
"get",
"(",
"'installed'",
",",
"array",
"(",
")",
")",
";",
"foreach",
"(",
"$",
"ships",
"as",
"$",
"key",
"=>",
"$",
"ship",
... | return all installed ships | [
"return",
"all",
"installed",
"ships"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCOrbit.php#L85-L95 |
19,194 | ClanCats/Core | src/classes/CCOrbit.php | CCOrbit.enter | public static function enter( $path )
{
if ( !is_array( $path ) )
{
$path = array( $path );
}
foreach( $path as $ship )
{
// load ship at path
$ship = CCOrbit_Ship::create( $ship );
if ( array_key_exists( $ship->name, static::$ships ) )
{
throw new CCException( "CCOrbit::enter... | php | public static function enter( $path )
{
if ( !is_array( $path ) )
{
$path = array( $path );
}
foreach( $path as $ship )
{
// load ship at path
$ship = CCOrbit_Ship::create( $ship );
if ( array_key_exists( $ship->name, static::$ships ) )
{
throw new CCException( "CCOrbit::enter... | [
"public",
"static",
"function",
"enter",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"path",
")",
")",
"{",
"$",
"path",
"=",
"array",
"(",
"$",
"path",
")",
";",
"}",
"foreach",
"(",
"$",
"path",
"as",
"$",
"ship",
")",
... | Add a ship
this loads the ship loader file
@param string $path
@return bool | [
"Add",
"a",
"ship",
"this",
"loads",
"the",
"ship",
"loader",
"file"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCOrbit.php#L162-L188 |
19,195 | xinix-technology/norm | src/Norm/Model.php | Model.setId | public function setId($givenId)
{
if (!isset($this->id)) {
$this->id = $givenId;
}
return $this->id;
} | php | public function setId($givenId)
{
if (!isset($this->id)) {
$this->id = $givenId;
}
return $this->id;
} | [
"public",
"function",
"setId",
"(",
"$",
"givenId",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"id",
")",
")",
"{",
"$",
"this",
"->",
"id",
"=",
"$",
"givenId",
";",
"}",
"return",
"$",
"this",
"->",
"id",
";",
"}"
] | Set id of model.
@return int|string | [
"Set",
"id",
"of",
"model",
"."
] | c357f7d3a75d05324dd84b8f6a968a094c53d603 | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Model.php#L131-L137 |
19,196 | xinix-technology/norm | src/Norm/Model.php | Model.dump | public function dump()
{
$attributes = array();
if ($this->id) {
$attributes['$id'] = $this->id;
}
foreach ($this->attributes as $key => $value) {
$schema = $this->schema($key);
if (! empty($schema['transient'])) {
continue;
... | php | public function dump()
{
$attributes = array();
if ($this->id) {
$attributes['$id'] = $this->id;
}
foreach ($this->attributes as $key => $value) {
$schema = $this->schema($key);
if (! empty($schema['transient'])) {
continue;
... | [
"public",
"function",
"dump",
"(",
")",
"{",
"$",
"attributes",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"id",
")",
"{",
"$",
"attributes",
"[",
"'$id'",
"]",
"=",
"$",
"this",
"->",
"id",
";",
"}",
"foreach",
"(",
"$",
"this"... | Dump attributes raw data.
@method dump
@return array | [
"Dump",
"attributes",
"raw",
"data",
"."
] | c357f7d3a75d05324dd84b8f6a968a094c53d603 | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Model.php#L180-L199 |
19,197 | xinix-technology/norm | src/Norm/Model.php | Model.add | public function add($key, $value)
{
if (! isset($this->attributes[$key])) {
$this->attributes[$key] = array();
}
$this->attributes[$key][] = $value;
return $this;
} | php | public function add($key, $value)
{
if (! isset($this->attributes[$key])) {
$this->attributes[$key] = array();
}
$this->attributes[$key][] = $value;
return $this;
} | [
"public",
"function",
"add",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"attributes",
"[",
"$",
"key",
"]",
")",
")",
"{",
"$",
"this",
"->",
"attributes",
"[",
"$",
"key",
"]",
"=",
"array",
... | Add an attributes data.
@method add
@param string $key
@param mixed $value | [
"Add",
"an",
"attributes",
"data",
"."
] | c357f7d3a75d05324dd84b8f6a968a094c53d603 | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Model.php#L209-L218 |
19,198 | xinix-technology/norm | src/Norm/Model.php | Model.clear | public function clear($key = null)
{
if (func_num_args() === 0) {
$this->attributes = array();
} elseif ($key === '$id') {
throw new Exception('[Norm/Model] Restricting clear for $id.');
} else {
unset($this->attributes[$key]);
}
return $t... | php | public function clear($key = null)
{
if (func_num_args() === 0) {
$this->attributes = array();
} elseif ($key === '$id') {
throw new Exception('[Norm/Model] Restricting clear for $id.');
} else {
unset($this->attributes[$key]);
}
return $t... | [
"public",
"function",
"clear",
"(",
"$",
"key",
"=",
"null",
")",
"{",
"if",
"(",
"func_num_args",
"(",
")",
"===",
"0",
")",
"{",
"$",
"this",
"->",
"attributes",
"=",
"array",
"(",
")",
";",
"}",
"elseif",
"(",
"$",
"key",
"===",
"'$id'",
")",
... | Clear attributes value.
@method clear
@param string $key
@return \Norm\Model | [
"Clear",
"attributes",
"value",
"."
] | c357f7d3a75d05324dd84b8f6a968a094c53d603 | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Model.php#L252-L263 |
19,199 | xinix-technology/norm | src/Norm/Model.php | Model.sync | public function sync($attributes)
{
if (isset($attributes['$id'])) {
$this->state = static::STATE_ATTACHED;
$this->id = $attributes['$id'];
} else {
foreach ($this->schema() as $key => $field) {
if ($field->has('default')) {
$at... | php | public function sync($attributes)
{
if (isset($attributes['$id'])) {
$this->state = static::STATE_ATTACHED;
$this->id = $attributes['$id'];
} else {
foreach ($this->schema() as $key => $field) {
if ($field->has('default')) {
$at... | [
"public",
"function",
"sync",
"(",
"$",
"attributes",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"attributes",
"[",
"'$id'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"state",
"=",
"static",
"::",
"STATE_ATTACHED",
";",
"$",
"this",
"->",
"id",
"=",
"$",... | Sync the existing attributes with new values. After update or insert, this method used to modify the existing attributes.
@param array $attributes
@return void | [
"Sync",
"the",
"existing",
"attributes",
"with",
"new",
"values",
".",
"After",
"update",
"or",
"insert",
"this",
"method",
"used",
"to",
"modify",
"the",
"existing",
"attributes",
"."
] | c357f7d3a75d05324dd84b8f6a968a094c53d603 | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Model.php#L272-L289 |
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.